@izara_project/izara-core-generate-service-code 1.0.65 → 1.0.66

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 (254) hide show
  1. package/README.md +73 -11
  2. package/index.js +0 -5
  3. package/package.json +7 -6
  4. package/src/compile/compileProject.js +26 -0
  5. package/src/compile/loadSchemas.js +28 -0
  6. package/src/emit/crud/dynamicCrudFlowSchemaTemplate.js +11 -0
  7. package/src/emit/crud/emitCrudApplicationArtifacts.js +157 -0
  8. package/src/emit/crud/emitDynamicCrudFlowSchemas.js +84 -0
  9. package/src/emit/crud/generateCrudApplicationArtifacts.js +16 -0
  10. package/src/emit/crud/generateDynamicCrudFlowSchemas.js +21 -0
  11. package/src/emit/crud/loadLocalSchemaArrays.js +8 -0
  12. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowObjects/templates/crud → emit/crud/templates}/CreateEndpoint_Main.ejs +1 -1
  13. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowObjects/templates/crud → emit/crud/templates}/DeleteEndpoint_Main.ejs +1 -1
  14. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowObjects/templates/step → emit/crud/templates}/FlowEndpointBeforeLogical_Main.ejs +2 -2
  15. package/src/emit/crud/templates/FlowEndpointComplete_Main.ejs +75 -0
  16. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/endpoint → emit/crud/templates}/FlowEndpoint_HdrWbs.ejs +1 -1
  17. package/src/{codeGenerators/app/src/generatedCode/ProcessLogical/templates/ProcessLogical_HdrSqs.ejs → emit/crud/templates/FlowHandler_HdrSqs.ejs} +52 -56
  18. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/endpoint → emit/crud/templates}/FlowMain_Wbs.ejs +1 -3
  19. package/src/emit/crud/templates/GetRangeEndpoint_Main.ejs +127 -0
  20. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowObjects/templates/crud → emit/crud/templates}/UpdateEndpoint_Main.ejs +1 -1
  21. package/src/emit/custom/customFlows.js +70 -0
  22. package/src/emit/custom/emitCustomFlowApplicationArtifacts.js +308 -0
  23. package/src/emit/custom/generateCustomFlowApplicationArtifacts.js +22 -0
  24. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/endpoint → emit/custom/templates}/FlowEndpoint_Main.ejs +1 -1
  25. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/step → emit/custom/templates}/FlowStep_Main.ejs +1 -1
  26. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/ConfirmReserved_Main.ejs +5 -5
  27. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/CreateObject_HdrWbs.ejs +1 -1
  28. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/CreateObject_Main.ejs +3 -3
  29. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/CreatePreSignUrl_Main.ejs +4 -5
  30. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/FlowHandler_HdrS3.ejs +2 -8
  31. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/ProcessS3File_Main.ejs +1 -1
  32. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/ReservedLimit_Main.ejs +5 -6
  33. package/src/emit/custom/templates/triggerCache/CheckTriggerCache_HdrSqs.ejs +32 -0
  34. package/src/emit/custom/templates/triggerCache/CheckTriggerCache_Main.ejs +63 -0
  35. package/src/emit/custom/templates/triggerCache/TriggerCacheComplete_Main.ejs +35 -0
  36. package/src/emit/custom/templates/triggerCache/TriggerCache_Main.ejs +16 -0
  37. package/src/emit/function/functionYamlArtifact.js +111 -0
  38. package/src/emit/rbac/emitDynamicRbacFlowSchemas.js +117 -0
  39. package/src/emit/rbac/emitRbacApplicationArtifacts.js +256 -0
  40. package/src/emit/rbac/generateCreateTargetRoleHandler.js +19 -0
  41. package/src/emit/rbac/generateDynamicRbacFlowSchemas.js +21 -0
  42. package/src/emit/rbac/rbacFlowTag.js +7 -0
  43. package/src/emit/rbac/templates/CreateTargetRole_HdrSqs.ejs +24 -0
  44. package/src/emit/rbac/templates/CreateTargetRole_Main.ejs +25 -0
  45. package/src/emit/rbac/templates/DynamicRbacFlowSchema.ejs +5 -0
  46. package/src/emit/rbac/templates/ListRbac_HdrApi.ejs +17 -0
  47. package/src/emit/rbac/templates/ListRbac_HdrSqs.ejs +13 -0
  48. package/src/emit/rbac/templates/ListRbac_Main.ejs +29 -0
  49. package/src/emit/rbac/templates/RbacMutation_Main.ejs +22 -0
  50. package/src/emit/rbac/templates/UserRbacFlow_HdrInv.ejs +10 -0
  51. package/src/emit/rbac/templates/UserRbacFlow_Main.ejs +44 -0
  52. package/src/emit/rbac/templates/UserRoleMutation_Main.ejs +33 -0
  53. package/src/emit/relationship/dynamicRelationshipFlowSchemaTemplate.js +11 -0
  54. package/src/emit/relationship/emitDynamicRelationshipFlowSchemas.js +66 -0
  55. package/src/emit/relationship/emitRelationshipApplicationArtifacts.js +147 -0
  56. package/src/emit/relationship/generateDynamicRelationshipFlowSchemas.js +23 -0
  57. package/src/emit/relationship/generateRelationshipApplicationArtifacts.js +22 -0
  58. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessChangeRelationshipComplete_Main.ejs → emit/relationship/templates/ChangeRelationshipComplete_Main.ejs} +1 -1
  59. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessChangeRelationship_Main.ejs → emit/relationship/templates/ChangeRelationship_Main.ejs} +10 -2
  60. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessCreateRelationshipComplete_Main.ejs → emit/relationship/templates/CreateRelationshipComplete_Main.ejs} +1 -1
  61. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessCreateRelationship_Main.ejs → emit/relationship/templates/CreateRelationship_Main.ejs} +1 -1
  62. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessDeleteRelationshipComplete_Main.ejs → emit/relationship/templates/DeleteRelationshipComplete_Main.ejs} +1 -1
  63. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessDeleteRelationship_Main.ejs → emit/relationship/templates/DeleteRelationship_Main.ejs} +1 -1
  64. package/src/emit/relationship/templates/FlowHandler_HdrApi.ejs +51 -0
  65. package/src/{codeGenerators/app/src/generatedCode/Flow/_shared/handlers → emit/relationship/templates}/FlowHandler_HdrDsq.ejs +1 -1
  66. package/src/emit/relationship/templates/FlowHandler_HdrInv.ejs +45 -0
  67. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessGetRelationshipComplete_Main.ejs → emit/relationship/templates/GetRelationshipComplete_Main.ejs} +1 -1
  68. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessGetRelationship_Main.ejs → emit/relationship/templates/GetRelationship_Main.ejs} +1 -1
  69. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessMoveRelationship_Main.ejs → emit/relationship/templates/MoveRelationship_Main.ejs} +9 -1
  70. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessUpdateRelationshipComplete_Main.ejs → emit/relationship/templates/UpdateRelationshipComplete_Main.ejs} +1 -1
  71. package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessUpdateRelationship_Main.ejs → emit/relationship/templates/UpdateRelationship_Main.ejs} +1 -1
  72. package/src/emit/resource/emitResourceArtifacts.js +300 -0
  73. package/src/emit/resource/generateResourceArtifacts.js +20 -0
  74. package/src/{codeGenerators/resource/sls_yaml/templates/crud → emit/resource/templates}/ResourceBeforeLogicalYaml.ejs +1 -1
  75. package/src/{codeGenerators/resource/sls_yaml/templates/crud → emit/resource/templates}/ResourceSqsYaml.ejs +6 -6
  76. package/src/{codeGenerators/app/sls_yaml → emit/resource}/templates/SharedResource_Yaml.ejs +8 -8
  77. package/src/emit/system/emitSystemWebSocketArtifacts.js +182 -0
  78. package/src/generate.js +60 -126
  79. package/src/output/commitArtifacts.js +213 -0
  80. package/src/output/mergeHooks.js +55 -0
  81. package/src/output/validateArtifacts.js +62 -0
  82. package/src/plan/buildGenerationPlan.js +50 -0
  83. package/test/core.test.js +159 -0
  84. package/test/createTargetRoleHandler.test.js +68 -0
  85. package/test/crudApplicationArtifacts.test.js +107 -0
  86. package/test/customFlowApplicationArtifacts.test.js +294 -0
  87. package/test/dynamicCrudFlowSchemas.test.js +136 -0
  88. package/test/dynamicRbacFlowSchemas.test.js +101 -0
  89. package/test/dynamicRelationshipFlowSchemas.test.js +99 -0
  90. package/test/functionYamlArtifact.test.js +34 -0
  91. package/test/intTestApi.test.js +29 -0
  92. package/test/publicApi.test.js +209 -0
  93. package/test/relationshipApplicationArtifacts.test.js +68 -0
  94. package/test/resourceArtifacts.test.js +121 -0
  95. package/jsconfig.json +0 -9
  96. package/src/__tests__/getIntTestConfig.test.js +0 -51
  97. package/src/__tests__/intTestGeneratorShared.test.cjs +0 -169
  98. package/src/__tests__/pathIntTest.test.js +0 -103
  99. package/src/codeGenerators/app/initial_setup/InitialSetupGenerator.js +0 -199
  100. package/src/codeGenerators/app/initial_setup/templates/InitialSetup_LambdaRole.ejs +0 -50
  101. package/src/codeGenerators/app/initial_setup/templates/InitialSetup_SnsService.ejs +0 -15
  102. package/src/codeGenerators/app/initial_setup/templates/InitialSetup_TableName.ejs +0 -9
  103. package/src/codeGenerators/app/sls_yaml/FindDataYamlGenerator.js +0 -23
  104. package/src/codeGenerators/app/sls_yaml/FunctionYamlGenerator.js +0 -332
  105. package/src/codeGenerators/app/sls_yaml/ProcessLogicalYamlGenerator.js +0 -21
  106. package/src/codeGenerators/app/sls_yaml/RoleNameConfigGenerator.js +0 -48
  107. package/src/codeGenerators/app/sls_yaml/SharedResourceYamlGenerator.js +0 -503
  108. package/src/codeGenerators/app/sls_yaml/__tests__/SharedResourceYamlGenerator.test.js +0 -235
  109. package/src/codeGenerators/app/sls_yaml/_policy/PolicyRegistry.js +0 -56
  110. package/src/codeGenerators/app/sls_yaml/_policy/__tests__/PolicyRegistry.test.js +0 -33
  111. package/src/codeGenerators/app/sls_yaml/renderYamlTemplate.js +0 -13
  112. package/src/codeGenerators/app/sls_yaml/templates/FindData_Yaml.ejs +0 -10
  113. package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Api.ejs +0 -21
  114. package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_EventBridge.ejs +0 -14
  115. package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Inv.ejs +0 -6
  116. package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Sqs.ejs +0 -11
  117. package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Wbs.ejs +0 -11
  118. package/src/codeGenerators/app/sls_yaml/templates/ProcessLogical_Yaml.ejs +0 -32
  119. package/src/codeGenerators/app/sls_yaml/templates/RoleNameConfig_Yaml.ejs +0 -5
  120. package/src/codeGenerators/app/src/generatedCode/FindData/FindDataGenerator.js +0 -238
  121. package/src/codeGenerators/app/src/generatedCode/FindData/templates/FindData_HdrSqs.ejs +0 -87
  122. package/src/codeGenerators/app/src/generatedCode/FindData/templates/FindData_Main.ejs +0 -108
  123. package/src/codeGenerators/app/src/generatedCode/FindData/templates/GetByStorage/getByDynamo.ejs +0 -32
  124. package/src/codeGenerators/app/src/generatedCode/FindData/templates/GetByStorage/getByGraph.ejs +0 -87
  125. package/src/codeGenerators/app/src/generatedCode/Flow/FlowObjects/.gitkeep +0 -0
  126. package/src/codeGenerators/app/src/generatedCode/Flow/FlowObjects/EndpointsGenerator.js +0 -120
  127. package/src/codeGenerators/app/src/generatedCode/Flow/FlowObjects/templates/step/FlowEndpointComplete_Main.ejs +0 -313
  128. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/RbacFlowGenerator.js +0 -116
  129. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/CreateRolePermissions.ejs +0 -135
  130. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/CreateTargetRole.ejs +0 -131
  131. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/CreateUserRole.ejs +0 -150
  132. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/DeleteRolePermissions.ejs +0 -132
  133. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/DeleteTargetRole.ejs +0 -132
  134. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/DeleteUserFromRole.ejs +0 -150
  135. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/FlowRbac_Main.ejs +0 -252
  136. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/ListRolePermissions.ejs +0 -120
  137. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/ListTargetRole.ejs +0 -122
  138. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/ListUserInRoles.ejs +0 -117
  139. package/src/codeGenerators/app/src/generatedCode/Flow/FlowRelationships/RelationshipFlowGenerator.js +0 -148
  140. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/.gitkeep +0 -0
  141. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/StatusFieldGenerator.js +0 -109
  142. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/WebSocketGenerator.js +0 -122
  143. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/endpoint/FlowEntryPoint_Main.ejs +0 -38
  144. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/statusField/CompleteStatusFieldSns_Yaml.ejs +0 -52
  145. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/statusField/CompleteStatusField_HdrSqs.ejs +0 -84
  146. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/statusField/CompleteStatusField_Main.ejs +0 -78
  147. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/step/plugIns/FlowStep_ByConfig_Awaiting_Main.ejs +0 -123
  148. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/step/plugIns/FlowStep_ByConfig_Paginated_Main.ejs +0 -59
  149. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/step/plugIns/FlowStep_PlugIn_Main.ejs +0 -72
  150. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/step/plugIns/FlowStep_RecievePlugIn_Main.ejs +0 -76
  151. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/step/plugIns/templateAwaitingStep.ejs +0 -41
  152. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/step/plugIns/templateSendPlugin.ejs +0 -18
  153. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocketFlow_Yaml.ejs +0 -26
  154. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocketSub_Yaml.ejs +0 -7
  155. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocket_HdrSqs.ejs +0 -66
  156. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocket_Main.ejs +0 -115
  157. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocket_Yaml.ejs +0 -36
  158. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/WebSocketConnect_Main.ejs +0 -52
  159. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/WebSocketConnect_Yaml.ejs +0 -13
  160. package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/WebSocketDynamoDb_Yaml.ejs +0 -28
  161. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/BaseDsqHandler.js +0 -63
  162. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/BaseSqsHandler.js +0 -66
  163. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/__tests__/BaseDsqHandler.test.js +0 -94
  164. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/dsq.js +0 -5
  165. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/eventBridge.js +0 -33
  166. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/extTopic.js +0 -6
  167. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/lambdaSyncApi.js +0 -51
  168. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/lambdaSyncInv.js +0 -51
  169. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/ownTopic.js +0 -54
  170. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/registry.js +0 -17
  171. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/s3.js +0 -56
  172. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/s3Components/ConfirmAfterUploadS3Generator.js +0 -46
  173. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/s3Components/CreateObjectGenerator.js +0 -50
  174. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/s3Components/CreatePreSignUrlGenerator.js +0 -48
  175. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/s3Components/ProcessAfterUploadS3Generator.js +0 -49
  176. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/events/s3Components/ReservedLimitGenerator.js +0 -47
  177. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/eventTypes.js +0 -23
  178. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowClassifier.js +0 -50
  179. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowEntryPointBase.js +0 -106
  180. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowMainFunctionBase.js +0 -172
  181. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowNaming.js +0 -37
  182. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowSelection.js +0 -19
  183. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowStepBase.js +0 -235
  184. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowStepNormalizer.js +0 -75
  185. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/flowValidator.js +0 -267
  186. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/propertyNormalizer.js +0 -18
  187. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/registry.js +0 -7
  188. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/roleNameDetection.js +0 -49
  189. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/shared/triggerCacheBase.js +0 -177
  190. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/CheckTriggerCache_HdrSqs.ejs +0 -89
  191. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/CheckTriggerCache_Main.ejs +0 -83
  192. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/ProcessTriggerCache_HdrSqs.ejs +0 -103
  193. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/ProcessTriggerCache_Main.ejs +0 -58
  194. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/TriggerCacheComplete_HdrDsq.ejs +0 -104
  195. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/TriggerCacheComplete_HdrSqs.ejs +0 -88
  196. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/TriggerCacheComplete_Main.ejs +0 -80
  197. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/triggerCache/TriggerCacheQueue_Yaml.ejs +0 -36
  198. package/src/codeGenerators/app/src/generatedCode/Flow/_shared/yaml/SharedFunctionSqs_Yaml.ejs +0 -13
  199. package/src/codeGenerators/app/src/generatedCode/ProcessLogical/ProcessLogicalGenerator.js +0 -29
  200. package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/PaginateProcessLogical_HdrDsq.ejs +0 -177
  201. package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/PaginateProcessLogical_HdrSqs.ejs +0 -155
  202. package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/PaginateProcessLogical_Main.ejs +0 -268
  203. package/src/codeGenerators/app/src/generatedCode/ProcessLogical/templates/ProcessLogical_Main.ejs +0 -450
  204. package/src/codeGenerators/app/src/generatedCode/SystemFlowSchemas/RegisterGenerator.js +0 -149
  205. package/src/codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/RegisterComplete_HdrSqs.ejs +0 -85
  206. package/src/codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/RegisterComplete_Main.ejs +0 -176
  207. package/src/codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/Register_HdrWbs.ejs +0 -80
  208. package/src/codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/Register_Main.ejs +0 -164
  209. package/src/codeGenerators/app/src/generatedCode/libs/ConstsGenerator.js +0 -28
  210. package/src/codeGenerators/app/src/generatedCode/libs/GenerateCodeLibsGenerator.js +0 -28
  211. package/src/codeGenerators/app/src/generatedCode/libs/templates/Consts.ejs +0 -448
  212. package/src/codeGenerators/app/src/generatedCode/libs/templates/GenerateCodeLibs.ejs +0 -124
  213. package/src/codeGenerators/resource/sls_yaml/DynamoDBGenerator.js +0 -87
  214. package/src/codeGenerators/resource/sls_yaml/FlowOutGenerator.js +0 -70
  215. package/src/codeGenerators/resource/sls_yaml/FlowResourceYamlGenerator.js +0 -182
  216. package/src/core/renderTemplateFile.js +0 -22
  217. package/src/core/validate.js +0 -165
  218. package/src/generateCode.js +0 -357
  219. package/src/generateSchema.js +0 -123
  220. package/src/parsers/flowSchemaParser.js +0 -112
  221. package/src/parsers/objectSchemaParser.js +0 -39
  222. package/src/parsers/relationshipSchemaParser.js +0 -51
  223. package/src/schemaGenerators/app/src/schemas/FlowSchemas/FlowSchemaGenerator.js +0 -107
  224. package/src/schemaGenerators/app/src/schemas/FlowSchemas/RbacFlowSchemaGenerator.js +0 -98
  225. package/src/schemaGenerators/app/src/schemas/FlowSchemas/RelationshipFlowSchemaGenerator.js +0 -89
  226. package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/DynamicFlowSchemaTemplate.ejs +0 -41
  227. package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/DynamicRbacFlowSchemaTemplate.ejs +0 -20
  228. package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/RelationshipFlowSchemaTemplate.ejs +0 -33
  229. package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/UserRbacFlowSchemaTemplate.ejs +0 -22
  230. package/src/schemaGenerators/app/src/schemas/ObjectSchemas/AttributeTreeSchemaGenerator.js +0 -124
  231. package/src/schemaGenerators/app/src/schemas/ObjectSchemas/PropertyValueSchemaGenerator.js +0 -119
  232. package/src/schemaGenerators/app/src/schemas/ObjectSchemas/templates/DynamicAttributeTreeManagerSchemaTemplate.ejs +0 -14
  233. package/src/schemaGenerators/app/src/schemas/ObjectSchemas/templates/DynamicAttributeTreeStandardSchemaTemplate.ejs +0 -13
  234. package/src/schemaGenerators/app/src/schemas/ObjectSchemas/templates/DynamicPropertyValueSchemaTemplate.ejs +0 -15
  235. package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/AttributeTreeRelationshipSchemaGenerator.js +0 -109
  236. package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/PropertyValueRelationshipSchemaGenerator.js +0 -103
  237. package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/__tests__/relationshipSchemaHelpers.test.js +0 -38
  238. package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/relationshipSchemaHelpers.js +0 -40
  239. package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/templates/DynamicAttributeTreeRelationshipSchemaTemplate.ejs +0 -7
  240. package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/templates/DynamicPropertyValueRelationshipSchemaTemplate.ejs +0 -7
  241. package/src/schemaGenerators/app/src/schemas/SystemTextSchemas/SystemTextGenerator.js +0 -102
  242. package/src/schemaGenerators/app/src/schemas/SystemTextSchemas/templates/SystemText_Template.ejs +0 -10
  243. /package/src/{codeGenerators/app/src/generatedCode/Flow/_shared/handlers → emit/crud/templates}/FlowHandler_HdrApi.ejs +0 -0
  244. /package/src/{codeGenerators/app/src/generatedCode/Flow/_shared/handlers → emit/crud/templates}/FlowHandler_HdrInv.ejs +0 -0
  245. /package/src/{codeGenerators/app/src/generatedCode/Flow/FlowObjects/templates/crud → emit/crud/templates}/GetEndpoint_Main.ejs +0 -0
  246. /package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/ConfirmReserved_HdrSqs.ejs +0 -0
  247. /package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/CreatePreSignUrl_HdrSqs.ejs +0 -0
  248. /package/src/{codeGenerators/app/src/generatedCode/Flow/FlowSchemas → emit/custom}/templates/s3/ReservedLimit_HdrSqs.ejs +0 -0
  249. /package/src/{codeGenerators/app/src/generatedCode/Flow/_shared/handlers → emit/relationship/templates}/FlowHandler_HdrSqs.ejs +0 -0
  250. /package/src/{codeGenerators/app/src/generatedCode/Flow/FlowRelationships/templates/relationship/ProcessMoveRelationshipComplete_Main.ejs → emit/relationship/templates/MoveRelationshipComplete_Main.ejs} +0 -0
  251. /package/src/{codeGenerators/resource/sls_yaml → emit/resource}/templates/DynamoDBTable_Yaml.ejs +0 -0
  252. /package/src/{codeGenerators/resource/sls_yaml → emit/resource}/templates/FlowOut_Yaml.ejs +0 -0
  253. /package/src/{codeGenerators/resource/sls_yaml/templates/crud → emit/resource/templates}/ResourceYaml.ejs +0 -0
  254. /package/src/{codeGenerators/resource/sls_yaml → emit/resource}/templates/SystemDynamoDB_Yaml.ejs +0 -0
@@ -1,252 +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
16
- <http: //www.gnu.org/licenses />.
17
- */
18
-
19
- import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
20
- import snsSharedLib from '@izara_project/izara-core-library-sns';
21
- import sqsSharedLib from '@izara_project/izara-core-library-sqs';
22
- import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow';
23
- import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
24
- import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
25
-
26
- //(<optionalImport>)
27
- import { coreConsts } from '@izara_project/izara-core-library-core';
28
- import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
29
- import {
30
- lambda,
31
- sns,
32
- sqs
33
- } from '@izara_project/izara-core-library-external-request';
34
- import { NoRetryError } from '@izara_project/izara-core-library-core';
35
- import { utils } from '@izara_project/izara-core-library-service-schemas';
36
-
37
- const { createFlowTypeConcat } = utils;
38
- //(</optionalImport>)
39
-
40
- /**
41
- *
42
- *
43
- * description of function.
44
- * @param {Object} _izContext
45
- * @param {CorrelationIds} _izContext.correlationIds - property of _izContext
46
- * @param {Logger} _izContext.logger - property of _izContext
47
- * @param {Object} requestParams - request params
48
- * @param {Object} requestParams.identifiers - identifiers for get data
49
- * @param {Object} requestParams.additionalRequest - additionalRequest
50
- *
51
- *
52
- * @returns {object} description of return value
53
- */
54
-
55
- export default async function ProcessUserRbacFlow(
56
- _izContext,
57
- requestParams,
58
- callingFlowConfig = {}
59
- //(<additionalParams>)
60
- //(</additionalParams>)
61
- ) {
62
- try {
63
- _izContext.logger.debug('ProcessUserRbacFlow _izContext', _izContext);
64
- _izContext.logger.debug('ProcessUserRbacFlow requestParams', requestParams);
65
- _izContext.logger.debug(
66
- 'ProcessUserRbacFlow callingFlowConfig',
67
- callingFlowConfig
68
- );
69
-
70
- const userId = _izContext.correlationIds.get(coreConsts.BASE_USER_ID);
71
- const targetId = _izContext.correlationIds.get(coreConsts.TARGET_ID);
72
-
73
- if (!userId && !targetId) {
74
- throw new Error(
75
- 'Missing required request parameters: userId or targetId'
76
- );
77
- }
78
-
79
- const { flowTypeConcat, inputParameterGroups } = requestParams;
80
- if (!flowTypeConcat) {
81
- throw new Error('Missing flowTypeConcat in requestParams');
82
- }
83
-
84
- _izContext.logger.debug('userId', userId);
85
- _izContext.logger.debug('targetId', targetId);
86
- _izContext.logger.debug('flowTypeConcat', flowTypeConcat);
87
-
88
- const tableUserRoles = dynamodbSharedLib.tableName(_izContext, 'UserRoles');
89
-
90
- const resultUserRoles = await dynamodbSharedLib.query(
91
- _izContext,
92
- tableUserRoles,
93
- {
94
- userId
95
- }
96
- );
97
-
98
- if (!resultUserRoles.Items) {
99
- resultUserRoles.Items = [];
100
- }
101
-
102
- let targetUserRoles = resultUserRoles.Items;
103
-
104
- targetUserRoles = targetUserRoles.filter(
105
- r => r.roleIdKey && r.roleIdKey.startsWith(targetId + '_')
106
- );
107
-
108
- const tableRolePermission = dynamodbSharedLib.tableName(
109
- _izContext,
110
- 'RolePermissions'
111
- );
112
-
113
- const chunkSize = 10;
114
- const rbacRolePermissions = [];
115
-
116
- for (let i = 0; i < targetUserRoles.length; i += chunkSize) {
117
- const chunk = targetUserRoles.slice(i, i + chunkSize);
118
- const promises = chunk.map(userRole =>
119
- dynamodbSharedLib
120
- .getItem(_izContext, tableRolePermission, {
121
- roleIdKey: userRole.roleIdKey,
122
- flowTypeConcat: flowTypeConcat
123
- })
124
- .catch(err => {
125
- _izContext.logger.error(
126
- `Error fetching permission for role ${userRole.roleIdKey}:`,
127
- err
128
- );
129
- return null;
130
- })
131
- );
132
-
133
- const results = await Promise.all(promises);
134
- rbacRolePermissions.push(...results);
135
- }
136
-
137
- let isPermission = false;
138
- let roleIdKey = '';
139
-
140
- for (let i = 0; i < rbacRolePermissions.length; i++) {
141
- const rbacRolePermission = rbacRolePermissions[i];
142
- const userRole = targetUserRoles[i];
143
-
144
- if (rbacRolePermission && rbacRolePermission.permission === true) {
145
- const dbParameterGroups = rbacRolePermission.parameterGroups;
146
- let isParamValid = true;
147
-
148
- if (
149
- dbParameterGroups &&
150
- typeof dbParameterGroups === 'object' &&
151
- !Array.isArray(dbParameterGroups)
152
- ) {
153
- const entries = Object.entries(dbParameterGroups);
154
- if (entries.length > 0) {
155
- let any_parameterGroup_match = false;
156
-
157
- for (const [groupName, parameterGroup] of entries) {
158
- if (!Array.isArray(parameterGroup)) {
159
- _izContext.logger.debug(
160
- `Skipping non-array parameterGroup: ${groupName}`
161
- );
162
- continue;
163
- }
164
-
165
- _izContext.logger.debug(
166
- `Checking parameterGroup [${groupName}]:`,
167
- parameterGroup
168
- );
169
- let parameterGroupMatch = true;
170
-
171
- for (const check_parameter of parameterGroup) {
172
- let tempRequestParams = inputParameterGroups || {};
173
-
174
- if (
175
- !check_parameter.parameterNames ||
176
- !Array.isArray(check_parameter.parameterNames)
177
- ) {
178
- parameterGroupMatch = false;
179
- break;
180
- }
181
-
182
- for (const parameterName of check_parameter.parameterNames) {
183
- if (
184
- !tempRequestParams ||
185
- typeof tempRequestParams !== 'object' ||
186
- !(parameterName in tempRequestParams)
187
- ) {
188
- parameterGroupMatch = false;
189
- break;
190
- }
191
- tempRequestParams = tempRequestParams[parameterName];
192
- }
193
-
194
- if (!parameterGroupMatch) break;
195
-
196
- if (
197
- !check_parameter.parameterValues ||
198
- !Array.isArray(check_parameter.parameterValues)
199
- ) {
200
- parameterGroupMatch = false;
201
- break;
202
- }
203
-
204
- const valueMatched =
205
- check_parameter.parameterValues.includes(tempRequestParams);
206
-
207
- if (!valueMatched) {
208
- parameterGroupMatch = false;
209
- break;
210
- }
211
- }
212
-
213
- if (parameterGroupMatch) {
214
- _izContext.logger.debug(
215
- `✅ parameterGroup [${groupName}] matched`
216
- );
217
- any_parameterGroup_match = true;
218
- break;
219
- } else {
220
- _izContext.logger.debug(
221
- `❌ parameterGroup [${groupName}] did not match`
222
- );
223
- }
224
- }
225
-
226
- isParamValid = any_parameterGroup_match;
227
- }
228
- }
229
-
230
- if (isParamValid) {
231
- isPermission = true;
232
- roleIdKey = rbacRolePermission.roleIdKey;
233
- _izContext.logger.debug(
234
- '### matched rbacRolePermission ###',
235
- rbacRolePermission
236
- );
237
- break;
238
- } else {
239
- _izContext.logger.debug(
240
- '### rbacRolePermission parameterGroups check failed ###',
241
- { roleIdKey: userRole.roleIdKey }
242
- );
243
- }
244
- }
245
- }
246
-
247
- return { permission: isPermission, roleIdKey };
248
- } catch (err) {
249
- _izContext.logger.error('error ProcessUserRbacFlow: ', err);
250
- throw err;
251
- }
252
- }
@@ -1,120 +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
16
- <http: //www.gnu.org/licenses />.
17
- */
18
-
19
- import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
20
- import snsSharedLib from '@izara_project/izara-core-library-sns';
21
- import sqsSharedLib from '@izara_project/izara-core-library-sqs';
22
- import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow';
23
- import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
24
- import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
25
-
26
- //(<optionalImport>)
27
- import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
28
- import {
29
- lambda,
30
- sns,
31
- sqs
32
- } from '@izara_project/izara-core-library-external-request';
33
- import { identifierUuid } from '@izara_project/izara-shared-core';
34
- import { consts, NoRetryError } from '@izara_project/izara-core-library-core';
35
- import { utils } from '@izara_project/izara-core-library-service-schemas';
36
-
37
- const { createFlowTypeConcat } = utils;
38
- //(</optionalImport>)
39
-
40
- /**
41
- *
42
- *
43
- * description of function.
44
- * @param {Object} _izContext
45
- * @param {CorrelationIds} _izContext.correlationIds - property of _izContext
46
- * @param {Logger} _izContext.logger - property of _izContext
47
- * @param {Object} requestParams - request params
48
- * @param {Object} requestParams.identifiers - identifiers for get data
49
- * @param {Object} requestParams.additionalRequest - additionalRequest
50
- *
51
- *
52
- * @returns {object} description of return value
53
- */
54
-
55
- export default async function Process<%= flowTag %>(
56
- _izContext,
57
- requestParams,
58
- callingFlowConfig = {}
59
- //(<additionalParams>)
60
- //(</additionalParams>)
61
- ) {
62
- try {
63
- _izContext.logger.debug(
64
- 'Process<%= flowTag %> _izContext',
65
- _izContext
66
- );
67
- _izContext.logger.debug(
68
- 'Process<%= flowTag %> requestParams',
69
- requestParams
70
- );
71
- _izContext.logger.debug(
72
- 'Process<%= flowTag %> callingFlowConfig',
73
- callingFlowConfig
74
- );
75
-
76
- const { roleIdKey } = requestParams;
77
-
78
- _izContext.logger.debug(
79
- '[Rbac:Process<%= flowTag %>] roleIdKey',
80
- roleIdKey
81
- );
82
-
83
- const resultQuery = await dynamodbSharedLib.query(
84
- _izContext,
85
- dynamodbSharedLib.tableName(_izContext, 'RolePermissions'),
86
- {
87
- roleIdKey
88
- }
89
- );
90
-
91
- _izContext.logger.debug(
92
- '[Rbac:Process<%= flowTag %>] resultQuery',
93
- resultQuery
94
- );
95
-
96
- const message = {
97
- returnResult: {
98
- records: resultQuery.Items || []
99
- }
100
- };
101
-
102
- const messageResult = {
103
- message,
104
- TopicArn: snsSharedLib.snsTopicArnByFlowSchema(_izContext, `<%- flowTag %>_Out`)
105
- };
106
-
107
- _izContext.logger.debug(
108
- '[Rbac:Process<%= flowTag %>] messageResult',
109
- messageResult
110
- );
111
-
112
- await sns.publishMessage(_izContext, messageResult);
113
- } catch (err) {
114
- _izContext.logger.error(
115
- '[Rbac:Process<%= flowTag %>] error: ',
116
- err
117
- );
118
- throw err;
119
- }
120
- }
@@ -1,122 +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
16
- <http: //www.gnu.org/licenses />.
17
- */
18
-
19
- import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
20
- import snsSharedLib from '@izara_project/izara-core-library-sns';
21
- import sqsSharedLib from '@izara_project/izara-core-library-sqs';
22
- import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow';
23
- import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
24
- import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
25
-
26
- //(<optionalImport>)
27
- import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
28
- import {
29
- lambda,
30
- sns,
31
- sqs
32
- } from '@izara_project/izara-core-library-external-request';
33
- import { identifierUuid } from '@izara_project/izara-shared-core';
34
- import { consts, NoRetryError } from '@izara_project/izara-core-library-core';
35
- import { utils } from '@izara_project/izara-core-library-service-schemas';
36
-
37
- const { createFlowTypeConcat } = utils;
38
- //(</optionalImport>)
39
-
40
- /**
41
- *
42
- *
43
- * description of function.
44
- * @param {Object} _izContext
45
- * @param {CorrelationIds} _izContext.correlationIds - property of _izContext
46
- * @param {Logger} _izContext.logger - property of _izContext
47
- * @param {Object} requestParams - request params
48
- * @param {Object} requestParams.identifiers - identifiers for get data
49
- * @param {Object} requestParams.additionalRequest - additionalRequest
50
- *
51
- *
52
- * @returns {object} description of return value
53
- */
54
-
55
- export default async function Process<%= flowTag %>(
56
- _izContext,
57
- requestParams,
58
- callingFlowConfig = {}
59
- //(<additionalParams>)
60
- //(</additionalParams>)
61
- ) {
62
- try {
63
- _izContext.logger.debug(
64
- 'Process<%= flowTag %> _izContext',
65
- _izContext
66
- );
67
- _izContext.logger.debug(
68
- 'Process<%= flowTag %> requestParams',
69
- requestParams
70
- );
71
- _izContext.logger.debug(
72
- 'Process<%= flowTag %> callingFlowConfig',
73
- callingFlowConfig
74
- );
75
-
76
- const userId = _izContext.correlationIds.get(consts.BASE_USER_ID);
77
-
78
- _izContext.logger.debug(
79
- '[Rbac:Process<%= flowTag %>] userId',
80
- userId
81
- );
82
-
83
- if (!userId) {
84
- throw new NoRetryError('User Id not found.');
85
- }
86
-
87
- const resultQuery = await dynamodbSharedLib.query(
88
- _izContext,
89
- dynamodbSharedLib.tableName(_izContext, 'TargetRoles'),
90
- { userId }
91
- );
92
-
93
- _izContext.logger.debug(
94
- '[Rbac:Process<%= flowTag %>] resultQuery',
95
- resultQuery
96
- );
97
-
98
- const message = {
99
- returnResult: {
100
- records: resultQuery.Items || []
101
- }
102
- };
103
-
104
- const messageResult = {
105
- message,
106
- TopicArn: snsSharedLib.snsTopicArnByFlowSchema(_izContext, `<%- flowTag %>_Out`)
107
- };
108
-
109
- _izContext.logger.debug(
110
- '[Rbac:Process<%= flowTag %>] messageResult',
111
- messageResult
112
- );
113
-
114
- await sns.publishMessage(_izContext, messageResult);
115
- } catch (err) {
116
- _izContext.logger.error(
117
- '[Rbac:Process<%= flowTag %>] error: ',
118
- err
119
- );
120
- throw err;
121
- }
122
- }
@@ -1,117 +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
16
- <http: //www.gnu.org/licenses />.
17
- */
18
-
19
- import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
20
- import snsSharedLib from '@izara_project/izara-core-library-sns';
21
- import sqsSharedLib from '@izara_project/izara-core-library-sqs';
22
- import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow';
23
- import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
24
- import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
25
-
26
- //(<optionalImport>)
27
- import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
28
- import {
29
- lambda,
30
- sns,
31
- sqs
32
- } from '@izara_project/izara-core-library-external-request';
33
- import { identifierUuid } from '@izara_project/izara-shared-core';
34
- import { consts, NoRetryError } from '@izara_project/izara-core-library-core';
35
- import { utils } from '@izara_project/izara-core-library-service-schemas';
36
-
37
- const { createFlowTypeConcat } = utils;
38
- //(</optionalImport>)
39
-
40
- /**
41
- *
42
- *
43
- * description of function.
44
- * @param {Object} _izContext
45
- * @param {CorrelationIds} _izContext.correlationIds - property of _izContext
46
- * @param {Logger} _izContext.logger - property of _izContext
47
- * @param {Object} requestParams - request params
48
- * @param {Object} requestParams.identifiers - identifiers for get data
49
- * @param {Object} requestParams.additionalRequest - additionalRequest
50
- *
51
- *
52
- * @returns {object} description of return value
53
- */
54
-
55
- export default async function Process<%= flowTag %>(
56
- _izContext,
57
- requestParams,
58
- callingFlowConfig = {}
59
- //(<additionalParams>)
60
- //(</additionalParams>)
61
- ) {
62
- try {
63
- _izContext.logger.debug(
64
- 'Process<%= flowTag %> _izContext',
65
- _izContext
66
- );
67
- _izContext.logger.debug(
68
- 'Process<%= flowTag %> requestParams',
69
- requestParams
70
- );
71
- _izContext.logger.debug(
72
- 'Process<%= flowTag %> callingFlowConfig',
73
- callingFlowConfig
74
- );
75
-
76
- const { roleIdKey } = requestParams;
77
-
78
- _izContext.logger.debug(
79
- '[Rbac:Process<%= flowTag %>] Inputs', { roleIdKey }
80
- );
81
-
82
- const resultQuery = await dynamodbSharedLib.query(
83
- _izContext,
84
- dynamodbSharedLib.tableName(_izContext, 'RoleUsers'),
85
- { roleIdKey }
86
- );
87
-
88
- _izContext.logger.debug(
89
- '[Rbac:Process<%= flowTag %>] resultQuery',
90
- resultQuery
91
- );
92
-
93
- const message = {
94
- returnResult: {
95
- records: resultQuery.Items || []
96
- }
97
- };
98
-
99
- const messageResult = {
100
- message,
101
- TopicArn: snsSharedLib.snsTopicArnByFlowSchema(_izContext, `<%- flowTag %>_Out`)
102
- };
103
-
104
- _izContext.logger.debug(
105
- '[Rbac:Process<%= flowTag %>] messageResult',
106
- messageResult
107
- );
108
-
109
- await sns.publishMessage(_izContext, messageResult);
110
- } catch (err) {
111
- _izContext.logger.error(
112
- '[Rbac:Process<%= flowTag %>] error: ',
113
- err
114
- );
115
- throw err;
116
- }
117
- }