@izara_project/izara-market-library-service-schemas 1.0.72 → 1.0.74
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 +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +14 -3
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +11 -2
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +6 -4
- package/src/reStructure/TemplateData/EndpointPerService/yaml/template.ejs +5 -4
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +24 -10
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +1 -1
- package/src/reStructure/TemplateData/findData/findDataYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +9 -9
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/template.ejs +4 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/template.ejs +4 -3
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +3 -4
- package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +4 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +4 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +16 -7
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/functionYaml/template.ejs +5 -3
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/template.ejs +5 -3
- package/src/reStructure/TemplateData/flowSchema/register/wbs/functionYaml/template.ejs +3 -2
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +108 -0
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/template.ejs +22 -0
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +63 -0
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +85 -0
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/MainFunction/template.ejs +87 -0
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/sns/data.js +61 -0
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/sns/template.ejs +59 -0
- package/src/reStructure/TemplateData/flowSchema/templateByStatusType/statusFieldTemplate.ejs +24 -17
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/template.ejs +22 -0
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/template.ejs +5 -4
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/template.ejs +4 -3
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/functionYaml/template.ejs +4 -3
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/template.ejs +4 -3
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/template.ejs +4 -3
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/processLogical/yaml/template.ejs +6 -6
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/template.ejs +3 -3
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/template.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/apiTemplate.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/dsqTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/invTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/sqsTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/apiTemplate.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/dsqTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/invTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/sqsTemplate.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/apiTemplate.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/dsqTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/invTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/sqsTemplate.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/apiTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/dsqTemplate.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/invTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/sqsTemplate.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +4 -3
package/package.json
CHANGED
|
@@ -102,10 +102,21 @@ module.exports.getMain = async (
|
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
const errorsFound = [];
|
|
105
|
+
let returnSystemFieldsName = false;
|
|
106
|
+
let throwWhenNotFoundSomeRecord = true;
|
|
107
|
+
let returnVersionedData = true;
|
|
105
108
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
if (requestParams.additionalParams.hasOwnProperty("settings")) {
|
|
110
|
+
if (requestParams.additionalParams.settings.hasOwnProperty("returnSystemFieldsName") && requestParams.additionalParams.settings.returnSystemFieldsName === true) {
|
|
111
|
+
returnSystemFieldsName = true;
|
|
112
|
+
}
|
|
113
|
+
if (requestParams.additionalParams.settings.hasOwnProperty("throwWhenNotFoundSomeRecord") && requestParams.additionalParams.settings.throwWhenNotFoundSomeRecord === false) {
|
|
114
|
+
throwWhenNotFoundSomeRecord = false;
|
|
115
|
+
}
|
|
116
|
+
if (requestParams.additionalParams.settings.hasOwnProperty("returnVersionedData") && requestParams.additionalParams.settings.returnVersionedData === false) {
|
|
117
|
+
returnVersionedData = false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
109
120
|
|
|
110
121
|
//(<beforeQuery>)
|
|
111
122
|
//(</beforeQuery>)
|
|
@@ -88,8 +88,17 @@ module.exports.updateMain = async (
|
|
|
88
88
|
callingFlowConfig
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
let returnSystemFieldsName = false;
|
|
92
|
+
let returnOldData = false;
|
|
93
|
+
|
|
94
|
+
if (requestParams.additionalParams.hasOwnProperty("settings")) {
|
|
95
|
+
if (requestParams.additionalParams.settings.hasOwnProperty("returnSystemFieldsName") && requestParams.additionalParams.settings.returnSystemFieldsName === true) {
|
|
96
|
+
returnSystemFieldsName = true;
|
|
97
|
+
}
|
|
98
|
+
if (requestParams.additionalParams.settings.hasOwnProperty("returnOldData") && requestParams.additionalParams.settings.returnOldData === true) {
|
|
99
|
+
returnOldData = true;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
93
102
|
|
|
94
103
|
let errorsFound = [];
|
|
95
104
|
|
|
@@ -57,16 +57,18 @@ const templatePath = path.join(__dirname, "./template.ejs")
|
|
|
57
57
|
* @return {{ templatePath, templateData, setting } }
|
|
58
58
|
*/
|
|
59
59
|
async function data(_izContext, allObjSchemas, srcPath) {
|
|
60
|
-
let
|
|
61
|
-
console.debug('templatePath:::', templatePath)
|
|
60
|
+
let createSourceParams = [];
|
|
61
|
+
// console.debug('templatePath:::', templatePath)
|
|
62
62
|
for (const action of Object.values(ACTIONS)) {
|
|
63
63
|
const defaultHandlers = DEFAULT_HANDLER_PER_ACTION[action]
|
|
64
64
|
for (const defaultHandler of defaultHandlers) {
|
|
65
65
|
const createSourceParam = await createParamForCreateSource(_izContext, allObjSchemas, action, defaultHandler, srcPath)
|
|
66
|
-
createSourceParam &&
|
|
66
|
+
if (createSourceParam && !createSourceParams.includes(createSourceParam)) {
|
|
67
|
+
createSourceParams.push(createSourceParam)
|
|
68
|
+
}
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
|
-
return
|
|
71
|
+
return createSourceParams;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
async function createParamForCreateSource(_izContext, allObjSchemas, action, handler, srcPath) {
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(action)}_${firstLetterUpperCase(handlerType)}.main`) %>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
-
|
|
5
|
+
role: <%- firstLetterUpperCase(roleName) _%>Role
|
|
6
|
+
#<#<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
|
|
7
|
+
#<#/<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
|
|
6
8
|
<%_ if (handlerType === "hdrDsq" || handlerType === "hdrSqs") { _%>
|
|
9
|
+
events:
|
|
7
10
|
- sqs:
|
|
8
11
|
arn: <%- event %>
|
|
9
12
|
batchSize: 10
|
|
10
13
|
<%_ } else if (handlerType === "hdrApi") { _%>
|
|
14
|
+
events:
|
|
11
15
|
<%_ resourceApis.forEach(resourceApi => { _%>
|
|
12
16
|
- httpApi:
|
|
13
17
|
path: /<%- serviceTag %>/<%- resourceApi.event %>/<%- action %>
|
|
@@ -23,9 +27,6 @@
|
|
|
23
27
|
#<#/<%- firstLetterUpperCase(resourceApi.event) _%><%- firstLetterUpperCase(handlerType) %>UserLevelAuthorizer#>
|
|
24
28
|
<%_ }) _%>
|
|
25
29
|
<%_ } _%>
|
|
26
|
-
role: <%- firstLetterUpperCase(roleName) _%>Role
|
|
27
|
-
#<#<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>IamRole#>
|
|
28
|
-
#<#/<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>IamRole#>
|
|
29
30
|
<%_ function firstLetterUpperCase(text){
|
|
30
31
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
31
32
|
} _%>
|
|
@@ -48,32 +48,46 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
|
|
|
48
48
|
const snsServiceConfigArray = [];
|
|
49
49
|
|
|
50
50
|
const snsServiceConfigUpdateRelationshipComplete = await snsSubScriptionUpdateRelationshipComplete(_izContext, allRelSchemas)
|
|
51
|
-
|
|
51
|
+
if (snsServiceConfigUpdateRelationshipComplete) {
|
|
52
|
+
snsServiceConfigArray.push(snsServiceConfigUpdateRelationshipComplete)
|
|
53
|
+
};
|
|
52
54
|
|
|
53
55
|
const snsServiceConfigCreateRelationshipComplete = await snsSubscriptionCreateRelationshipComplete(_izContext, allRelSchemas)
|
|
54
|
-
|
|
56
|
+
if (snsServiceConfigCreateRelationshipComplete) {
|
|
57
|
+
snsServiceConfigArray.push(snsServiceConfigCreateRelationshipComplete)
|
|
58
|
+
};
|
|
55
59
|
|
|
56
60
|
const snsServiceConfigDeleteRelationshipComplete = await snsSubscriptionDeleteRelationshipComplete(_izContext, allRelSchemas)
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
if (snsServiceConfigDeleteRelationshipComplete) {
|
|
62
|
+
snsServiceConfigArray.push(snsServiceConfigDeleteRelationshipComplete);
|
|
63
|
+
};
|
|
59
64
|
const snsServiceConfigUpdateNodeComplete = await snsSubscriptionOutUpdateNodeComplete(_izContext, allObjSchemas)
|
|
60
|
-
|
|
65
|
+
if (snsServiceConfigUpdateNodeComplete) {
|
|
66
|
+
snsServiceConfigArray.push(snsServiceConfigUpdateNodeComplete)
|
|
67
|
+
};
|
|
61
68
|
|
|
62
69
|
const snsServiceConfigCreateNodeComplete = await snsSubscriptionCreateNodeComplete(_izContext, allObjSchemas)
|
|
63
|
-
|
|
70
|
+
if (snsServiceConfigCreateNodeComplete) {
|
|
71
|
+
snsServiceConfigArray.push(snsServiceConfigCreateNodeComplete)
|
|
72
|
+
};
|
|
64
73
|
|
|
65
74
|
const snsServiceConfigDeleteNodeComplete = await snsSubscriptionDeleteNodeComplete(_izContext, allObjSchemas)
|
|
66
|
-
|
|
75
|
+
if (snsServiceConfigDeleteNodeComplete) {
|
|
76
|
+
snsServiceConfigArray.push(snsServiceConfigDeleteNodeComplete);
|
|
77
|
+
}
|
|
67
78
|
|
|
68
79
|
if (allLocalFlowSchemas) {
|
|
69
80
|
for (const localFlowSchema of allLocalFlowSchemas) {
|
|
70
81
|
for (const event of localFlowSchema.event) {
|
|
71
82
|
if (event.includes("s3")) {
|
|
72
83
|
const snsServiceConfigForReservedDynamicUsage = await snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext);
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
if (snsServiceConfigForReservedDynamicUsage) {
|
|
85
|
+
snsServiceConfigArray.push(snsServiceConfigForReservedDynamicUsage);
|
|
86
|
+
}
|
|
75
87
|
const snsServiceConfigForConfirmReserved = await snsSubscriptionConfirmReserved(_izContext);
|
|
76
|
-
|
|
88
|
+
if (snsServiceConfigForConfirmReserved) {
|
|
89
|
+
snsServiceConfigArray.push(snsServiceConfigForConfirmReserved);
|
|
90
|
+
}
|
|
77
91
|
}
|
|
78
92
|
}
|
|
79
93
|
}
|
|
@@ -141,7 +141,7 @@ async function data(_izContext, objectSchemas, srcPath, settings) {
|
|
|
141
141
|
)
|
|
142
142
|
|
|
143
143
|
// console.log("additionalResourcePermission", additionalResourcePermission)
|
|
144
|
-
console.log("findData template generated")
|
|
144
|
+
// console.log("findData template generated")
|
|
145
145
|
return {
|
|
146
146
|
templatePath: templatePath,
|
|
147
147
|
templateData: {
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
|
|
7
|
+
#<#/<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
8
11
|
batchSize: 10
|
|
9
|
-
role: <%- roleName %>Role
|
|
10
|
-
#<#<%- functionName %><%- firstLetterUpperCase(handlerType) %>IamRole#>
|
|
11
|
-
#<#/<%- functionName %><%- firstLetterUpperCase(handlerType) %>IamRole#>
|
|
12
12
|
<%_ function firstLetterUpperCase(text){
|
|
13
13
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
14
14
|
} _%>
|
package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
6
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
role: <%- roleName %>Role
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %>
|
|
@@ -9,9 +12,6 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
role: <%- roleName %>Role
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
15
|
<%_ function firstLetterUpperCase(text){
|
|
16
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
17
|
} _%>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
@@ -9,9 +12,6 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
role: <%- roleName %>Role
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
15
|
<%_ function firstLetterUpperCase(text){
|
|
16
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
17
|
} _%>
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
-
events:
|
|
6
|
-
- websocket:
|
|
7
|
-
route: $default
|
|
8
|
-
- websocket:
|
|
9
|
-
route: <%- route %>
|
|
10
|
-
# authorizer: ${self:custom.iz_authorizerAppLevel}
|
|
11
|
-
# identifierResource: 'route.request.header.Auth'
|
|
12
5
|
role: <%- roleName %>Role
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
8
|
+
events:
|
|
9
|
+
- websocket:
|
|
10
|
+
route: $default
|
|
11
|
+
- websocket:
|
|
12
|
+
route: <%- route %>
|
|
13
|
+
# authorizer: ${self:custom.iz_authorizerAppLevel}
|
|
14
|
+
# identifierResource: 'route.request.header.Auth'
|
|
15
15
|
<%_ function firstLetterUpperCase(text){
|
|
16
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
17
|
} _%>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
@@ -9,9 +12,6 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
role: <%- roleName %>Role
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
15
|
<%_ function firstLetterUpperCase(text){
|
|
16
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
17
|
} _%>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
@@ -9,9 +12,7 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
|
+
|
|
15
16
|
<%_ function firstLetterUpperCase(text){
|
|
16
17
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
18
|
} _%>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
8
11
|
batchSize: 10
|
|
9
|
-
role: <%- roleName %>Role
|
|
10
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
11
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
12
12
|
<%_ function firstLetterUpperCase(text){
|
|
13
13
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
14
14
|
} _%>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- s3:
|
|
7
10
|
bucket: <%- bucketName %>
|
|
@@ -13,9 +16,7 @@
|
|
|
13
16
|
- prefix: uploads/
|
|
14
17
|
- suffix: .csv
|
|
15
18
|
forceDeploy: true
|
|
16
|
-
|
|
17
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
18
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
19
|
+
|
|
19
20
|
<%_ function firstLetterUpperCase(text){
|
|
20
21
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
21
22
|
} _%>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionName) -%>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}.main`) %>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<WebSocketConnectSetting#>
|
|
7
|
+
#<#/<WebSocketConnectSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- websocket:
|
|
7
10
|
route: $connect
|
|
@@ -9,10 +12,6 @@
|
|
|
9
12
|
route: $disconnect
|
|
10
13
|
- websocket:
|
|
11
14
|
route: $default
|
|
12
|
-
role: <%- roleName %>Role
|
|
13
|
-
#<#<WebSocketConnectIamRole#>
|
|
14
|
-
#<#/<WebSocketConnectIamRole#>
|
|
15
|
-
|
|
16
15
|
<%_ function firstLetterUpperCase(text){
|
|
17
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
18
17
|
} _%>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${functionName}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionNameConfig) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
<%_ schedules.forEach((schedule) => { _%>
|
|
7
10
|
- schedule:
|
|
@@ -10,9 +13,6 @@
|
|
|
10
13
|
rate: <%- schedule.rate %>
|
|
11
14
|
input: <%- JSON.stringify(schedule.input) %>
|
|
12
15
|
<%_ }) _%>
|
|
13
|
-
role: <%- roleName %>Role
|
|
14
|
-
#<#<%- functionName %>IamRole#>
|
|
15
|
-
#<#/<%- functionName %>IamRole#>
|
|
16
16
|
<%_ function firstLetterUpperCase(text){
|
|
17
17
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
18
18
|
} _%>
|
package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/functionYaml/template.ejs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
6
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
role: <%- roleName %>Role
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
@@ -9,9 +12,6 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
role: <%- roleName %>Role
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
15
|
<%_ function firstLetterUpperCase(text){
|
|
16
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
17
|
} _%>
|
package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/functionYaml/template.ejs
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
@@ -9,9 +12,6 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
role: <%- roleName %>Role
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
15
|
<%_ function firstLetterUpperCase(text){
|
|
16
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
17
|
} _%>
|
|
@@ -34,6 +34,7 @@ const NoRetryError = require('@izara_project/izara-core-library-core').NoRetryEr
|
|
|
34
34
|
const triggeredCacheSharedLib = require('@izara_project/izara-core-library-trigger-cache')
|
|
35
35
|
<% } else if (statusType === "statusField") { -%>
|
|
36
36
|
const { createFieldNamesFromRequestParamsByObjectSchema } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs.js')
|
|
37
|
+
const statusFieldSharedLib = require('@izara_project/izara-core-library-status-field')
|
|
37
38
|
<% } else if (statusType === "storedCache") { -%>
|
|
38
39
|
const storedCacheSharedLib = require('@izara_project/izara-core-library-stored-cache')
|
|
39
40
|
<% } -%>
|
|
@@ -69,9 +70,9 @@ module.exports.<%- functionName %> = async (
|
|
|
69
70
|
_izContext.logger.debug("<%- functionName %> callingFlowConfig", callingFlowConfig)
|
|
70
71
|
|
|
71
72
|
<% if (statusType === "statusField") { %>
|
|
72
|
-
<%- include(statusFieldTemplate) %>
|
|
73
|
+
<%- include(statusFieldTemplate, { tableName:tableName, flowTag: flowTag }) %>
|
|
73
74
|
<% } else if (statusType === "storedCache") { %>
|
|
74
|
-
<%- include(storedCacheTemplate, {tableName:tableName, flowSchemaComplete:flowSchemaComplete,flowTag}) %>
|
|
75
|
+
<%- include(storedCacheTemplate, { tableName:tableName, flowSchemaComplete:flowSchemaComplete,flowTag }) %>
|
|
75
76
|
|
|
76
77
|
<% } else if (statusType === "triggerCache") { %>
|
|
77
78
|
<%- include(triggerCacheTemplate, {
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
@@ -9,9 +12,7 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
|
+
|
|
15
16
|
<%_ function firstLetterUpperCase(text){
|
|
16
17
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
18
|
} _%>
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
@@ -9,9 +12,7 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
|
+
|
|
15
16
|
<%_ function firstLetterUpperCase(text){
|
|
16
17
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
18
|
} _%>
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- websocket:
|
|
7
10
|
route: <%- route %>
|
|
8
11
|
# authorizer: ${self:custom.iz_authorizerAppLevel}
|
|
9
12
|
# identifierResource: 'route.request.header.Auth'
|
|
10
|
-
role: <%- roleName %>Role
|
|
11
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
12
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
13
13
|
<%_ function firstLetterUpperCase(text){
|
|
14
14
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
15
15
|
} _%>
|
|
@@ -51,7 +51,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
51
51
|
let eventParams = JSON.parse(event.body)
|
|
52
52
|
|
|
53
53
|
//(<createIdentifiersFlow>)
|
|
54
|
-
let identifiers
|
|
54
|
+
let identifiers = ""
|
|
55
55
|
//(</createIdentifiersFlow>)
|
|
56
56
|
|
|
57
57
|
let flowSchema = await getObjectSchema.getFlowSchemaS3WithCache(
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- roleName %>Role
|
|
6
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- sqs:
|
|
7
10
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
@@ -9,9 +12,6 @@
|
|
|
9
12
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
10
13
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
14
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
role: <%- roleName %>Role
|
|
13
|
-
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
|
-
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
15
15
|
<%_ function firstLetterUpperCase(text){
|
|
16
16
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
17
|
} _%>
|
|
@@ -154,6 +154,13 @@ const createFlowSchemaTriggerCacheMainFunction = {
|
|
|
154
154
|
createTriggerCacheCompleteMainFunction: require('./triggerCacheComponent/triggerCacheComplete/mainFunction/data')
|
|
155
155
|
}
|
|
156
156
|
const createFlowSchemaTriggerCacheQueue = require('./triggerCacheComponent/triggerCacheQueue/data')
|
|
157
|
+
|
|
158
|
+
const createFlowSchemaStatusFieldComponent = {
|
|
159
|
+
createCompleteStatusFieldMainFunction: require('./statusFieldComponent/MainFunction/data'),
|
|
160
|
+
createCompleteStatusFieldFunctionYaml: require('./statusFieldComponent/FunctionYaml/data'),
|
|
161
|
+
createCompleteStatusFieldHandler: require('./statusFieldComponent/Handler/data'),
|
|
162
|
+
createCompleteStatusFieldTopicAndQueue: require('./statusFieldComponent/sns/data')
|
|
163
|
+
}
|
|
157
164
|
/**
|
|
158
165
|
* Generates code with templates for different actions
|
|
159
166
|
* @param {Object} _izContext - Context object
|
|
@@ -186,7 +193,8 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
186
193
|
if (allLocalFlowSchemas.records.length) {
|
|
187
194
|
createSourceParams.push(
|
|
188
195
|
...webSocketResource,
|
|
189
|
-
...webSocketCompleteComponent
|
|
196
|
+
...webSocketCompleteComponent,
|
|
197
|
+
...userUploadRecordTable
|
|
190
198
|
)
|
|
191
199
|
}
|
|
192
200
|
|
|
@@ -299,7 +307,6 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
299
307
|
...processAfterUploadResources,
|
|
300
308
|
...confirmAfterUploadResources,
|
|
301
309
|
...snsTopicOutFlowSchemaUploadS3,
|
|
302
|
-
...userUploadRecordTable
|
|
303
310
|
);
|
|
304
311
|
|
|
305
312
|
} else if (event.includes("extTopic")) {
|
|
@@ -358,6 +365,11 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
358
365
|
console.log("event ownTopic generated")
|
|
359
366
|
createSourceParams.push(...ownTopicResources);
|
|
360
367
|
|
|
368
|
+
if (flowSchema.outputTopic === true && flowSchema.event.includes("ownTopic") || flowSchema.event.includes("extTopic")) {
|
|
369
|
+
const statusFieldComponent = (await Promise.all(Object.entries(createFlowSchemaStatusFieldComponent).map(([type, functionYaml]) => functionYaml(_izContext, flowSchema, saveFilePath)))).flat();;
|
|
370
|
+
console.log("statusFieldComponent", JSON.stringify(statusFieldComponent, null, 2))
|
|
371
|
+
createSourceParams.push(...statusFieldComponent)
|
|
372
|
+
}
|
|
361
373
|
} else if (event.includes("eventBridge")) {
|
|
362
374
|
|
|
363
375
|
const flowSchemaEventBridgeHandler = createFlowSchemaEventBridgeHandler(_izContext, flowSchema, saveFilePath);
|
|
@@ -443,10 +455,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
443
455
|
const queue = createFlowSchemaTriggerCacheQueue(flowSchema, saveFilePath);
|
|
444
456
|
// console.log("functionYaml", JSON.stringify(...functionYaml, null, 2))
|
|
445
457
|
createSourceParams.push(...functionYaml, ...mainFunction, ...handler, ...queue)
|
|
446
|
-
// console.log("
|
|
447
|
-
console.log("mainFunction triggerCache", JSON.stringify(mainFunction, null, 2))
|
|
448
|
-
console.log("handler triggerCache", JSON.stringify(handler, null, 2))
|
|
449
|
-
console.log("Generate triggerCache component")
|
|
458
|
+
// console.log("Generate triggerCache component")
|
|
450
459
|
}
|
|
451
460
|
}
|
|
452
461
|
|
|
@@ -478,7 +487,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
478
487
|
createSourceParams.push(...flowSchemaRegisters);
|
|
479
488
|
}
|
|
480
489
|
|
|
481
|
-
|
|
490
|
+
console.log("createSourceParams flowSchema", createSourceParams)
|
|
482
491
|
return createSourceParams;
|
|
483
492
|
} catch (error) {
|
|
484
493
|
_izContext.logger.error('Error generating code with template flowSchema:', error);
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`) %>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
5
|
+
role: <%- firstLetterUpperCase(roleName) _%>Role
|
|
6
|
+
#<#<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
|
|
7
|
+
#<#/<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
|
|
5
8
|
events:
|
|
6
9
|
- httpApi:
|
|
7
10
|
path: /<%- serviceTag %>/<%- firstLetterLowerCase(functionName) %>/<%- functionName %>
|
|
@@ -15,9 +18,8 @@
|
|
|
15
18
|
authorizer: authorizerServiceSchema
|
|
16
19
|
#<#<%- firstLetterUpperCase(functionName) _%><%- firstLetterUpperCase(handlerType) %>UserLevelAuthorizer#>
|
|
17
20
|
#<#/<%- firstLetterUpperCase(functionName) _%><%- firstLetterUpperCase(handlerType) %>UserLevelAuthorizer#>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
#<#/<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>IamRole#>
|
|
21
|
+
|
|
22
|
+
|
|
21
23
|
<%_ function firstLetterUpperCase(text){
|
|
22
24
|
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
23
25
|
} _%>
|