@friggframework/core 1.0.1-v1-alpha-package-update.2 → 1.0.1-v1-alpha.1
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.
- package/bump0.txt +1 -0
- package/encrypt/encrypt.test.js +1 -1
- package/errors/fetch-error.js +5 -1
- package/index.js +1 -7
- package/integrations/jest-setup.js +1 -1
- package/integrations/jest-teardown.js +1 -1
- package/logs/logger.test.js +1 -1
- package/module-plugin/jest-setup.js +1 -1
- package/module-plugin/jest-teardown.js +1 -1
- package/module-plugin/requester/requester.js +2 -1
- package/package.json +5 -14
- package/eslint-config/.eslintrc.json +0 -3
- package/eslint-config/CHANGELOG.md +0 -17
- package/eslint-config/LICENSE.md +0 -9
- package/eslint-config/README.md +0 -3
- package/eslint-config/bump3.txt +0 -0
- package/eslint-config/index.js +0 -38
- package/migrations/README.md +0 -3
- package/migrations/bump3.txt +0 -0
- package/migrations/index.js +0 -9
- package/migrations/jest.config.js +0 -3
- package/migrations/manager.js +0 -33
- package/migrations/migrator.js +0 -170
- package/migrations/options.js +0 -28
- package/prettier-config/.eslintrc.json +0 -3
- package/prettier-config/CHANGELOG.md +0 -17
- package/prettier-config/LICENSE.md +0 -9
- package/prettier-config/README.md +0 -3
- package/prettier-config/bump3.txt +0 -0
- package/prettier-config/index.js +0 -6
- package/test-environment/.eslintrc.json +0 -3
- package/test-environment/Authenticator.js +0 -73
- package/test-environment/CHANGELOG.md +0 -46
- package/test-environment/LICENSE.md +0 -9
- package/test-environment/README.md +0 -3
- package/test-environment/auther-definition-method-tester.js +0 -45
- package/test-environment/auther-definition-tester.js +0 -104
- package/test-environment/bump3.txt +0 -0
- package/test-environment/index.js +0 -24
- package/test-environment/integration-validator.js +0 -2
- package/test-environment/jest-global-setup.js +0 -6
- package/test-environment/jest-global-teardown.js +0 -3
- package/test-environment/jest-preset.js +0 -14
- package/test-environment/mock-api-readme.md +0 -102
- package/test-environment/mock-api.js +0 -284
- package/test-environment/mock-integration.js +0 -82
- package/test-environment/mongodb.js +0 -22
- package/test-environment/override-environment.js +0 -11
package/bump0.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2
|
package/encrypt/encrypt.test.js
CHANGED
|
@@ -8,7 +8,7 @@ const {
|
|
|
8
8
|
createModel,
|
|
9
9
|
saveTestDocument,
|
|
10
10
|
} = require('./test-encrypt');
|
|
11
|
-
const { TestMongo } = require('
|
|
11
|
+
const { TestMongo } = require('@friggframework/devtools');
|
|
12
12
|
|
|
13
13
|
const testMongo = new TestMongo();
|
|
14
14
|
const originalEnv = process.env;
|
package/errors/fetch-error.js
CHANGED
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
const core = require('./core/index');
|
|
3
3
|
const database = require('./database/index');
|
|
4
4
|
const assertions = require('./assertions/index');
|
|
@@ -9,13 +9,9 @@ const lambda = require('./lambda/index');
|
|
|
9
9
|
const logs = require('./logs/index');
|
|
10
10
|
const modulePlugin = require('./module-plugin/index');
|
|
11
11
|
|
|
12
|
-
const eslintConfig = require('./eslint-config')
|
|
13
|
-
const prettierConfig = require('./prettier-config')
|
|
14
|
-
|
|
15
12
|
// const {Sync } = require('./syncs/model');
|
|
16
13
|
|
|
17
14
|
module.exports = {
|
|
18
|
-
...testEnvironment,
|
|
19
15
|
...core,
|
|
20
16
|
...database,
|
|
21
17
|
...assertions,
|
|
@@ -25,6 +21,4 @@ module.exports = {
|
|
|
25
21
|
...lambda,
|
|
26
22
|
...logs,
|
|
27
23
|
...modulePlugin,
|
|
28
|
-
eslintConfig,
|
|
29
|
-
prettierConfig
|
|
30
24
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const { globalSetup } = require('
|
|
1
|
+
const { globalSetup } = require('@friggframework/devtools');
|
|
2
2
|
module.exports = globalSetup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const { globalTeardown } = require('
|
|
1
|
+
const { globalTeardown } = require('@friggframework/devtools');
|
|
2
2
|
module.exports = globalTeardown;
|
package/logs/logger.test.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const { globalTeardown } = require('
|
|
1
|
+
const { globalTeardown } = require('@friggframework/devtools');
|
|
2
2
|
module.exports = globalTeardown;
|
|
@@ -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,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "1.0.1-v1-alpha
|
|
4
|
+
"version": "1.0.1-v1-alpha.1",
|
|
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": "1.0.1-v1-alpha.1",
|
|
27
19
|
"@types/lodash": "^4.14.191",
|
|
28
20
|
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
|
29
|
-
"aws-sdk": "^2.1339.0",
|
|
30
21
|
"chai": "^4.3.6",
|
|
31
22
|
"eslint": "^8.36.0",
|
|
32
23
|
"eslint-config-standard-with-typescript": "^34.0.1",
|
|
@@ -34,8 +25,8 @@
|
|
|
34
25
|
"eslint-plugin-n": "^15.6.1",
|
|
35
26
|
"eslint-plugin-promise": "^6.1.1",
|
|
36
27
|
"jest": "^28.1.3",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
28
|
+
"jest-runner-groups": "^2.2.0",
|
|
29
|
+
"mongodb-memory-server": "^8.9.0",
|
|
39
30
|
"prettier": "^2.8.5",
|
|
40
31
|
"sinon": "^14.0.0",
|
|
41
32
|
"typescript": "^5.0.2"
|
|
@@ -56,5 +47,5 @@
|
|
|
56
47
|
},
|
|
57
48
|
"homepage": "https://github.com/friggframework/frigg#readme",
|
|
58
49
|
"description": "",
|
|
59
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "c63d67db8bb7801469fd7c84132dd977eaa4ef5b"
|
|
60
51
|
}
|
|
@@ -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))
|
package/eslint-config/LICENSE.md
DELETED
|
@@ -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.
|
package/eslint-config/README.md
DELETED
package/eslint-config/bump3.txt
DELETED
|
File without changes
|
package/eslint-config/index.js
DELETED
|
@@ -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
|
-
};
|
package/migrations/README.md
DELETED
package/migrations/bump3.txt
DELETED
|
File without changes
|
package/migrations/index.js
DELETED
package/migrations/manager.js
DELETED
|
@@ -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;
|
package/migrations/migrator.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
const { Delegate } = require('../core');
|
|
2
|
-
const { Integration } = require('../integrations');
|
|
3
|
-
const { get } = require('../assertions');
|
|
4
|
-
|
|
5
|
-
class Migrator extends Delegate {
|
|
6
|
-
constructor(params) {
|
|
7
|
-
super(params);
|
|
8
|
-
this.options = [];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
static getInstance() {
|
|
12
|
-
const instance = new this();
|
|
13
|
-
return instance;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
static getName() {
|
|
17
|
-
return this.integrationManager.getName();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async migrate(params) {
|
|
21
|
-
try {
|
|
22
|
-
const fromVersion = get(params, "fromVersion", null);
|
|
23
|
-
const toVersion = get(params, "toVersion");
|
|
24
|
-
|
|
25
|
-
console.log("Migrate called. First validating whether it can be done.");
|
|
26
|
-
if (
|
|
27
|
-
!this.integrationManager.Config.supportedVersions.some(
|
|
28
|
-
(version) => version === toVersion
|
|
29
|
-
)
|
|
30
|
-
) {
|
|
31
|
-
return this.throwException(
|
|
32
|
-
`Attempting to migrate to an unsupported version. Current supported versions are ${this.integrationManager.Config.supportedVersions.join(
|
|
33
|
-
", "
|
|
34
|
-
)}`,
|
|
35
|
-
"Migration Error"
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
const migrationOption = this.options
|
|
39
|
-
.map((val) => val.get())
|
|
40
|
-
.find(
|
|
41
|
-
(option) =>
|
|
42
|
-
option.fromVersion === fromVersion && option.toVersion === toVersion
|
|
43
|
-
);
|
|
44
|
-
if (!migrationOption)
|
|
45
|
-
return this.throwException(
|
|
46
|
-
`No migration option found for version ${fromVersion} to ${toVersion}`,
|
|
47
|
-
"Migration Error"
|
|
48
|
-
);
|
|
49
|
-
// Run all general functions
|
|
50
|
-
for (const generalFunct of migrationOption.generalFunctions) {
|
|
51
|
-
console.log("Running general functions first");
|
|
52
|
-
const res = await generalFunct();
|
|
53
|
-
console.log(res);
|
|
54
|
-
}
|
|
55
|
-
// Get all integration records based on fromVersion
|
|
56
|
-
const filter = {
|
|
57
|
-
"config.type": this.integrationManager.getName(),
|
|
58
|
-
};
|
|
59
|
-
console.log(
|
|
60
|
-
`Retrieved all ${this.integrationManager.getName()} integrations`
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
const integrations = await Integration.find(filter);
|
|
64
|
-
const filteredIntegrations = integrations.filter((int) => {
|
|
65
|
-
const isNotToVersion = int.version !== toVersion;
|
|
66
|
-
let isFromVersion = true;
|
|
67
|
-
if (fromVersion && fromVersion !== "*") {
|
|
68
|
-
isFromVersion = int.version === fromVersion;
|
|
69
|
-
}
|
|
70
|
-
return isNotToVersion && isFromVersion;
|
|
71
|
-
});
|
|
72
|
-
const results = {
|
|
73
|
-
integrationType: this.integrationManager.getName(),
|
|
74
|
-
totalIntegrations: integrations.length,
|
|
75
|
-
versionReport: {
|
|
76
|
-
startVersions: {},
|
|
77
|
-
endVersions: {},
|
|
78
|
-
},
|
|
79
|
-
statusReport: {
|
|
80
|
-
startStatuses: {},
|
|
81
|
-
endStatuses: {},
|
|
82
|
-
},
|
|
83
|
-
toMigrate: filteredIntegrations.length,
|
|
84
|
-
migrationResults: {
|
|
85
|
-
success: 0,
|
|
86
|
-
needsConfig: 0,
|
|
87
|
-
error: 0,
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
for (const integration of integrations) {
|
|
92
|
-
if (results.versionReport.startVersions[integration.version]) {
|
|
93
|
-
results.versionReport.startVersions[integration.version] += 1;
|
|
94
|
-
} else {
|
|
95
|
-
results.versionReport.startVersions[integration.version] = 1;
|
|
96
|
-
}
|
|
97
|
-
if (results.statusReport.startStatuses[integration.status]) {
|
|
98
|
-
results.statusReport.startStatuses[integration.status] += 1;
|
|
99
|
-
} else {
|
|
100
|
-
results.statusReport.startStatuses[integration.status] = 1;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Instantiate the integrationManager based on integration ID, run all specific functions for each integration
|
|
105
|
-
for (const integration of filteredIntegrations) {
|
|
106
|
-
let integrationManagerInstance;
|
|
107
|
-
try {
|
|
108
|
-
integrationManagerInstance =
|
|
109
|
-
await this.integrationManager.getInstanceFromIntegrationId({
|
|
110
|
-
integrationId: integration.id,
|
|
111
|
-
userId: integration.user.id,
|
|
112
|
-
});
|
|
113
|
-
} catch (e) {
|
|
114
|
-
console.log(e);
|
|
115
|
-
}
|
|
116
|
-
// Test Auth
|
|
117
|
-
if (integrationManagerInstance) {
|
|
118
|
-
await integrationManagerInstance.testAuth();
|
|
119
|
-
|
|
120
|
-
// Run functions
|
|
121
|
-
if (integrationManagerInstance.integration.status !== "ERROR") {
|
|
122
|
-
for (const func of migrationOption.perIntegrationFunctions) {
|
|
123
|
-
const res = await func(integrationManagerInstance);
|
|
124
|
-
console.log(res);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Validate Config
|
|
129
|
-
if (integrationManagerInstance.integration.status !== "ERROR") {
|
|
130
|
-
await integrationManagerInstance.validateConfig();
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Add to results tally
|
|
134
|
-
const currentStatus = integrationManagerInstance.integration.status;
|
|
135
|
-
if (currentStatus === "ENABLED") {
|
|
136
|
-
integrationManagerInstance.integration.version = toVersion;
|
|
137
|
-
await integrationManagerInstance.integration.save();
|
|
138
|
-
results.migrationResults.success += 1;
|
|
139
|
-
}
|
|
140
|
-
if (currentStatus === "NEEDS_CONFIG") {
|
|
141
|
-
integrationManagerInstance.integration.version = toVersion;
|
|
142
|
-
await integrationManagerInstance.integration.save();
|
|
143
|
-
results.migrationResults.needsConfig += 1;
|
|
144
|
-
}
|
|
145
|
-
if (currentStatus === "ERROR") results.migrationResults.error += 1;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const freshRetrieve = await Integration.find(filter);
|
|
150
|
-
for (const int of freshRetrieve) {
|
|
151
|
-
if (results.versionReport.endVersions[int.version]) {
|
|
152
|
-
results.versionReport.endVersions[int.version] += 1;
|
|
153
|
-
} else {
|
|
154
|
-
results.versionReport.endVersions[int.version] = 1;
|
|
155
|
-
}
|
|
156
|
-
if (results.statusReport.endStatuses[int.status]) {
|
|
157
|
-
results.statusReport.endStatuses[int.status] += 1;
|
|
158
|
-
} else {
|
|
159
|
-
results.statusReport.endStatuses[int.status] = 1;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return results;
|
|
164
|
-
} catch (e) {
|
|
165
|
-
this.throwException(e.message, "Migrate Error");
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
module.exports = Migrator;
|
package/migrations/options.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const IntegrationManager = require('../integrations');
|
|
2
|
-
const { get, getAndVerifyType } = require('../assertions');
|
|
3
|
-
|
|
4
|
-
class Options {
|
|
5
|
-
constructor(params) {
|
|
6
|
-
this.integrationManager = getAndVerifyType(
|
|
7
|
-
params,
|
|
8
|
-
"integrationManager",
|
|
9
|
-
IntegrationManager
|
|
10
|
-
);
|
|
11
|
-
this.fromVersion = get(params, "fromVersion");
|
|
12
|
-
this.toVersion = get(params, "toVersion");
|
|
13
|
-
this.generalFunctions = get(params, "generalFunctions", []);
|
|
14
|
-
this.perIntegrationFunctions = get(params, "perIntegrationFunctions", []);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
get() {
|
|
18
|
-
return {
|
|
19
|
-
type: this.integrationManager.getName(),
|
|
20
|
-
fromVersion: this.fromVersion,
|
|
21
|
-
toVersion: this.toVersion,
|
|
22
|
-
generalFunctions: this.generalFunctions,
|
|
23
|
-
perIntegrationFunctions: this.perIntegrationFunctions,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
module.exports = Options;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# v1.0.6 (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.
|
|
File without changes
|
package/prettier-config/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// "use strict";
|
|
2
|
-
const http = require('http');
|
|
3
|
-
const url = require('url');
|
|
4
|
-
const open = require('open');
|
|
5
|
-
|
|
6
|
-
class Authenticator {
|
|
7
|
-
static searchParamsToDictionary(params) {
|
|
8
|
-
const entries = params.entries();
|
|
9
|
-
const result = {};
|
|
10
|
-
for (const entry of entries) {
|
|
11
|
-
const [key, value] = entry;
|
|
12
|
-
result[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static async oauth2(authorizeUrl, port = 3000) {
|
|
18
|
-
return new Promise((resolve, reject) => {
|
|
19
|
-
const server = http
|
|
20
|
-
.createServer(async (req, res) => {
|
|
21
|
-
try {
|
|
22
|
-
const qs = new url.URL(
|
|
23
|
-
req.url,
|
|
24
|
-
`http://localhost:${port}`
|
|
25
|
-
).searchParams;
|
|
26
|
-
|
|
27
|
-
// gets the last parameter in the slash
|
|
28
|
-
const urlPostfix = req.url.split('?')[0];
|
|
29
|
-
|
|
30
|
-
const params =
|
|
31
|
-
Authenticator.searchParamsToDictionary(qs);
|
|
32
|
-
|
|
33
|
-
res.end(
|
|
34
|
-
`<h1 style="position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);">Feel free to close the Brow Brow now</h1>
|
|
35
|
-
<style>@media (prefers-color-scheme: dark) {
|
|
36
|
-
body {
|
|
37
|
-
color: #b0b0b0;
|
|
38
|
-
background-color: #101010;
|
|
39
|
-
}
|
|
40
|
-
</style>`
|
|
41
|
-
);
|
|
42
|
-
server.close();
|
|
43
|
-
resolve({
|
|
44
|
-
base: urlPostfix,
|
|
45
|
-
data: params,
|
|
46
|
-
});
|
|
47
|
-
} catch (e) {
|
|
48
|
-
reject(e);
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
.listen(port, () => {
|
|
52
|
-
// open the browser to the authorize url to start the workflow
|
|
53
|
-
open(authorizeUrl).then((childProcess) => {
|
|
54
|
-
childProcess.unref();
|
|
55
|
-
clearTimeout(timeoutId);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const timeoutId = setTimeout(() => {
|
|
60
|
-
if (server.listening) {
|
|
61
|
-
try {
|
|
62
|
-
server.close();
|
|
63
|
-
} finally {
|
|
64
|
-
throw new Error(
|
|
65
|
-
'Authenticator timed out before authentication completed in the browser.'
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, 59_000);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
module.exports = Authenticator;
|