@izara_project/izara-core-generate-service-code 1.0.53 → 1.0.55

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 (146) hide show
  1. package/package.json +1 -2
  2. package/src/codeGenerators/app/initial_setup/InitialSetupGenerator.js +1 -1
  3. package/src/codeGenerators/app/sls_yaml/FindDataYamlGenerator.js +23 -0
  4. package/src/codeGenerators/app/sls_yaml/FunctionYamlGenerator.js +16 -16
  5. package/src/codeGenerators/app/sls_yaml/ProcessLogicalYamlGenerator.js +11 -25
  6. package/src/codeGenerators/app/sls_yaml/RoleNameConfigGenerator.js +1 -1
  7. package/src/codeGenerators/app/sls_yaml/SharedResourceYamlGenerator.js +3 -3
  8. package/src/codeGenerators/app/sls_yaml/renderYamlTemplate.js +13 -0
  9. package/src/codeGenerators/app/sls_yaml/templates/SharedResource_Yaml.ejs +6 -2
  10. package/src/codeGenerators/app/src/generatedCode/FindData/FindDataGenerator.js +10 -44
  11. package/src/codeGenerators/app/src/generatedCode/Flow/FlowEndpoints/EndpointsGenerator.js +119 -0
  12. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/RbacFlowGenerator.js +91 -52
  13. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/RelationshipFlowGenerator.js +20 -16
  14. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/StatusFieldGenerator.js +2 -9
  15. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/WebSocketGenerator.js +1 -7
  16. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/BaseSqsHandler.js +3 -3
  17. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/s3Components/ConfirmAfterUploadS3Generator.js +2 -4
  18. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/s3Components/CreateObjectGenerator.js +2 -4
  19. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/s3Components/CreatePreSignUrlGenerator.js +2 -4
  20. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/s3Components/ProcessAfterUploadS3Generator.js +5 -5
  21. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/s3Components/ReservedLimitGenerator.js +2 -4
  22. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowEntryPointBase.js +6 -6
  23. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowMainFunctionBase.js +3 -3
  24. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowStepBase.js +11 -11
  25. package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/triggerCacheBase.js +1 -7
  26. package/src/codeGenerators/app/src/generatedCode/ProcessLogical/ProcessLogicalGenerator.js +18 -15
  27. package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/{PaginateProcessLogical_HdrDsq.js → PaginateProcessLogical_HdrDsq.ejs} +1 -1
  28. package/src/codeGenerators/app/src/generatedCode/SystemFlowSchemas/RegisterGenerator.js +127 -149
  29. package/src/codeGenerators/app/src/generatedCode/libs/ConstsGenerator.js +16 -8
  30. package/src/codeGenerators/app/src/generatedCode/libs/GenerateCodeLibsGenerator.js +17 -9
  31. package/src/codeGenerators/resource/sls_yaml/DynamoDBGenerator.js +8 -8
  32. package/src/codeGenerators/resource/sls_yaml/FlowOutGenerator.js +60 -43
  33. package/src/codeGenerators/resource/sls_yaml/FlowResourceYamlGenerator.js +151 -151
  34. package/src/codeGenerators/resource/sls_yaml/templates/crud/ResourceYaml.ejs +10 -10
  35. package/src/core/renderTemplateFile.js +22 -0
  36. package/src/generateCode.js +146 -81
  37. package/src/generateIntTest.js +45 -69
  38. package/src/generateResourceIntTest.js +22 -47
  39. package/src/intTestGeneratorShared.js +36 -0
  40. package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/DynamicFlowSchemaTemplate.ejs +12 -10
  41. package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/RelationshipFlowSchemaTemplate.ejs +6 -5
  42. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/flowSchemaMainFunction/data.js +0 -119
  43. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/flowSchemaMainFunction/template.ejs +0 -89
  44. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/flowSchemaMainFunction/templateByStatusType/statusFieldTemplate.ejs +0 -30
  45. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/flowSchemaMainFunction/templateByStatusType/storedCacheTemplate.ejs +0 -26
  46. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/flowSchemaMainFunction/templateByStatusType/triggerCacheTemplate.ejs +0 -44
  47. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/index.js +0 -80
  48. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/functionYaml/data.js +0 -129
  49. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/functionYaml/template.ejs +0 -17
  50. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/handler/data.js +0 -63
  51. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/mainFunction/data.js +0 -54
  52. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/mainFunction/template.ejs +0 -129
  53. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/queue/data.js +0 -63
  54. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/queue/template.ejs +0 -45
  55. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/functionYaml/data.js +0 -117
  56. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/functionYaml/template.ejs +0 -20
  57. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/handler/data.js +0 -64
  58. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/mainFunction/data.js +0 -64
  59. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/mainFunction/template.ejs +0 -131
  60. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/functionYaml/data.js +0 -122
  61. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/functionYaml/template.ejs +0 -17
  62. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/handler/data.js +0 -66
  63. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/handler/template.ejs +0 -99
  64. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/mainFunction/data.js +0 -64
  65. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/mainFunction/template.ejs +0 -82
  66. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/sns-sqs/data.js +0 -70
  67. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/sns-sqs/template.ejs +0 -49
  68. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/functionYaml/data.js +0 -139
  69. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/functionYaml/template.ejs +0 -18
  70. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/handler/data.js +0 -63
  71. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/mainFunction/data.js +0 -63
  72. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/mainFunction/template.ejs +0 -262
  73. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/queue/data.js +0 -63
  74. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/queue/template.ejs +0 -45
  75. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/functionYaml/data.js +0 -146
  76. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +0 -14
  77. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/handler/data.js +0 -64
  78. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/mainFunction/data.js +0 -59
  79. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +0 -173
  80. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/sqs/data.js +0 -67
  81. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/sqs/template.ejs +0 -53
  82. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/functionYml/HdrS3/data.js +0 -140
  83. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/functionYml/HdrS3/template.ejs +0 -25
  84. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/handler/handlerS3/data.js +0 -49
  85. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/handler/handlerS3/template.ejs +0 -50
  86. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +0 -182
  87. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/mainFunction/data.js +0 -49
  88. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/mainFunction/template.ejs +0 -66
  89. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/queue/data.js +0 -77
  90. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/queue/dsqTemplatePath.ejs +0 -32
  91. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/queue/s3Template.ejs +0 -59
  92. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/relate/S3/data.js +0 -61
  93. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/relate/S3/template.ejs +0 -13
  94. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/relate/sns-out/data.js +0 -70
  95. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/websocket/dynamoDb/ReservedTableData.js +0 -69
  96. package/src/codeGenerators/app/src/generatedCode/Flow/SystemFlowDescriptorBuilder.js +0 -151
  97. /package/src/codeGenerators/app/{src/generatedCode/FindData → sls_yaml}/templates/FindData_Yaml.ejs +0 -0
  98. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared/endpoint → FlowEndpoints/templates}/FlowEndpointBeforeLogical_Main.ejs +0 -0
  99. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/endpoint/FlowEndpoint_HdrWbs.ejs +0 -0
  100. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/endpoint/FlowEndpoint_Main.ejs +0 -0
  101. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/endpoint/FlowEntryPoint_Main.ejs +0 -0
  102. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/endpoint/FlowMain_Wbs.ejs +0 -0
  103. /package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/{s3Legacy/upload/confirmReserved/handler/template.ejs → s3/ConfirmReserved_HdrSqs.ejs} +0 -0
  104. /package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/{s3Legacy/upload/createObject/handler/template.ejs → s3/CreateObject_HdrWbs.ejs} +0 -0
  105. /package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/{s3Legacy/upload/preSignUrl/createPreSignUrl/handler/template.ejs → s3/CreatePreSignUrl_HdrSqs.ejs} +0 -0
  106. /package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/{s3Legacy/upload/preSignUrl/reservedLimit/handler/template.ejs → s3/ReservedLimit_HdrSqs.ejs} +0 -0
  107. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/FlowEndpointComplete_Main.ejs +0 -0
  108. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/FlowStep_Main.ejs +0 -0
  109. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/plugIns/FlowStep_ByConfig_Awaiting_Main.ejs +0 -0
  110. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/plugIns/FlowStep_ByConfig_Paginated_Main.ejs +0 -0
  111. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/plugIns/FlowStep_PlugIn_Main.ejs +0 -0
  112. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/plugIns/FlowStep_RecievePlugIn_Main.ejs +0 -0
  113. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/plugIns/templateAwaitingStep.ejs +0 -0
  114. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → FlowSchemas/templates}/step/plugIns/templateSendPlugin.ejs +0 -0
  115. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/eventBridge.js +0 -0
  116. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/extTopic.js +0 -0
  117. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/lambdaSyncApi.js +0 -0
  118. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/lambdaSyncInv.js +0 -0
  119. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/ownTopic.js +0 -0
  120. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/registry.js +0 -0
  121. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/events/s3.js +0 -0
  122. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/handlers/FlowHandler_HdrApi.ejs +0 -0
  123. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/handlers/FlowHandler_HdrInv.ejs +0 -0
  124. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/handlers/FlowHandler_HdrSqs.ejs +0 -0
  125. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/eventTypes.js +0 -0
  126. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowClassifier.js +0 -0
  127. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowNaming.js +0 -0
  128. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowSelection.js +0 -0
  129. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowStepNormalizer.js +0 -0
  130. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/flowValidator.js +0 -0
  131. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal → _shared}/shared/registry.js +0 -0
  132. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/CheckTriggerCache_HdrSqs.ejs +0 -0
  133. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/CheckTriggerCache_Main.ejs +0 -0
  134. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/ProcessTriggerCache_HdrSqs.ejs +0 -0
  135. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/ProcessTriggerCache_Main.ejs +0 -0
  136. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/TriggerCacheComplete_HdrDsq.ejs +0 -0
  137. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/TriggerCacheComplete_HdrSqs.ejs +0 -0
  138. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/TriggerCacheComplete_Main.ejs +0 -0
  139. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/triggerCache/TriggerCacheQueue_Yaml.ejs +0 -0
  140. /package/src/codeGenerators/app/src/generatedCode/Flow/{_internal/_shared → _shared}/yaml/SharedFunctionSqs_Yaml.ejs +0 -0
  141. /package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/{PaginateProcessLogical_HdrSqs.js → PaginateProcessLogical_HdrSqs.ejs} +0 -0
  142. /package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/{PaginateProcessLogical_Main.js → PaginateProcessLogical_Main.ejs} +0 -0
  143. /package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/{ProcessLogical_HdrSqs.js → ProcessLogical_HdrSqs.ejs} +0 -0
  144. /package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/{ProcessLogical_Main.js → ProcessLogical_Main.ejs} +0 -0
  145. /package/src/codeGenerators/app/src/generatedCode/libs/templates/{Consts.js → Consts.ejs} +0 -0
  146. /package/src/codeGenerators/app/src/generatedCode/libs/templates/{GenerateCodeLibs.js → GenerateCodeLibs.ejs} +0 -0
@@ -1,59 +0,0 @@
1
- # ----- [Topic]
2
- In<%- queueName %>:
3
- Type: AWS::SNS::Topic
4
- Properties:
5
- DisplayName: "SNS Message in ProcessImageAfterUploadHdrSqs"
6
- TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- queueName %>_In
7
- # ----- [Subscription]
8
- SNSSubscriptionIn<%- queueName %>:
9
- Type: AWS::SNS::Subscription
10
- Properties:
11
- RawMessageDelivery: true
12
- TopicArn: !Ref In<%- queueName %>
13
- Endpoint: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>"
14
- Protocol: "sqs"
15
- ##===== [Queue]
16
- <%- queueName %>:
17
- Type: "AWS::SQS::Queue"
18
- Properties:
19
- QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
20
- RedrivePolicy:
21
- deadLetterTargetArn:
22
- # !GetAtt
23
- Fn::GetAtt:
24
- - <%- queueName %>DLQ
25
- - Arn
26
- maxReceiveCount: 3
27
- VisibilityTimeout: 120
28
- ##==== [QueueDLQ]
29
- <%- queueName %>DLQ:
30
- Type: AWS::SQS::Queue
31
- Properties:
32
- QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
33
- ##==== [QueuePolicy]
34
- <%- queueName %>Policy:
35
- Type: AWS::SQS::QueuePolicy
36
- Properties:
37
- PolicyDocument:
38
- Version: "2012-10-17"
39
- Statement:
40
- - Sid: "allow-sns-messages"
41
- Effect: Allow
42
- Principal: "*"
43
- Resource:
44
- # !GetAtt
45
- Fn::GetAtt:
46
- - <%- queueName %>
47
- - Arn
48
- Action: "SQS:SendMessage"
49
- Queues:
50
- - Ref: <%- queueName %>
51
- #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
52
- #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
53
-
54
- <%_ function firstLetterUpperCase(text){
55
- return text.charAt(0).toUpperCase() + text.slice(1)
56
- } _%>
57
- <%_ function firstLetterLowerCase(str) {
58
- return str.charAt(0).toLowerCase() + str.slice(1)
59
- } _%>
@@ -1,61 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- import consts from '#libs/Consts.js';
24
-
25
- const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
26
-
27
- const templatePath = path.join(__dirname, 'template.ejs');
28
-
29
- function data(_izContext, flowSchema, appPath) {
30
- let createBucket = false;
31
- if (flowSchema.createBucket) {
32
- createBucket = true;
33
- }
34
- if (!createBucket) {
35
- return [];
36
- } else {
37
- return [createSourceParams(_izContext, flowSchema, appPath)];
38
- }
39
- }
40
-
41
- function createSourceParams(_izContext, flowSchema, appPath) {
42
- let bucketName = flowSchema.bucketName;
43
- let resourceName = bucketName.split('-').join('');
44
-
45
- return {
46
- templatePath: templatePath,
47
- templateData: {
48
- bucketName,
49
- resourceName
50
- },
51
- setting: {
52
- initialData: 'Resources:\n',
53
- savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
54
- saveFileName: SAVE_FILE_NAME.S3Bucket,
55
- fileExtension: '.yml',
56
- isAppend: true
57
- }
58
- };
59
- }
60
-
61
- export default data;
@@ -1,13 +0,0 @@
1
- <%- resourceName %>:
2
- Type: AWS::S3::Bucket
3
- DependsOn:
4
- - SNSInProcessAfterUploadS3Policy
5
- Properties:
6
- BucketName: <%- bucketName %>
7
- BucketEncryption:
8
- ServerSideEncryptionConfiguration:
9
- - ServerSideEncryptionByDefault:
10
- SSEAlgorithm: AES256
11
- BucketKeyEnabled: true
12
- VersioningConfiguration:
13
- Status: Suspended
@@ -1,70 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- import consts from '#libs/Consts.js';
24
- import utils from '#libs/Utils.js';
25
-
26
- const { firstLetterUpperCase: upperCase } = utils;
27
- const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
28
-
29
- const templatePath = path.join(
30
- __dirname,
31
- '../../../../../../resourceYamlComponent/sns-out/template.ejs'
32
- );
33
-
34
- /**
35
- * create data for template.ejs
36
- * return array of defaultSnsOutData
37
- * because must create for FindData and ProcessLogical
38
- *
39
- * @param {Object} _izContext
40
- * @param {String} saveFilePath
41
- * @returns {Object[]} - data of multiple defaultSnsOutData
42
- */
43
-
44
- function createDataForDefaultSnsOut(_izContext, flowSchema, appPath) {
45
- let resultsForCreateDefaultSnsOut = [];
46
- const defaultSnsOutDataList = [
47
- {
48
- queueName: upperCase(flowSchema.flowTag)
49
- }
50
- ];
51
-
52
- for (let defaultSnsOutData of defaultSnsOutDataList) {
53
- resultsForCreateDefaultSnsOut.push({
54
- templatePath: templatePath,
55
- templateData: defaultSnsOutData,
56
- setting: {
57
- initialData: 'Resources:\n',
58
- savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
59
- saveFileName: SAVE_FILE_NAME.snsOutYaml,
60
- fileExtension: '.yml',
61
- isAppend: true,
62
- fromFile: 's3/sns-out/data.js'
63
- }
64
- });
65
- }
66
-
67
- return resultsForCreateDefaultSnsOut;
68
- }
69
-
70
- export default createDataForDefaultSnsOut;
@@ -1,69 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- import consts from '#libs/Consts.js';
24
-
25
- const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
26
-
27
- const templatePath = path.join(
28
- __dirname,
29
- '../../../../../resourceYamlComponent/dynamodb/template.ejs'
30
- );
31
-
32
- function data(_izContext, appPath) {
33
- let resultForCreateSources = [];
34
- const reservedDataTables = [
35
- {
36
- tableName: 'ReservedDataMain',
37
- resourceName: 'ReservedDataMain',
38
- attributes: [
39
- {
40
- keyType: 'partitionKey',
41
- AttributeName: 'servicePendingId',
42
- AttributeType: 'S'
43
- },
44
- {
45
- keyType: 'sortKey',
46
- AttributeName: 'reservedDataId',
47
- AttributeType: 'S'
48
- }
49
- ]
50
- }
51
- ];
52
-
53
- for (let reservedDataTable of reservedDataTables) {
54
- resultForCreateSources.push({
55
- templatePath: templatePath,
56
- templateData: reservedDataTable,
57
- setting: {
58
- initialData: 'Resources:\n',
59
- savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
60
- saveFileName: SAVE_FILE_NAME.dynamoDbYaml,
61
- fileExtension: '.yml',
62
- isAppend: true
63
- }
64
- });
65
- }
66
- return resultForCreateSources;
67
- }
68
-
69
- export default data;
@@ -1,151 +0,0 @@
1
- const CRUD_ACTIONS = ['Create', 'Update', 'Delete', 'Get'];
2
- const CRUD_ASYNC_ACTIONS = ['Create', 'Update', 'Delete'];
3
- const RBAC_FLOW_DEFINITIONS = [
4
- { flowTag: 'CreateTargetRole', event: ['ownTopic'] },
5
- { flowTag: 'ListTargetRole', event: ['lambdaSyncApi'] },
6
- { flowTag: 'DeleteTargetRole', event: ['ownTopic'] },
7
- { flowTag: 'CreateRolePermissions', event: ['ownTopic'] },
8
- { flowTag: 'ListRolePermissions', event: ['lambdaSyncApi'] },
9
- { flowTag: 'DeleteRolePermissions', event: ['ownTopic'] },
10
- { flowTag: 'CreateUserRole', event: ['ownTopic'] },
11
- { flowTag: 'ListUserInRoles', event: ['lambdaSyncApi'] },
12
- { flowTag: 'DeleteUserFromRole', event: ['ownTopic'] }
13
- ];
14
- const RELATIONSHIP_ACTIONS = [
15
- 'CreateRelationship',
16
- 'UpdateRelationship',
17
- 'DeleteRelationship',
18
- 'GetRelationship',
19
- 'ChangeRelationship',
20
- 'MoveRelationship'
21
- ];
22
- const CORRELATION_MESSAGE_ATTRIBUTES = ['userId', 'correlationId'];
23
- const CORRELATION_STEP_MESSAGE_ATTRIBUTES = {
24
- userId: {
25
- propertyName: 'x-correlation-base-user-id',
26
- type: 'string'
27
- },
28
- correlationId: {
29
- propertyName: 'x-correlation-id',
30
- type: 'string'
31
- }
32
- };
33
-
34
- function objectsFrom(objectData) {
35
- return objectData?.objects || [];
36
- }
37
-
38
- function relationshipsFrom(relationshipData) {
39
- return relationshipData?.relationships || [];
40
- }
41
-
42
- function buildStep(stepName, messageAttributes = CORRELATION_MESSAGE_ATTRIBUTES) {
43
- return {
44
- stepName,
45
- properties: [],
46
- messageAttributes
47
- };
48
- }
49
-
50
- function hasApplicableObject(objectData) {
51
- return objectsFrom(objectData).some(
52
- obj => obj.generatedBy === 'userGenerated' || obj.generatedBy === 'systemGenerated'
53
- );
54
- }
55
-
56
- function hasRbacAddOn(obj) {
57
- return Array.isArray(obj.addOnDataStructure) && obj.addOnDataStructure.some(addOn => addOn.type === 'rbac');
58
- }
59
-
60
- function hasBeforeLogicalHook(action, customFlowData) {
61
- return (customFlowData?.flows || []).some(flow => {
62
- const config = flow.generatedCodeConfig;
63
- return config &&
64
- config.generatedCodeTag === action.toLowerCase() &&
65
- config.codeHookTag === 'beforeLogical' &&
66
- flow.event?.includes(config.invocationType);
67
- });
68
- }
69
-
70
- function buildCorrelatedSystemFlow({ flowTag, event, outputTopic, flowSteps, extra = {} }) {
71
- return {
72
- flowTag,
73
- ...extra,
74
- initiateBy: 'system',
75
- handleObj: 'one',
76
- statusType: 'none',
77
- event,
78
- outputTopic,
79
- stepMessageAttributes: CORRELATION_STEP_MESSAGE_ATTRIBUTES,
80
- flowSteps
81
- };
82
- }
83
-
84
- export function buildCrudFlowDescriptors(objectData, customFlowData) {
85
- if (!hasApplicableObject(objectData)) return [];
86
-
87
- return CRUD_ACTIONS.map(action => {
88
- const isAsyncAction = CRUD_ASYNC_ACTIONS.includes(action);
89
- const flowSteps = [buildStep('InTag')];
90
-
91
- if (hasBeforeLogicalHook(action, customFlowData)) {
92
- flowSteps.push(buildStep('beforeLogical'));
93
- }
94
-
95
- if (isAsyncAction) {
96
- flowSteps.push(buildStep('Complete'));
97
- }
98
-
99
- return buildCorrelatedSystemFlow({
100
- flowTag: action,
101
- event: isAsyncAction ? ['ownTopic'] : ['lambdaSyncInv', 'lambdaSyncApi'],
102
- outputTopic: isAsyncAction,
103
- flowSteps,
104
- extra: { isDynamicObjectType: true }
105
- });
106
- });
107
- }
108
-
109
- export function buildRbacFlowDescriptors(objectData) {
110
- const rbacObjects = objectsFrom(objectData).filter(hasRbacAddOn);
111
- if (rbacObjects.length === 0) return [];
112
-
113
- return rbacObjects.flatMap(obj =>
114
- RBAC_FLOW_DEFINITIONS.map(def => ({
115
- flowTag: def.flowTag,
116
- objectType: obj.objectType,
117
- initiateBy: 'system',
118
- statusType: 'none',
119
- event: def.event,
120
- outputTopic: true,
121
- flowSteps: [buildStep('InTag', [])]
122
- }))
123
- );
124
- }
125
-
126
- export function buildRelationshipFlowDescriptors(relationshipData) {
127
- if (relationshipsFrom(relationshipData).length === 0) return [];
128
-
129
- return RELATIONSHIP_ACTIONS.map(action => {
130
- const flowSteps = [buildStep('InTag')];
131
- flowSteps.push(buildStep('Complete'));
132
-
133
- return buildCorrelatedSystemFlow({
134
- flowTag: action,
135
- event: ['ownTopic'],
136
- outputTopic: true,
137
- flowSteps,
138
- extra: { isDynamicRelationshipType: true }
139
- });
140
- });
141
- }
142
-
143
- export function buildSystemFlowDescriptors(objectData, relationshipData, customFlowData) {
144
- const flows = [
145
- ...buildCrudFlowDescriptors(objectData, customFlowData),
146
- ...buildRbacFlowDescriptors(objectData),
147
- ...buildRelationshipFlowDescriptors(relationshipData)
148
- ];
149
-
150
- return { flows };
151
- }