@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
package/src/generators/fromObjectSchema/relationship/moveRelationship/action/functionYaml/yaml.js
CHANGED
|
@@ -153,17 +153,29 @@ function createParamForCreateSource(
|
|
|
153
153
|
|
|
154
154
|
const event = resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType));
|
|
155
155
|
|
|
156
|
+
const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
|
|
157
|
+
|
|
158
|
+
const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.moveRel)) +
|
|
159
|
+
upperCase(shortNameHandler(handlerType));
|
|
160
|
+
|
|
161
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipRole;
|
|
162
|
+
const upperFunctionName = upperCase(functionName);
|
|
163
|
+
const upperHandlerType = upperCase(handlerType);
|
|
164
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
165
|
+
const upperRoleName = upperCase(roleName);
|
|
166
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
167
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
168
|
+
|
|
156
169
|
return {
|
|
157
170
|
templatePath: templatePath,
|
|
158
171
|
templateData: {
|
|
159
172
|
functionName,
|
|
160
173
|
handlerType,
|
|
161
174
|
additionalResourcePermission,
|
|
162
|
-
resourceLocation
|
|
163
|
-
functionNameConfig
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
roleName: SOURCE_GENERATE_IAM_ROLE.RelationshipRole,
|
|
175
|
+
resourceLocation,
|
|
176
|
+
functionNameConfig,
|
|
177
|
+
roleName,
|
|
178
|
+
|
|
167
179
|
resourceApis: resourcesApi.map(api => ({
|
|
168
180
|
path: `/${serviceTag}/${api.event}/${api.action}`,
|
|
169
181
|
pathWithUser: `/${serviceTag}/${api.event}/${api.action}/{targetUserId}`,
|
|
@@ -171,7 +183,14 @@ function createParamForCreateSource(
|
|
|
171
183
|
hookTagApp: `${upperCase(api.event)}AppLevelAuthorizer`,
|
|
172
184
|
hookTagUser: `${upperCase(api.event)}UserLevelAuthorizer`
|
|
173
185
|
})),
|
|
174
|
-
|
|
186
|
+
|
|
187
|
+
event,
|
|
188
|
+
upperFunctionName,
|
|
189
|
+
upperHandlerType,
|
|
190
|
+
upperFunctionNameConfig,
|
|
191
|
+
upperRoleName,
|
|
192
|
+
handlerPath,
|
|
193
|
+
handlerPathUpperFunctionName
|
|
175
194
|
},
|
|
176
195
|
setting: {
|
|
177
196
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
package/src/generators/fromObjectSchema/relationship/moveRelationship/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 basicValidatorSchema = {
|
|
@@ -147,9 +147,6 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
147
147
|
return (response.failure(err));
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
-
<%_ function firstLetterUpperCase(text) {
|
|
151
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
152
|
-
} _%>
|
|
153
150
|
<%_ function firstLetterLowerCase(str) {
|
|
154
151
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
155
152
|
} _%>
|
|
@@ -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(
|
|
@@ -190,9 +190,6 @@ let basicValidatorSchema = {
|
|
|
190
190
|
throw (err);
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
|
-
|
|
194
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
195
|
-
} _%>
|
|
196
|
-
<%_ function firstLetterLowerCase(str) {
|
|
193
|
+
<%_ function firstLetterLowerCase(str) {
|
|
197
194
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
198
195
|
} _%>
|
|
@@ -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 basicValidatorSchema = {
|
|
@@ -131,13 +131,10 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
131
131
|
);
|
|
132
132
|
|
|
133
133
|
} catch (err) {
|
|
134
|
-
event._izContext.logger.error('Error, <%-
|
|
134
|
+
event._izContext.logger.error('Error, <%- upperFunctionName %><%- upperHandler %> : ', err);
|
|
135
135
|
throw (err);
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
|
-
<%_ function firstLetterUpperCase(text) {
|
|
139
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
140
|
-
} _%>
|
|
141
138
|
<%_ function firstLetterLowerCase(str) {
|
|
142
139
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
143
140
|
} _%>
|
|
@@ -25,7 +25,7 @@ import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record
|
|
|
25
25
|
//(<optionalRequire>)
|
|
26
26
|
//(</optionalRequire>)
|
|
27
27
|
|
|
28
|
-
import <%- functionName %> from './<%-
|
|
28
|
+
import <%- functionName %> from './<%- upperFunctionName %>_Main.js';
|
|
29
29
|
|
|
30
30
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
31
31
|
|
|
@@ -137,7 +137,7 @@ let basicValidatorSchema = {
|
|
|
137
137
|
// --- validate message (and MessageAttributes)
|
|
138
138
|
await recordHandlerSharedLib.validateRecord(
|
|
139
139
|
record, // one record will send to mainFunction
|
|
140
|
-
"<%-
|
|
140
|
+
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
141
141
|
basicValidatorSchema, // schema for record.Message
|
|
142
142
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
143
143
|
);
|
|
@@ -154,7 +154,7 @@ let basicValidatorSchema = {
|
|
|
154
154
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
155
155
|
record, // one record will send to mainFunction
|
|
156
156
|
<%- functionName %>, // mainFunction that need to invoke.
|
|
157
|
-
"<%-
|
|
157
|
+
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
158
158
|
passOnProperties, // all parameters that mainFunction needed.
|
|
159
159
|
);
|
|
160
160
|
record._izContext.logger.debug('after recordPromise in handler');
|
|
@@ -174,9 +174,6 @@ let basicValidatorSchema = {
|
|
|
174
174
|
throw (err);
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
|
-
|
|
178
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
179
|
-
} _%>
|
|
180
|
-
<%_ function firstLetterLowerCase(str) {
|
|
177
|
+
<%_ function firstLetterLowerCase(str) {
|
|
181
178
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
182
179
|
} _%>
|
package/src/generators/fromObjectSchema/relationship/moveRelationship/action/mainFunction/main.js
CHANGED
|
@@ -46,7 +46,8 @@ function createParamForCreateSource(srcPath) {
|
|
|
46
46
|
return {
|
|
47
47
|
templatePath: templatePath,
|
|
48
48
|
templateData: {
|
|
49
|
-
functionName
|
|
49
|
+
functionName,
|
|
50
|
+
upperFunctionName: upperCase(functionName)
|
|
50
51
|
},
|
|
51
52
|
setting: {
|
|
52
53
|
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
@@ -48,12 +48,9 @@
|
|
|
48
48
|
Action: "SQS:SendMessage"
|
|
49
49
|
Queues:
|
|
50
50
|
- Ref: <%- queueName %>HdrSqs
|
|
51
|
-
#<#<%-
|
|
52
|
-
#<#/<%-
|
|
51
|
+
#<#<%- queueName %>QueueSetting#>
|
|
52
|
+
#<#/<%- queueName %>QueueSetting#>
|
|
53
53
|
|
|
54
|
-
<%_ function firstLetterUpperCase(text){
|
|
55
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
56
|
-
} _%>
|
|
57
54
|
<%_ function firstLetterLowerCase(str) {
|
|
58
55
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
59
56
|
} _%>
|
|
@@ -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
|
-
<%_ function firstLetterUpperCase(text){
|
|
39
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
40
|
-
} _%>
|
|
41
38
|
<%_ function firstLetterLowerCase(str) {
|
|
42
39
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
43
40
|
} _%>
|
|
@@ -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
|
-
#<#<%- 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}<%-
|
|
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
|
} _%>
|
package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/functionYaml/yaml.js
CHANGED
|
@@ -96,17 +96,35 @@ function createParamForCreateSource(srcPath) {
|
|
|
96
96
|
|
|
97
97
|
additionalResourcePermission.push(awaitingMultipleStepsRole());
|
|
98
98
|
|
|
99
|
+
const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
|
|
100
|
+
|
|
101
|
+
const functionNameConfig = upperCase(
|
|
102
|
+
SHORT_FUNCTION_NAME(FUNCTION_NAME.moveRelComplete)
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipCompleteRole;
|
|
106
|
+
const upperFunctionName = upperCase(functionName);
|
|
107
|
+
const upperHandlerType = upperCase(handlerType);
|
|
108
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
109
|
+
const upperRoleName = upperCase(roleName);
|
|
110
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
111
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
112
|
+
|
|
99
113
|
return {
|
|
100
114
|
templatePath: templatePath,
|
|
101
115
|
templateData: {
|
|
102
116
|
functionName,
|
|
103
117
|
handlerType,
|
|
104
118
|
additionalResourcePermission,
|
|
105
|
-
resourceLocation
|
|
106
|
-
functionNameConfig
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
resourceLocation,
|
|
120
|
+
functionNameConfig,
|
|
121
|
+
roleName,
|
|
122
|
+
upperFunctionName,
|
|
123
|
+
upperHandlerType,
|
|
124
|
+
upperFunctionNameConfig,
|
|
125
|
+
upperRoleName,
|
|
126
|
+
handlerPath,
|
|
127
|
+
handlerPathUpperFunctionName
|
|
110
128
|
},
|
|
111
129
|
setting: {
|
|
112
130
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/mainFunction/main.js
CHANGED
|
@@ -45,7 +45,8 @@ function createParamForCreateSource(srcPath) {
|
|
|
45
45
|
return {
|
|
46
46
|
templatePath: templatePath,
|
|
47
47
|
templateData: {
|
|
48
|
-
functionName
|
|
48
|
+
functionName,
|
|
49
|
+
upperFunctionName: upperCase(functionName)
|
|
49
50
|
},
|
|
50
51
|
setting: {
|
|
51
52
|
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
@@ -34,13 +34,10 @@
|
|
|
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
|
} _%>
|
package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/snsOut.js
CHANGED
|
@@ -47,10 +47,13 @@ function createDefaultSnsOut(_izContext, srcPath) {
|
|
|
47
47
|
|
|
48
48
|
function createParamsForCreateSource(_izContext, srcPath) {
|
|
49
49
|
let queueName = FUNCTION_NAME.moveRelComplete;
|
|
50
|
+
queueName = upperCase(queueName);
|
|
51
|
+
const upperQueueName = upperCase(queueName);
|
|
50
52
|
return {
|
|
51
53
|
templatePath: templatePath,
|
|
52
54
|
templateData: {
|
|
53
|
-
queueName
|
|
55
|
+
queueName,
|
|
56
|
+
upperQueueName
|
|
54
57
|
},
|
|
55
58
|
setting: {
|
|
56
59
|
initialData: 'Resources:\n',
|
package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/template.ejs
CHANGED
|
@@ -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
|
+
|
package/src/generators/fromObjectSchema/relationship/update/action/functionYaml/template.ejs
CHANGED
|
@@ -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
|
-
} _%>
|
|
@@ -183,17 +183,29 @@ function createParamForCreateSource(
|
|
|
183
183
|
|
|
184
184
|
const event = resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType));
|
|
185
185
|
|
|
186
|
+
const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
|
|
187
|
+
|
|
188
|
+
const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.updateRel)) +
|
|
189
|
+
upperCase(shortNameHandler(handlerType));
|
|
190
|
+
|
|
191
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipRole;
|
|
192
|
+
const upperFunctionName = upperCase(functionName);
|
|
193
|
+
const upperHandlerType = upperCase(handlerType);
|
|
194
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
195
|
+
const upperRoleName = upperCase(roleName);
|
|
196
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
197
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
198
|
+
|
|
186
199
|
return {
|
|
187
200
|
templatePath: templatePath,
|
|
188
201
|
templateData: {
|
|
189
202
|
functionName,
|
|
190
203
|
handlerType,
|
|
191
204
|
additionalResourcePermission,
|
|
192
|
-
resourceLocation
|
|
193
|
-
functionNameConfig
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
roleName: SOURCE_GENERATE_IAM_ROLE.RelationshipRole,
|
|
205
|
+
resourceLocation,
|
|
206
|
+
functionNameConfig,
|
|
207
|
+
roleName,
|
|
208
|
+
|
|
197
209
|
resourceApis: resourcesApi.map(api => ({
|
|
198
210
|
path: `/${serviceTag}/${api.event}/${api.action}`,
|
|
199
211
|
pathWithUser: `/${serviceTag}/${api.event}/${api.action}/{targetUserId}`,
|
|
@@ -201,7 +213,14 @@ function createParamForCreateSource(
|
|
|
201
213
|
hookTagApp: `${upperCase(api.event)}AppLevelAuthorizer`,
|
|
202
214
|
hookTagUser: `${upperCase(api.event)}UserLevelAuthorizer`
|
|
203
215
|
})),
|
|
204
|
-
|
|
216
|
+
|
|
217
|
+
event,
|
|
218
|
+
upperFunctionName,
|
|
219
|
+
upperHandlerType,
|
|
220
|
+
upperFunctionNameConfig,
|
|
221
|
+
upperRoleName,
|
|
222
|
+
handlerPath,
|
|
223
|
+
handlerPathUpperFunctionName
|
|
205
224
|
},
|
|
206
225
|
setting: {
|
|
207
226
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -60,7 +60,10 @@ function createParamForCreateSource(handler, srcPath) {
|
|
|
60
60
|
dsqTemplate,
|
|
61
61
|
invTemplate,
|
|
62
62
|
sqsTemplate,
|
|
63
|
-
handler
|
|
63
|
+
handler,
|
|
64
|
+
upperFunctionName: upperCase(functionName),
|
|
65
|
+
upperHandler: upperCase(handler),
|
|
66
|
+
upperQueueName: upperCase(queueName)
|
|
64
67
|
},
|
|
65
68
|
setting: {
|
|
66
69
|
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, 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 middlewareHandler before into function
|
|
26
26
|
let basicValidatorSchema = {
|
|
@@ -126,9 +126,6 @@ export const main = middlewareHandler.wrap(async (event, context) => {
|
|
|
126
126
|
return (response.failure(err));
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
|
-
<%_ function firstLetterUpperCase(text) {
|
|
130
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
131
|
-
} _%>
|
|
132
129
|
<%_ function firstLetterLowerCase(str) {
|
|
133
130
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
134
131
|
} _%>
|
|
@@ -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(
|
|
@@ -168,9 +168,6 @@ let basicValidatorSchema = {
|
|
|
168
168
|
throw (err);
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
|
-
|
|
172
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
173
|
-
} _%>
|
|
174
|
-
<%_ function firstLetterLowerCase(str) {
|
|
171
|
+
<%_ function firstLetterLowerCase(str) {
|
|
175
172
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
176
173
|
} _%>
|
|
@@ -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 middleware before into function.
|
|
29
29
|
let basicValidatorSchema = {
|
|
@@ -108,13 +108,10 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
108
108
|
);
|
|
109
109
|
|
|
110
110
|
} catch (err) {
|
|
111
|
-
event._izContext.logger.error('Error, <%-
|
|
111
|
+
event._izContext.logger.error('Error, <%- upperFunctionName %><%- upperHandler %> : ', err);
|
|
112
112
|
throw (err);
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
-
<%_ function firstLetterUpperCase(text) {
|
|
116
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
117
|
-
} _%>
|
|
118
115
|
<%_ function firstLetterLowerCase(str) {
|
|
119
116
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
120
117
|
} _%>
|
|
@@ -26,7 +26,7 @@ import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record
|
|
|
26
26
|
//(<optionalRequire>)
|
|
27
27
|
//(</optionalRequire>)
|
|
28
28
|
|
|
29
|
-
import <%- functionName %> from './<%-
|
|
29
|
+
import <%- functionName %> from './<%- upperFunctionName %>_Main.js';
|
|
30
30
|
|
|
31
31
|
middlewareHandler.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
32
32
|
|
|
@@ -161,9 +161,6 @@ export const main = middlewareHandler.wrap(async (event, context, callback) => {
|
|
|
161
161
|
throw err;
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
<%_ function firstLetterUpperCase(text) {
|
|
165
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
166
|
-
} _%>
|
|
167
164
|
<%_ function firstLetterLowerCase(str) {
|
|
168
165
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
169
166
|
} _%>
|
|
@@ -47,7 +47,8 @@ function createParamForCreateSource(srcPath) {
|
|
|
47
47
|
return {
|
|
48
48
|
templatePath: templatePath,
|
|
49
49
|
templateData: {
|
|
50
|
-
functionName: functionName
|
|
50
|
+
functionName: functionName,
|
|
51
|
+
upperFunctionName: upperCase(functionName)
|
|
51
52
|
},
|
|
52
53
|
setting: {
|
|
53
54
|
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/snsTemplate.ejs
CHANGED
|
@@ -48,12 +48,9 @@
|
|
|
48
48
|
Action: "SQS:SendMessage"
|
|
49
49
|
Queues:
|
|
50
50
|
- Ref: <%- queueName %>HdrSqs
|
|
51
|
-
#<#<%-
|
|
52
|
-
#<#/<%-
|
|
51
|
+
#<#<%- queueName %>QueueSetting#>
|
|
52
|
+
#<#/<%- queueName %>QueueSetting#>
|
|
53
53
|
|
|
54
|
-
<%_ function firstLetterUpperCase(text){
|
|
55
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
56
|
-
} _%>
|
|
57
54
|
<%_ function firstLetterLowerCase(str) {
|
|
58
55
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
59
56
|
} _%>
|
package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/sqsTemplate.ejs
CHANGED
|
@@ -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
|
-
<%_ function firstLetterUpperCase(text){
|
|
39
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
40
|
-
} _%>
|
|
41
38
|
<%_ function firstLetterLowerCase(str) {
|
|
42
39
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
43
40
|
} _%>
|
package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/template.ejs
CHANGED
|
@@ -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
|
-
#<#<%- 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}<%-
|
|
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
|
} _%>
|
|
@@ -97,17 +97,35 @@ function createParamForCreateSource(srcPath) {
|
|
|
97
97
|
|
|
98
98
|
additionalResourcePermission.push(awaitingMultipleStepsRole());
|
|
99
99
|
|
|
100
|
+
const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
|
|
101
|
+
|
|
102
|
+
const functionNameConfig = upperCase(
|
|
103
|
+
SHORT_FUNCTION_NAME(FUNCTION_NAME.updateRelComplete)
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipCompleteRole;
|
|
107
|
+
const upperFunctionName = upperCase(functionName);
|
|
108
|
+
const upperHandlerType = upperCase(handlerType);
|
|
109
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
110
|
+
const upperRoleName = upperCase(roleName);
|
|
111
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
112
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
113
|
+
|
|
100
114
|
return {
|
|
101
115
|
templatePath: templatePath,
|
|
102
116
|
templateData: {
|
|
103
117
|
functionName,
|
|
104
118
|
handlerType,
|
|
105
119
|
additionalResourcePermission,
|
|
106
|
-
resourceLocation
|
|
107
|
-
functionNameConfig
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
resourceLocation,
|
|
121
|
+
functionNameConfig,
|
|
122
|
+
roleName,
|
|
123
|
+
upperFunctionName,
|
|
124
|
+
upperHandlerType,
|
|
125
|
+
upperFunctionNameConfig,
|
|
126
|
+
upperRoleName,
|
|
127
|
+
handlerPath,
|
|
128
|
+
handlerPathUpperFunctionName
|
|
111
129
|
},
|
|
112
130
|
setting: {
|
|
113
131
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|