@izara_project/izara-market-library-service-schemas 1.0.62 → 1.0.64

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.
Files changed (49) hide show
  1. package/package.json +1 -1
  2. package/src/GenerateCodeLibs/src/Consts.js +7 -3
  3. package/src/MainLibs/src/Consts.js +6 -2
  4. package/src/reStructure/GenerateCode.js +1 -1
  5. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +20 -8
  6. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +114 -83
  7. package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +8 -0
  8. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +11 -1
  9. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +13 -7
  10. package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +3 -2
  11. package/src/reStructure/TemplateData/flowSchema/register/complete/handler/template.ejs +1 -0
  12. package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +3 -1
  13. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/data.js +123 -0
  14. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/template.ejs +20 -0
  15. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/data.js +122 -0
  16. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/template.ejs +17 -0
  17. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/data.js +123 -0
  18. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/template.ejs +13 -0
  19. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/data.js +123 -0
  20. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/template.ejs +17 -0
  21. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/data.js +57 -0
  22. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/request.json +0 -0
  23. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/template.ejs +155 -0
  24. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/data.js +58 -0
  25. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/request.json +0 -0
  26. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/template.ejs +202 -0
  27. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/data.js +59 -0
  28. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/request.json +0 -0
  29. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/template.ejs +144 -0
  30. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/data.js +59 -0
  31. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/request.json +0 -0
  32. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/template.ejs +181 -0
  33. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +59 -0
  34. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +382 -0
  35. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +77 -0
  36. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
  37. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
  38. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +121 -0
  39. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/template.ejs +20 -0
  40. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +60 -0
  41. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +129 -0
  42. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +55 -0
  43. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +154 -0
  44. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +71 -0
  45. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/template.ejs +46 -0
  46. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +71 -0
  47. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/template.ejs +10 -0
  48. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +2 -2
  49. package/src/reStructure/TemplateData/relationshipPerAction/generateTemplateData.js +55 -2
@@ -0,0 +1,154 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const hash = require('@izara_project/izara-shared-core').objectHash;
20
+
21
+ const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
22
+ const lambdaSharedLib = require("@izara_project/izara-core-library-lambda");
23
+ const snsSharedLib = require("@izara_project/izara-core-library-sns");
24
+ const dynamodbSharedLib = require("@izara_project/izara-core-library-dynamodb");
25
+ const asyncFlowSharedLib = require("@izara_project/izara-core-library-asynchronous-flow");
26
+
27
+ const sns = require("@izara_project/izara-core-library-external-request").sns;
28
+ const NoRetryError = require("@izara_project/izara-core-library-core/src/NoRetryError");
29
+
30
+ const { explodedObjectTypeId, explodedRelationshipTypeId, createLinkTypeId } = require('@izara_project/izara-core-library-service-schemas/src/Utils')
31
+
32
+ const {
33
+ TOPIC_NAME_GENERATE_CODE,
34
+ TOPIC_NAME_GRAPH_HANDLER,
35
+ PREFIX
36
+ } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
37
+
38
+ //(<optionalRequire>)
39
+ //(</optionalRequire>)
40
+
41
+ module.exports.changeRelationshipComplete = async (
42
+ _izContext,
43
+ returnValue,
44
+ status,
45
+ errorsFound,
46
+ graphServiceTag,
47
+ passBackProperties = {},
48
+
49
+ ) => {
50
+ try {
51
+ _izContext.logger.debug("Function:ChangeRelationshipComplete", {
52
+ returnValue: returnValue,
53
+ status: status,
54
+ errorsFound: errorsFound,
55
+ graphServiceTag: graphServiceTag,
56
+ passBackProperties: passBackProperties,
57
+ });
58
+
59
+ // start create awaitingStepId
60
+ const linkTypeId = createLinkTypeId(
61
+ _izContext,
62
+ returnValue.requestParams.fromObject.objType,
63
+ returnValue.requestParams.toObject.objType,
64
+ returnValue.requestParams.newRelType,
65
+ returnValue.requestParams.oldReltypeAndDirection.relationshipDirection
66
+ );
67
+
68
+ let awaitingStepId = asyncFlowSharedLib.createAwaitingStepId(
69
+ hash({
70
+ linkTypeId,
71
+ graphServiceTag: graphServiceTag,
72
+ callingFlowProperties: passBackProperties.passBackProperties.parentPassBackProperties.callingFlowProperties || {},
73
+ firstObject: returnValue.requestParams.fromObject,
74
+ secondObject: returnValue.requestParams.toObject,
75
+ oldReltypeAndDirection: returnValue.requestParams.oldReltypeAndDirection,
76
+ newRelType: returnValue.requestParams.newRelType,
77
+ }), // hash id
78
+ PREFIX.changeRel // prefix, use constant further
79
+ )
80
+
81
+
82
+ let createRelPendingObjects = await dynamodbSharedLib.query(
83
+ _izContext,
84
+ await dynamodbSharedLib.tableName(_izContext, "AwaitingMultipleSteps"),
85
+ {
86
+ awaitingStepId: awaitingStepId
87
+ }
88
+ );
89
+ _izContext.logger.debug("record of createRelPendingObjects ::", createRelPendingObjects);
90
+
91
+
92
+
93
+ await Promise.all(
94
+ createRelPendingObjects.Items.map(async ({ pendingStepId }) => {
95
+ if (await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
96
+ _izContext,
97
+ pendingStepId, // task waiting
98
+ awaitingStepId,
99
+ errorsFound
100
+ )) {
101
+ _izContext.logger.debug("finished all awaitingStep");
102
+
103
+ let createCompleteMsg = {
104
+ firstObject: returnValue.requestParams.fromObject,
105
+ secondObject: returnValue.requestParams.toObject,
106
+ relType: returnValue.requestParams.relType,
107
+ oldReltypeAndDirection: returnValue.requestParams.oldReltypeAndDirection,
108
+ newRelType: returnValue.requestParams.newRelType,
109
+ status: status,
110
+ errorsFound: errorsFound
111
+ };
112
+
113
+ createCompleteMsg = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, createCompleteMsg);
114
+ _izContext.logger.debug("After addCallingFlowToSnsResponseMessageObject", createCompleteMsg);
115
+
116
+ let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
117
+ _izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", createCompleteMsg);
118
+
119
+ let sendMessageToOutCreateRelationshipComplete = {
120
+ Message: JSON.stringify(createCompleteMsg),
121
+ MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
122
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
123
+ };
124
+ _izContext.logger.debug("Send message to OutCreateRelationshipComplete :::>", sendMessageToOutCreateRelationshipComplete);
125
+ await sns.publishAsync(_izContext, sendMessageToOutCreateRelationshipComplete);
126
+
127
+ //(<afterCheckAwaitingStep>)
128
+ //(</afterCheckAwaitingStep>)
129
+ } // check pendingStepId finished
130
+
131
+ // remove awaitingMultipleStep after finished
132
+ await asyncFlowSharedLib.removeAwaitingMultipleStep(
133
+ _izContext,
134
+ awaitingStepId,
135
+ pendingStepId,
136
+ errorsFound
137
+ );
138
+ }) // end per pendingStep
139
+ );
140
+
141
+ //(<afterCheckAllAwaitingStep>)
142
+ //(</afterCheckAllAwaitingStep>)
143
+
144
+ return {
145
+ returnValue,
146
+ status,
147
+ errorsFound
148
+ }
149
+
150
+ } catch (err) {
151
+ _izContext.logger.error('error createRelationshipComplete:', err)
152
+ throw (err)
153
+ }
154
+ }
@@ -0,0 +1,71 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+
20
+ const path = require("path")
21
+
22
+ // const {
23
+ // HANDLER,
24
+ // STORAGE_TYPES
25
+ // } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
26
+
27
+
28
+ const STORAGE_TYPES = {
29
+ dynamoDB: "dynamoDB",
30
+ graph: "graph"
31
+ }
32
+
33
+ const templatePath = path.join(__dirname, './template.ejs');
34
+ const { SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require('../../../../../../MainLibs/index.js').consts;
35
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/index.js").utils;
36
+
37
+
38
+ /**
39
+ * create data for dynamoDbYaml tempalte from objectSchema
40
+ * return array of dynamoDb data
41
+ * because one objectSchema can create multiple dynamoDb table
42
+ *
43
+ * @param {Object} _izContext
44
+ * @param {String} saveFilePath
45
+ * @returns {Object[]} - data of multiple dynamoDb template
46
+ */
47
+
48
+ function createDataForDefaultSnsInSqs(_izContext, srcPath) {
49
+ let createCreateRelationCompleteQueue = [];
50
+ const createRelationshipCompleteQueues = [
51
+ {
52
+ queueName: upperCase(FUNCTION_NAME.changeRelComplete)
53
+ }
54
+ ]
55
+ for (let createRelationshipCompleteQueue of createRelationshipCompleteQueues) {
56
+ createCreateRelationCompleteQueue.push({
57
+ templatePath: templatePath,
58
+ templateData: createRelationshipCompleteQueue,
59
+ setting: {
60
+ initialData: "Resources:\n",
61
+ savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
62
+ saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
63
+ fileExtension: ".yml",
64
+ isAppend: true
65
+ }
66
+ })
67
+ }
68
+ return createCreateRelationCompleteQueue
69
+ }
70
+
71
+ module.exports = createDataForDefaultSnsInSqs;
@@ -0,0 +1,46 @@
1
+ ##===== [Queue]
2
+ <%- queueName %>:
3
+ Type: "AWS::SQS::Queue"
4
+ Properties:
5
+ QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
6
+ RedrivePolicy:
7
+ deadLetterTargetArn:
8
+ # !GetAtt
9
+ Fn::GetAtt:
10
+ - <%- queueName %>DLQ
11
+ - Arn
12
+ maxReceiveCount: 3
13
+ VisibilityTimeout: 120
14
+ ##==== [QueueDLQ]
15
+ <%- queueName %>DLQ:
16
+ Type: AWS::SQS::Queue
17
+ Properties:
18
+ QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
19
+ ##==== [QueuePolicy]
20
+ <%- queueName %>Policy:
21
+ Type: AWS::SQS::QueuePolicy
22
+ Properties:
23
+ PolicyDocument:
24
+ Version: "2012-10-17"
25
+ Statement:
26
+ - Sid: "allow-sns-messages"
27
+ Effect: Allow
28
+ Principal: "*"
29
+ Resource:
30
+ # !GetAtt
31
+ Fn::GetAtt:
32
+ - <%- queueName %>
33
+ - Arn
34
+ Action: "SQS:SendMessage"
35
+ Queues:
36
+ - Ref: <%- queueName %>
37
+ #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
38
+ #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
39
+
40
+
41
+ <%_ function firstLetterUpperCase(text){
42
+ return text.charAt(0).toUpperCase() + text.slice(1)
43
+ } _%>
44
+ <%_ function firstLetterLowerCase(str) {
45
+ return str.charAt(0).toLowerCase() + str.slice(1)
46
+ } _%>
@@ -0,0 +1,71 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+
20
+ const path = require("path")
21
+
22
+ // const {
23
+ // HANDLER,
24
+ // STORAGE_TYPES
25
+ // } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
26
+
27
+
28
+ const STORAGE_TYPES = {
29
+ dynamoDB: "dynamoDB",
30
+ graph: "graph"
31
+ }
32
+
33
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/index.js").utils;
34
+ const { SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../../../MainLibs/index.js").consts;
35
+ const templatePath = path.join(__dirname, './template.ejs')
36
+
37
+ /**
38
+ * create data for dynamoDbYaml tempalte from objectSchema
39
+ * return array of dynamoDb data
40
+ * because one objectSchema can create multiple dynamoDb table
41
+ *
42
+ * @param {Object} _izContext
43
+ * @param {String} saveFilePath
44
+ * @returns {Object[]} - data of multiple dynamoDb template
45
+ */
46
+
47
+ function createDefaultSnsOut(_izContext, srcPath) {
48
+ const createSourceParams = createParamsForCreateSource(_izContext, srcPath)
49
+ // console.log("createSourceParamsCreateRelationshipComplete", createSourceParams)
50
+
51
+ return [createSourceParams]
52
+ }
53
+
54
+ function createParamsForCreateSource(_izContext, srcPath) {
55
+ let queueName = FUNCTION_NAME.changeRelComplete;
56
+ return {
57
+ templatePath: templatePath,
58
+ templateData: {
59
+ queueName: upperCase(queueName)
60
+ },
61
+ setting: {
62
+ initialData: 'Resources:\n',
63
+ savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
64
+ saveFileName: SAVE_FILE_NAME.snsOutYaml,
65
+ fileExtension: '.yml',
66
+ isAppend: true
67
+ }
68
+ }
69
+ }
70
+
71
+ module.exports = createDefaultSnsOut
@@ -0,0 +1,10 @@
1
+ ##--------- [Create Topic Out]
2
+ Out<%- firstLetterUpperCase(queueName) %>:
3
+ Type: AWS::SNS::Topic
4
+ Properties:
5
+ DisplayName: "SNS Message out"
6
+ TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- firstLetterUpperCase(queueName) %>_Out
7
+
8
+ <%_ function firstLetterUpperCase(text) {
9
+ return text.charAt(0).toUpperCase() + text.slice(1)
10
+ } _%>
@@ -93,8 +93,8 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
93
93
  // add argument (to invoke lambda) to passOnProperties[]
94
94
  passOnProperties.push(record.body.Message.returnValue)
95
95
  passOnProperties.push(record.body.Message.status)
96
- passOnProperties.push(record.body.Message.errorsFound),
97
- passOnProperties.push(record.body.Message.graphServiceTag),
96
+ passOnProperties.push(record.body.Message.errorsFound)
97
+ passOnProperties.push(record.body.Message.graphServiceTag)
98
98
  passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
99
99
  // passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
100
100
  record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
@@ -138,6 +138,31 @@ const getCompleteImports = {
138
138
  snsOut: require('./get/complete/sns-out/data')
139
139
  }
140
140
 
141
+ const changeRelationshipCompleteImports = {
142
+ mainFunction: require('./changeRelationship/complete/mainFunction/data'),
143
+ functionYaml: require('./changeRelationship/complete/functionYaml/data'),
144
+ handler: require('./changeRelationship/complete/handler/sqs/data'),
145
+ snsInSqs: require("./changeRelationship/complete/sns-in-sqs/data"),
146
+ snsOut: require("./changeRelationship/complete/sns-out/data")
147
+ }
148
+
149
+ const changeRelationshipActionImports = {
150
+ mainFunction: require('./changeRelationship/action/mainFunction/data'),
151
+ handler: {
152
+ api: require('./changeRelationship/action/handler/api/data'),
153
+ dsp: require("./changeRelationship/action/handler/dsq/data"),
154
+ inv: require('./changeRelationship/action/handler/inv/data'),
155
+ sqs: require('./changeRelationship/action/handler/sqs/data')
156
+ },
157
+ functionYaml: {
158
+ api: require('./changeRelationship/action/functionYaml/api/data'),
159
+ dsp: require("./changeRelationship/action/functionYaml/dsq/data"),
160
+ inv: require('./changeRelationship/action/functionYaml/inv/data'),
161
+ sqs: require('./changeRelationship/action/functionYaml/sqs/data')
162
+ },
163
+ snsInSqs: require('./changeRelationship/action/sns-in-sqs/data')
164
+ }
165
+
141
166
  /**
142
167
  * Generates code from templates based on object schemas
143
168
  * @param {Object} _izContext - Context object
@@ -151,7 +176,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
151
176
  // console.log('objSchemaPath', objSchemaPath);
152
177
  const allObjectRelationships = getAllLocalRelationshipSchema(_izContext, objSchemaPath);
153
178
  // console.log('allObjectRelationships', JSON.stringify(allObjectRelationships));
154
-
179
+ console.log("allObjectRelationships", allObjectRelationships)
155
180
  // Check if the table yaml is valid
156
181
  if (!allObjectRelationships.length) {
157
182
  return createSourceParams;
@@ -212,6 +237,21 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
212
237
  const getSnsInSqs = getActionImports.snsInSqs(_izContext, saveFilePath);
213
238
  const getCompleteSnsInSqs = getCompleteImports.snsInSqs(_izContext, saveFilePath);
214
239
  const getCompleteSnsOut = getCompleteImports.snsOut(_izContext, saveFilePath);
240
+
241
+ // Generate change relationship data
242
+ const changeRelMainFunction = changeRelationshipActionImports.mainFunction(_izContext, saveFilePath);
243
+ const changeRelCompleteMainFunction = changeRelationshipCompleteImports.mainFunction(_izContext, saveFilePath);
244
+
245
+ const changeRelFunctionYaml = Object.values(changeRelationshipActionImports.functionYaml).map(fn => fn(_izContext, allObjectRelationships, saveFilePath)).flat();
246
+ const changeRelCompleteYaml = changeRelationshipCompleteImports.functionYaml(_izContext, saveFilePath);
247
+
248
+ const changeRelHandlers = Object.values(changeRelationshipActionImports.handler).map(fn => fn(_izContext, saveFilePath)).flat();
249
+ const changeRelCompleteHandler = changeRelationshipCompleteImports.handler(_izContext, saveFilePath);
250
+
251
+ const changeRelSnsInSqs = changeRelationshipActionImports.snsInSqs(_izContext, saveFilePath);
252
+ const changeRelCompleteSnsInSqs = changeRelationshipCompleteImports.snsInSqs(_izContext, saveFilePath);
253
+ const changeRelCompleteSnsOut = changeRelationshipCompleteImports.snsOut(_izContext, saveFilePath);
254
+
215
255
  // Combine all generated data
216
256
  const updateRelationshipData = [
217
257
  ...updateHandlers,
@@ -272,6 +312,18 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
272
312
  ...getCompleteSnsInSqs,
273
313
  ...getCompleteSnsOut
274
314
  ];
315
+
316
+ const changeRelData = [
317
+ ...changeRelMainFunction,
318
+ ...changeRelCompleteMainFunction,
319
+ ...changeRelFunctionYaml,
320
+ ...changeRelCompleteYaml,
321
+ ...changeRelHandlers,
322
+ ...changeRelCompleteHandler,
323
+ ...changeRelSnsInSqs,
324
+ ...changeRelCompleteSnsInSqs,
325
+ ...changeRelCompleteSnsOut,
326
+ ];
275
327
  // Combine all data sets
276
328
  createSourceParams.push(
277
329
  ...updateRelationshipData,
@@ -281,7 +333,8 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
281
333
  ...deleteRelationshipData,
282
334
  ...deleteRelationshipCompleteData,
283
335
  ...getRelationshipData,
284
- ...getRelationshipCompleteData
336
+ ...getRelationshipCompleteData,
337
+ ...changeRelData
285
338
  );
286
339
 
287
340
  return createSourceParams;