@izara_project/izara-core-generate-service-code 1.0.46 → 1.0.48
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/fix_array.js +11 -0
- package/fix_imports.js +41 -0
- package/fix_upper.js +38 -0
- package/package.json +1 -1
- package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/template.ejs +2 -2
- package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/templateIntTesting.ejs +1 -1
- package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/templateYaml.ejs +1 -1
- package/src/generators/fromFlowSchema/events/eventBridge/functionYaml/yaml.js +5 -1
- package/src/generators/fromFlowSchema/events/eventBridge/handler/inv/inv.js +5 -1
- package/src/generators/fromFlowSchema/events/eventBridge/mainFunction/main.js +13 -3
- package/src/generators/fromFlowSchema/events/eventBridge/mainFunction/template.ejs +1 -1
- package/src/generators/fromFlowSchema/events/extTopic/process/functionYaml/yaml.js +6 -1
- package/src/generators/fromFlowSchema/events/extTopic/process/handler/handler.js +4 -1
- package/src/generators/fromFlowSchema/events/extTopic/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromFlowSchema/events/lambdaSyncApi/functionYaml/yaml.js +6 -1
- package/src/generators/fromFlowSchema/events/lambdaSyncApi/handler/handler.js +5 -1
- package/src/generators/fromFlowSchema/events/lambdaSyncInv/functionYaml/yaml.js +5 -1
- package/src/generators/fromFlowSchema/events/lambdaSyncInv/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/events/ownTopic/endpoint/functionYaml/yaml.js +5 -1
- package/src/generators/fromFlowSchema/events/ownTopic/endpoint/handler/handler.js +5 -2
- package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/handler/template.ejs +1 -1
- package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/mainFunction/main.js +2 -1
- package/src/generators/fromFlowSchema/events/s3/flowSchemaMainFunction/main.js +3 -1
- package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/functionYaml/template.ejs +5 -9
- package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/functionYaml/yaml.js +20 -9
- package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/queue/template.ejs +2 -5
- package/src/generators/fromFlowSchema/events/s3/upload/createObject/functionYaml/template.ejs +3 -7
- package/src/generators/fromFlowSchema/events/s3/upload/createObject/functionYaml/yaml.js +24 -8
- package/src/generators/fromFlowSchema/events/s3/upload/createObject/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/events/s3/upload/createObject/mainFunction/main.js +2 -1
- package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/functionYaml/template.ejs +4 -8
- package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/functionYaml/yaml.js +26 -9
- package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/mainFunction/main.js +2 -1
- package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/sns-sqs/template.ejs +2 -5
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/functionYaml/template.ejs +5 -9
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/functionYaml/yaml.js +27 -9
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/mainFunction/main.js +2 -1
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/queue/template.ejs +2 -5
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +4 -8
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/functionYaml/yaml.js +27 -9
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/sqs/template.ejs +3 -6
- package/src/generators/fromFlowSchema/events/s3/upload/processFile/functionYml/HdrS3/template.ejs +3 -7
- package/src/generators/fromFlowSchema/events/s3/upload/processFile/functionYml/HdrS3/yaml.js +24 -8
- package/src/generators/fromFlowSchema/events/s3/upload/processFile/queue/s3Template.ejs +2 -5
- package/src/generators/fromFlowSchema/flowSchemaMainFunction/main.js +3 -1
- package/src/generators/fromFlowSchema/flowStep/firstFlowStep/templateResource.ejs +2 -5
- package/src/generators/fromFlowSchema/flowStep/flowStep.js +14 -3
- package/src/generators/fromFlowSchema/index.js +58 -21
- package/src/generators/fromFlowSchema/register/complete/functionYaml/yaml.js +6 -1
- package/src/generators/fromFlowSchema/register/complete/handler/handler.js +5 -1
- package/src/generators/fromFlowSchema/register/complete/handler/template.ejs +3 -3
- package/src/generators/fromFlowSchema/register/dynamoDB/register.js +6 -1
- package/src/generators/fromFlowSchema/register/sns-in/snsIn.js +5 -2
- package/src/generators/fromFlowSchema/register/sns-in/template.ejs +3 -6
- package/src/generators/fromFlowSchema/register/subscriptionOutAll/subscriptionOutAll.js +2 -1
- package/src/generators/fromFlowSchema/register/subscriptionOutAll/template.ejs +0 -3
- package/src/generators/fromFlowSchema/register/wbs/functionYaml/yaml.js +4 -1
- package/src/generators/fromFlowSchema/register/wbs/handler/handler.js +2 -1
- package/src/generators/fromFlowSchema/statusTypes/statusField/functionYaml/template.ejs +3 -7
- package/src/generators/fromFlowSchema/statusTypes/statusField/functionYaml/yaml.js +27 -9
- package/src/generators/fromFlowSchema/statusTypes/statusField/handler/handler.js +4 -1
- package/src/generators/fromFlowSchema/statusTypes/statusField/mainFunction/main.js +2 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/functionYaml/template.ejs +3 -7
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/functionYaml/yaml.js +27 -9
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/mainFunction/main.js +3 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/functionYaml/template.ejs +3 -7
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/functionYaml/yaml.js +27 -9
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/handler/handler.js +3 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/mainFunction/main.js +2 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/dsq/dsq.js +27 -9
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/dsq/template.ejs +3 -7
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/sqs/sqs.js +27 -9
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/sqs/template.ejs +3 -7
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/dsq/dsq.js +3 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/sqs/sqs.js +3 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/mainFunction/main.js +3 -1
- package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheQueue/template.ejs +2 -5
- package/src/generators/fromFlowSchema/webSocket/webSocket/connect/functionYaml/yaml.js +4 -1
- package/src/generators/fromFlowSchema/webSocket/webSocket/connect/handler/handler.js +4 -1
- package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/WebSocketTaskData.js +3 -4
- package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/template.ejs +28 -0
- package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/ttlDynamoTemplate.ejs +2 -5
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/functionYaml/yaml.js +7 -1
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/handler/handler.js +4 -1
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/mainFunction/main.js +4 -1
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/sqs/sqs.js +8 -2
- package/src/generators/fromFlowSchema/webSocket/webSocketComplete/sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpoint/index.js +2 -1
- package/src/generators/fromObjectSchema/endpoint/main/beforeLogical/beforeLogical.js +4 -1
- package/src/generators/fromObjectSchema/endpoint/main/create/create.js +4 -1
- package/src/generators/fromObjectSchema/endpoint/main/delete/delete.js +2 -1
- package/src/generators/fromObjectSchema/endpoint/main/get/get.js +2 -1
- package/src/generators/fromObjectSchema/endpoint/main/update/update.js +2 -1
- package/src/generators/fromObjectSchema/endpointComplete/create/handler/handler.js +2 -1
- package/src/generators/fromObjectSchema/endpointComplete/create/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpointComplete/create/sns-out/snsOut.js +4 -1
- package/src/generators/fromObjectSchema/endpointComplete/create/sns-out/template.ejs +3 -5
- package/src/generators/fromObjectSchema/endpointComplete/create/yaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/endpointComplete/create/yaml/yaml.js +17 -2
- package/src/generators/fromObjectSchema/endpointComplete/delete/handler/handler.js +8 -2
- package/src/generators/fromObjectSchema/endpointComplete/delete/handler/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpointComplete/delete/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpointComplete/delete/yaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/endpointComplete/delete/yaml/yaml.js +17 -2
- package/src/generators/fromObjectSchema/endpointComplete/get/handler/handler.js +8 -2
- package/src/generators/fromObjectSchema/endpointComplete/get/handler/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpointComplete/get/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpointComplete/get/yaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/endpointComplete/get/yaml/yaml.js +17 -2
- package/src/generators/fromObjectSchema/endpointComplete/update/handler/handler.js +8 -2
- package/src/generators/fromObjectSchema/endpointComplete/update/handler/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpointComplete/update/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/endpointComplete/update/yaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/endpointComplete/update/yaml/yaml.js +17 -2
- package/src/generators/fromObjectSchema/findData/findDataYaml/findDataYaml.js +12 -3
- package/src/generators/fromObjectSchema/findData/findDataYaml/template.ejs +7 -11
- package/src/generators/fromObjectSchema/processLogical/yaml/template.ejs +4 -6
- package/src/generators/fromObjectSchema/processLogical/yaml/yaml.js +24 -6
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/dsq/dsq.js +24 -6
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/dsq/template.ejs +4 -6
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/sqs/sqs.js +24 -6
- package/src/generators/fromObjectSchema/processLogicalPagination/yaml/sqs/template.ejs +6 -8
- package/src/generators/fromObjectSchema/rbac/lambda/handler/handler.js +4 -1
- package/src/generators/fromObjectSchema/rbac/lambda/mainFunction/main.js +3 -2
- package/src/generators/fromObjectSchema/rbac/lambda/yaml/yaml.js +4 -1
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/functionYaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/functionYaml/yaml.js +25 -6
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/handler.js +4 -1
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -4
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/mainFunction/main.js +2 -1
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/sns-in-sqs/snsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/changeRelationship/action/sns-in-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/functionYaml/template.ejs +7 -11
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/functionYaml/yaml.js +23 -5
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-out/snsOut.js +4 -1
- package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-out/template.ejs +3 -5
- package/src/generators/fromObjectSchema/relationship/create/action/functionYaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/relationship/create/action/functionYaml/yaml.js +25 -6
- package/src/generators/fromObjectSchema/relationship/create/action/handler/handler.js +4 -1
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/apiTemplate.ejs +1 -4
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/invTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
- package/src/generators/fromObjectSchema/relationship/create/action/mainFunction/main.js +2 -1
- package/src/generators/fromObjectSchema/relationship/create/action/sns-in-sqs/snsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/create/action/sns-in-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/create/complete/functionYaml/template.ejs +7 -11
- package/src/generators/fromObjectSchema/relationship/create/complete/functionYaml/yaml.js +23 -5
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-out/snsOut.js +4 -1
- package/src/generators/fromObjectSchema/relationship/create/complete/sns-out/template.ejs +3 -5
- package/src/generators/fromObjectSchema/relationship/delete/action/functionYaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/relationship/delete/action/functionYaml/yaml.js +26 -6
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/handler.js +4 -1
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/apiTemplate.ejs +1 -4
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/invTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/sqsTemplate.ejs +3 -6
- package/src/generators/fromObjectSchema/relationship/delete/action/mainFunction/main.js +2 -1
- package/src/generators/fromObjectSchema/relationship/delete/action/sns-in-sqs/snsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/delete/action/sns-in-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/delete/complete/functionYaml/template.ejs +7 -11
- package/src/generators/fromObjectSchema/relationship/delete/complete/functionYaml/yaml.js +23 -5
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-out/snsOut.js +4 -1
- package/src/generators/fromObjectSchema/relationship/delete/complete/sns-out/template.ejs +3 -5
- package/src/generators/fromObjectSchema/relationship/get/action/functionYaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/relationship/get/action/functionYaml/yaml.js +25 -6
- package/src/generators/fromObjectSchema/relationship/get/action/handler/handler.js +4 -1
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/apiTemplate.ejs +1 -4
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/invTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
- package/src/generators/fromObjectSchema/relationship/get/action/mainFunction/main.js +2 -1
- package/src/generators/fromObjectSchema/relationship/get/action/sns-in-sqs/snsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/get/action/sns-in-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/get/complete/functionYaml/template.ejs +7 -11
- package/src/generators/fromObjectSchema/relationship/get/complete/functionYaml/yaml.js +23 -5
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-out/snsOut.js +4 -1
- package/src/generators/fromObjectSchema/relationship/get/complete/sns-out/template.ejs +3 -5
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/functionYaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/functionYaml/yaml.js +25 -6
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/handler.js +4 -1
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -4
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/mainFunction/main.js +2 -1
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/sns-in-sqs/snsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/moveRelationship/action/sns-in-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/functionYaml/template.ejs +7 -11
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/functionYaml/yaml.js +23 -5
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/mainFunction/main.js +2 -1
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-in-sqs/template.ejs +3 -6
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/snsOut.js +4 -1
- package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/template.ejs +3 -5
- package/src/generators/fromObjectSchema/relationship/update/action/functionYaml/template.ejs +5 -9
- package/src/generators/fromObjectSchema/relationship/update/action/functionYaml/yaml.js +25 -6
- package/src/generators/fromObjectSchema/relationship/update/action/handler/handler.js +4 -1
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/apiTemplate.ejs +1 -4
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/invTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/sqsTemplate.ejs +1 -4
- package/src/generators/fromObjectSchema/relationship/update/action/mainFunction/main.js +2 -1
- package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/snsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/template.ejs +7 -11
- package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/yaml.js +23 -5
- package/src/generators/fromObjectSchema/relationship/update/complete/sns-in-sqs/template.ejs +2 -5
- package/src/generators/fromObjectSchema/relationship/update/complete/sns-out/template.ejs +3 -5
- package/src/generators/fromObjectSchema/textTag/systemText/systemText.js +13 -13
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/main.js +3 -2
- package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/yaml/yaml.js +3 -1
- package/src/generators/fromPlugIn/byConfig/mainFunction/templateAwaitingStep.ejs +1 -4
- package/src/generators/fromPlugIn/byConfig/sns-sqs/queueNoTopic.ejs +2 -5
- package/src/generators/fromPlugIn/byConfig/sns-sqs/snsSqs.js +8 -2
- package/src/generators/fromPlugIn/byConfig/sns-sqs/snsTemplate.ejs +2 -5
- package/src/generators/fromPlugIn/byConfig/sns-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/fromPlugIn/firstFlowStep/mainFunction/templateByConfig/awaitingSteps.ejs +3 -6
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/dsqTemplate.ejs +2 -5
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/queueNtopic.js +5 -1
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/snsTemplate.ejs +15 -18
- package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/sqsTemplate.ejs +2 -5
- package/src/generators/fromPlugIn/firstFlowStep/topicOut/topicOut.js +5 -2
- package/src/generators/fromPlugIn/index.js +150 -155
- package/src/generators/resourceYamlComponent/dynamodb/template.ejs +2 -8
- package/src/generators/resourceYamlComponent/sns-in-sqs/snsTemplate.ejs +2 -5
- package/src/generators/resourceYamlComponent/sns-in-sqs/sqsTemplate.ejs +2 -5
- package/src/generators/roles/roleNameConfig/template.ejs +2 -2
- package/src/generators/roles/roleNameConfig/templateIntTesting.ejs +1 -1
- package/src/generators/roles/roleNameConfig/templateYaml.ejs +1 -1
- package/src/generators/roles/sharedResource/sharedResource.js +7 -1
- package/src/libs/Utils.js +4 -2
|
@@ -68,12 +68,15 @@ function createWebSocketConnectYaml(_izContext, srcPath) {
|
|
|
68
68
|
templatePath: templatePath,
|
|
69
69
|
templateData: {
|
|
70
70
|
functionName,
|
|
71
|
+
|
|
71
72
|
handlerFilePath: path.join(
|
|
72
73
|
SOURCE_PATH.resourceLocationWebSocketMain,
|
|
73
74
|
functionName
|
|
74
75
|
),
|
|
76
|
+
|
|
75
77
|
additionalResourcePermission,
|
|
76
|
-
roleName: 'WebSocketMain'
|
|
78
|
+
roleName: 'WebSocketMain',
|
|
79
|
+
upperFunctionName: upperCase(functionName)
|
|
77
80
|
},
|
|
78
81
|
setting: {
|
|
79
82
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -21,6 +21,8 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
21
21
|
const __dirname = path.dirname(__filename);
|
|
22
22
|
|
|
23
23
|
import consts from '#libs/Consts.js';
|
|
24
|
+
import utils from '#libs/Utils.js';
|
|
25
|
+
const { firstLetterUpperCase: upperCase } = utils;
|
|
24
26
|
|
|
25
27
|
const { SOURCE_PATH } = consts;
|
|
26
28
|
|
|
@@ -38,7 +40,8 @@ function createWebSocketConnectYaml(_izContext, srcPath) {
|
|
|
38
40
|
return {
|
|
39
41
|
templatePath: templatePath,
|
|
40
42
|
templateData: {
|
|
41
|
-
functionName
|
|
43
|
+
functionName,
|
|
44
|
+
upperFunctionName: upperCase(functionName)
|
|
42
45
|
},
|
|
43
46
|
setting: {
|
|
44
47
|
savePath: path.join(srcPath, SOURCE_PATH.WebSocketMain),
|
|
@@ -24,10 +24,7 @@ import consts from '#libs/Consts.js';
|
|
|
24
24
|
|
|
25
25
|
const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
|
|
26
26
|
|
|
27
|
-
const templatePath = path.join(
|
|
28
|
-
__dirname,
|
|
29
|
-
'../../../../resourceYamlComponent/dynamodb/template.ejs'
|
|
30
|
-
);
|
|
27
|
+
const templatePath = path.join(__dirname, './template.ejs');
|
|
31
28
|
|
|
32
29
|
/**
|
|
33
30
|
*
|
|
@@ -41,6 +38,8 @@ function data(_izContext, srcPath) {
|
|
|
41
38
|
{
|
|
42
39
|
tableName: 'WebSocketTask',
|
|
43
40
|
resourceName: 'WebSocketTask',
|
|
41
|
+
ttl: true,
|
|
42
|
+
ttlAttributeName: 'expirationTime',
|
|
44
43
|
attributes: [
|
|
45
44
|
{
|
|
46
45
|
keyType: 'partitionKey',
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<%- resourceName %>Table:
|
|
2
|
+
Type: "AWS::DynamoDB::Table"
|
|
3
|
+
Properties:
|
|
4
|
+
TableName: ${self:custom.iz_resourcePrefix}<%- tableName %>
|
|
5
|
+
BillingMode: PAY_PER_REQUEST
|
|
6
|
+
AttributeDefinitions:
|
|
7
|
+
<%_ attributes.forEach(attribute => { -%>
|
|
8
|
+
- AttributeName: <%- attribute['AttributeName'] %>
|
|
9
|
+
AttributeType: <%- attribute['AttributeType'] %>
|
|
10
|
+
<%_ }) _%>
|
|
11
|
+
KeySchema:
|
|
12
|
+
<%_ attributes.forEach(attribute => { -%>
|
|
13
|
+
<%_ if (attribute.keyType === 'partitionKey' || attribute.keyType === "identifier") { -%>
|
|
14
|
+
- AttributeName: <%- attribute["AttributeName"] %>
|
|
15
|
+
KeyType: HASH
|
|
16
|
+
<%_ } -%>
|
|
17
|
+
<%_ if(attribute.keyType === "sortKey") { -%>
|
|
18
|
+
- AttributeName: <%- attribute["AttributeName"] %>
|
|
19
|
+
KeyType: RANGE
|
|
20
|
+
<%_ } -%>
|
|
21
|
+
<%_ }) _%>
|
|
22
|
+
<%_ if (typeof ttl !== 'undefined' && ttl && typeof ttlAttributeName !== 'undefined' && ttlAttributeName) { _%>
|
|
23
|
+
TimeToLiveSpecification:
|
|
24
|
+
AttributeName: <%- ttlAttributeName %>
|
|
25
|
+
Enabled: true
|
|
26
|
+
<%_ } _%>
|
|
27
|
+
#<#<%- tableName %>DynamoDbSetting#>
|
|
28
|
+
#<#/<%- tableName %>DynamoDbSetting#>
|
|
@@ -22,11 +22,8 @@
|
|
|
22
22
|
TimeToLiveSpecification:
|
|
23
23
|
AttributeName: expirationTime
|
|
24
24
|
Enabled: true
|
|
25
|
-
#<#<%-
|
|
26
|
-
#<#/<%-
|
|
27
|
-
<%_ function firstLetterUpperCase(text){
|
|
28
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
29
|
-
} _%>
|
|
25
|
+
#<#<%- tableName %>DynamoDbSetting#>
|
|
26
|
+
#<#/<%- tableName %>DynamoDbSetting#>
|
|
30
27
|
<%_ function firstLetterLowerCase(str) {
|
|
31
28
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
32
29
|
} _%>
|
|
@@ -120,13 +120,19 @@ function createSourceParams(_izContext, allLocalFlowSchemas, srcPath) {
|
|
|
120
120
|
SOURCE_PATH.resourceLocationWebSocketMain,
|
|
121
121
|
`${upperCase(functionName)}_${upperCase(handlerType)}`
|
|
122
122
|
),
|
|
123
|
+
|
|
123
124
|
functionName,
|
|
124
125
|
handlerType,
|
|
125
126
|
additionalResourcePermission,
|
|
127
|
+
|
|
126
128
|
functionNameConfig:
|
|
127
129
|
upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
130
|
+
|
|
128
131
|
roleName: 'WebSocketMain',
|
|
129
|
-
queueName: queueName
|
|
132
|
+
queueName: queueName,
|
|
133
|
+
upperFunctionName: upperCase(functionName),
|
|
134
|
+
upperHandlerType: upperCase(handlerType),
|
|
135
|
+
upperQueueName: upperCase(queueName)
|
|
130
136
|
},
|
|
131
137
|
setting: {
|
|
132
138
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -45,7 +45,10 @@ function createParamsForCreateSource(_izContext, srcPath) {
|
|
|
45
45
|
templateData: {
|
|
46
46
|
functionName,
|
|
47
47
|
handlerType,
|
|
48
|
-
queueName
|
|
48
|
+
queueName,
|
|
49
|
+
upperFunctionName: upperCase(functionName),
|
|
50
|
+
upperHandlerType: upperCase(handlerType),
|
|
51
|
+
upperQueueName: upperCase(queueName)
|
|
49
52
|
},
|
|
50
53
|
setting: {
|
|
51
54
|
savePath: path.join(srcPath, SOURCE_PATH.WebSocketMain),
|
|
@@ -20,6 +20,8 @@ import { fileURLToPath } from 'url';
|
|
|
20
20
|
const __filename = fileURLToPath(import.meta.url);
|
|
21
21
|
const __dirname = path.dirname(__filename);
|
|
22
22
|
import consts from '#libs/Consts.js';
|
|
23
|
+
import utils from '#libs/Utils.js';
|
|
24
|
+
const { firstLetterUpperCase: upperCase } = utils;
|
|
23
25
|
|
|
24
26
|
const { SOURCE_PATH } = consts;
|
|
25
27
|
|
|
@@ -37,7 +39,8 @@ function createParamsForCreateSource(_izContext, srcPath) {
|
|
|
37
39
|
return {
|
|
38
40
|
templatePath: templatePath,
|
|
39
41
|
templateData: {
|
|
40
|
-
functionName
|
|
42
|
+
functionName,
|
|
43
|
+
upperFunctionName: upperCase(functionName)
|
|
41
44
|
},
|
|
42
45
|
setting: {
|
|
43
46
|
savePath: path.join(srcPath, SOURCE_PATH.WebSocketMain),
|
|
@@ -67,11 +67,14 @@ function createDataForDefaultSnsInSqs(_izContext, allFlowSchema, srcPath) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function createSubscriptionForWebSocketComplete(subscribeTo, srcPath) {
|
|
70
|
+
const queueName = `WebSocketComplete` + upperCase(HANDLER.hdrSqs);
|
|
71
|
+
const upperQueueName = upperCase(queueName);
|
|
70
72
|
return {
|
|
71
73
|
templatePath: templateSub,
|
|
72
74
|
templateData: {
|
|
73
75
|
subscribeTo,
|
|
74
|
-
queueName
|
|
76
|
+
queueName,
|
|
77
|
+
upperQueueName
|
|
75
78
|
},
|
|
76
79
|
setting: {
|
|
77
80
|
initialData: 'Resources:\n',
|
|
@@ -84,10 +87,13 @@ function createSubscriptionForWebSocketComplete(subscribeTo, srcPath) {
|
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
function createWebSocketCompleteQueue(srcPath) {
|
|
90
|
+
const queueName = 'WebSocketComplete' + upperCase(HANDLER.hdrSqs);
|
|
91
|
+
const upperQueueName = upperCase(queueName);
|
|
87
92
|
return {
|
|
88
93
|
templatePath: templatePath,
|
|
89
94
|
templateData: {
|
|
90
|
-
queueName
|
|
95
|
+
queueName,
|
|
96
|
+
upperQueueName
|
|
91
97
|
},
|
|
92
98
|
setting: {
|
|
93
99
|
initialData: 'Resources:\n',
|
|
@@ -32,12 +32,9 @@
|
|
|
32
32
|
Action: "SQS:SendMessage"
|
|
33
33
|
Queues:
|
|
34
34
|
- Ref: <%- queueName %>
|
|
35
|
-
#<#<%-
|
|
36
|
-
#<#/<%-
|
|
35
|
+
#<#<%- queueName %>QueueSetting#>
|
|
36
|
+
#<#/<%- queueName %>QueueSetting#>
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
40
|
-
} _%>
|
|
41
|
-
<%_ function firstLetterLowerCase(str) {
|
|
38
|
+
<%_ function firstLetterLowerCase(str) {
|
|
42
39
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
43
40
|
} _%>
|
|
@@ -141,7 +141,8 @@ async function endpointComponent(
|
|
|
141
141
|
handler: upperCase(type),
|
|
142
142
|
queueName,
|
|
143
143
|
functionMainName: action + 'Main',
|
|
144
|
-
fileMainName: upperCase(action) + '_Main.js'
|
|
144
|
+
fileMainName: upperCase(action) + '_Main.js',
|
|
145
|
+
upperQueueName: upperCase(queueName)
|
|
145
146
|
}
|
|
146
147
|
});
|
|
147
148
|
createSourceParams.push(...params);
|
|
@@ -32,12 +32,15 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
32
32
|
function createSource(_izContext, appPath, action, generatedCodeConfig = []) {
|
|
33
33
|
const functionName = upperCase(action);
|
|
34
34
|
|
|
35
|
+
const upperFunctionName = upperCase(functionName);
|
|
36
|
+
|
|
35
37
|
return {
|
|
36
38
|
templatePath: templatePath,
|
|
37
39
|
templateData: {
|
|
38
40
|
action,
|
|
39
41
|
functionName,
|
|
40
|
-
generatedCodeConfig
|
|
42
|
+
generatedCodeConfig,
|
|
43
|
+
upperFunctionName
|
|
41
44
|
},
|
|
42
45
|
setting: {
|
|
43
46
|
savePath: path.join(appPath, SOURCE_PATH.endpointPerService),
|
|
@@ -31,11 +31,14 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
31
31
|
function createSource(_izContext, appPath, generatedCodeConfig = []) {
|
|
32
32
|
const functionName = upperCase(ACTIONS.create);
|
|
33
33
|
|
|
34
|
+
const upperFunctionName = upperCase(functionName);
|
|
35
|
+
|
|
34
36
|
return {
|
|
35
37
|
templatePath: templatePath,
|
|
36
38
|
templateData: {
|
|
37
39
|
functionName,
|
|
38
|
-
generatedCodeConfig
|
|
40
|
+
generatedCodeConfig,
|
|
41
|
+
upperFunctionName
|
|
39
42
|
},
|
|
40
43
|
setting: {
|
|
41
44
|
savePath: path.join(appPath, SOURCE_PATH.endpointPerService),
|
|
@@ -34,7 +34,8 @@ function createSource(_izContext, appPath, generatedCodeConfig = []) {
|
|
|
34
34
|
templatePath: templatePath,
|
|
35
35
|
templateData: {
|
|
36
36
|
functionName,
|
|
37
|
-
generatedCodeConfig
|
|
37
|
+
generatedCodeConfig,
|
|
38
|
+
upperFunctionName: upperCase(functionName)
|
|
38
39
|
},
|
|
39
40
|
setting: {
|
|
40
41
|
savePath: path.join(appPath, SOURCE_PATH.endpointPerService),
|
|
@@ -34,7 +34,8 @@ function createSource(_izContext, appPath, generatedCodeConfig = []) {
|
|
|
34
34
|
return {
|
|
35
35
|
templatePath: templatePath,
|
|
36
36
|
templateData: {
|
|
37
|
-
functionName
|
|
37
|
+
functionName,
|
|
38
|
+
upperFunctionName: upperCase(functionName)
|
|
38
39
|
},
|
|
39
40
|
setting: {
|
|
40
41
|
savePath: path.join(appPath, SOURCE_PATH.endpointPerService),
|
|
@@ -35,7 +35,8 @@ function createSource(_izContext, appPath, generatedCodeConfig = []) {
|
|
|
35
35
|
templatePath: templatePath,
|
|
36
36
|
templateData: {
|
|
37
37
|
functionName,
|
|
38
|
-
generatedCodeConfig
|
|
38
|
+
generatedCodeConfig,
|
|
39
|
+
upperFunctionName: upperCase(functionName)
|
|
39
40
|
},
|
|
40
41
|
setting: {
|
|
41
42
|
savePath: path.join(appPath, SOURCE_PATH.endpointPerService),
|
|
@@ -48,7 +48,8 @@ function createParamForCreateSource(srcPath) {
|
|
|
48
48
|
templateData: {
|
|
49
49
|
functionName,
|
|
50
50
|
queueName: upperCase(functionName),
|
|
51
|
-
functionName
|
|
51
|
+
functionName,
|
|
52
|
+
upperFunctionName: upperCase(functionName)
|
|
52
53
|
},
|
|
53
54
|
setting: {
|
|
54
55
|
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
@@ -34,14 +34,11 @@
|
|
|
34
34
|
Action: "SQS:SendMessage"
|
|
35
35
|
Queues:
|
|
36
36
|
- Ref: <%- queueName %>
|
|
37
|
-
#<#<%-
|
|
38
|
-
#<#/<%-
|
|
37
|
+
#<#<%- queueName %>QueueSetting#>
|
|
38
|
+
#<#/<%- queueName %>QueueSetting#>
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
43
|
-
} _%>
|
|
44
|
-
<%_ function firstLetterLowerCase(str) {
|
|
41
|
+
<%_ function firstLetterLowerCase(str) {
|
|
45
42
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
46
43
|
} _%>
|
|
47
44
|
|
|
@@ -50,10 +50,13 @@ function data(_izContext, srcPath) {
|
|
|
50
50
|
|
|
51
51
|
function createParamsForCreateSource(_izContext, srcPath) {
|
|
52
52
|
let queueName = FUNCTION_NAME.createObjectComplete;
|
|
53
|
+
queueName = upperCase(queueName);
|
|
54
|
+
const upperQueueName = upperCase(queueName);
|
|
53
55
|
return {
|
|
54
56
|
templatePath: templatePath,
|
|
55
57
|
templateData: {
|
|
56
|
-
queueName
|
|
58
|
+
queueName,
|
|
59
|
+
upperQueueName
|
|
57
60
|
},
|
|
58
61
|
setting: {
|
|
59
62
|
initialData: 'Resources:\n',
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
##--------- [Create Topic Out]
|
|
2
|
-
Out<%-
|
|
2
|
+
Out<%- queueName %>:
|
|
3
3
|
Type: AWS::SNS::Topic
|
|
4
4
|
Properties:
|
|
5
5
|
DisplayName: "SNS Message out"
|
|
6
|
-
TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%-
|
|
6
|
+
TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- queueName %>_Out
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
10
|
-
} _%>
|
|
8
|
+
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPathUpperFunctionName %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
5
|
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
6
|
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
8
7
|
events:
|
|
9
8
|
- sqs:
|
|
10
|
-
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%-
|
|
9
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
|
|
11
10
|
batchSize: 10
|
|
12
11
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
13
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-
|
|
12
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- upperFunctionName %>"]}}} # functionName of callingFlow
|
|
14
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
15
14
|
|
|
16
|
-
<%_ function firstLetterUpperCase(text){
|
|
17
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
18
|
-
} _%>
|
|
19
15
|
<%_ function firstLetterLowerCase(str) {
|
|
20
16
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
21
17
|
} _%>
|
|
@@ -89,15 +89,30 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
89
89
|
|
|
90
90
|
additionalResourcePermission.push(awaitingMultipleStepsRole());
|
|
91
91
|
|
|
92
|
+
const resourceLocation = SOURCE_PATH.resourceLocationOutPerActionComplete;
|
|
93
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.ObjectCompleteRole;
|
|
94
|
+
const upperFunctionName = upperCase(functionName);
|
|
95
|
+
const upperHandlerType = upperCase(handlerType);
|
|
96
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
97
|
+
const upperRoleName = upperCase(roleName);
|
|
98
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
99
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
100
|
+
|
|
92
101
|
return {
|
|
93
102
|
templatePath: templatePath,
|
|
94
103
|
templateData: {
|
|
95
104
|
functionName,
|
|
96
105
|
handlerType,
|
|
97
106
|
additionalResourcePermission,
|
|
98
|
-
resourceLocation
|
|
107
|
+
resourceLocation,
|
|
99
108
|
functionNameConfig,
|
|
100
|
-
roleName
|
|
109
|
+
roleName,
|
|
110
|
+
upperFunctionName,
|
|
111
|
+
upperHandlerType,
|
|
112
|
+
upperFunctionNameConfig,
|
|
113
|
+
upperRoleName,
|
|
114
|
+
handlerPath,
|
|
115
|
+
handlerPathUpperFunctionName
|
|
101
116
|
},
|
|
102
117
|
setting: {
|
|
103
118
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -43,12 +43,18 @@ function data(_izContext, srcPath) {
|
|
|
43
43
|
function createParamForCreateSource(srcPath) {
|
|
44
44
|
const functionName = FUNCTION_NAME.deleteNodeComplete;
|
|
45
45
|
|
|
46
|
+
const queueName = upperCase(functionName);
|
|
47
|
+
const upperFunctionName = upperCase(functionName);
|
|
48
|
+
const upperQueueName = upperCase(queueName);
|
|
49
|
+
|
|
46
50
|
return {
|
|
47
51
|
templatePath: templatePath,
|
|
48
52
|
templateData: {
|
|
49
53
|
functionName,
|
|
50
|
-
queueName
|
|
51
|
-
functionName
|
|
54
|
+
queueName,
|
|
55
|
+
functionName,
|
|
56
|
+
upperFunctionName,
|
|
57
|
+
upperQueueName
|
|
52
58
|
},
|
|
53
59
|
setting: {
|
|
54
60
|
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
@@ -22,7 +22,7 @@ import Logger from '@izara_project/izara-core-library-logger';
|
|
|
22
22
|
import { recordHandlerSharedLib } from "@izara_project/izara-core-library-record-handler";
|
|
23
23
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
24
24
|
|
|
25
|
-
import <%- functionName %> from './<%-
|
|
25
|
+
import <%- functionName %> from './<%- upperFunctionName %>_Main.js';
|
|
26
26
|
|
|
27
27
|
// validate event properties in body.Message of sqs event
|
|
28
28
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
@@ -78,7 +78,7 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
78
78
|
//validate message (and MessageAttributes)
|
|
79
79
|
await recordHandlerSharedLib.validateRecord(
|
|
80
80
|
record, // one record will send to mainFunction
|
|
81
|
-
"<%-
|
|
81
|
+
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
82
82
|
perRecordsValidatorSchema, // schema for record.Message
|
|
83
83
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
84
84
|
);
|
|
@@ -95,7 +95,7 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
95
95
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
96
96
|
record, // one record will send to mainFunction
|
|
97
97
|
<%- functionName %>, // mainFunction that need to invoke.
|
|
98
|
-
"<%-
|
|
98
|
+
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
99
99
|
passOnProperties, // all parameters that mainFunction needed.
|
|
100
100
|
);
|
|
101
101
|
record._izContext.logger.debug('after recordPromise in handler');
|
|
@@ -120,6 +120,3 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
<%_ function firstLetterUpperCase(text){
|
|
124
|
-
return text.charAt(0).toUpperCase()+ text.slice(1)
|
|
125
|
-
} _%>
|
|
@@ -34,14 +34,11 @@
|
|
|
34
34
|
Action: "SQS:SendMessage"
|
|
35
35
|
Queues:
|
|
36
36
|
- Ref: <%- queueName %>
|
|
37
|
-
#<#<%-
|
|
38
|
-
#<#/<%-
|
|
37
|
+
#<#<%- queueName %>QueueSetting#>
|
|
38
|
+
#<#/<%- queueName %>QueueSetting#>
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
43
|
-
} _%>
|
|
44
|
-
<%_ function firstLetterLowerCase(str) {
|
|
41
|
+
<%_ function firstLetterLowerCase(str) {
|
|
45
42
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
46
43
|
} _%>
|
|
47
44
|
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPathUpperFunctionName %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
5
|
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
6
|
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
8
7
|
events:
|
|
9
8
|
- sqs:
|
|
10
|
-
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%-
|
|
9
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
|
|
11
10
|
batchSize: 10
|
|
12
11
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
13
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-
|
|
12
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- upperFunctionName %>"]}}} # functionName of callingFlow
|
|
14
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
15
|
-
<%_ function firstLetterUpperCase(text){
|
|
16
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
|
-
} _%>
|
|
18
14
|
<%_ function firstLetterLowerCase(str) {
|
|
19
15
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
20
16
|
} _%>
|
|
@@ -87,15 +87,30 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
87
87
|
)
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
+
const resourceLocation = SOURCE_PATH.resourceLocationOutPerActionComplete;
|
|
91
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.ObjectCompleteRole;
|
|
92
|
+
const upperFunctionName = upperCase(functionName);
|
|
93
|
+
const upperHandlerType = upperCase(handlerType);
|
|
94
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
95
|
+
const upperRoleName = upperCase(roleName);
|
|
96
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
97
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
98
|
+
|
|
90
99
|
return {
|
|
91
100
|
templatePath: templatePath,
|
|
92
101
|
templateData: {
|
|
93
102
|
functionName,
|
|
94
103
|
handlerType,
|
|
95
104
|
additionalResourcePermission,
|
|
96
|
-
resourceLocation
|
|
105
|
+
resourceLocation,
|
|
97
106
|
functionNameConfig,
|
|
98
|
-
roleName
|
|
107
|
+
roleName,
|
|
108
|
+
upperFunctionName,
|
|
109
|
+
upperHandlerType,
|
|
110
|
+
upperFunctionNameConfig,
|
|
111
|
+
upperRoleName,
|
|
112
|
+
handlerPath,
|
|
113
|
+
handlerPathUpperFunctionName
|
|
99
114
|
},
|
|
100
115
|
setting: {
|
|
101
116
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -43,12 +43,18 @@ function data(_izContext, srcPath) {
|
|
|
43
43
|
function createParamForCreateSource(srcPath) {
|
|
44
44
|
const functionName = FUNCTION_NAME.getNodeComplete;
|
|
45
45
|
|
|
46
|
+
const queueName = upperCase(functionName);
|
|
47
|
+
const upperFunctionName = upperCase(functionName);
|
|
48
|
+
const upperQueueName = upperCase(queueName);
|
|
49
|
+
|
|
46
50
|
return {
|
|
47
51
|
templatePath: templatePath,
|
|
48
52
|
templateData: {
|
|
49
53
|
functionName,
|
|
50
|
-
queueName
|
|
51
|
-
functionName
|
|
54
|
+
queueName,
|
|
55
|
+
functionName,
|
|
56
|
+
upperFunctionName,
|
|
57
|
+
upperQueueName
|
|
52
58
|
},
|
|
53
59
|
setting: {
|
|
54
60
|
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
@@ -22,7 +22,7 @@ import Logger from '@izara_project/izara-core-library-logger';
|
|
|
22
22
|
import { recordHandlerSharedLib } from "@izara_project/izara-core-library-record-handler";
|
|
23
23
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
24
24
|
|
|
25
|
-
import <%- functionName %> from './<%-
|
|
25
|
+
import <%- functionName %> from './<%- upperFunctionName %>_Main.js';
|
|
26
26
|
|
|
27
27
|
// validate event properties in body.Message of sqs event
|
|
28
28
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
@@ -78,7 +78,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
78
78
|
//validate message (and MessageAttributes)
|
|
79
79
|
await recordHandlerSharedLib.validateRecord(
|
|
80
80
|
record, // one record will send to mainFunction
|
|
81
|
-
"<%-
|
|
81
|
+
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
82
82
|
perRecordsValidatorSchema, // schema for record.Message
|
|
83
83
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
84
84
|
);
|
|
@@ -95,7 +95,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
95
95
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
96
96
|
record, // one record will send to mainFunction
|
|
97
97
|
<%- functionName %>, // mainFunction that need to invoke.
|
|
98
|
-
"<%-
|
|
98
|
+
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
99
99
|
passOnProperties, // all parameters that mainFunction needed.
|
|
100
100
|
);
|
|
101
101
|
record._izContext.logger.debug('after recordPromise in handler');
|
|
@@ -120,6 +120,3 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
<%_ function firstLetterUpperCase(text){
|
|
124
|
-
return text.charAt(0).toUpperCase()+ text.slice(1)
|
|
125
|
-
} _%>
|
|
@@ -34,14 +34,11 @@
|
|
|
34
34
|
Action: "SQS:SendMessage"
|
|
35
35
|
Queues:
|
|
36
36
|
- Ref: <%- queueName %>
|
|
37
|
-
#<#<%-
|
|
38
|
-
#<#/<%-
|
|
37
|
+
#<#<%- queueName %>QueueSetting#>
|
|
38
|
+
#<#/<%- queueName %>QueueSetting#>
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
43
|
-
} _%>
|
|
44
|
-
<%_ function firstLetterLowerCase(str) {
|
|
41
|
+
<%_ function firstLetterLowerCase(str) {
|
|
45
42
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
46
43
|
} _%>
|
|
47
44
|
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPathUpperFunctionName %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
5
|
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
6
|
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
8
7
|
events:
|
|
9
8
|
- sqs:
|
|
10
|
-
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%-
|
|
9
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
|
|
11
10
|
batchSize: 10
|
|
12
11
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
13
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-
|
|
12
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- upperFunctionName %>"]}}} # functionName of callingFlow
|
|
14
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
15
14
|
|
|
16
|
-
<%_ function firstLetterUpperCase(text){
|
|
17
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
18
|
-
} _%>
|
|
19
15
|
<%_ function firstLetterLowerCase(str) {
|
|
20
16
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
21
17
|
} _%>
|