@izara_project/izara-core-generate-service-code 1.0.52 → 1.0.53
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/index.js +11 -17
- package/package.json +9 -8
- package/src/codeGenerators/app/initial_setup/InitialSetupGenerator.js +149 -0
- package/src/codeGenerators/app/initial_setup/templates/InitialSetup_LambdaRole.ejs +43 -0
- package/src/codeGenerators/app/initial_setup/templates/InitialSetup_SnsService.ejs +15 -0
- package/src/codeGenerators/app/initial_setup/templates/InitialSetup_TableName.ejs +9 -0
- package/src/codeGenerators/app/sls_yaml/FunctionYamlGenerator.js +230 -0
- package/src/codeGenerators/app/sls_yaml/ProcessLogicalYamlGenerator.js +35 -0
- package/src/codeGenerators/app/sls_yaml/RoleNameConfigGenerator.js +83 -0
- package/src/codeGenerators/app/sls_yaml/SharedResourceYamlGenerator.js +471 -0
- package/src/codeGenerators/app/sls_yaml/__tests__/SharedResourceYamlGenerator.test.js +176 -0
- package/src/codeGenerators/app/sls_yaml/_policy/PolicyEmitter.js +45 -0
- package/src/codeGenerators/app/sls_yaml/_policy/PolicyRegistry.js +94 -0
- package/src/codeGenerators/app/sls_yaml/_policy/__tests__/PolicyEmitter.test.js +55 -0
- package/src/codeGenerators/app/sls_yaml/_policy/__tests__/PolicyRegistry.test.js +48 -0
- package/src/codeGenerators/app/sls_yaml/_policy/templates/ManagedPolicy_Yaml.ejs +22 -0
- package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Api.ejs +21 -0
- package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_EventBridge.ejs +14 -0
- package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Inv.ejs +6 -0
- package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Sqs.ejs +11 -0
- package/src/codeGenerators/app/sls_yaml/templates/FunctionYaml_Wbs.ejs +11 -0
- package/src/codeGenerators/app/sls_yaml/templates/ProcessLogical_Yaml.ejs +32 -0
- package/src/{generators/fromObjectSchema/roleNameConfig/templateYaml.ejs → codeGenerators/app/sls_yaml/templates/RoleNameConfig_Yaml.ejs} +1 -1
- package/src/codeGenerators/app/sls_yaml/templates/SharedResource_Yaml.ejs +35 -0
- package/src/codeGenerators/app/src/generatedCode/FindData/FindDataGenerator.js +272 -0
- package/src/codeGenerators/app/src/generatedCode/FindData/templates/FindData_HdrSqs.ejs +87 -0
- package/src/codeGenerators/app/src/generatedCode/FindData/templates/FindData_Main.ejs +108 -0
- package/src/codeGenerators/app/src/generatedCode/FindData/templates/FindData_Yaml.ejs +10 -0
- package/src/codeGenerators/app/src/generatedCode/FindData/templates/GetByStorage/getByDynamo.ejs +32 -0
- package/src/{generators/fromObjectSchema/findData → codeGenerators/app/src/generatedCode/FindData/templates}/GetByStorage/getByGraph.ejs +5 -5
- package/src/{generators/fromObjectSchema/endpoint/main/create/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowEndpoints/templates/crud/CreateEndpoint_Main.ejs} +6 -6
- package/src/{generators/fromObjectSchema/endpoint/main/delete/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowEndpoints/templates/crud/DeleteEndpoint_Main.ejs} +5 -5
- package/src/{generators/fromObjectSchema/endpoint/main/get/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowEndpoints/templates/crud/GetEndpoint_Main.ejs} +1 -1
- package/src/{generators/fromObjectSchema/endpoint/main/update/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowEndpoints/templates/crud/UpdateEndpoint_Main.ejs} +5 -5
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/RbacFlowGenerator.js +73 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/CreateRolePermissions.ejs +135 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/CreateTargetRole.ejs +131 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/CreateUserRole.ejs +150 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/DeleteRolePermissions.ejs +132 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/DeleteTargetRole.ejs +132 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/DeleteUserFromRole.ejs +150 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/ListRolePermissions.ejs +120 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/ListTargetRole.ejs +122 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRbac/templates/rbac/ListUserInRoles.ejs +117 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/RelationshipFlowGenerator.js +127 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/StatusFieldGenerator.js +116 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/WebSocketGenerator.js +124 -0
- package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3/CreatePreSignUrl_Main.ejs} +7 -7
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3/FlowHandler_HdrS3.ejs +66 -0
- package/src/{generators/fromFlowSchema/events/s3/flowSchemaMainFunction/main.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/flowSchemaMainFunction/data.js} +1 -3
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/index.js +21 -22
- package/src/{generators/fromFlowSchema/events/s3/upload/confirmReserved/functionYaml/yaml.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/functionYaml/data.js} +9 -20
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/functionYaml/template.ejs +17 -0
- package/src/{generators/fromFlowSchema/events/s3/upload/confirmReserved/handler/handler.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/handler/data.js} +1 -3
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/confirmReserved/handler/template.ejs +5 -5
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/mainFunction/template.ejs +129 -0
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/confirmReserved/queue/template.ejs +5 -2
- package/src/{generators/fromFlowSchema/events/s3/upload/createObject/functionYaml/yaml.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/functionYaml/data.js} +8 -24
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/createObject/functionYaml/template.ejs +7 -3
- package/src/{generators/fromFlowSchema/events/s3/upload/createObject/handler/handler.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/handler/data.js} +1 -3
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/createObject/handler/template.ejs +2 -2
- package/src/{generators/fromFlowSchema/events/s3/upload/createObject/mainFunction/main.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/mainFunction/data.js} +1 -2
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObject/mainFunction/template.ejs +131 -0
- package/src/{generators/fromFlowSchema/events/s3/upload/createObjectComplete/functionYaml/yaml.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/functionYaml/data.js} +9 -26
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/createObjectComplete/functionYaml/template.ejs +8 -4
- package/src/{generators/fromFlowSchema/events/s3/upload/createObjectComplete/handler/handler.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/handler/data.js} +1 -3
- package/src/{generators/fromFlowSchema/events/s3/upload/createObjectComplete/mainFunction/main.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/mainFunction/data.js} +1 -2
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/createObjectComplete/sns-sqs/template.ejs +5 -2
- package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/functionYaml/yaml.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/functionYaml/data.js} +10 -28
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/functionYaml/template.ejs +18 -0
- package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/handler/handler.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/handler/data.js} +2 -4
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/preSignUrl/createPreSignUrl/handler/template.ejs +5 -5
- package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/mainFunction/main.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/mainFunction/data.js} +2 -3
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/mainFunction/template.ejs +262 -0
- package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/queue/queue.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/createPreSignUrl/queue/data.js} +1 -1
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/preSignUrl/createPreSignUrl/queue/template.ejs +5 -2
- package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/functionYaml/yaml.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/functionYaml/data.js} +10 -28
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +14 -0
- package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/handler/handler.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/handler/data.js} +1 -3
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/preSignUrl/reservedLimit/handler/template.ejs +5 -5
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +173 -0
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/preSignUrl/reservedLimit/sqs/template.ejs +6 -3
- package/src/{generators/fromFlowSchema/events/s3/upload/processFile/functionYml/HdrS3/yaml.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/functionYml/HdrS3/data.js} +8 -24
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/processFile/functionYml/HdrS3/template.ejs +7 -3
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/processFile/handler/handlerS3/template.ejs +3 -3
- package/src/codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/mainFunction/template.ejs +66 -0
- package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/processFile/queue/s3Template.ejs +5 -2
- package/src/{generators/fromFlowSchema/events/s3/upload/relate/sns-out/snsOut.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/relate/sns-out/data.js} +1 -1
- package/src/{generators/fromFlowSchema/statusTypes/statusField/handler/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/statusField/CompleteStatusField_HdrSqs.ejs} +0 -2
- package/src/{generators/fromFlowSchema/webSocket/webSocketComplete/functionYaml/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocketFlow_Yaml.ejs} +5 -5
- package/src/{generators/fromFlowSchema/webSocket/webSocketComplete/sqs/templateSub.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocketSub_Yaml.ejs} +1 -1
- package/src/{generators/fromFlowSchema/webSocket/webSocketComplete/handler/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocket_HdrSqs.ejs} +1 -20
- package/src/{generators/fromFlowSchema/webSocket/webSocketComplete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocket_Main.ejs} +1 -21
- package/src/{generators/fromFlowSchema/webSocket/webSocket/connect/handler/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/WebSocketConnect_Main.ejs} +1 -21
- package/src/{generators/fromFlowSchema/webSocket/webSocket/connect/functionYaml/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/WebSocketConnect_Yaml.ejs} +1 -1
- package/src/codeGenerators/app/src/generatedCode/Flow/SystemFlowDescriptorBuilder.js +151 -0
- package/src/{generators/fromObjectSchema/endpoint/main/beforeLogical/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/endpoint/FlowEndpointBeforeLogical_Main.ejs} +11 -16
- package/src/{generators/fromFlowSchema/events/ownTopic/flowSchema/handler/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/endpoint/FlowEndpoint_HdrWbs.ejs} +6 -6
- package/src/{generators/fromFlowSchema/flowSchemaMainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/endpoint/FlowEndpoint_Main.ejs} +31 -25
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/_shared/endpoint/FlowEntryPoint_Main.ejs +38 -0
- package/src/{generators/fromFlowSchema/events/ownTopic/flowSchema/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/endpoint/FlowMain_Wbs.ejs} +20 -20
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/_shared/handlers/FlowHandler_HdrApi.ejs +51 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/_shared/handlers/FlowHandler_HdrInv.ejs +45 -0
- package/src/{generators/fromPlugIn/firstFlowStep/handler/templateSqs.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/handlers/FlowHandler_HdrSqs.ejs} +30 -9
- package/src/{generators/fromObjectSchema/endpointComplete/create/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/FlowEndpointComplete_Main.ejs} +26 -24
- package/src/{generators/fromFlowSchema/flowStep/noPlugInHook/templateMain.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/FlowStep_Main.ejs} +13 -12
- package/src/{generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/CheckTriggerCache_Main.ejs} +0 -2
- package/src/{generators/fromObjectSchema/relationship/create/action/sns-in-sqs/sqsTemplate.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/TriggerCacheQueue_Yaml.ejs} +6 -10
- package/src/{generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/sqs/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/yaml/SharedFunctionSqs_Yaml.ejs} +1 -5
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/BaseSqsHandler.js +67 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/eventBridge.js +25 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/extTopic.js +6 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/lambdaSyncApi.js +52 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/lambdaSyncInv.js +52 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/ownTopic.js +42 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/registry.js +15 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/s3.js +56 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/s3Components/ConfirmAfterUploadS3Generator.js +48 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/s3Components/CreateObjectGenerator.js +52 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/s3Components/CreatePreSignUrlGenerator.js +50 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/s3Components/ProcessAfterUploadS3Generator.js +49 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/events/s3Components/ReservedLimitGenerator.js +49 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/eventTypes.js +23 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowClassifier.js +49 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowEntryPointBase.js +102 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowMainFunctionBase.js +160 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowNaming.js +21 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowSelection.js +20 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowStepBase.js +229 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowStepNormalizer.js +28 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/flowValidator.js +144 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/registry.js +7 -0
- package/src/codeGenerators/app/src/generatedCode/Flow/_internal/shared/triggerCacheBase.js +183 -0
- package/src/codeGenerators/app/src/generatedCode/ProcessLogical/ProcessLogicalGenerator.js +26 -0
- package/src/{generators/fromObjectSchema/processLogicalPagination/handler/dsq/template.ejs → codeGenerators/app/src/generatedCode/ProcessLogical/templates/PaginateProcessLogical_HdrDsq.js} +1 -1
- package/src/{generators/fromObjectSchema/processLogicalPagination/handler/sqs/template.ejs → codeGenerators/app/src/generatedCode/ProcessLogical/templates/PaginateProcessLogical_HdrSqs.js} +1 -1
- package/src/{generators/fromObjectSchema/processLogicalPagination/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/ProcessLogical/templates/PaginateProcessLogical_Main.js} +10 -10
- package/src/{generators/fromObjectSchema/processLogical/handler/template.ejs → codeGenerators/app/src/generatedCode/ProcessLogical/templates/ProcessLogical_HdrSqs.js} +1 -1
- package/src/{generators/fromObjectSchema/processLogical/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/ProcessLogical/templates/ProcessLogical_Main.js} +16 -16
- package/src/codeGenerators/app/src/generatedCode/SystemFlowSchemas/RegisterGenerator.js +166 -0
- package/src/{generators/fromFlowSchema/register/wbs/handler/template.ejs → codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/Register_HdrWbs.ejs} +1 -5
- package/src/codeGenerators/app/src/generatedCode/libs/ConstsGenerator.js +20 -0
- package/src/codeGenerators/app/src/generatedCode/libs/GenerateCodeLibsGenerator.js +20 -0
- package/src/codeGenerators/app/src/generatedCode/libs/templates/Consts.js +448 -0
- package/src/{generators/fromFlowSchema/shared/template.ejs → codeGenerators/app/src/generatedCode/libs/templates/GenerateCodeLibs.js} +38 -29
- package/src/codeGenerators/resource/sls_yaml/DynamoDBGenerator.js +96 -0
- package/src/codeGenerators/resource/sls_yaml/FlowOutGenerator.js +64 -0
- package/src/codeGenerators/resource/sls_yaml/FlowResourceYamlGenerator.js +172 -0
- package/src/codeGenerators/resource/sls_yaml/templates/DynamoDBTable_Yaml.ejs +20 -0
- package/src/{generators/fromObjectSchema/relationship/create/complete/sns-out/template.ejs → codeGenerators/resource/sls_yaml/templates/FlowOut_Yaml.ejs} +3 -5
- package/src/codeGenerators/resource/sls_yaml/templates/SystemDynamoDB_Yaml.ejs +138 -0
- package/src/{generators/fromObjectSchema/relationship/update/complete/sns-in-sqs/template.ejs → codeGenerators/resource/sls_yaml/templates/crud/ResourceSqsYaml.ejs} +6 -10
- package/src/{generators/fromObjectSchema/endpoint/resourceTemplate.ejs → codeGenerators/resource/sls_yaml/templates/crud/ResourceYaml.ejs} +9 -9
- package/src/core/validate.js +161 -0
- package/src/generate.js +130 -0
- package/src/generateCode.js +212 -49
- package/src/generateIntTest.js +166 -0
- package/src/generateResourceIntTest.js +102 -0
- package/src/generateResources/IntTest/consts.js +36 -0
- package/src/generateResources/IntTest/generateResources/generateResources.js +11 -14
- package/src/generateResources/IntTest/generateTests/events/events.js +1 -4
- package/src/generateResources/IntTest/generateTests/generateTemplate.js +15 -16
- package/src/generateResources/IntTest/generateTests/pathIntTest/pathIntTest.js +6 -2
- package/src/generateResources/IntTest/generateTests/tests/tests.js +2 -6
- package/src/generateResources/IntTest/libs/libs.js +5 -5
- package/src/generateSchema.js +63 -0
- package/src/parsers/flowSchemaParser.js +106 -0
- package/src/parsers/objectSchemaParser.js +39 -0
- package/src/parsers/relationshipSchemaParser.js +51 -0
- package/src/schemaGenerators/app/src/schemas/FlowSchemas/FlowSchemaGenerator.js +151 -0
- package/src/schemaGenerators/app/src/schemas/FlowSchemas/RbacFlowSchemaGenerator.js +84 -0
- package/src/schemaGenerators/app/src/schemas/FlowSchemas/RelationshipFlowSchemaGenerator.js +89 -0
- package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/DynamicFlowSchemaTemplate.ejs +39 -0
- package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/DynamicRbacFlowSchemaTemplate.ejs +19 -0
- package/src/schemaGenerators/app/src/schemas/FlowSchemas/templates/RelationshipFlowSchemaTemplate.ejs +32 -0
- package/src/schemaGenerators/app/src/schemas/ObjectSchemas/AttributeTreeSchemaGenerator.js +124 -0
- package/src/schemaGenerators/app/src/schemas/ObjectSchemas/PropertyValueSchemaGenerator.js +119 -0
- package/src/schemaGenerators/app/src/schemas/ObjectSchemas/templates/DynamicAttributeTreeManagerSchemaTemplate.ejs +14 -0
- package/src/schemaGenerators/app/src/schemas/ObjectSchemas/templates/DynamicAttributeTreeStandardSchemaTemplate.ejs +13 -0
- package/src/schemaGenerators/app/src/schemas/ObjectSchemas/templates/DynamicPropertyValueSchemaTemplate.ejs +15 -0
- package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/AttributeTreeRelationshipSchemaGenerator.js +149 -0
- package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/PropertyValueRelationshipSchemaGenerator.js +143 -0
- package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/templates/DynamicAttributeTreeRelationshipSchemaTemplate.ejs +7 -0
- package/src/schemaGenerators/app/src/schemas/RelationshipSchemas/templates/DynamicPropertyValueRelationshipSchemaTemplate.ejs +7 -0
- package/src/schemaGenerators/app/src/schemas/SystemTextSchemas/SystemTextGenerator.js +102 -0
- package/src/{generators/fromObjectSchema/textTag/systemText/template.ejs → schemaGenerators/app/src/schemas/SystemTextSchemas/templates/SystemText_Template.ejs} +1 -1
- package/REFACTOR_PLAN.md +0 -172
- package/fix_array.js +0 -11
- package/fix_imports.js +0 -41
- package/fix_upper.js +0 -38
- package/src/IntTestConfig.js +0 -23
- package/src/generateResources/IntTest/upload/uploadIntTest.js +0 -96
- package/src/generateResources.js +0 -123
- package/src/generateTests.js +0 -139
- package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/functionNameConfig.js +0 -182
- package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/template.ejs +0 -14
- package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/templateIntTesting.ejs +0 -31
- package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/templateYaml.ejs +0 -10
- package/src/generators/fromExternalService/externalServiceComponent/index.js +0 -69
- package/src/generators/fromExternalService/externalServiceComponent/lambdaRole/lambdaRole.js +0 -250
- package/src/generators/fromExternalService/externalServiceComponent/lambdaRole/template.ejs +0 -58
- package/src/generators/fromExternalService/externalServiceComponent/snsTopicSubscriptions/snsTopicSubscriptions.js +0 -155
- package/src/generators/fromExternalService/externalServiceComponent/snsTopicSubscriptions/template.ejs +0 -33
- package/src/generators/fromExternalService/externalServiceComponent/tableNameConfig/tableNameConfig.js +0 -90
- package/src/generators/fromExternalService/externalServiceComponent/tableNameConfig/template.ejs +0 -43
- package/src/generators/fromExternalService/index.js +0 -65
- package/src/generators/fromFlowSchema/env/template.ejs +0 -5
- package/src/generators/fromFlowSchema/env/yaml.js +0 -73
- package/src/generators/fromFlowSchema/events/eventBridge/functionYaml/template.ejs +0 -14
- package/src/generators/fromFlowSchema/events/eventBridge/functionYaml/yaml.js +0 -168
- package/src/generators/fromFlowSchema/events/eventBridge/handler/inv/inv.js +0 -74
- package/src/generators/fromFlowSchema/events/eventBridge/handler/inv/request.json +0 -7
- package/src/generators/fromFlowSchema/events/eventBridge/handler/inv/template.ejs +0 -53
- package/src/generators/fromFlowSchema/events/eventBridge/index.js +0 -16
- package/src/generators/fromFlowSchema/events/eventBridge/mainFunction/main.js +0 -77
- package/src/generators/fromFlowSchema/events/eventBridge/mainFunction/request.json +0 -5
- package/src/generators/fromFlowSchema/events/eventBridge/mainFunction/template.ejs +0 -59
- package/src/generators/fromFlowSchema/events/extTopic/index.js +0 -18
- package/src/generators/fromFlowSchema/events/extTopic/process/functionYaml/template.ejs +0 -13
- package/src/generators/fromFlowSchema/events/extTopic/process/functionYaml/yaml.js +0 -159
- package/src/generators/fromFlowSchema/events/extTopic/process/handler/handler.js +0 -67
- package/src/generators/fromFlowSchema/events/extTopic/process/handler/template.ejs +0 -101
- package/src/generators/fromFlowSchema/events/extTopic/sns-in-sqs/snsInSqs.js +0 -79
- package/src/generators/fromFlowSchema/events/extTopic/sns-in-sqs/template.ejs +0 -44
- package/src/generators/fromFlowSchema/events/extTopic/sns-out/snsOut.js +0 -76
- package/src/generators/fromFlowSchema/events/lambdaSyncApi/functionYaml/template.ejs +0 -19
- package/src/generators/fromFlowSchema/events/lambdaSyncApi/functionYaml/yaml.js +0 -88
- package/src/generators/fromFlowSchema/events/lambdaSyncApi/handler/handler.js +0 -68
- package/src/generators/fromFlowSchema/events/lambdaSyncApi/handler/template.ejs +0 -84
- package/src/generators/fromFlowSchema/events/lambdaSyncApi/index.js +0 -14
- package/src/generators/fromFlowSchema/events/lambdaSyncInv/functionYaml/template.ejs +0 -6
- package/src/generators/fromFlowSchema/events/lambdaSyncInv/functionYaml/yaml.js +0 -75
- package/src/generators/fromFlowSchema/events/lambdaSyncInv/handler/handler.js +0 -64
- package/src/generators/fromFlowSchema/events/lambdaSyncInv/handler/template.ejs +0 -52
- package/src/generators/fromFlowSchema/events/lambdaSyncInv/index.js +0 -14
- package/src/generators/fromFlowSchema/events/ownTopic/endpoint/functionYaml/template.ejs +0 -10
- package/src/generators/fromFlowSchema/events/ownTopic/endpoint/functionYaml/yaml.js +0 -178
- package/src/generators/fromFlowSchema/events/ownTopic/endpoint/handler/DsqHandlerTemplate.ejs +0 -105
- package/src/generators/fromFlowSchema/events/ownTopic/endpoint/handler/SqsHandlerTemplate.ejs +0 -87
- package/src/generators/fromFlowSchema/events/ownTopic/endpoint/handler/handler.js +0 -93
- package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/functionYaml/template.ejs +0 -11
- package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/functionYaml/yaml.js +0 -127
- package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/handler/handler.js +0 -65
- package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/mainFunction/main.js +0 -64
- package/src/generators/fromFlowSchema/events/ownTopic/index.js +0 -32
- package/src/generators/fromFlowSchema/events/ownTopic/sns-in/snsIn.js +0 -108
- package/src/generators/fromFlowSchema/events/ownTopic/sns-out/snsOut.js +0 -77
- package/src/generators/fromFlowSchema/events/registry.js +0 -6
- package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/functionYaml/template.ejs +0 -13
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/functionYaml/template.ejs +0 -14
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +0 -10
- package/src/generators/fromFlowSchema/flowSchemaMainFunction/main.js +0 -123
- package/src/generators/fromFlowSchema/flowSchemaMainFunction/templateByStatusType/statusFieldTemplate.ejs +0 -30
- package/src/generators/fromFlowSchema/flowSchemaMainFunction/templateByStatusType/storedCacheTemplate.ejs +0 -26
- package/src/generators/fromFlowSchema/flowSchemaMainFunction/templateByStatusType/triggerCacheTemplate.ejs +0 -44
- package/src/generators/fromFlowSchema/flowStep/afterPluginHook/handler/templateDsq.ejs +0 -151
- package/src/generators/fromFlowSchema/flowStep/afterPluginHook/handler/templateSqs.ejs +0 -89
- package/src/generators/fromFlowSchema/flowStep/afterPluginHook/templateMain.ejs +0 -93
- package/src/generators/fromFlowSchema/flowStep/afterPluginHook/templateResource.ejs +0 -91
- package/src/generators/fromFlowSchema/flowStep/afterPluginHook/templateYaml.ejs +0 -47
- package/src/generators/fromFlowSchema/flowStep/firstFlowStep/templateHandler.ejs +0 -95
- package/src/generators/fromFlowSchema/flowStep/firstFlowStep/templateMain.ejs +0 -95
- package/src/generators/fromFlowSchema/flowStep/firstFlowStep/templateResource.ejs +0 -56
- package/src/generators/fromFlowSchema/flowStep/firstFlowStep/templateYaml.ejs +0 -23
- package/src/generators/fromFlowSchema/flowStep/flowStep.js +0 -515
- package/src/generators/fromFlowSchema/flowStep/noPlugInHook/templateHandler.ejs +0 -95
- package/src/generators/fromFlowSchema/flowStep/noPlugInHook/templateResource.ejs +0 -52
- package/src/generators/fromFlowSchema/flowStep/noPlugInHook/templateYaml.ejs +0 -23
- package/src/generators/fromFlowSchema/index.js +0 -213
- package/src/generators/fromFlowSchema/register/complete/functionYaml/template.ejs +0 -23
- package/src/generators/fromFlowSchema/register/complete/functionYaml/yaml.js +0 -127
- package/src/generators/fromFlowSchema/register/complete/handler/handler.js +0 -61
- package/src/generators/fromFlowSchema/register/complete/mainFunction/main.js +0 -53
- package/src/generators/fromFlowSchema/register/dynamoDB/register.js +0 -74
- package/src/generators/fromFlowSchema/register/index.js +0 -50
- package/src/generators/fromFlowSchema/register/sns-in/snsIn.js +0 -59
- package/src/generators/fromFlowSchema/register/sns-in/template.ejs +0 -42
- package/src/generators/fromFlowSchema/register/subscriptionOutAll/subscriptionOutAll.js +0 -84
- package/src/generators/fromFlowSchema/register/subscriptionOutAll/template.ejs +0 -10
- package/src/generators/fromFlowSchema/register/wbs/functionYaml/template.ejs +0 -11
- package/src/generators/fromFlowSchema/register/wbs/functionYaml/yaml.js +0 -114
- package/src/generators/fromFlowSchema/register/wbs/handler/handler.js +0 -63
- package/src/generators/fromFlowSchema/register/wbs/mainFunction/main.js +0 -54
- package/src/generators/fromFlowSchema/shared/wsCodeLibs.js +0 -49
- package/src/generators/fromFlowSchema/statusTypes/registry.js +0 -2
- package/src/generators/fromFlowSchema/statusTypes/statusField/functionYaml/template.ejs +0 -18
- package/src/generators/fromFlowSchema/statusTypes/statusField/functionYaml/yaml.js +0 -169
- package/src/generators/fromFlowSchema/statusTypes/statusField/handler/handler.js +0 -68
- package/src/generators/fromFlowSchema/statusTypes/statusField/index.js +0 -22
- package/src/generators/fromFlowSchema/statusTypes/statusField/mainFunction/main.js +0 -67
- package/src/generators/fromFlowSchema/statusTypes/statusField/sns/sns.js +0 -66
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/functionYaml/template.ejs +0 -18
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/functionYaml/yaml.js +0 -154
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/handler/handler.js +0 -73
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/mainFunction/main.js +0 -75
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/index.js +0 -41
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/functionYaml/template.ejs +0 -18
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/functionYaml/yaml.js +0 -159
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/handler/handler.js +0 -74
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/mainFunction/main.js +0 -68
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/dsq/dsq.js +0 -148
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/dsq/template.ejs +0 -17
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/sqs/sqs.js +0 -148
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/dsq/dsq.js +0 -69
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/sqs/sqs.js +0 -69
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/mainFunction/main.js +0 -72
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheQueue/queue.js +0 -97
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheQueue/template.ejs +0 -46
- package/src/generators/fromFlowSchema/webSocket/index.js +0 -39
- package/src/generators/fromFlowSchema/webSocket/webSocket/connect/functionYaml/yaml.js +0 -89
- package/src/generators/fromFlowSchema/webSocket/webSocket/connect/handler/handler.js +0 -55
- package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/WebSocketTaskData.js +0 -74
- package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/ttlDynamoTemplate.ejs +0 -29
- package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/userUploadRecords.js +0 -61
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/functionYaml/yaml.js +0 -144
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/handler/handler.js +0 -61
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/mainFunction/main.js +0 -53
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/sqs/sqs.js +0 -108
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/sqs/template.ejs +0 -40
- package/src/generators/fromObjectSchema/endpoint/handler/api.js +0 -55
- package/src/generators/fromObjectSchema/endpoint/handler/apiTemplate.ejs +0 -81
- package/src/generators/fromObjectSchema/endpoint/handler/beforeLogical.js +0 -56
- package/src/generators/fromObjectSchema/endpoint/handler/beforeLogicalTemplate.ejs +0 -123
- package/src/generators/fromObjectSchema/endpoint/handler/dsq.js +0 -55
- package/src/generators/fromObjectSchema/endpoint/handler/dsqTemplate.ejs +0 -126
- package/src/generators/fromObjectSchema/endpoint/handler/inv.js +0 -55
- package/src/generators/fromObjectSchema/endpoint/handler/invTemplate.ejs +0 -63
- package/src/generators/fromObjectSchema/endpoint/handler/sqs.js +0 -55
- package/src/generators/fromObjectSchema/endpoint/handler/sqsTemplate.ejs +0 -124
- package/src/generators/fromObjectSchema/endpoint/index.js +0 -290
- package/src/generators/fromObjectSchema/endpoint/main/beforeLogical/beforeLogical.js +0 -54
- package/src/generators/fromObjectSchema/endpoint/main/create/create.js +0 -52
- package/src/generators/fromObjectSchema/endpoint/main/delete/delete.js +0 -49
- package/src/generators/fromObjectSchema/endpoint/main/get/get.js +0 -49
- package/src/generators/fromObjectSchema/endpoint/main/update/update.js +0 -50
- package/src/generators/fromObjectSchema/endpoint/resource.js +0 -72
- package/src/generators/fromObjectSchema/endpoint/yaml.js +0 -308
- package/src/generators/fromObjectSchema/endpoint/yamlTemplate.ejs +0 -28
- package/src/generators/fromObjectSchema/endpointComplete/create/handler/handler.js +0 -63
- package/src/generators/fromObjectSchema/endpointComplete/create/handler/template.ejs +0 -126
- package/src/generators/fromObjectSchema/endpointComplete/create/mainFunction/main.js +0 -54
- package/src/generators/fromObjectSchema/endpointComplete/create/sns-in-sqs/snsInSqs.js +0 -63
- package/src/generators/fromObjectSchema/endpointComplete/create/sns-in-sqs/template.ejs +0 -44
- package/src/generators/fromObjectSchema/endpointComplete/create/sns-out/snsOut.js +0 -72
- package/src/generators/fromObjectSchema/endpointComplete/create/sns-out/template.ejs +0 -8
- package/src/generators/fromObjectSchema/endpointComplete/create/yaml/template.ejs +0 -17
- package/src/generators/fromObjectSchema/endpointComplete/create/yaml/yaml.js +0 -152
- package/src/generators/fromObjectSchema/endpointComplete/delete/handler/handler.js +0 -68
- package/src/generators/fromObjectSchema/endpointComplete/delete/handler/template.ejs +0 -122
- package/src/generators/fromObjectSchema/endpointComplete/delete/mainFunction/main.js +0 -55
- package/src/generators/fromObjectSchema/endpointComplete/delete/mainFunction/template.ejs +0 -87
- package/src/generators/fromObjectSchema/endpointComplete/delete/sns-in-sqs/snsInSqs.js +0 -64
- package/src/generators/fromObjectSchema/endpointComplete/delete/sns-in-sqs/template.ejs +0 -44
- package/src/generators/fromObjectSchema/endpointComplete/delete/sns-out/snsOut.js +0 -69
- package/src/generators/fromObjectSchema/endpointComplete/delete/yaml/template.ejs +0 -16
- package/src/generators/fromObjectSchema/endpointComplete/delete/yaml/yaml.js +0 -124
- package/src/generators/fromObjectSchema/endpointComplete/get/handler/handler.js +0 -68
- package/src/generators/fromObjectSchema/endpointComplete/get/handler/template.ejs +0 -122
- package/src/generators/fromObjectSchema/endpointComplete/get/mainFunction/main.js +0 -54
- package/src/generators/fromObjectSchema/endpointComplete/get/mainFunction/template.ejs +0 -132
- package/src/generators/fromObjectSchema/endpointComplete/get/sns-in-sqs/snsInSqs.js +0 -63
- package/src/generators/fromObjectSchema/endpointComplete/get/sns-in-sqs/template.ejs +0 -44
- package/src/generators/fromObjectSchema/endpointComplete/get/sns-out/snsOut.js +0 -69
- package/src/generators/fromObjectSchema/endpointComplete/get/yaml/template.ejs +0 -17
- package/src/generators/fromObjectSchema/endpointComplete/get/yaml/yaml.js +0 -127
- package/src/generators/fromObjectSchema/endpointComplete/index.js +0 -101
- package/src/generators/fromObjectSchema/endpointComplete/update/handler/handler.js +0 -68
- package/src/generators/fromObjectSchema/endpointComplete/update/handler/template.ejs +0 -122
- package/src/generators/fromObjectSchema/endpointComplete/update/mainFunction/main.js +0 -54
- package/src/generators/fromObjectSchema/endpointComplete/update/mainFunction/template.ejs +0 -218
- package/src/generators/fromObjectSchema/endpointComplete/update/sns-in-sqs/snsInSqs.js +0 -63
- package/src/generators/fromObjectSchema/endpointComplete/update/sns-in-sqs/template.ejs +0 -44
- package/src/generators/fromObjectSchema/endpointComplete/update/sns-out/snsOut.js +0 -66
- package/src/generators/fromObjectSchema/endpointComplete/update/yaml/template.ejs +0 -16
- package/src/generators/fromObjectSchema/endpointComplete/update/yaml/yaml.js +0 -155
- package/src/generators/fromObjectSchema/findData/GetByStorage/getByDynamo.ejs +0 -58
- package/src/generators/fromObjectSchema/findData/findDataYaml/findDataYaml.js +0 -204
- package/src/generators/fromObjectSchema/findData/findDataYaml/template.ejs +0 -10
- package/src/generators/fromObjectSchema/findData/handler/handler.js +0 -52
- package/src/generators/fromObjectSchema/findData/handler/template.ejs +0 -135
- package/src/generators/fromObjectSchema/findData/index.js +0 -70
- package/src/generators/fromObjectSchema/findData/mainFunction/main.js +0 -320
- package/src/generators/fromObjectSchema/findData/mainFunction/template.ejs +0 -156
- package/src/generators/fromObjectSchema/index.js +0 -134
- package/src/generators/fromObjectSchema/processLogical/handler/handler.js +0 -51
- package/src/generators/fromObjectSchema/processLogical/index.js +0 -50
- package/src/generators/fromObjectSchema/processLogical/mainFunction/main.js +0 -49
- package/src/generators/fromObjectSchema/processLogical/yaml/template.ejs +0 -10
- package/src/generators/fromObjectSchema/processLogical/yaml/yaml.js +0 -200
- package/src/generators/fromObjectSchema/processLogicalPagination/dsqYaml/dsqYaml.js +0 -51
- package/src/generators/fromObjectSchema/processLogicalPagination/dsqYaml/template.ejs +0 -32
- package/src/generators/fromObjectSchema/processLogicalPagination/handler/dsq/dsq.js +0 -50
- package/src/generators/fromObjectSchema/processLogicalPagination/handler/sqs/sqs.js +0 -49
- package/src/generators/fromObjectSchema/processLogicalPagination/index.js +0 -62
- package/src/generators/fromObjectSchema/processLogicalPagination/mainFunction/main.js +0 -49
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/dsq/dsq.js +0 -189
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/dsq/template.ejs +0 -10
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/sqs/sqs.js +0 -198
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/sqs/template.ejs +0 -11
- package/src/generators/fromObjectSchema/rbac/dynamoDb/dynamoDb.js +0 -74
- package/src/generators/fromObjectSchema/rbac/index.js +0 -68
- package/src/generators/fromObjectSchema/rbac/lambda/handler/handler.js +0 -72
- package/src/generators/fromObjectSchema/rbac/lambda/handler/template.ejs +0 -52
- package/src/generators/fromObjectSchema/rbac/lambda/mainFunction/main.js +0 -83
- package/src/generators/fromObjectSchema/rbac/lambda/mainFunction/template.ejs +0 -111
- package/src/generators/fromObjectSchema/rbac/lambda/yaml/template.ejs +0 -6
- package/src/generators/fromObjectSchema/rbac/lambda/yaml/yaml.js +0 -109
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/functionYaml/template.ejs +0 -29
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/functionYaml/yaml.js +0 -201
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/handler.js +0 -76
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/template.ejs +0 -9
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +0 -150
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +0 -194
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +0 -138
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +0 -178
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/mainFunction/main.js +0 -61
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/sns-in-sqs/snsInSqs.js +0 -76
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/sns-in-sqs/snsTemplate.ejs +0 -56
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/sns-in-sqs/sqsTemplate.ejs +0 -40
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/functionYaml/template.ejs +0 -16
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/functionYaml/yaml.js +0 -139
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/handler/sqs/sqs.js +0 -61
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/handler/sqs/template.ejs +0 -126
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/mainFunction/main.js +0 -56
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-in-sqs/snsInSqs.js +0 -64
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-in-sqs/template.ejs +0 -43
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-out/snsOut.js +0 -68
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-out/template.ejs +0 -8
- package/src/generators/fromObjectSchema/relationship/create/action/functionYaml/template.ejs +0 -29
- package/src/generators/fromObjectSchema/relationship/create/action/functionYaml/yaml.js +0 -238
- package/src/generators/fromObjectSchema/relationship/create/action/handler/handler.js +0 -76
- package/src/generators/fromObjectSchema/relationship/create/action/handler/template.ejs +0 -9
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/apiTemplate.ejs +0 -134
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/dsqTemplate.ejs +0 -176
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/invTemplate.ejs +0 -120
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/sqsTemplate.ejs +0 -160
- package/src/generators/fromObjectSchema/relationship/create/action/mainFunction/main.js +0 -60
- package/src/generators/fromObjectSchema/relationship/create/action/sns-in-sqs/snsInSqs.js +0 -77
- package/src/generators/fromObjectSchema/relationship/create/action/sns-in-sqs/snsTemplate.ejs +0 -56
- package/src/generators/fromObjectSchema/relationship/create/complete/functionYaml/template.ejs +0 -16
- package/src/generators/fromObjectSchema/relationship/create/complete/functionYaml/yaml.js +0 -140
- package/src/generators/fromObjectSchema/relationship/create/complete/handler/sqs/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/create/complete/handler/sqs/sqs.js +0 -61
- package/src/generators/fromObjectSchema/relationship/create/complete/handler/sqs/template.ejs +0 -126
- package/src/generators/fromObjectSchema/relationship/create/complete/mainFunction/main.js +0 -56
- package/src/generators/fromObjectSchema/relationship/create/complete/mainFunction/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-in-sqs/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-in-sqs/snsInSqs.js +0 -63
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-in-sqs/template.ejs +0 -43
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-out/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-out/snsOut.js +0 -67
- package/src/generators/fromObjectSchema/relationship/delete/action/functionYaml/template.ejs +0 -29
- package/src/generators/fromObjectSchema/relationship/delete/action/functionYaml/yaml.js +0 -241
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/handler.js +0 -76
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/template.ejs +0 -9
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/apiTemplate.ejs +0 -133
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/dsqTemplate.ejs +0 -176
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/invTemplate.ejs +0 -118
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/sqsTemplate.ejs +0 -167
- package/src/generators/fromObjectSchema/relationship/delete/action/mainFunction/main.js +0 -60
- package/src/generators/fromObjectSchema/relationship/delete/action/sns-in-sqs/snsInSqs.js +0 -77
- package/src/generators/fromObjectSchema/relationship/delete/action/sns-in-sqs/snsTemplate.ejs +0 -56
- package/src/generators/fromObjectSchema/relationship/delete/action/sns-in-sqs/sqsTemplate.ejs +0 -40
- package/src/generators/fromObjectSchema/relationship/delete/complete/functionYaml/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/delete/complete/functionYaml/template.ejs +0 -16
- package/src/generators/fromObjectSchema/relationship/delete/complete/functionYaml/yaml.js +0 -138
- package/src/generators/fromObjectSchema/relationship/delete/complete/handler/sqs/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/delete/complete/handler/sqs/sqs.js +0 -61
- package/src/generators/fromObjectSchema/relationship/delete/complete/handler/sqs/template.ejs +0 -126
- package/src/generators/fromObjectSchema/relationship/delete/complete/mainFunction/main.js +0 -56
- package/src/generators/fromObjectSchema/relationship/delete/complete/mainFunction/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-in-sqs/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-in-sqs/snsInSqs.js +0 -65
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-in-sqs/template.ejs +0 -44
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-out/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-out/snsOut.js +0 -69
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-out/template.ejs +0 -8
- package/src/generators/fromObjectSchema/relationship/get/action/functionYaml/template.ejs +0 -23
- package/src/generators/fromObjectSchema/relationship/get/action/functionYaml/yaml.js +0 -235
- package/src/generators/fromObjectSchema/relationship/get/action/handler/handler.js +0 -76
- package/src/generators/fromObjectSchema/relationship/get/action/handler/template.ejs +0 -9
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/apiTemplate.ejs +0 -134
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/dsqTemplate.ejs +0 -175
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/invTemplate.ejs +0 -119
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/sqsTemplate.ejs +0 -160
- package/src/generators/fromObjectSchema/relationship/get/action/mainFunction/main.js +0 -59
- package/src/generators/fromObjectSchema/relationship/get/action/sns-in-sqs/snsInSqs.js +0 -77
- package/src/generators/fromObjectSchema/relationship/get/action/sns-in-sqs/snsTemplate.ejs +0 -56
- package/src/generators/fromObjectSchema/relationship/get/action/sns-in-sqs/sqsTemplate.ejs +0 -40
- package/src/generators/fromObjectSchema/relationship/get/complete/functionYaml/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/get/complete/functionYaml/template.ejs +0 -16
- package/src/generators/fromObjectSchema/relationship/get/complete/functionYaml/yaml.js +0 -139
- package/src/generators/fromObjectSchema/relationship/get/complete/handler/sqs/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/get/complete/handler/sqs/sqs.js +0 -62
- package/src/generators/fromObjectSchema/relationship/get/complete/handler/sqs/template.ejs +0 -127
- package/src/generators/fromObjectSchema/relationship/get/complete/mainFunction/main.js +0 -57
- package/src/generators/fromObjectSchema/relationship/get/complete/mainFunction/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-in-sqs/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-in-sqs/snsInSqs.js +0 -65
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-in-sqs/template.ejs +0 -44
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-out/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-out/snsOut.js +0 -70
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-out/template.ejs +0 -8
- package/src/generators/fromObjectSchema/relationship/index.js +0 -164
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/functionYaml/template.ejs +0 -29
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/functionYaml/yaml.js +0 -204
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/handler.js +0 -76
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/template.ejs +0 -9
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +0 -152
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +0 -195
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +0 -140
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +0 -179
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/mainFunction/main.js +0 -61
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/sns-in-sqs/snsInSqs.js +0 -76
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/sns-in-sqs/snsTemplate.ejs +0 -56
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/sns-in-sqs/sqsTemplate.ejs +0 -40
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/functionYaml/template.ejs +0 -16
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/functionYaml/yaml.js +0 -138
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/handler/sqs/sqs.js +0 -61
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/handler/sqs/template.ejs +0 -126
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/mainFunction/main.js +0 -60
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-in-sqs/snsInSqs.js +0 -65
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-in-sqs/template.ejs +0 -43
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/snsOut.js +0 -69
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/template.ejs +0 -8
- package/src/generators/fromObjectSchema/relationship/update/action/functionYaml/template.ejs +0 -29
- package/src/generators/fromObjectSchema/relationship/update/action/functionYaml/yaml.js +0 -234
- package/src/generators/fromObjectSchema/relationship/update/action/handler/handler.js +0 -77
- package/src/generators/fromObjectSchema/relationship/update/action/handler/template.ejs +0 -9
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/apiTemplate.ejs +0 -131
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/dsqTemplate.ejs +0 -173
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/invTemplate.ejs +0 -117
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/sqsTemplate.ejs +0 -166
- package/src/generators/fromObjectSchema/relationship/update/action/mainFunction/main.js +0 -62
- package/src/generators/fromObjectSchema/relationship/update/action/mainFunction/request.json +0 -1
- package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/request.json +0 -3
- package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/snsInSqs.js +0 -85
- package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/snsTemplate.ejs +0 -56
- package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/sqsTemplate.ejs +0 -40
- package/src/generators/fromObjectSchema/relationship/update/action/sns-out/request.json +0 -3
- package/src/generators/fromObjectSchema/relationship/update/action/sns-out/snsOut.js +0 -69
- package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/request.json +0 -3
- package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/template.ejs +0 -17
- package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/yaml.js +0 -139
- package/src/generators/fromObjectSchema/relationship/update/complete/handler/sqs/request.json +0 -0
- package/src/generators/fromObjectSchema/relationship/update/complete/handler/sqs/sqs.js +0 -61
- package/src/generators/fromObjectSchema/relationship/update/complete/handler/sqs/template.ejs +0 -128
- package/src/generators/fromObjectSchema/relationship/update/complete/mainFunction/main.js +0 -56
- package/src/generators/fromObjectSchema/relationship/update/complete/mainFunction/request.json +0 -1
- package/src/generators/fromObjectSchema/relationship/update/complete/sns-in-sqs/request.json +0 -3
- package/src/generators/fromObjectSchema/relationship/update/complete/sns-in-sqs/snsInSqs.js +0 -64
- package/src/generators/fromObjectSchema/relationship/update/complete/sns-out/request.json +0 -3
- package/src/generators/fromObjectSchema/relationship/update/complete/sns-out/snsOut.js +0 -59
- package/src/generators/fromObjectSchema/relationship/update/complete/sns-out/template.ejs +0 -8
- package/src/generators/fromObjectSchema/roleNameConfig/roleNameConfig.js +0 -77
- package/src/generators/fromObjectSchema/textTag/index.js +0 -58
- package/src/generators/fromObjectSchema/textTag/systemText/systemText.js +0 -148
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/handler/handler.js +0 -66
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/handler/templateApi.ejs +0 -84
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/handler/templateWebSocket.ejs +0 -66
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/main.js +0 -58
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/yaml/template.ejs +0 -18
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/yaml/yaml.js +0 -91
- package/src/generators/fromPlugIn/afterFirstFlowStep/sendPlugIn/handler/handler.js +0 -0
- package/src/generators/fromPlugIn/afterFirstFlowStep/sendPlugIn/handler/template.ejs +0 -0
- package/src/generators/fromPlugIn/afterFirstFlowStep/sendPlugIn/mainFunction/main.js +0 -45
- package/src/generators/fromPlugIn/afterFirstFlowStep/sendPlugIn/mainFunction/template.ejs +0 -82
- package/src/generators/fromPlugIn/afterFirstFlowStep/sendPlugIn/yaml/template.ejs +0 -0
- package/src/generators/fromPlugIn/afterFirstFlowStep/sendPlugIn/yaml/yaml.js +0 -0
- package/src/generators/fromPlugIn/byConfig/handler/handler.js +0 -55
- package/src/generators/fromPlugIn/byConfig/handler/templateAwaitingStep.ejs +0 -105
- package/src/generators/fromPlugIn/byConfig/handler/templatePaginated.ejs +0 -137
- package/src/generators/fromPlugIn/byConfig/mainFunction/main.js +0 -54
- package/src/generators/fromPlugIn/byConfig/sns-sqs/queueNoTopic.ejs +0 -40
- package/src/generators/fromPlugIn/byConfig/sns-sqs/snsSqs.js +0 -56
- package/src/generators/fromPlugIn/byConfig/sns-sqs/snsTemplate.ejs +0 -55
- package/src/generators/fromPlugIn/byConfig/sns-sqs/sqsTemplate.ejs +0 -40
- package/src/generators/fromPlugIn/byConfig/yaml/template.ejs +0 -43
- package/src/generators/fromPlugIn/byConfig/yaml/yaml.js +0 -47
- package/src/generators/fromPlugIn/firstFlowStep/handler/handler.js +0 -58
- package/src/generators/fromPlugIn/firstFlowStep/handler/templateApi.ejs +0 -84
- package/src/generators/fromPlugIn/firstFlowStep/handler/templateDsq.ejs +0 -105
- package/src/generators/fromPlugIn/firstFlowStep/handler/templateInv.ejs +0 -53
- package/src/generators/fromPlugIn/firstFlowStep/mainFunction/main.js +0 -67
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/dsqTemplate.ejs +0 -40
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/queueNtopic.js +0 -54
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/snsTemplate.ejs +0 -55
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/sqsTemplate.ejs +0 -40
- package/src/generators/fromPlugIn/firstFlowStep/topicOut/topicOut.js +0 -48
- package/src/generators/fromPlugIn/firstFlowStep/yaml/template.ejs +0 -40
- package/src/generators/fromPlugIn/firstFlowStep/yaml/yaml.js +0 -47
- package/src/generators/fromPlugIn/index.js +0 -518
- package/src/generators/other/generateAuthYml/template.ejs +0 -18
- package/src/generators/other/generateAuthYml/yaml.js +0 -49
- package/src/generators/other/index.js +0 -41
- package/src/generators/resourceYamlComponent/dynamodb/defaultDynamoDbTable.js +0 -145
- package/src/generators/resourceYamlComponent/dynamodb/generateDynamoPerLink.js +0 -108
- package/src/generators/resourceYamlComponent/dynamodb/mainResourcePerObjectSchemaData.js +0 -166
- package/src/generators/resourceYamlComponent/dynamodb/template.ejs +0 -23
- package/src/generators/resourceYamlComponent/filterGenerateResource/filter.js +0 -125
- package/src/generators/resourceYamlComponent/index.js +0 -96
- package/src/generators/resourceYamlComponent/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +0 -92
- package/src/generators/resourceYamlComponent/sns-in-sqs/request.json +0 -4
- package/src/generators/resourceYamlComponent/sns-in-sqs/snsAndSqsPerActionData.js +0 -86
- package/src/generators/resourceYamlComponent/sns-in-sqs/snsTemplate.ejs +0 -56
- package/src/generators/resourceYamlComponent/sns-in-sqs/sqsTemplate.ejs +0 -40
- package/src/generators/resourceYamlComponent/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +0 -66
- package/src/generators/resourceYamlComponent/sns-out/request.json +0 -3
- package/src/generators/resourceYamlComponent/sns-out/snsOut.js +0 -80
- package/src/generators/resourceYamlComponent/sns-out/template.ejs +0 -10
- package/src/generators/roles/index.js +0 -31
- package/src/generators/roles/roleNameConfig/roleNameConfig.js +0 -181
- package/src/generators/roles/roleNameConfig/template.ejs +0 -14
- package/src/generators/roles/roleNameConfig/templateIntTesting.ejs +0 -31
- package/src/generators/roles/roleNameConfig/templateYaml.ejs +0 -10
- package/src/generators/roles/sharedResource/sharedResource.js +0 -103
- package/src/generators/roles/sharedResource/template.ejs +0 -33
- package/src/libs/Consts.js +0 -96
- package/src/libs/GenerateCodeLibs.js +0 -32
- package/src/libs/Libs.js +0 -585
- package/src/libs/Utils.js +0 -164
- package/src/libs/consts/functions.js +0 -96
- package/src/libs/consts/handlers.js +0 -30
- package/src/libs/consts/index.js +0 -6
- package/src/libs/consts/paths.js +0 -84
- package/src/libs/consts/resources.js +0 -48
- package/src/libs/consts/tags.js +0 -68
- package/src/libs/consts/topics.js +0 -67
- package/src/pipeline/fetchSchemas.js +0 -31
- package/src/pipeline/transformSchemas.js +0 -75
- package/src/pipeline/validateSources.js +0 -47
- package/src/pipeline/writeSources.js +0 -24
- package/src/sourceManager/CreateSource.js +0 -174
- /package/src/{generators/fromFlowSchema/events/generatedCode/index.js → codeGenerators/app/src/generatedCode/Flow/FlowEndpoints/.gitkeep} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/changeRelationship/complete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessChangeRelationshipComplete_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/changeRelationship/action/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessChangeRelationship_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/create/complete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessCreateRelationshipComplete_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/create/action/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessCreateRelationship_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/delete/complete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessDeleteRelationshipComplete_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/delete/action/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessDeleteRelationship_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/get/complete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessGetRelationshipComplete_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/get/action/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessGetRelationship_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/moveRelationship/complete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessMoveRelationshipComplete_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/moveRelationship/action/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessMoveRelationship_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/update/complete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessUpdateRelationshipComplete_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/update/action/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowRelationshipEndpoints/templates/relationship/ProcessUpdateRelationship_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/relationship/create/complete/functionYaml/request.json → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/.gitkeep} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/confirmReserved/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3/ConfirmReserved_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/createObject/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3/CreateObject_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/processFile/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3/ProcessS3File_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3/ReservedLimit_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/flowSchemaMainFunction/template.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/flowSchemaMainFunction/templateByStatusType/statusFieldTemplate.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/flowSchemaMainFunction/templateByStatusType/storedCacheTemplate.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/flowSchemaMainFunction/templateByStatusType/triggerCacheTemplate.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/confirmReserved/mainFunction/main.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/mainFunction/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/confirmReserved/queue/queue.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/confirmReserved/queue/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/createObjectComplete/handler/template.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/createObjectComplete/mainFunction/template.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/createObjectComplete/sns-sqs/snsSqs.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/createObjectComplete/sns-sqs/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/mainFunction/main.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/mainFunction/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/sqs/sqs.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/preSignUrl/reservedLimit/sqs/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/processFile/handler/handlerS3/handlerS3.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/handler/handlerS3/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/processFile/mainFunction/main.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/mainFunction/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/processFile/queue/queue.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/processFile/queue/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/processFile/queue/dsqTemplatePath.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3/upload/relate/S3/s3.js → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy/upload/relate/S3/data.js} +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/upload/relate/S3/template.ejs +0 -0
- /package/src/{generators/fromFlowSchema/events/s3 → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/s3Legacy}/websocket/dynamoDb/ReservedTableData.js +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/statusField/sns/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/statusField/CompleteStatusFieldSns_Yaml.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/statusField/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/statusField/CompleteStatusField_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/events/ownTopic/sns-in/sqsTemplate.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/ProcessWebSocket_Yaml.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/webSocket/webSocket/dynamoDb/template.ejs → codeGenerators/app/src/generatedCode/Flow/FlowSchemas/templates/webSocket/WebSocketDynamoDb_Yaml.ejs} +0 -0
- /package/src/{generators/fromPlugIn/byConfig/mainFunction/templateAwaitingStep.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/plugIns/FlowStep_ByConfig_Awaiting_Main.ejs} +0 -0
- /package/src/{generators/fromPlugIn/byConfig/mainFunction/templatePaginated.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/plugIns/FlowStep_ByConfig_Paginated_Main.ejs} +0 -0
- /package/src/{generators/fromPlugIn/firstFlowStep/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/plugIns/FlowStep_PlugIn_Main.ejs} +0 -0
- /package/src/{generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/plugIns/FlowStep_RecievePlugIn_Main.ejs} +0 -0
- /package/src/{generators/fromPlugIn/firstFlowStep/mainFunction/templateByConfig/awaitingSteps.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/plugIns/templateAwaitingStep.ejs} +0 -0
- /package/src/{generators/fromPlugIn/firstFlowStep/mainFunction/templateByConfig → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/step/plugIns}/templateSendPlugin.ejs +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/handler/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/CheckTriggerCache_HdrSqs.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/handler/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/ProcessTriggerCache_HdrSqs.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/ProcessTriggerCache_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/dsq/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/TriggerCacheComplete_HdrDsq.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/sqs/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/TriggerCacheComplete_HdrSqs.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/Flow/_internal/_shared/triggerCache/TriggerCacheComplete_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/register/complete/handler/template.ejs → codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/RegisterComplete_HdrSqs.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/register/complete/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/RegisterComplete_Main.ejs} +0 -0
- /package/src/{generators/fromFlowSchema/register/wbs/mainFunction/template.ejs → codeGenerators/app/src/generatedCode/SystemFlowSchemas/templates/register/Register_Main.ejs} +0 -0
- /package/src/{generators/fromObjectSchema/endpoint/resourceBeforeLogicalTemplate.ejs → codeGenerators/resource/sls_yaml/templates/crud/ResourceBeforeLogicalYaml.ejs} +0 -0
package/index.js
CHANGED
|
@@ -15,25 +15,19 @@ You should have received a copy of the GNU Affero General Public License
|
|
|
15
15
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import
|
|
19
|
-
import generateCode from './src/generateCode.js';
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import consts from './src/libs/Consts.js';
|
|
24
|
-
import generateCodeLibs from './src/libs/GenerateCodeLibs.js';
|
|
25
|
-
import libs from './src/libs/Libs.js';
|
|
26
|
-
import utils from './src/libs/Utils.js';
|
|
18
|
+
import { generate } from './src/generate.js';
|
|
19
|
+
import { generateCode } from './src/generateCode.js';
|
|
20
|
+
import { generateSchema } from './src/generateSchema.js';
|
|
21
|
+
import { generateIntTest } from './src/generateIntTest.js';
|
|
22
|
+
import { generateResourceIntTest } from './src/generateResourceIntTest.js';
|
|
27
23
|
|
|
28
24
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
// High-level API (recommended for consumers) — wires legacy Logger+validateLocalSchema
|
|
26
|
+
generate,
|
|
27
|
+
// Main generators (low-level)
|
|
31
28
|
generateCode,
|
|
29
|
+
generateSchema,
|
|
30
|
+
// IntTest generators (Result-Driven: no createSource/libs dependencies)
|
|
32
31
|
generateIntTest,
|
|
33
|
-
generateResourceIntTest
|
|
34
|
-
// libs
|
|
35
|
-
consts,
|
|
36
|
-
generateCodeLibs,
|
|
37
|
-
libs,
|
|
38
|
-
utils
|
|
32
|
+
generateResourceIntTest
|
|
39
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-core-generate-service-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"description": "Code for locally generating per service files",
|
|
5
5
|
"homepage": "https://bitbucket.org/izara-core-support-services/izara-core-support-services-generate-service-code#readme",
|
|
6
6
|
"repository": {
|
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
"license": "AGPL-3.0-or-later",
|
|
11
11
|
"author": "Sven Mason <thebarbariansven@gmail.com>",
|
|
12
12
|
"type": "module",
|
|
13
|
-
"imports": {
|
|
14
|
-
"#libs/*": "./src/libs/*"
|
|
15
|
-
},
|
|
16
13
|
"main": "index.js",
|
|
17
14
|
"scripts": {
|
|
18
15
|
"test": "jest"
|
|
@@ -21,16 +18,20 @@
|
|
|
21
18
|
"testEnvironment": "node"
|
|
22
19
|
},
|
|
23
20
|
"dependencies": {
|
|
21
|
+
"@izara_project/izara-attribute-tree": "^1.0.15",
|
|
24
22
|
"@izara_project/izara-core-library-core": "^1.0.32",
|
|
25
23
|
"@izara_project/izara-core-library-logger": "^1.0.9",
|
|
26
|
-
"@izara_project/izara-core-library-s3": "^1.0.
|
|
27
|
-
"@izara_project/izara-core-library-service-schemas": "^1.0.
|
|
24
|
+
"@izara_project/izara-core-library-s3": "^1.0.10",
|
|
25
|
+
"@izara_project/izara-core-library-service-schemas": "^1.0.155",
|
|
26
|
+
"@izara_project/izara-property-nodes": "^1.0.16",
|
|
28
27
|
"@izara_project/izara-shared-core": "^1.0.12",
|
|
28
|
+
"@izara_project/izara-shared-service-schemas": "^1.0.64",
|
|
29
29
|
"ejs": "^5.0.1",
|
|
30
30
|
"js-beautify": "^1.15.4",
|
|
31
|
-
"
|
|
31
|
+
"lodash": "^4.18.1",
|
|
32
|
+
"yaml": "^2.9.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
|
-
"jest": "^30.
|
|
35
|
+
"jest": "^30.4.2"
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import ejs from 'ejs';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { getFlowsForGeneration } from '../src/generatedCode/Flow/_internal/shared/flowSelection.js';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
export async function generateInitialSetup(allSchemas, options) {
|
|
11
|
+
console.log(' [InitialSetupGenerator] Generating Initial Setup Scripts...');
|
|
12
|
+
const flows = getFlowsForGeneration(allSchemas);
|
|
13
|
+
|
|
14
|
+
const setupDir = path.join(options.outputPath, 'app', 'initial_setup');
|
|
15
|
+
const sourceDir = path.join(setupDir, 'generatedCode', 'source');
|
|
16
|
+
const hookDir = path.join(setupDir, 'generatedCode', 'hook');
|
|
17
|
+
|
|
18
|
+
await fs.mkdir(sourceDir, { recursive: true });
|
|
19
|
+
await fs.mkdir(hookDir, { recursive: true });
|
|
20
|
+
|
|
21
|
+
// 1. Table Names
|
|
22
|
+
const tableNames = new Set();
|
|
23
|
+
const tableNameTpl = await fs.readFile(path.join(__dirname, 'templates', 'InitialSetup_TableName.ejs'), 'utf-8');
|
|
24
|
+
const tableNameContent = ejs.render(tableNameTpl, { tableNames: Array.from(tableNames) });
|
|
25
|
+
await fs.writeFile(path.join(sourceDir, 'generatedTableNameConfig.js'), tableNameContent, 'utf-8');
|
|
26
|
+
|
|
27
|
+
// 2. SNS Subscriptions
|
|
28
|
+
const hardcodedSubscriptions = [
|
|
29
|
+
{ serviceTag: "GraphHandler", topicName: "UpdateRelationship_Out", sqsEndpoint: "UpdateRelationshipComplete" },
|
|
30
|
+
{ serviceTag: "GraphHandler", topicName: "CreateRelationship_Out", sqsEndpoint: "CreateRelationshipComplete" },
|
|
31
|
+
{ serviceTag: "GraphHandler", topicName: "DeleteRelationship_Out", sqsEndpoint: "DeleteRelationshipComplete" },
|
|
32
|
+
{ serviceTag: "GraphHandler", topicName: "UpdateNode_Out", sqsEndpoint: "UpdateNodeComplete" },
|
|
33
|
+
{ serviceTag: "GraphHandler", topicName: "CreateNode_Out", sqsEndpoint: "CreateObjectComplete" },
|
|
34
|
+
{ serviceTag: "GraphHandler", topicName: "ChangeRelationshipType_Out", sqsEndpoint: "ChangeRelationshipComplete" },
|
|
35
|
+
{ serviceTag: "GraphHandler", topicName: "MoveRelationship_Out", sqsEndpoint: "MoveRelationshipComplete" }
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const snsTpl = await fs.readFile(path.join(__dirname, 'templates', 'InitialSetup_SnsService.ejs'), 'utf-8');
|
|
39
|
+
const snsContent = ejs.render(snsTpl, { subscriptions: hardcodedSubscriptions });
|
|
40
|
+
await fs.writeFile(path.join(sourceDir, 'generatedSnsServiceConfig.js'), snsContent, 'utf-8');
|
|
41
|
+
|
|
42
|
+
// 3. Lambda Roles
|
|
43
|
+
const lambdaRoles = [
|
|
44
|
+
{
|
|
45
|
+
objectType: "PerActionEndpoint",
|
|
46
|
+
additionalResourcePermission: [
|
|
47
|
+
{
|
|
48
|
+
effect: "Allow",
|
|
49
|
+
action: { "lambda": ["InvokeFunction"] },
|
|
50
|
+
resource: ["arn:aws:lambda:${process.env.iz_region}:${process.env.iz_accountId}:function:${lambdaSharedLib.lambdaFunctionName(_izContext, \"GetNodeHdrInv\" ,\"GraphHandler\")}"]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
effect: "Allow",
|
|
54
|
+
action: { "sns": ["Publish"] },
|
|
55
|
+
resource: ["arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${snsSharedLib.snsTopicNameByFlowSchema(_izContext, \"UpdateNode_In\", \"GraphHandler\")}"]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
effect: "Allow",
|
|
59
|
+
action: { "sns": ["Publish"] },
|
|
60
|
+
resource: ["arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${snsSharedLib.snsTopicNameByFlowSchema(_izContext, \"CreateNode_In\", \"GraphHandler\")}"]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
objectType: "ProcFindData",
|
|
66
|
+
additionalResourcePermission: [
|
|
67
|
+
{
|
|
68
|
+
effect: "Allow",
|
|
69
|
+
action: { "lambda": ["InvokeFunction"] },
|
|
70
|
+
resource: ["arn:aws:lambda:${process.env.iz_region}:${process.env.iz_accountId}:function:${lambdaSharedLib.lambdaFunctionName(_izContext, \"GetNodeHdrInv\" ,\"GraphHandler\")}"]
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
if (flows.length > 0) {
|
|
77
|
+
for (const flow of flows) {
|
|
78
|
+
if (flow.event && flow.event.includes('s3')) {
|
|
79
|
+
lambdaRoles.push({
|
|
80
|
+
objectType: "FlowSchemaUploadS3Role",
|
|
81
|
+
additionalResourcePermission: [
|
|
82
|
+
{
|
|
83
|
+
effect: "Allow",
|
|
84
|
+
action: { "sns": ["Publish"] },
|
|
85
|
+
resource: ["arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${snsSharedLib.snsTopicNameByFlowSchema(_izContext, \"ReservedDynamicUsage_In\", \"AccountLimits\")}"]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
effect: "Allow",
|
|
89
|
+
action: { "lambda": ["InvokeFunction"] },
|
|
90
|
+
resource: ["arn:aws:lambda:${process.env.iz_region}:${process.env.iz_accountId}:function:${lambdaSharedLib.lambdaFunctionName(_izContext, \"StaticLimitProcessHdrInv\" ,\"AccountLimits\")}"]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
effect: "Allow",
|
|
94
|
+
action: { "sns": ["Publish"] },
|
|
95
|
+
resource: ["arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${snsSharedLib.snsTopicNameByFlowSchema(_izContext, \"CancelUsage_In\", \"AccountLimits\")}"]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
effect: "Allow",
|
|
99
|
+
action: { "sns": ["Publish"] },
|
|
100
|
+
resource: [
|
|
101
|
+
"arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${snsSharedLib.snsTopicNameByFlowSchema(_izContext, \"ReservedDynamicUsageComplet_Out\", \"AccountLimits\")}",
|
|
102
|
+
"arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${snsSharedLib.snsTopicNameByFlowSchema(_izContext, \"ConfirmUsage_In\", \"AccountLimits\")}"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const lambdaTpl = await fs.readFile(path.join(__dirname, 'templates', 'InitialSetup_LambdaRole.ejs'), 'utf-8');
|
|
112
|
+
const lambdaContent = ejs.render(lambdaTpl, { datas: lambdaRoles });
|
|
113
|
+
await fs.writeFile(path.join(sourceDir, 'generatedLambdaRoleServiceConfig.js'), lambdaContent, 'utf-8');
|
|
114
|
+
|
|
115
|
+
// 4. RoleNameConfig.js
|
|
116
|
+
const roleNameConfigs = new Set();
|
|
117
|
+
const upperCase = (str) => {
|
|
118
|
+
if (!str) return str;
|
|
119
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
if (flows.length > 0) {
|
|
123
|
+
for (const flow of flows) {
|
|
124
|
+
if (flow.flowTag) {
|
|
125
|
+
roleNameConfigs.add(upperCase(flow.flowTag));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
roleNameConfigs.add('ProcFindData');
|
|
130
|
+
if (flows.length > 0 && flows.some(f => f.event && f.event.includes('webSocket'))) {
|
|
131
|
+
roleNameConfigs.add('WebSocketMain');
|
|
132
|
+
}
|
|
133
|
+
roleNameConfigs.add('PerActionEndpoint');
|
|
134
|
+
roleNameConfigs.add('Register');
|
|
135
|
+
roleNameConfigs.add('ObjectCom');
|
|
136
|
+
roleNameConfigs.add('RelationshipCom');
|
|
137
|
+
roleNameConfigs.add('Relationship');
|
|
138
|
+
|
|
139
|
+
const roleNameConfigContent = `export function generatedIntTestRoleNameConfig() {
|
|
140
|
+
let roleNameConfigIntTest = [
|
|
141
|
+
${Array.from(roleNameConfigs).map(r => ` "${r}",`).join('\n')}
|
|
142
|
+
];
|
|
143
|
+
return roleNameConfigIntTest;
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
await fs.writeFile(path.join(sourceDir, 'RoleNameConfig.js'), roleNameConfigContent, 'utf-8');
|
|
147
|
+
|
|
148
|
+
console.log(` [InitialSetupGenerator] Wrote initial_setup scripts to ${sourceDir}`);
|
|
149
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Logger from '@izara_project/izara-core-library-logger';
|
|
2
|
+
import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
|
|
3
|
+
import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
|
|
4
|
+
import snsSharedLib from '@izara_project/izara-core-library-sns';
|
|
5
|
+
import initialSetupConfig from '../../config/Config.js';
|
|
6
|
+
|
|
7
|
+
const _izContext = { logger: Logger };
|
|
8
|
+
|
|
9
|
+
export function generatedLambdaRole() {
|
|
10
|
+
const externalLambdaRole = [
|
|
11
|
+
<% datas.forEach((data, dataIndex) => { %>
|
|
12
|
+
{
|
|
13
|
+
roleName: "<%- data.objectType %>",
|
|
14
|
+
statement: [
|
|
15
|
+
<% data.additionalResourcePermission.forEach((resourcePermission, resourceIdx) => { %>
|
|
16
|
+
{
|
|
17
|
+
"Sid": "<%- data.objectType %>Test<%- resourceIdx %>",
|
|
18
|
+
"Effect": "<%- resourcePermission.effect %>",
|
|
19
|
+
"Action": [
|
|
20
|
+
<% Object.keys(resourcePermission.action).forEach(resourcePerAction => { %>
|
|
21
|
+
<% resourcePermission.action[resourcePerAction].forEach(permission => { %>
|
|
22
|
+
"<%- resourcePerAction %>:<%- permission %>",
|
|
23
|
+
<% }) %>
|
|
24
|
+
<% }) %>
|
|
25
|
+
],
|
|
26
|
+
"Resource": [
|
|
27
|
+
<% resourcePermission.resource.forEach(resource => { %>
|
|
28
|
+
`<%- resource %>`,
|
|
29
|
+
<% }) %>
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
<% }) %>
|
|
33
|
+
//(<create<%- data.objectType %>Role>)
|
|
34
|
+
//(</create<%- data.objectType %>Role>)
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
<% }) %>
|
|
38
|
+
//(<additionalRole>)
|
|
39
|
+
//(</additionalRole>)
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
return externalLambdaRole;
|
|
43
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const generatedSnsTopicSubscription = [
|
|
2
|
+
<% subscriptions.forEach(sub => { %>
|
|
3
|
+
{
|
|
4
|
+
serviceTag: "<%- sub.serviceTag %>",
|
|
5
|
+
topicName: "<%- sub.topicName %>",
|
|
6
|
+
sqsEndpoint: "<%- sub.sqsEndpoint %>"
|
|
7
|
+
},
|
|
8
|
+
<% }) %>
|
|
9
|
+
//(<additionalSubscription>)
|
|
10
|
+
//(</additionalSubscription>)
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
generatedSnsTopicSubscription
|
|
15
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import ejs from 'ejs';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { getFlowsForGeneration } from '../src/generatedCode/Flow/_internal/shared/flowSelection.js';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
export async function generateFunctionYaml(allSchemas, options) {
|
|
11
|
+
console.log(' [FunctionYamlGenerator] Generating Function YAMLs...');
|
|
12
|
+
|
|
13
|
+
const slsYamlDir = path.join(options.outputPath, 'app', 'sls_yaml', 'generatedCode', 'source');
|
|
14
|
+
await fs.mkdir(slsYamlDir, { recursive: true });
|
|
15
|
+
|
|
16
|
+
const templates = {
|
|
17
|
+
sqs: await fs.readFile(path.join(__dirname, 'templates', 'FunctionYaml_Sqs.ejs'), 'utf-8'),
|
|
18
|
+
inv: await fs.readFile(path.join(__dirname, 'templates', 'FunctionYaml_Inv.ejs'), 'utf-8'),
|
|
19
|
+
api: await fs.readFile(path.join(__dirname, 'templates', 'FunctionYaml_Api.ejs'), 'utf-8'),
|
|
20
|
+
wbs: await fs.readFile(path.join(__dirname, 'templates', 'FunctionYaml_Wbs.ejs'), 'utf-8'),
|
|
21
|
+
eventBridge: await fs.readFile(path.join(__dirname, 'templates', 'FunctionYaml_EventBridge.ejs'), 'utf-8')
|
|
22
|
+
};
|
|
23
|
+
const flows = getFlowsForGeneration(allSchemas);
|
|
24
|
+
|
|
25
|
+
const CRUD_FLOW_TAGS = ['Create', 'Update', 'Delete', 'Get'];
|
|
26
|
+
const REL_FLOW_TAGS = [
|
|
27
|
+
'createRelationship', 'updateRelationship', 'deleteRelationship',
|
|
28
|
+
'getRelationship', 'changeRelationship', 'moveRelationship'
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
let perActionYaml = '';
|
|
32
|
+
let relActionYaml = '';
|
|
33
|
+
let flowSchemaYaml = '';
|
|
34
|
+
|
|
35
|
+
const upperCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
36
|
+
|
|
37
|
+
// 1. Find all generated Handlers
|
|
38
|
+
const generatedCodeDir = path.join(options.outputPath, 'app', 'src', 'generatedCode');
|
|
39
|
+
const handlerFiles = [];
|
|
40
|
+
async function getHandlerFiles(dir) {
|
|
41
|
+
try {
|
|
42
|
+
const dirents = await fs.readdir(dir, { withFileTypes: true });
|
|
43
|
+
for (const dirent of dirents) {
|
|
44
|
+
const res = path.resolve(dir, dirent.name);
|
|
45
|
+
if (dirent.isDirectory()) {
|
|
46
|
+
await getHandlerFiles(res);
|
|
47
|
+
} else if (dirent.name.includes('_Hdr') && dirent.name.endsWith('.js')) {
|
|
48
|
+
// Extract relative path from generatedCodeDir
|
|
49
|
+
const relativePath = path.relative(generatedCodeDir, res);
|
|
50
|
+
// normalize to forward slashes
|
|
51
|
+
handlerFiles.push(relativePath.replace(/\\/g, '/'));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
// directory might not exist if no flows generated
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
await getHandlerFiles(generatedCodeDir);
|
|
59
|
+
|
|
60
|
+
// Prepare API routes
|
|
61
|
+
const crudApiRoutes = allSchemas.objects.map(obj => ({
|
|
62
|
+
objectName: obj.objectType,
|
|
63
|
+
upperName: upperCase(obj.objectType)
|
|
64
|
+
}));
|
|
65
|
+
const relApiRoutes = allSchemas.relationships.map(rel => {
|
|
66
|
+
const relName = Object.keys(rel)[0];
|
|
67
|
+
return {
|
|
68
|
+
objectName: relName,
|
|
69
|
+
upperName: upperCase(relName)
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
for (const handlerFile of handlerFiles) {
|
|
74
|
+
// e.g. "Endpoints/Create/source/ProcessCreate_HdrSqs.js"
|
|
75
|
+
const parts = handlerFile.split('/');
|
|
76
|
+
if (parts.length < 4) continue;
|
|
77
|
+
|
|
78
|
+
const subDir = parts[0]; // e.g. FlowEndpoints, FlowSchemas, SystemFlowSchemas
|
|
79
|
+
if (subDir === 'SystemFlowSchemas') continue;
|
|
80
|
+
|
|
81
|
+
const flowTag = parts[1];
|
|
82
|
+
const fileName = parts[3]; // e.g. ProcessCreate_HdrSqs.js
|
|
83
|
+
|
|
84
|
+
const fileNameWithoutExt = fileName.replace('.js', '');
|
|
85
|
+
// e.g. ProcessCreate_HdrSqs
|
|
86
|
+
const splitFileName = fileNameWithoutExt.split('_');
|
|
87
|
+
const handlerBaseName = splitFileName[0]; // e.g. ProcessCreate or CreateComplete
|
|
88
|
+
const handlerSuffix = splitFileName[1]; // e.g. HdrSqs, HdrApi, HdrInv
|
|
89
|
+
|
|
90
|
+
const isCrud = CRUD_FLOW_TAGS.map(t => t.toLowerCase()).includes(flowTag.toLowerCase());
|
|
91
|
+
const isRel = REL_FLOW_TAGS.map(t => t.toLowerCase()).includes(flowTag.toLowerCase());
|
|
92
|
+
const isCustom = !isCrud && !isRel;
|
|
93
|
+
|
|
94
|
+
// Role mapping
|
|
95
|
+
let roleName = '';
|
|
96
|
+
if (isCrud) {
|
|
97
|
+
roleName = 'PerActionEndpointRole';
|
|
98
|
+
} else if (isRel) {
|
|
99
|
+
roleName = 'RelationshipRole';
|
|
100
|
+
} else {
|
|
101
|
+
roleName = `${upperCase(flowTag)}Role`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Function Name Config
|
|
105
|
+
// e.g. ProcessCreateSqs or CreateCompleteSqs or GetApi
|
|
106
|
+
let suffixType = handlerSuffix.replace('Hdr', ''); // Sqs, Api, Inv
|
|
107
|
+
let functionNameConfig = `${handlerBaseName}${suffixType}`;
|
|
108
|
+
if (isCrud && handlerBaseName === `Process${upperCase(flowTag)}`) {
|
|
109
|
+
// Legacy matches: CreateSqs, GetApi instead of ProcessCreateSqs
|
|
110
|
+
functionNameConfig = `${upperCase(flowTag)}${suffixType}`;
|
|
111
|
+
}
|
|
112
|
+
if (isRel && handlerBaseName === `Process${upperCase(flowTag)}`) {
|
|
113
|
+
// Legacy matches: CreateRelSqs
|
|
114
|
+
functionNameConfig = `${upperCase(flowTag).replace('Relationship', 'Rel')}${suffixType}`;
|
|
115
|
+
}
|
|
116
|
+
if (handlerBaseName.endsWith('Complete')) {
|
|
117
|
+
// e.g. CreateObjectComp or CreateCompleteSqs
|
|
118
|
+
if (isCrud) {
|
|
119
|
+
// Legacy: DeleteNodeComp, UpdateNodeComp, CreateObjectComp
|
|
120
|
+
const crudType = upperCase(flowTag);
|
|
121
|
+
if (crudType === 'Create') functionNameConfig = `CreateObjectComp`;
|
|
122
|
+
else functionNameConfig = `${crudType}NodeComp`;
|
|
123
|
+
} else if (isRel) {
|
|
124
|
+
// Legacy: UpdateRelComp
|
|
125
|
+
functionNameConfig = `${upperCase(flowTag).replace('Relationship', 'Rel')}Comp`;
|
|
126
|
+
} else {
|
|
127
|
+
functionNameConfig = `${handlerBaseName}${suffixType}`;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
let queueName = '';
|
|
132
|
+
const flowDefForQueue = flows.find(f => f.flowTag === flowTag);
|
|
133
|
+
|
|
134
|
+
if (isCrud || isRel) {
|
|
135
|
+
queueName = handlerBaseName.replace('Process', '');
|
|
136
|
+
if (handlerSuffix === 'HdrSqs' || handlerSuffix === 'HdrDsq') {
|
|
137
|
+
queueName += handlerSuffix.replace('Hdr', '');
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
// For Custom Flows (e.g. OwnTopicFlowProcess, ProcessExtTopicFlow)
|
|
141
|
+
// The queue name exactly matches the handler name without the underscore.
|
|
142
|
+
if (handlerSuffix === 'HdrSqs' || handlerSuffix === 'HdrDsq') {
|
|
143
|
+
if (handlerBaseName === `Process${upperCase(flowTag)}` && flowDefForQueue && flowDefForQueue.event && flowDefForQueue.event.includes('ownTopic')) {
|
|
144
|
+
// ownTopic flows in FlowResourceYamlGenerator omit 'Process' for the queue
|
|
145
|
+
queueName = flowTag + handlerSuffix.replace('Hdr', '');
|
|
146
|
+
} else {
|
|
147
|
+
queueName = handlerBaseName + handlerSuffix.replace('Hdr', '');
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
queueName = handlerBaseName;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Api routes
|
|
155
|
+
let apiRoutes = [];
|
|
156
|
+
if (suffixType === 'Api') {
|
|
157
|
+
const routesList = isCrud ? crudApiRoutes : (isRel ? relApiRoutes : []);
|
|
158
|
+
const actionPath = flowTag.toLowerCase().replace('relationship', '');
|
|
159
|
+
apiRoutes = routesList.map(r => ({
|
|
160
|
+
path: `/TST/${r.objectName}/${actionPath}`,
|
|
161
|
+
upperName: r.upperName
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Handler Path
|
|
166
|
+
const handlerPath = `src/generatedCode/${subDir}/${flowTag}/source/${fileNameWithoutExt}.main`;
|
|
167
|
+
|
|
168
|
+
let filterPatterns = '';
|
|
169
|
+
if (handlerBaseName.endsWith('Complete') && (suffixType === 'Sqs' || suffixType === 'Dsq')) {
|
|
170
|
+
filterPatterns = ` filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
171
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":["\${self:custom.iz_resourcePrefix}${functionNameConfig}"]}}} # functionName of callingFlow
|
|
172
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}`;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const flowDef = flows.find(f => f.flowTag === flowTag);
|
|
176
|
+
let schedules = [];
|
|
177
|
+
if (flowDef && flowDef.schedules) {
|
|
178
|
+
schedules = flowDef.schedules;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const renderVars = {
|
|
182
|
+
functionNameConfig,
|
|
183
|
+
handlerPath,
|
|
184
|
+
roleName,
|
|
185
|
+
queueName,
|
|
186
|
+
apiRoutes,
|
|
187
|
+
filterPatterns,
|
|
188
|
+
schedules,
|
|
189
|
+
flowTag
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
let yamlBlock = '';
|
|
193
|
+
if (schedules.length > 0 && suffixType === 'Inv') {
|
|
194
|
+
yamlBlock = ejs.render(templates.eventBridge, renderVars);
|
|
195
|
+
} else if (suffixType === 'Sqs' || suffixType === 'Dsq') {
|
|
196
|
+
yamlBlock = ejs.render(templates.sqs, renderVars);
|
|
197
|
+
} else if (suffixType === 'Inv') {
|
|
198
|
+
yamlBlock = ejs.render(templates.inv, renderVars);
|
|
199
|
+
} else if (suffixType === 'Api') {
|
|
200
|
+
yamlBlock = ejs.render(templates.api, renderVars);
|
|
201
|
+
} else if (suffixType === 'Wbs') {
|
|
202
|
+
renderVars.routeName = flowTag;
|
|
203
|
+
yamlBlock = ejs.render(templates.wbs, renderVars);
|
|
204
|
+
} else {
|
|
205
|
+
// Fallback for others
|
|
206
|
+
yamlBlock = ejs.render(templates.inv, renderVars); // Simple no-events template
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (isCrud) {
|
|
210
|
+
perActionYaml += yamlBlock + '\n\n';
|
|
211
|
+
} else if (isRel) {
|
|
212
|
+
relActionYaml += yamlBlock + '\n\n';
|
|
213
|
+
} else {
|
|
214
|
+
flowSchemaYaml += yamlBlock + '\n\n';
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (perActionYaml) {
|
|
219
|
+
await fs.writeFile(path.join(slsYamlDir, 'per-action-function.yml'), perActionYaml, 'utf-8');
|
|
220
|
+
}
|
|
221
|
+
if (relActionYaml) {
|
|
222
|
+
await fs.writeFile(path.join(slsYamlDir, 'relationship-per-action.yml'), relActionYaml, 'utf-8');
|
|
223
|
+
}
|
|
224
|
+
if (flowSchemaYaml) {
|
|
225
|
+
// Append to flow-schema.yml just in case WebSocket/TriggerCache already created it, or create new.
|
|
226
|
+
await fs.appendFile(path.join(slsYamlDir, 'flow-schema.yml'), flowSchemaYaml, 'utf-8');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
console.log(` [FunctionYamlGenerator] Wrote YAML functions for CRUD, Relationships, and Custom Flows.`);
|
|
230
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import ejs from 'ejs';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
export async function generateProcessLogicalYaml(allSchemas, options) {
|
|
10
|
+
console.log(' [ProcessLogicalYamlGenerator] Generating ProcessLogical YAML...');
|
|
11
|
+
|
|
12
|
+
// We only generate if ProcessLogical actually exists in the schemas or if there are objects.
|
|
13
|
+
// In most cases, if there are objects, ProcessLogical is needed.
|
|
14
|
+
if (!allSchemas.objects || allSchemas.objects.length === 0) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const slsYamlDir = path.join(options.outputPath, 'app', 'sls_yaml', 'generatedCode', 'source');
|
|
19
|
+
await fs.mkdir(slsYamlDir, { recursive: true });
|
|
20
|
+
|
|
21
|
+
const templatePath = path.join(__dirname, 'templates', 'ProcessLogical_Yaml.ejs');
|
|
22
|
+
let templateString;
|
|
23
|
+
try {
|
|
24
|
+
templateString = await fs.readFile(templatePath, 'utf-8');
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error('Error reading ProcessLogical YAML template:', e);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const fileContent = ejs.render(templateString, {});
|
|
31
|
+
const outputPath = path.join(slsYamlDir, 'process-logical.yml');
|
|
32
|
+
|
|
33
|
+
await fs.writeFile(outputPath, fileContent, 'utf-8');
|
|
34
|
+
console.log(` [ProcessLogicalYamlGenerator] Wrote process-logical.yml to ${outputPath}`);
|
|
35
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import ejs from 'ejs';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { getFlowsForGeneration } from '../src/generatedCode/Flow/_internal/shared/flowSelection.js';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
export async function generateRoleNameConfig(allSchemas, options) {
|
|
11
|
+
console.log(' [RoleNameConfigGenerator] Generating IAM Role Configurations...');
|
|
12
|
+
|
|
13
|
+
const resourceYamlDir = path.join(options.outputPath, 'app', 'sls_yaml', 'generatedCode', 'source');
|
|
14
|
+
await fs.mkdir(resourceYamlDir, { recursive: true });
|
|
15
|
+
|
|
16
|
+
const roleNameConfigs = new Set();
|
|
17
|
+
const CRUD_FLOW_TAGS = new Set(['Create', 'Update', 'Delete', 'Get']);
|
|
18
|
+
const REL_FLOW_TAGS = new Set([
|
|
19
|
+
'CreateRelationship',
|
|
20
|
+
'UpdateRelationship',
|
|
21
|
+
'DeleteRelationship',
|
|
22
|
+
'GetRelationship',
|
|
23
|
+
'ChangeRelationship',
|
|
24
|
+
'MoveRelationship'
|
|
25
|
+
]);
|
|
26
|
+
|
|
27
|
+
const upperCase = (str) => {
|
|
28
|
+
if (!str) return str;
|
|
29
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const flows = getFlowsForGeneration(allSchemas);
|
|
33
|
+
|
|
34
|
+
if (flows.length > 0) {
|
|
35
|
+
for (const flow of flows) {
|
|
36
|
+
if (flow.flowTag) {
|
|
37
|
+
const upperFlowTag = upperCase(flow.flowTag);
|
|
38
|
+
if (CRUD_FLOW_TAGS.has(upperFlowTag)) {
|
|
39
|
+
roleNameConfigs.add('PerActionEndpointRole');
|
|
40
|
+
} else if (REL_FLOW_TAGS.has(upperFlowTag)) {
|
|
41
|
+
roleNameConfigs.add('RelationshipRole');
|
|
42
|
+
} else {
|
|
43
|
+
roleNameConfigs.add(`${upperFlowTag}Role`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Static core framework roles that are generated
|
|
50
|
+
roleNameConfigs.add('ProcFindDataRole');
|
|
51
|
+
|
|
52
|
+
// 2. Main Execution Roles (Based on initiateBy & outputTopic)
|
|
53
|
+
if (flows.length > 0 && flows.some(f => f.event && f.event.includes('ownTopic'))) {
|
|
54
|
+
roleNameConfigs.add('WebSocketMainRole');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Prepare template output
|
|
58
|
+
const templatePath = path.join(__dirname, 'templates', 'RoleNameConfig_Yaml.ejs');
|
|
59
|
+
|
|
60
|
+
// Create templates directory and file if it doesn't exist
|
|
61
|
+
await fs.mkdir(path.dirname(templatePath), { recursive: true });
|
|
62
|
+
|
|
63
|
+
let templateString;
|
|
64
|
+
try {
|
|
65
|
+
templateString = await fs.readFile(templatePath, 'utf-8');
|
|
66
|
+
} catch (e) {
|
|
67
|
+
// Fallback to auto-creating the template based on old roleNameConfig
|
|
68
|
+
templateString = `# for createIamRole\n\n<% roleNameConfigs.forEach(roleNameConfig => { _%>\n- arn:aws:iam::\${self:custom.iz_accountId}:role/\${self:custom.iz_resourcePrefix}<%- roleNameConfig %>\n<% }) _%>\n`;
|
|
69
|
+
await fs.writeFile(templatePath, templateString, 'utf-8');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const fileContent = ejs.render(templateString, {
|
|
73
|
+
roleNameConfigs: Array.from(roleNameConfigs)
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const outputPath = path.join(resourceYamlDir, 'role-name-config.yml');
|
|
77
|
+
|
|
78
|
+
// Since isAppend was true in the old code, we should append or overwrite.
|
|
79
|
+
// However, since we clean the resource folder at start, writeFile is fine.
|
|
80
|
+
await fs.writeFile(outputPath, fileContent, 'utf-8');
|
|
81
|
+
|
|
82
|
+
console.log(` [RoleNameConfigGenerator] Wrote ${roleNameConfigs.size} role configs to ${outputPath}`);
|
|
83
|
+
}
|