@izara_project/izara-market-library-service-schemas 1.0.35 → 1.0.37
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 +8 -7
- package/src/GenerateCodeLibs/src/Consts.js +2 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +3 -2
- package/src/MainLibs/src/Consts.js +8 -8
- package/src/MainLibs/src/GenerateCodeUtils.js +3 -1
- package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/generateTemplateData.js +35 -20
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/data.js +84 -0
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/tempReferenceRelationshipSchema.ejs +9 -0
- package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/relationshipSchema/data.js +1 -1
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/handler/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +1 -1
- package/src/reStructure/SchemaConfig.js +1 -4
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +701 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +35 -163
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +3 -1
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +3 -4
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +3 -1
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +45 -19
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +5 -2
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +24 -14
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +4 -1
- package/src/reStructure/TemplateData/findData/GetByStorage/getByGraph.ejs +4 -3
- package/src/reStructure/TemplateData/findData/handler/template.ejs +2 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +4 -10
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +69 -34
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +3 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +3 -12
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +18 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +10 -7
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +12 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +14 -9
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/data.js +16 -40
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/template.ejs +9 -9
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/handler/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/data.js +3 -3
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/template.ejs +78 -27
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/dynamoDB/register.js +82 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/template.ejs +34 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/storedCacheTemplate.ejs +9 -32
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/data.js +30 -20
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/template.ejs +6 -6
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/data.js +32 -32
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/template.ejs +5 -5
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/handler/template.ejs +8 -9
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/mainFunction/template.ejs +116 -26
- package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +83 -44
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +4 -5
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +1 -7
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +6 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/template.ejs +2 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/data.js +31 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/data.js +7 -8
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/template.ejs +13 -13
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/template.ejs +43 -39
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +5 -7
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/data.js +2 -9
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/template.ejs +46 -48
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +5 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/template.ejs +3 -11
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +17 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +6 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +49 -84
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +60 -10
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +7 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +22 -7
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +27 -34
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data.js +21 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/template.ejs +1 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/template.ejs +5 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/data.js +5 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/template.ejs +10 -6
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +6 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +0 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +8 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +21 -14
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +23 -8
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +11 -6
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +50 -45
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +3 -2
- package/src/reStructure/TemplateData/generateRole/sharedResourceTemplate.ejs +2 -28
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +10 -9
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +6 -2
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/perActionEndpoint/libs/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +1 -0
- package/src/reStructure/TemplateData/{propertyNodeSchema → propertyValueSchema}/generateTemplateData.js +4 -4
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +131 -0
- package/src/reStructure/TemplateData/{propertyNodeSchema/relationshipPropertyNodeSchema → propertyValueSchema/relationshipPropertyValueSchema}/data.js +32 -55
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/tempRelationship.ejs +13 -0
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/templateRelationshipPropertyValueSchema.ejs +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +5 -5
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +6 -5
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +5 -4
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/template.ejs +1 -3
- package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +61 -0
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +13 -4
- package/src/reStructure/TemplateData/propertyNodeSchema/objectPropertyNodeSchema/data.js +0 -151
- package/src/reStructure/TemplateData/propertyNodeSchema/relationshipPropertyNodeSchema/templateRelationshipPropertyNodeSchema.ejs +0 -7
- package/src/reStructure/TemplateData/testTemplate/data.js +0 -27
- package/src/reStructure/TemplateData/testTemplate/template.ejs +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/attributeLinkTemplate.ejs +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/data.js +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/request.json +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/relationshipSchema/template.ejs +0 -0
- /package/src/reStructure/TemplateData/{propertyNodeSchema/objectPropertyNodeSchema/templateObjectPropertyNodeSchema.ejs → propertyValueSchema/objectPropertyValueSchema/templateObjectPropertyValueSchema.ejs} +0 -0
|
@@ -31,7 +31,7 @@ const serviceConfigLib = require('@izara_project/izara-core-library-service-sche
|
|
|
31
31
|
|
|
32
32
|
const uploadUseCase = require('@izara_project/izara-core-library-service-schemas/src/libs/UploadUseCase')
|
|
33
33
|
|
|
34
|
-
const hash = require(
|
|
34
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
35
35
|
const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
|
|
36
36
|
const path = require('path')
|
|
37
37
|
const schemasPath = path.join(__dirname, '../schemas');
|
|
@@ -62,22 +62,11 @@ const { createDataDetailsLib } = require('@izara_project/izara-market-library-se
|
|
|
62
62
|
const { createLinkTypeId, createObjType } = require('@izara_project/izara-core-library-service-schemas/src/Utils');
|
|
63
63
|
const { findLinksByObjTypes } = require("@izara_project/izara-core-library-service-schemas/src/libs/RelSchemaLib")
|
|
64
64
|
const lodash = require("lodash")
|
|
65
|
+
const { createRelTypeConcat } = require('@izara_project/izara-core-library-service-schemas').utils
|
|
66
|
+
const createNodeLib = require('@izara_project/izara-core-library-service-schemas').createNodeLib
|
|
67
|
+
//(<optionalRequire>)
|
|
68
|
+
//(</optionalRequire>)
|
|
65
69
|
|
|
66
|
-
/**
|
|
67
|
-
- all storageType( DB and Graph) use objInstance({identifiers,fields})
|
|
68
|
-
- storageType[DB] async
|
|
69
|
-
- storageType[Graph] sync (should be have lambda complete)
|
|
70
|
-
-- before DB and Graph have boolend check (allStorageTagComplete = true) if storageType == graph set allStorageTagComplete = false,
|
|
71
|
-
and save awaitingMultiplastep prefix(serviceTag_CreateObject{identifierId})
|
|
72
|
-
|
|
73
|
-
>>> in lambdaComplete resive message from GrapHandler
|
|
74
|
-
1.1 check have returnValue.errorsFould.length > 0
|
|
75
|
-
-- Delete all awitingMultiplestep and senf message to callingFlow have errorFound.
|
|
76
|
-
1.2 check awaitingmultipleStepall finish
|
|
77
|
-
-- Delete awaitingStep in come if have other multiplestep(not finish)== not send message.
|
|
78
|
-
--- if check awaitingmultipleStepall finish not have record ===> sendmessage to callingFlow.
|
|
79
|
-
*/
|
|
80
|
-
//=========================================================================================
|
|
81
70
|
/**
|
|
82
71
|
*
|
|
83
72
|
* @param {*} _izContext
|
|
@@ -128,156 +117,23 @@ module.exports.createMain = async (
|
|
|
128
117
|
let createDataDetails = await createDataDetailsLib(_izContext, objectSchemas);
|
|
129
118
|
_izContext.logger.debug("createDataDetails is =", createDataDetails);
|
|
130
119
|
|
|
131
|
-
let checkCorrectLinks = [];
|
|
132
|
-
|
|
133
|
-
//validate linkType
|
|
134
120
|
if ((requestParams.hasOwnProperty("relationships")) && (requestParams.relationships.length > 0)) {
|
|
121
|
+
//(<beforeValidateRelationships>)
|
|
122
|
+
//(</beforeValidateRelationships>)
|
|
135
123
|
|
|
136
|
-
|
|
137
|
-
_izContext.logger.debug("relationshipProperties", relationshipProperties);
|
|
138
|
-
_izContext.logger.debug("relType", relationshipProperties.relType);
|
|
139
|
-
let getObjectRelationship = await getObjectSchema.getRelationshipSchemaWithCache(
|
|
140
|
-
_izContext,
|
|
141
|
-
relationshipProperties.relType
|
|
142
|
-
)
|
|
143
|
-
_izContext.logger.debug("getObjectRelationship", getObjectRelationship)
|
|
144
|
-
|
|
145
|
-
for (const relationshipLink of Object.values(getObjectRelationship.links)) {
|
|
146
|
-
if (relationshipLink.from.linkType === "many" && relationshipLink.to.linkType === "many") {
|
|
147
|
-
if (relationshipLink.from.requiredOnCreate === true || relationshipLink.to.requiredOnCreate === true) {
|
|
148
|
-
errorsFound.push("error many to many linkType can't have requireOnCreate === true")
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
const links = await findLinksByObjTypes(_izContext, [objType, relationshipProperties.targetObjType], getObjectRelationship.links);
|
|
153
|
-
_izContext.logger.debug("links", links)
|
|
154
|
-
|
|
155
|
-
if (!links.length) {
|
|
156
|
-
errorsFound.push(`not found link between ${JSON.stringify({ mainObjType: objType })} and ${JSON.stringify({ toObjType: relationshipProperties.targetObjType })} `)
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
for (let link of links) {
|
|
160
|
-
const { serviceTag: fromServiceTag, objectType: fromObjectType } = objType;
|
|
161
|
-
const { serviceTag: toServiceTag, objectType: toObjectType } = relationshipProperties.targetObjType
|
|
162
|
-
|
|
163
|
-
const { serviceTag: firstServiceTag, objectType: firstObjectType } = link.from.objType;
|
|
164
|
-
const { serviceTag: secondServiceTag, objectType: secondObjectType } = link.to.objType
|
|
165
|
-
|
|
166
|
-
const matchesFromTo =
|
|
167
|
-
fromServiceTag === firstServiceTag && fromObjectType === firstObjectType &&
|
|
168
|
-
toServiceTag === secondServiceTag && toObjectType === secondObjectType;
|
|
169
|
-
|
|
170
|
-
const matchesToFrom =
|
|
171
|
-
fromServiceTag === secondServiceTag && fromObjectType === secondObjectType &&
|
|
172
|
-
toServiceTag === firstServiceTag && toObjectType === firstObjectType
|
|
173
|
-
|
|
174
|
-
if ((relationshipProperties.relationshipDirection === "from" && matchesFromTo) ||
|
|
175
|
-
(relationshipProperties.relationshipDirection === "to" && matchesToFrom)) {
|
|
176
|
-
checkCorrectLinks.push(true)
|
|
177
|
-
} else {
|
|
178
|
-
checkCorrectLinks.push(false)
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
for (const [index, checkCorrectLink] of checkCorrectLinks.entries()) {
|
|
184
|
-
if (checkCorrectLink === false) {
|
|
185
|
-
errorsFound.push(`relationship direction ${JSON.stringify(requestParams.relationships[index])} is invalid`)
|
|
186
|
-
}
|
|
124
|
+
errorsFound.push(...await createNodeLib.validateRequiredOnCreateLinks(_izContext, objType, requestParams.relationships))
|
|
187
125
|
}
|
|
188
|
-
_izContext.logger.debug("
|
|
189
|
-
let requiredOnCreateLinks = {};
|
|
190
|
-
let createLinkTypeIds = [];
|
|
191
|
-
// validate relationships link
|
|
192
|
-
let objectRelationshipSchema = await getObjectSchema.getRequiredOnCreateLinksWithCache(_izContext, objType);
|
|
193
|
-
_izContext.logger.debug("objectRelationshipSchema", objectRelationshipSchema);
|
|
194
|
-
|
|
195
|
-
// validate requiredOnCreateLinks
|
|
196
|
-
let filteredRequiredOnCreatedLinks = [];
|
|
197
|
-
|
|
198
|
-
await Promise.all(
|
|
199
|
-
objectRelationshipSchema.map(async (requiredLink) => {
|
|
200
|
-
const serviceTag = await Promise.all(
|
|
201
|
-
requiredLink.storageResourceTags.map(async (storageTag) => {
|
|
202
|
-
let storageResource = requiredLink.storageResources[storageTag];
|
|
203
|
-
if (storageResource.storageType === consts.STORAGE_TYPES.graph) {
|
|
204
|
-
return await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag);
|
|
205
|
-
}
|
|
206
|
-
})
|
|
207
|
-
);
|
|
208
|
-
if (serviceTag) {
|
|
209
|
-
filteredRequiredOnCreatedLinks.push(requiredLink);
|
|
210
|
-
}
|
|
211
|
-
})
|
|
212
|
-
)
|
|
213
|
-
_izContext.logger.debug("filteredRequiredOnCreatedLinks", filteredRequiredOnCreatedLinks);
|
|
214
|
-
|
|
215
|
-
if (filteredRequiredOnCreatedLinks.length) {
|
|
216
|
-
if (!requestParams.relationships || !requestParams.relationships.length) {
|
|
217
|
-
// in case not send relationship to create with
|
|
218
|
-
for (const requireLink of filteredRequiredOnCreatedLinks) {
|
|
219
|
-
errorsFound.push(`missing required relationship of relType ${JSON.stringify(requireLink.relType)} when create`)
|
|
220
|
-
}
|
|
221
|
-
}
|
|
126
|
+
_izContext.logger.debug("errorsFound", errorsFound)
|
|
222
127
|
|
|
223
|
-
for (const requireLink of filteredRequiredOnCreatedLinks) {
|
|
224
|
-
const requiredOnCreateLinkTypeId = createLinkTypeId(
|
|
225
|
-
_izContext,
|
|
226
|
-
objType,
|
|
227
|
-
requireLink.other.objType,
|
|
228
|
-
requireLink.relType,
|
|
229
|
-
requireLink.base.direction
|
|
230
|
-
);
|
|
231
|
-
|
|
232
|
-
Object.assign(requiredOnCreateLinks, {
|
|
233
|
-
[requiredOnCreateLinkTypeId]: requireLink
|
|
234
|
-
})
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (requestParams.hasOwnProperty("relationships") && requestParams.relationships.length) {
|
|
238
|
-
for (const createRelationship of requestParams.relationships) {
|
|
239
|
-
const onCreateLinkTypeId = createLinkTypeId(
|
|
240
|
-
_izContext,
|
|
241
|
-
objType,
|
|
242
|
-
createRelationship.targetObjType,
|
|
243
|
-
createRelationship.relType,
|
|
244
|
-
createRelationship.relationshipDirection
|
|
245
|
-
);
|
|
246
|
-
|
|
247
|
-
if (!requiredOnCreateLinks.hasOwnProperty(onCreateLinkTypeId)) {
|
|
248
|
-
errorsFound.push(`relType:${JSON.stringify(createRelationship.relType)} not allow to create when use create action`)
|
|
249
|
-
continue;
|
|
250
|
-
} else {
|
|
251
|
-
createLinkTypeIds.push(onCreateLinkTypeId);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
// validate missing relType when create that should create
|
|
259
|
-
const remainRequiredOnCreateLinkTypeIds = Object.keys(requiredOnCreateLinks)
|
|
260
|
-
.filter(requiredInCreateLinkTypeId => !createLinkTypeIds.includes(requiredInCreateLinkTypeId))
|
|
261
|
-
|
|
262
|
-
if (remainRequiredOnCreateLinkTypeIds.length) {
|
|
263
|
-
for (const remainRequiredOnCreateLinkTypeId of remainRequiredOnCreateLinkTypeIds) {
|
|
264
|
-
const missingLink = {
|
|
265
|
-
relType: requiredOnCreateLinks[remainRequiredOnCreateLinkTypeId].relType,
|
|
266
|
-
base: requiredOnCreateLinks[remainRequiredOnCreateLinkTypeId].base.objType,
|
|
267
|
-
other: requiredOnCreateLinks[remainRequiredOnCreateLinkTypeId].other.objType
|
|
268
|
-
};
|
|
269
|
-
errorsFound.push(`Missing Link:: ${JSON.stringify(missingLink)} when create`)
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
_izContext.logger.debug("createLinkTypeIds", createLinkTypeIds);
|
|
273
|
-
_izContext.logger.debug("requiredOnCreateLinks", requiredOnCreateLinks);
|
|
274
128
|
// end validate
|
|
275
|
-
|
|
276
129
|
let objInstanceFull = {
|
|
277
130
|
identifiers: {},
|
|
278
131
|
fields: {}
|
|
279
132
|
};
|
|
280
133
|
|
|
134
|
+
//(<optionalObjInstanceFull>)
|
|
135
|
+
//(</optionalObjInstanceFull>)
|
|
136
|
+
|
|
281
137
|
let listOfRequiredOnCreate = [];
|
|
282
138
|
let listOfOptionalOnCreate = [];
|
|
283
139
|
|
|
@@ -404,8 +260,11 @@ module.exports.createMain = async (
|
|
|
404
260
|
if (errorsFound.length == 0) {
|
|
405
261
|
|
|
406
262
|
for (let [storageTag, createDataDetail] of Object.entries(createDataDetails)) {
|
|
407
|
-
|
|
263
|
+
//(<beforeCreate>)
|
|
264
|
+
//(</beforeCreate>)
|
|
408
265
|
if (createDataDetail.storageType == consts.STORAGE_TYPES.dynamoDB) {
|
|
266
|
+
//(<beforeCreateRecordDynamo>)
|
|
267
|
+
//(</beforeCreateRecordDynamo>)
|
|
409
268
|
_izContext.logger.debug("::::::DynamoDB::::::", { storageTag, objInstanceFull });
|
|
410
269
|
|
|
411
270
|
|
|
@@ -432,6 +291,8 @@ module.exports.createMain = async (
|
|
|
432
291
|
}
|
|
433
292
|
);
|
|
434
293
|
} else if (createDataDetail.storageType == consts.STORAGE_TYPES.graph) {
|
|
294
|
+
//(<beforeCreateNode>)
|
|
295
|
+
//(</beforeCreateNode>)
|
|
435
296
|
_izContext.logger.debug("::::::Graph::::::", { storageTag, objInstanceFull });
|
|
436
297
|
|
|
437
298
|
Object.assign(objInstanceFullForGraph.fields, createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail))
|
|
@@ -500,7 +361,8 @@ module.exports.createMain = async (
|
|
|
500
361
|
});
|
|
501
362
|
|
|
502
363
|
if (objecForCreate.allStorageTagComplete == false) { // needless check because in listOfObjectForCreates push case graph only!
|
|
503
|
-
|
|
364
|
+
//(<beforeSendMessageToGraph>)
|
|
365
|
+
//(</beforeSendMessageToGraph>)
|
|
504
366
|
messageObject = {
|
|
505
367
|
objType: objType,
|
|
506
368
|
objInstanceFull: objecForCreate.objInstanceFull,
|
|
@@ -534,6 +396,16 @@ module.exports.createMain = async (
|
|
|
534
396
|
};
|
|
535
397
|
_izContext.logger.debug("RequestParams before send to sqs messageToCreateObject ::::::: ", messageToCreateObject);
|
|
536
398
|
await sns.publishAsync(_izContext, messageToCreateObject);
|
|
399
|
+
|
|
400
|
+
//(<afterSendMessageToGraph>)
|
|
401
|
+
//(</afterSendMessageToGraph>)
|
|
402
|
+
return {
|
|
403
|
+
objType: objType,
|
|
404
|
+
objInstanceFull: objInstanceFullForGraph,
|
|
405
|
+
relationships: requestParams.relationships || [],
|
|
406
|
+
status: "complete",
|
|
407
|
+
errorsFound: errorsFound
|
|
408
|
+
}
|
|
537
409
|
};
|
|
538
410
|
}; // end loop of objectCreate.
|
|
539
411
|
if (errorsFound.length > 0) {
|
|
@@ -574,8 +446,8 @@ module.exports.createMain = async (
|
|
|
574
446
|
|
|
575
447
|
return {
|
|
576
448
|
objType: objType,
|
|
577
|
-
|
|
578
|
-
|
|
449
|
+
objInstanceFull: objInstanceFull,
|
|
450
|
+
relationships: requestParams.relationships || [],
|
|
579
451
|
status: "error",
|
|
580
452
|
errorsFound: errorsFound
|
|
581
453
|
}
|
|
@@ -612,8 +484,8 @@ module.exports.createMain = async (
|
|
|
612
484
|
}
|
|
613
485
|
return {
|
|
614
486
|
objType: objType,
|
|
615
|
-
|
|
616
|
-
|
|
487
|
+
objInstanceFull: objInstanceFullForDynamoDb,
|
|
488
|
+
relationships: requestParams.relationships || [],
|
|
617
489
|
status: "complete",
|
|
618
490
|
errorsFound: errorsFound
|
|
619
491
|
}
|
|
@@ -621,4 +493,4 @@ module.exports.createMain = async (
|
|
|
621
493
|
} catch (err) {
|
|
622
494
|
throw (err)
|
|
623
495
|
}
|
|
624
|
-
}
|
|
496
|
+
}
|
|
@@ -28,7 +28,7 @@ const serviceConfigLib = require('@izara_project/izara-core-library-service-sche
|
|
|
28
28
|
|
|
29
29
|
const uploadUseCase = require('@izara_project/izara-core-library-service-schemas/src/libs/UploadUseCase')
|
|
30
30
|
|
|
31
|
-
const hash = require(
|
|
31
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
32
32
|
const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
|
|
33
33
|
const path = require('path')
|
|
34
34
|
const schemasPath = path.join(__dirname, '../schemas');
|
|
@@ -50,6 +50,8 @@ const { TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER } = require('@izara_p
|
|
|
50
50
|
const { createDeleteDataDetail } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs')
|
|
51
51
|
const { createObjType } = require("@izara_project/izara-core-library-service-schemas/src/Utils");
|
|
52
52
|
|
|
53
|
+
//(<optionalRequire>)
|
|
54
|
+
//(</optionalRequire>)
|
|
53
55
|
/**
|
|
54
56
|
*
|
|
55
57
|
* @param {*} _izContext
|
|
@@ -53,6 +53,8 @@ const sns = externalRequest.sns
|
|
|
53
53
|
const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
|
|
54
54
|
const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
55
55
|
const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
56
|
+
//(<optionalRequire>)
|
|
57
|
+
//(</optionalRequire>)
|
|
56
58
|
/**
|
|
57
59
|
*
|
|
58
60
|
*
|
|
@@ -149,10 +151,7 @@ module.exports.getMain = async (
|
|
|
149
151
|
if (callingFlowConfig[callingFlowSharedLib.consts.CALLINGFLOW_PROPERTYNAME]) {
|
|
150
152
|
|
|
151
153
|
let messageObject = {
|
|
152
|
-
objType:
|
|
153
|
-
objectType: OBJECT_TYPE,
|
|
154
|
-
serviceTag: SERVICE_TAG
|
|
155
|
-
},
|
|
154
|
+
objType: objType,
|
|
156
155
|
objInstanceFull: dataFromGraph.objInstanceFull
|
|
157
156
|
}
|
|
158
157
|
// send message to SNS ProcessFindRequiredData
|
|
@@ -18,7 +18,7 @@ along with this program. If not, see
|
|
|
18
18
|
|
|
19
19
|
'use strict';
|
|
20
20
|
|
|
21
|
-
const hash = require(
|
|
21
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
22
22
|
const {
|
|
23
23
|
getObjSchemaS3WithHierarchy,
|
|
24
24
|
} = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
@@ -40,6 +40,8 @@ const { createUpdateDataDetail } = require("@izara_project/izara-market-library-
|
|
|
40
40
|
const { PREFIX, TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
41
41
|
const coreConsts = require('@izara_project/izara-core-library-core/src/Consts')
|
|
42
42
|
const { createObjType } = require("@izara_project/izara-core-library-service-schemas/src/Utils")
|
|
43
|
+
//(<optionalRequire>)
|
|
44
|
+
//(</optionalRequire>)
|
|
43
45
|
/**
|
|
44
46
|
*
|
|
45
47
|
*
|
|
@@ -75,23 +75,26 @@ const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas
|
|
|
75
75
|
if (event.includes("s3")) {
|
|
76
76
|
const externalLambdaIamRoleGetPresignUrl = await externalLambdaIamRoleUploadS3(_izContext);
|
|
77
77
|
externalLambdaIamRoleGetPresignUrl && externalLambdaIamRoleArray.push(externalLambdaIamRoleGetPresignUrl);
|
|
78
|
+
} else if (event.includes("extTopic")) {
|
|
79
|
+
const externalSnsPublish = await externalRoleSnsPublish(_izContext, localFlowSchema);
|
|
80
|
+
externalSnsPublish && externalLambdaIamRoleArray.push(externalSnsPublish);
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
|
-
}
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
// console.log("externalLambdaIamRoleArray", externalLambdaIamRoleArray)
|
|
86
|
+
// console.log("createSourceArrayIamRole", JSON.stringify(externalLambdaIamRoleArray))
|
|
87
|
+
// return externalLambdaIamRoleArray
|
|
86
88
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
return {
|
|
90
|
+
templatePath: templatePath,
|
|
91
|
+
templateData: { datas: externalLambdaIamRoleArray },
|
|
92
|
+
setting: {
|
|
93
|
+
savePath: path.join(srcPath, SOURCE_PATH.externalService),
|
|
94
|
+
saveFileName: SAVE_FILE_NAME.externalLambdaRole,
|
|
95
|
+
fileExtension: ".js",
|
|
96
|
+
isAppend: false
|
|
97
|
+
}
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
}
|
|
@@ -219,7 +222,7 @@ function externalLambdaIamRoleUploadS3(_izContext) {
|
|
|
219
222
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
220
223
|
},
|
|
221
224
|
[
|
|
222
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
225
|
+
externalResourceName(RESOURCE_CLASSES.sns, "ReservedDynamicUsage_In", EXTERNAL_SERVICE_NAME.accountLimits)
|
|
223
226
|
]
|
|
224
227
|
),
|
|
225
228
|
createIamRole(
|
|
@@ -238,7 +241,7 @@ function externalLambdaIamRoleUploadS3(_izContext) {
|
|
|
238
241
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
239
242
|
},
|
|
240
243
|
[
|
|
241
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
244
|
+
externalResourceName(RESOURCE_CLASSES.sns, "CancelUsage_In", EXTERNAL_SERVICE_NAME.accountLimits)
|
|
242
245
|
]
|
|
243
246
|
)
|
|
244
247
|
)
|
|
@@ -249,8 +252,8 @@ function externalLambdaIamRoleUploadS3(_izContext) {
|
|
|
249
252
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
250
253
|
},
|
|
251
254
|
[
|
|
252
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
253
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
255
|
+
externalResourceName(RESOURCE_CLASSES.sns, "ReservedDynamicUsageComplet_Out", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
256
|
+
externalResourceName(RESOURCE_CLASSES.sns, "ConfirmUsage_In", EXTERNAL_SERVICE_NAME.accountLimits)
|
|
254
257
|
]
|
|
255
258
|
),
|
|
256
259
|
)
|
|
@@ -261,9 +264,9 @@ function externalLambdaIamRoleUploadS3(_izContext) {
|
|
|
261
264
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
262
265
|
},
|
|
263
266
|
[
|
|
264
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
265
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
266
|
-
externalResourceName(RESOURCE_CLASSES.sns, "
|
|
267
|
+
externalResourceName(RESOURCE_CLASSES.sns, "CancelUsage_In", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
268
|
+
externalResourceName(RESOURCE_CLASSES.sns, "ConfirmUsage_In", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
269
|
+
externalResourceName(RESOURCE_CLASSES.sns, "ReservedDynamicUsage_In", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
267
270
|
]
|
|
268
271
|
)
|
|
269
272
|
)
|
|
@@ -274,4 +277,27 @@ function externalLambdaIamRoleUploadS3(_izContext) {
|
|
|
274
277
|
}
|
|
275
278
|
}
|
|
276
279
|
|
|
280
|
+
async function externalRoleSnsPublish(_izContext, localFlowSchema) {
|
|
281
|
+
|
|
282
|
+
const additionalResourcePermission = [];
|
|
283
|
+
const flowStepInSplitKey = Object.keys(localFlowSchema.flowSteps)[0].split('_')
|
|
284
|
+
const serviceTag = flowStepInSplitKey[0]
|
|
285
|
+
|
|
286
|
+
additionalResourcePermission.push(
|
|
287
|
+
createIamRole(
|
|
288
|
+
{
|
|
289
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
290
|
+
},
|
|
291
|
+
[
|
|
292
|
+
externalResourceName(RESOURCE_CLASSES.sns, `${flowStepInSplitKey[2]}_${flowStepInSplitKey[3]}`, serviceTag)
|
|
293
|
+
]
|
|
294
|
+
)
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
return {
|
|
298
|
+
additionalResourcePermission,
|
|
299
|
+
objectType: SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
277
303
|
module.exports = createExternalLambdaRole;
|
|
@@ -47,10 +47,13 @@ module.exports.generatedLambdaRole = async () => {
|
|
|
47
47
|
]
|
|
48
48
|
<%_ }) _%>
|
|
49
49
|
<%_ }) _%>
|
|
50
|
-
}
|
|
50
|
+
},
|
|
51
51
|
<%_ }) _%>
|
|
52
|
+
//(<create<%- data.objectType%>Role>)
|
|
53
|
+
//(</create<%- data.objectType%>Role>)
|
|
52
54
|
]
|
|
53
|
-
},
|
|
55
|
+
},
|
|
56
|
+
<%_ }) %>
|
|
54
57
|
]
|
|
55
58
|
return externalLambdaRole
|
|
56
59
|
}
|
|
@@ -79,6 +79,10 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
|
|
|
79
79
|
const snsServiceConfigForExtTopic = await snsSubscriptionFlowSchemaExternalTopic(_izContext, localFlowSchema);
|
|
80
80
|
snsServiceConfigForExtTopic && snsServiceConfigArray.push(snsServiceConfigForExtTopic);
|
|
81
81
|
}
|
|
82
|
+
if (!localFlowSchema.statusType === "none") {
|
|
83
|
+
const snsServiceConfigForCreateRecordByStatusType = await createFlowSchemaRegisterSnsTopicSubscriptions(_izContext, localFlowSchema);
|
|
84
|
+
snsServiceConfigForCreateRecordByStatusType && snsServiceConfigArray.push(snsServiceConfigForCreateRecordByStatusType);
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
}
|
|
@@ -181,21 +185,27 @@ function snsSubscriptionConfirmReserved(_izContext) {
|
|
|
181
185
|
}
|
|
182
186
|
|
|
183
187
|
function snsSubscriptionFlowSchemaExternalTopic(_izContext, localFlowSchema) {
|
|
184
|
-
const
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
188
|
+
const flowStepOut = Object.keys(localFlowSchema.flowSteps)[1]
|
|
189
|
+
const splitFlowStepOutKey = flowStepOut.split("_");
|
|
190
|
+
const queueNameExtTopic = upperCase(FUNCTION_NAME.flowSchemaExternalTopic)
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
serviceTag: [splitFlowStepOutKey[0]],
|
|
194
|
+
topicName: splitFlowStepOutKey[2] + '_' + splitFlowStepOutKey[3],
|
|
195
|
+
sqsEndpoint: queueNameExtTopic
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function createFlowSchemaRegisterSnsTopicSubscriptions(_izContext, localFlowSchema) {
|
|
200
|
+
const flowStepKeys = Object.keys(localFlowSchema.flowSteps)[1];
|
|
201
|
+
const flowStepKeySplit = flowStepKeys.split("_");
|
|
202
|
+
const registerCompleteSqs = upperCase(FUNCTION_NAME.flowSchemaRegister);
|
|
197
203
|
|
|
198
|
-
return
|
|
204
|
+
return {
|
|
205
|
+
serviceTag: [flowStepKeySplit[0]],
|
|
206
|
+
topicName: flowStepKeySplit[2],
|
|
207
|
+
sqsEndpoint: registerCompleteSqs,
|
|
208
|
+
}
|
|
199
209
|
}
|
|
200
210
|
|
|
201
211
|
module.exports = createExternalSnsSubscriptions;
|
|
@@ -11,13 +11,14 @@ let getDataByGraph = await graphSharedLib.getNodeV2(
|
|
|
11
11
|
graphHandlerServiceTag,
|
|
12
12
|
objType,
|
|
13
13
|
{
|
|
14
|
-
|
|
15
|
-
...fieldName
|
|
14
|
+
identifiers:identifiers
|
|
16
15
|
},
|
|
17
|
-
|
|
16
|
+
<%- JSON.stringify(versionedDataLabel) %>
|
|
18
17
|
);
|
|
18
|
+
|
|
19
19
|
_izContext.logger.debug("getDataByGraph: ", getDataByGraph)
|
|
20
20
|
|
|
21
|
+
|
|
21
22
|
if (!getDataByGraph) {
|
|
22
23
|
errorsFound.push(`can't get data of ${objType.objectType} in graph`)
|
|
23
24
|
standardErrorParams.push(errorsFound)
|
|
@@ -40,16 +40,10 @@ function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
|
|
|
40
40
|
let functionName = upperCase(FUNCTION_NAME.createRecordComplete)
|
|
41
41
|
let flowSteps = Object.keys(flowSchema.flowSteps)
|
|
42
42
|
let splitFlowSteps = flowSteps[0].split("_")
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
topicArn = flowSteps[0]
|
|
48
|
-
} else if (event.includes(FLOW_SCHEMA_EVENT_TYPE.extTopic)) {
|
|
49
|
-
topicArn = splitFlowSteps[3] + "_" + splitFlowSteps[4]
|
|
50
|
-
serviceTag = splitFlowSteps[0]
|
|
51
|
-
}
|
|
52
|
-
}
|
|
43
|
+
|
|
44
|
+
let topicArn = splitFlowSteps[2] + "_" + splitFlowSteps[3]
|
|
45
|
+
let serviceTag = splitFlowSteps[0]
|
|
46
|
+
// serviceTag_stage_TopicName_In/Out
|
|
53
47
|
return {
|
|
54
48
|
templatePath: templatePath,
|
|
55
49
|
templateData: {
|