@izara_project/izara-core-generate-service-code 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +41 -0
- package/package.json +10 -10
- package/src/GenerateCode.js +184 -0
- package/src/GenerateResources.js +121 -0
- package/src/GenerateSchema.js +164 -0
- package/src/GenerateTests.js +138 -0
- package/src/IntTestConfig.js +23 -0
- package/src/SchemaConfig.js +23 -0
- package/src/SourceManager/CreateSource.js +226 -0
- package/src/TemplateConfig.js +55 -0
- package/src/TemplateData/Auth/generateAuthYml/data.js +47 -0
- package/src/TemplateData/Auth/generateAuthYml/template.ejs +16 -0
- package/src/TemplateData/Auth/generateTemplateData.js +48 -0
- package/src/TemplateData/EndpointPerService/generateTemplateData.js +127 -0
- package/src/TemplateData/EndpointPerService/handler/api/data.js +72 -0
- package/src/TemplateData/EndpointPerService/handler/api/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/api/template.ejs +73 -0
- package/src/TemplateData/EndpointPerService/handler/dsq/data.js +76 -0
- package/src/TemplateData/EndpointPerService/handler/dsq/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/dsq/template.ejs +129 -0
- package/src/TemplateData/EndpointPerService/handler/inv/data.js +78 -0
- package/src/TemplateData/EndpointPerService/handler/inv/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/inv/template.ejs +73 -0
- package/src/TemplateData/EndpointPerService/handler/sqs/data.js +76 -0
- package/src/TemplateData/EndpointPerService/handler/sqs/request.json +7 -0
- package/src/TemplateData/EndpointPerService/handler/sqs/template.ejs +131 -0
- package/src/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +358 -0
- package/src/TemplateData/EndpointPerService/mainFunction/create/data.js +51 -0
- package/src/TemplateData/EndpointPerService/mainFunction/create/template.ejs +627 -0
- package/src/TemplateData/EndpointPerService/mainFunction/delete/data.js +51 -0
- package/src/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +163 -0
- package/src/TemplateData/EndpointPerService/mainFunction/get/data.js +52 -0
- package/src/TemplateData/EndpointPerService/mainFunction/get/template.ejs +273 -0
- package/src/TemplateData/EndpointPerService/mainFunction/update/data.js +52 -0
- package/src/TemplateData/EndpointPerService/mainFunction/update/template.ejs +446 -0
- package/src/TemplateData/EndpointPerService/yaml/data.js +311 -0
- package/src/TemplateData/EndpointPerService/yaml/template.ejs +35 -0
- package/src/TemplateData/IntTest/generateResources/generateResources.js +112 -0
- package/src/TemplateData/IntTest/generateResources/templateResources.ejs +33 -0
- package/src/TemplateData/IntTest/generateTests/events/data.js +135 -0
- package/src/TemplateData/IntTest/generateTests/events/templateEvents.ejs +11 -0
- package/src/TemplateData/IntTest/generateTests/generateTemplate.js +67 -0
- package/src/TemplateData/IntTest/generateTests/pathIntTest/data.js +56 -0
- package/src/TemplateData/IntTest/generateTests/pathIntTest/template.ejs +5 -0
- package/src/TemplateData/IntTest/generateTests/tests/data.js +211 -0
- package/src/TemplateData/IntTest/generateTests/tests/templateTests.ejs +3 -0
- package/src/TemplateData/IntTest/libs/libs.js +416 -0
- package/src/TemplateData/IntTest/upload/uploadIntTest.js +95 -0
- package/src/TemplateData/externalService/functionNameConfig/data.js +178 -0
- package/src/TemplateData/externalService/functionNameConfig/template.ejs +14 -0
- package/src/TemplateData/externalService/functionNameConfig/templateIntTesting.ejs +31 -0
- package/src/TemplateData/externalService/functionNameConfig/templateYaml.ejs +10 -0
- package/src/TemplateData/externalService/generateTemplateData.js +79 -0
- package/src/TemplateData/externalService/lambdaRole/data.js +448 -0
- package/src/TemplateData/externalService/lambdaRole/request.json +18 -0
- package/src/TemplateData/externalService/lambdaRole/template.ejs +59 -0
- package/src/TemplateData/externalService/snsTopicSubscriptions/data.js +271 -0
- package/src/TemplateData/externalService/snsTopicSubscriptions/request.json +12 -0
- package/src/TemplateData/externalService/snsTopicSubscriptions/template.ejs +35 -0
- package/src/TemplateData/findData/GetByStorage/getByDynamo.ejs +54 -0
- package/src/TemplateData/findData/GetByStorage/getByGraph.ejs +81 -0
- package/src/TemplateData/findData/findDataYaml/data.js +187 -0
- package/src/TemplateData/findData/findDataYaml/template.ejs +14 -0
- package/src/TemplateData/findData/generateTemplateData.js +69 -0
- package/src/TemplateData/findData/handler/data.js +51 -0
- package/src/TemplateData/findData/handler/template.ejs +136 -0
- package/src/TemplateData/findData/mainFunction/data.js +316 -0
- package/src/TemplateData/findData/mainFunction/template.ejs +149 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +129 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +68 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +84 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +71 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +118 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +73 -0
- package/src/TemplateData/flowSchema/CreateRecordComplete/queue/template.ejs +49 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +128 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +17 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +123 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +58 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +129 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +62 -0
- package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/template.ejs +45 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +116 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/handler/data.js +67 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +83 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +67 -0
- package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +131 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +118 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +17 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +65 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +99 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +63 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +81 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +69 -0
- package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/template.ejs +49 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +138 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/template.ejs +18 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/template.ejs +123 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +262 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/template.ejs +45 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +144 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +14 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +66 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +121 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +61 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +172 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +68 -0
- package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/template.ejs +53 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +139 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/template.ejs +25 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +52 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +50 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +182 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +51 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +68 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/queue/data.js +77 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/queue/dsqTemplatePath.ejs +32 -0
- package/src/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs +59 -0
- package/src/TemplateData/flowSchema/components/upload/relate/S3/data.js +60 -0
- package/src/TemplateData/flowSchema/components/upload/relate/S3/template.ejs +13 -0
- package/src/TemplateData/flowSchema/components/upload/relate/libs/data.js +53 -0
- package/src/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +97 -0
- package/src/TemplateData/flowSchema/components/upload/relate/sns-out/data.js +66 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +91 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +17 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/handler/data.js +58 -0
- package/src/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +72 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +69 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +69 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ttlDynamoTemplate.ejs +32 -0
- package/src/TemplateData/flowSchema/components/websocket/dynamoDb/userUploadRecords.js +61 -0
- package/src/TemplateData/flowSchema/dynamoDb/data.js +116 -0
- package/src/TemplateData/flowSchema/eventBridge/functionYaml/data.js +167 -0
- package/src/TemplateData/flowSchema/eventBridge/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/eventBridge/handler/inv/data.js +69 -0
- package/src/TemplateData/flowSchema/eventBridge/handler/inv/request.json +7 -0
- package/src/TemplateData/flowSchema/eventBridge/handler/inv/template.ejs +60 -0
- package/src/TemplateData/flowSchema/eventBridge/mainFunction/data.js +67 -0
- package/src/TemplateData/flowSchema/eventBridge/mainFunction/request.json +5 -0
- package/src/TemplateData/flowSchema/eventBridge/mainFunction/template.ejs +59 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +111 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +93 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/handler/template.ejs +81 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +68 -0
- package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/template.ejs +58 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +156 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/handler/data.js +65 -0
- package/src/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +101 -0
- package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +77 -0
- package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/flowSchema/externalTopic/sns-out/data.js +72 -0
- package/src/TemplateData/flowSchema/flowSchemaMainFunction/data.js +120 -0
- package/src/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +92 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +111 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +70 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +81 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +70 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +61 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +145 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +68 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +87 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +111 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +18 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +65 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +108 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +65 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +106 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +100 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/sqsTemplate.ejs +43 -0
- package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +74 -0
- package/src/TemplateData/flowSchema/flowStep/functionYaml/data.js +152 -0
- package/src/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +20 -0
- package/src/TemplateData/flowSchema/flowStep/handler/data.js +102 -0
- package/src/TemplateData/flowSchema/flowStep/handler/template.ejs +89 -0
- package/src/TemplateData/flowSchema/flowStep/mainFunction/data.js +100 -0
- package/src/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +58 -0
- package/src/TemplateData/flowSchema/flowStep/sns-in/data.js +98 -0
- package/src/TemplateData/flowSchema/flowStep/sns-in/template.ejs +59 -0
- package/src/TemplateData/flowSchema/generateTemplateData.js +808 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +85 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/template.ejs +28 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +67 -0
- package/src/TemplateData/flowSchema/lambdaSync/Api/handler/template.ejs +86 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +74 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/template.ejs +13 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +64 -0
- package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/template.ejs +52 -0
- package/src/TemplateData/flowSchema/register/complete/functionYaml/data.js +113 -0
- package/src/TemplateData/flowSchema/register/complete/functionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/register/complete/handler/data.js +58 -0
- package/src/TemplateData/flowSchema/register/complete/handler/template.ejs +85 -0
- package/src/TemplateData/flowSchema/register/complete/mainFunction/data.js +62 -0
- package/src/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +176 -0
- package/src/TemplateData/flowSchema/register/dynamoDB/register.js +73 -0
- package/src/TemplateData/flowSchema/register/sns-in/data.js +58 -0
- package/src/TemplateData/flowSchema/register/sns-in/template.ejs +45 -0
- package/src/TemplateData/flowSchema/register/subscriptionOutAll/data.js +82 -0
- package/src/TemplateData/flowSchema/register/subscriptionOutAll/template.ejs +13 -0
- package/src/TemplateData/flowSchema/register/wbs/functionYaml/data.js +107 -0
- package/src/TemplateData/flowSchema/register/wbs/functionYaml/template.ejs +19 -0
- package/src/TemplateData/flowSchema/register/wbs/handler/data.js +65 -0
- package/src/TemplateData/flowSchema/register/wbs/handler/template.ejs +83 -0
- package/src/TemplateData/flowSchema/register/wbs/mainFunction/data.js +56 -0
- package/src/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +165 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +143 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +73 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +86 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +62 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/template.ejs +80 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/sns/data.js +63 -0
- package/src/TemplateData/flowSchema/statusFieldComponent/sns/template.ejs +59 -0
- package/src/TemplateData/flowSchema/templateByStatusType/statusFieldTemplate.ejs +30 -0
- package/src/TemplateData/flowSchema/templateByStatusType/storedCacheTemplate.ejs +26 -0
- package/src/TemplateData/flowSchema/templateByStatusType/triggerCacheTemplate.ejs +44 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +135 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +70 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/template.ejs +89 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +72 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/template.ejs +85 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +139 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/template.ejs +22 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +73 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +89 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +69 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/template.ejs +58 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +131 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +69 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/template.ejs +88 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +69 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +74 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/data.js +90 -0
- package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/template.ejs +49 -0
- package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +137 -0
- package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/flowSchema/webSocketComplete/handler/data.js +61 -0
- package/src/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +85 -0
- package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/data.js +55 -0
- package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/template.ejs +134 -0
- package/src/TemplateData/flowSchema/webSocketComplete/sqs/data.js +100 -0
- package/src/TemplateData/flowSchema/webSocketComplete/sqs/template.ejs +43 -0
- package/src/TemplateData/flowSchema/webSocketComplete/sqs/templateSub.ejs +7 -0
- package/src/TemplateData/generateRole/createSharedResource.js +469 -0
- package/src/TemplateData/generateRole/data.js +92 -0
- package/src/TemplateData/generateRole/sharedResourceTemplate.ejs +32 -0
- package/src/TemplateData/generateRole/template.ejs +33 -0
- package/src/TemplateData/perActionComplete/create/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/create/handler/template.ejs +126 -0
- package/src/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +196 -0
- package/src/TemplateData/perActionComplete/create/mainFunction/data.js +53 -0
- package/src/TemplateData/perActionComplete/create/mainFunction/template.ejs +187 -0
- package/src/TemplateData/perActionComplete/create/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/perActionComplete/create/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/create/sns-out/data.js +67 -0
- package/src/TemplateData/perActionComplete/create/sns-out/template.ejs +10 -0
- package/src/TemplateData/perActionComplete/create/yaml/data.js +106 -0
- package/src/TemplateData/perActionComplete/create/yaml/template.ejs +21 -0
- package/src/TemplateData/perActionComplete/delete/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/delete/handler/template.ejs +125 -0
- package/src/TemplateData/perActionComplete/delete/mainFunction/data.js +53 -0
- package/src/TemplateData/perActionComplete/delete/mainFunction/template.ejs +88 -0
- package/src/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/perActionComplete/delete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/delete/sns-out/data.js +67 -0
- package/src/TemplateData/perActionComplete/delete/yaml/data.js +104 -0
- package/src/TemplateData/perActionComplete/delete/yaml/template.ejs +20 -0
- package/src/TemplateData/perActionComplete/generateTemplateData.js +162 -0
- package/src/TemplateData/perActionComplete/get/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/get/handler/template.ejs +125 -0
- package/src/TemplateData/perActionComplete/get/mainFunction/data.js +54 -0
- package/src/TemplateData/perActionComplete/get/mainFunction/template.ejs +131 -0
- package/src/TemplateData/perActionComplete/get/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/perActionComplete/get/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/get/sns-out/data.js +67 -0
- package/src/TemplateData/perActionComplete/get/yaml/data.js +106 -0
- package/src/TemplateData/perActionComplete/get/yaml/template.ejs +21 -0
- package/src/TemplateData/perActionComplete/update/handler/data.js +61 -0
- package/src/TemplateData/perActionComplete/update/handler/template.ejs +125 -0
- package/src/TemplateData/perActionComplete/update/mainFunction/data.js +53 -0
- package/src/TemplateData/perActionComplete/update/mainFunction/template.ejs +133 -0
- package/src/TemplateData/perActionComplete/update/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/perActionComplete/update/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/perActionComplete/update/sns-out/data.js +66 -0
- package/src/TemplateData/perActionComplete/update/yaml/data.js +107 -0
- package/src/TemplateData/perActionComplete/update/yaml/template.ejs +20 -0
- package/src/TemplateData/perActionEndpoint/generateTemplateData.js +112 -0
- package/src/TemplateData/perActionEndpoint/handler/api/data.js +109 -0
- package/src/TemplateData/perActionEndpoint/handler/api/request.json +7 -0
- package/src/TemplateData/perActionEndpoint/handler/api/template.ejs +36 -0
- package/src/TemplateData/perActionEndpoint/handler/dsq/data.js +118 -0
- package/src/TemplateData/perActionEndpoint/handler/dsq/request.json +7 -0
- package/src/TemplateData/perActionEndpoint/handler/dsq/template.ejs +55 -0
- package/src/TemplateData/perActionEndpoint/handler/inv/data.js +112 -0
- package/src/TemplateData/perActionEndpoint/handler/inv/request.json +7 -0
- package/src/TemplateData/perActionEndpoint/handler/inv/template.ejs +37 -0
- package/src/TemplateData/perActionEndpoint/handler/sqs/data.js +116 -0
- package/src/TemplateData/perActionEndpoint/handler/sqs/request.json +7 -0
- package/src/TemplateData/perActionEndpoint/handler/sqs/template.ejs +57 -0
- package/src/TemplateData/perActionEndpoint/handler/webSocket/data.js +94 -0
- package/src/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +61 -0
- package/src/TemplateData/perActionEndpoint/handler/webSocketConnect/data.js +54 -0
- package/src/TemplateData/perActionEndpoint/handler/webSocketConnect/template.ejs +55 -0
- package/src/TemplateData/perActionEndpoint/libs/data.js +60 -0
- package/src/TemplateData/perActionEndpoint/libs/template.ejs +46 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/create/data.js +91 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/create/request.json +0 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +339 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/delete/data.js +91 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +99 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/get/data.js +92 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/get/request.json +5 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/get/template.ejs +116 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/get/testParam.json +5 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/update/data.js +85 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/update/request.json +0 -0
- package/src/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +166 -0
- package/src/TemplateData/perActionEndpoint/yaml/api/data.js +229 -0
- package/src/TemplateData/perActionEndpoint/yaml/api/request.json +14 -0
- package/src/TemplateData/perActionEndpoint/yaml/api/template.ejs +20 -0
- package/src/TemplateData/perActionEndpoint/yaml/dsq/data.js +234 -0
- package/src/TemplateData/perActionEndpoint/yaml/dsq/request.json +19 -0
- package/src/TemplateData/perActionEndpoint/yaml/dsq/template.ejs +17 -0
- package/src/TemplateData/perActionEndpoint/yaml/inv/data.js +207 -0
- package/src/TemplateData/perActionEndpoint/yaml/inv/example req.js +15 -0
- package/src/TemplateData/perActionEndpoint/yaml/inv/request.json +14 -0
- package/src/TemplateData/perActionEndpoint/yaml/inv/template.ejs +13 -0
- package/src/TemplateData/perActionEndpoint/yaml/sqs/data.js +237 -0
- package/src/TemplateData/perActionEndpoint/yaml/sqs/request.json +19 -0
- package/src/TemplateData/perActionEndpoint/yaml/sqs/template.ejs +17 -0
- package/src/TemplateData/perActionEndpoint/yaml/wbs/data.js +204 -0
- package/src/TemplateData/perActionEndpoint/yaml/wbs/request.json +19 -0
- package/src/TemplateData/perActionEndpoint/yaml/wbs/template.ejs +29 -0
- package/src/TemplateData/perActionEndpoint/yaml/webSocketConnect/data.js +58 -0
- package/src/TemplateData/perActionEndpoint/yaml/webSocketConnect/template.ejs +10 -0
- package/src/TemplateData/processLogical/generateTemplateData.js +60 -0
- package/src/TemplateData/processLogical/handler/data.js +50 -0
- package/src/TemplateData/processLogical/handler/template.ejs +127 -0
- package/src/TemplateData/processLogical/mainFunction/data.js +49 -0
- package/src/TemplateData/processLogical/mainFunction/template.ejs +424 -0
- package/src/TemplateData/processLogical/yaml/data.js +172 -0
- package/src/TemplateData/processLogical/yaml/template.ejs +12 -0
- package/src/TemplateData/processLogicalPagination/DsqYaml/data.js +50 -0
- package/src/TemplateData/processLogicalPagination/DsqYaml/template.ejs +32 -0
- package/src/TemplateData/processLogicalPagination/generateTemplateData.js +68 -0
- package/src/TemplateData/processLogicalPagination/handler/dsq/data.js +49 -0
- package/src/TemplateData/processLogicalPagination/handler/dsq/template.ejs +160 -0
- package/src/TemplateData/processLogicalPagination/handler/sqs/data.js +48 -0
- package/src/TemplateData/processLogicalPagination/handler/sqs/template.ejs +143 -0
- package/src/TemplateData/processLogicalPagination/mainFunction/data.js +48 -0
- package/src/TemplateData/processLogicalPagination/mainFunction/template.ejs +210 -0
- package/src/TemplateData/processLogicalPagination/yaml/dsq/data.js +162 -0
- package/src/TemplateData/processLogicalPagination/yaml/dsq/template.ejs +12 -0
- package/src/TemplateData/processLogicalPagination/yaml/sqs/data.js +171 -0
- package/src/TemplateData/processLogicalPagination/yaml/sqs/template.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/data.js +146 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +161 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/data.js +146 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/data.js +146 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/template.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/data.js +147 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/template.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/template.ejs +202 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/template.ejs +144 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/template.ejs +77 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +153 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +197 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +141 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +59 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +377 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +73 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +116 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +55 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +150 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +175 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/api/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +201 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +176 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +175 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/inv/template.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +177 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/api/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +57 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/data.js +71 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +184 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/inv/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +75 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/apiTemplate.ejs +137 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +179 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/invTemplate.ejs +123 -0
- package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
- package/src/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +57 -0
- package/src/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +443 -0
- package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +74 -0
- package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +117 -0
- package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +55 -0
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +151 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-out/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/create/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +178 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/api/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +201 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +176 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +178 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/template.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +176 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/api/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +139 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +182 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +124 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +162 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/apiTemplate.ejs +139 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +182 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/invTemplate.ejs +124 -0
- package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +162 -0
- package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +61 -0
- package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +365 -0
- package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +74 -0
- package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +115 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +55 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +143 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/generateTemplateData.js +547 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +168 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/api/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +202 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +177 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +167 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/inv/template.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +166 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/api/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/api/template.ejs +138 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/data.js +72 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/template.ejs +185 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/inv/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/inv/template.ejs +127 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/template.ejs +165 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/apiTemplate.ejs +137 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +178 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/invTemplate.ejs +122 -0
- package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
- package/src/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +58 -0
- package/src/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +317 -0
- package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +74 -0
- package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +116 -0
- package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +61 -0
- package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +127 -0
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +56 -0
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +143 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +65 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-out/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/get/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +168 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +71 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +155 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +198 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +143 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +182 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +57 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +379 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +73 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +115 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +126 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +58 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +155 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +64 -0
- package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +167 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/template.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +191 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +196 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +186 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/template.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +187 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/template.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/dsqTemplate.ejs +18 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
- package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/api/data.js +78 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/api/request.json +7 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +142 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/data.js +73 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/data.js +79 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/request.json +7 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +188 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/inv/data.js +80 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/inv/request.json +5 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +147 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/data.js +79 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/request.json +7 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +163 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/template.ejs +9 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/apiTemplate.ejs +138 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +180 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/invTemplate.ejs +124 -0
- package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/request.json +1 -0
- package/src/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +384 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +83 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-out/data.js +68 -0
- package/src/TemplateData/relationshipPerAction/update/action/sns-out/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +117 -0
- package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +21 -0
- package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +60 -0
- package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/request.json +0 -0
- package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +128 -0
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +55 -0
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/request.json +1 -0
- package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +145 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +63 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/template.ejs +46 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +62 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-out/request.json +3 -0
- package/src/TemplateData/relationshipPerAction/update/complete/sns-out/template.ejs +10 -0
- package/src/TemplateData/resourceYaml/CreateSourceData.js +79 -0
- package/src/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +145 -0
- package/src/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +111 -0
- package/src/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +165 -0
- package/src/TemplateData/resourceYaml/dynamodb/template.ejs +29 -0
- package/src/TemplateData/resourceYaml/filterGenerateResource/data.js +124 -0
- package/src/TemplateData/resourceYaml/generateTemplateData.js +146 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +91 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/request.json +4 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +84 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateData/resourceYaml/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateData/resourceYaml/sns-out/data.js +78 -0
- package/src/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +64 -0
- package/src/TemplateData/resourceYaml/sns-out/request.json +3 -0
- package/src/TemplateData/resourceYaml/sns-out/template.ejs +10 -0
- package/src/libs/Consts.js +432 -0
- package/src/libs/GenerateCodeLibs.js +32 -0
- package/src/libs/Libs.js +357 -0
- package/src/libs/Utils.js +140 -0
package/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2021 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 createSource from './src/SourceManager/CreateSource.js';
|
|
19
|
+
import generateCode from './src/GenerateCode.js';
|
|
20
|
+
import generateSchema from './src/GenerateSchema.js';
|
|
21
|
+
import generateIntTest from './src/GenerateTests.js';
|
|
22
|
+
import generateResourceIntTest from './src/GenerateResources.js';
|
|
23
|
+
|
|
24
|
+
import consts from './src/libs/Consts.js';
|
|
25
|
+
import generateCodeLibs from './src/libs/GenerateCodeLibs.js';
|
|
26
|
+
import libs from './src/libs/Libs.js';
|
|
27
|
+
import utils from './src/libs/Utils.js';
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
createSource,
|
|
31
|
+
// main generateCode
|
|
32
|
+
generateCode,
|
|
33
|
+
generateSchema,
|
|
34
|
+
generateIntTest,
|
|
35
|
+
generateResourceIntTest,
|
|
36
|
+
// libs
|
|
37
|
+
consts,
|
|
38
|
+
generateCodeLibs,
|
|
39
|
+
libs,
|
|
40
|
+
utils
|
|
41
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-core-generate-service-code",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Code for locally generating per service files",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"testEnvironment": "node"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@izara_project/izara-
|
|
24
|
-
"@izara_project/izara-core-library-
|
|
25
|
-
"@izara_project/izara-
|
|
26
|
-
"@izara_project/izara-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
23
|
+
"@izara_project/izara-market-library-service-schemas": "^1.0.84",
|
|
24
|
+
"@izara_project/izara-core-library-service-schemas": "^1.0.106",
|
|
25
|
+
"@izara_project/izara-shared-core": "^1.0.8",
|
|
26
|
+
"@izara_project/izara-shared-service-schemas": "^1.0.35",
|
|
27
|
+
"ejs": "^3.1.10",
|
|
28
|
+
"js-beautify": "^1.15.4",
|
|
29
|
+
"lodash": "^4.17.21",
|
|
30
|
+
"yaml": "^2.8.2"
|
|
31
31
|
}
|
|
32
|
-
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
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 { join, dirname } from 'path';
|
|
19
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = dirname(__filename);
|
|
22
|
+
|
|
23
|
+
import { readFileSync } from 'fs';
|
|
24
|
+
|
|
25
|
+
import { validatePathWithRootServicePath } from './libs/GenerateCodeLibs.js';
|
|
26
|
+
|
|
27
|
+
import { templateConfig } from './TemplateConfig.js';
|
|
28
|
+
// SourceManager
|
|
29
|
+
import { utils, createSource } from '../../izara-market-library-service-schemas/src/SourceManager/index.js';
|
|
30
|
+
const { deleteFileInDir } = utils;
|
|
31
|
+
|
|
32
|
+
//* get functionNameConfig
|
|
33
|
+
import functionNameConfigYamlData from './TemplateData/externalService/functionNameConfig/data.js';
|
|
34
|
+
import generateRole from './TemplateData/generateRole/data.js';
|
|
35
|
+
|
|
36
|
+
async function generateCodeWithTemplate(
|
|
37
|
+
_izContext,
|
|
38
|
+
objSchemaPath,
|
|
39
|
+
settings = {}
|
|
40
|
+
) {
|
|
41
|
+
try {
|
|
42
|
+
// console.log('objSchemaPath', objSchemaPath);
|
|
43
|
+
// --------- Prepare path -------------
|
|
44
|
+
// point to app/src
|
|
45
|
+
let saveFilePath = join(objSchemaPath, `../`);
|
|
46
|
+
|
|
47
|
+
// point to root folder of service
|
|
48
|
+
let localServicePath = join(saveFilePath, '../../');
|
|
49
|
+
|
|
50
|
+
// // define path for store yml file
|
|
51
|
+
// const GENERATE_CODE_SOURCE_PATH = {
|
|
52
|
+
// appYaml: join(saveFilePath, SOURCE_PATH.appYaml),
|
|
53
|
+
// resourceYaml: join(saveFilePath, SOURCE_PATH.resourceYaml),
|
|
54
|
+
// lambdaPerAction: join(saveFilePath, SOURCE_PATH.lambdaPerAction),
|
|
55
|
+
// externalService: join(saveFilePath, SOURCE_PATH.externalService),
|
|
56
|
+
// relationshipPerAction: join(saveFilePath, SOURCE_PATH.relationshipPerAction),
|
|
57
|
+
// webSocketEndpoint: join(saveFilePath, SOURCE_PATH.webSocket),
|
|
58
|
+
// generateCodeLib: join(saveFilePath, SOURCE_PATH.generateCodeLib),
|
|
59
|
+
// generatedMainFunctionPerService: join(saveFilePath, SOURCE_PATH.endpointPerService),
|
|
60
|
+
// flowSchema: join(saveFilePath, '../src/generatedCode/flowSchema')
|
|
61
|
+
// };
|
|
62
|
+
|
|
63
|
+
//------ Start Create Source ------
|
|
64
|
+
|
|
65
|
+
// collect all result of template data for execute createSource
|
|
66
|
+
let allCreateSource = [];
|
|
67
|
+
|
|
68
|
+
// * iterate templateConfig for generate data
|
|
69
|
+
for (const templateName in templateConfig.TemplateAndData) {
|
|
70
|
+
// Display log indicating which template is being loaded
|
|
71
|
+
let generateTemplateData = (
|
|
72
|
+
await import(
|
|
73
|
+
join(__dirname, templateConfig.TemplateAndData[templateName])
|
|
74
|
+
)
|
|
75
|
+
).default;
|
|
76
|
+
// sources[eventSourceTag] = await import(`../MiddlewareCore/EventSources/${eventSourceTag}.js`);
|
|
77
|
+
let createSourceResult = await generateTemplateData(
|
|
78
|
+
_izContext,
|
|
79
|
+
objSchemaPath,
|
|
80
|
+
settings
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Filter out empty or invalid objects before adding to allCreateSource
|
|
84
|
+
if (Array.isArray(createSourceResult)) {
|
|
85
|
+
const validResults = createSourceResult.filter(
|
|
86
|
+
item => item && item.templatePath && item.templateData && item.setting
|
|
87
|
+
);
|
|
88
|
+
allCreateSource.push(...validResults);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ** Generate function name configuration
|
|
93
|
+
const functionNameConfigs = functionNameConfigYamlData(
|
|
94
|
+
_izContext,
|
|
95
|
+
allCreateSource,
|
|
96
|
+
saveFilePath
|
|
97
|
+
);
|
|
98
|
+
allCreateSource.push(...functionNameConfigs);
|
|
99
|
+
|
|
100
|
+
let filterAllCreateSource = allCreateSource.filter(
|
|
101
|
+
createSource =>
|
|
102
|
+
createSource.templateData.hasOwnProperty(
|
|
103
|
+
'additionalResourcePermission'
|
|
104
|
+
) && createSource.templateData.hasOwnProperty('roleName')
|
|
105
|
+
);
|
|
106
|
+
const generateRoleData = generateRole(
|
|
107
|
+
_izContext,
|
|
108
|
+
filterAllCreateSource,
|
|
109
|
+
saveFilePath
|
|
110
|
+
);
|
|
111
|
+
allCreateSource.push(...generateRoleData);
|
|
112
|
+
|
|
113
|
+
// ** create Generate-Shared-resource
|
|
114
|
+
// const generateSharedResource = createSharedResource(_izContext, allCreateSource, saveFilePath);
|
|
115
|
+
// allCreateSource.push(generateSharedResource);
|
|
116
|
+
// console.log('---> allCreateSource', allCreateSource);
|
|
117
|
+
|
|
118
|
+
// check each allCreateSource valid
|
|
119
|
+
for (let item of allCreateSource) {
|
|
120
|
+
// throw Error('Skipping invalid source item:', item);
|
|
121
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
122
|
+
console.log('throw Error Skipping invalid source item:', item);
|
|
123
|
+
throw Error('Skipping invalid source item:', item);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const { templatePath, templateData, setting } = item;
|
|
127
|
+
setting.checkCreateSourcePass = true;
|
|
128
|
+
// console.log({ templatePath })
|
|
129
|
+
// console.log({ templateData })
|
|
130
|
+
let [status, errors] = await createSource.createSource(
|
|
131
|
+
readFileSync(templatePath, 'utf8'),
|
|
132
|
+
templateData,
|
|
133
|
+
setting
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
if (status === false) {
|
|
137
|
+
// console.log('templatePath in generateCode', templatePath)
|
|
138
|
+
throw Error(errors);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// console.log("templatePath in generateCode", setting.savePath)
|
|
142
|
+
// empty file by savePath
|
|
143
|
+
// validate path before empty folder
|
|
144
|
+
validatePathWithRootServicePath(localServicePath, setting.savePath);
|
|
145
|
+
await deleteFileInDir(setting.savePath);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// generate all source
|
|
149
|
+
for (let item of allCreateSource) {
|
|
150
|
+
// throw error if item is invalid
|
|
151
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
152
|
+
console.log('Throwing invalid source item:', item);
|
|
153
|
+
throw Error('Throwing invalid source item:', item);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const { templatePath, templateData, setting } = item;
|
|
157
|
+
setting.checkCreateSourcePass = false;
|
|
158
|
+
|
|
159
|
+
await createSource.createSource(
|
|
160
|
+
readFileSync(templatePath, 'utf8'),
|
|
161
|
+
templateData,
|
|
162
|
+
setting
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
console.log('Generated all source files successfully');
|
|
167
|
+
return 'return values';
|
|
168
|
+
} catch (error) {
|
|
169
|
+
console.error('Error generating code:', error);
|
|
170
|
+
throw error;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export default generateCodeWithTemplate;
|
|
175
|
+
|
|
176
|
+
/*
|
|
177
|
+
GenerateCode will iterate through templateConfig and generate each template dependOn each templateAndData\
|
|
178
|
+
|
|
179
|
+
GenerateSchema now use for generate attribute tree only
|
|
180
|
+
generateSchema can be modify use used depend on use case eg: some objectType have attribute tree inside addOn
|
|
181
|
+
when generateSchema in own service need to generate ref objectRelationship only
|
|
182
|
+
and attribute tree service can generate schema
|
|
183
|
+
|
|
184
|
+
*/
|
|
@@ -0,0 +1,121 @@
|
|
|
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 { join, dirname } from 'path';
|
|
19
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = dirname(__filename);
|
|
22
|
+
import { readFileSync } from 'fs';
|
|
23
|
+
|
|
24
|
+
// SourceManager
|
|
25
|
+
const { deleteFileInDir } = utils;
|
|
26
|
+
import { utils, createSource } from '../../izara-market-library-service-schemas/src/SourceManager/index.js';
|
|
27
|
+
|
|
28
|
+
import generateResource from './TemplateData/IntTest/generateResources/generateResources.js';
|
|
29
|
+
|
|
30
|
+
async function generateCodeWithTemplate(_izContext, savePath, settings) {
|
|
31
|
+
try {
|
|
32
|
+
// let packagePath = path.join(__dirname, "../../")
|
|
33
|
+
// let saveFilePath = join(packagePath, `../`);
|
|
34
|
+
// let localServicePath = join(saveFilePath, "../../");
|
|
35
|
+
// console.log({ packagePath });
|
|
36
|
+
// --------- Prepare path -------------
|
|
37
|
+
// point to app/src
|
|
38
|
+
|
|
39
|
+
// point to root folder of service
|
|
40
|
+
|
|
41
|
+
//------ Start Create Source ------
|
|
42
|
+
|
|
43
|
+
// collect all result of template data for execute createSource
|
|
44
|
+
let allCreateSource = [];
|
|
45
|
+
|
|
46
|
+
let createSourceResult = await generateResource(_izContext, savePath);
|
|
47
|
+
// console.log({ createSourceResult })
|
|
48
|
+
// Filter out empty or invalid objects before adding to allCreateSource
|
|
49
|
+
if (Array.isArray(createSourceResult)) {
|
|
50
|
+
const validResults = createSourceResult.filter(
|
|
51
|
+
item => item && item.templatePath && item.templateData && item.setting
|
|
52
|
+
);
|
|
53
|
+
allCreateSource.push(...validResults);
|
|
54
|
+
}
|
|
55
|
+
// console.log({ allCreateSource })
|
|
56
|
+
// check each allCreateSource valid
|
|
57
|
+
for (let item of allCreateSource) {
|
|
58
|
+
// throw Error('Skipping invalid source item:', item);
|
|
59
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
60
|
+
console.log('throw Error Skipping invalid source item:', item);
|
|
61
|
+
throw Error('Skipping invalid source item:', item);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const { templatePath, templateData, setting } = item;
|
|
65
|
+
setting.checkCreateSourcePass = true;
|
|
66
|
+
|
|
67
|
+
let [status, errors] = await createSource.createSource(
|
|
68
|
+
readFileSync(templatePath, 'utf8'),
|
|
69
|
+
templateData,
|
|
70
|
+
setting
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
if (status === false) {
|
|
74
|
+
console.log('templatePath in generateCode', templatePath);
|
|
75
|
+
throw Error(errors);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// validatePathWithRootServicePath(localServicePath, setting.savePath)
|
|
79
|
+
await deleteFileInDir(setting.savePath);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// generate all source
|
|
83
|
+
for (let item of allCreateSource) {
|
|
84
|
+
// throw error if item is invalid
|
|
85
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
86
|
+
console.log('Throwing invalid source item:', item);
|
|
87
|
+
throw Error('Throwing invalid source item:', item);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const { templatePath, templateData, setting } = item;
|
|
91
|
+
setting.checkCreateSourcePass = false;
|
|
92
|
+
|
|
93
|
+
await createSource.createSource(
|
|
94
|
+
readFileSync(templatePath, 'utf8'),
|
|
95
|
+
templateData,
|
|
96
|
+
setting
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log('Generated all source files successfully');
|
|
101
|
+
|
|
102
|
+
// exec(`bash ${path.join(packagePath, "./frontEnd/NpmBash.bash")}`, (error, stdout, stderr) => {
|
|
103
|
+
// if (error) {
|
|
104
|
+
// console.error(`
|
|
105
|
+
// ${error.message}`);
|
|
106
|
+
// return;
|
|
107
|
+
// }
|
|
108
|
+
// if (stderr) {
|
|
109
|
+
// console.error(`${stderr}`);
|
|
110
|
+
// return;
|
|
111
|
+
// }
|
|
112
|
+
// console.log(`${stdout}`);
|
|
113
|
+
// });
|
|
114
|
+
// return 'return values';
|
|
115
|
+
} catch (error) {
|
|
116
|
+
console.error('Error generating code:', error);
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default generateCodeWithTemplate;
|
|
@@ -0,0 +1,164 @@
|
|
|
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 { join } from 'path';
|
|
19
|
+
import { readFileSync } from 'fs';
|
|
20
|
+
|
|
21
|
+
import { validatePathWithRootServicePath } from './libs/GenerateCodeLibs.js';
|
|
22
|
+
|
|
23
|
+
import { schemaConfig } from './SchemaConfig.js';
|
|
24
|
+
|
|
25
|
+
// SourceManager
|
|
26
|
+
import { utils, createSource } from '../../izara-market-library-service-schemas/src/SourceManager/index.js';
|
|
27
|
+
const { deleteFileInDir } = utils;
|
|
28
|
+
|
|
29
|
+
async function generateSchema(
|
|
30
|
+
_izContext,
|
|
31
|
+
objSchemaPath,
|
|
32
|
+
generateSchemaSettings
|
|
33
|
+
) {
|
|
34
|
+
try {
|
|
35
|
+
// console.log('generateSchema', { objSchemaPath, generateSchemaSettings });
|
|
36
|
+
// --------- Prepare path -------------
|
|
37
|
+
// point to app/src
|
|
38
|
+
let saveFilePath = join(objSchemaPath, `../`);
|
|
39
|
+
// console.log("saveFilePath: ", saveFilePath);
|
|
40
|
+
|
|
41
|
+
// point to root folder of service
|
|
42
|
+
let localServicePath = join(saveFilePath, '../../');
|
|
43
|
+
// console.log("localServicePath: ", localServicePath);
|
|
44
|
+
|
|
45
|
+
//------ Start Create Source ------
|
|
46
|
+
|
|
47
|
+
// collect all result of template data for execute createSource
|
|
48
|
+
let allCreateSource = [];
|
|
49
|
+
// collect all path that need to empty before createSource
|
|
50
|
+
let allEmptyPath = new Set();
|
|
51
|
+
|
|
52
|
+
// Validate that all generateNames in generateSettings are present in the schemaConfig
|
|
53
|
+
const generateNameSet = new Set(Object.keys(schemaConfig.TemplateAndData));
|
|
54
|
+
|
|
55
|
+
// Find any missing generateNames that are not in the schemaConfig
|
|
56
|
+
let missingGenerateName = generateSchemaSettings.filter(
|
|
57
|
+
({ generateName }) => !generateNameSet.has(generateName)
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
// If there are missing generateNames, throw an error with the list of missing names
|
|
61
|
+
if (missingGenerateName.length) {
|
|
62
|
+
throw Error(
|
|
63
|
+
`Invalid generateName:[ ${missingGenerateName.map(({ generateName }) => generateName).join(', ')} ]`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// start create generateSchema depend on
|
|
68
|
+
for (const generateSetting of generateSchemaSettings) {
|
|
69
|
+
console.log('Loading template:', generateSetting.generateName);
|
|
70
|
+
console.log('Setting data:', generateSetting);
|
|
71
|
+
// console.log('schemaPath:', schemaConfig.TemplateAndData[generateSetting.generateName]);
|
|
72
|
+
// console.log('schemaPath:', join(__dirname, schemaConfig.TemplateAndData[generateSetting.generateName]));
|
|
73
|
+
|
|
74
|
+
// get generateSchema template depend on generateName
|
|
75
|
+
let generateSchemaData = (
|
|
76
|
+
await import(
|
|
77
|
+
join(
|
|
78
|
+
__dirname,
|
|
79
|
+
schemaConfig.TemplateAndData[generateSetting.generateName]
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
).default;
|
|
83
|
+
// sources[eventSourceTag] = await import(`../MiddlewareCore/EventSources/${eventSourceTag}.js`);
|
|
84
|
+
let createSourceResult = await generateSchemaData(
|
|
85
|
+
_izContext,
|
|
86
|
+
objSchemaPath,
|
|
87
|
+
generateSchemaSettings
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// Filter out empty or invalid objects before adding to allCreateSource
|
|
91
|
+
if (Array.isArray(createSourceResult)) {
|
|
92
|
+
const validResults = createSourceResult.filter(
|
|
93
|
+
item => item && item.templatePath && item.templateData && item.setting
|
|
94
|
+
);
|
|
95
|
+
allCreateSource.push(...validResults);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// check each allCreateSource valid
|
|
100
|
+
for (let item of allCreateSource) {
|
|
101
|
+
// throw Error('Skipping invalid source item:', item);
|
|
102
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
103
|
+
console.log('throw Error Skipping invalid source item:', item);
|
|
104
|
+
throw Error('Skipping invalid source item:', item);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const {
|
|
108
|
+
templatePath,
|
|
109
|
+
templateData,
|
|
110
|
+
setting,
|
|
111
|
+
emptyPath: returnEmptyPath
|
|
112
|
+
} = item;
|
|
113
|
+
setting.checkCreateSourcePass = true;
|
|
114
|
+
|
|
115
|
+
let [status, errors] = await createSource.createSource(
|
|
116
|
+
readFileSync(templatePath, 'utf8'),
|
|
117
|
+
templateData,
|
|
118
|
+
setting
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
if (status === false) {
|
|
122
|
+
throw Error(errors);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
allEmptyPath.add(setting.savePath);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// validate path before empty folder
|
|
129
|
+
for (let emptyPath of allEmptyPath) {
|
|
130
|
+
// console.log("emptyPath: ", emptyPath);
|
|
131
|
+
validatePathWithRootServicePath(localServicePath, emptyPath);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
for (let emptyPath of allEmptyPath) {
|
|
135
|
+
await deleteFileInDir(emptyPath);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// generate all source
|
|
139
|
+
for (let item of allCreateSource) {
|
|
140
|
+
// throw error if item is invalid
|
|
141
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
142
|
+
console.log('Throwing invalid source item:', item);
|
|
143
|
+
throw Error('Throwing invalid source item:', item);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const { templatePath, templateData, setting } = item;
|
|
147
|
+
setting.checkCreateSourcePass = false;
|
|
148
|
+
|
|
149
|
+
await createSource(
|
|
150
|
+
readFileSync(templatePath, 'utf8'),
|
|
151
|
+
templateData,
|
|
152
|
+
setting
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
console.log('Generated all source files successfully');
|
|
157
|
+
return 'return values';
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error('Error generating code:', error);
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export default generateSchema;
|
|
@@ -0,0 +1,138 @@
|
|
|
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 { join, dirname } from 'path';
|
|
19
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = dirname(__filename);
|
|
22
|
+
|
|
23
|
+
import { readFileSync } from 'fs';
|
|
24
|
+
// SourceManager
|
|
25
|
+
import { utils, createSource } from '../../izara-market-library-service-schemas/src/SourceManager/index.js';
|
|
26
|
+
const { deleteFileInDir } = utils;
|
|
27
|
+
import generateTest from './TemplateData/IntTest/generateTests/generateTemplate.js';
|
|
28
|
+
|
|
29
|
+
import lib from './TemplateData/IntTest/libs/libs.js';
|
|
30
|
+
const { getLocalConfig } = lib;
|
|
31
|
+
import uploadLib from './TemplateData/IntTest/upload/uploadIntTest.js';
|
|
32
|
+
async function generateCodeWithTemplate(_izContext, savePath, settings) {
|
|
33
|
+
_izContext.logger.debug('START', { savePath, settings });
|
|
34
|
+
try {
|
|
35
|
+
const serviceTag = getLocalConfig('iz_serviceTag');
|
|
36
|
+
let packagePath = path.join(__dirname, '../../');
|
|
37
|
+
// console.log({ packagePath });
|
|
38
|
+
// --------- Prepare path -------------
|
|
39
|
+
// point to app/src
|
|
40
|
+
let saveFilePath = join(packagePath, `../`);
|
|
41
|
+
|
|
42
|
+
// point to root folder of service
|
|
43
|
+
// let localServicePath = join(saveFilePath, "../../");
|
|
44
|
+
|
|
45
|
+
//------ Start Create Source ------
|
|
46
|
+
|
|
47
|
+
// collect all result of template data for execute createSource
|
|
48
|
+
let allCreateSource = [];
|
|
49
|
+
|
|
50
|
+
// console.log({ intTestPath })
|
|
51
|
+
// let generateTemplateData = (await import(join(__dirname, IntTestConfig.TemplateAndData[templateName]))).default;
|
|
52
|
+
let createSourceResult = await generateTest(_izContext, savePath, {
|
|
53
|
+
serviceTag,
|
|
54
|
+
s3Prefix: settings
|
|
55
|
+
});
|
|
56
|
+
// console.log({ createSourceResult })
|
|
57
|
+
// Filter out empty or invalid objects before adding to allCreateSource
|
|
58
|
+
if (Array.isArray(createSourceResult)) {
|
|
59
|
+
const validResults = createSourceResult.filter(
|
|
60
|
+
item => item && item.templatePath && item.templateData && item.setting
|
|
61
|
+
);
|
|
62
|
+
allCreateSource.push(...validResults);
|
|
63
|
+
}
|
|
64
|
+
// console.log({ allCreateSource })
|
|
65
|
+
// check each allCreateSource valid
|
|
66
|
+
// _izContext.logger.debug("check savePath:", savePath);
|
|
67
|
+
for (let item of allCreateSource) {
|
|
68
|
+
// throw Error('Skipping invalid source item:', item);
|
|
69
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
70
|
+
console.log('throw Error Skipping invalid source item:', item);
|
|
71
|
+
throw Error('Skipping invalid source item:', item);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const { templatePath, templateData, setting } = item;
|
|
75
|
+
setting.checkCreateSourcePass = true;
|
|
76
|
+
|
|
77
|
+
let [status, errors] = await createSource.createSource(
|
|
78
|
+
readFileSync(templatePath, 'utf8'),
|
|
79
|
+
templateData,
|
|
80
|
+
setting
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
if (status === false) {
|
|
84
|
+
console.log('templatePath in generateCode', templatePath);
|
|
85
|
+
throw Error(errors);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// validatePathWithRootServicePath(localServicePath, setting.savePath)
|
|
89
|
+
// await deleteFileInDir(setting.savePath);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// generate all source
|
|
93
|
+
for (let item of allCreateSource) {
|
|
94
|
+
// throw error if item is invalid
|
|
95
|
+
if (!item || !item.templatePath || !item.templateData || !item.setting) {
|
|
96
|
+
console.log('Throwing invalid source item:', item);
|
|
97
|
+
throw Error('Throwing invalid source item:', item);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const { templatePath, templateData, setting } = item;
|
|
101
|
+
setting.checkCreateSourcePass = false;
|
|
102
|
+
|
|
103
|
+
await createSource.createSource(
|
|
104
|
+
readFileSync(templatePath, 'utf8'),
|
|
105
|
+
templateData,
|
|
106
|
+
setting
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.log('Generated all source files successfully');
|
|
111
|
+
|
|
112
|
+
console.log('upload file to S3');
|
|
113
|
+
|
|
114
|
+
await uploadLib.uploadTos3(
|
|
115
|
+
join(saveFilePath, `../../src/generateIntegrationTest/${serviceTag}`), //intTest path
|
|
116
|
+
{ s3Prefix: settings, serviceTag: serviceTag } // settings
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
// exec(`bash ${ path.join(packagePath, "./frontEnd/NpmBash.bash") } `, (error, stdout, stderr) => {
|
|
120
|
+
// if (error) {
|
|
121
|
+
// console.error(`
|
|
122
|
+
// ${error.message}`);
|
|
123
|
+
// return;
|
|
124
|
+
// }
|
|
125
|
+
// if (stderr) {
|
|
126
|
+
// console.error(`${stderr}`);
|
|
127
|
+
// return;
|
|
128
|
+
// }
|
|
129
|
+
// console.log(`${stdout}`);
|
|
130
|
+
// });
|
|
131
|
+
// return 'return values';
|
|
132
|
+
} catch (error) {
|
|
133
|
+
console.error('Error generating code:', error);
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export default generateCodeWithTemplate;
|