@izara_project/izara-market-library-service-schemas 1.0.29 → 1.0.30
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/GenerateCodeLibs/src/Consts.js +10 -9
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +54 -21
- package/src/MainLibs/src/Consts.js +33 -17
- package/src/reStructure/GenerateCode.js +2 -1
- package/src/reStructure/TemplateConfig.js +5 -1
- package/src/reStructure/TemplateData/EndpointPerService/generateTemplateData.js +108 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/data.js +76 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +73 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/data.js +81 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/template.ejs +125 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/data.js +70 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +73 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/data.js +79 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/template.ejs +126 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/data.js +53 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +624 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/data.js +52 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +177 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/data.js +56 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +234 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/data.js +56 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +330 -0
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +175 -0
- package/src/reStructure/TemplateData/EndpointPerService/yaml/template.ejs +26 -0
- package/src/reStructure/TemplateData/externalService/generateTemplateData.js +1 -1
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +91 -249
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +1 -1
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +10 -8
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +1 -1
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +4 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +3 -29
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +3 -21
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +3 -31
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/functionYaml/data.js +41 -10
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/functionYaml/template.ejs +3 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/{hook/handler/templateAsyncHandler.ejs → preSignUrl/createPresignUrl/handler/template.ejs} +26 -11
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/mainFunction/data.js +10 -7
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +253 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{reservedLimit → createPresignUrl}/queue/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +10 -38
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +0 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +40 -45
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +7 -10
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +100 -190
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → reservedLimit}/sqs/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → reservedLimit}/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +8 -6
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/data.js +5 -2
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +41 -38
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +11 -1
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +35 -44
- package/src/reStructure/TemplateData/perActionComplete/create/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/data.js +4 -5
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/data.js +5 -4
- package/src/reStructure/TemplateData/perActionComplete/generateTemplateData.js +15 -2
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/data.js +7 -4
- package/src/reStructure/TemplateData/perActionComplete/update/sns-out/data.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/data.js +5 -4
- package/src/reStructure/TemplateData/processLogical/yaml/data.js +3 -3
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/template.ejs +0 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +6 -12
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +22 -49
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/resourceYaml/sns-out/data.js +8 -24
- package/src/reStructure/TemplateData/resourceYaml/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/testTemplate/template.ejs +0 -5
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/data.js +0 -93
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateSyncHandler.ejs +0 -49
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/hookLogic/data.js +0 -43
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/data.js +0 -65
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/template.ejs +0 -7
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/data.js +0 -72
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/snsTemplate.ejs +0 -59
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/sqsTemplate.ejs +0 -43
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/handler/template.ejs +0 -120
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/mainFunction/template.ejs +0 -163
- package/src/reStructure/TemplateData/relationshipPerAction.zip +0 -0
- /package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{reservedLimit → createPresignUrl}/queue/template.ejs +0 -0
|
@@ -40,83 +40,42 @@ const {
|
|
|
40
40
|
SHORT_FUNCTION_NAME,
|
|
41
41
|
defaultIamRolePerAction,
|
|
42
42
|
resourceNames,
|
|
43
|
-
SOURCE_GENERATE_IAM_ROLE
|
|
43
|
+
SOURCE_GENERATE_IAM_ROLE,
|
|
44
|
+
getStorageResourceFromObjectSchemas,
|
|
45
|
+
FUNCTION_NAME
|
|
44
46
|
} = require("../../../../MainLibs/src/Consts");
|
|
45
47
|
const templatePath = path.join(__dirname, "./template.ejs");
|
|
46
48
|
const { getAllLocalRelationshipSchema } = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
47
49
|
const { EXTERNAL_SERVICE_NAME } = require("../../../../GenerateCodeLibs/src/Consts");
|
|
48
50
|
|
|
49
51
|
const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas, allLocalFlowSchemas, srcPath) => {
|
|
50
|
-
const allRelationshipSchemas = getAllLocalRelationshipSchema(_izContext, srcPath)
|
|
51
52
|
// console.log("allRelationshipSchemas", allRelationshipSchemas);
|
|
52
53
|
const externalLambdaIamRoleArray = [];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
for (const action of Object.values(ACTIONS)) {
|
|
57
|
-
if (objectSchema.overWriteHandlers?.[action]) {
|
|
58
|
-
for (const handler of objectSchema.overWriteHandlers[action]) {
|
|
59
|
-
const externalLambdaIamRole = await externalLambdaIamRoleDataPerAction(_izContext, objectSchema, action, handler)
|
|
60
|
-
externalLambdaIamRole && externalLambdaIamRoleArray.push(externalLambdaIamRole);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
} else {
|
|
64
|
-
for (const handler of DEFAULT_HANDLER_PER_ACTION[action]) {
|
|
65
|
-
const externalLambdaIamRole = await externalLambdaIamRoleDataPerAction(_izContext, objectSchema, action, handler)
|
|
66
|
-
externalLambdaIamRole && externalLambdaIamRoleArray.push(externalLambdaIamRole);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
54
|
+
// per action external lambda role
|
|
55
|
+
const externalLambdaIamRole = await externalLambdaIamRoleDataPerAction(_izContext, allObjSchemas)
|
|
56
|
+
externalLambdaIamRole && externalLambdaIamRoleArray.push(externalLambdaIamRole);
|
|
70
57
|
|
|
71
|
-
|
|
58
|
+
const allRelationshipSchemas = getAllLocalRelationshipSchema(_izContext, srcPath)
|
|
72
59
|
|
|
73
60
|
// validate relationship in ObjectRelationship
|
|
74
61
|
if (allRelationshipSchemas.length) {
|
|
62
|
+
// relationship external lambda role
|
|
63
|
+
const externalLambdaIamRoleRelationshipPerAction = await externalLamdaIamRoleRelationships(_izContext, allRelSchemas);
|
|
64
|
+
externalLambdaIamRoleRelationshipPerAction && externalLambdaIamRoleArray.push(externalLambdaIamRoleRelationshipPerAction)
|
|
65
|
+
}
|
|
75
66
|
|
|
76
|
-
// updateRelationship external lambda role
|
|
77
|
-
for (const handler of Object.values(HANDLER)) {
|
|
78
|
-
const externalLambdaIamRoleUpdateRelationship = await externalLambdaIamRoleDataUpdateRelationshipSchema(_izContext, allRelSchemas, handler);
|
|
79
|
-
externalLambdaIamRoleUpdateRelationship && externalLambdaIamRoleArray.push(externalLambdaIamRoleUpdateRelationship)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// CreateRelationship external lambda role
|
|
83
|
-
for (const handler of Object.values(HANDLER)) {
|
|
84
|
-
const externalLambdaIamRoleCreateRelationship = await externalLambdaIamRoleDataCreateRelationshipSchema(_izContext, allRelSchemas, handler);
|
|
85
|
-
externalLambdaIamRoleCreateRelationship && externalLambdaIamRoleArray.push(externalLambdaIamRoleCreateRelationship)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
for (const handler of Object.values(HANDLER)) {
|
|
89
|
-
const externalLambdaIamRoleDeleteRelationship = await externalLambdaIamRoleDataDeleteRelationshipSchema(_izContext, allRelSchemas, handler);
|
|
90
|
-
externalLambdaIamRoleDeleteRelationship && externalLambdaIamRoleArray.push(externalLambdaIamRoleDeleteRelationship)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// findData external lambda role
|
|
94
|
-
const externalLambdaIamRoleFindData = externalLambdaIamRoleDataFindData(_izContext);
|
|
95
|
-
externalLambdaIamRoleFindData && externalLambdaIamRoleArray.push(externalLambdaIamRoleFindData)
|
|
96
|
-
|
|
97
|
-
// updateRelationshipComplete external lambda role
|
|
98
|
-
|
|
99
|
-
// ... another external lambda role data
|
|
100
67
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
68
|
+
// ProcessLogical and FindData
|
|
69
|
+
const externalLambdaIamRoleProcessLogical = await externalLambdaIamRoleDataProcessLogicalAndFindData(_izContext, allObjSchemas);
|
|
70
|
+
externalLambdaIamRoleProcessLogical && externalLambdaIamRoleArray.push(externalLambdaIamRoleProcessLogical)
|
|
105
71
|
|
|
106
72
|
if (allLocalFlowSchemas) {
|
|
107
73
|
for (const localFlowSchema of allLocalFlowSchemas) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
externalLambdaIamRoleReservedLimitComplete && externalLambdaIamRoleArray.push(externalLambdaIamRoleReservedLimitComplete);
|
|
114
|
-
|
|
115
|
-
const externalLambdaIamRoleProcessAfterUpload = await externalLambdaIamRoleDataProcessAfterUpload(_izContext);
|
|
116
|
-
externalLambdaIamRoleProcessAfterUpload && externalLambdaIamRoleArray.push(externalLambdaIamRoleProcessAfterUpload);
|
|
117
|
-
|
|
118
|
-
const externalLambdaIamRoleConfirmReservedAfterUpload = await externalLambdaIamRoleDataConfirmReservedAfterUpload(_izContext);
|
|
119
|
-
externalLambdaIamRoleConfirmReservedAfterUpload && externalLambdaIamRoleArray.push(externalLambdaIamRoleConfirmReservedAfterUpload);
|
|
74
|
+
for (const event of localFlowSchema.event) {
|
|
75
|
+
if (event.includes("s3")) {
|
|
76
|
+
const externalLambdaIamRoleGetPresignUrl = await externalLambdaIamRoleUploadS3(_izContext);
|
|
77
|
+
externalLambdaIamRoleGetPresignUrl && externalLambdaIamRoleArray.push(externalLambdaIamRoleGetPresignUrl);
|
|
78
|
+
}
|
|
120
79
|
}
|
|
121
80
|
}
|
|
122
81
|
}
|
|
@@ -137,189 +96,100 @@ const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas
|
|
|
137
96
|
}
|
|
138
97
|
}
|
|
139
98
|
|
|
140
|
-
async function externalLambdaIamRoleDataPerAction(_izContext,
|
|
141
|
-
|
|
99
|
+
async function externalLambdaIamRoleDataPerAction(_izContext, allObjSchemas) {
|
|
100
|
+
let storageResourceAllLocalObjectSchemas = await getStorageResourceFromObjectSchemas(_izContext, allObjSchemas)
|
|
142
101
|
const additionalResourcePermission = [];
|
|
143
|
-
const graphServiceNames = [];
|
|
144
|
-
for (const storgaeResource of Object.values(objectSchema.storageResources)) {
|
|
145
|
-
if (storgaeResource.storageType === STORAGE_TYPES.graph) {
|
|
146
|
-
let getGraphServiceName = await getGraphServiceTagWithCache(_izContext, storgaeResource.graphServerTag)
|
|
147
|
-
if (!graphServiceNames.includes(getGraphServiceName)) {
|
|
148
|
-
getGraphServiceName && graphServiceNames.push(getGraphServiceName)
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// let functionName = upperCase(objectType) + upperCase(action) + upperCase(shortNameHandler(handler));
|
|
155
|
-
let functionName = upperCase(objectType) + upperCase(action) + upperCase(shortNameHandler(handler));
|
|
156
102
|
|
|
157
|
-
if (!
|
|
103
|
+
if (!storageResourceAllLocalObjectSchemas.resourceGraphServiceTag.length) {
|
|
158
104
|
return
|
|
159
105
|
} else {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
externalResourceName(RESOURCE_CLASSES.lambda, "GetNodeV2HdrInv", graphServiceName),
|
|
166
|
-
)
|
|
106
|
+
additionalResourcePermission.push(
|
|
107
|
+
createIamRole(
|
|
108
|
+
{ [RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction] },
|
|
109
|
+
storageResourceAllLocalObjectSchemas.resourceGraphServiceTag.map(graphServiceName =>
|
|
110
|
+
externalResourceName(RESOURCE_CLASSES.lambda, "GetNodeV2HdrInv", graphServiceName),
|
|
167
111
|
)
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
graphServiceNames.map(graphServiceName =>
|
|
177
|
-
externalResourceName(RESOURCE_CLASSES.sns, "InUpdateNode", graphServiceName)
|
|
178
|
-
)
|
|
112
|
+
),
|
|
113
|
+
createIamRole(
|
|
114
|
+
{
|
|
115
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
116
|
+
},
|
|
117
|
+
storageResourceAllLocalObjectSchemas.resourceGraphServiceTag.map(graphServiceName =>
|
|
118
|
+
externalResourceName(RESOURCE_CLASSES.sns, "InUpdateNode", graphServiceName)
|
|
179
119
|
)
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
graphServiceNames.map(graphServiceName =>
|
|
189
|
-
externalResourceName(RESOURCE_CLASSES.sns, "InCreateNodeV2", graphServiceName)
|
|
190
|
-
)
|
|
120
|
+
),
|
|
121
|
+
createIamRole(
|
|
122
|
+
{
|
|
123
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
124
|
+
},
|
|
125
|
+
storageResourceAllLocalObjectSchemas.resourceGraphServiceTag.map(graphServiceName =>
|
|
126
|
+
externalResourceName(RESOURCE_CLASSES.sns, "InCreateNodeV2", graphServiceName)
|
|
191
127
|
)
|
|
192
128
|
)
|
|
193
|
-
|
|
194
|
-
} else if (action === ACTIONS.delete) {
|
|
195
|
-
return
|
|
196
|
-
// additionalResourcePermission.push(
|
|
197
|
-
// createIamRole(
|
|
198
|
-
// {
|
|
199
|
-
// [RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
200
|
-
// },
|
|
201
|
-
// graphServiceNames.map(graphServiceName =>
|
|
202
|
-
// externalResourceSns("InDeleteNode", graphServiceName)
|
|
203
|
-
// )
|
|
204
|
-
// )
|
|
205
|
-
// )
|
|
206
|
-
} else {
|
|
207
|
-
throw new error("Invalid action")
|
|
208
|
-
}
|
|
129
|
+
)
|
|
209
130
|
}
|
|
210
131
|
|
|
211
132
|
|
|
212
133
|
return {
|
|
213
|
-
objectType:
|
|
214
|
-
functionName: functionName,
|
|
215
|
-
action: action,
|
|
134
|
+
objectType: SOURCE_GENERATE_IAM_ROLE.perActionEndpoint,
|
|
216
135
|
additionalResourcePermission
|
|
217
136
|
}
|
|
218
137
|
}
|
|
219
138
|
|
|
220
139
|
|
|
221
140
|
// update Relationship
|
|
222
|
-
async function
|
|
223
|
-
const functionName = upperCase(SHORT_FUNCTION_NAME.updateRel) + upperCase(shortNameHandler(handler));
|
|
141
|
+
async function externalLamdaIamRoleRelationships(_izContext, allRelSchemas) {
|
|
224
142
|
const additionalResourcePermission = [];
|
|
225
143
|
const graphServiceNamesFromAllRelSchemas = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas);
|
|
226
144
|
const objectType = SOURCE_GENERATE_IAM_ROLE.RelationshipRole
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
)
|
|
263
|
-
)
|
|
264
|
-
)
|
|
265
|
-
return {
|
|
266
|
-
functionName,
|
|
267
|
-
additionalResourcePermission,
|
|
268
|
-
objectType
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// delete Relationship
|
|
273
|
-
async function externalLambdaIamRoleDataDeleteRelationshipSchema(_izContext, allRelSchemas, handler) {
|
|
274
|
-
const functionName = upperCase(SHORT_FUNCTION_NAME.deleteRel) + upperCase(shortNameHandler(handler))
|
|
275
|
-
const additionalResourcePermission = [];
|
|
276
|
-
const graphServiceNamesFromAllRelSchemas = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas);
|
|
277
|
-
const objectType = SOURCE_GENERATE_IAM_ROLE.RelationshipRole
|
|
278
|
-
|
|
279
|
-
additionalResourcePermission.push(
|
|
280
|
-
createIamRole(
|
|
281
|
-
{
|
|
282
|
-
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
283
|
-
},
|
|
284
|
-
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
285
|
-
externalResourceName(RESOURCE_CLASSES.sns, "InDeleteRelationshipV2", graphServiceName)
|
|
145
|
+
if (!graphServiceNamesFromAllRelSchemas.length) {
|
|
146
|
+
return
|
|
147
|
+
} else {
|
|
148
|
+
additionalResourcePermission.push(
|
|
149
|
+
createIamRole(
|
|
150
|
+
{
|
|
151
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
152
|
+
},
|
|
153
|
+
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
154
|
+
externalResourceName(RESOURCE_CLASSES.sns, "InUpdateRelationship", graphServiceName)
|
|
155
|
+
)
|
|
156
|
+
),
|
|
157
|
+
createIamRole(
|
|
158
|
+
{
|
|
159
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
160
|
+
},
|
|
161
|
+
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
162
|
+
externalResourceName(RESOURCE_CLASSES.sns, "InCreateRelationshipV2", graphServiceName)
|
|
163
|
+
)
|
|
164
|
+
),
|
|
165
|
+
createIamRole(
|
|
166
|
+
{
|
|
167
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
168
|
+
},
|
|
169
|
+
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
170
|
+
externalResourceName(RESOURCE_CLASSES.sns, "InDeleteRelationshipV2", graphServiceName)
|
|
171
|
+
)
|
|
172
|
+
),
|
|
173
|
+
createIamRole(
|
|
174
|
+
{
|
|
175
|
+
[RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction]
|
|
176
|
+
},
|
|
177
|
+
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
178
|
+
externalResourceName(RESOURCE_CLASSES.lambda, "GetRelationshipV2HdrInv", graphServiceName)
|
|
179
|
+
)
|
|
286
180
|
)
|
|
287
181
|
)
|
|
288
|
-
)
|
|
289
|
-
return {
|
|
290
|
-
functionName,
|
|
291
|
-
additionalResourcePermission,
|
|
292
|
-
objectType
|
|
293
182
|
}
|
|
294
|
-
}
|
|
295
183
|
|
|
296
|
-
function externalLambdaIamRoleDataFindData(_izContext) {
|
|
297
|
-
let functionName = upperCase(SHORT_FUNCTION_NAME.findData) + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
298
|
-
let additionalResourcePermission = [];
|
|
299
|
-
let objectType = SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole
|
|
300
|
-
additionalResourcePermission.push(
|
|
301
|
-
createIamRole(
|
|
302
|
-
{
|
|
303
|
-
[RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction]
|
|
304
|
-
},
|
|
305
|
-
[
|
|
306
|
-
externalResourceName(RESOURCE_CLASSES.lambda, "GetNodeV2HdrInv", "GraphHandler")
|
|
307
|
-
]
|
|
308
|
-
)
|
|
309
|
-
)
|
|
310
|
-
// console.log("findData template data:", { functionName, additionalResourcePermission })
|
|
311
184
|
return {
|
|
312
|
-
functionName,
|
|
313
185
|
additionalResourcePermission,
|
|
314
186
|
objectType
|
|
315
187
|
}
|
|
316
188
|
}
|
|
317
189
|
|
|
318
|
-
|
|
319
|
-
async function externalLambdaIamRoleDataProcessLogical(_izContext, allObjectSchemas) {
|
|
320
|
-
let functionName = upperCase(SHORT_FUNCTION_NAME.processLogical) + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
190
|
+
async function externalLambdaIamRoleDataProcessLogicalAndFindData(_izContext, allObjectSchemas) {
|
|
321
191
|
let additionalResourcePermission = [];
|
|
322
|
-
let graphServiceNames = await
|
|
192
|
+
let graphServiceNames = await getStorageResourceFromObjectSchemas(_izContext, allObjectSchemas)
|
|
323
193
|
let objectType = SOURCE_GENERATE_IAM_ROLE.ProcessFindDataRole
|
|
324
194
|
|
|
325
195
|
// console.log("graphServiceNameFromProcessLogical::", graphServiceNames)
|
|
@@ -328,22 +198,21 @@ async function externalLambdaIamRoleDataProcessLogical(_izContext, allObjectSche
|
|
|
328
198
|
{
|
|
329
199
|
[RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction]
|
|
330
200
|
},
|
|
331
|
-
graphServiceNames.map(graphServiceName => (
|
|
201
|
+
graphServiceNames.resourceGraphServiceTag.map(graphServiceName => (
|
|
332
202
|
externalResourceName(RESOURCE_CLASSES.lambda, "GetNodeV2HdrInv", graphServiceName)
|
|
333
203
|
))
|
|
334
204
|
)
|
|
335
205
|
)
|
|
336
206
|
return {
|
|
337
|
-
functionName,
|
|
338
207
|
additionalResourcePermission,
|
|
339
208
|
objectType
|
|
340
209
|
}
|
|
341
210
|
}
|
|
342
211
|
|
|
343
|
-
function
|
|
344
|
-
let functionName = "GetPresignUrl" + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
212
|
+
function externalLambdaIamRoleUploadS3(_izContext) {
|
|
345
213
|
let additionalResourcePermission = [];
|
|
346
|
-
|
|
214
|
+
let objectType = SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
215
|
+
// reservedLimit
|
|
347
216
|
additionalResourcePermission.push(
|
|
348
217
|
createIamRole(
|
|
349
218
|
{
|
|
@@ -362,17 +231,7 @@ function externalLambdaIamRoleDataGetPresignUrl(_izContext) {
|
|
|
362
231
|
]
|
|
363
232
|
)
|
|
364
233
|
)
|
|
365
|
-
//
|
|
366
|
-
return {
|
|
367
|
-
functionName,
|
|
368
|
-
additionalResourcePermission
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
function externalLambdaIamRoleDataReservedLimitComplete(_izContext) {
|
|
373
|
-
let functionName = "ReservedLimitComp" + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
374
|
-
let additionalResourcePermission = [];
|
|
375
|
-
|
|
234
|
+
// createPresignUrl
|
|
376
235
|
additionalResourcePermission.push(
|
|
377
236
|
createIamRole(
|
|
378
237
|
{
|
|
@@ -383,16 +242,7 @@ function externalLambdaIamRoleDataReservedLimitComplete(_izContext) {
|
|
|
383
242
|
]
|
|
384
243
|
)
|
|
385
244
|
)
|
|
386
|
-
|
|
387
|
-
functionName,
|
|
388
|
-
additionalResourcePermission
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
function externalLambdaIamRoleDataConfirmReservedAfterUpload(_izContext) {
|
|
393
|
-
let functionName = "ConfirmNewReserved" + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
394
|
-
let additionalResourcePermission = []
|
|
395
|
-
|
|
245
|
+
// confirmReserved
|
|
396
246
|
additionalResourcePermission.push(
|
|
397
247
|
createIamRole(
|
|
398
248
|
{
|
|
@@ -404,16 +254,7 @@ function externalLambdaIamRoleDataConfirmReservedAfterUpload(_izContext) {
|
|
|
404
254
|
]
|
|
405
255
|
),
|
|
406
256
|
)
|
|
407
|
-
|
|
408
|
-
functionName,
|
|
409
|
-
additionalResourcePermission
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
function externalLambdaIamRoleDataProcessAfterUpload(_izContext) {
|
|
414
|
-
let functionName = "ProcessAfterUploadS3" + shortNameHandler(upperCase("HdrS3"));
|
|
415
|
-
let additionalResourcePermission = []
|
|
416
|
-
|
|
257
|
+
// process after upload
|
|
417
258
|
additionalResourcePermission.push(
|
|
418
259
|
createIamRole(
|
|
419
260
|
{
|
|
@@ -426,9 +267,10 @@ function externalLambdaIamRoleDataProcessAfterUpload(_izContext) {
|
|
|
426
267
|
]
|
|
427
268
|
)
|
|
428
269
|
)
|
|
270
|
+
// console.log("additionalResourcePermission GetPresignUrl::", JSON.stringify(additionalResourcePermission))
|
|
429
271
|
return {
|
|
430
|
-
|
|
431
|
-
|
|
272
|
+
additionalResourcePermission,
|
|
273
|
+
objectType
|
|
432
274
|
}
|
|
433
275
|
}
|
|
434
276
|
|
|
@@ -32,7 +32,7 @@ module.exports.generatedLambdaRole = async () => {
|
|
|
32
32
|
statement: [
|
|
33
33
|
<%_ data.additionalResourcePermission.forEach((resourcePermission, resourceIdx) => { _%>
|
|
34
34
|
{
|
|
35
|
-
"Sid": "<%- data.
|
|
35
|
+
"Sid": "<%- data.objectType %>Test<%- resourceIdx %>",
|
|
36
36
|
"Effect": "<%- resourcePermission.effect %>",
|
|
37
37
|
"Action":
|
|
38
38
|
[
|
|
@@ -66,13 +66,15 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
|
|
|
66
66
|
snsServiceConfigDeleteNodeComplete && snsServiceConfigArray.push(snsServiceConfigDeleteNodeComplete);
|
|
67
67
|
|
|
68
68
|
if (allLocalFlowSchemas) {
|
|
69
|
-
for (const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
for (const localFlowSchema of allLocalFlowSchemas) {
|
|
70
|
+
for (const event of localFlowSchema.event) {
|
|
71
|
+
if (event.includes("s3")) {
|
|
72
|
+
const snsServiceConfigForReservedDynamicUsage = await snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext);
|
|
73
|
+
snsServiceConfigForReservedDynamicUsage && snsServiceConfigArray.push(snsServiceConfigForReservedDynamicUsage);
|
|
74
|
+
|
|
75
|
+
const snsServiceConfigForConfirmReserved = await snsSubscriptionConfirmReserved(_izContext);
|
|
76
|
+
snsServiceConfigForConfirmReserved && snsServiceConfigArray.push(snsServiceConfigForConfirmReserved);
|
|
77
|
+
}
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
}
|
|
@@ -160,7 +162,7 @@ function snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext)
|
|
|
160
162
|
return {
|
|
161
163
|
serviceNames: serviceNames,
|
|
162
164
|
topicName: TOPIC_NAME_EXTERNAL_SERVICE.reservedDynamicUsageComplete,
|
|
163
|
-
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.
|
|
165
|
+
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.createPresignUrl + upperCase(HANDLER.hdrSqs)
|
|
164
166
|
}
|
|
165
167
|
}
|
|
166
168
|
|
|
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
module.exports.generatedSnsTopicSubscription = [ <% datas.forEach(data => { -%>
|
|
21
|
-
<% data.serviceNames.forEach(serviceName => {
|
|
21
|
+
<% data.serviceNames.forEach(serviceName => { _%>
|
|
22
22
|
{
|
|
23
23
|
serviceName: "<%- serviceName %>",
|
|
24
24
|
topicName: "<%- data.topicName %>",
|
|
@@ -75,8 +75,8 @@ function defaultIamRolePerAction() {
|
|
|
75
75
|
[RESOURCE_CLASSES.sns]: ["Publish"]
|
|
76
76
|
},
|
|
77
77
|
[
|
|
78
|
-
resourceNames(RESOURCE_CLASSES.sns, "
|
|
79
|
-
resourceNames(RESOURCE_CLASSES.sns, "
|
|
78
|
+
resourceNames(RESOURCE_CLASSES.sns, "FindData_In"),
|
|
79
|
+
resourceNames(RESOURCE_CLASSES.sns, "FindDataComplete_Out")
|
|
80
80
|
]
|
|
81
81
|
)
|
|
82
82
|
)
|
|
@@ -38,7 +38,8 @@ const {
|
|
|
38
38
|
externalResourceName,
|
|
39
39
|
DYNAMO_RESOURCE,
|
|
40
40
|
LAMBDA_RESOURCE,
|
|
41
|
-
SOURCE_GENERATE_IAM_ROLE
|
|
41
|
+
SOURCE_GENERATE_IAM_ROLE,
|
|
42
|
+
ACTIONS
|
|
42
43
|
} = require('../../../../../../../MainLibs/src/Consts');
|
|
43
44
|
|
|
44
45
|
/**
|
|
@@ -91,8 +92,8 @@ function createSourceParams(_izContext, srcPath) {
|
|
|
91
92
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
92
93
|
},
|
|
93
94
|
[
|
|
94
|
-
resourceNames(RESOURCE_CLASSES.lambda,
|
|
95
|
-
resourceNames(RESOURCE_CLASSES.sns, "
|
|
95
|
+
resourceNames(RESOURCE_CLASSES.lambda, upperCase(ACTIONS.get) + upperCase(HANDLER.hdrInv)),
|
|
96
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(ACTIONS.update) + "_In")
|
|
96
97
|
]
|
|
97
98
|
)
|
|
98
99
|
)
|
package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js
CHANGED
|
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
const path = require('path');
|
|
20
20
|
|
|
21
|
-
const { FLOW_SCHEMA_HOOK_STATE } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
21
|
+
const { FLOW_SCHEMA_HOOK_STATE, ACTIONS } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
22
22
|
const { firstLetterUpperCase: upperCase } = require('../../../../../../../MainLibs/src/Utils')
|
|
23
23
|
const {
|
|
24
24
|
SOURCE_PATH,
|
|
@@ -63,7 +63,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
65
|
[
|
|
66
|
-
resourceNames(RESOURCE_CLASSES.sns, "
|
|
66
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(ACTIONS.create) + "_In")
|
|
67
67
|
]
|
|
68
68
|
),
|
|
69
69
|
createIamRole(
|
|
@@ -92,33 +92,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
92
92
|
)
|
|
93
93
|
)
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
for (const [hookName, hookProperties] of Object.entries(flowSchema.hook)) {
|
|
97
|
-
if (hookName === FLOW_SCHEMA_HOOK_STATE.beforeCreate) {
|
|
98
|
-
for (const hookFunction of hookProperties.functionList) {
|
|
99
|
-
if ((hookFunction.event.hasOwnProperty("initialEvent") && (hookFunction.event.initialEvent === true))) {
|
|
100
|
-
if (hookFunction?.permission) {
|
|
101
|
-
for (const permission of hookFunction.permission) {
|
|
102
|
-
additionalResourcePermission.push(
|
|
103
|
-
createIamRole(
|
|
104
|
-
permission.action,
|
|
105
|
-
permission.resource.map(resource =>
|
|
106
|
-
externalResourceYaml(
|
|
107
|
-
resource.resource,
|
|
108
|
-
resource.resourceName,
|
|
109
|
-
resource.serviceTag),
|
|
110
|
-
permission.effect
|
|
111
|
-
)
|
|
112
|
-
)
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// console.log("additionalResourcePermission in createObjectS3", JSON.stringify(additionalResourcePermission))
|
|
95
|
+
|
|
122
96
|
return {
|
|
123
97
|
templatePath: templatePath,
|
|
124
98
|
templateData: {
|
package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js
CHANGED
|
@@ -38,30 +38,12 @@ function data(_izContext, flowSchema, srcPath) {
|
|
|
38
38
|
function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
|
|
39
39
|
let functionName = upperCase(FUNCTION_NAME.createObjectS3)
|
|
40
40
|
let handlerType = "HdrWbs"
|
|
41
|
-
|
|
42
|
-
let hookFunctionName;
|
|
43
|
-
let isAsync = false;
|
|
44
|
-
if (flowSchema?.hook) {
|
|
45
|
-
for (const [hookName, hookProperties] of Object.entries(flowSchema.hook)) {
|
|
46
|
-
for (const hookFunction of hookProperties.functionList) {
|
|
47
|
-
if (hookName === FLOW_SCHEMA_HOOK_STATE.beforeCreate) {
|
|
48
|
-
if (hookFunction.event?.initialEvent && hookFunction.event.initialEvent === true) {
|
|
49
|
-
hook = true
|
|
50
|
-
hookFunctionName = hookFunction.name
|
|
51
|
-
if (hookFunction.event?.isAsync && hookFunction.event.isAsync === true) {
|
|
52
|
-
isAsync = true
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
41
|
+
|
|
59
42
|
return {
|
|
60
43
|
templatePath: templatePath,
|
|
61
44
|
templateData: {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
isAsync
|
|
45
|
+
functionName,
|
|
46
|
+
handlerType
|
|
65
47
|
},
|
|
66
48
|
setting: {
|
|
67
49
|
savePath: path.join(srcPath, SOURCE_PATH.webSocket),
|