@friggframework/devtools 2.0.0--canary.397.4957a89.0 → 2.0.0--canary.398.bdb6d27.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/frigg-cli/build-command/index.js +4 -2
- package/frigg-cli/deploy-command/index.js +5 -2
- package/frigg-cli/generate-iam-command.js +115 -0
- package/frigg-cli/index.js +11 -1
- package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +245 -0
- package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +594 -0
- package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +268 -0
- package/infrastructure/GENERATE-IAM-DOCS.md +253 -0
- package/infrastructure/IAM-POLICY-TEMPLATES.md +174 -0
- package/infrastructure/README-TESTING.md +332 -0
- package/infrastructure/WEBSOCKET-CONFIGURATION.md +105 -0
- package/infrastructure/__tests__/fixtures/mock-aws-resources.js +391 -0
- package/infrastructure/__tests__/helpers/test-utils.js +277 -0
- package/infrastructure/aws-discovery.js +568 -0
- package/infrastructure/aws-discovery.test.js +373 -0
- package/infrastructure/build-time-discovery.js +206 -0
- package/infrastructure/build-time-discovery.test.js +375 -0
- package/infrastructure/create-frigg-infrastructure.js +10 -2
- package/infrastructure/frigg-deployment-iam-stack.yaml +377 -0
- package/infrastructure/iam-generator.js +696 -0
- package/infrastructure/iam-generator.test.js +169 -0
- package/infrastructure/iam-policy-basic.json +210 -0
- package/infrastructure/iam-policy-full.json +280 -0
- package/infrastructure/integration.test.js +383 -0
- package/infrastructure/run-discovery.js +110 -0
- package/infrastructure/serverless-template.js +606 -27
- package/infrastructure/serverless-template.test.js +498 -0
- package/package.json +9 -5
- package/test/auther-definition-tester.js +125 -0
- package/test/index.js +4 -2
- package/test/mock-integration.js +14 -4
package/test/mock-integration.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
const {
|
|
2
|
+
Auther,
|
|
3
|
+
Credential,
|
|
4
|
+
Entity,
|
|
5
|
+
IntegrationFactory,
|
|
2
6
|
createObjectId,
|
|
3
7
|
} = require('@friggframework/core');
|
|
4
8
|
|
|
@@ -7,6 +11,7 @@ async function createMockIntegration(
|
|
|
7
11
|
userId = null,
|
|
8
12
|
config = { type: IntegrationClass.Definition.name }
|
|
9
13
|
) {
|
|
14
|
+
const integrationFactory = new IntegrationFactory([IntegrationClass]);
|
|
10
15
|
userId = userId || createObjectId();
|
|
11
16
|
|
|
12
17
|
const insertOptions = {
|
|
@@ -19,8 +24,10 @@ async function createMockIntegration(
|
|
|
19
24
|
const entities = [];
|
|
20
25
|
for (const moduleName in IntegrationClass.modules) {
|
|
21
26
|
const ModuleDef = IntegrationClass.Definition.modules[moduleName];
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
const module = await Auther.getInstance({
|
|
28
|
+
definition: ModuleDef,
|
|
29
|
+
userId: userId,
|
|
30
|
+
});
|
|
24
31
|
const credential = await module.CredentialModel.findOneAndUpdate(
|
|
25
32
|
user,
|
|
26
33
|
{ $set: user },
|
|
@@ -44,8 +51,11 @@ async function createMockIntegration(
|
|
|
44
51
|
);
|
|
45
52
|
}
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
const integration = await integrationFactory.createIntegration(
|
|
55
|
+
entities,
|
|
56
|
+
userId,
|
|
57
|
+
config
|
|
58
|
+
);
|
|
49
59
|
|
|
50
60
|
integration.id = integration.record._id;
|
|
51
61
|
|