Fixed import of bson-objectid in accordance to the typings

- there's a few different ways we can import it but I've chosen to
  append `.default` as we have done in several other places in the code
This commit is contained in:
Daniel Lockyer 2022-10-12 14:54:35 +07:00
parent 2422f4a95c
commit e2ba19b0df
No known key found for this signature in database
41 changed files with 41 additions and 41 deletions

View File

@ -1,7 +1,7 @@
const debug = require('@tryghost/debug')('importer:base');
const _ = require('lodash');
const Promise = require('bluebird');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const errors = require('@tryghost/errors');
const {sequence} = require('@tryghost/promise');
const models = require('../../../../models');

View File

@ -1,5 +1,5 @@
const {chunk} = require('lodash');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const {createTransactionalMigration} = require('../../utils');
const logging = require('@tryghost/logging');

View File

@ -1,5 +1,5 @@
const {chunk} = require('lodash');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');

View File

@ -1,6 +1,6 @@
const {createIrreversibleMigration} = require('../../utils');
const logging = require('@tryghost/logging');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const security = require('@tryghost/security');
module.exports = createIrreversibleMigration(

View File

@ -1,5 +1,5 @@
const {chunk} = require('lodash');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const {createTransactionalMigration} = require('../../utils');
const logging = require('@tryghost/logging');
const errors = require('@tryghost/errors');

View File

@ -1,4 +1,4 @@
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');

View File

@ -1,5 +1,5 @@
const {createTransactionalMigration} = require('../../utils');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const {slugify} = require('@tryghost/string');
const logging = require('@tryghost/logging');

View File

@ -1,5 +1,5 @@
const {createTransactionalMigration} = require('../../utils');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const {chunk} = require('lodash');
const logging = require('@tryghost/logging');

View File

@ -1,6 +1,6 @@
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
module.exports = createTransactionalMigration(
async function up(connection) {

View File

@ -1,5 +1,5 @@
const {createTransactionalMigration} = require('../../utils');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const {slugify} = require('@tryghost/string');
const logging = require('@tryghost/logging');

View File

@ -1,4 +1,4 @@
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const uuid = require('uuid');
const logging = require('@tryghost/logging');
const startsWith = require('lodash/startsWith');

View File

@ -1,5 +1,5 @@
const logging = require('@tryghost/logging');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const {createTransactionalMigration} = require('../../utils');

View File

@ -1,4 +1,4 @@
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');

View File

@ -1,4 +1,4 @@
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const {createTransactionalMigration} = require('../../utils');
const logging = require('@tryghost/logging');

View File

@ -1,6 +1,6 @@
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
// newsletter_show_header = false ->
// newsletter_show_header_title = false

View File

@ -1,5 +1,5 @@
const logging = require('@tryghost/logging');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const security = require('@tryghost/security');
const {createTransactionalMigration} = require('../../utils');

View File

@ -1,6 +1,6 @@
const _ = require('lodash');
const bookshelf = require('bookshelf');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const plugins = require('@tryghost/bookshelf-plugins');
const Promise = require('bluebird');

View File

@ -1,6 +1,6 @@
const _ = require('lodash');
const debug = require('@tryghost/debug')('models:base:model-events');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const schema = require('../../../data/schema');

View File

@ -5,7 +5,7 @@
const _ = require('lodash');
const Promise = require('bluebird');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const errors = require('@tryghost/errors');
/**

View File

@ -1,5 +1,5 @@
const ghostBookshelf = require('./base');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const uuid = require('uuid');
const urlUtils = require('../../shared/url-utils');

View File

@ -3,7 +3,7 @@ const _ = require('lodash');
const uuid = require('uuid');
const crypto = require('crypto');
const keypair = require('keypair');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const ghostBookshelf = require('./base');
const tpl = require('@tryghost/tpl');
const errors = require('@tryghost/errors');

View File

@ -1,7 +1,7 @@
const _ = require('lodash');
const Promise = require('bluebird');
const validator = require('@tryghost/validator');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const ghostBookshelf = require('./base');
const baseUtils = require('./base/utils');
const limitService = require('../services/limits');

View File

@ -3,7 +3,7 @@ const Promise = require('bluebird');
const debug = require('@tryghost/debug')('mega');
const tpl = require('@tryghost/tpl');
const moment = require('moment');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const errors = require('@tryghost/errors');
const logging = require('@tryghost/logging');
const settingsCache = require('../../../shared/settings-cache');

View File

@ -5,7 +5,7 @@ const _ = require('lodash');
const errors = require('@tryghost/errors');
const ghostVersion = require('@tryghost/version');
const tpl = require('@tryghost/tpl');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const messages = {
noPermissionToDismissNotif: 'You do not have permission to dismiss this notification.',

View File

@ -13,7 +13,7 @@ const mail = require('../mail');
const SingleUseTokenProvider = require('../members/SingleUseTokenProvider');
const urlUtils = require('../../../shared/url-utils');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const settingsHelpers = require('../settings-helpers');
const MAGIC_LINK_TOKEN_VALIDITY = 24 * 60 * 60 * 1000;

View File

@ -1,6 +1,6 @@
const debug = require('@tryghost/debug')('themes');
const fs = require('fs-extra');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const tpl = require('@tryghost/tpl');
const logging = require('@tryghost/logging');

View File

@ -3,7 +3,7 @@ const {anyEtag, anyErrorId} = matchers;
const assert = require('assert');
// @TODO: factor out these requires
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const testUtils = require('../../utils');
const models = require('../../../core/server/models/index');

View File

@ -1,6 +1,6 @@
const {agentProvider, mockManager, fixtureManager, matchers} = require('../../utils/e2e-framework');
const {anyEtag, anyObjectId, anyUuid, anyISODateTime, anyISODate, anyString, anyArray, anyLocationFor, anyContentLength, anyErrorId, anyObject} = matchers;
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const assert = require('assert');
const nock = require('nock');

View File

@ -3,7 +3,7 @@ const nock = require('nock');
const path = require('path');
const supertest = require('supertest');
const _ = require('lodash');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const moment = require('moment-timezone');
const testUtils = require('../../utils');
const config = require('../../../core/shared/config');

View File

@ -3,7 +3,7 @@ const sinon = require('sinon');
const testUtils = require('../../utils');
const Promise = require('bluebird');
const moment = require('moment-timezone');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const assert = require('assert');
const _ = require('lodash');
const validator = require('@tryghost/validator');

View File

@ -1,7 +1,7 @@
require('should');
const {agentProvider, fixtureManager, mockManager} = require('../../utils/e2e-framework');
const moment = require('moment');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const models = require('../../../core/server/models');
const sinon = require('sinon');
const assert = require('assert');

View File

@ -1,7 +1,7 @@
const _ = require('lodash');
const should = require('should');
const supertest = require('supertest');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const moment = require('moment-timezone');
const testUtils = require('../../../utils');
const config = require('../../../../core/shared/config');

View File

@ -1,6 +1,6 @@
const should = require('should');
const supertest = require('supertest');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const testUtils = require('../../../utils');
const config = require('../../../../core/shared/config');
const localUtils = require('./utils');

View File

@ -1,6 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const urlService = require('../../../../core/server/services/url');
const getAuthorUrl = require('../../../../core/frontend/meta/author-url');

View File

@ -1,6 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const _ = require('lodash');
const testUtils = require('../../../../utils');
const urlUtils = require('../../../../../core/shared/url-utils');

View File

@ -1,6 +1,6 @@
const should = require('should');
const _ = require('lodash');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const testUtils = require('../../../../utils');
const models = require('../../../../../core/server/models');

View File

@ -4,7 +4,7 @@ const _ = require('lodash');
const path = require('path');
const fs = require('fs-extra');
const uuid = require('uuid');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const KnexMigrator = require('knex-migrator');
const {sequence} = require('@tryghost/promise');
const knexMigrator = new KnexMigrator();

View File

@ -1,6 +1,6 @@
const _ = require('lodash');
const uuid = require('uuid');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const moment = require('moment');
const constants = require('@tryghost/constants');
const DataGenerator = {};

View File

@ -3,7 +3,7 @@
*/
const _ = require('lodash');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const db = require('../../../../core/server/data/db');
const markdownToMobiledoc = require('../data-generator').markdownToMobiledoc;
const data = {};

View File

@ -4,7 +4,7 @@ const logging = require('@tryghost/logging');
const tpl = require('@tryghost/tpl');
const DomainEvents = require('@tryghost/domain-events');
const {MemberCreatedEvent, SubscriptionCreatedEvent, MemberSubscribeEvent, SubscriptionCancelledEvent} = require('@tryghost/member-events');
const ObjectId = require('bson-objectid');
const ObjectId = require('bson-objectid').default;
const {NotFoundError} = require('@tryghost/errors');
const messages = {

View File

@ -1,5 +1,5 @@
const should = require('should');
const ObjectID = require('bson-objectid');
const ObjectID = require('bson-objectid').default;
const errors = require('../../../../lib/domain/errors');
const Offer = require('../../../../lib/domain/models/Offer');
const OfferName = require('../../../../lib/domain/models/OfferName');