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/data/migrations/versions/5.65/2023-09-22-06-42-15-truncate-stale-built-in-collections-posts.js
ghost/core/core/server/data/migrations/versions/5.65/2023-09-22-06-42-15-truncate-stale-built-in-collections-posts.js
const logging = require('@tryghost/logging'); const {createNonTransactionalMigration} = require('../../utils'); module.exports = createNonTransactionalMigration( async function up(knex) { logging.info('Clearing collections_posts table'); await knex('collections_posts').truncate(); }, async ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.42/2023-04-04-07-03-add-portal-terms-settings.js
ghost/core/core/server/data/migrations/versions/5.42/2023-04-04-07-03-add-portal-terms-settings.js
const {combineTransactionalMigrations, addSetting} = require('../../utils'); module.exports = combineTransactionalMigrations( addSetting({ key: 'portal_signup_terms_html', value: null, type: 'string', group: 'portal' }), addSetting({ key: 'portal_signup_checkbox_requ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/exporter/index.js
ghost/core/core/server/data/exporter/index.js
const {BACKUP_TABLES, TABLES_ALLOWLIST} = require('./table-lists'); module.exports = { doExport: require('./exporter'), fileName: require('./export-filename'), BACKUP_TABLES, TABLES_ALLOWLIST };
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/exporter/export-filename.js
ghost/core/core/server/data/exporter/export-filename.js
const _ = require('lodash'); const logging = require('@tryghost/logging'); const errors = require('@tryghost/errors'); const security = require('@tryghost/security'); const models = require('../../models'); const modelOptions = {context: {internal: true}}; const exportFileName = async function exportFileName(options)...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/exporter/exporter.js
ghost/core/core/server/data/exporter/exporter.js
const _ = require('lodash'); const db = require('../../data/db'); const commands = require('../schema').commands; const ghostVersion = require('@tryghost/version'); const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const {sequence} = require('@tryghost/promise'); const messages = { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/exporter/table-lists.js
ghost/core/core/server/data/exporter/table-lists.js
// NOTE: these tables can be optionally included to have full db-like export const BACKUP_TABLES = [ 'actions', 'api_keys', 'automated_emails', 'brute', 'donation_payment_events', 'emails', 'integrations', 'invites', 'labels', 'members', 'members_labels', 'members_product...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/DataGenerator.js
ghost/core/core/server/data/seeders/DataGenerator.js
const path = require('path'); const fs = require('fs/promises'); const JsonImporter = require('./utils/JsonImporter'); const {getProcessRoot} = require('@tryghost/root-utils'); const topologicalSort = require('./utils/topological-sort'); const {faker} = require('@faker-js/faker'); const {faker: americanFaker} = require...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/NewslettersImporter.js
ghost/core/core/server/data/seeders/importers/NewslettersImporter.js
const TableImporter = require('./TableImporter'); const {blogStartDate} = require('../utils/blog-info'); const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); class NewslettersImporter extends TableImporter { static table = 'newsletters'; static dependencies = []; defa...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/EmailRecipientsImporter.js
ghost/core/core/server/data/seeders/importers/EmailRecipientsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const generateEvents = require('../utils/event-generator'); const dateToDatabaseString = require('../utils/database-date'); const debug = require('@tryghost/debug')('EmailRecipientsImporter'); const emailStatus = { delive...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersLoginEventsImporter.js
ghost/core/core/server/data/seeders/importers/MembersLoginEventsImporter.js
const TableImporter = require('./TableImporter'); const {luck} = require('../utils/random'); const generateEvents = require('../utils/event-generator'); const dateToDatabaseString = require('../utils/database-date'); class MembersLoginEventsImporter extends TableImporter { static table = 'members_login_events'; ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersSubscriptionCreatedEventsImporter.js
ghost/core/core/server/data/seeders/importers/MembersSubscriptionCreatedEventsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); class MembersSubscriptionCreatedEventsImporter extends TableImporter { static table = 'members_subscription_created_events'; static dependencies = ['members_stripe_customers'...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/LabelsImporter.js
ghost/core/core/server/data/seeders/importers/LabelsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); const {blogStartDate} = require('../utils/blog-info'); const dateToDatabaseString = require('../utils/database-date'); class LabelsImporter extends TableImporter { static tab...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/TableImporter.js
ghost/core/core/server/data/seeders/importers/TableImporter.js
const debug = require('@tryghost/debug')('TableImporter'); const dateToDatabaseString = require('../utils/database-date'); const path = require('path'); const createCsvWriter = require('csv-writer').createObjectCsvWriter; const fs = require('fs'); const {luck} = require('../utils/random'); const os = require('os'); con...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/PostsTagsImporter.js
ghost/core/core/server/data/seeders/importers/PostsTagsImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); class PostsTagsImporter extends TableImporter { static table = 'posts_tags'; static dependencies = ['posts', 'tags']; constructor(knex, transaction) { super(PostsTagsImporter.table, knex, transaction); ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/PostsImporter.js
ghost/core/core/server/data/seeders/importers/PostsImporter.js
const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); const {luck} = require('../utils/random'); const TableImporter = require('./TableImporter'); const dateToDatabaseString = require('../utils/database-date'); class PostsImporter extends TableImporter { static table = 'posts';...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersSubscribeEventsImporter.js
ghost/core/core/server/data/seeders/importers/MembersSubscribeEventsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); const dateToDatabaseString = require('../utils/database-date'); class MembersSubscribeEventsImporter extends TableImporter { static table = 'members_subscribe_events'; static...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/RecommendationsImporter.js
ghost/core/core/server/data/seeders/importers/RecommendationsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); function capitalize(str) { return str.charAt(0).toUpperCase() + str.slice(1); } class RecommendationsImporter extends TableImporter { static table = 'recommendations'; static dependencies = []; defaultQuantit...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/TagsImporter.js
ghost/core/core/server/data/seeders/importers/TagsImporter.js
const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); const TableImporter = require('./TableImporter'); const dateToDatabaseString = require('../utils/database-date'); class TagsImporter extends TableImporter { static table = 'tags'; static dependencies = ['users']; def...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/WebMentionsImporter.js
ghost/core/core/server/data/seeders/importers/WebMentionsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const dateToDatabaseString = require('../utils/database-date'); class WebMentionsImporter extends TableImporter { static table = 'mentions'; static dependencies = []; defaultQuantity = 23; constructor(knex, t...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/RolesUsersImporter.js
ghost/core/core/server/data/seeders/importers/RolesUsersImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); class RolesUsersImporter extends TableImporter { static table = 'roles_users'; // No roles imorter, since roles are statically defined in database static dependencies = ['users']; constructor(knex, transactio...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersLabelsImporter.js
ghost/core/core/server/data/seeders/importers/MembersLabelsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); class MembersLabelsImporter extends TableImporter { static table = 'members_labels'; static dependencies = ['labels', 'members']; constructor(knex, transaction, {labels}...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/EmailsImporter.js
ghost/core/core/server/data/seeders/importers/EmailsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const generateEvents = require('../utils/event-generator'); const {luck} = require('../utils/random'); const dateToDatabaseString = require('../utils/database-date'); class EmailsImporter extends TableImporter { static ta...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/PostsAuthorsImporter.js
ghost/core/core/server/data/seeders/importers/PostsAuthorsImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); class PostsAuthorsImporter extends TableImporter { static table = 'posts_authors'; static dependencies = ['posts', 'users']; constructor(knex, transaction) { super(PostsAuthorsImporter.table, knex, transa...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/CommentsImporter.js
ghost/core/core/server/data/seeders/importers/CommentsImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); const {luck} = require('../utils/random'); const generateEvents = require('../utils/event-generator'); const dateToDatabaseString = require('../utils/database-date'); class CommentsImporter extends TableImporter { static ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/PostsProductsImporter.js
ghost/core/core/server/data/seeders/importers/PostsProductsImporter.js
const TableImporter = require('./TableImporter'); class PostsProductsImporter extends TableImporter { static table = 'posts_products'; static dependencies = ['posts', 'products']; constructor(knex, transaction) { super(PostsProductsImporter.table, knex, transaction); } async import(quanti...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/OffersImporter.js
ghost/core/core/server/data/seeders/importers/OffersImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); const {blogStartDate} = require('../utils/blog-info'); const dateToDatabaseString = require('../utils/database-date'); class OffersImporter extends TableImporter { static tab...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/index.js
ghost/core/core/server/data/seeders/importers/index.js
module.exports = [ require('./NewslettersImporter'), require('./PostsImporter'), require('./UsersImporter'), require('./TagsImporter'), require('./ProductsImporter'), require('./MembersImporter'), require('./BenefitsImporter'), require('./WebMentionsImporter'), require('./PostsAuthor...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersNewslettersImporter.js
ghost/core/core/server/data/seeders/importers/MembersNewslettersImporter.js
const TableImporter = require('./TableImporter'); class MembersNewslettersImporter extends TableImporter { static table = 'members_newsletters'; static dependencies = ['members_subscribe_events']; constructor(knex, transaction) { super(MembersNewslettersImporter.table, knex, transaction); } ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersStripeCustomersSubscriptionsImporter.js
ghost/core/core/server/data/seeders/importers/MembersStripeCustomersSubscriptionsImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); const dateToDatabaseString = require('../utils/database-date'); const generateEvents = require('../utils/event-generator'); const {luck} = require('../utils/random'); class MembersStripeCustomersSubscriptionsImporter extends ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersStripeCustomersImporter.js
ghost/core/core/server/data/seeders/importers/MembersStripeCustomersImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); class MembersStripeCustomersImporter extends TableImporter { static table = 'members_stripe_customers'; static dependencies = ['members']; constructor(knex, transaction) { super(MembersStripeCustomersImpo...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/ProductsBenefitsImporter.js
ghost/core/core/server/data/seeders/importers/ProductsBenefitsImporter.js
const TableImporter = require('./TableImporter'); class ProductsBenefitsImporter extends TableImporter { static table = 'products_benefits'; static dependencies = ['benefits', 'products']; constructor(knex, transaction) { super(ProductsBenefitsImporter.table, knex, transaction); } async i...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersImporter.js
ghost/core/core/server/data/seeders/importers/MembersImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {faker: americanFaker} = require('@faker-js/faker/locale/en_US'); const {blogStartDate: startTime} = require('../utils/blog-info'); const generateEvents = require('../utils/event-generator'); const {luck} = require('../u...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/StripePricesImporter.js
ghost/core/core/server/data/seeders/importers/StripePricesImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); const {blogStartDate} = require('../utils/blog-info'); const sixWeeksLater = new Date(blogStartDate); sixWeeksLater.setDate(sixWeeksLater.getDate() + (7 * 6)); class StripePricesImporter extends TableImporter { static ta...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/RecommendationClickEventsImporter.js
ghost/core/core/server/data/seeders/importers/RecommendationClickEventsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); class RecommendationClickEventsImporter extends TableImporter { static table = 'recommendation_click_events'; static dependencies = ['recommendations', 'members']; const...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/StripeProductsImporter.js
ghost/core/core/server/data/seeders/importers/StripeProductsImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); const {blogStartDate} = require('../utils/blog-info'); const sixWeeksLater = new Date(blogStartDate); sixWeeksLater.setDate(sixWeeksLater.getDate() + (7 * 6)); class StripeProductsImporter extends TableImporter { static ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersCreatedEventsImporter.js
ghost/core/core/server/data/seeders/importers/MembersCreatedEventsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); const dateToDatabaseString = require('../utils/database-date'); class MembersCreatedEventsImporter extends TableImporter { static table = 'members_created_events'; static dep...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersFeedbackImporter.js
ghost/core/core/server/data/seeders/importers/MembersFeedbackImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); const dateToDatabaseString = require('../utils/database-date'); class MembersFeedbackImporter extends TableImporter { static table = 'members_feedback'; static dependencies =...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/EmailBatchesImporter.js
ghost/core/core/server/data/seeders/importers/EmailBatchesImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const dateToDatabaseString = require('../utils/database-date'); class EmailBatchesImporter extends TableImporter { static table = 'email_batches'; static dependencies = ['emails']; constructor(knex, transaction) ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/UsersImporter.js
ghost/core/core/server/data/seeders/importers/UsersImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); const security = require('@tryghost/security'); const dateToDatabaseString = require('../utils/database-date'); class UsersImporter extends TableImporter { static table = 'us...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/ProductsImporter.js
ghost/core/core/server/data/seeders/importers/ProductsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); const {blogStartDate} = require('../utils/blog-info'); class ProductsImporter extends TableImporter { static table = 'products'; static dependencies = []; defaultQuan...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersPaidSubscriptionEventsImporter.js
ghost/core/core/server/data/seeders/importers/MembersPaidSubscriptionEventsImporter.js
const TableImporter = require('./TableImporter'); class MembersPaidSubscriptionEventsImporter extends TableImporter { static table = 'members_paid_subscription_events'; static dependencies = ['members_stripe_customers_subscriptions']; constructor(knex, transaction) { super(MembersPaidSubscriptionE...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersProductsImporter.js
ghost/core/core/server/data/seeders/importers/MembersProductsImporter.js
const {faker} = require('@faker-js/faker'); const TableImporter = require('./TableImporter'); const {luck} = require('../utils/random'); const dateToDatabaseString = require('../utils/database-date'); class MembersProductsImporter extends TableImporter { static table = 'members_products'; static dependencies =...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/BenefitsImporter.js
ghost/core/core/server/data/seeders/importers/BenefitsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {slugify} = require('@tryghost/string'); const {blogStartDate} = require('../utils/blog-info'); class BenefitsImporter extends TableImporter { static table = 'benefits'; static dependencies = []; defaultQuan...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/RecommendationSubscribeEventsImporter.js
ghost/core/core/server/data/seeders/importers/RecommendationSubscribeEventsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); class RecommendationSubscribeEventsImporter extends TableImporter { static table = 'recommendation_subscribe_events'; static dependencies = ['recommendations', 'members']; ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersClickEventsImporter.js
ghost/core/core/server/data/seeders/importers/MembersClickEventsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const {luck} = require('../utils/random'); const dateToDatabaseString = require('../utils/database-date'); class MembersClickEventsImporter extends TableImporter { static table = 'members_click_events'; static depende...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/MembersStatusEventsImporter.js
ghost/core/core/server/data/seeders/importers/MembersStatusEventsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); const dateToDatabaseString = require('../utils/database-date'); class MembersStatusEventsImporter extends TableImporter { static table = 'members_status_events'; static dependencies = ['members']; constructor(kne...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/EmailRecipientFailuresImporter.js
ghost/core/core/server/data/seeders/importers/EmailRecipientFailuresImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); class EmailRecipientFailuresImporter extends TableImporter { static table = 'email_recipient_failures'; static dependencies = ['email_recipients']; constructor(knex, transaction) { super(EmailRecipientFai...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/importers/RedirectsImporter.js
ghost/core/core/server/data/seeders/importers/RedirectsImporter.js
const TableImporter = require('./TableImporter'); const {faker} = require('@faker-js/faker'); class RedirectsImporter extends TableImporter { static table = 'redirects'; static dependencies = ['posts']; constructor(knex, transaction) { super(RedirectsImporter.table, knex, transaction); } ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/utils/database-date.js
ghost/core/core/server/data/seeders/utils/database-date.js
module.exports = function dateToDatabaseString(date) { if (typeof date === 'string') { // SQLite fix when reusing other dates from the db return date; } return date.toISOString().replace('Z','').replace('T', ' '); };
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/utils/blog-info.js
ghost/core/core/server/data/seeders/utils/blog-info.js
module.exports = { blogStartDate: new Date(2018, 5, 4) };
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/utils/event-generator.js
ghost/core/core/server/data/seeders/utils/event-generator.js
const probabilityDistributions = require('probability-distributions'); const generateEvents = ({ shape = 'flat', trend = 'positive', total = 0, startTime = new Date(), endTime = new Date() } = {}) => { if (total <= 0) { return []; } let alpha = 0; let beta = 0; let posi...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/utils/JsonImporter.js
ghost/core/core/server/data/seeders/utils/JsonImporter.js
const TableImporter = require('../importers/TableImporter'); class JsonImporter extends TableImporter { constructor(knex, transaction) { super(); this.knex = knex; this.transaction = transaction; } /** * @typedef {Object} JsonImportOptions * @property {string} name Name o...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/utils/topological-sort.js
ghost/core/core/server/data/seeders/utils/topological-sort.js
/** * This sorting algorithm is used to make sure that dependent tables are imported after their dependencies. * @param {Array<Object>} objects Objects with a name and dependencies properties * @returns Topologically sorted array of objects */ module.exports = function topologicalSort(objects) { // Create an em...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/seeders/utils/random.js
ghost/core/core/server/data/seeders/utils/random.js
const {faker} = require('@faker-js/faker'); /** * Adds another degree of randomness into some decisions * @param {number} lowerThan Only this % of people will achieve this luck * @returns {boolean} Whether this person is lucky enough for the condition */ const luck = lowerThan => faker.datatype.number({ min: 1...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/schema/index.js
ghost/core/core/server/data/schema/index.js
module.exports.tables = require('./schema'); module.exports.commands = require('./commands'); module.exports.defaultSettings = require('./default-settings'); module.exports.validate = require('./validator');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/schema/commands.js
ghost/core/core/server/data/schema/commands.js
const _ = require('lodash'); const logging = require('@tryghost/logging'); const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const db = require('../db'); const DatabaseInfo = require('@tryghost/database-info'); const schema = require('./schema'); const messages = { hasPrimaryKeySQLi...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/schema/schema.js
ghost/core/core/server/data/schema/schema.js
/* String Column Sizes Information * (From: https://github.com/TryGhost/Ghost/pull/7932) * New/Updated column maxlengths should meet these guidlines * * Small strings = length 50 * Medium strings = length 191 * Large strings = length 2000 (use soft limits via validation for 191-2000) * Text = length 65535 (64 Ki...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
true
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/schema/validator.js
ghost/core/core/server/data/schema/validator.js
const _ = require('lodash'); const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const validator = require('@tryghost/validator'); const schema = require('./schema'); const messages = { valueCannotBeBlank: 'Value in [{tableName}.{columnKey}] cannot be blank.', valueMustBeBoolean:...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/schema/default-settings/index.js
ghost/core/core/server/data/schema/default-settings/index.js
const config = require('../../../../shared/config'); const defaultSettingsPath = config.get('paths').defaultSettings; const defaultSettings = require(defaultSettingsPath); module.exports = defaultSettings;
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/schema/fixtures/index.js
ghost/core/core/server/data/schema/fixtures/index.js
const FixtureManager = require('./FixtureManager'); const config = require('../../../../shared/config'); const fixturePath = config.get('paths').fixtures; const fixtures = require(fixturePath); module.exports.FixtureManager = FixtureManager; module.exports.fixtureManager = new FixtureManager(fixtures, { __OWNER_U...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/schema/fixtures/FixtureManager.js
ghost/core/core/server/data/schema/fixtures/FixtureManager.js
const _ = require('lodash'); const logging = require('@tryghost/logging'); const {sequence} = require('@tryghost/promise'); const models = require('../../../models'); const baseUtils = require('../../../models/base/utils'); const moment = require('moment'); class FixtureManager { /** * Create a new FixtureM...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/tinybird/scripts/docker-database-utils.js
ghost/core/core/server/data/tinybird/scripts/docker-database-utils.js
/* eslint-disable ghost/filenames/match-exported-class */ /* eslint-disable no-console */ /** * Docker Database Utilities for Ghost Analytics Scripts * Provides database operations for the Docker-based development environment * * Connects directly to MySQL when running outside Docker (from host machine) */ const ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/tinybird/scripts/docker-analytics-manager.js
ghost/core/core/server/data/tinybird/scripts/docker-analytics-manager.js
#!/usr/bin/env node /* eslint-disable ghost/filenames/match-exported-class */ /* eslint-disable no-console */ /* eslint-disable ghost/ghost-custom/no-native-error */ /** * Docker Analytics Manager * * Manages analytics data for the Docker-based development environment. * Generates and clears analytics events direct...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/email-template.js
ghost/core/core/server/data/importer/email-template.js
module.exports = ({result, siteUrl, postsUrl, emailRecipient}) => ` <!doctype html> <html> <head> <meta name="viewport" content="width=device-width"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Your content import is complete</title> <style> /* ----------------------...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/index.js
ghost/core/core/server/data/importer/index.js
module.exports = require('./import-manager');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/import-manager.js
ghost/core/core/server/data/importer/import-manager.js
const _ = require('lodash'); const fs = require('fs-extra'); const path = require('path'); const os = require('os'); const glob = require('glob'); const crypto = require('crypto'); const config = require('../../../shared/config'); const {extract} = require('@tryghost/zip'); const tpl = require('@tryghost/tpl'); const d...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/json-to-html.js
ghost/core/core/server/data/importer/importers/json-to-html.js
const SimpleDom = require('simple-dom'); const serializer = new SimpleDom.HTMLSerializer(SimpleDom.voidMap); const imageCard = require('@tryghost/kg-default-cards/lib/cards/image.js'); const embedCard = require('@tryghost/kg-default-cards/lib/cards/embed.js'); // Take the array of items for a specific post and return ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/ContentFileImporter.js
ghost/core/core/server/data/importer/importers/ContentFileImporter.js
const _ = require('lodash'); let replaceImage; let preProcessPosts; let preProcessTags; let preProcessUsers; replaceImage = function (markdown, image) { if (!markdown) { return; } // Normalizes to include a trailing slash if there was one const regex = new RegExp('(/)?' + image.originalPath, '...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/importer-revue.js
ghost/core/core/server/data/importer/importers/importer-revue.js
const debug = require('@tryghost/debug')('importer:revue'); const {slugify} = require('@tryghost/string'); const papaparse = require('papaparse'); const _ = require('lodash'); const JSONToHTML = require('./json-to-html'); /** * Build posts out of the issue and item data * * @param {Object} revueData * @return {Ar...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/NewslettersImporter.js
ghost/core/core/server/data/importer/importers/data/NewslettersImporter.js
const debug = require('@tryghost/debug')('importer:newsletters'); const _ = require('lodash'); const BaseImporter = require('./Base'); const models = require('../../../../models'); const ignoredColumns = ['sender_email']; class NewslettersImporter extends BaseImporter { constructor(allDataFromFile) { supe...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/PostsImporter.js
ghost/core/core/server/data/importer/importers/data/PostsImporter.js
const debug = require('@tryghost/debug')('importer:posts'); const _ = require('lodash'); const crypto = require('crypto'); const BaseImporter = require('./Base'); const mobiledocLib = require('../../../../lib/mobiledoc'); const validator = require('@tryghost/validator'); const postsMetaSchema = require('../../../schema...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/TagsImporter.js
ghost/core/core/server/data/importer/importers/data/TagsImporter.js
const debug = require('@tryghost/debug')('importer:tags'); const _ = require('lodash'); const BaseImporter = require('./Base'); const models = require('../../../../models'); const {sequence} = require('@tryghost/promise'); class TagsImporter extends BaseImporter { constructor(allDataFromFile) { super(allDa...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/Base.js
ghost/core/core/server/data/importer/importers/data/Base.js
const debug = require('@tryghost/debug')('importer:base'); const _ = require('lodash'); const ObjectId = require('bson-objectid').default; const errors = require('@tryghost/errors'); const {sequence} = require('@tryghost/promise'); const models = require('../../../../models'); class Base { constructor(allDataFromF...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/index.js
ghost/core/core/server/data/importer/importers/data/index.js
module.exports = require('./data-importer');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/RevueSubscriberImporter.js
ghost/core/core/server/data/importer/importers/data/RevueSubscriberImporter.js
const debug = require('@tryghost/debug')('importer:revue-subscriber'); const BaseImporter = require('./Base'); const papaparse = require('papaparse'); const path = require('path'); const fs = require('fs-extra'); const config = require('../../../../../shared/config'); const models = require('../../../../models'); cl...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/SettingsImporter.js
ghost/core/core/server/data/importer/importers/data/SettingsImporter.js
const debug = require('@tryghost/debug')('importer:settings'); const ObjectId = require('bson-objectid').default; const _ = require('lodash'); const BaseImporter = require('./Base'); const models = require('../../../../models'); const defaultSettings = require('../../../schema').defaultSettings; const keyGroupMapper = ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/StripePricesImporter.js
ghost/core/core/server/data/importer/importers/data/StripePricesImporter.js
const _ = require('lodash'); const debug = require('@tryghost/debug')('importer:stripeprices'); const BaseImporter = require('./Base'); const models = require('../../../../models'); class StripePricesImporter extends BaseImporter { constructor(allDataFromFile) { super(allDataFromFile, { modelNa...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/StripeProductsImporter.js
ghost/core/core/server/data/importer/importers/data/StripeProductsImporter.js
const _ = require('lodash'); const debug = require('@tryghost/debug')('importer:stripeproducts'); const BaseImporter = require('./Base'); const models = require('../../../../models'); class StripeProductsImporter extends BaseImporter { constructor(allDataFromFile) { super(allDataFromFile, { mod...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/RolesImporter.js
ghost/core/core/server/data/importer/importers/data/RolesImporter.js
const debug = require('@tryghost/debug')('importer:roles'); const BaseImporter = require('./Base'); class RolesImporter extends BaseImporter { constructor(allDataFromFile) { super(allDataFromFile, { modelName: 'Role', dataKeyToImport: 'roles' }); this.errorConfig.re...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/UsersImporter.js
ghost/core/core/server/data/importer/importers/data/UsersImporter.js
const debug = require('@tryghost/debug')('importer:users'); const _ = require('lodash'); const BaseImporter = require('./Base'); const models = require('../../../../models'); const limitService = require('../../../../services/limits'); class UsersImporter extends BaseImporter { constructor(allDataFromFile) { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/ProductsImporter.js
ghost/core/core/server/data/importer/importers/data/ProductsImporter.js
const _ = require('lodash'); const BaseImporter = require('./Base'); const models = require('../../../../models'); const debug = require('@tryghost/debug')('importer:products'); class ProductsImporter extends BaseImporter { constructor(allDataFromFile) { super(allDataFromFile, { modelName: 'Pro...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/data-importer.js
ghost/core/core/server/data/importer/importers/data/data-importer.js
const _ = require('lodash'); const ObjectId = require('bson-objectid').default; const semver = require('semver'); const {IncorrectUsageError} = require('@tryghost/errors'); const debug = require('@tryghost/debug')('importer:data'); const {sequence} = require('@tryghost/promise'); const models = require('../../../../mod...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/importers/data/CustomThemeSettingsImporter.js
ghost/core/core/server/data/importer/importers/data/CustomThemeSettingsImporter.js
const _ = require('lodash'); const debug = require('@tryghost/debug')('importer:roles'); const BaseImporter = require('./Base'); const models = require('../../../../models'); const {activate} = require('../../../../services/themes/activate'); const {sequence} = require('@tryghost/promise'); class CustomThemeSettingsIm...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/handlers/markdown.js
ghost/core/core/server/data/importer/handlers/markdown.js
const _ = require('lodash'); const fs = require('fs-extra'); const moment = require('moment'); const featuredImageRegex = /^(!\[]\(([^)]*?)\)\s+)(?=#)/; const titleRegex = /^#\s?([\w\W]*?)(?=\n)/; const statusRegex = /(published||draft)-/; const dateRegex = /(\d{4}-\d{2}-\d{2})-/; let processDateTime; let processFileNa...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/handlers/image.js
ghost/core/core/server/data/importer/handlers/image.js
const _ = require('lodash'); const path = require('path'); const config = require('../../../../shared/config'); const urlUtils = require('../../../../shared/url-utils'); const storage = require('../../../adapters/storage'); let ImageHandler; ImageHandler = { type: 'images', extensions: config.get('uploads').im...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/handlers/json.js
ghost/core/core/server/data/importer/handlers/json.js
const _ = require('lodash'); const fs = require('fs-extra'); const tpl = require('@tryghost/tpl'); const errors = require('@tryghost/errors'); const debug = require('@tryghost/debug')('importer:handler:data'); const messages = { invalidJsonFormat: 'Invalid JSON format, expected `{ db: [exportedData] }`', check...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/handlers/ImporterContentFileHandler.js
ghost/core/core/server/data/importer/handlers/ImporterContentFileHandler.js
const _ = require('lodash'); const path = require('path'); class ImporterContentFileHandler { /** @property {'media' | 'files' | 'images'} */ type; /** @property {string[]} */ directories; /** @property {string[]} */ extensions; /** @property {string[]} */ contentTypes; /** ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/importer/handlers/revue.js
ghost/core/core/server/data/importer/handlers/revue.js
const _ = require('lodash'); const fs = require('fs-extra'); const debug = require('@tryghost/debug')('importer:handler:revue'); const hasIssuesCSV = (files, startDirRegex) => { return _.some(files, (file) => { const name = file.name.replace(startDirRegex, ''); return name.match(/^issues.*?\.csv/);...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/index.js
ghost/core/core/server/web/index.js
module.exports = { get shared() { return require('./shared'); } };
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/well-known.js
ghost/core/core/server/web/well-known.js
const express = require('../../shared/express'); const settings = require('../../shared/settings-cache'); const config = require('../../shared/config'); const {cacheControl} = require('./shared/middleware'); module.exports = function setupWellKnownApp() { const wellKnownApp = express('well-known'); const jose...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/webmentions/index.js
ghost/core/core/server/web/webmentions/index.js
module.exports = require('./routes');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/webmentions/routes.js
ghost/core/core/server/web/webmentions/routes.js
const express = require('../../../shared/express'); const api = require('../../api').endpoints; const {http} = require('@tryghost/api-framework'); const shared = require('../shared'); const bodyParser = require('body-parser'); /** * @returns {import('express').Router} */ module.exports = function apiRoutes() { ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/admin/index.js
ghost/core/core/server/web/admin/index.js
module.exports = require('./app');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/admin/app.js
ghost/core/core/server/web/admin/app.js
const debug = require('@tryghost/debug')('web:admin:app'); const path = require('path'); const express = require('../../../shared/express'); const serveStatic = express.static; const config = require('../../../shared/config'); const urlUtils = require('../../../shared/url-utils'); const shared = require('../shared'); c...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/admin/controller.js
ghost/core/core/server/web/admin/controller.js
const debug = require('@tryghost/debug')('web:admin:controller'); const errors = require('@tryghost/errors'); const tpl = require('@tryghost/tpl'); const path = require('path'); const fs = require('fs'); const crypto = require('crypto'); const config = require('../../../shared/config'); const labs = require('../../../s...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/admin/middleware/redirect-admin-urls.js
ghost/core/core/server/web/admin/middleware/redirect-admin-urls.js
const urlUtils = require('../../../../shared/url-utils'); /** * * @param {import('express').Request} req * @param {import('express').Response} res * @param {import('express').NextFunction} next */ function redirectAdminUrls(req, res, next) { const subdir = urlUtils.getSubdir(); const ghostPathRegex = new ...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/announcement/index.js
ghost/core/core/server/web/announcement/index.js
module.exports = require('./routes');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/announcement/routes.js
ghost/core/core/server/web/announcement/routes.js
const express = require('../../../shared/express'); const api = require('../../api').endpoints; const {http} = require('@tryghost/api-framework'); const shared = require('../shared'); /** * @returns {import('express').Router} */ module.exports = function apiRoutes() { const router = express.Router('announcements...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/api/index.js
ghost/core/core/server/web/api/index.js
module.exports = require('./app');
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false
TryGhost/Ghost
https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/web/api/app.js
ghost/core/core/server/web/api/app.js
const debug = require('@tryghost/debug')('web:api:default:app'); const config = require('../../../shared/config'); const express = require('../../../shared/express'); const sentry = require('../../../shared/sentry'); const middleware = require('../shared/middleware'); const errorHandler = require('@tryghost/mw-error-ha...
javascript
MIT
31ecb69a147e71743e74014b4e04ccce09ab8c1a
2026-01-04T14:57:14.657301Z
false