@izara_project/izara-core-generate-service-code 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +0 -2
- package/package.json +3 -3
- package/src/GenerateCode.js +5 -4
- package/src/GenerateResources.js +4 -3
- package/src/GenerateTests.js +6 -7
- package/src/TemplateConfig.js +18 -18
- package/src/TemplateData/EndpointPerService/generateTemplateData.js +1 -1
- package/src/TemplateData/EndpointPerService/mainFunction/create/template.ejs +37 -39
- package/src/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +7 -12
- package/src/TemplateData/EndpointPerService/mainFunction/get/template.ejs +7 -10
- package/src/TemplateData/EndpointPerService/mainFunction/update/template.ejs +24 -31
- package/src/TemplateData/IntTest/generateResources/generateResources.js +4 -3
- package/src/TemplateData/IntTest/generateTests/events/data.js +3 -1
- package/src/TemplateData/IntTest/generateTests/generateTemplate.js +4 -2
- package/src/TemplateData/IntTest/generateTests/pathIntTest/data.js +2 -2
- package/src/TemplateData/IntTest/generateTests/tests/data.js +9 -8
- package/src/TemplateData/IntTest/libs/libs.js +4 -35
- package/src/TemplateData/IntTest/upload/uploadIntTest.js +4 -3
- package/src/TemplateData/externalService/lambdaRole/template.ejs +1 -3
- package/src/TemplateData/externalService/snsTopicSubscriptions/template.ejs +0 -2
- package/src/TemplateData/findData/findDataYaml/data.js +2 -1
- package/src/TemplateData/findData/mainFunction/data.js +1 -1
- package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +9 -5
- package/src/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +3 -3
- package/src/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +11 -8
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +1 -1
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +3 -2
- package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +11 -7
- package/src/TemplateData/flowSchema/components/upload/createObject/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +4 -3
- package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +2 -2
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +9 -7
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +11 -7
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +2 -2
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/data.js +2 -4
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +15 -9
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +2 -1
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +1 -1
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +3 -5
- package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +10 -5
- package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +2 -1
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +2 -1
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +0 -2
- package/src/TemplateData/flowSchema/components/upload/processFile/queue/data.js +1 -1
- package/src/TemplateData/flowSchema/components/upload/relate/S3/data.js +1 -1
- package/src/TemplateData/flowSchema/components/upload/relate/libs/data.js +1 -1
- package/src/TemplateData/flowSchema/components/upload/relate/sns-out/data.js +2 -1
- package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +9 -4
- package/src/TemplateData/flowSchema/components/websocket/connect/handler/data.js +1 -1
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +1 -2
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +1 -1
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/userUploadRecords.js +1 -1
- package/src/TemplateData/flowSchema/dynamoDb/data.js +2 -1
- package/src/TemplateData/flowSchema/eventBridge/functionYaml/data.js +9 -4
- package/src/TemplateData/flowSchema/eventBridge/handler/inv/data.js +2 -1
- package/src/TemplateData/flowSchema/eventBridge/mainFunction/data.js +2 -1
- package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +9 -6
- package/src/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +2 -19
- package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +3 -1
- package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +12 -5
- package/src/TemplateData/flowSchema/externalTopic/Process/handler/data.js +4 -1
- package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +3 -1
- package/src/TemplateData/flowSchema/externalTopic/sns-out/data.js +5 -6
- package/src/TemplateData/flowSchema/flowSchemaMainFunction/data.js +5 -9
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +10 -5
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +3 -3
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +65 -58
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +0 -4
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/DsqHandlerTemplate.ejs +91 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +31 -16
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +10 -5
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +4 -3
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +5 -6
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +3 -1
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +3 -3
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +3 -3
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +3 -3
- package/src/TemplateData/flowSchema/flowStep/functionYaml/data.js +13 -8
- package/src/TemplateData/flowSchema/flowStep/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/flowStep/mainFunction/data.js +2 -1
- package/src/TemplateData/flowSchema/flowStep/sns-in/data.js +3 -3
- package/src/TemplateData/flowSchema/generateTemplateData.js +1 -6
- package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +10 -3
- package/src/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +3 -1
- package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +9 -3
- package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +2 -1
- package/src/TemplateData/flowSchema/register/complete/functionYaml/data.js +11 -5
- package/src/TemplateData/flowSchema/register/complete/handler/data.js +2 -1
- package/src/TemplateData/flowSchema/register/complete/mainFunction/data.js +2 -1
- package/src/TemplateData/flowSchema/register/dynamoDB/register.js +2 -4
- package/src/TemplateData/flowSchema/register/sns-in/data.js +3 -4
- package/src/TemplateData/flowSchema/register/subscriptionOutAll/data.js +3 -3
- package/src/TemplateData/flowSchema/register/wbs/functionYaml/data.js +10 -5
- package/src/TemplateData/flowSchema/register/wbs/handler/data.js +2 -1
- package/src/TemplateData/flowSchema/register/wbs/mainFunction/data.js +2 -1
- package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +14 -6
- package/src/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +4 -7
- package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +4 -3
- package/src/TemplateData/flowSchema/statusFieldComponent/sns/data.js +3 -3
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +12 -8
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +3 -3
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +3 -3
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +12 -6
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +2 -1
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +2 -1
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +11 -8
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +2 -1
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +3 -3
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +10 -4
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/data.js +4 -11
- package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +11 -8
- package/src/TemplateData/flowSchema/webSocketComplete/handler/data.js +2 -1
- package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/data.js +1 -1
- package/src/TemplateData/flowSchema/webSocketComplete/sqs/data.js +3 -3
- package/src/TemplateData/generateRole/data.js +7 -2
- package/src/TemplateData/perActionComplete/create/handler/data.js +3 -3
- package/src/TemplateData/perActionComplete/create/mainFunction/data.js +3 -3
- package/src/TemplateData/perActionComplete/create/mainFunction/template.ejs +2 -2
- package/src/TemplateData/perActionComplete/create/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/perActionComplete/create/sns-out/data.js +3 -3
- package/src/TemplateData/perActionComplete/create/yaml/data.js +11 -7
- package/src/TemplateData/perActionComplete/delete/handler/data.js +3 -3
- package/src/TemplateData/perActionComplete/delete/mainFunction/data.js +4 -3
- package/src/TemplateData/perActionComplete/delete/mainFunction/template.ejs +3 -4
- package/src/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +4 -3
- package/src/TemplateData/perActionComplete/delete/sns-out/data.js +3 -3
- package/src/TemplateData/perActionComplete/delete/yaml/data.js +11 -7
- package/src/TemplateData/perActionComplete/get/handler/data.js +3 -3
- package/src/TemplateData/perActionComplete/get/mainFunction/data.js +3 -4
- package/src/TemplateData/perActionComplete/get/mainFunction/template.ejs +2 -2
- package/src/TemplateData/perActionComplete/get/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/perActionComplete/get/sns-out/data.js +3 -3
- package/src/TemplateData/perActionComplete/get/yaml/data.js +12 -7
- package/src/TemplateData/perActionComplete/update/handler/data.js +3 -3
- package/src/TemplateData/perActionComplete/update/mainFunction/data.js +3 -3
- package/src/TemplateData/perActionComplete/update/mainFunction/template.ejs +2 -2
- package/src/TemplateData/perActionComplete/update/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/perActionComplete/update/sns-out/data.js +4 -6
- package/src/TemplateData/perActionComplete/update/yaml/data.js +11 -7
- package/src/TemplateData/processLogical/handler/data.js +3 -3
- package/src/TemplateData/processLogical/mainFunction/data.js +2 -1
- package/src/TemplateData/processLogical/yaml/data.js +10 -7
- package/src/TemplateData/processLogicalPagination/DsqYaml/data.js +1 -1
- package/src/TemplateData/processLogicalPagination/handler/dsq/data.js +2 -1
- package/src/TemplateData/processLogicalPagination/handler/sqs/data.js +2 -1
- package/src/TemplateData/processLogicalPagination/mainFunction/data.js +2 -1
- package/src/TemplateData/processLogicalPagination/yaml/dsq/data.js +11 -7
- package/src/TemplateData/processLogicalPagination/yaml/sqs/data.js +9 -6
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +12 -7
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +2 -2
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +5 -3
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +11 -7
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +12 -11
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +2 -1
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +20 -15
- package/src/TemplateData/relationshipPerAction/create/action/handler/data.js +4 -3
- package/src/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +4 -3
- package/src/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +2 -2
- package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +6 -4
- package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +14 -10
- package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +3 -2
- package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +3 -4
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +20 -15
- package/src/TemplateData/relationshipPerAction/delete/action/handler/data.js +4 -4
- package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +4 -7
- package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +2 -2
- package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +5 -3
- package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +11 -7
- package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +2 -1
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +4 -5
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/generateTemplateData.js +1 -1
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +19 -16
- package/src/TemplateData/relationshipPerAction/get/action/handler/data.js +4 -4
- package/src/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +3 -4
- package/src/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +6 -3
- package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +5 -3
- package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +13 -9
- package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +2 -1
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +3 -2
- package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +2 -1
- package/src/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +17 -13
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +4 -3
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +6 -4
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +6 -3
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +6 -4
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +13 -9
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +3 -2
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +20 -15
- package/src/TemplateData/relationshipPerAction/update/action/handler/data.js +4 -4
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +4 -4
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +6 -3
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +4 -3
- package/src/TemplateData/relationshipPerAction/update/action/sns-out/data.js +5 -6
- package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +13 -10
- package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +2 -1
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +3 -2
- package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +3 -3
- package/src/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +3 -3
- package/src/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +1 -1
- package/src/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +7 -3
- package/src/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +2 -1
- package/src/TemplateData/resourceYaml/filterGenerateResource/data.js +5 -3
- package/src/TemplateData/resourceYaml/generateTemplateData.js +5 -2
- package/src/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +3 -3
- package/src/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +4 -3
- package/src/TemplateData/resourceYaml/sns-out/data.js +3 -3
- package/src/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +2 -1
- package/src/libs/GenerateCodeLibs.js +1 -1
- package/src/libs/Libs.js +22 -0
- package/src/libs/Utils.js +4 -4
- package/src/GenerateSchema.js +0 -164
- package/src/SchemaConfig.js +0 -23
- package/src/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +0 -358
- package/src/TemplateData/perActionEndpoint/generateTemplateData.js +0 -112
- package/src/TemplateData/perActionEndpoint/handler/api/data.js +0 -109
- package/src/TemplateData/perActionEndpoint/handler/api/request.json +0 -7
- package/src/TemplateData/perActionEndpoint/handler/api/template.ejs +0 -36
- package/src/TemplateData/perActionEndpoint/handler/dsq/data.js +0 -118
- package/src/TemplateData/perActionEndpoint/handler/dsq/request.json +0 -7
- package/src/TemplateData/perActionEndpoint/handler/dsq/template.ejs +0 -55
- package/src/TemplateData/perActionEndpoint/handler/inv/data.js +0 -112
- package/src/TemplateData/perActionEndpoint/handler/inv/request.json +0 -7
- package/src/TemplateData/perActionEndpoint/handler/inv/template.ejs +0 -37
- package/src/TemplateData/perActionEndpoint/handler/sqs/data.js +0 -116
- package/src/TemplateData/perActionEndpoint/handler/sqs/request.json +0 -7
- package/src/TemplateData/perActionEndpoint/handler/sqs/template.ejs +0 -57
- package/src/TemplateData/perActionEndpoint/handler/webSocket/data.js +0 -94
- package/src/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +0 -61
- package/src/TemplateData/perActionEndpoint/handler/webSocketConnect/data.js +0 -54
- package/src/TemplateData/perActionEndpoint/handler/webSocketConnect/template.ejs +0 -55
- package/src/TemplateData/perActionEndpoint/libs/data.js +0 -60
- package/src/TemplateData/perActionEndpoint/libs/template.ejs +0 -46
- package/src/TemplateData/perActionEndpoint/mainFunction/create/data.js +0 -91
- package/src/TemplateData/perActionEndpoint/mainFunction/create/request.json +0 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +0 -339
- package/src/TemplateData/perActionEndpoint/mainFunction/delete/data.js +0 -91
- package/src/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +0 -99
- package/src/TemplateData/perActionEndpoint/mainFunction/get/data.js +0 -92
- package/src/TemplateData/perActionEndpoint/mainFunction/get/request.json +0 -5
- package/src/TemplateData/perActionEndpoint/mainFunction/get/template.ejs +0 -116
- package/src/TemplateData/perActionEndpoint/mainFunction/get/testParam.json +0 -5
- package/src/TemplateData/perActionEndpoint/mainFunction/update/data.js +0 -85
- package/src/TemplateData/perActionEndpoint/mainFunction/update/request.json +0 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +0 -166
- package/src/TemplateData/perActionEndpoint/yaml/api/data.js +0 -229
- package/src/TemplateData/perActionEndpoint/yaml/api/request.json +0 -14
- package/src/TemplateData/perActionEndpoint/yaml/api/template.ejs +0 -20
- package/src/TemplateData/perActionEndpoint/yaml/dsq/data.js +0 -234
- package/src/TemplateData/perActionEndpoint/yaml/dsq/request.json +0 -19
- package/src/TemplateData/perActionEndpoint/yaml/dsq/template.ejs +0 -17
- package/src/TemplateData/perActionEndpoint/yaml/inv/data.js +0 -207
- package/src/TemplateData/perActionEndpoint/yaml/inv/example req.js +0 -15
- package/src/TemplateData/perActionEndpoint/yaml/inv/request.json +0 -14
- package/src/TemplateData/perActionEndpoint/yaml/inv/template.ejs +0 -13
- package/src/TemplateData/perActionEndpoint/yaml/sqs/data.js +0 -237
- package/src/TemplateData/perActionEndpoint/yaml/sqs/request.json +0 -19
- package/src/TemplateData/perActionEndpoint/yaml/sqs/template.ejs +0 -17
- package/src/TemplateData/perActionEndpoint/yaml/wbs/data.js +0 -204
- package/src/TemplateData/perActionEndpoint/yaml/wbs/request.json +0 -19
- package/src/TemplateData/perActionEndpoint/yaml/wbs/template.ejs +0 -29
- package/src/TemplateData/perActionEndpoint/yaml/webSocketConnect/data.js +0 -58
- package/src/TemplateData/perActionEndpoint/yaml/webSocketConnect/template.ejs +0 -10
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/data.js +0 -146
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/template.ejs +0 -20
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/data.js +0 -146
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/data.js +0 -146
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/template.ejs +0 -13
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/data.js +0 -147
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/data.js +0 -62
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/template.ejs +0 -59
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/data.js +0 -63
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/template.ejs +0 -202
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/template.ejs +0 -144
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/template.ejs +0 -77
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +0 -175
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/api/template.ejs +0 -20
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +0 -176
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +0 -175
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/inv/template.ejs +0 -13
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +0 -177
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/create/action/handler/api/data.js +0 -62
- package/src/TemplateData/relationshipPerAction/create/action/handler/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +0 -57
- package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/data.js +0 -63
- package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +0 -184
- package/src/TemplateData/relationshipPerAction/create/action/handler/inv/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/create/action/handler/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +0 -126
- package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +0 -75
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +0 -178
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/api/template.ejs +0 -20
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +0 -176
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +0 -178
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/template.ejs +0 -13
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +0 -176
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/delete/action/handler/api/data.js +0 -62
- package/src/TemplateData/relationshipPerAction/delete/action/handler/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +0 -139
- package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/data.js +0 -63
- package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +0 -182
- package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +0 -124
- package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +0 -162
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +0 -168
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/api/template.ejs +0 -20
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +0 -177
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +0 -167
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/inv/template.ejs +0 -13
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +0 -166
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/get/action/handler/api/data.js +0 -62
- package/src/TemplateData/relationshipPerAction/get/action/handler/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/api/template.ejs +0 -138
- package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/data.js +0 -63
- package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/template.ejs +0 -185
- package/src/TemplateData/relationshipPerAction/get/action/handler/inv/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/get/action/handler/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/inv/template.ejs +0 -127
- package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/data.js +0 -64
- package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/template.ejs +0 -165
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +0 -167
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/template.ejs +0 -20
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +0 -196
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +0 -186
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/template.ejs +0 -13
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +0 -187
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/template.ejs +0 -17
- package/src/TemplateData/relationshipPerAction/update/action/handler/api/data.js +0 -78
- package/src/TemplateData/relationshipPerAction/update/action/handler/api/request.json +0 -7
- package/src/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +0 -142
- package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/data.js +0 -79
- package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/request.json +0 -7
- package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +0 -188
- package/src/TemplateData/relationshipPerAction/update/action/handler/inv/data.js +0 -80
- package/src/TemplateData/relationshipPerAction/update/action/handler/inv/request.json +0 -5
- package/src/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +0 -147
- package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/data.js +0 -79
- package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/request.json +0 -7
- package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +0 -163
- package/src/TemplateData/resourceYaml/CreateSourceData.js +0 -79
- /package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/{template.ejs → SqsHandlerTemplate.ejs} +0 -0
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const path = require('path');
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
ACTIONS,
|
|
22
|
-
HANDLER
|
|
23
|
-
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
24
|
-
|
|
25
|
-
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase, checkOverWriteGenerateMainFunction } = require("../#utils");
|
|
26
|
-
// const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../../../#const");
|
|
27
|
-
const {
|
|
28
|
-
firstLetterLowerCase: lowerCase,
|
|
29
|
-
firstLetterUpperCase: upperCase,
|
|
30
|
-
firstLetterUpperCase,
|
|
31
|
-
checkOverWriteGenerateMainFunction
|
|
32
|
-
} = require('../../../../../MainLibs/src/Consts.js').utils;
|
|
33
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } =
|
|
34
|
-
require('../../../../../MainLibs/src/Consts.js').consts;
|
|
35
|
-
|
|
36
|
-
const templatePath = path.join(__dirname, 'template.ejs');
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* receive objectSchema
|
|
40
|
-
* create data for hdrApi template
|
|
41
|
-
*
|
|
42
|
-
* @param {Object} objectSchema
|
|
43
|
-
* @return {{ templatePath, templateData, setting } }
|
|
44
|
-
*/
|
|
45
|
-
function data(_izContext, objectSchema, srcPath) {
|
|
46
|
-
let createSourceArray = [];
|
|
47
|
-
|
|
48
|
-
for (const action of Object.values(ACTIONS)) {
|
|
49
|
-
if (objectSchema.overWriteHandlers?.[action]) {
|
|
50
|
-
// if have overWriteHander of action check hdrApi inside
|
|
51
|
-
if (objectSchema.overWriteHandlers[action].includes(HANDLER.hdrApi)) {
|
|
52
|
-
// create template data
|
|
53
|
-
const createSourceParam = createParamForCreateSource(
|
|
54
|
-
objectSchema,
|
|
55
|
-
action,
|
|
56
|
-
HANDLER.hdrApi,
|
|
57
|
-
srcPath
|
|
58
|
-
);
|
|
59
|
-
createSourceArray.push(createSourceParam);
|
|
60
|
-
}
|
|
61
|
-
} else {
|
|
62
|
-
// if not have overWriteHander of action will use default handler
|
|
63
|
-
const defaultHandler = DEFAULT_HANDLER_PER_ACTION[action];
|
|
64
|
-
if (defaultHandler.includes(HANDLER.hdrApi)) {
|
|
65
|
-
// create template data and object for create source
|
|
66
|
-
const createSourceParam = createParamForCreateSource(
|
|
67
|
-
objectSchema,
|
|
68
|
-
action,
|
|
69
|
-
HANDLER.hdrApi,
|
|
70
|
-
srcPath
|
|
71
|
-
);
|
|
72
|
-
createSourceArray.push(createSourceParam);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return createSourceArray;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function createParamForCreateSource(objectSchema, action, handler, srcPath) {
|
|
81
|
-
// let objectType = objectSchema.objectType;
|
|
82
|
-
let objectType = objectSchema.objectType;
|
|
83
|
-
let groupBy = objectSchema?.shortNameObjectType
|
|
84
|
-
? objectSchema.shortNameObjectType
|
|
85
|
-
: objectSchema.objectType;
|
|
86
|
-
|
|
87
|
-
let functionName = objectType + firstLetterUpperCase(action);
|
|
88
|
-
return {
|
|
89
|
-
templatePath: templatePath,
|
|
90
|
-
templateData: {
|
|
91
|
-
functionName: functionName,
|
|
92
|
-
objectType: objectType,
|
|
93
|
-
roleName: groupBy,
|
|
94
|
-
action: action,
|
|
95
|
-
isCreateMainFunction: checkOverWriteGenerateMainFunction(
|
|
96
|
-
objectSchema,
|
|
97
|
-
action
|
|
98
|
-
)
|
|
99
|
-
},
|
|
100
|
-
setting: {
|
|
101
|
-
savePath: path.join(srcPath, SOURCE_PATH.lambdaPerAction),
|
|
102
|
-
saveFileName: `${upperCase(objectSchema.objectType)}${upperCase(action)}_${upperCase(handler)}`,
|
|
103
|
-
fileExtension: '.js',
|
|
104
|
-
isAppend: false
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
module.exports = data;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/* Copyright (C) 2020 Sven Mason <http://izara.io> This program is free
|
|
2
|
-
software: you can redistribute it and/or modify it under the terms of the GNU
|
|
3
|
-
Affero General Public License as published by the Free Software Foundation,
|
|
4
|
-
either version 3 of the License, or (at your option) any later version. This
|
|
5
|
-
program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
6
|
-
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
7
|
-
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
-
You should have received a copy of the GNU Affero General Public License along
|
|
9
|
-
with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
10
|
-
const izara = require("@izara_project/izara-middleware"); const middleware =
|
|
11
|
-
izara.middlewareHandler; const callingFlowSharedLib =
|
|
12
|
-
require('@izara_project/izara-core-library-calling-flow'); const {
|
|
13
|
-
validateSchemaMiddleware } =
|
|
14
|
-
require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs/index.js');
|
|
15
|
-
<%_ if (isCreateMainFunction == true) { _%> // user generate main function <%_ }
|
|
16
|
-
else { %> const <%- functionName %> =require('./<%-
|
|
17
|
-
firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
18
|
-
<%_ } _%> //(<globalVariable> //</globalVariable>) //validate event params in
|
|
19
|
-
middleware before into main function validateSchemaMiddleware( middleware, "<%-
|
|
20
|
-
(objectType) %>", "<%- action %>" //(<validateSchemaSetting>
|
|
21
|
-
//</validateSchemaSetting
|
|
22
|
-
>) ) // if need to validate authorizer or additional params , add code to hook
|
|
23
|
-
tag below //(<afterValidateWith>) //(</afterValidateWith>) module.exports.main =
|
|
24
|
-
middleware.wrap(async (event, context, callback) => {
|
|
25
|
-
event._izContext.logger.debug('Event:', event); try { // invoke LambdaFunction
|
|
26
|
-
let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>Main(
|
|
27
|
-
event._izContext, //
|
|
28
|
-
correlationId/logger/integrationTestDetail/uniqueRequestId/userId event, ); //
|
|
29
|
-
return error to client if (lambdaFunctionResponse instanceof Error) { return
|
|
30
|
-
(izara.response.failure(lambdaFunctionResponse)); } // return success to client
|
|
31
|
-
return (izara.response.success(lambdaFunctionResponse)); } catch (err) {
|
|
32
|
-
event._izContext.logger.error('Error, <%- functionName %>Main: ', err); return
|
|
33
|
-
(izara.response.failure(err)); } }); <%_ function firstLetterUpperCase(text){
|
|
34
|
-
return text.charAt(0).toUpperCase() + text.slice(1) } _%> <%_ function
|
|
35
|
-
firstLetterLowerCase(str) { return str.charAt(0).toLowerCase() + str.slice(1) }
|
|
36
|
-
_%>
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const path = require('path');
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
ACTIONS,
|
|
22
|
-
HANDLER
|
|
23
|
-
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
24
|
-
|
|
25
|
-
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase, checkOverWriteGenerateMainFunction } = require("../#utils");
|
|
26
|
-
// const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../#const");
|
|
27
|
-
const {
|
|
28
|
-
firstLetterLowerCase: lowerCase,
|
|
29
|
-
firstLetterUpperCase: upperCase,
|
|
30
|
-
firstLetterUpperCase,
|
|
31
|
-
checkOverWriteGenerateMainFunction
|
|
32
|
-
} = require('../../../../../MainLibs/src/Consts.js').utils;
|
|
33
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } =
|
|
34
|
-
require('../../../../../MainLibs/src/Consts.js').consts;
|
|
35
|
-
|
|
36
|
-
const templatePath = path.join(__dirname, 'template.ejs');
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* receive objectSchema
|
|
40
|
-
* create data for hdrInv template
|
|
41
|
-
*
|
|
42
|
-
* @param {Object} objectSchema
|
|
43
|
-
* @return {{ templatePath, templateData, setting } }
|
|
44
|
-
*/
|
|
45
|
-
function data(_izContext, objectSchema, srcPath) {
|
|
46
|
-
let createSourceArray = [];
|
|
47
|
-
|
|
48
|
-
for (const action of Object.values(ACTIONS)) {
|
|
49
|
-
if (objectSchema.overWriteHandlers?.[action]) {
|
|
50
|
-
// if have overWriteHander of action check hdrInv inside
|
|
51
|
-
if (objectSchema.overWriteHandlers[action].includes(HANDLER.hdrDsq)) {
|
|
52
|
-
const createSourceParamHandlerGet =
|
|
53
|
-
createParamForCreateSourceHandlerGet(
|
|
54
|
-
objectSchema,
|
|
55
|
-
action,
|
|
56
|
-
HANDLER.hdrDsq,
|
|
57
|
-
srcPath
|
|
58
|
-
);
|
|
59
|
-
createSourceParamHandlerGet &&
|
|
60
|
-
createSourceArray.push(createSourceParamHandlerGet);
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
// if not have overWriteHander of action will use default handler
|
|
64
|
-
const defaultHandler = DEFAULT_HANDLER_PER_ACTION[action];
|
|
65
|
-
if (defaultHandler.includes(HANDLER.hdrDsq)) {
|
|
66
|
-
const createSourceParamHandlerGet =
|
|
67
|
-
createParamForCreateSourceHandlerGet(
|
|
68
|
-
objectSchema,
|
|
69
|
-
action,
|
|
70
|
-
HANDLER.hdrdsq,
|
|
71
|
-
srcPath
|
|
72
|
-
);
|
|
73
|
-
createSourceParamHandlerGet &&
|
|
74
|
-
createSourceArray.push(createSourceParamHandlerGet);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return createSourceArray;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function createParamForCreateSourceHandlerGet(
|
|
82
|
-
objectSchema,
|
|
83
|
-
action,
|
|
84
|
-
handler,
|
|
85
|
-
srcPath
|
|
86
|
-
) {
|
|
87
|
-
// let objectType = objectSchema.objectType;
|
|
88
|
-
let objectType = objectSchema.objectType;
|
|
89
|
-
let groupBy = objectSchema?.shortNameObjectType
|
|
90
|
-
? objectSchema.shortNameObjectType
|
|
91
|
-
: objectSchema.objectType;
|
|
92
|
-
let functionName = objectType + upperCase(action);
|
|
93
|
-
let queueName =
|
|
94
|
-
objectType + firstLetterUpperCase(action) + upperCase(handler);
|
|
95
|
-
return {
|
|
96
|
-
templatePath: templatePath,
|
|
97
|
-
templateData: {
|
|
98
|
-
functionName: functionName,
|
|
99
|
-
objectType: objectType,
|
|
100
|
-
roleName: groupBy,
|
|
101
|
-
queueName,
|
|
102
|
-
action,
|
|
103
|
-
isCreateMainFunction: checkOverWriteGenerateMainFunction(
|
|
104
|
-
objectSchema,
|
|
105
|
-
action
|
|
106
|
-
),
|
|
107
|
-
handler
|
|
108
|
-
},
|
|
109
|
-
setting: {
|
|
110
|
-
savePath: path.join(srcPath, SOURCE_PATH.lambdaPerAction),
|
|
111
|
-
saveFileName: `${upperCase(objectType)}${upperCase(action)}_${upperCase(handler)}`,
|
|
112
|
-
fileExtension: '.js',
|
|
113
|
-
isAppend: false
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
module.exports = data;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/* Copyright (C) 2020 Sven Mason <http://izara.io> This program is free
|
|
2
|
-
software: you can redistribute it and/or modify it under the terms of the GNU
|
|
3
|
-
Affero General Public License as published by the Free Software Foundation,
|
|
4
|
-
either version 3 of the License, or (at your option) any later version. This
|
|
5
|
-
program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
6
|
-
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
7
|
-
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
-
You should have received a copy of the GNU Affero General Public License along
|
|
9
|
-
with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
10
|
-
const izara = require("@izara_project/izara-middleware"); const middleware =
|
|
11
|
-
izara.middlewareHandler; const callingFlowSharedLib =
|
|
12
|
-
require('@izara_project/izara-core-library-calling-flow'); const Logger =
|
|
13
|
-
require('@izara_project/izara-core-library-logger'); const
|
|
14
|
-
{validateSchemaPerRecord} =
|
|
15
|
-
require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs/index.js')
|
|
16
|
-
const recordHandlerSharedLib =
|
|
17
|
-
require('@izara_project/izara-core-library-record-handler'); <%_ if
|
|
18
|
-
(isCreateMainFunction == true) { _%> // user generate main function <%_ } else {
|
|
19
|
-
%> const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType)
|
|
20
|
-
%><%- firstLetterUpperCase(action) %>_Main') <%_ } _%> //(<globalVariable>
|
|
21
|
-
//</globalVariable
|
|
22
|
-
>) //validate event params in middleware before into main function
|
|
23
|
-
middleware.setValidatorSchema( recordHandlerSharedLib.baseValidatorSchema(),
|
|
24
|
-
//(<middlewareSettings>) //(</middlewareSettings>) ) /* const
|
|
25
|
-
perRecordsValidatorSchema = { type: "object", required: [], properties: {}, } */
|
|
26
|
-
//(<globalValidatorSchema>) //(</globalValidatorSchema>) // if need to validate
|
|
27
|
-
authorizer or additional params , add code to hook tag below module.exports.main
|
|
28
|
-
= middleware.wrap(async (event,context, callback) => { try { let recordPromises
|
|
29
|
-
= []; await Promise.all(event.Records.map(async record => {
|
|
30
|
-
record._izContext.logger.debug('record RecieveMsgOutHdrSqs', record); let
|
|
31
|
-
passOnProperties = []; const OBJTYPE = { objectType: "<%- objectType %>",
|
|
32
|
-
serviceTag: process.env.iz_serviceTag } await validateSchemaPerRecord( record,
|
|
33
|
-
"<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handler) %>",
|
|
34
|
-
OBJTYPE, "<%- action %>" //(<validateSchemaSetting>) //(</validateSchemaSetting
|
|
35
|
-
>) ) //for validate additional params /* await
|
|
36
|
-
recordHandlerSharedLib.validateRecord( record, "<%-
|
|
37
|
-
firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handler) %>",
|
|
38
|
-
perRecordsValidatorSchema ); */ //(<afterGenerateValidatorSchema
|
|
39
|
-
>) //(</afterGenerateValidatorSchema
|
|
40
|
-
>) //(<additionalParams>) //(</additionalParams>)
|
|
41
|
-
passOnProperties.push(record.body.Message);
|
|
42
|
-
passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message));
|
|
43
|
-
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
44
|
-
let recordPromise = recordHandlerSharedLib.recordHandler( record, <%-
|
|
45
|
-
functionName %>.<%- functionName %>Main, // mainFunction '<%-
|
|
46
|
-
firstLetterUpperCase(queueName) %>', // queueName passOnProperties );
|
|
47
|
-
record._izContext.logger.debug('after record Promise in handler');
|
|
48
|
-
recordPromises.push(recordPromise); })) Logger.debug('before
|
|
49
|
-
Promise.all(recordPromise) in handler'); try { await
|
|
50
|
-
Promise.all(recordPromises); return event.Records } catch {
|
|
51
|
-
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one
|
|
52
|
-
record did no resolve)'); } Logger.debug('after Promise.all(recordPromises) in
|
|
53
|
-
handler'); } catch (err) { Logger.debug('unhandled error <%- functionName %><%-
|
|
54
|
-
handler %>') throw err } } ) <%_ function firstLetterUpperCase(text){ return
|
|
55
|
-
text.charAt(0).toUpperCase() + text.slice(1) } _%>
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const path = require('path');
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
ACTIONS,
|
|
22
|
-
HANDLER
|
|
23
|
-
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
24
|
-
|
|
25
|
-
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, checkOverWriteGenerateMainFunction } = require("../#utils");
|
|
26
|
-
// const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME } = require("../../../#const");
|
|
27
|
-
const {
|
|
28
|
-
firstLetterLowerCase: lowerCase,
|
|
29
|
-
firstLetterUpperCase: upperCase,
|
|
30
|
-
checkOverWriteGenerateMainFunction
|
|
31
|
-
} = require('../../../../../MainLibs/src/Consts.js').utils;
|
|
32
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME } =
|
|
33
|
-
require('../../../../../MainLibs/src/Consts.js').consts;
|
|
34
|
-
|
|
35
|
-
const templatePath = path.join(__dirname, 'template.ejs');
|
|
36
|
-
/**
|
|
37
|
-
* receive objectSchema
|
|
38
|
-
* create data for hdrInv template
|
|
39
|
-
*
|
|
40
|
-
* @param {Object} objectSchema
|
|
41
|
-
* @return {{ templatePath, templateData, setting } }
|
|
42
|
-
*/
|
|
43
|
-
function data(_izContext, objectSchema, srcPath) {
|
|
44
|
-
let createSourceArray = [];
|
|
45
|
-
|
|
46
|
-
for (const action of Object.values(ACTIONS)) {
|
|
47
|
-
if (objectSchema.overWriteHandlers?.[action]) {
|
|
48
|
-
// if have overWriteHander of action check hdrInv inside
|
|
49
|
-
if (objectSchema.overWriteHandlers[action].includes(HANDLER.hdrInv)) {
|
|
50
|
-
// create template data
|
|
51
|
-
const createHandlerGet = createParamForCreateHandlerGet(
|
|
52
|
-
objectSchema,
|
|
53
|
-
action,
|
|
54
|
-
HANDLER.hdrInv,
|
|
55
|
-
srcPath
|
|
56
|
-
);
|
|
57
|
-
createHandlerGet && createSourceArray.push(createHandlerGet);
|
|
58
|
-
}
|
|
59
|
-
} else {
|
|
60
|
-
// if not have overWriteHander of action will use default handler
|
|
61
|
-
const defaultHandler = DEFAULT_HANDLER_PER_ACTION[action];
|
|
62
|
-
|
|
63
|
-
if (defaultHandler.includes(HANDLER.hdrInv)) {
|
|
64
|
-
// create template data and object for create source
|
|
65
|
-
const createHandlerGet = createParamForCreateHandlerGet(
|
|
66
|
-
objectSchema,
|
|
67
|
-
action,
|
|
68
|
-
HANDLER.hdrInv,
|
|
69
|
-
srcPath
|
|
70
|
-
);
|
|
71
|
-
createHandlerGet && createSourceArray.push(createHandlerGet);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
// console.log("createSourceArrayInHdrInv", createSourceArray)
|
|
76
|
-
return createSourceArray;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function createParamForCreateHandlerGet(
|
|
80
|
-
objectSchema,
|
|
81
|
-
action,
|
|
82
|
-
handler,
|
|
83
|
-
srcPath
|
|
84
|
-
) {
|
|
85
|
-
// let objectType = objectSchema.objectType;
|
|
86
|
-
let objectType = objectSchema.objectType;
|
|
87
|
-
let groupBy = objectSchema?.shortNameObjectType
|
|
88
|
-
? objectSchema.shortNameObjectType
|
|
89
|
-
: objectSchema.objectType;
|
|
90
|
-
let functionName = objectType + upperCase(action);
|
|
91
|
-
return {
|
|
92
|
-
templatePath: templatePath,
|
|
93
|
-
templateData: {
|
|
94
|
-
functionName: functionName,
|
|
95
|
-
objectType: objectType,
|
|
96
|
-
roleName: groupBy,
|
|
97
|
-
action: action,
|
|
98
|
-
isCreateMainFunction: checkOverWriteGenerateMainFunction(
|
|
99
|
-
objectSchema,
|
|
100
|
-
action
|
|
101
|
-
)
|
|
102
|
-
},
|
|
103
|
-
setting: {
|
|
104
|
-
savePath: path.join(srcPath, SOURCE_PATH.lambdaPerAction),
|
|
105
|
-
saveFileName: `${upperCase(objectType)}${upperCase(action)}_${upperCase(handler)}`,
|
|
106
|
-
fileExtension: '.js',
|
|
107
|
-
isAppend: false
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
module.exports = data;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* Copyright (C) 2020 Sven Mason <http://izara.io> This program is free
|
|
2
|
-
software: you can redistribute it and/or modify it under the terms of the GNU
|
|
3
|
-
Affero General Public License as published by the Free Software Foundation,
|
|
4
|
-
either version 3 of the License, or (at your option) any later version. This
|
|
5
|
-
program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
6
|
-
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
7
|
-
PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
-
You should have received a copy of the GNU Affero General Public License along
|
|
9
|
-
with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
10
|
-
const middleware =
|
|
11
|
-
require("@izara_project/izara-middleware/src/MiddlewareCore/MiddlewareHandler");
|
|
12
|
-
const callingFlowSharedLib =
|
|
13
|
-
require('@izara_project/izara-core-library-calling-flow'); const {
|
|
14
|
-
validateSchemaMiddleware } =
|
|
15
|
-
require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs/index.js');
|
|
16
|
-
<%_ if (isCreateMainFunction == true) { _%> // user generate main function <%_ }
|
|
17
|
-
else { %> const <%- functionName %> =require('./<%-
|
|
18
|
-
firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
19
|
-
<%_ } _%> //(<globalVariable> //</globalVariable>) //validate event params in
|
|
20
|
-
middleware before into function validateSchemaMiddleware( middleware, "<%-
|
|
21
|
-
(objectType) %>", // objectType "<%- action %>", // action
|
|
22
|
-
//(<validateSchemaSetting>) //(</validateSchemaSetting>) ) // if need to
|
|
23
|
-
validate authorizer or additional params, add code to hook tag below
|
|
24
|
-
//(<afterValidateWithGenereatedSchema>) //(</afterValidateWithGenereatedSchema>)
|
|
25
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
26
|
-
event._izContext.logger.debug('Event:', event);
|
|
27
|
-
event._izContext.logger.debug('context:', context); try { //(<beforeInvoke
|
|
28
|
-
>) //(</beforeInvoke
|
|
29
|
-
>) // invoke LambdaFunction return await <%- functionName %>.<%- functionName
|
|
30
|
-
%>Main( event._izContext, //
|
|
31
|
-
correlationId/logger/integrationTestDetail/uniqueRequestId event,
|
|
32
|
-
callingFlowSharedLib.addCallingFlowToPassOnProperties(event) ); } catch (err) {
|
|
33
|
-
event._izContext.logger.error('Error, <%- firstLetterUpperCase(objectType) %>:
|
|
34
|
-
', err); throw (err); } }); <%_ function firstLetterUpperCase(text){ return
|
|
35
|
-
text.charAt(0).toUpperCase() + text.slice(1) } _%> <%_ function
|
|
36
|
-
firstLetterLowerCase(str) { return str.charAt(0).toLowerCase() + str.slice(1) }
|
|
37
|
-
_%>
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const path = require('path');
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
ACTIONS,
|
|
22
|
-
HANDLER
|
|
23
|
-
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
24
|
-
|
|
25
|
-
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase, checkOverWriteGenerateMainFunction } = require("../#utils");
|
|
26
|
-
// const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../#const");
|
|
27
|
-
const {
|
|
28
|
-
firstLetterLowerCase: lowerCase,
|
|
29
|
-
firstLetterUpperCase: upperCase,
|
|
30
|
-
firstLetterUpperCase,
|
|
31
|
-
checkOverWriteGenerateMainFunction
|
|
32
|
-
} = require('../../../../../MainLibs/src/Consts.js').utils;
|
|
33
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } =
|
|
34
|
-
require('../../../../../MainLibs/src/Consts.js').consts;
|
|
35
|
-
|
|
36
|
-
const templatePath = path.join(__dirname, 'template.ejs');
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* receive objectSchema
|
|
40
|
-
* create data for hdrInv template
|
|
41
|
-
*
|
|
42
|
-
* @param {Object} objectSchema
|
|
43
|
-
* @return {{ templatePath, templateData, setting } }
|
|
44
|
-
*/
|
|
45
|
-
function data(_izContext, objectSchema, srcPath) {
|
|
46
|
-
let createSourceArray = [];
|
|
47
|
-
|
|
48
|
-
for (const action of Object.values(ACTIONS)) {
|
|
49
|
-
if (objectSchema.overWriteHandlers?.[action]) {
|
|
50
|
-
// if have overWriteHander of action check hdrInv inside
|
|
51
|
-
if (objectSchema.overWriteHandlers[action].includes(HANDLER.hdrSqs)) {
|
|
52
|
-
// create template data
|
|
53
|
-
const createSourceParam = createParamForCreateSourceGetHandler(
|
|
54
|
-
objectSchema,
|
|
55
|
-
action,
|
|
56
|
-
HANDLER.hdrSqs,
|
|
57
|
-
srcPath
|
|
58
|
-
);
|
|
59
|
-
createSourceParam && createSourceArray.push(createSourceParam);
|
|
60
|
-
}
|
|
61
|
-
} else {
|
|
62
|
-
// if not have overWriteHander of action will use default handler
|
|
63
|
-
const defaultHandler = DEFAULT_HANDLER_PER_ACTION[action];
|
|
64
|
-
if (defaultHandler.includes(HANDLER.hdrSqs)) {
|
|
65
|
-
// create template data and object for create source
|
|
66
|
-
const createSourceParam = createParamForCreateSourceGetHandler(
|
|
67
|
-
objectSchema,
|
|
68
|
-
action,
|
|
69
|
-
HANDLER.hdrSqs,
|
|
70
|
-
srcPath
|
|
71
|
-
);
|
|
72
|
-
createSourceParam && createSourceArray.push(createSourceParam);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// console.log("createSourceArray in sqsData :", createSourceArray)
|
|
77
|
-
return createSourceArray;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function createParamForCreateSourceGetHandler(
|
|
81
|
-
objectSchema,
|
|
82
|
-
action,
|
|
83
|
-
handler,
|
|
84
|
-
srcPath
|
|
85
|
-
) {
|
|
86
|
-
// let objectType = objectSchema.objectType;
|
|
87
|
-
let objectType = objectSchema.objectType;
|
|
88
|
-
let groupBy = objectSchema?.shortNameObjectType
|
|
89
|
-
? objectSchema.shortNameObjectType
|
|
90
|
-
: objectSchema.objectType;
|
|
91
|
-
let functionName = objectType + firstLetterUpperCase(action);
|
|
92
|
-
let queueName = functionName + upperCase(handler);
|
|
93
|
-
return {
|
|
94
|
-
templatePath: templatePath,
|
|
95
|
-
templateData: {
|
|
96
|
-
functionName: functionName,
|
|
97
|
-
objectType: objectType,
|
|
98
|
-
roleName: groupBy,
|
|
99
|
-
queueName,
|
|
100
|
-
action,
|
|
101
|
-
isCreateMainFunction: checkOverWriteGenerateMainFunction(
|
|
102
|
-
objectSchema,
|
|
103
|
-
action
|
|
104
|
-
),
|
|
105
|
-
handler
|
|
106
|
-
},
|
|
107
|
-
setting: {
|
|
108
|
-
savePath: path.join(srcPath, SOURCE_PATH.lambdaPerAction),
|
|
109
|
-
saveFileName: `${upperCase(objectType)}${upperCase(action)}_${upperCase(handler)}`,
|
|
110
|
-
fileExtension: '.js',
|
|
111
|
-
isAppend: false
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
module.exports = data;
|