@izara_project/izara-core-generate-service-code 1.0.2 → 1.0.3
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/package.json +3 -3
- package/src/GenerateCode.js +5 -4
- package/src/GenerateResources.js +4 -3
- package/src/GenerateSchema.js +5 -4
- 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 +6 -17
- 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 +5 -17
- 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/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/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,78 +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
|
-
import path from 'path';
|
|
19
|
-
import { fileURLToPath } from 'url';
|
|
20
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
-
const __dirname = path.dirname(__filename);
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
ACTIONS,
|
|
25
|
-
HANDLER
|
|
26
|
-
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
27
|
-
|
|
28
|
-
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../#utils");
|
|
29
|
-
// const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, SNS_RESOURCE, DYNAMO_RESOURCE, defaultIamRolePerAction, awaitingMultipleStepsRole } = require("../../../#const");
|
|
30
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
|
|
31
|
-
require('../../../../../../../MainLibs/src/Consts.js').utils;
|
|
32
|
-
const {
|
|
33
|
-
DEFAULT_HANDLER_PER_ACTION,
|
|
34
|
-
createIamRole,
|
|
35
|
-
resourceNames,
|
|
36
|
-
RESOURCE_CLASSES,
|
|
37
|
-
DEFAULT_LAMBDA_ROLE_PER_ACTION,
|
|
38
|
-
SQS_RESOURCE,
|
|
39
|
-
SOURCE_PATH,
|
|
40
|
-
SAVE_FILE_NAME,
|
|
41
|
-
FUNCTION_NAME,
|
|
42
|
-
SNS_RESOURCE,
|
|
43
|
-
DYNAMO_RESOURCE,
|
|
44
|
-
defaultIamRolePerAction,
|
|
45
|
-
awaitingMultipleStepsRole
|
|
46
|
-
} = require('../../../../../../../MainLibs/src/Consts.js').consts;
|
|
47
|
-
|
|
48
|
-
const templatePath = path.join(__dirname, 'template.ejs');
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* receive objectSchema
|
|
52
|
-
* create data for hdrInv template
|
|
53
|
-
*
|
|
54
|
-
* @return {{ templatePath, templateData, setting } }
|
|
55
|
-
*/
|
|
56
|
-
function data(_izContext, srcPath) {
|
|
57
|
-
const createSourceParams = createParamForCreateSource(srcPath);
|
|
58
|
-
return [createSourceParams];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function createParamForCreateSource(srcPath) {
|
|
62
|
-
const functionName = FUNCTION_NAME.updateRel;
|
|
63
|
-
const handler = HANDLER.hdrApi;
|
|
64
|
-
return {
|
|
65
|
-
templatePath: templatePath,
|
|
66
|
-
templateData: {
|
|
67
|
-
functionName
|
|
68
|
-
},
|
|
69
|
-
setting: {
|
|
70
|
-
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
71
|
-
saveFileName: `${upperCase(functionName)}_${upperCase(handler)}`,
|
|
72
|
-
fileExtension: '.js',
|
|
73
|
-
isAppend: false
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
module.exports = data;
|
|
@@ -1,142 +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
|
-
|
|
19
|
-
|
|
20
|
-
const { middlewareHandler, validatorSchema, response } = require("@izara_project/izara-middleware");
|
|
21
|
-
|
|
22
|
-
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
|
-
|
|
24
|
-
//(<optionalRequire>)
|
|
25
|
-
//(</optionalRequire>)
|
|
26
|
-
|
|
27
|
-
const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
|
|
28
|
-
|
|
29
|
-
// validate event params in middlewareHandler before into function
|
|
30
|
-
let basicValidatorSchema = {
|
|
31
|
-
type: "object",
|
|
32
|
-
required: ["firstObject","secondObject", "relType", "relationshipProperties","relationshipDirection","relId"],
|
|
33
|
-
properties: {
|
|
34
|
-
firstObject: {
|
|
35
|
-
type: "object",
|
|
36
|
-
required: ["objType","identifiers"],
|
|
37
|
-
properties: {
|
|
38
|
-
objType: {
|
|
39
|
-
type: "object",
|
|
40
|
-
required: ["serviceTag","objectType"],
|
|
41
|
-
properties: {
|
|
42
|
-
serviceTag: validatorSchema.stringNotEmpty(),
|
|
43
|
-
objectType: validatorSchema.stringNotEmpty(),
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
identifiers: {
|
|
47
|
-
type: "object",
|
|
48
|
-
minProperties: 1
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
secondObject: {
|
|
53
|
-
type: "object",
|
|
54
|
-
required: ["objType","identifiers"],
|
|
55
|
-
properties: {
|
|
56
|
-
objType: {
|
|
57
|
-
type: "object",
|
|
58
|
-
required: ["serviceTag","objectType"],
|
|
59
|
-
properties: {
|
|
60
|
-
serviceTag: validatorSchema.stringNotEmpty(),
|
|
61
|
-
objectType: validatorSchema.stringNotEmpty(),
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
identifiers: {
|
|
65
|
-
type: "object",
|
|
66
|
-
minProperties: 1
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
relType: {
|
|
71
|
-
type: "object",
|
|
72
|
-
required: ["relationshipTag", "serviceTag"],
|
|
73
|
-
properties: {
|
|
74
|
-
relationshipTag: validatorSchema.stringNotEmpty(),
|
|
75
|
-
serviceTag: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
pattern: "^[a-zA-Z0-9_-]+$",
|
|
78
|
-
enum: [process.env.iz_serviceTag]
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
relId: validatorSchema.stringNotEmpty(),
|
|
83
|
-
relationshipProperties: {
|
|
84
|
-
type: "object",
|
|
85
|
-
minProperties: 1
|
|
86
|
-
},
|
|
87
|
-
relationshipDirection: {
|
|
88
|
-
type: "string",
|
|
89
|
-
enum: ['from','to']
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
//(<globalVariable>
|
|
96
|
-
//</globalVariable>)
|
|
97
|
-
|
|
98
|
-
// validate event params in middlewareHandler before into main function
|
|
99
|
-
basicValidatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(basicValidatorSchema);
|
|
100
|
-
middlewareHandler.setValidatorSchema(basicValidatorSchema)
|
|
101
|
-
// if need to validate authorizer or additional params , add code to hook tag below
|
|
102
|
-
|
|
103
|
-
//(<afterValidateWith>)
|
|
104
|
-
//(</afterValidateWith>)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
module.exports.main = middlewareHandler.wrap(async (event, context, callback) => {
|
|
108
|
-
event._izContext.logger.debug('Event:', event);
|
|
109
|
-
try {
|
|
110
|
-
// invoke LambdaFunction
|
|
111
|
-
let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>(
|
|
112
|
-
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
|
|
113
|
-
{
|
|
114
|
-
firstObject: event.firstObject,
|
|
115
|
-
secondObject: event.secondObject,
|
|
116
|
-
relType: event.relType,
|
|
117
|
-
relationshipDirection: event.relationshipDirection,
|
|
118
|
-
relationshipProperties: event.relationshipProperties,
|
|
119
|
-
relId: event.relId
|
|
120
|
-
},
|
|
121
|
-
callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
// return error to client
|
|
125
|
-
if (lambdaFunctionResponse instanceof Error) {
|
|
126
|
-
return (response.failure(lambdaFunctionResponse));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// return success to client
|
|
130
|
-
return (response.success(lambdaFunctionResponse));
|
|
131
|
-
|
|
132
|
-
} catch (err) {
|
|
133
|
-
event._izContext.logger.error('Error, <%- functionName %>HdrApi: ', err);
|
|
134
|
-
return (response.failure(err));
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
<%_ function firstLetterUpperCase(text) {
|
|
138
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
139
|
-
} _%>
|
|
140
|
-
<%_ function firstLetterLowerCase(str) {
|
|
141
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
142
|
-
} _%>
|
|
@@ -1,79 +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
|
-
import path from 'path';
|
|
19
|
-
import { fileURLToPath } from 'url';
|
|
20
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
-
const __dirname = path.dirname(__filename);
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
ACTIONS,
|
|
25
|
-
HANDLER
|
|
26
|
-
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
27
|
-
|
|
28
|
-
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../#utils");
|
|
29
|
-
// const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, SNS_RESOURCE, DYNAMO_RESOURCE, defaultIamRolePerAction, awaitingMultipleStepsRole } = require("../../../#const");
|
|
30
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
|
|
31
|
-
require('../../../../../../../MainLibs/src/Consts.js').utils;
|
|
32
|
-
const {
|
|
33
|
-
DEFAULT_HANDLER_PER_ACTION,
|
|
34
|
-
createIamRole,
|
|
35
|
-
resourceNames,
|
|
36
|
-
RESOURCE_CLASSES,
|
|
37
|
-
DEFAULT_LAMBDA_ROLE_PER_ACTION,
|
|
38
|
-
SQS_RESOURCE,
|
|
39
|
-
SOURCE_PATH,
|
|
40
|
-
SAVE_FILE_NAME,
|
|
41
|
-
FUNCTION_NAME,
|
|
42
|
-
SNS_RESOURCE,
|
|
43
|
-
DYNAMO_RESOURCE,
|
|
44
|
-
defaultIamRolePerAction,
|
|
45
|
-
awaitingMultipleStepsRole
|
|
46
|
-
} = require('../../../../../../../MainLibs/src/Consts.js').consts;
|
|
47
|
-
|
|
48
|
-
const templatePath = path.join(__dirname, 'template.ejs');
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* receive objectSchema
|
|
52
|
-
* create data for hdrInv template
|
|
53
|
-
*
|
|
54
|
-
* @return {{ templatePath, templateData, setting } }
|
|
55
|
-
*/
|
|
56
|
-
function data(_izContext, srcPath) {
|
|
57
|
-
const createSourceParams = createParamForCreateSource(srcPath);
|
|
58
|
-
return [createSourceParams];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function createParamForCreateSource(srcPath) {
|
|
62
|
-
const functionName = FUNCTION_NAME.updateRel;
|
|
63
|
-
const handler = HANDLER.hdrDsq;
|
|
64
|
-
return {
|
|
65
|
-
templatePath: templatePath,
|
|
66
|
-
templateData: {
|
|
67
|
-
functionName,
|
|
68
|
-
queueName: upperCase(functionName) + upperCase(HANDLER.hdrDsq)
|
|
69
|
-
},
|
|
70
|
-
setting: {
|
|
71
|
-
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
72
|
-
saveFileName: `${upperCase(functionName)}_${upperCase(handler)}`,
|
|
73
|
-
fileExtension: '.js',
|
|
74
|
-
isAppend: false
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
module.exports = data;
|
|
@@ -1,188 +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
|
-
|
|
19
|
-
|
|
20
|
-
const { middlewareHandler, validatorSchema, response } = require("@izara_project/izara-middleware");
|
|
21
|
-
|
|
22
|
-
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
|
-
|
|
24
|
-
// const CorrelationIds = require('@izara_project/izara-core-library-correlation-ids')
|
|
25
|
-
// const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
|
-
// const IntegrationTestDetail = require('@izara_project/izara-core-library-integration-tests')
|
|
27
|
-
const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
|
|
28
|
-
const Logger = require("@izara_project/izara-core-library-logger/src/Logger");
|
|
29
|
-
|
|
30
|
-
//(<optionalRequire>)
|
|
31
|
-
//(</optionalRequire>)
|
|
32
|
-
|
|
33
|
-
const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
|
|
34
|
-
|
|
35
|
-
// validate event properties in body.Message of sqs event
|
|
36
|
-
middlewareHandler.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
|
|
37
|
-
{
|
|
38
|
-
type: "object",
|
|
39
|
-
required: ['body', 'messageAttributes'],
|
|
40
|
-
properties: {
|
|
41
|
-
body: {
|
|
42
|
-
type: 'object',
|
|
43
|
-
},
|
|
44
|
-
messageAttributes: {
|
|
45
|
-
type: 'object'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
));
|
|
50
|
-
|
|
51
|
-
// validate event params in middlewareHandler before into function
|
|
52
|
-
let basicValidatorSchema = {
|
|
53
|
-
type: "object",
|
|
54
|
-
required: ["firstObject","secondObject", "relType", "relationshipProperties","relationshipDirection","relId"],
|
|
55
|
-
properties: {
|
|
56
|
-
firstObject: {
|
|
57
|
-
type: "object",
|
|
58
|
-
required: ["objType","identifiers"],
|
|
59
|
-
properties: {
|
|
60
|
-
objType: {
|
|
61
|
-
type: "object",
|
|
62
|
-
required: ["serviceTag","objectType"],
|
|
63
|
-
properties: {
|
|
64
|
-
serviceTag: validatorSchema.stringNotEmpty(),
|
|
65
|
-
objectType: validatorSchema.stringNotEmpty(),
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
identifiers: {
|
|
69
|
-
type: "object",
|
|
70
|
-
minProperties: 1
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
secondObject: {
|
|
75
|
-
type: "object",
|
|
76
|
-
required: ["objType","identifiers"],
|
|
77
|
-
properties: {
|
|
78
|
-
objType: {
|
|
79
|
-
type: "object",
|
|
80
|
-
required: ["serviceTag","objectType"],
|
|
81
|
-
properties: {
|
|
82
|
-
serviceTag: validatorSchema.stringNotEmpty(),
|
|
83
|
-
objectType: validatorSchema.stringNotEmpty(),
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
identifiers: {
|
|
87
|
-
type: "object",
|
|
88
|
-
minProperties: 1
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
relType: {
|
|
93
|
-
type: "object",
|
|
94
|
-
required: ["relationshipTag", "serviceTag"],
|
|
95
|
-
properties: {
|
|
96
|
-
relationshipTag: validatorSchema.stringNotEmpty(),
|
|
97
|
-
serviceTag: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
pattern: "^[a-zA-Z0-9_-]+$",
|
|
100
|
-
enum: [process.env.iz_serviceTag]
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
relId: validatorSchema.stringNotEmpty(),
|
|
105
|
-
relationshipProperties: {
|
|
106
|
-
type: "object",
|
|
107
|
-
minProperties: 1
|
|
108
|
-
},
|
|
109
|
-
relationshipDirection: {
|
|
110
|
-
type: "string",
|
|
111
|
-
enum: ['from','to']
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
//(<globalVariable>
|
|
118
|
-
//</globalVariable>)
|
|
119
|
-
|
|
120
|
-
// validate event params in middlewareHandler before into main function
|
|
121
|
-
basicValidatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(basicValidatorSchema);
|
|
122
|
-
// if need to validate authorizer or additional params , add code to hook tag below
|
|
123
|
-
|
|
124
|
-
//(<afterValidateWith>)
|
|
125
|
-
//(</afterValidateWith>)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
module.exports.main = middlewareHandler.wrap(async (event, context, callback) => {
|
|
129
|
-
Logger.debug('event:', event);
|
|
130
|
-
Logger.debug('context:', context);
|
|
131
|
-
try {
|
|
132
|
-
|
|
133
|
-
let recordPromises = []; // final return
|
|
134
|
-
|
|
135
|
-
// loop each record and send to mainFunction
|
|
136
|
-
await Promise.all(event.Records.map(async record => { // promise.all for map() function
|
|
137
|
-
|
|
138
|
-
// --- reforming record.body for Dsq request
|
|
139
|
-
record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
|
|
140
|
-
record._izContext.logger.debug('record LambdaFunctionHdrDsq after reform', record);
|
|
141
|
-
|
|
142
|
-
let passOnProperties = []
|
|
143
|
-
|
|
144
|
-
// --- validate message (and MessageAttributes)
|
|
145
|
-
await recordHandlerSharedLib.validateRecord(
|
|
146
|
-
record, // one record will send to mainFunction
|
|
147
|
-
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
148
|
-
basicValidatorSchema, // schema for record.Message
|
|
149
|
-
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
// add argument (to invoke lambda) to passOnProperties[]
|
|
153
|
-
passOnProperties.push(record.body.Message)
|
|
154
|
-
passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message));
|
|
155
|
-
//(<afterPutParamIntoMainFunction>)
|
|
156
|
-
//(</afterPutParamIntoMainFunction>)
|
|
157
|
-
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
158
|
-
|
|
159
|
-
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
160
|
-
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
161
|
-
record, // one record will send to mainFunction
|
|
162
|
-
<%- functionName %>.<%- functionName %>, // mainFunction that need to invoke.
|
|
163
|
-
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
164
|
-
passOnProperties, // all parameters that mainFunction needed.
|
|
165
|
-
);
|
|
166
|
-
record._izContext.logger.debug('after recordPromise in handler');
|
|
167
|
-
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
168
|
-
})) //end record
|
|
169
|
-
|
|
170
|
-
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
171
|
-
try {
|
|
172
|
-
await Promise.all(recordPromises); // await all promises
|
|
173
|
-
return event.Records // return all for local test
|
|
174
|
-
} catch {
|
|
175
|
-
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
176
|
-
}
|
|
177
|
-
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
178
|
-
} catch (err) {
|
|
179
|
-
Logger.error('Unhandled Error, updateRelationshipHdrDsq:', err);
|
|
180
|
-
throw (err);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
<%_ function firstLetterUpperCase(text) {
|
|
184
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
185
|
-
} _%>
|
|
186
|
-
<%_ function firstLetterLowerCase(str) {
|
|
187
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
188
|
-
} _%>
|
|
@@ -1,80 +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
|
-
import path from 'path';
|
|
19
|
-
import { fileURLToPath } from 'url';
|
|
20
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
-
const __dirname = path.dirname(__filename);
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
ACTIONS,
|
|
25
|
-
HANDLER
|
|
26
|
-
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
27
|
-
|
|
28
|
-
// const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../#utils");
|
|
29
|
-
// const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, SNS_RESOURCE, DYNAMO_RESOURCE, defaultIamRolePerAction, awaitingMultipleStepsRole } = require("../../../#const");
|
|
30
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
|
|
31
|
-
require('../../../../../../../MainLibs/src/Consts.js').utils;
|
|
32
|
-
const {
|
|
33
|
-
DEFAULT_HANDLER_PER_ACTION,
|
|
34
|
-
createIamRole,
|
|
35
|
-
resourceNames,
|
|
36
|
-
RESOURCE_CLASSES,
|
|
37
|
-
DEFAULT_LAMBDA_ROLE_PER_ACTION,
|
|
38
|
-
SQS_RESOURCE,
|
|
39
|
-
SOURCE_PATH,
|
|
40
|
-
SAVE_FILE_NAME,
|
|
41
|
-
FUNCTION_NAME,
|
|
42
|
-
SNS_RESOURCE,
|
|
43
|
-
DYNAMO_RESOURCE,
|
|
44
|
-
defaultIamRolePerAction,
|
|
45
|
-
awaitingMultipleStepsRole
|
|
46
|
-
} = require('../../../../../../../MainLibs/src/Consts.js').consts;
|
|
47
|
-
|
|
48
|
-
const templatePath = path.join(__dirname, 'template.ejs');
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* receive objectSchema
|
|
52
|
-
* create data for hdrInv template
|
|
53
|
-
*
|
|
54
|
-
* @return {{ templatePath, templateData, setting } }
|
|
55
|
-
*/
|
|
56
|
-
function data(_izContext, srcPath) {
|
|
57
|
-
const createSourceParams = createParamForCreateSource(srcPath);
|
|
58
|
-
// console.log("createSourceArrayInUpdateRelationshipHdrInv", createSourceArray)
|
|
59
|
-
return [createSourceParams];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function createParamForCreateSource(srcPath) {
|
|
63
|
-
const functionName = FUNCTION_NAME.updateRel;
|
|
64
|
-
const handler = HANDLER.hdrInv;
|
|
65
|
-
return {
|
|
66
|
-
templatePath: templatePath,
|
|
67
|
-
templateData: {
|
|
68
|
-
functionName,
|
|
69
|
-
queueName: upperCase(functionName) + upperCase(handler)
|
|
70
|
-
},
|
|
71
|
-
setting: {
|
|
72
|
-
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
73
|
-
saveFileName: `${upperCase(functionName)}_${upperCase(handler)}`,
|
|
74
|
-
fileExtension: '.js',
|
|
75
|
-
isAppend: false
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
module.exports = data;
|