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