repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/WebhookController.js | ghost/core/core/server/services/stripe/WebhookController.js | const logging = require('@tryghost/logging');
module.exports = class WebhookController {
/**
* @param {object} deps
* @param {import('./WebhookManager')} deps.webhookManager
* @param {import('./services/webhook/CheckoutSessionEventService')} deps.checkoutSessionEventService
* @param {import('./... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/StripeService.js | ghost/core/core/server/services/stripe/StripeService.js | const WebhookManager = require('./WebhookManager');
const StripeAPI = require('./StripeAPI');
const StripeMigrations = require('./StripeMigrations');
const WebhookController = require('./WebhookController');
const DomainEvents = require('@tryghost/domain-events');
const {StripeLiveEnabledEvent, StripeLiveDisabledEvent}... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/StripeMigrations.js | ghost/core/core/server/services/stripe/StripeMigrations.js | const _ = require('lodash');
const logging = require('@tryghost/logging');
module.exports = class StripeMigrations {
/**
* StripeMigrations
*
* @param {object} params
*
* @param {any} params.models
* @param {import('./StripeAPI')} params.api
*/
constructor({
models,
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/services/webhook/InvoiceEventService.js | ghost/core/core/server/services/stripe/services/webhook/InvoiceEventService.js | const errors = require('@tryghost/errors');
// const _ = require('lodash');
/**
* Handles `invoice.payment_succeeded` webhook events
*
* The `invoice.payment_succeeded` event is triggered when a customer's payment succeeds.
*/
module.exports = class InvoiceEventService {
/**
* @param {object} deps
*... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/services/webhook/SubscriptionEventService.js | ghost/core/core/server/services/stripe/services/webhook/SubscriptionEventService.js | const errors = require('@tryghost/errors');
const _ = require('lodash');
/**
* Handles `customer.subscription.*` webhook events
*
* The `customer.subscription.*` events are triggered when a customer's subscription status changes.
*
* This service is responsible for handling these events and updating the subscri... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/services/webhook/CheckoutSessionEventService.js | ghost/core/core/server/services/stripe/services/webhook/CheckoutSessionEventService.js | const _ = require('lodash');
const errors = require('@tryghost/errors');
const logging = require('@tryghost/logging');
/**
* Handles `checkout.session.completed` webhook events
*
* The `checkout.session.completed` event is triggered when a customer completes a checkout session.
*
* It is triggered for the followi... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/events/index.js | ghost/core/core/server/services/stripe/events/index.js | module.exports = {
StripeLiveEnabledEvent: require('./StripeLiveEnabledEvent'),
StripeLiveDisabledEvent: require('./StripeLiveDisabledEvent')
};
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/events/StripeLiveEnabledEvent.js | ghost/core/core/server/services/stripe/events/StripeLiveEnabledEvent.js | /**
* @typedef {object} StripeLiveEnabledEventData
* @prop {string} message
*/
module.exports = class StripeLiveEnabledEvent {
/**
* @param {StripeLiveEnabledEventData} data
* @param {Date} timestamp
*/
constructor(data, timestamp) {
this.data = data;
this.timestamp = timestam... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stripe/events/StripeLiveDisabledEvent.js | ghost/core/core/server/services/stripe/events/StripeLiveDisabledEvent.js | /**
* @typedef {object} StripeLiveDisabledEventData
* @prop {string?} message
*/
module.exports = class StripeLiveDisabledEvent {
/**
* @param {StripeLiveDisabledEventData} data
* @param {Date} timestamp
*/
constructor(data, timestamp) {
this.data = data;
this.timestamp = time... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/MrrStatsService.js | ghost/core/core/server/services/stats/MrrStatsService.js | const moment = require('moment');
class MrrStatsService {
/**
* @param {object} deps
* @param {import('knex').Knex} deps.knex
**/
constructor({knex}) {
this.knex = knex;
}
/**
* Get the current total MRR, grouped by currency (ascending order)
* @returns {Promise<MrrByC... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/PostsStatsService.js | ghost/core/core/server/services/stats/PostsStatsService.js | const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
const urlUtils = require('../../../shared/url-utils');
// Import source normalization from ReferrersStatsService
const {normalizeSource} = require('./ReferrersStatsService');
// Import centralized date utilities
const {getDateBou... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | true |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/SubscriptionStatsService.js | ghost/core/core/server/services/stats/SubscriptionStatsService.js | const moment = require('moment');
class SubscriptionStatsService {
/**
* @param {object} deps
* @param {import('knex').Knex} deps.knex*/
constructor({knex}) {
this.knex = knex;
}
/**
* @returns {Promise<{data: SubscriptionHistoryEntry[]}>}
**/
async getSubscriptionHisto... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/index.js | ghost/core/core/server/services/stats/index.js | module.exports = require('./service');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/MembersStatsService.js | ghost/core/core/server/services/stats/MembersStatsService.js | const moment = require('moment');
class MembersStatsService {
/**
* @param {object} deps
* @param {import('knex').Knex} deps.knex*/
constructor({knex}) {
this.knex = knex;
}
/**
* Get the current total members grouped by status
* @returns {Promise<TotalMembersByStatus>}
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/service.js | ghost/core/core/server/services/stats/service.js | class StatsServiceWrapper {
constructor() {
this.api = null;
this.cache = null;
}
async init() {
if (this.api) {
// Already done
return;
}
const StatsService = require('./StatsService');
const db = require('../../data/db');
co... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/ContentStatsService.js | ghost/core/core/server/services/stats/ContentStatsService.js | const logging = require('@tryghost/logging');
/**
* @typedef {Object} TopContentDataItem
* @property {string} pathname - Page path
* @property {number} visits - Number of visits
* @property {string} [post_uuid] - Associated post UUID if available
* @property {string} [post_id] - Associated post ID if available
*... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/StatsService.js | ghost/core/core/server/services/stats/StatsService.js | const MRRService = require('./MrrStatsService');
const MembersService = require('./MembersStatsService');
const SubscriptionStatsService = require('./SubscriptionStatsService');
const ReferrersStatsService = require('./ReferrersStatsService');
const PostsStatsService = require('./PostsStatsService');
const ContentStats... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/ReferrersStatsService.js | ghost/core/core/server/services/stats/ReferrersStatsService.js | const moment = require('moment');
const errors = require('@tryghost/errors');
// Import centralized date utilities
const {getDateBoundaries, applyDateFilter} = require('./utils/date-utils');
// Source normalization mapping - consolidated from frontend apps
const SOURCE_NORMALIZATION_MAP = new Map([
// Social Medi... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/utils/tinybird.js | ghost/core/core/server/services/stats/utils/tinybird.js | const logging = require('@tryghost/logging');
/**
* Creates a configured Tinybird client
* @param {object} deps - Configuration and request dependencies
* @param {object} deps.config - Ghost configuration
* @param {object} deps.request - HTTP request client
* @param {object} deps.settingsCache - Settings cache cl... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/stats/utils/date-utils.js | ghost/core/core/server/services/stats/utils/date-utils.js | const moment = require('moment-timezone');
/**
* Get processed date boundaries with timezone support
* @param {Object} options - Options containing date and timezone info
* @param {string} [options.date_from] - Start date in YYYY-MM-DD format
* @param {string} [options.date_to] - End date in YYYY-MM-DD format
* @... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/permissions/index.js | ghost/core/core/server/services/permissions/index.js | // canThis(someUser).edit.posts([id]|[[ids]])
// canThis(someUser).edit.post(somePost|somePostId)
const models = require('../../models');
const actionsMap = require('./actions-map-cache');
const init = function init(options) {
options = options || {};
// Load all the permissions
return models.Permission... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/permissions/providers.js | ghost/core/core/server/services/permissions/providers.js | const _ = require('lodash');
const models = require('../../models');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
const messages = {
userNotFound: 'User not found',
apiKeyNotFound: 'API Key not found',
memberNotFound: 'Member not found'
};
module.exports = {
user: ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/permissions/parse-context.js | ghost/core/core/server/services/permissions/parse-context.js | /**
* Parse Context
*
* Utility function, to expand strings out into objects.
* @param {Object|String} context
* @return {{internal: boolean, user: integer|null, public: boolean, api_key: Object|null}}
*/
module.exports = function parseContext(context) {
const parsed = {
internal: false,
user:... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/permissions/actions-map-cache.js | ghost/core/core/server/services/permissions/actions-map-cache.js | // Based heavily on the settings cache
const _ = require('lodash');
let actionsMap = {};
module.exports = {
getAll: function getAll() {
return _.cloneDeep(actionsMap);
},
init: function init(perms) {
const seenActions = {};
actionsMap = {};
// Build a hash map of the acti... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/permissions/can-this.js | ghost/core/core/server/services/permissions/can-this.js | const _ = require('lodash');
const models = require('../../models');
const errors = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
const providers = require('./providers');
const parseContext = require('./parse-context');
const actionsMap = require('./actions-map-cache');
const {setIsRoles} = requir... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/InMemoryMilestoneRepository.js | ghost/core/core/server/services/milestones/InMemoryMilestoneRepository.js | /**
* @typedef {import('./Milestone')} Milestone
* @typedef {import('./MilestonesService').IMilestoneRepository} IMilestoneRepository
*/
/**
* @implements {IMilestoneRepository}
*/
module.exports = class InMemoryMilestoneRepository {
/** @type {Milestone[]} */
#store = [];
/** @type {Object.<string, ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/Milestone.js | ghost/core/core/server/services/milestones/Milestone.js | const ObjectID = require('bson-objectid').default;
const {ValidationError} = require('@tryghost/errors');
const MilestoneCreatedEvent = require('./MilestoneCreatedEvent');
module.exports = class Milestone {
/** @type {Array} */
events = [];
/**
* @type {ObjectID}
*/
#id;
get id() {
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/MilestoneCreatedEvent.js | ghost/core/core/server/services/milestones/MilestoneCreatedEvent.js | /**
* @typedef {object} MilestoneCreatedEventData
*/
module.exports = class MilestoneCreatedEvent {
/**
* @param {MilestoneCreatedEventData} data
* @param {Date} timestamp
*/
constructor(data, timestamp) {
this.data = data;
this.timestamp = timestamp;
}
/**
* @par... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/index.js | ghost/core/core/server/services/milestones/index.js | module.exports = require('./service');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/BookshelfMilestoneRepository.js | ghost/core/core/server/services/milestones/BookshelfMilestoneRepository.js | const Milestone = require('./Milestone');
/**
* @typedef {import('./MilestonesService').IMilestoneRepository} IMilestoneRepository
*/
/**
* @implements {IMilestoneRepository}
*/
module.exports = class BookshelfMilestoneRepository {
/** @type {Object} */
#MilestoneModel;
/** @type {import('@tryghost/d... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/service.js | ghost/core/core/server/services/milestones/service.js | const DomainEvents = require('@tryghost/domain-events');
const logging = require('@tryghost/logging');
const models = require('../../models');
const BookshelfMilestoneRepository = require('./BookshelfMilestoneRepository');
const JOB_TIMEOUT = 1000 * 60 * 60 * 24 * (Math.floor(Math.random() * 4)); // 0 - 4 days;
const... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/MilestonesService.js | ghost/core/core/server/services/milestones/MilestonesService.js | const Milestone = require('./Milestone');
/**
* @typedef {object} IMilestoneRepository
* @prop {(milestone: Milestone) => Promise<void>} save
* @prop {(arr: number, [currency]: string|null) => Promise<Milestone>} getByARR
* @prop {(count: number) => Promise<Milestone>} getByCount
* @prop {(type: 'arr'|'members', ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/milestones/MilestoneQueries.js | ghost/core/core/server/services/milestones/MilestoneQueries.js | module.exports = class MilestoneQueries {
#db;
/** @type {number} */
#minDaysSinceImported;
constructor(deps) {
this.#db = deps.db;
this.#minDaysSinceImported = deps.minDaysSinceImported;
}
/**
* @returns {Promise<number>}
*/
async getMembersCount() {
con... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/donations/index.js | ghost/core/core/server/services/donations/index.js | const DonationServiceWrapper = require('./DonationServiceWrapper');
module.exports = new DonationServiceWrapper();
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/donations/DonationServiceWrapper.js | ghost/core/core/server/services/donations/DonationServiceWrapper.js | const {DonationPaymentEvent: DonationPaymentEventModel} = require('../../models');
class DonationServiceWrapper {
repository;
init() {
if (this.repository) {
return;
}
const {DonationBookshelfRepository} = require('./DonationBookshelfRepository');
this.repository ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/Urls.js | ghost/core/core/server/services/url/Urls.js | const debug = require('@tryghost/debug')('services:url:urls');
const urlUtils = require('../../../shared/url-utils');
const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
// This emits its own url added/removed events
const events = require('../../lib/common/events');
/**
* @type... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/LocalFileCache.js | ghost/core/core/server/services/url/LocalFileCache.js | const fs = require('fs-extra');
const path = require('path');
class LocalFileCache {
/**
* @param {Object} options
* @param {String} options.storagePath - cached storage path
* @param {Boolean} options.writeDisabled - controls if cache can write
*/
constructor({storagePath, writeDisabled}) ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/Queue.js | ghost/core/core/server/services/url/Queue.js | const debug = require('@tryghost/debug')('services:url:queue');
const EventEmitter = require('events').EventEmitter;
const _ = require('lodash');
const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
/**
* ### Purpose of this queue
*
* Ghost fetches the resources as early as poss... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/Resources.js | ghost/core/core/server/services/url/Resources.js | const _ = require('lodash');
const debug = require('@tryghost/debug')('services:url:resources');
const DomainEvents = require('@tryghost/domain-events');
const {URLResourceUpdatedEvent} = require('../../../shared/events');
const Resource = require('./Resource');
const config = require('../../../shared/config');
const m... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/index.js | ghost/core/core/server/services/url/index.js | const config = require('../../../shared/config');
const LocalFileCache = require('./LocalFileCache');
const UrlService = require('./UrlService');
// NOTE: instead of a path we could give UrlService a "data-resolver" of some sort
// so it doesn't have to contain the logic to read data at all. This would be
// ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/Resource.js | ghost/core/core/server/services/url/Resource.js | const EventEmitter = require('events').EventEmitter;
const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
/**
* Resource cache.
*/
class Resource extends EventEmitter {
/**
* @param {('posts'|'pages'|'tags'|'authors')} type - of the resource
* @param {Object} obj - ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/config.js | ghost/core/core/server/services/url/config.js | /*
* These are the default resources and filters.
* They contain minimum filters for public accessibility of resources.
*/
// TODO: switch exclude lists to include lists to make this more explicit
module.exports = [
{
type: 'posts',
modelOptions: {
modelName: 'Post',
filt... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/UrlGenerator.js | ghost/core/core/server/services/url/UrlGenerator.js | const nql = require('@tryghost/nql');
const debug = require('@tryghost/debug')('services:url:generator');
const localUtils = require('../../../shared/url-utils');
// @TODO: merge with filter plugin
const EXPANSIONS = [{
key: 'author',
replacement: 'authors.slug'
}, {
key: 'tags',
replacement: 'tags.slu... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/url/UrlService.js | ghost/core/core/server/services/url/UrlService.js | const debug = require('@tryghost/debug')('services:url:service');
const _ = require('lodash');
const errors = require('@tryghost/errors');
const logging = require('@tryghost/logging');
const metrics = require('@tryghost/metrics');
const labs = require('../../../shared/labs');
const UrlGenerator = require('./UrlGenerato... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/posts/posts-service.js | ghost/core/core/server/services/posts/posts-service.js | const PostsService = require('./PostsService');
const PostsExporter = require('./PostsExporter');
const url = require('../../../server/api/endpoints/utils/serializers/output/utils/url');
/**
* @returns {InstanceType<PostsService>} instance of the PostsService
*/
const getPostServiceInstance = () => {
const urlUt... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/posts/post-scheduling-service.js | ghost/core/core/server/services/posts/post-scheduling-service.js | const _ = require('lodash');
const errors = require('@tryghost/errors');
const moment = require('moment');
const config = require('../../../shared/config');
const urlUtils = require('../../../shared/url-utils');
const api = require('../../api').endpoints;
const messages = {
jobNotFound: 'Job not found.',
jobPu... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/posts/PostsService.js | ghost/core/core/server/services/posts/PostsService.js | const nql = require('@tryghost/nql');
const {BadRequestError} = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const ObjectId = require('bson-objectid').default;
const pick = require('lodash/pick');
const DomainEvents = require('@tryghost/domain-events');
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/posts/PostsExporter.js | ghost/core/core/server/services/posts/PostsExporter.js | const nql = require('@tryghost/nql');
const logging = require('@tryghost/logging');
class PostsExporter {
#models;
#getPostUrl;
#settingsCache;
#settingsHelpers;
/**
* @param {Object} dependencies
* @param {Object} dependencies.models
* @param {Object} dependencies.models.Post
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/posts/stats/PostStats.js | ghost/core/core/server/services/posts/stats/PostStats.js | const db = require('../../../data/db');
class PostStats {
#db;
constructor() {
this.#db = db;
}
/**
* Returns the most recently `published_at` post that was published or sent
* via email
*/
async getMostRecentlyPublishedPostDate() {
const result = await this.#db.knex... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/mentions-email-report/index.js | ghost/core/core/server/services/mentions-email-report/index.js | module.exports = require('./service');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/mentions-email-report/service.js | ghost/core/core/server/services/mentions-email-report/service.js | const MentionEmailReportJob = require('./MentionEmailReportJob');
/**
* @typedef {MentionEmailReportJob.MentionReport} MentionReport
* @typedef {MentionEmailReportJob.MentionReportRecipient} MentionReportRecipient
*/
let initialised = false;
module.exports = {
async init() {
if (initialised) {
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/mentions-email-report/MentionEmailReportJob.js | ghost/core/core/server/services/mentions-email-report/MentionEmailReportJob.js | module.exports = class MentionEmailReportJob {
/** @type {IMentionReportGenerator} */
#mentionReportGenerator;
/** @type {IMentionReportRecipientRepository} */
#mentionReportRecipientRepository;
/** @type {IMentionReportEmailView} */
#mentionReportEmailView;
/** @type {IMentionReportHisto... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/mentions-email-report/job.js | ghost/core/core/server/services/mentions-email-report/job.js | const {parentPort} = require('worker_threads');
const StartMentionEmailReportJob = require('./StartMentionEmailReportJob');
if (parentPort) {
parentPort.postMessage({
event: {
type: StartMentionEmailReportJob.name
}
});
parentPort.postMessage('done');
}
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/mentions-email-report/StartMentionEmailReportJob.js | ghost/core/core/server/services/mentions-email-report/StartMentionEmailReportJob.js | module.exports = class StartMentionEmailReportJob {
/**
* @param {Date} timestamp
*/
constructor(timestamp) {
this.data = null;
this.timestamp = timestamp;
}
/**
* @param {Date} [timestamp]
*/
static create(data, timestamp) {
return new StartMentionEmailR... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/custom-redirects/CustomRedirectsAPI.js | ghost/core/core/server/services/custom-redirects/CustomRedirectsAPI.js | const fs = require('fs-extra');
const path = require('path');
const yaml = require('js-yaml');
const logging = require('@tryghost/logging');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const messages = {
jsonParse: 'Could not parse JSON: {context}.',
yamlParse: 'Could not... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/custom-redirects/index.js | ghost/core/core/server/services/custom-redirects/index.js | const config = require('../../../shared/config');
const urlUtils = require('../../../shared/url-utils');
const DynamicRedirectManager = require('../lib/DynamicRedirectManager');
const CustomRedirectsAPI = require('./CustomRedirectsAPI');
const validation = require('./validation');
const {getBackupRedirectsFilePath} = ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/custom-redirects/validation.js | ghost/core/core/server/services/custom-redirects/validation.js | const _ = require('lodash');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const messages = {
redirectsWrongFormat: 'Incorrect redirects file format.',
invalidRedirectsFromRegex: 'Incorrect RegEx in redirects file.',
redirectsHelp: 'https://ghost.org/docs/themes/routing/... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/custom-redirects/utils.js | ghost/core/core/server/services/custom-redirects/utils.js | const path = require('path');
const moment = require('moment-timezone');
/**
* @param {string} filePath
* @returns {string}
*/
const getBackupRedirectsFilePath = (filePath) => {
const {dir, name, ext} = path.parse(filePath);
return path.join(dir, `${name}-${moment().format('YYYY-MM-DD-HH-mm-ss')}${ext}`);
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/explore-ping/index.js | ghost/core/core/server/services/explore-ping/index.js | const ExplorePingService = require('./ExplorePingService');
const config = require('../../../shared/config');
const labs = require('../../../shared/labs');
const logging = require('@tryghost/logging');
const ghostVersion = require('@tryghost/version');
const request = require('@tryghost/request');
const settingsCache =... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/explore-ping/ExplorePingService.js | ghost/core/core/server/services/explore-ping/ExplorePingService.js | module.exports = class ExplorePingService {
/**
* @param {object} deps
* @param {{get: (string) => string}} deps.settingsCache
* @param {object} deps.config
* @param {object} deps.labs
* @param {object} deps.logging
* @param {object} deps.ghostVersion
* @param {object} deps.reques... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/webhooks/index.js | ghost/core/core/server/services/webhooks/index.js | module.exports = {
get listen() {
return require('./listen');
}
};
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/webhooks/webhooks-service.js | ghost/core/core/server/services/webhooks/webhooks-service.js | const {ValidationError} = require('@tryghost/errors');
const tpl = require('@tryghost/tpl');
const messages = {
webhookAlreadyExists: 'Target URL has already been used for this event.',
nonExistingIntegrationIdProvided: {
message: `Validation failed for '{key}'.`,
context: `'integration_id' val... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/webhooks/payload.js | ghost/core/core/server/services/webhooks/payload.js | const serialize = require('./serialize');
module.exports = (event, model) => {
const payload = {};
if (model) {
return serialize(event, model)
.then((result) => {
Object.assign(payload, result);
return payload;
});
}
return Promise.reso... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/webhooks/serialize.js | ghost/core/core/server/services/webhooks/serialize.js | module.exports = (event, model) => {
const _ = require('lodash');
const {sequence} = require('@tryghost/promise');
const api = require('../../api').endpoints;
const apiFramework = require('@tryghost/api-framework');
const resourceName = event.match(/(\w+)\./)[1];
const docName = `${resourceName... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/webhooks/WebhookTrigger.js | ghost/core/core/server/services/webhooks/WebhookTrigger.js | const debug = require('@tryghost/debug')('services:webhooks:trigger');
const logging = require('@tryghost/logging');
const ghostVersion = require('@tryghost/version');
const crypto = require('crypto');
class WebhookTrigger {
/**
*
* @param {Object} options
* @param {Object} options.models - Ghost mo... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/webhooks/listen.js | ghost/core/core/server/services/webhooks/listen.js | const _ = require('lodash');
const limitService = require('../../services/limits');
const WebhookTrigger = require('./WebhookTrigger');
const models = require('../../models');
const payload = require('./payload');
// The webhook system is fundamentally built on top of our model event system
const events = require('../... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/recommendations/RecommendationServiceWrapper.js | ghost/core/core/server/services/recommendations/RecommendationServiceWrapper.js | const DomainEvents = require('@tryghost/domain-events');
const MentionCreatedEvent = require('../mentions/MentionCreatedEvent');
const logging = require('@tryghost/logging');
class RecommendationServiceWrapper {
/**
* @type {import('./service').RecommendationRepository}
*/
repository;
/**
*... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/recommendations/index.js | ghost/core/core/server/services/recommendations/index.js | const RecommendationServiceWrapper = require('./RecommendationServiceWrapper');
module.exports = new RecommendationServiceWrapper();
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/recommendations/RecommendationEnablerService.js | ghost/core/core/server/services/recommendations/RecommendationEnablerService.js | module.exports = class RecommendationEnablerService {
/** @type {import('../settings/SettingsBREADService')} */
#settingsService;
/**
* @param {object} deps
* @param {import('../settings/SettingsBREADService')} deps.settingsService
*/
constructor(deps) {
this.#settingsService = d... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/member-welcome-emails/index.js | ghost/core/core/server/services/member-welcome-emails/index.js | const service = require('./service');
const constants = require('./constants');
module.exports = {
service,
...constants
};
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/member-welcome-emails/service.js | ghost/core/core/server/services/member-welcome-emails/service.js | const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
const urlUtils = require('../../../shared/url-utils');
const settingsCache = require('../../../shared/settings-cache');
const config = require('../../../shared/config');
const emailAddressService = require('../email-address');
con... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/member-welcome-emails/constants.js | ghost/core/core/server/services/member-welcome-emails/constants.js | const MEMBER_WELCOME_EMAIL_LOG_KEY = '[MEMBER-WELCOME-EMAIL]';
const MEMBER_WELCOME_EMAIL_SLUGS = {
free: 'member-welcome-email-free',
paid: 'member-welcome-email-paid'
};
const MESSAGES = {
NO_MEMBER_WELCOME_EMAIL: 'No member welcome email found',
INVALID_LEXICAL_STRUCTURE: 'Member welcome email has ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/member-welcome-emails/MemberWelcomeEmailRenderer.js | ghost/core/core/server/services/member-welcome-emails/MemberWelcomeEmailRenderer.js | const fs = require('fs');
const path = require('path');
const htmlToPlaintext = require('@tryghost/html-to-plaintext');
const juice = require('juice');
const lexicalLib = require('../../lib/lexical');
const errors = require('@tryghost/errors');
const {MESSAGES} = require('./constants');
class MemberWelcomeEmailRendere... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/public-config/index.js | ghost/core/core/server/services/public-config/index.js | module.exports = {
get config() {
return require('./config')();
},
get site() {
return require('./site')();
}
};
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/public-config/site.js | ghost/core/core/server/services/public-config/site.js | const ghostVersion = require('@tryghost/version');
const settingsCache = require('../../../shared/settings-cache');
const config = require('../../../shared/config');
const urlUtils = require('../../../shared/url-utils');
module.exports = function getSiteProperties() {
const siteProperties = {
title: settin... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/public-config/config.js | ghost/core/core/server/services/public-config/config.js | const {isPlainObject} = require('lodash');
const config = require('../../../shared/config');
const settingsCache = require('../../../shared/settings-cache');
const labs = require('../../../shared/labs');
const databaseInfo = require('../../data/db/info');
const ghostVersion = require('@tryghost/version');
module.expor... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/CommentsServiceEmails.js | ghost/core/core/server/services/comments/CommentsServiceEmails.js | const moment = require('moment');
const htmlToPlaintext = require('@tryghost/html-to-plaintext');
const emailService = require('../email-service');
const CommentsServiceEmailRenderer = require('./CommentsServiceEmailRenderer');
const {t} = require('../i18n');
class CommentsServiceEmails {
constructor({config, logg... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/CommentsService.js | ghost/core/core/server/services/comments/CommentsService.js | const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const {MemberCommentEvent} = require('../../../shared/events');
const DomainEvents = require('@tryghost/domain-events');
const messages = {
commentNotFound: 'Comment could not be found',
memberNotFound: 'Unable to find member',
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/CommentsStatsService.js | ghost/core/core/server/services/comments/CommentsStatsService.js | module.exports = class CommentsStatsService {
constructor(deps) {
this.db = deps.db;
}
/**
* @param {string[]} ids - List of post ids to fetch counts for
* @returns {Promise<Object<string, number>>}
*/
async getCountsByPost(ids) {
const results = await this.db.knex('comme... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/index.js | ghost/core/core/server/services/comments/index.js | class CommentsServiceWrapper {
init() {
const CommentsService = require('./CommentsService');
const CommentsController = require('./CommentsController');
const CommentsStats = require('./CommentsStatsService');
const config = require('../../../shared/config');
const logging ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/CommentsServiceEmailRenderer.js | ghost/core/core/server/services/comments/CommentsServiceEmailRenderer.js | const {promises: fs} = require('fs');
const path = require('path');
class CommentsServiceEmailRenderer {
constructor({t}) {
this.t = t;
this.Handlebars = require('handlebars').create();
this.Handlebars.registerHelper('t', function (key, options) {
let hash = options?.hash;
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/CommentsController.js | ghost/core/core/server/services/comments/CommentsController.js | const _ = require('lodash');
const errors = require('@tryghost/errors');
const nql = require('@tryghost/nql');
const {splitFilter} = require('@tryghost/mongo-utils');
/**
* @typedef {import('@tryghost/api-framework').Frame} Frame
*/
const {MethodNotAllowedError} = require('@tryghost/errors');
const tpl = require('@... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/email-templates/new-comment.txt.js | ghost/core/core/server/services/comments/email-templates/new-comment.txt.js | module.exports = function (data) {
// Be careful when you indent the email, because whitespaces are visible in emails!
return `
Hey there,
Someone just posted a comment on your post "${data.postTitle}"
${data.postUrl}#ghost-comments-root
---
Sent to ${data.toEmail} from ${data.siteDomain}.
You can manage yo... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/email-templates/new-comment-reply.txt.js | ghost/core/core/server/services/comments/email-templates/new-comment-reply.txt.js | module.exports = function (data, t) {
// Be careful when you indent the email, because whitespaces are visible in emails!
return `${t('Hey there,')}
${t('Someone just replied to your comment on {postTitle}.', {postTitle: data.postTitle, interpolation: {escapeValue: false}})}
${data.postUrl}#ghost-comments-roo... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/comments/email-templates/report.txt.js | ghost/core/core/server/services/comments/email-templates/report.txt.js | module.exports = function (data) {
// Be careful when you indent the email, because whitespaces are visible in emails!
return `Hey there,
${data.reporter} has reported the comment below on ${data.postTitle}. This comment will remain visible until you choose to remove it, which can be done directly on the post.... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/activate.js | ghost/core/core/server/services/themes/activate.js | const debug = require('@tryghost/debug')('themes');
const errors = require('@tryghost/errors');
const logging = require('@tryghost/logging');
const tpl = require('@tryghost/tpl');
const activator = require('./activation-bridge');
const list = require('./list');
const themeLoader = require('./loader');
const validate ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/storage.js | ghost/core/core/server/services/themes/storage.js | const debug = require('@tryghost/debug')('themes');
const fs = require('fs-extra');
const ObjectID = require('bson-objectid').default;
const tpl = require('@tryghost/tpl');
const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');
const validate = require('./validate');
const list = re... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/list.js | ghost/core/core/server/services/themes/list.js | /**
* Store themes after loading them from the file system
*/
const _ = require('lodash');
let themeListCache = {};
module.exports = {
get: function get(key) {
return themeListCache[key];
},
getAll: function getAll() {
return themeListCache;
},
set: function set(key, theme) {
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/activation-bridge.js | ghost/core/core/server/services/themes/activation-bridge.js | const debug = require('@tryghost/debug')('themes');
const bridge = require('../../../bridge');
const customThemeSettings = require('../custom-theme-settings');
/**
* These helper methods mean that the bridge is only required in one place
* And also adds a little debug statement, which is very handy when debugging th... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/ThemeStorage.js | ghost/core/core/server/services/themes/ThemeStorage.js | const fs = require('fs-extra');
const os = require('os');
const path = require('path');
const config = require('../../../shared/config');
const security = require('@tryghost/security');
const {compress} = require('@tryghost/zip');
const LocalStorageBase = require('../../adapters/storage/LocalStorageBase');
/**
* @TOD... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/index.js | ghost/core/core/server/services/themes/index.js | const activate = require('./activate');
const themeLoader = require('./loader');
const storage = require('./storage');
const getJSON = require('./to-json');
const installer = require('./installer');
const validate = require('./validate');
const settingsCache = require('../../../shared/settings-cache');
const config = r... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/to-json.js | ghost/core/core/server/services/themes/to-json.js | const _ = require('lodash');
const themeList = require('./list');
const bridge = require('../../../bridge');
const packageJSON = require('../../lib/package-json');
const settingsCache = require('../../../shared/settings-cache');
/**
*
* Provides a JSON object which can be returned via the API.
* You can either requ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/loader.js | ghost/core/core/server/services/themes/loader.js | const debug = require('@tryghost/debug')('themes');
const packageJSON = require('../../lib/package-json');
const config = require('../../../shared/config');
const themeList = require('./list');
const loadAllThemes = async function loadAllThemes() {
const themes = await packageJSON.readPackages(config.getContentPa... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/installer.js | ghost/core/core/server/services/themes/installer.js | const fs = require('fs-extra');
const os = require('os');
const path = require('path');
const security = require('@tryghost/security');
const request = require('@tryghost/request');
const errors = require('@tryghost/errors');
const limitService = require('../../services/limits');
const {setFromZip} = require('./storage... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/themes/validate.js | ghost/core/core/server/services/themes/validate.js | const debug = require('@tryghost/debug')('themes');
const _ = require('lodash');
const fs = require('fs-extra');
const config = require('../../../shared/config');
const labs = require('../../../shared/labs');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');
const adapterManager = requir... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/slack-notifications/index.js | ghost/core/core/server/services/slack-notifications/index.js | module.exports = require('./service');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/slack-notifications/service.js | ghost/core/core/server/services/slack-notifications/service.js | const DomainEvents = require('@tryghost/domain-events');
const config = require('../../../shared/config');
const logging = require('@tryghost/logging');
class SlackNotificationsServiceWrapper {
/** @type {import('./SlackNotificationsService')} */
#api;
/**
*
* @param {object} deps
* @param ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/slack-notifications/SlackNotificationsService.js | ghost/core/core/server/services/slack-notifications/SlackNotificationsService.js | const MilestoneCreatedEvent = require('../milestones/MilestoneCreatedEvent');
/**
* @typedef {import('../milestones/Milestone')} Milestone
*/
/**
* @typedef {object} meta
* @prop {'import'|'email'} [reason]
* @prop {number} [currentValue]
*/
/**
* @typedef {import('@tryghost/logging')} logging
*/
/**
* @ty... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/slack-notifications/SlackNotifications.js | ghost/core/core/server/services/slack-notifications/SlackNotifications.js | const got = require('got');
const validator = require('@tryghost/validator');
const errors = require('@tryghost/errors');
const ghostVersion = require('@tryghost/version');
const moment = require('moment');
/**
* @typedef {URL} webhookUrl
*/
/**
* @typedef {string} siteUrl
*/
/**
* @typedef {import('@tryghost/l... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/services/member-attribution/MemberAttributionService.js | ghost/core/core/server/services/member-attribution/MemberAttributionService.js | const UrlHistory = require('./UrlHistory');
class MemberAttributionService {
/**
*
* @param {Object} deps
* @param {Object} deps.attributionBuilder
* @param {Object} deps.models
* @param {Object} deps.models.MemberCreatedEvent
* @param {Object} deps.models.SubscriptionCreatedEvent
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.