@izara_project/izara-market-library-service-schemas 1.0.18 → 1.0.20
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 +2 -2
- package/src/GenerateCodeLibs/src/Consts.js +32 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +3 -61
- package/src/SourceManager/src/Utils.js +40 -1
- package/src/TemplateManager/src/FindData/FindDataYaml/data.js +4 -1
- package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +1 -14
- package/src/TemplateManager/src/GenerateCode.js +152 -46
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +23 -3
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs +1 -14
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +22 -3
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/template.ejs +1 -14
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/data.js +23 -3
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/template.ejs +1 -14
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +23 -3
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs +1 -14
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +6 -6
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/template.ejs +1 -14
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +2 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs +1 -14
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/template.ejs +1 -14
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +3 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +1 -14
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +65 -26
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +0 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +13 -11
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +34 -18
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/mainFunction → PerActionEndpoint/libs}/data.js +12 -23
- package/src/TemplateManager/src/PerActionEndpoint/libs/template.ejs +46 -0
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +18 -2
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +1 -14
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +20 -3
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +1 -14
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +21 -3
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +1 -14
- package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +16 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +17 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +16 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +18 -3
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/data.js +18 -3
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +15 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +17 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +16 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +18 -3
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +18 -3
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +19 -4
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +19 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +19 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +20 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +1 -14
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +20 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +1 -14
- package/src/TemplateManager/src/Role/createSharedResource.js +270 -0
- package/src/TemplateManager/src/Role/sharedResourceTemplate.ejs +58 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +1 -1
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +1 -1
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +119 -9
- package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +3 -4
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +31 -6
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js +65 -0
- package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/data.js +3 -2
- package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/data.js +1 -1
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/data.js +77 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/functionYaml/template.ejs +9 -3
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js +47 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/handler/template.ejs +25 -52
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/data.js +46 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js +36 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/data.js +102 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/data.js +58 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/template.ejs +126 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/template.ejs +121 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/data.js +64 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/template.ejs +45 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/functionYaml/data.js +42 -13
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/template.ejs +37 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/data.js +75 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +120 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/handler → flowSchema/UploadS3Case/createObject/mainFunction}/data.js +11 -15
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/mainFunction/template.ejs +4 -4
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/functionYaml/data.js +6 -4
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/data.js +1 -1
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/template.ejs +10 -10
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/mainFunction/data.js +3 -4
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/template.ejs +86 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/sns-sqs/data.js +4 -2
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/template.ejs +49 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/data.js +85 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc}/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/data.js +57 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/template.ejs +120 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +164 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/data.js +65 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/template.ejs +53 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/data.js +112 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/data.js +57 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/template.ejs +126 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/data.js +54 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +254 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/data.js +64 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/template.ejs +45 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/data.js +94 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateAsyncHandler.ejs +110 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateSyncHandler.ejs +49 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/hookLogic/data.js +44 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/data.js +66 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/template.ejs +7 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/data.js +73 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/sqsTemplate.ejs +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/data.js +102 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/template.ejs +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/data.js +94 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateAsyncHandler.ejs +110 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateSyncHandler.ejs +49 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/hookLogic/data.js +65 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/data.js +67 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/data.js +125 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/data.js +87 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/data.js +112 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/template.ejs +38 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/data.js +45 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/template.ejs +151 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/data.js +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/template.ejs +68 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/data.js +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +392 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/data.js +77 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/dsqTemplatePath.ejs +32 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/s3Template.ejs +59 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/template.ejs +13 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/data.js +42 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +137 -0
- package/src/TemplateManager/src/libs/Consts.js +89 -34
- package/src/TemplateManager/src/reStructureExample/GenerateCodeTest.js +31 -0
- package/src/TemplateManager/src/reStructureExample/TemplateConfig.js +11 -0
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/data.js +0 -0
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generateCodeShared.js +1 -0
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generatePerAction.js +5 -0
- package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/template.ejs +0 -0
- package/src/TemplateManager/src/flowTag/webSocket/webSocketComplete/mainFunction/template.ejs +0 -180
- /package/src/TemplateManager/src/{flowTag/resources/dynamoDb/data.js → flowSchema/DefaultWebSocketResource/dynamoDb/WebSocketTaskData.js} +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/template.ejs +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/template.ejs +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete/sns-sqs/template.ejs → flowSchema/UploadS3Case/hookCode(old)/queue/sqsTemplate.ejs} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# ----- [Topic]
|
|
2
|
+
In<%- queueName %>:
|
|
3
|
+
Type: AWS::SNS::Topic
|
|
4
|
+
Properties:
|
|
5
|
+
DisplayName: "SNS Message in ProcessImageAfterUploadHdrSqs"
|
|
6
|
+
TopicName: ${self:custom.iz_resourcePrefix}In<%- queueName %>
|
|
7
|
+
# ----- [Subscription]
|
|
8
|
+
SNSSubscriptionIn<%- queueName %>:
|
|
9
|
+
Type: AWS::SNS::Subscription
|
|
10
|
+
Properties:
|
|
11
|
+
RawMessageDelivery: true
|
|
12
|
+
TopicArn: !Ref In<%- queueName %>
|
|
13
|
+
Endpoint: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>"
|
|
14
|
+
Protocol: "sqs"
|
|
15
|
+
##===== [Queue]
|
|
16
|
+
<%- queueName %>:
|
|
17
|
+
Type: "AWS::SQS::Queue"
|
|
18
|
+
Properties:
|
|
19
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
20
|
+
RedrivePolicy:
|
|
21
|
+
deadLetterTargetArn:
|
|
22
|
+
# !GetAtt
|
|
23
|
+
Fn::GetAtt:
|
|
24
|
+
- <%- queueName %>DLQ
|
|
25
|
+
- Arn
|
|
26
|
+
maxReceiveCount: 3
|
|
27
|
+
VisibilityTimeout: 120
|
|
28
|
+
##==== [QueueDLQ]
|
|
29
|
+
<%- queueName %>DLQ:
|
|
30
|
+
Type: AWS::SQS::Queue
|
|
31
|
+
Properties:
|
|
32
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
|
|
33
|
+
##==== [QueuePolicy]
|
|
34
|
+
<%- queueName %>Policy:
|
|
35
|
+
Type: AWS::SQS::QueuePolicy
|
|
36
|
+
Properties:
|
|
37
|
+
PolicyDocument:
|
|
38
|
+
Version: "2012-10-17"
|
|
39
|
+
Statement:
|
|
40
|
+
- Sid: "allow-sns-messages"
|
|
41
|
+
Effect: Allow
|
|
42
|
+
Principal: "*"
|
|
43
|
+
Resource:
|
|
44
|
+
# !GetAtt
|
|
45
|
+
Fn::GetAtt:
|
|
46
|
+
- <%- queueName %>
|
|
47
|
+
- Arn
|
|
48
|
+
Action: "SQS:SendMessage"
|
|
49
|
+
Queues:
|
|
50
|
+
- Ref: <%- queueName %>
|
|
51
|
+
#<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
52
|
+
#<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
53
|
+
|
|
54
|
+
<%_ function firstLetterUpperCase(text){
|
|
55
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
56
|
+
} _%>
|
|
57
|
+
<%_ function firstLetterLowerCase(str) {
|
|
58
|
+
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
59
|
+
} _%>
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
const { SOURCE_PATH, SAVE_FILE_NAME } = require('../../../../libs/Consts');
|
|
22
|
+
|
|
23
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
24
|
+
|
|
25
|
+
function data(_izContext, flowSchema, srcPath) {
|
|
26
|
+
// console.log("flowSchema", flowSchema)
|
|
27
|
+
if (flowSchema.createBucket === false) {
|
|
28
|
+
return []
|
|
29
|
+
} else {
|
|
30
|
+
return [createSourceParams(_izContext, flowSchema, srcPath)]
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
35
|
+
let bucketName = flowSchema.bucketName
|
|
36
|
+
return {
|
|
37
|
+
templatePath: templatePath,
|
|
38
|
+
templateData: {
|
|
39
|
+
bucketName
|
|
40
|
+
},
|
|
41
|
+
setting: {
|
|
42
|
+
initialData: 'Resources:\n',
|
|
43
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
44
|
+
saveFileName: SAVE_FILE_NAME.S3Bucket,
|
|
45
|
+
fileExtension: '.yml',
|
|
46
|
+
isAppend: true
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = data;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<%- bucketName %>:
|
|
2
|
+
Type: AWS::S3::Bucket
|
|
3
|
+
DependsOn:
|
|
4
|
+
- SNSInProcessAfterUploadS3Policy
|
|
5
|
+
Properties:
|
|
6
|
+
BucketName: <%- bucketName %>
|
|
7
|
+
BucketEncryption:
|
|
8
|
+
ServerSideEncryptionConfiguration:
|
|
9
|
+
- ServerSideEncryptionByDefault:
|
|
10
|
+
SSEAlgorithm: AES256
|
|
11
|
+
BucketKeyEnabled: true
|
|
12
|
+
VersioningConfiguration:
|
|
13
|
+
Status: Suspended
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
const { SOURCE_PATH, SAVE_FILE_NAME } = require('../../../../libs/Consts');
|
|
22
|
+
|
|
23
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
24
|
+
|
|
25
|
+
function data(_izContext, srcPath) {
|
|
26
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function createSourceParams(_izContext, srcPath) {
|
|
30
|
+
return {
|
|
31
|
+
templatePath: templatePath,
|
|
32
|
+
templateData: {},
|
|
33
|
+
setting: {
|
|
34
|
+
saveFileName: "ImportDataLib",
|
|
35
|
+
savePath: path.join(srcPath, SOURCE_PATH.generateCodeLib),
|
|
36
|
+
fileExtension: ".js",
|
|
37
|
+
isAppend: false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
module.exports = data;
|
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
21
|
+
const lambda = externalRequest.lambda;
|
|
22
|
+
|
|
23
|
+
const { ApiGatewayManagementApiClient, PostToConnectionCommand } = require("@aws-sdk/client-apigatewaymanagementapi");
|
|
24
|
+
const { inMemoryCacheLib } = require('@izara_project/izara-shared');
|
|
25
|
+
const hash = require("object-hash")
|
|
26
|
+
const csv = require('csv-parser');
|
|
27
|
+
const streamifier = require('streamifier');
|
|
28
|
+
const NoRetryError = require('@izara_project/izara-core-library-core').NoRetryError;
|
|
29
|
+
|
|
30
|
+
const client = new ApiGatewayManagementApiClient({
|
|
31
|
+
endpoint: `https://${process.env.iz_webSocketEndpoint}`
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
async function postToConnection(message, connectionId) {
|
|
35
|
+
try {
|
|
36
|
+
const messageParams = JSON.stringify(message)
|
|
37
|
+
const command = new PostToConnectionCommand({
|
|
38
|
+
ConnectionId: connectionId,
|
|
39
|
+
Data: Buffer.from(messageParams)
|
|
40
|
+
})
|
|
41
|
+
// console.log("command::", command)
|
|
42
|
+
// console.log("client::", client)
|
|
43
|
+
await client.send(command);
|
|
44
|
+
console.log(`send Message: ${JSON.stringify(message)} to ${connectionId} 1`)
|
|
45
|
+
} catch (err) {
|
|
46
|
+
if (err.name === "GoneException") {
|
|
47
|
+
console.log(`message send to connectionIds ${connectionId} is no longer connect`)
|
|
48
|
+
} else {
|
|
49
|
+
console.error(`Error post message: ${err}`)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
* @param {Object} _izContext
|
|
56
|
+
* @param {string} functionName
|
|
57
|
+
* @param {Object} payload
|
|
58
|
+
*/
|
|
59
|
+
async function getDataFromInvokeFunction(_izContext, functionName, payload) {
|
|
60
|
+
return await lambda.invokeSync(_izContext, functionName, payload)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const getDataFromInvokeFunctionWithCache = inMemoryCacheLib.inMemoryCacheLib(
|
|
64
|
+
getDataFromInvokeFunction,
|
|
65
|
+
{
|
|
66
|
+
max: 100,
|
|
67
|
+
maxAge: 86400000,
|
|
68
|
+
promise: true,
|
|
69
|
+
profileName: "getDataFromInvokeFunction",
|
|
70
|
+
normalizer: function (args) {
|
|
71
|
+
return hash(args[1], args[2])
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @param {Object} _izContext
|
|
79
|
+
* @param {Object} data - S3 data
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
async function isValidCsv(_izContext, data) {
|
|
83
|
+
_izContext.logger.debug("function checkValidCsv", { data })
|
|
84
|
+
let errorCheckCsv = [];
|
|
85
|
+
let validCsv = true;
|
|
86
|
+
let rowCount = 0;
|
|
87
|
+
let columnCount = null;
|
|
88
|
+
|
|
89
|
+
streamifier.createReadStream(data.Body).pipe(csv()).on('data', (row) => {
|
|
90
|
+
rowCount++;
|
|
91
|
+
if (columnCount === null) {
|
|
92
|
+
columnCount = Object.keys(row).length
|
|
93
|
+
} else if (Object.keys(row).length !== columnCount) {
|
|
94
|
+
validCsv = false
|
|
95
|
+
errorCheckCsv.push(`Row ${rowCount} has inconsistent columns: ${JSON.stringify(row)}`)
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
.on('end', () => {
|
|
99
|
+
if (rowCount === 0) {
|
|
100
|
+
errorCheckCsv.push("csv file not have data row")
|
|
101
|
+
} else {
|
|
102
|
+
_izContext.logger.debug("validCsv")
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
.on('error', (error) => {
|
|
106
|
+
errorCheckCsv.push(`error:: ${error}`)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
return [validCsv, errorCheckCsv]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param {Object} _izContext
|
|
115
|
+
* @param {Object} nestedObj - source Object
|
|
116
|
+
* @param {String[]} paths - path to get value
|
|
117
|
+
*/
|
|
118
|
+
function getNestObject(_izContext, nestedObj, paths) {
|
|
119
|
+
_izContext.logger.debug("function getNestObject", { nestedObj, paths });
|
|
120
|
+
let data;
|
|
121
|
+
|
|
122
|
+
if (typeof nestedObj === "object" && Array.isArray(paths)) {
|
|
123
|
+
data = paths.reduce((obj, key) => obj && typeof obj[key] !== 'undefined' ? obj[key] : undefined, nestedObj);
|
|
124
|
+
} else {
|
|
125
|
+
throw new NoRetryError("Type error: Invalid type in getNestObject")
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
module.exports = {
|
|
132
|
+
postToConnection,
|
|
133
|
+
getDataFromInvokeFunction,
|
|
134
|
+
getDataFromInvokeFunctionWithCache,
|
|
135
|
+
isValidCsv,
|
|
136
|
+
getNestObject
|
|
137
|
+
}
|
|
@@ -23,6 +23,8 @@ const {
|
|
|
23
23
|
STORAGE_TYPES
|
|
24
24
|
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
25
25
|
|
|
26
|
+
const { firstLetterUpperCase: upperCase } = require("../../../MainLibs/src/Utils")
|
|
27
|
+
|
|
26
28
|
const { getGraphServiceNameFromGraphServerTagWithCache, getGraphServiceTagWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig');
|
|
27
29
|
|
|
28
30
|
const DEFAULT_HANDLER_PER_ACTION = {
|
|
@@ -37,7 +39,7 @@ const RESOURCE_CLASSES = {
|
|
|
37
39
|
s3: 's3',
|
|
38
40
|
dynamoDbTable: 'dynamodb',
|
|
39
41
|
dynamoDbAcrossService: 'dynamodb',
|
|
40
|
-
sns: "
|
|
42
|
+
sns: "sns",
|
|
41
43
|
lambda: "lambda",
|
|
42
44
|
webSocket: "webSocket"
|
|
43
45
|
};
|
|
@@ -54,7 +56,7 @@ function resourceNames(resourceClass, resourceName) {
|
|
|
54
56
|
[RESOURCE_CLASSES.s3]: "arn:aws:s3:::" + resourceName,
|
|
55
57
|
[RESOURCE_CLASSES.dynamoDbTable]: "arn:aws:dynamodb:${self:custom.iz_region}:${self:custom.iz_accountId}:table/${self:custom.iz_resourcePrefix}" + resourceName,
|
|
56
58
|
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}" + resourceName,
|
|
57
|
-
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:" + resourceName,
|
|
59
|
+
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:${self:custom.iz_resourcePrefix}" + resourceName,
|
|
58
60
|
[RESOURCE_CLASSES.webSocket]: "arn:aws:execute-api:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_webSocketHostId}/Test/POST/@connections/{connectionId}"
|
|
59
61
|
}[resourceClass];
|
|
60
62
|
}
|
|
@@ -67,13 +69,24 @@ function resourceNames(resourceClass, resourceName) {
|
|
|
67
69
|
* @returns {{ effect, action, resource}}
|
|
68
70
|
*/
|
|
69
71
|
function createIamRole(action, resource = [], effect = "Allow") {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
if (Array.isArray(action)) {
|
|
73
|
+
const actionObj = {};
|
|
74
|
+
action.forEach(act => {
|
|
75
|
+
if (act.includes(":")) {
|
|
76
|
+
const [serviceAction, resourceAction] = act.split(":")
|
|
77
|
+
actionObj[serviceAction] = [upperCase(resourceAction)]
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
action = actionObj
|
|
81
|
+
} else {
|
|
82
|
+
for (const resourceAction in action) {
|
|
83
|
+
if (typeof (action[resourceAction]) === 'string') {
|
|
84
|
+
action[resourceAction] = [action[resourceAction]]
|
|
85
|
+
}
|
|
74
86
|
|
|
75
|
-
|
|
76
|
-
|
|
87
|
+
if (!Array.isArray(action[resourceAction])) {
|
|
88
|
+
throw new Error(`resourceAction:${resourceAction} should be string or array`);
|
|
89
|
+
}
|
|
77
90
|
}
|
|
78
91
|
}
|
|
79
92
|
|
|
@@ -103,7 +116,12 @@ const SOURCE_PATH = {
|
|
|
103
116
|
resourceLocationTranslateId: 'src/generatedCode/TranslateId/source/',
|
|
104
117
|
resourceLocationProcessLogical: "src/generatedCode/ProcessLogical/source/",
|
|
105
118
|
webSocket: "../src/generatedCode/WebSocket/source/",
|
|
106
|
-
resourceLocationWebSocket: "src/generatedCode/WebSocket/source/"
|
|
119
|
+
resourceLocationWebSocket: "src/generatedCode/WebSocket/source/",
|
|
120
|
+
generateCodeLib: "../src/generatedCode/libs/source/",
|
|
121
|
+
logicalFunctionHook: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source/",
|
|
122
|
+
resourceLocationLogicalFunctionHook: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source",
|
|
123
|
+
generatedCodeHookFunction: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
124
|
+
resourceLocationGeneratedCodeHookFunction: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
107
125
|
};
|
|
108
126
|
|
|
109
127
|
|
|
@@ -124,7 +142,7 @@ const DEFAULT_LAMBDA_ROLE_PER_ACTION = {
|
|
|
124
142
|
dynamoDbPermission: 'DeleteItem',
|
|
125
143
|
httpMethod: 'delete',
|
|
126
144
|
}
|
|
127
|
-
}
|
|
145
|
+
};
|
|
128
146
|
|
|
129
147
|
const SQS_RESOURCE = {
|
|
130
148
|
sendMessage: "SendMessage",
|
|
@@ -133,12 +151,12 @@ const SQS_RESOURCE = {
|
|
|
133
151
|
getQueueAttributes: "GetQueueAttributes",
|
|
134
152
|
deleteMessageBatch: "DeleteMessageBatch",
|
|
135
153
|
getQueueUrl: "GetQueueUrl"
|
|
136
|
-
}
|
|
154
|
+
};
|
|
137
155
|
|
|
138
156
|
const SNS_RESOURCE = {
|
|
139
157
|
publish: "Publish",
|
|
140
|
-
|
|
141
|
-
}
|
|
158
|
+
subscribe: "Subscribe"
|
|
159
|
+
};
|
|
142
160
|
|
|
143
161
|
const DYNAMO_RESOURCE = {
|
|
144
162
|
putItem: "PutItem",
|
|
@@ -146,23 +164,46 @@ const DYNAMO_RESOURCE = {
|
|
|
146
164
|
query: "Query",
|
|
147
165
|
updateItem: "UpdateItem",
|
|
148
166
|
deleteItem: "DeleteItem"
|
|
149
|
-
}
|
|
167
|
+
};
|
|
150
168
|
|
|
151
169
|
const LAMBDA_RESOURCE = {
|
|
152
170
|
invokeFunction: "InvokeFunction"
|
|
153
|
-
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const S3_RESOURCE = {
|
|
174
|
+
getObject: "GetObject",
|
|
175
|
+
getObjectTagging: "GetObjectTagging",
|
|
176
|
+
deleteObject: "DeleteObject",
|
|
177
|
+
deleteObjectTagging: "DeleteObjectTagging",
|
|
178
|
+
putObject: "PutObject",
|
|
179
|
+
putObjectTagging: "PutObjectTagging",
|
|
180
|
+
};
|
|
181
|
+
|
|
154
182
|
function externalResourceName(resourceClass, resourceName, serviceTag) {
|
|
155
183
|
return {
|
|
156
184
|
[RESOURCE_CLASSES.dynamoDbTable]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/${await dynamoSharedLib.tableName(_izContext, " + `"${resourceName}" ,"${serviceTag}")}`,
|
|
157
185
|
// [RESOURCE_CLASSES.dynamoDbAcrossService]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/*/" + `${resourceName}`,
|
|
158
|
-
[RESOURCE_CLASSES.dynamoDbAcrossService]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table
|
|
186
|
+
[RESOURCE_CLASSES.dynamoDbAcrossService]: "arn:aws:dynamodb:${process.env.iz_region}:${process.env.iz_accountId}:table/" + `"${serviceTag}"` + `"${resourceName}"`,
|
|
159
187
|
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${process.env.iz_region}:${process.env.iz_accountId}:function:${await lambdaSharedLib.lambdaFunctionName(_izContext, " + `"${resourceName}" ,"${serviceTag}")}`,
|
|
188
|
+
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${process.env.iz_region}:${process.env.iz_accountId}:${await snsSharedLib.snsTopicName(_izContext, " + `"${resourceName}", "${serviceTag}")}`
|
|
189
|
+
|
|
160
190
|
}[resourceClass]
|
|
161
|
-
}
|
|
191
|
+
};
|
|
162
192
|
|
|
163
|
-
function
|
|
164
|
-
|
|
165
|
-
}
|
|
193
|
+
function externalResourceYaml(resourceClass, resourceName, serviceTag) {
|
|
194
|
+
if (!serviceTag) {
|
|
195
|
+
serviceTag = "${self:custom.iz_resourcePrefix}"
|
|
196
|
+
} else {
|
|
197
|
+
serviceTag = serviceTag + "Test"
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
[RESOURCE_CLASSES.dynamoDbTable]: "arn:aws:dynamodb:${self:custom.iz_region}:${self:custom.iz_accountId}:table/" + `${serviceTag}` + `${resourceName}`,
|
|
201
|
+
[RESOURCE_CLASSES.lambda]: "arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:" + `${serviceTag}` + `${resourceName}`,
|
|
202
|
+
[RESOURCE_CLASSES.sns]: "arn:aws:sns:${self:custom.iz_region}:${self:custom.iz_accountId}:" + `${serviceTag}` + `${resourceName}`,
|
|
203
|
+
[RESOURCE_CLASSES.sqs]: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:" + `${serviceTag}` + `${resourceName}`
|
|
204
|
+
|
|
205
|
+
}[resourceClass]
|
|
206
|
+
};
|
|
166
207
|
|
|
167
208
|
const SAVE_FILE_NAME = {
|
|
168
209
|
dynamoDbYaml: "generated-dynamoDB-table",
|
|
@@ -175,8 +216,10 @@ const SAVE_FILE_NAME = {
|
|
|
175
216
|
translateId: "TranslateIdsRequest",
|
|
176
217
|
findData: "findData",
|
|
177
218
|
processLogicalYaml: "processLogical",
|
|
178
|
-
flowSchema: "flowSchema"
|
|
179
|
-
|
|
219
|
+
flowSchema: "flowSchema",
|
|
220
|
+
S3Bucket: "generated-s3-bucket",
|
|
221
|
+
sharedResourceYaml: "generate-SharedResource",
|
|
222
|
+
};
|
|
180
223
|
|
|
181
224
|
const FUNCTION_NAME = {
|
|
182
225
|
updateRel: "updateRelationship",
|
|
@@ -195,8 +238,11 @@ const FUNCTION_NAME = {
|
|
|
195
238
|
getNodeComplete: "getNodeComplete",
|
|
196
239
|
paginateProcessLogical: "paginateProcessLogical",
|
|
197
240
|
deleteNode: "deleteNode",
|
|
198
|
-
deleteNodeComplete: "deleteNodeComplete"
|
|
199
|
-
|
|
241
|
+
deleteNodeComplete: "deleteNodeComplete",
|
|
242
|
+
createObjectS3: "createObjectS3",
|
|
243
|
+
createObjectS3Complete: "webSocketTaskComplete",
|
|
244
|
+
processAfterUploadS3: "processAfterUploadS3"
|
|
245
|
+
};
|
|
200
246
|
|
|
201
247
|
const SHORT_FUNCTION_NAME = {
|
|
202
248
|
updateRel: "updateRel",
|
|
@@ -215,7 +261,8 @@ const SHORT_FUNCTION_NAME = {
|
|
|
215
261
|
getNodeComplete: "getNodeComp",
|
|
216
262
|
paginateProcessLogical: "paginateProLogical",
|
|
217
263
|
deleteNode: "deleteNode",
|
|
218
|
-
deleteNodeComplete: "deleteNodeComp"
|
|
264
|
+
deleteNodeComplete: "deleteNodeComp",
|
|
265
|
+
createObjectS3Complete: "webSocketTaskComp",
|
|
219
266
|
}
|
|
220
267
|
|
|
221
268
|
const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) => {
|
|
@@ -233,7 +280,7 @@ const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) =>
|
|
|
233
280
|
}))
|
|
234
281
|
const graphServiceName = [...graphServiceNameSet]
|
|
235
282
|
return graphServiceName
|
|
236
|
-
}
|
|
283
|
+
};
|
|
237
284
|
|
|
238
285
|
function defaultIamRolePerAction() {
|
|
239
286
|
|
|
@@ -247,7 +294,6 @@ function defaultIamRolePerAction() {
|
|
|
247
294
|
},
|
|
248
295
|
[
|
|
249
296
|
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
250
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
251
297
|
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json"),
|
|
252
298
|
]
|
|
253
299
|
)
|
|
@@ -263,7 +309,7 @@ function defaultIamRolePerAction() {
|
|
|
263
309
|
);
|
|
264
310
|
|
|
265
311
|
return defaultIamRole
|
|
266
|
-
}
|
|
312
|
+
};
|
|
267
313
|
|
|
268
314
|
function getComplexFilterServiceTag(allObjectSchemas) {
|
|
269
315
|
const complexFilterServiceTagSet = new Set();
|
|
@@ -272,7 +318,7 @@ function getComplexFilterServiceTag(allObjectSchemas) {
|
|
|
272
318
|
}
|
|
273
319
|
let complexFilterServiceTags = [...complexFilterServiceTagSet];
|
|
274
320
|
return complexFilterServiceTags
|
|
275
|
-
}
|
|
321
|
+
};
|
|
276
322
|
|
|
277
323
|
async function getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas) {
|
|
278
324
|
const graphServiceName = new Set();
|
|
@@ -287,7 +333,7 @@ async function getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas) {
|
|
|
287
333
|
let graphServiceNames = [...graphServiceName]
|
|
288
334
|
// console.log("graphServiceName", graphServiceNames)
|
|
289
335
|
return graphServiceNames
|
|
290
|
-
}
|
|
336
|
+
};
|
|
291
337
|
|
|
292
338
|
function awaitingMultipleStepsRole() {
|
|
293
339
|
let awaitingMultipleStepsRole = createIamRole(
|
|
@@ -306,11 +352,18 @@ function awaitingMultipleStepsRole() {
|
|
|
306
352
|
]
|
|
307
353
|
)
|
|
308
354
|
return awaitingMultipleStepsRole
|
|
309
|
-
}
|
|
355
|
+
};
|
|
310
356
|
|
|
311
357
|
function shortNameHandler(fullNameHandler) {
|
|
312
358
|
return fullNameHandler.slice(3)
|
|
313
|
-
}
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
const SOURCE_GENERATE_IAM_ROLE = {
|
|
362
|
+
ProcessFindDataRole: "ProcessFindData",
|
|
363
|
+
ObjectCompleteRole: "ObjectComplete",
|
|
364
|
+
RelationshipRole: "Relationship",
|
|
365
|
+
RelationshipCompleteRole: "RelationshipComplete",
|
|
366
|
+
};
|
|
314
367
|
|
|
315
368
|
|
|
316
369
|
module.exports = {
|
|
@@ -327,7 +380,7 @@ module.exports = {
|
|
|
327
380
|
LAMBDA_RESOURCE,
|
|
328
381
|
HANDLER,
|
|
329
382
|
externalResourceName,
|
|
330
|
-
|
|
383
|
+
externalResourceYaml,
|
|
331
384
|
SAVE_FILE_NAME,
|
|
332
385
|
FUNCTION_NAME,
|
|
333
386
|
getGraphServiceNameFromAllRelSchema,
|
|
@@ -336,5 +389,7 @@ module.exports = {
|
|
|
336
389
|
getGraphServiceNameFromObjectSchema,
|
|
337
390
|
awaitingMultipleStepsRole,
|
|
338
391
|
shortNameHandler,
|
|
339
|
-
SHORT_FUNCTION_NAME
|
|
392
|
+
SHORT_FUNCTION_NAME,
|
|
393
|
+
S3_RESOURCE,
|
|
394
|
+
SOURCE_GENERATE_IAM_ROLE
|
|
340
395
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const templateConfig = require("./TemplateConfig");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const { createSource } = require("../../../SourceManager/src/CreateSource");
|
|
4
|
+
|
|
5
|
+
async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
6
|
+
let allCreateSource = []
|
|
7
|
+
|
|
8
|
+
for (const templateName in templateConfig) {
|
|
9
|
+
const { generateCode } = require(path.join(__dirname, templateConfig[templateName]))
|
|
10
|
+
let createSourceResult = await generateCode(generateCode)
|
|
11
|
+
allCreateSource.push(...createSourceResult);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
for (let folderPathToEmpty of Object.keys(GENERATECODE_SOURCE_PATH)) {
|
|
16
|
+
await deleteFileInDir(GENERATECODE_SOURCE_PATH[folderPathToEmpty]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
for (let { templatePath, templateData, setting } of allCreateSource) {
|
|
21
|
+
// console.log("setting.saveFileName in GenerateCode", setting.saveFileName);
|
|
22
|
+
// console.log("templatePath in GenerateCode", templatePath);
|
|
23
|
+
|
|
24
|
+
await createSource(
|
|
25
|
+
readFileSync(templatePath, 'utf8'),
|
|
26
|
+
templateData,
|
|
27
|
+
setting,
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
File without changes
|
package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generateCodeShared.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// generated code (data,template)
|
|
File without changes
|