@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.
Files changed (31) hide show
  1. package/frigg-cli/build-command/index.js +4 -2
  2. package/frigg-cli/deploy-command/index.js +5 -2
  3. package/frigg-cli/generate-iam-command.js +115 -0
  4. package/frigg-cli/index.js +11 -1
  5. package/infrastructure/AWS-DISCOVERY-TROUBLESHOOTING.md +245 -0
  6. package/infrastructure/AWS-IAM-CREDENTIAL-NEEDS.md +594 -0
  7. package/infrastructure/DEPLOYMENT-INSTRUCTIONS.md +268 -0
  8. package/infrastructure/GENERATE-IAM-DOCS.md +253 -0
  9. package/infrastructure/IAM-POLICY-TEMPLATES.md +174 -0
  10. package/infrastructure/README-TESTING.md +332 -0
  11. package/infrastructure/WEBSOCKET-CONFIGURATION.md +105 -0
  12. package/infrastructure/__tests__/fixtures/mock-aws-resources.js +391 -0
  13. package/infrastructure/__tests__/helpers/test-utils.js +277 -0
  14. package/infrastructure/aws-discovery.js +568 -0
  15. package/infrastructure/aws-discovery.test.js +373 -0
  16. package/infrastructure/build-time-discovery.js +206 -0
  17. package/infrastructure/build-time-discovery.test.js +375 -0
  18. package/infrastructure/create-frigg-infrastructure.js +10 -2
  19. package/infrastructure/frigg-deployment-iam-stack.yaml +377 -0
  20. package/infrastructure/iam-generator.js +696 -0
  21. package/infrastructure/iam-generator.test.js +169 -0
  22. package/infrastructure/iam-policy-basic.json +210 -0
  23. package/infrastructure/iam-policy-full.json +280 -0
  24. package/infrastructure/integration.test.js +383 -0
  25. package/infrastructure/run-discovery.js +110 -0
  26. package/infrastructure/serverless-template.js +606 -27
  27. package/infrastructure/serverless-template.test.js +498 -0
  28. package/package.json +9 -5
  29. package/test/auther-definition-tester.js +125 -0
  30. package/test/index.js +4 -2
  31. package/test/mock-integration.js +14 -4
@@ -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
- // todo: create module using the new architecture
23
- const module = {}
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
- // todo: create integration using the new architecture
48
- const integration = {}
54
+ const integration = await integrationFactory.createIntegration(
55
+ entities,
56
+ userId,
57
+ config
58
+ );
49
59
 
50
60
  integration.id = integration.record._id;
51
61