@friggframework/devtools 1.2.0-canary.293.5731c31.0 → 1.2.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.
- package/CHANGELOG.md +117 -0
- package/README.md +80 -0
- package/frigg-cli/backendJs.js +33 -0
- package/frigg-cli/backendPath.js +26 -0
- package/frigg-cli/commitChanges.js +16 -0
- package/frigg-cli/environmentVariables.js +134 -0
- package/frigg-cli/environmentVariables.test.js +86 -0
- package/frigg-cli/index.js +14 -0
- package/frigg-cli/index.test.js +109 -0
- package/frigg-cli/installCommand.js +57 -0
- package/frigg-cli/installPackage.js +13 -0
- package/frigg-cli/integrationFile.js +30 -0
- package/frigg-cli/logger.js +12 -0
- package/frigg-cli/template.js +90 -0
- package/frigg-cli/validatePackage.js +79 -0
- package/index.js +2 -6
- package/package.json +16 -6
- package/test/auther-definition-method-tester.js +45 -0
- package/test/auther-definition-tester.js +125 -0
- package/test/index.js +11 -0
- package/{test-environment → test}/mock-api.js +1 -1
- package/test/mock-integration.js +83 -0
- 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/jest.config.js +0 -3
- 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 -74
- package/test-environment/CHANGELOG.md +0 -46
- package/test-environment/LICENSE.md +0 -9
- package/test-environment/README.md +0 -3
- package/test-environment/bump3.txt +0 -0
- package/test-environment/index.js +0 -21
- 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/mongodb.js +0 -22
- package/test-environment/override-environment.js +0 -11
- /package/{eslint-config/.eslintrc.json → .eslintrc.json} +0 -0
- /package/{test-environment → test}/integration-validator.js +0 -0
- /package/{test-environment → test}/mock-api-readme.md +0 -0
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
|
|
@@ -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,74 +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, browserName = undefined) {
|
|
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
|
-
const options = browserName ? {app: {name: browserName }} : undefined
|
|
53
|
-
// open the browser to the authorize url to start the workflow
|
|
54
|
-
open(authorizeUrl, options).then((childProcess) => {
|
|
55
|
-
childProcess.unref();
|
|
56
|
-
clearTimeout(timeoutId);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const timeoutId = setTimeout(() => {
|
|
61
|
-
if (server.listening) {
|
|
62
|
-
try {
|
|
63
|
-
server.close();
|
|
64
|
-
} finally {
|
|
65
|
-
throw new Error(
|
|
66
|
-
'Authenticator timed out before authentication completed in the browser.'
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}, 59_000);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
module.exports = Authenticator;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# v1.1.6 (Tue Jan 31 2023)
|
|
2
|
-
|
|
3
|
-
#### 🐛 Bug Fix
|
|
4
|
-
|
|
5
|
-
- Updates/api module yotpo [#108](https://github.com/friggframework/frigg/pull/108) ([@seanspeaks](https://github.com/seanspeaks))
|
|
6
|
-
- # mock-api.js Work in Progress ([@seanspeaks](https://github.com/seanspeaks))
|
|
7
|
-
- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
8
|
-
|
|
9
|
-
#### Authors: 1
|
|
10
|
-
|
|
11
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# v1.1.5 (Mon Jan 09 2023)
|
|
16
|
-
|
|
17
|
-
#### 🐛 Bug Fix
|
|
18
|
-
|
|
19
|
-
- Merge remote-tracking branch 'origin/main' into gitbook-updates [#48](https://github.com/friggframework/frigg/pull/48) ([@seanspeaks](https://github.com/seanspeaks))
|
|
20
|
-
- Bump independent versions \[skip ci\] ([@seanspeaks](https://github.com/seanspeaks))
|
|
21
|
-
- Merge remote-tracking branch 'origin/main' into simplify-mongoose-models ([@seanspeaks](https://github.com/seanspeaks))
|
|
22
|
-
- Add READMEs for all packages and api-modules [#20](https://github.com/friggframework/frigg/pull/20) ([@seanspeaks](https://github.com/seanspeaks))
|
|
23
|
-
- Add READMEs for all packages and api-modules ([@seanspeaks](https://github.com/seanspeaks))
|
|
24
|
-
|
|
25
|
-
#### ⚠️ Pushed to `main`
|
|
26
|
-
|
|
27
|
-
- Merge branch 'main' into gitbook-updates ([@seanspeaks](https://github.com/seanspeaks))
|
|
28
|
-
- Refactored for more conventional naming (at least for packages) ([@seanspeaks](https://github.com/seanspeaks))
|
|
29
|
-
|
|
30
|
-
#### Authors: 1
|
|
31
|
-
|
|
32
|
-
- Sean Matthews ([@seanspeaks](https://github.com/seanspeaks))
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
# v1.1.4 (Mon Sep 19 2022)
|
|
37
|
-
|
|
38
|
-
#### 🐛 Bug Fix
|
|
39
|
-
|
|
40
|
-
- Test environment setup for all modules [#49](https://github.com/friggframework/frigg/pull/49) ([@seanspeaks](https://github.com/seanspeaks))
|
|
41
|
-
- Test environment setup for all modules ([@seanspeaks](https://github.com/seanspeaks))
|
|
42
|
-
- Merge remote-tracking branch 'origin/main' into gitbook-updates [#48](https://github.com/friggframework/frigg/pull/48) ([@seanspeaks](https://github.com/seanspeaks))
|
|
43
|
-
|
|
44
|
-
#### Authors: 1
|
|
45
|
-
|
|
46
|
-
- 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
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const { TestMongo } = require('./mongodb');
|
|
2
|
-
const {
|
|
3
|
-
overrideEnvironment,
|
|
4
|
-
restoreEnvironment,
|
|
5
|
-
} = require('./override-environment');
|
|
6
|
-
const globalTeardown = require('./jest-global-teardown');
|
|
7
|
-
const globalSetup = require('./jest-global-setup');
|
|
8
|
-
const Authenticator = require('./Authenticator')
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
TestMongo,
|
|
12
|
-
overrideEnvironment,
|
|
13
|
-
restoreEnvironment,
|
|
14
|
-
globalTeardown,
|
|
15
|
-
globalSetup,
|
|
16
|
-
createMockIntegration,
|
|
17
|
-
createMockApiObject,
|
|
18
|
-
testDefinitionRequiredAuthMethods,
|
|
19
|
-
testAutherDefinition,
|
|
20
|
-
Authenticator
|
|
21
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const { MongoMemoryServer } = require('mongodb-memory-server');
|
|
2
|
-
|
|
3
|
-
class TestMongo {
|
|
4
|
-
#mongoServer;
|
|
5
|
-
|
|
6
|
-
// Start the in-memory mongo instance and set env variable for the app to use in its connection.
|
|
7
|
-
async start() {
|
|
8
|
-
this.#mongoServer = await MongoMemoryServer.create();
|
|
9
|
-
process.env.MONGO_URI = this.#mongoServer.getUri();
|
|
10
|
-
console.log('Started in memory mongo server', process.env.MONGO_URI);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async stop() {
|
|
14
|
-
await this.#mongoServer.stop();
|
|
15
|
-
process.env.MONGO_URI = undefined;
|
|
16
|
-
this.#mongoServer = undefined;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
module.exports = {
|
|
21
|
-
TestMongo,
|
|
22
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const originalEnv = process.env;
|
|
2
|
-
|
|
3
|
-
function overrideEnvironment(overrideByKey) {
|
|
4
|
-
process.env = { ...process.env, ...overrideByKey };
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function restoreEnvironment() {
|
|
8
|
-
process.env = originalEnv;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = { overrideEnvironment, restoreEnvironment };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|