@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
package/fix_array.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import glob from 'glob';
|
|
3
|
+
|
|
4
|
+
const files = glob.sync('src/generators/**/*.js');
|
|
5
|
+
for (const file of files) {
|
|
6
|
+
let content = fs.readFileSync(file, 'utf8');
|
|
7
|
+
let changed = false;
|
|
8
|
+
|
|
9
|
+
// Let's just find any place where templateData is assigned an object and inject the upper variables if they are missing but they are present in the base variables.
|
|
10
|
+
// Actually, wait, it's easier to just find the EJS files that have upperQueueName etc. and see if they are missing in the JS.
|
|
11
|
+
}
|
package/fix_imports.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
function walkDir(dir, callback) {
|
|
5
|
+
fs.readdirSync(dir).forEach(f => {
|
|
6
|
+
const dirPath = path.join(dir, f);
|
|
7
|
+
const isDirectory = fs.statSync(dirPath).isDirectory();
|
|
8
|
+
isDirectory ? walkDir(dirPath, callback) : callback(dirPath);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
walkDir('src/generators', (filePath) => {
|
|
13
|
+
if (!filePath.endsWith('.js')) return;
|
|
14
|
+
let content = fs.readFileSync(filePath, 'utf8');
|
|
15
|
+
|
|
16
|
+
if (content.includes('upperCase(')) {
|
|
17
|
+
let changed = false;
|
|
18
|
+
if (!content.includes('firstLetterUpperCase: upperCase') && !content.includes('upperCase =')) {
|
|
19
|
+
// Need to import upperCase
|
|
20
|
+
if (!content.includes('#libs/Utils.js')) {
|
|
21
|
+
// Find where to insert
|
|
22
|
+
content = content.replace(/(import consts from '#libs\/Consts\.js';)/, "$1\nimport utils from '#libs/Utils.js';\nconst { firstLetterUpperCase: upperCase } = utils;");
|
|
23
|
+
} else {
|
|
24
|
+
content = content.replace(/(import utils from '#libs\/Utils\.js';\n)/, "$1const { firstLetterUpperCase: upperCase } = utils;\n");
|
|
25
|
+
}
|
|
26
|
+
changed = true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (changed) {
|
|
30
|
+
// just to be super safe against multiple definitions or if my regex failed:
|
|
31
|
+
if (!content.includes('firstLetterUpperCase: upperCase')) {
|
|
32
|
+
// If regex failed, just prepend it after imports
|
|
33
|
+
const importsEnd = content.lastIndexOf('import ');
|
|
34
|
+
const eol = content.indexOf('\n', importsEnd);
|
|
35
|
+
content = content.slice(0, eol+1) + "\nimport utils from '#libs/Utils.js';\nconst { firstLetterUpperCase: upperCase } = utils;\n" + content.slice(eol+1);
|
|
36
|
+
}
|
|
37
|
+
fs.writeFileSync(filePath, content, 'utf8');
|
|
38
|
+
console.log('Fixed imports in', filePath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
package/fix_upper.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
function walkDir(dir, callback) {
|
|
5
|
+
fs.readdirSync(dir).forEach(f => {
|
|
6
|
+
const dirPath = path.join(dir, f);
|
|
7
|
+
const isDirectory = fs.statSync(dirPath).isDirectory();
|
|
8
|
+
isDirectory ? walkDir(dirPath, callback) : callback(dirPath);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
walkDir('src/generators', (filePath) => {
|
|
13
|
+
if (!filePath.endsWith('.ejs')) return;
|
|
14
|
+
let content = fs.readFileSync(filePath, 'utf8');
|
|
15
|
+
let changed = false;
|
|
16
|
+
|
|
17
|
+
if (content.includes('upperQueueName')) {
|
|
18
|
+
content = content.replace(/upperQueueName/g, 'queueName');
|
|
19
|
+
changed = true;
|
|
20
|
+
}
|
|
21
|
+
if (content.includes('upperTableName')) {
|
|
22
|
+
content = content.replace(/upperTableName/g, 'tableName');
|
|
23
|
+
changed = true;
|
|
24
|
+
}
|
|
25
|
+
if (content.includes('upperRoleNameConfig')) {
|
|
26
|
+
content = content.replace(/upperRoleNameConfig/g, 'roleNameConfig');
|
|
27
|
+
changed = true;
|
|
28
|
+
}
|
|
29
|
+
if (content.includes('upperFunctionNameConfig')) {
|
|
30
|
+
content = content.replace(/upperFunctionNameConfig/g, 'functionNameConfig');
|
|
31
|
+
changed = true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (changed) {
|
|
35
|
+
fs.writeFileSync(filePath, content, 'utf8');
|
|
36
|
+
console.log('Fixed', filePath);
|
|
37
|
+
}
|
|
38
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-core-generate-service-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
4
4
|
"description": "Code for locally generating per service files",
|
|
5
5
|
"homepage": "https://bitbucket.org/izara-core-support-services/izara-core-support-services-generate-service-code#readme",
|
|
6
6
|
"repository": {
|
package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/template.ejs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# for createIamRole
|
|
2
2
|
|
|
3
3
|
<% functionNameConfigs.forEach(functionNameConfig => { _%>
|
|
4
|
-
- ${self:custom.iz_prefixIamRole}<%-
|
|
4
|
+
- ${self:custom.iz_prefixIamRole}<%- functionNameConfig %>${self:custom.iz_suffixIamRole}
|
|
5
5
|
<% }) _%>
|
|
6
6
|
|
|
7
7
|
# for createIntTest
|
|
8
8
|
<% functionNameConfigs.forEach(functionNameConfig => { _%>
|
|
9
|
-
"<%-
|
|
9
|
+
"<%- functionNameConfig %>",
|
|
10
10
|
<% }) _%>
|
|
11
11
|
|
|
12
12
|
<%_function firstLetterUpperCase(text) {
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
export function generatedIntTestRoleNameConfig () {
|
|
21
21
|
let roleNameConfigIntTest = [
|
|
22
22
|
<% roleNameConfigs.forEach(roleNameConfig => { _%>
|
|
23
|
-
"<%-
|
|
23
|
+
"<%- roleNameConfig %>",
|
|
24
24
|
<% }) _%>
|
|
25
25
|
]
|
|
26
26
|
return roleNameConfigIntTest
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# for createIamRole
|
|
2
2
|
|
|
3
3
|
<% roleNameConfigs.forEach(roleNameConfig => { _%>
|
|
4
|
-
- arn:aws:iam::${self:custom.iz_accountId}:role/${self:custom.iz_resourcePrefix}<%-
|
|
4
|
+
- arn:aws:iam::${self:custom.iz_accountId}:role/${self:custom.iz_resourcePrefix}<%- roleNameConfig %>
|
|
5
5
|
<% }) _%>
|
|
6
6
|
|
|
7
7
|
|
|
@@ -145,12 +145,16 @@ function createSourceParams(_izContext, flowSchema, appPath) {
|
|
|
145
145
|
flowSchema.flowTag,
|
|
146
146
|
'source/'
|
|
147
147
|
),
|
|
148
|
+
|
|
148
149
|
functionName,
|
|
149
150
|
functionNameConfig: functionNameConfig,
|
|
150
151
|
additionalResourcePermission,
|
|
151
152
|
roleName: SOURCE_GENERATE_IAM_ROLE.EventBridge,
|
|
152
153
|
handlerType,
|
|
153
|
-
schedules
|
|
154
|
+
schedules,
|
|
155
|
+
upperFunctionName: upperCase(functionName),
|
|
156
|
+
upperHandlerType: upperCase(handlerType),
|
|
157
|
+
upperFunctionNameConfig: upperCase(functionNameConfig)
|
|
154
158
|
},
|
|
155
159
|
setting: {
|
|
156
160
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -47,11 +47,15 @@ function data(_izContext, flowSchema, appPath) {
|
|
|
47
47
|
templateData: {
|
|
48
48
|
functionName: functionName,
|
|
49
49
|
flowTag: upperCase(flowTag),
|
|
50
|
+
|
|
50
51
|
// flowTag: ,
|
|
51
52
|
// action: action,
|
|
52
|
-
handler
|
|
53
53
|
// roleName: SOURCE_GENERATE_IAM_ROLE.EventBridge,
|
|
54
54
|
// firstLetterUpperCase: upperCase,
|
|
55
|
+
handler,
|
|
56
|
+
|
|
57
|
+
upperFunctionName: upperCase(functionName),
|
|
58
|
+
upperHandler: upperCase(handler)
|
|
55
59
|
},
|
|
56
60
|
setting: {
|
|
57
61
|
savePath: path.join(
|
|
@@ -38,17 +38,27 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
38
38
|
function data(_izContext, flowSchema, appPath) {
|
|
39
39
|
// const handler = HANDLER.hdrInv;
|
|
40
40
|
const flowTag = flowSchema.flowTag;
|
|
41
|
+
const functionName = 'EventBridge';
|
|
42
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.EventBridge;
|
|
43
|
+
const upperFunctionName = upperCase(functionName);
|
|
44
|
+
const upperRoleName = upperCase(roleName);
|
|
45
|
+
const upperFlowTag = upperCase(flowTag);
|
|
41
46
|
// const functionName = "EventBridge" + upperCase(handler);
|
|
42
47
|
// const action = SOURCE_GENERATE_IAM_ROLE.EventBridge;
|
|
43
48
|
// const fileName = `${upperCase(flowTag)}${upperCase(action)}_Main`;
|
|
44
49
|
return {
|
|
45
50
|
templatePath: templatePath,
|
|
46
51
|
templateData: {
|
|
47
|
-
functionName
|
|
52
|
+
functionName,
|
|
48
53
|
flowTag: flowTag,
|
|
49
|
-
roleName
|
|
54
|
+
roleName,
|
|
55
|
+
|
|
50
56
|
// action: action,
|
|
51
|
-
firstLetterUpperCase: upperCase
|
|
57
|
+
firstLetterUpperCase: upperCase,
|
|
58
|
+
|
|
59
|
+
upperFunctionName,
|
|
60
|
+
upperRoleName,
|
|
61
|
+
upperFlowTag
|
|
52
62
|
},
|
|
53
63
|
setting: {
|
|
54
64
|
savePath: path.join(
|
|
@@ -53,7 +53,7 @@ export default async function <%- functionName %>Main(
|
|
|
53
53
|
//(</eventBridgeHook>)
|
|
54
54
|
|
|
55
55
|
} catch (err) {
|
|
56
|
-
_izContext.logger.error('error <%-
|
|
56
|
+
_izContext.logger.error('error <%- upperFunctionName %>Main: ', err)
|
|
57
57
|
throw (err)
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -137,10 +137,15 @@ async function createSourceParams(_izContext, flowSchema, appPath) {
|
|
|
137
137
|
handlerType,
|
|
138
138
|
additionalResourcePermission,
|
|
139
139
|
route,
|
|
140
|
+
|
|
140
141
|
functionNameConfig:
|
|
141
142
|
upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
143
|
+
|
|
142
144
|
roleName: upperCase(flowSchema.flowTag),
|
|
143
|
-
queueName
|
|
145
|
+
queueName,
|
|
146
|
+
upperFunctionName: upperCase(functionName),
|
|
147
|
+
upperHandlerType: upperCase(handlerType),
|
|
148
|
+
upperQueueName: upperCase(queueName)
|
|
144
149
|
},
|
|
145
150
|
setting: {
|
|
146
151
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -45,7 +45,10 @@ function createSourceParams(_izContext, flowSchema, appPath) {
|
|
|
45
45
|
templateData: {
|
|
46
46
|
functionName,
|
|
47
47
|
handlerType,
|
|
48
|
-
queueName
|
|
48
|
+
queueName,
|
|
49
|
+
upperFunctionName: upperCase(functionName),
|
|
50
|
+
upperHandlerType: upperCase(handlerType),
|
|
51
|
+
upperQueueName: upperCase(queueName)
|
|
49
52
|
},
|
|
50
53
|
setting: {
|
|
51
54
|
savePath: path.join(
|
|
@@ -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
|
|
|
@@ -62,14 +62,19 @@ function createSourceParamsApi(_izContext, flowSchema, appPath) {
|
|
|
62
62
|
// 'source/'
|
|
63
63
|
// ),
|
|
64
64
|
savePath.flowSchemaFlowTag(flowSchema.flowTag),
|
|
65
|
+
|
|
65
66
|
functionName,
|
|
66
67
|
handlerType,
|
|
67
68
|
additionalResourcePermission,
|
|
69
|
+
|
|
68
70
|
functionNameConfig:
|
|
69
71
|
upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
72
|
+
|
|
70
73
|
roleName: upperCase(flowSchema.flowTag),
|
|
71
74
|
event: 'post',
|
|
72
|
-
serviceTag: serviceTag
|
|
75
|
+
serviceTag: serviceTag,
|
|
76
|
+
upperFunctionName: upperCase(functionName),
|
|
77
|
+
upperHandlerType: upperCase(handlerType)
|
|
73
78
|
},
|
|
74
79
|
setting: {
|
|
75
80
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -43,9 +43,13 @@ function createSourceParamsApi(_izContext, flowSchema, appPath) {
|
|
|
43
43
|
templatePath: templatePath,
|
|
44
44
|
templateData: {
|
|
45
45
|
functionName,
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
// propertyNames,
|
|
48
48
|
// properties
|
|
49
|
+
handlerType,
|
|
50
|
+
|
|
51
|
+
upperFunctionName: upperCase(functionName),
|
|
52
|
+
upperHandlerType: upperCase(handlerType)
|
|
49
53
|
},
|
|
50
54
|
setting: {
|
|
51
55
|
savePath: path.join(
|
|
@@ -54,11 +54,15 @@ function createSourceParamsInvoke(_izContext, flowSchema, appPath) {
|
|
|
54
54
|
// 'source/'
|
|
55
55
|
// ),
|
|
56
56
|
savePath.flowSchemaFlowTag(flowSchema.flowTag),
|
|
57
|
+
|
|
57
58
|
handlerType,
|
|
58
59
|
additionalResourcePermission,
|
|
60
|
+
|
|
59
61
|
functionNameConfig:
|
|
60
62
|
upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
61
|
-
|
|
63
|
+
|
|
64
|
+
roleName: upperCase(flowSchema.flowTag),
|
|
65
|
+
upperHandlerType: upperCase(handlerType)
|
|
62
66
|
},
|
|
63
67
|
setting: {
|
|
64
68
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -43,7 +43,9 @@ function createSourceParamsInvoke(_izContext, flowSchema, appPath) {
|
|
|
43
43
|
templatePath: templatePath,
|
|
44
44
|
templateData: {
|
|
45
45
|
functionName,
|
|
46
|
-
handlerType
|
|
46
|
+
handlerType,
|
|
47
|
+
upperFunctionName: upperCase(functionName),
|
|
48
|
+
upperHandlerType: upperCase(handlerType)
|
|
47
49
|
},
|
|
48
50
|
setting: {
|
|
49
51
|
savePath: path.join(
|
|
@@ -160,9 +160,13 @@ async function createSourceParams(_izContext, flowSchema, appPath) {
|
|
|
160
160
|
templateData: {
|
|
161
161
|
...baseTemplateData,
|
|
162
162
|
handlerType,
|
|
163
|
+
|
|
163
164
|
functionNameConfig:
|
|
164
165
|
upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
165
|
-
|
|
166
|
+
|
|
167
|
+
queueName,
|
|
168
|
+
upperHandlerType: upperCase(handlerType),
|
|
169
|
+
upperQueueName: upperCase(queueName)
|
|
166
170
|
},
|
|
167
171
|
setting: setting
|
|
168
172
|
});
|
|
@@ -48,7 +48,9 @@ function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
|
48
48
|
templateData: {
|
|
49
49
|
functionName,
|
|
50
50
|
handlerType: handlerTypeSqs,
|
|
51
|
-
queueName
|
|
51
|
+
queueName,
|
|
52
|
+
upperFunctionName: upperCase(functionName),
|
|
53
|
+
upperQueueName: upperCase(queueName)
|
|
52
54
|
},
|
|
53
55
|
setting: {
|
|
54
56
|
savePath: path.join(
|
|
@@ -70,7 +72,8 @@ function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
|
70
72
|
templateData: {
|
|
71
73
|
functionName,
|
|
72
74
|
handlerType: handlerTypeDsq,
|
|
73
|
-
queueName: `${upperCase(flowSchema.flowTag)}${handlerTypeDsq}
|
|
75
|
+
queueName: `${upperCase(flowSchema.flowTag)}${handlerTypeDsq}`,
|
|
76
|
+
upperFunctionName: upperCase(functionName)
|
|
74
77
|
},
|
|
75
78
|
setting: {
|
|
76
79
|
savePath: path.join(
|
|
@@ -45,7 +45,9 @@ function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
|
45
45
|
templateData: {
|
|
46
46
|
functionName,
|
|
47
47
|
handlerType,
|
|
48
|
-
route
|
|
48
|
+
route,
|
|
49
|
+
upperFunctionName: upperCase(functionName),
|
|
50
|
+
upperHandlerType: upperCase(handlerType)
|
|
49
51
|
},
|
|
50
52
|
setting: {
|
|
51
53
|
savePath: path.join(
|
|
@@ -66,6 +66,7 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
66
66
|
{
|
|
67
67
|
taskKey: `${createFlowTypeConcat(event._izContext, { flowTag: "<%- route %>", serviceTag: process.env.iz_serviceTag })}${identifiers}`,
|
|
68
68
|
connectionId: connectionId,
|
|
69
|
+
ttl: 600
|
|
69
70
|
}
|
|
70
71
|
)
|
|
71
72
|
|
|
@@ -80,7 +81,6 @@ export const main = middleware.wrap(async (event, context) => {
|
|
|
80
81
|
)
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
|
|
84
84
|
let callingFlow = eventParams?.callingFlow ? eventParams.callingFlow : {};
|
|
85
85
|
await <%- functionName %>(
|
|
86
86
|
event._izContext,
|
|
@@ -45,7 +45,8 @@ function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
|
45
45
|
templateData: {
|
|
46
46
|
topicArn,
|
|
47
47
|
flowTag: flowSchema.flowTag,
|
|
48
|
-
functionName
|
|
48
|
+
functionName,
|
|
49
|
+
upperFunctionName: upperCase(functionName)
|
|
49
50
|
},
|
|
50
51
|
setting: {
|
|
51
52
|
savePath: path.join(
|
|
@@ -99,7 +99,9 @@ async function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
|
99
99
|
tableName,
|
|
100
100
|
flowSchemaComplete,
|
|
101
101
|
triggerType,
|
|
102
|
-
queueName: `${createFlowTypeConcat(_izContext, { serviceTag: getLocalConfig('iz_serviceTag'), flowTag: upperCase(flowSchema.flowTag) })}_Main
|
|
102
|
+
queueName: `${createFlowTypeConcat(_izContext, { serviceTag: getLocalConfig('iz_serviceTag'), flowTag: upperCase(flowSchema.flowTag) })}_Main`,
|
|
103
|
+
upperFunctionName: upperCase(functionName),
|
|
104
|
+
upperTableName: upperCase(tableName)
|
|
103
105
|
},
|
|
104
106
|
setting: {
|
|
105
107
|
savePath:
|
package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/functionYaml/template.ejs
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
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
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 %><%- upperHandlerType %>"]}}} # 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
|
-
} _%>
|
|
@@ -101,21 +101,32 @@ function createSourceParams(_izContext, flowSchema, appPath) {
|
|
|
101
101
|
)
|
|
102
102
|
);
|
|
103
103
|
|
|
104
|
+
const resourceLocation = path.join(
|
|
105
|
+
SOURCE_PATH.resourceLocationWebSocket,
|
|
106
|
+
flowSchema.flowTag,
|
|
107
|
+
'source/'
|
|
108
|
+
);
|
|
109
|
+
const functionNameConfig = functionName + upperCase(handlerType);
|
|
110
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
111
|
+
const upperFunctionName = upperCase(functionName);
|
|
112
|
+
const upperHandlerType = upperCase(handlerType);
|
|
113
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
114
|
+
const upperRoleName = upperCase(SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role);
|
|
115
|
+
|
|
104
116
|
return {
|
|
105
117
|
templatePath: templatePath,
|
|
106
118
|
templateData: {
|
|
107
119
|
functionName,
|
|
108
120
|
handlerType,
|
|
109
|
-
|
|
110
|
-
resourceLocation: path.join(
|
|
111
|
-
SOURCE_PATH.resourceLocationWebSocket,
|
|
112
|
-
flowSchema.flowTag,
|
|
113
|
-
'source/'
|
|
114
|
-
),
|
|
121
|
+
resourceLocation,
|
|
115
122
|
additionalResourcePermission,
|
|
116
|
-
functionNameConfig
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
functionNameConfig,
|
|
124
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role,
|
|
125
|
+
upperFunctionNameConfig,
|
|
126
|
+
handlerPath,
|
|
127
|
+
upperHandlerType,
|
|
128
|
+
upperFunctionName,
|
|
129
|
+
upperRoleName
|
|
119
130
|
},
|
|
120
131
|
setting: {
|
|
121
132
|
saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
|
|
@@ -44,7 +44,9 @@ function createSourceParams(_izContext, flowSchema, appPath) {
|
|
|
44
44
|
templatePath: templatePath,
|
|
45
45
|
templateData: {
|
|
46
46
|
functionName,
|
|
47
|
-
handlerType
|
|
47
|
+
handlerType,
|
|
48
|
+
upperFunctionName: upperCase(functionName),
|
|
49
|
+
upperHandlerType: upperCase(handlerType)
|
|
48
50
|
},
|
|
49
51
|
setting: {
|
|
50
52
|
saveFileName: `${functionName}_${handlerType}`,
|
|
@@ -34,12 +34,9 @@
|
|
|
34
34
|
Action: "SQS:SendMessage"
|
|
35
35
|
Queues:
|
|
36
36
|
- Ref: <%- queueName %>HdrSqs
|
|
37
|
-
#<#<%-
|
|
38
|
-
#<#/<%-
|
|
37
|
+
#<#<%- queueName %>QueueSetting#>
|
|
38
|
+
#<#/<%- queueName %>QueueSetting#>
|
|
39
39
|
|
|
40
|
-
<%_ function firstLetterUpperCase(text){
|
|
41
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
42
|
-
} _%>
|
|
43
40
|
<%_ function firstLetterLowerCase(str) {
|
|
44
41
|
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
45
42
|
} _%>
|
package/src/generators/fromFlowSchema/events/s3/upload/createObject/functionYaml/template.ejs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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
5
|
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
6
|
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
@@ -12,9 +11,6 @@
|
|
|
12
11
|
route: <%- route %>
|
|
13
12
|
# authorizer: ${self:custom.iz_authorizerAppLevel}
|
|
14
13
|
# identifierResource: 'route.request.header.Auth'
|
|
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
|
} _%>
|
|
@@ -89,21 +89,37 @@ function createSourceParams(_izContext, flowSchema, appPath) {
|
|
|
89
89
|
)
|
|
90
90
|
);
|
|
91
91
|
|
|
92
|
+
const resourceLocation = path.join(
|
|
93
|
+
SOURCE_PATH.resourceLocationWebSocket,
|
|
94
|
+
flowSchema.flowTag,
|
|
95
|
+
'source/'
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
const functionNameConfig = upperCase(functionName) + upperCase(shortNameHandler(handlerType));
|
|
99
|
+
const roleName = SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role;
|
|
100
|
+
const upperFunctionName = upperCase(functionName);
|
|
101
|
+
const upperHandlerType = upperCase(handlerType);
|
|
102
|
+
const upperFunctionNameConfig = upperCase(functionNameConfig);
|
|
103
|
+
const upperRoleName = upperCase(roleName);
|
|
104
|
+
const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
|
|
105
|
+
const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
|
|
106
|
+
|
|
92
107
|
return {
|
|
93
108
|
templatePath: templatePath,
|
|
94
109
|
templateData: {
|
|
95
|
-
resourceLocation
|
|
96
|
-
SOURCE_PATH.resourceLocationWebSocket,
|
|
97
|
-
flowSchema.flowTag,
|
|
98
|
-
'source/'
|
|
99
|
-
),
|
|
110
|
+
resourceLocation,
|
|
100
111
|
functionName,
|
|
101
112
|
handlerType,
|
|
102
113
|
additionalResourcePermission,
|
|
103
114
|
route,
|
|
104
|
-
functionNameConfig
|
|
105
|
-
|
|
106
|
-
|
|
115
|
+
functionNameConfig,
|
|
116
|
+
roleName,
|
|
117
|
+
upperFunctionName,
|
|
118
|
+
upperHandlerType,
|
|
119
|
+
upperFunctionNameConfig,
|
|
120
|
+
upperRoleName,
|
|
121
|
+
handlerPath,
|
|
122
|
+
handlerPathUpperFunctionName
|
|
107
123
|
},
|
|
108
124
|
setting: {
|
|
109
125
|
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
@@ -46,7 +46,9 @@ function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
|
46
46
|
templateData: {
|
|
47
47
|
functionName,
|
|
48
48
|
handlerType,
|
|
49
|
-
route
|
|
49
|
+
route,
|
|
50
|
+
upperFunctionName: upperCase(functionName),
|
|
51
|
+
upperHandlerType: upperCase(handlerType)
|
|
50
52
|
},
|
|
51
53
|
setting: {
|
|
52
54
|
savePath: path.join(
|
|
@@ -45,7 +45,8 @@ function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
|
45
45
|
templatePath: templatePath,
|
|
46
46
|
templateData: {
|
|
47
47
|
flowTag: flowSchema.flowTag,
|
|
48
|
-
objectType
|
|
48
|
+
objectType,
|
|
49
|
+
upperObjectType: upperCase(objectType)
|
|
49
50
|
},
|
|
50
51
|
setting: {
|
|
51
52
|
savePath: path.join(
|
|
@@ -1,17 +1,13 @@
|
|
|
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
11
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
13
12
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # 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
|
-
} _%>
|