@izara_project/izara-core-generate-service-code 1.0.46 → 1.0.47
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 +11 -7
- 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
|
@@ -90,15 +90,30 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
90
90
|
|
|
91
91
|
additionalResourcePermission.push(awaitingMultipleStepsRole());
|
|
92
92
|
|
|
93
|
+
const resourceLocation = SOURCE_PATH.resourceLocationOutPerActionComplete;
|
|
94
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.ObjectCompleteRole;
|
|
95
|
+
const upperFunctionName = upperCase(functionName);
|
|
96
|
+
const upperHandlerType = upperCase(handlerType);
|
|
97
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
98
|
+
const upperRoleName = upperCase(roleName);
|
|
99
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
100
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
101
|
+
|
|
93
102
|
return {
|
|
94
103
|
templatePath: templatePath,
|
|
95
104
|
templateData: {
|
|
96
105
|
functionName,
|
|
97
106
|
handlerType,
|
|
98
107
|
additionalResourcePermission,
|
|
99
|
-
resourceLocation
|
|
108
|
+
resourceLocation,
|
|
100
109
|
functionNameConfig,
|
|
101
|
-
roleName
|
|
110
|
+
roleName,
|
|
111
|
+
upperFunctionName,
|
|
112
|
+
upperHandlerType,
|
|
113
|
+
upperFunctionNameConfig,
|
|
114
|
+
upperRoleName,
|
|
115
|
+
handlerPath,
|
|
116
|
+
handlerPathUpperFunctionName
|
|
102
117
|
},
|
|
103
118
|
setting: {
|
|
104
119
|
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.updateNodeComplete;
|
|
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, 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 @@ export const 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 @@ export const 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,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
|
} _%>
|
|
@@ -90,15 +90,30 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
90
90
|
// console.log("additionalResourcePermission in update", JSON.stringify(additionalResourcePermission, null, 2))
|
|
91
91
|
additionalResourcePermission.push(awaitingMultipleStepsRole());
|
|
92
92
|
|
|
93
|
+
const resourceLocation = SOURCE_PATH.resourceLocationOutPerActionComplete;
|
|
94
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.ObjectCompleteRole;
|
|
95
|
+
const upperFunctionName = upperCase(functionName);
|
|
96
|
+
const upperHandlerType = upperCase(handlerType);
|
|
97
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
98
|
+
const upperRoleName = upperCase(roleName);
|
|
99
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
100
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
101
|
+
|
|
93
102
|
return {
|
|
94
103
|
templatePath: templatePath,
|
|
95
104
|
templateData: {
|
|
96
105
|
functionName,
|
|
97
106
|
handlerType,
|
|
98
107
|
additionalResourcePermission,
|
|
99
|
-
resourceLocation
|
|
108
|
+
resourceLocation,
|
|
100
109
|
functionNameConfig,
|
|
101
|
-
roleName
|
|
110
|
+
roleName,
|
|
111
|
+
upperFunctionName,
|
|
112
|
+
upperHandlerType,
|
|
113
|
+
upperFunctionNameConfig,
|
|
114
|
+
upperRoleName,
|
|
115
|
+
handlerPath,
|
|
116
|
+
handlerPathUpperFunctionName
|
|
102
117
|
},
|
|
103
118
|
setting: {
|
|
104
119
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -172,6 +172,12 @@ async function data(_izContext, objectSchemas, appPath, settings) {
|
|
|
172
172
|
|
|
173
173
|
// console.log("additionalResourcePermission", additionalResourcePermission)
|
|
174
174
|
// console.log("findData template generated")
|
|
175
|
+
const functionNameConfig = upperCase(functionName) + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
176
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
177
|
+
const upperFunctionName = upperCase(functionName);
|
|
178
|
+
const upperHandlerType = upperCase(HANDLER.hdrSqs);
|
|
179
|
+
const handlerPath = path.join(SOURCE_PATH.resourceLocationFindData, `${functionName}_${upperHandlerType}.main`);
|
|
180
|
+
|
|
175
181
|
return {
|
|
176
182
|
templatePath: templatePath,
|
|
177
183
|
templateData: {
|
|
@@ -179,9 +185,12 @@ async function data(_izContext, objectSchemas, appPath, settings) {
|
|
|
179
185
|
resourceLocation: SOURCE_PATH.resourceLocationFindData,
|
|
180
186
|
handlerType: HANDLER.hdrSqs,
|
|
181
187
|
additionalResourcePermission,
|
|
182
|
-
functionNameConfig
|
|
183
|
-
|
|
184
|
-
|
|
188
|
+
functionNameConfig,
|
|
189
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole,
|
|
190
|
+
upperFunctionNameConfig,
|
|
191
|
+
upperFunctionName,
|
|
192
|
+
upperHandlerType,
|
|
193
|
+
handlerPath
|
|
185
194
|
},
|
|
186
195
|
setting: {
|
|
187
196
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPath %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
|
-
#<#<%-
|
|
7
|
-
#<#/<%-
|
|
5
|
+
#<#<%- upperFunctionName %><%- upperHandlerType %>FunctionSetting#>
|
|
6
|
+
#<#/<%- upperFunctionName %><%- upperHandlerType %>FunctionSetting#>
|
|
8
7
|
events:
|
|
9
8
|
- sqs:
|
|
10
|
-
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%-
|
|
11
|
-
batchSize: 10
|
|
12
|
-
<%_ function firstLetterUpperCase(text){
|
|
13
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
14
|
-
} _%>
|
|
9
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
10
|
+
batchSize: 10
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPath %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
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}<%- functionName %><%-
|
|
9
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
11
10
|
batchSize: 10
|
|
12
|
-
<%_ function firstLetterUpperCase(text){ return text.charAt(0).toUpperCase() + text.slice(1) } _%>
|
|
@@ -158,17 +158,35 @@ async function data(_izContext, objectSchemas, appPath) {
|
|
|
158
158
|
)
|
|
159
159
|
);
|
|
160
160
|
|
|
161
|
+
const resourceLocation = SOURCE_PATH.resourceLocationProcessLogical;
|
|
162
|
+
const handlerType = HANDLER.hdrSqs;
|
|
163
|
+
|
|
164
|
+
const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.processLogical)) +
|
|
165
|
+
upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
166
|
+
|
|
167
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole;
|
|
168
|
+
const upperFunctionName = upperCase(functionName);
|
|
169
|
+
const upperHandlerType = upperCase(handlerType);
|
|
170
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
171
|
+
const upperRoleName = upperCase(roleName);
|
|
172
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
173
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
174
|
+
|
|
161
175
|
return {
|
|
162
176
|
templatePath: templatePath,
|
|
163
177
|
templateData: {
|
|
164
178
|
functionName: functionName,
|
|
165
|
-
resourceLocation
|
|
166
|
-
handlerType
|
|
179
|
+
resourceLocation,
|
|
180
|
+
handlerType,
|
|
167
181
|
additionalResourcePermission,
|
|
168
|
-
functionNameConfig
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
182
|
+
functionNameConfig,
|
|
183
|
+
roleName,
|
|
184
|
+
upperFunctionName,
|
|
185
|
+
upperHandlerType,
|
|
186
|
+
upperFunctionNameConfig,
|
|
187
|
+
upperRoleName,
|
|
188
|
+
handlerPath,
|
|
189
|
+
handlerPathUpperFunctionName
|
|
172
190
|
},
|
|
173
191
|
setting: {
|
|
174
192
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -136,6 +136,20 @@ async function data(_izContext, allObjSchemas, appPath) {
|
|
|
136
136
|
)
|
|
137
137
|
);
|
|
138
138
|
|
|
139
|
+
const resourceLocation = SOURCE_PATH.resourceLocationProcessLogical;
|
|
140
|
+
const handlerType = HANDLER.hdrDsq;
|
|
141
|
+
|
|
142
|
+
const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.paginateProcessLogical)) +
|
|
143
|
+
upperCase(shortNameHandler(HANDLER.hdrDsq));
|
|
144
|
+
|
|
145
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole;
|
|
146
|
+
const upperFunctionName = upperCase(functionName);
|
|
147
|
+
const upperHandlerType = upperCase(handlerType);
|
|
148
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
149
|
+
const upperRoleName = upperCase(roleName);
|
|
150
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
151
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
152
|
+
|
|
139
153
|
// additionalResourcePermission.push(
|
|
140
154
|
// createIamRole(
|
|
141
155
|
// {
|
|
@@ -151,13 +165,17 @@ async function data(_izContext, allObjSchemas, appPath) {
|
|
|
151
165
|
templatePath: templatePath,
|
|
152
166
|
templateData: {
|
|
153
167
|
functionName: functionName,
|
|
154
|
-
resourceLocation
|
|
155
|
-
handlerType
|
|
168
|
+
resourceLocation,
|
|
169
|
+
handlerType,
|
|
156
170
|
additionalResourcePermission,
|
|
157
|
-
functionNameConfig
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
171
|
+
functionNameConfig,
|
|
172
|
+
roleName,
|
|
173
|
+
upperFunctionName,
|
|
174
|
+
upperHandlerType,
|
|
175
|
+
upperFunctionNameConfig,
|
|
176
|
+
upperRoleName,
|
|
177
|
+
handlerPath,
|
|
178
|
+
handlerPathUpperFunctionName
|
|
161
179
|
},
|
|
162
180
|
setting: {
|
|
163
181
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPath %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
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}<%- functionName %><%-
|
|
9
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
11
10
|
batchSize: 10
|
|
12
|
-
<%_ function firstLetterUpperCase(text){ return text.charAt(0).toUpperCase() + text.slice(1) } _%>
|
|
@@ -145,6 +145,20 @@ async function data(_izContext, allObjSchemas, appPath) {
|
|
|
145
145
|
)
|
|
146
146
|
);
|
|
147
147
|
|
|
148
|
+
const resourceLocation = SOURCE_PATH.resourceLocationProcessLogical;
|
|
149
|
+
const handlerType = HANDLER.hdrSqs;
|
|
150
|
+
|
|
151
|
+
const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.paginateProcessLogical)) +
|
|
152
|
+
upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
153
|
+
|
|
154
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole;
|
|
155
|
+
const upperFunctionName = upperCase(functionName);
|
|
156
|
+
const upperHandlerType = upperCase(handlerType);
|
|
157
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
158
|
+
const upperRoleName = upperCase(roleName);
|
|
159
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
160
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
161
|
+
|
|
148
162
|
// additionalResourcePermission.push(
|
|
149
163
|
// createIamRole(
|
|
150
164
|
// {
|
|
@@ -160,13 +174,17 @@ async function data(_izContext, allObjSchemas, appPath) {
|
|
|
160
174
|
templatePath: templatePath,
|
|
161
175
|
templateData: {
|
|
162
176
|
functionName: functionName,
|
|
163
|
-
resourceLocation
|
|
164
|
-
handlerType
|
|
177
|
+
resourceLocation,
|
|
178
|
+
handlerType,
|
|
165
179
|
additionalResourcePermission,
|
|
166
|
-
functionNameConfig
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
180
|
+
functionNameConfig,
|
|
181
|
+
roleName,
|
|
182
|
+
upperFunctionName,
|
|
183
|
+
upperHandlerType,
|
|
184
|
+
upperFunctionNameConfig,
|
|
185
|
+
upperRoleName,
|
|
186
|
+
handlerPath,
|
|
187
|
+
handlerPathUpperFunctionName
|
|
170
188
|
},
|
|
171
189
|
setting: {
|
|
172
190
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPath %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
|
-
#<#<%- functionName %><%-
|
|
7
|
-
#<#/<%- functionName %><%-
|
|
5
|
+
#<#<%- functionName %><%- upperHandlerType %>FunctionSetting#>
|
|
6
|
+
#<#/<%- functionName %><%- upperHandlerType %>FunctionSetting#>
|
|
8
7
|
events:
|
|
9
8
|
- sqs:
|
|
10
|
-
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%-
|
|
9
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- upperHandlerType %>
|
|
11
10
|
batchSize: 10
|
|
12
11
|
|
|
13
|
-
<%_ function firstLetterUpperCase(text){ return text.charAt(0).toUpperCase() + text.slice(1) } _%>
|
|
@@ -56,7 +56,10 @@ function data(
|
|
|
56
56
|
|
|
57
57
|
return {
|
|
58
58
|
templatePath: templatePathInv,
|
|
59
|
-
templateData: {
|
|
59
|
+
templateData: {
|
|
60
|
+
functionName,
|
|
61
|
+
upperFunctionName: upperCase(functionName)
|
|
62
|
+
},
|
|
60
63
|
setting: {
|
|
61
64
|
savePath: path.join(appPath, SOURCE_PATH.rbac),
|
|
62
65
|
saveFileName: fileName,
|
|
@@ -67,7 +67,8 @@ function data(
|
|
|
67
67
|
return {
|
|
68
68
|
templatePath,
|
|
69
69
|
templateData: {
|
|
70
|
-
functionName
|
|
70
|
+
functionName,
|
|
71
|
+
upperFunctionName: upperCase(functionName)
|
|
71
72
|
},
|
|
72
73
|
setting: {
|
|
73
74
|
savePath: path.join(appPath, SOURCE_PATH.rbac),
|
|
@@ -75,7 +76,7 @@ function data(
|
|
|
75
76
|
fileExtension: '.js',
|
|
76
77
|
isAppend: true
|
|
77
78
|
}
|
|
78
|
-
}
|
|
79
|
+
};
|
|
79
80
|
|
|
80
81
|
};
|
|
81
82
|
|
|
@@ -82,14 +82,17 @@ async function data(
|
|
|
82
82
|
templatePath,
|
|
83
83
|
templateData: {
|
|
84
84
|
functionName: functionName,
|
|
85
|
+
|
|
85
86
|
handlerPath: path.join(
|
|
86
87
|
SOURCE_PATH.resourceLocationRbac,
|
|
87
88
|
`${functionName}.main`
|
|
88
89
|
),
|
|
90
|
+
|
|
89
91
|
additionalResourcePermission,
|
|
90
92
|
roleName: "Authorization",
|
|
91
93
|
hookTagSetting: `${functionName}FunctionSetting`,
|
|
92
|
-
functionNameConfig: functionName
|
|
94
|
+
functionNameConfig: functionName,
|
|
95
|
+
upperFunctionName: upperCase(functionName)
|
|
93
96
|
},
|
|
94
97
|
setting: {
|
|
95
98
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- handlerPathUpperFunctionName %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %><%- upperHandlerType %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
|
-
#<#<%- functionName %><%-
|
|
7
|
-
#<#/<%- functionName %><%-
|
|
5
|
+
#<#<%- functionName %><%- upperHandlerType %>FunctionSetting#>
|
|
6
|
+
#<#/<%- functionName %><%- upperHandlerType %>FunctionSetting#>
|
|
8
7
|
<%_ if (handlerType === 'hdrDsq' || handlerType === 'hdrSqs') { _%>
|
|
9
8
|
events:
|
|
10
9
|
- sqs:
|
|
@@ -28,6 +27,3 @@
|
|
|
28
27
|
<%_ }) _%>
|
|
29
28
|
<%_ } _%>
|
|
30
29
|
|
|
31
|
-
<%_ function firstLetterUpperCase(text) {
|
|
32
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
33
|
-
} _%>
|
package/src/generators/fromObjectSchema/relationship/changeRelationship/action/functionYaml/yaml.js
CHANGED
|
@@ -150,17 +150,29 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
150
150
|
)
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
|
|
154
|
+
|
|
155
|
+
const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.changeRel)) +
|
|
156
|
+
upperCase(shortNameHandler(handlerType));
|
|
157
|
+
|
|
158
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipRole;
|
|
159
|
+
const upperFunctionName = upperCase(functionName);
|
|
160
|
+
const upperHandlerType = upperCase(handlerType);
|
|
161
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
162
|
+
const upperRoleName = upperCase(roleName);
|
|
163
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
164
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
165
|
+
|
|
153
166
|
return {
|
|
154
167
|
templatePath: templatePath,
|
|
155
168
|
templateData: {
|
|
156
169
|
functionName,
|
|
157
170
|
handlerType,
|
|
158
171
|
additionalResourcePermission,
|
|
159
|
-
resourceLocation
|
|
160
|
-
functionNameConfig
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
roleName: SOURCE_GENERATE_IAM_ROLE.RelationshipRole,
|
|
172
|
+
resourceLocation,
|
|
173
|
+
functionNameConfig,
|
|
174
|
+
roleName,
|
|
175
|
+
|
|
164
176
|
resourceApis: resourcesApi.map(api => ({
|
|
165
177
|
path: `/${serviceTag}/${api.event}/${api.action}`,
|
|
166
178
|
pathWithUser: `/${serviceTag}/${api.event}/${api.action}/{targetUserId}`,
|
|
@@ -168,7 +180,14 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
168
180
|
hookTagApp: `${upperCase(api.event)}AppLevelAuthorizer`,
|
|
169
181
|
hookTagUser: `${upperCase(api.event)}UserLevelAuthorizer`
|
|
170
182
|
})),
|
|
171
|
-
|
|
183
|
+
|
|
184
|
+
event,
|
|
185
|
+
upperFunctionName,
|
|
186
|
+
upperHandlerType,
|
|
187
|
+
upperFunctionNameConfig,
|
|
188
|
+
upperRoleName,
|
|
189
|
+
handlerPath,
|
|
190
|
+
handlerPathUpperFunctionName
|
|
172
191
|
},
|
|
173
192
|
setting: {
|
|
174
193
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/handler.js
CHANGED
|
@@ -59,7 +59,10 @@ function createParamForCreateSource(handler, srcPath) {
|
|
|
59
59
|
dsqTemplate,
|
|
60
60
|
invTemplate,
|
|
61
61
|
sqsTemplate,
|
|
62
|
-
handler
|
|
62
|
+
handler,
|
|
63
|
+
upperFunctionName: upperCase(functionName),
|
|
64
|
+
upperHandler: upperCase(handler),
|
|
65
|
+
upperQueueName: upperCase(queueName)
|
|
63
66
|
},
|
|
64
67
|
setting: {
|
|
65
68
|
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
import { middlewareHandler as middleware, validatorSchema, response } from "@izara_project/izara-middleware";
|
|
21
21
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
22
22
|
|
|
23
|
-
import <%- functionName %> from './<%-
|
|
23
|
+
import <%- functionName %> from './<%- upperFunctionName %>_Main.js'
|
|
24
24
|
|
|
25
25
|
// validate event params in middleware before into function
|
|
26
26
|
let validator = {
|
|
@@ -145,9 +145,6 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
145
145
|
return (response.failure(err));
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
|
-
<%_ function firstLetterUpperCase(text) {
|
|
149
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
150
|
-
} _%>
|
|
151
148
|
<%_ function firstLetterLowerCase(str) {
|
|
152
149
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
153
150
|
} _%>
|
|
@@ -22,7 +22,7 @@ import Logger from '@izara_project/izara-core-library-logger';
|
|
|
22
22
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
23
23
|
import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
|
|
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(
|
|
@@ -189,9 +189,6 @@ let validator = {
|
|
|
189
189
|
throw (err);
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
|
-
|
|
193
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
194
|
-
} _%>
|
|
195
|
-
<%_ function firstLetterLowerCase(str) {
|
|
192
|
+
<%_ function firstLetterLowerCase(str) {
|
|
196
193
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
197
194
|
} _%>
|
|
@@ -23,7 +23,7 @@ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow
|
|
|
23
23
|
//(<optionalRequire>)
|
|
24
24
|
//(</optionalRequire>)
|
|
25
25
|
|
|
26
|
-
import <%- functionName %> from './<%-
|
|
26
|
+
import <%- functionName %> from './<%- upperFunctionName %>_Main.js'
|
|
27
27
|
|
|
28
28
|
// validate event params in middlewware before into function.
|
|
29
29
|
let validator = {
|
|
@@ -129,13 +129,10 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
129
129
|
);
|
|
130
130
|
|
|
131
131
|
} catch (err) {
|
|
132
|
-
event._izContext.logger.error('Error, <%-
|
|
132
|
+
event._izContext.logger.error('Error, <%- upperFunctionName %><%- upperHandler %> : ', err);
|
|
133
133
|
throw (err);
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
-
<%_ function firstLetterUpperCase(text) {
|
|
137
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
138
|
-
} _%>
|
|
139
136
|
<%_ function firstLetterLowerCase(str) {
|
|
140
137
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
141
138
|
} _%>
|