@friggframework/core 1.0.3-v1-alpha-package-update.5 → 1.1.0-v1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/database/index.js +14 -8
  2. package/encrypt/CHANGELOG.md +13 -0
  3. package/encrypt/README.md +10 -0
  4. package/encrypt/encrypt.js +12 -4
  5. package/encrypt/encrypt.test.js +2 -1
  6. package/encrypt/index.js +2 -1
  7. package/errors/fetch-error.js +5 -1
  8. package/index.js +119 -25
  9. package/integrations/jest-setup.js +1 -1
  10. package/integrations/jest-teardown.js +1 -1
  11. package/logs/logger.test.js +1 -1
  12. package/module-plugin/jest-setup.js +1 -1
  13. package/module-plugin/jest-teardown.js +1 -1
  14. package/module-plugin/module-factory.js +1 -1
  15. package/module-plugin/requester/requester.js +2 -1
  16. package/package.json +6 -14
  17. package/syncs/manager.js +0 -2
  18. package/eslint-config/.eslintrc.json +0 -3
  19. package/eslint-config/CHANGELOG.md +0 -17
  20. package/eslint-config/LICENSE.md +0 -9
  21. package/eslint-config/README.md +0 -3
  22. package/eslint-config/bump3.txt +0 -0
  23. package/eslint-config/index.js +0 -38
  24. package/migrations/README.md +0 -3
  25. package/migrations/bump3.txt +0 -0
  26. package/migrations/index.js +0 -9
  27. package/migrations/jest.config.js +0 -3
  28. package/migrations/manager.js +0 -33
  29. package/migrations/migrator.js +0 -170
  30. package/migrations/options.js +0 -28
  31. package/prettier-config/.eslintrc.json +0 -3
  32. package/prettier-config/CHANGELOG.md +0 -17
  33. package/prettier-config/LICENSE.md +0 -9
  34. package/prettier-config/README.md +0 -3
  35. package/prettier-config/bump3.txt +0 -0
  36. package/prettier-config/index.js +0 -6
  37. package/test-environment/.eslintrc.json +0 -3
  38. package/test-environment/Authenticator.js +0 -73
  39. package/test-environment/CHANGELOG.md +0 -46
  40. package/test-environment/LICENSE.md +0 -9
  41. package/test-environment/README.md +0 -3
  42. package/test-environment/auther-definition-method-tester.js +0 -45
  43. package/test-environment/auther-definition-tester.js +0 -104
  44. package/test-environment/bump3.txt +0 -0
  45. package/test-environment/index.js +0 -24
  46. package/test-environment/integration-validator.js +0 -2
  47. package/test-environment/jest-global-setup.js +0 -6
  48. package/test-environment/jest-global-teardown.js +0 -3
  49. package/test-environment/jest-preset.js +0 -14
  50. package/test-environment/mock-api-readme.md +0 -102
  51. package/test-environment/mock-api.js +0 -284
  52. package/test-environment/mock-integration.js +0 -82
  53. package/test-environment/mongodb.js +0 -22
  54. package/test-environment/override-environment.js +0 -11
package/database/index.js CHANGED
@@ -1,14 +1,20 @@
1
- const mongo = require('./mongo');
2
- const { mongoose } = require('./mongoose');
3
- const { IndividualUser } = require('./models/IndividualUser');
4
- const { OrganizationUser } = require('./models/OrganizationUser');
5
- const { State } = require('./models/State');
6
- const { Token } = require('./models/Token');
7
- const { UserModel } = require('./models/UserModel');
1
+ const { mongoose} = require('./mongoose');
2
+ const {
3
+ connectToDatabase,
4
+ disconnectFromDatabase,
5
+ createObjectId,
6
+ } = require('./mongo');
7
+ const {IndividualUser} = require('./models/IndividualUser');
8
+ const {OrganizationUser} = require('./models/OrganizationUser');
9
+ const {State} = require('./models/State');
10
+ const {Token} = require('./models/Token');
11
+ const {UserModel} = require('./models/UserModel');
8
12
 
9
13
  module.exports = {
10
- ...mongo,
11
14
  mongoose,
15
+ connectToDatabase,
16
+ disconnectFromDatabase,
17
+ createObjectId,
12
18
  IndividualUser,
13
19
  OrganizationUser,
14
20
  State,
@@ -1,3 +1,16 @@
1
+ # v1.1.8 (Fri Feb 02 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Added variable BYPASS_ENCRYPTION_STAGE to encrypt module [#248](https://github.com/friggframework/frigg/pull/248) ([@leofmds](https://github.com/leofmds))
6
+ - Added variable BYPASS_ENCRYPTION_STAGE to encrypt module ([@leofmds](https://github.com/leofmds))
7
+
8
+ #### Authors: 1
9
+
10
+ - Leonardo Ferreira ([@leofmds](https://github.com/leofmds))
11
+
12
+ ---
13
+
1
14
  # v1.1.7 (Tue Apr 04 2023)
2
15
 
3
16
  :tada: This release contains work from a new contributor! :tada:
package/encrypt/README.md CHANGED
@@ -1,3 +1,13 @@
1
1
  # encrypt
2
2
 
3
3
  This package exports the `encrypt` mongoose plugin used in [Frigg](https://friggframework.org). You can find its documentation [on Frigg's website](https://docs.friggframework.org/packages/encrypt).
4
+
5
+ ## Configuration
6
+
7
+ | Environment variable | Description |
8
+ |-------------------------|------------------------------------------------------------------------------------------------------------|
9
+ | KMS_KEY_ARN | The AWS KMS Key ARN, if using it to encryption/decryption. |
10
+ | AES_KEY | AES key, used in conjunction with AES_KEY_ID. AES option is mutually exclusive with KMS_KEY_ARN. |
11
+ | AES_KEY_ID | AES key ID, used in conjunction with AES_KEY. |
12
+ | STAGE | The stage in which the application is running. It is usually defined in Serverless configuration, if used. |
13
+ | BYPASS_ENCRYPTION_STAGE | Stages to bypass encryption/decryption, separated by comma. |
@@ -14,14 +14,22 @@ const findOneEvents = [
14
14
  'findOneAndReplace',
15
15
  ];
16
16
 
17
+ const shouldBypassEncryption = (STAGE) => {
18
+ const defaultBypassStages = ['dev', 'test', 'local'];
19
+ const bypassStageEnv = process.env.BYPASS_ENCRYPTION_STAGE;
20
+ // If the env is set to anything or an empty string, use the env. Otherwise, use the default array
21
+ const useEnv = !String(bypassStageEnv) || !!bypassStageEnv;
22
+ const bypassStages = useEnv
23
+ ? bypassStageEnv.split(',').map((stage) => stage.trim())
24
+ : defaultBypassStages;
25
+ return bypassStages.includes(STAGE);
26
+ };
27
+
17
28
  // The Mongoose plug-in function
18
29
  function Encrypt(schema, options) {
19
30
  const { STAGE, KMS_KEY_ARN, AES_KEY_ID } = process.env;
20
- const isEnabledForStage =
21
- ['staging', 'QA', 'prod', 'encryption-test'].indexOf(STAGE) > -1;
22
31
 
23
- // No-op if not enabled
24
- if (!isEnabledForStage) {
32
+ if (shouldBypassEncryption(STAGE)) {
25
33
  return;
26
34
  }
27
35
 
@@ -8,7 +8,7 @@ const {
8
8
  createModel,
9
9
  saveTestDocument,
10
10
  } = require('./test-encrypt');
11
- const { TestMongo } = require('../test-environment');
11
+ const { TestMongo } = require('@friggframework/devtools');
12
12
 
13
13
  const testMongo = new TestMongo();
14
14
  const originalEnv = process.env;
@@ -34,6 +34,7 @@ describe('Encrypt', () => {
34
34
  process.env = {
35
35
  ...originalEnv,
36
36
  STAGE: 'not-encryption-test',
37
+ BYPASS_ENCRYPTION_STAGE: 'not-encryption-test',
37
38
  };
38
39
 
39
40
  try {
package/encrypt/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  const { Encrypt } = require('./encrypt');
2
+ const { Cryptor } = require('./Cryptor');
2
3
 
3
- module.exports = { Encrypt };
4
+ module.exports = { Encrypt, Cryptor };
@@ -7,6 +7,8 @@ const { stripIndent } = require('common-tags');
7
7
  // https://developer.mozilla.org/en-US/docs/Web/API/fetch
8
8
 
9
9
  class FetchError extends BaseError {
10
+ response = null;
11
+
10
12
  constructor(options = {}) {
11
13
  const { resource, init, response, responseBody } = options;
12
14
  const method = init?.method ?? 'GET';
@@ -17,7 +19,7 @@ class FetchError extends BaseError {
17
19
  return JSON.stringify({ init }, null, 2);
18
20
  })()
19
21
  : JSON.stringify({ init }, null, 2)
20
- : '';
22
+ : '';
21
23
 
22
24
  let responseBodyText = '<response body is unavailable>';
23
25
  if (typeof responseBody === 'string') {
@@ -59,6 +61,8 @@ class FetchError extends BaseError {
59
61
  ];
60
62
 
61
63
  super(messageParts.filter(Boolean).join('\n'));
64
+
65
+ this.response = response;
62
66
  }
63
67
 
64
68
  static async create(options = {}) {
package/index.js CHANGED
@@ -1,30 +1,124 @@
1
- const testEnvironment = require('./test-environment/index');
2
- const core = require('./core/index');
3
- const database = require('./database/index');
4
- const assertions = require('./assertions/index');
5
- const integrations = require('./integrations/index');
6
- const errors = require('./errors/index');
7
- const encrypt = require('./encrypt/encrypt');
8
- const lambda = require('./lambda/index');
9
- const logs = require('./logs/index');
10
- const modulePlugin = require('./module-plugin/index');
11
-
12
- const eslintConfig = require('./eslint-config')
13
- const prettierConfig = require('./prettier-config')
1
+ const {
2
+ expectShallowEqualDbObject,
3
+ get,
4
+ getAll,
5
+ verifyType,
6
+ getParamAndVerifyParamType,
7
+ getArrayParamAndVerifyParamType,
8
+ getAndVerifyType,
9
+ } = require('./assertions/index');
10
+ const { Delegate, Worker, loadInstalledModules, createHandler } = require('./core/index');
11
+ const {
12
+ mongoose,
13
+ connectToDatabase,
14
+ disconnectFromDatabase,
15
+ createObjectId,
16
+ IndividualUser,
17
+ OrganizationUser,
18
+ State,
19
+ Token,
20
+ UserModel
21
+ } = require('./database/index');
22
+ const { Encrypt, Cryptor } = require('./encrypt/encrypt');
23
+ const {
24
+ BaseError,
25
+ FetchError,
26
+ HaltError,
27
+ RequiredPropertyError,
28
+ ParameterTypeError,
29
+ } = require('./errors/index');
30
+ const {
31
+ IntegrationBase,
32
+ IntegrationModel,
33
+ Options,
34
+ IntegrationMapping,
35
+ IntegrationFactory,
36
+ IntegrationHelper,
37
+ createIntegrationRouter,
38
+ checkRequiredParams,
39
+ createFriggBackend
40
+ } = require('./integrations/index');
41
+ const { TimeoutCatcher } = require('./lambda/index');
42
+ const {
43
+ debug,
44
+ initDebugLog,
45
+ flushDebugLog
46
+ } = require('./logs/index');
47
+ const {
48
+ Credential,
49
+ EntityManager,
50
+ Entity,
51
+ ModuleManager,
52
+ ApiKeyRequester,
53
+ BasicAuthRequester,
54
+ OAuth2Requester,
55
+ Requester,
56
+ ModuleConstants,
57
+ ModuleFactory,
58
+ Auther
59
+ } = require('./module-plugin/index');
14
60
 
15
61
  // const {Sync } = require('./syncs/model');
16
62
 
17
63
  module.exports = {
18
- ...testEnvironment,
19
- ...core,
20
- ...database,
21
- ...assertions,
22
- ...integrations,
23
- ...errors,
24
- ...encrypt,
25
- ...lambda,
26
- ...logs,
27
- ...modulePlugin,
28
- eslintConfig,
29
- prettierConfig
64
+ // assertions
65
+ expectShallowEqualDbObject,
66
+ get,
67
+ getAll,
68
+ verifyType,
69
+ getParamAndVerifyParamType,
70
+ getArrayParamAndVerifyParamType,
71
+ getAndVerifyType,
72
+ // core
73
+ Delegate,
74
+ Worker,
75
+ loadInstalledModules,
76
+ createHandler,
77
+ // database
78
+ mongoose,
79
+ connectToDatabase,
80
+ disconnectFromDatabase,
81
+ createObjectId,
82
+ IndividualUser,
83
+ OrganizationUser,
84
+ State,
85
+ Token,
86
+ UserModel,
87
+ // encrypt
88
+ Encrypt,
89
+ Cryptor,
90
+ // errors
91
+ BaseError,
92
+ FetchError,
93
+ HaltError,
94
+ RequiredPropertyError,
95
+ ParameterTypeError,
96
+ // integrations
97
+ IntegrationBase,
98
+ IntegrationModel,
99
+ Options,
100
+ IntegrationMapping,
101
+ IntegrationFactory,
102
+ IntegrationHelper,
103
+ checkRequiredParams,
104
+ createIntegrationRouter,
105
+ createFriggBackend,
106
+ // lambda
107
+ TimeoutCatcher,
108
+ // logs
109
+ debug,
110
+ initDebugLog,
111
+ flushDebugLog,
112
+ // module plugin
113
+ Credential,
114
+ EntityManager,
115
+ Entity,
116
+ ModuleManager,
117
+ ApiKeyRequester,
118
+ BasicAuthRequester,
119
+ OAuth2Requester,
120
+ Requester,
121
+ ModuleConstants,
122
+ ModuleFactory,
123
+ Auther
30
124
  }
@@ -1,2 +1,2 @@
1
- const { globalSetup } = require('../test-environment');
1
+ const { globalSetup } = require('@friggframework/devtools');
2
2
  module.exports = globalSetup;
@@ -1,2 +1,2 @@
1
- const { globalTeardown } = require('../test-environment');
1
+ const { globalTeardown } = require('@friggframework/devtools');
2
2
  module.exports = globalTeardown;
@@ -3,7 +3,7 @@ const sinon = require('sinon');
3
3
  const {
4
4
  overrideEnvironment,
5
5
  restoreEnvironment,
6
- } = require('../test-environment');
6
+ } = require('@friggframework/devtools');
7
7
 
8
8
  /* eslint-disable no-console */
9
9
 
@@ -1,3 +1,3 @@
1
1
  require('dotenv').config();
2
- const { globalSetup } = require('../test-environment');
2
+ const { globalSetup } = require('@friggframework/devtools');
3
3
  module.exports = globalSetup;
@@ -1,2 +1,2 @@
1
- const { globalTeardown } = require('../test-environment');
1
+ const { globalTeardown } = require('@friggframework/devtools');
2
2
  module.exports = globalTeardown;
@@ -27,7 +27,7 @@ class ModuleFactory {
27
27
  }
28
28
 
29
29
  getModuleDefinitionFromTypeName(typeName) {
30
- return
30
+
31
31
  }
32
32
 
33
33
 
@@ -23,7 +23,8 @@ class Requester extends Delegate {
23
23
 
24
24
  if (
25
25
  contentType.match(/^application\/json/) ||
26
- contentType.match(/^application\/vnd.api\+json/)
26
+ contentType.match(/^application\/vnd.api\+json/) ||
27
+ contentType.match(/^application\/hal\+json/)
27
28
  ) {
28
29
  return resp.json();
29
30
  }
package/package.json CHANGED
@@ -1,32 +1,24 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "1.0.3-v1-alpha-package-update.5",
4
+ "version": "1.1.0-v1-alpha.0",
5
5
  "dependencies": {
6
- "@babel/eslint-parser": "^7.18.9",
7
6
  "@hapi/boom": "^10.0.1",
8
7
  "aws-sdk": "^2.1200.0",
9
8
  "bcryptjs": "^2.4.3",
10
9
  "common-tags": "^1.8.2",
11
- "eslint": "^8.22.0",
12
- "eslint-config-prettier": "^8.5.0",
13
- "eslint-plugin-json": "^3.1.0",
14
- "eslint-plugin-markdown": "^3.0.0",
15
- "eslint-plugin-no-only-tests": "^3.0.0",
16
- "eslint-plugin-yaml": "^0.5.0",
17
10
  "express": "^4.18.2",
18
11
  "express-async-handler": "^1.2.0",
19
- "jest-runner-groups": "^2.2.0",
20
12
  "lodash": "^4.17.21",
21
13
  "lodash.get": "^4.4.2",
22
- "mongodb-memory-server": "^8.9.0",
23
14
  "mongoose": "6.11.6",
24
15
  "node-fetch": "^2.6.7"
25
16
  },
26
17
  "devDependencies": {
18
+ "@friggframework/devtools": "v1-alpha",
19
+ "@friggframework/prettier-config": "^1.0.6",
27
20
  "@types/lodash": "^4.14.191",
28
21
  "@typescript-eslint/eslint-plugin": "^5.55.0",
29
- "aws-sdk": "^2.1339.0",
30
22
  "chai": "^4.3.6",
31
23
  "eslint": "^8.36.0",
32
24
  "eslint-config-standard-with-typescript": "^34.0.1",
@@ -34,8 +26,8 @@
34
26
  "eslint-plugin-n": "^15.6.1",
35
27
  "eslint-plugin-promise": "^6.1.1",
36
28
  "jest": "^28.1.3",
37
- "lodash": "^4.17.21",
38
- "open": "8.4.2",
29
+ "jest-runner-groups": "^2.2.0",
30
+ "mongodb-memory-server": "^8.9.0",
39
31
  "prettier": "^2.8.5",
40
32
  "sinon": "^14.0.0",
41
33
  "typescript": "^5.0.2"
@@ -56,5 +48,5 @@
56
48
  },
57
49
  "homepage": "https://github.com/friggframework/frigg#readme",
58
50
  "description": "",
59
- "gitHead": "afc5c3626416838485a6cec57b98b2b4387dd775"
51
+ "gitHead": "0900fdc8d00b013f41e24e08d827078bedd12d29"
60
52
  }
package/syncs/manager.js CHANGED
@@ -8,7 +8,6 @@ const { Sync } = require("./model");
8
8
 
9
9
  class SyncManager {
10
10
  constructor(params) {
11
- super(params);
12
11
  // TODO verify type????????
13
12
  // this.primaryModule = getAndVerifyType(params, 'primary', ModuleManager);
14
13
  // this.secondaryModule = getAndVerifyType(
@@ -36,7 +35,6 @@ class SyncManager {
36
35
 
37
36
  this.integration = get(params, "integration", null); // TODO Change to type validation
38
37
 
39
- Sync = new Sync();
40
38
  }
41
39
 
42
40
  // calls getAllSyncObjects() on the modules and then finds the difference between each. The Primary Module
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "@friggframework/eslint-config"
3
- }
@@ -1,17 +0,0 @@
1
- # v1.0.8 (Mon Jan 09 2023)
2
-
3
- #### 🐛 Bug Fix
4
-
5
- - Merge remote-tracking branch 'origin/main' into gitbook-updates [#48](https://github.com/friggframework/frigg/pull/48) ([@seanspeaks](https://github.com/seanspeaks))
6
- - Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
7
- - Merge remote-tracking branch 'origin/main' into simplify-mongoose-models ([@seanspeaks](https://github.com/seanspeaks))
8
- - Add READMEs for all packages and api-modules [#20](https://github.com/friggframework/frigg/pull/20) ([@seanspeaks](https://github.com/seanspeaks))
9
- - Add READMEs for all packages and api-modules ([@seanspeaks](https://github.com/seanspeaks))
10
-
11
- #### ⚠️ Pushed to `main`
12
-
13
- - Refactored for more conventional naming (at least for packages) ([@seanspeaks](https://github.com/seanspeaks))
14
-
15
- #### Authors: 1
16
-
17
- - Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
@@ -1,9 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Left Hook Inc.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +0,0 @@
1
- # eslint-config
2
-
3
- This package exports the default `eslint-config` settings used in [Frigg](https://friggframework.org). You can find its documentation [on Frigg's website](https://docs.friggframework.org/packages/eslint-config).
File without changes
@@ -1,38 +0,0 @@
1
- module.exports = {
2
- env: {
3
- commonjs: true,
4
- es2020: true,
5
- jest: true,
6
- },
7
- extends: ['prettier', 'plugin:markdown/recommended'],
8
- parser: '@babel/eslint-parser',
9
- parserOptions: {
10
- ecmaVersion: 11,
11
- requireConfigFile: false,
12
- },
13
- plugins: ['no-only-tests'],
14
- ignorePatterns: ['coverage/', '.nyc_output/'],
15
- overrides: [
16
- {
17
- files: ['*.json'],
18
- plugins: ['json'],
19
- extends: ['plugin:json/recommended'],
20
- },
21
- {
22
- files: ['*.yaml', '*.yml'],
23
- plugins: ['yaml'],
24
- extends: ['plugin:yaml/recommended'],
25
- },
26
- ],
27
- rules: {
28
- 'no-only-tests/no-only-tests': ['error', { fix: false }],
29
- 'no-unused-vars': [
30
- 'warn',
31
- { vars: 'all', args: 'after-used', ignoreRestSiblings: false },
32
- ],
33
- 'no-console': ['warn'],
34
- camelcase: ['warn'],
35
- 'no-mixed-requires': ['warn'],
36
- 'no-warning-comments': ['warn'],
37
- },
38
- };
@@ -1,3 +0,0 @@
1
- # migrations
2
-
3
- This package exports the `migrations` class and functions used in [Frigg](https://friggframework.org). You can find its documentation [on Frigg's website](https://docs.friggframework.org/packages/migrations).
File without changes
@@ -1,9 +0,0 @@
1
- const MigrationManager = require('./manager');
2
- const Migrator = require('./migrator');
3
- const MigrationOptions = require('./options');
4
-
5
- module.exports = {
6
- MigrationManager,
7
- Migrator,
8
- MigrationOptions
9
- }
@@ -1,3 +0,0 @@
1
- module.exports = async () => {
2
- preset: "@friggframework/test-environment";
3
- };
@@ -1,33 +0,0 @@
1
- const hubspotMigrator = require("./HubSpotMigrator");
2
- const salesforceMigrator = require("./SalesforceMigrator");
3
-
4
- class MigrationManager {
5
- static migratorClasses = [hubspotMigrator, salesforceMigrator];
6
-
7
- static integrationTypes = MigrationManager.migratorClasses.map(
8
- (MigratorClass) => MigratorClass.getName()
9
- );
10
-
11
- constructor() {
12
- // ...
13
- }
14
-
15
- static async getMigrator(params) {
16
- const { integrationType, fromVersion, toVersion } = params;
17
- const indexOfMigrator =
18
- MigrationManager.integrationTypes.indexOf(integrationType);
19
- if (indexOfMigrator < 0) {
20
- throw new Error(
21
- `Error: Invalid integration type of ${
22
- params.integrationType
23
- }, options are ${MigrationManager.integrationTypes.join(", ")}`
24
- );
25
- }
26
- const instance = await MigrationManager.migratorClasses[
27
- indexOfMigrator
28
- ].getInstance();
29
- return instance;
30
- }
31
- }
32
-
33
- module.exports = MigrationManager;