@izara_project/izara-market-library-service-schemas 1.0.42 → 1.0.45

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 (36) hide show
  1. package/package.json +3 -3
  2. package/src/GenerateCodeLibs/index.js +0 -1
  3. package/src/SourceManager/src/CreateSource.js +2 -22
  4. package/src/reStructure/GenerateCode.js +2 -2
  5. package/src/reStructure/GenerateSchema.js +3 -3
  6. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +3 -1
  7. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +2 -0
  8. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +2 -0
  9. package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +4 -4
  10. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +1 -2
  11. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -1
  12. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +1 -1
  13. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +5 -5
  14. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +1 -1
  15. package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +1 -1
  16. package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +3 -3
  17. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +6 -0
  18. package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +3 -3
  19. package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +3 -3
  20. package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +3 -3
  21. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +12 -12
  22. package/src/reStructure/TemplateData/propertyValueSchema/generateTemplateData.js +2 -2
  23. package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +1 -1
  24. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +7 -5
  25. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +4 -2
  26. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +4 -4
  27. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +7 -5
  28. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +6 -3
  29. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +4 -4
  30. package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +3 -3
  31. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +6 -3
  32. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +1 -1
  33. package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +5 -3
  34. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +6 -3
  35. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +4 -4
  36. package/src/reStructure/libs/ValidateAddOnDataStructure.js +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izara_project/izara-market-library-service-schemas",
3
- "version": "1.0.42",
3
+ "version": "1.0.45",
4
4
  "description": "Schemas for Izara Market project",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -24,11 +24,11 @@
24
24
  "@izara_project/izara-core-library-core": "^1.0.19",
25
25
  "@izara_project/izara-core-library-external-request": "^1.0.20",
26
26
  "@izara_project/izara-core-library-logger": "^1.0.7",
27
- "@izara_project/izara-core-library-service-schemas": "^1.0.62",
27
+ "@izara_project/izara-core-library-service-schemas": "^1.0.73",
28
28
  "@izara_project/izara-core-library-sns": "^1.0.6",
29
29
  "@izara_project/izara-core-library-sqs": "^1.0.4",
30
30
  "@izara_project/izara-shared": "^1.0.126",
31
- "@izara_project/izara-shared-service-schemas": "^1.0.13",
31
+ "@izara_project/izara-shared-service-schemas": "^1.0.19",
32
32
  "@izara_project/izara-shared-core": "^1.0.2",
33
33
  "ejs": "^3.1.10",
34
34
  "js-beautify": "^1.15.4",
@@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
  'use strict';
19
19
 
20
20
  // contain functions that use with generated code in each services
21
- console.log("./src/GenerateCodeLibs")
22
21
  module.exports = {
23
22
  consts: require('./src/Consts'),
24
23
  generateCodeLibs: require("./src/GenerateCodeLibs"),
@@ -86,7 +86,7 @@ function generateDataFromTemplate(template, data,) {
86
86
  * @param {string} setting.initialData // initialData can use when isAppend = true
87
87
  * @returns
88
88
  */
89
- async function createSource(template, data, { savePath, hookPath, saveFileName, fileExtension, initialData, isAppend = false, checkCreateSourcePass = false }) {
89
+ async function createSource(template, data, { savePath, hookPath, saveFileName, fileExtension, initialData, isAppend = false, checkCreateSourcePass = false, generateHookFile = true }) {
90
90
 
91
91
  try {
92
92
 
@@ -115,7 +115,7 @@ async function createSource(template, data, { savePath, hookPath, saveFileName,
115
115
  let hookDataPath = hookPath ? hookPath : join(savePath, '../hook/');
116
116
 
117
117
  if (!fs.existsSync(savePath)) fs.mkdirSync(savePath, { recursive: true });
118
- if (!fs.existsSync(hookDataPath)) fs.mkdirSync(hookDataPath, { recursive: true });
118
+ if (generateHookFile) if (!fs.existsSync(hookDataPath)) fs.mkdirSync(hookDataPath, { recursive: true });
119
119
 
120
120
  // check saveFileName for Hook exists
121
121
  if (fs.existsSync(`${hookDataPath}${saveFileName}${fileExtension}`.trim())) {
@@ -165,26 +165,6 @@ async function createSource(template, data, { savePath, hookPath, saveFileName,
165
165
  }
166
166
  }
167
167
 
168
-
169
-
170
-
171
-
172
- // Function to extract multiple code between tags
173
- // function extractMultipleCodeBetweenTags(content, tagName) {
174
- // const result = [];
175
- // const startTag = `//(<${tagName}>)`;
176
- // const endTag = `//(</${tagName}>)`;
177
- // let startIndex = content.indexOf(startTag);
178
- // let endIndex = content.indexOf(endTag, startIndex);
179
- // while (startIndex >= 0 && endIndex >= 0) {
180
- // result.push(content.substring(startIndex + startTag.length + 1, endIndex));
181
- // startIndex = content.indexOf(startTag, endIndex);
182
- // endIndex = content.indexOf(endTag, startIndex);
183
- // }
184
- // return result;
185
- // }
186
-
187
-
188
168
  module.exports = {
189
169
  createSource,
190
170
  generateDataFromTemplate
@@ -36,7 +36,7 @@ const { createSharedResource } = require('./TemplateData/generateRole/createShar
36
36
 
37
37
  async function generateCodeWithTemplate(_izContext, objSchemaPath) {
38
38
  try {
39
- console.log('objSchemaPath', objSchemaPath);
39
+ // console.log('objSchemaPath', objSchemaPath);
40
40
  // --------- Prepare path -------------
41
41
  // point to app/src
42
42
  let saveFilePath = join(objSchemaPath, `../`);
@@ -65,7 +65,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
65
65
  // * iterate templateConfig for generate data
66
66
  for (const templateName in templateConfig.TemplateAndData) {
67
67
  // Display log indicating which template is being loaded
68
- console.log('Loading template:', templateName);
68
+ // console.log('Loading template:', templateName);
69
69
 
70
70
  let generateTemplateData = require(join(__dirname, templateConfig.TemplateAndData[templateName]));
71
71
  let createSourceResult = await generateTemplateData(_izContext, objSchemaPath);
@@ -34,15 +34,15 @@ const { validatePathWithRootServicePath } = require("./libs/GenerateCodeLibs");
34
34
 
35
35
  async function generateSchema(_izContext, objSchemaPath, generateSchemaSettings) {
36
36
  try {
37
- console.log('generateSchema', { objSchemaPath, generateSchemaSettings });
37
+ // console.log('generateSchema', { objSchemaPath, generateSchemaSettings });
38
38
  // --------- Prepare path -------------
39
39
  // point to app/src
40
40
  let saveFilePath = join(objSchemaPath, `../`);
41
- console.log("saveFilePath: ", saveFilePath);
41
+ // console.log("saveFilePath: ", saveFilePath);
42
42
 
43
43
  // point to root folder of service
44
44
  let localServicePath = join(saveFilePath, "../../");
45
- console.log("localServicePath: ", localServicePath);
45
+ // console.log("localServicePath: ", localServicePath);
46
46
 
47
47
 
48
48
  //------ Start Create Source ------
@@ -420,8 +420,10 @@ module.exports.createMain = async (
420
420
  messageObject,
421
421
  callingFlowSharedLib.addParentCallingFlowConfig(
422
422
  callingFlowConfig, // resive parent callingFlowConfig.
423
- callingFlowSharedLib.createCallingFlowConfig( // callinfflow own service
423
+ callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
424
+ //(<callingFlowProperties>)
424
425
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createNodeComplete), {}
426
+ //(</callingFlowProperties>)
425
427
  )
426
428
  )
427
429
  );
@@ -165,7 +165,9 @@ module.exports.deleteMain = async (
165
165
  callingFlowSharedLib.addParentCallingFlowConfig(
166
166
  callingFlowConfig,
167
167
  callingFlowSharedLib.createCallingFlowConfig(
168
+ //(<callingFlowProperties>)
168
169
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.deleteNodeComplete), {}
170
+ //(</callingFlowProperties>)
169
171
  )
170
172
  )
171
173
  )
@@ -247,7 +247,9 @@ module.exports.updateMain = async (
247
247
  callingFlowSharedLib.addParentCallingFlowConfig(
248
248
  callingFlowConfig,
249
249
  callingFlowSharedLib.createCallingFlowConfig(
250
+ //(<callingFlowProperties>)
250
251
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.updateNodeComplete), {}
252
+ //(</callingFlowProperties>)
251
253
  )
252
254
  )
253
255
  )
@@ -121,17 +121,17 @@ exports.findData = async (
121
121
  <%- createAdditionalFieldNamesTag(objectType) %>
122
122
  <% } _%>
123
123
  else <% } _%> {
124
- errorsFound.push("unrecognised fieldName")
124
+ errorsFound.push("unrecognized fieldName")
125
125
  standardErrorParams.push(errorsFound)
126
126
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
127
127
  return;
128
128
  }
129
129
  } <% if (idx + 1 == datas.length) { %>
130
- //(<addtionalObjectType>)
131
- //(</addtionalObjectType>)
130
+ //(<additionalObjectType>)
131
+ //(</additionalObjectType>)
132
132
  <% } _%>
133
133
  else<% } %> {
134
- errorsFound.push("unrecognised objectType")
134
+ errorsFound.push("unrecognized objectType")
135
135
  standardErrorParams.push(errorsFound)
136
136
  await findDataSharedLib.completeFindDataMain(...standardErrorParams);
137
137
  return;
@@ -71,7 +71,6 @@ module.exports.createObject = async (
71
71
  let flowSchema = await getObjectSchema.getFlowSchemaS3WithCache(_izContext, {
72
72
  flowTag: "<%- flowTag %>",
73
73
  serviceTag: process.env.iz_serviceTag
74
- // serviceTag: "GenerateCodeTamplateBas002"
75
74
  })
76
75
 
77
76
  _izContext.logger.debug("getFlowSchema", flowSchema)
@@ -89,7 +88,7 @@ module.exports.createObject = async (
89
88
 
90
89
  // get objectType
91
90
  let objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, flowSchema.objType)
92
- _izContext.logger.debug("objectSchema in flowShcema mainFunction", objectSchema)
91
+ _izContext.logger.debug("objectSchema in flowSchema mainFunction", objectSchema)
93
92
 
94
93
  _izContext.correlationIds.get(coreConsts.X_CORRELATION_ID)
95
94
 
@@ -222,7 +222,7 @@ module.exports.createPresignUrl = async (
222
222
  updateImportBatchMainMsg,
223
223
  callingFlowSharedLib.addParentCallingFlowConfig(
224
224
  returnMessage, // resive parent callingFlowConfig.
225
- callingFlowSharedLib.createCallingFlowConfig( // callinfflow own service
225
+ callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
226
226
  await lambdaSharedLib.lambdaFunctionName(_izContext, `WebSocketTaskComplete`), {}
227
227
  )
228
228
  )
@@ -46,7 +46,7 @@ let perRecordsValidatorSchema = {
46
46
  }
47
47
  },
48
48
  },
49
- objInstaceFull: {
49
+ objInstanceFull: {
50
50
  type: "object",
51
51
  properties: {
52
52
  identifiers: {
@@ -44,7 +44,7 @@ const importDataLibs = require('../../../../libs/source/GenerateCodeLibs');
44
44
  module.exports.reservedLimit = async (
45
45
  _izContext,
46
46
  objType,
47
- objInstaceFull,
47
+ objInstanceFull,
48
48
  callingFlowConfig = {}
49
49
  ) => {
50
50
 
@@ -52,7 +52,7 @@ module.exports.reservedLimit = async (
52
52
 
53
53
  _izContext.logger.debug('----- reservedLimit event params ----- ', {
54
54
  objType,
55
- objInstaceFull,
55
+ objInstanceFull,
56
56
  callingFlowConfig
57
57
  });
58
58
  const {
@@ -64,10 +64,10 @@ module.exports.reservedLimit = async (
64
64
  fileName,
65
65
  fileSize,
66
66
  startTime
67
- } = objInstaceFull.fields
67
+ } = objInstanceFull.fields
68
68
  const {
69
69
  importBatchId
70
- } = objInstaceFull.identifiers
70
+ } = objInstanceFull.identifiers
71
71
 
72
72
  let connectionId = _izContext.correlationIds.get(coreConsts.CONNECTION_ID)
73
73
  //* hard code
@@ -154,7 +154,7 @@ module.exports.reservedLimit = async (
154
154
 
155
155
  return {
156
156
  objType,
157
- objInstaceFull,
157
+ objInstanceFull,
158
158
  }
159
159
  } catch (err) {
160
160
  _izContext.logger.error('error GetSignedUrlAccountLimit: ', err);
@@ -150,7 +150,7 @@ module.exports.processAfterUpload = async (
150
150
  fileS3Buffer = Buffer.concat(await fileS3Body.toArray());
151
151
  _izContext.logger.debug("fileS3Buffer", fileS3Buffer)
152
152
  } else {
153
- errorsFound.push('unknow object stream type');
153
+ errorsFound.push('unknown object stream type');
154
154
  }
155
155
 
156
156
  // check file type
@@ -63,7 +63,7 @@ module.exports.registerCompleteMain = async (
63
63
 
64
64
  let connectionId = _izContext.correlationIds.get(consts.CONNECTION_ID);
65
65
 
66
- // getflowSchema by using send topic name
66
+ // get flowSchema by using send topic name
67
67
  // ! didn't got topicName from requestParams complete endpoint must send flowTag with identifiersTask
68
68
 
69
69
  if (!requestParams.flowTag) {
@@ -35,7 +35,7 @@ let perRecordsValidatorSchema = {
35
35
  required: [
36
36
  'returnValue',
37
37
  'status',
38
- 'errorFounds',
38
+ 'errorsFound',
39
39
  'graphServiceTag'
40
40
  ],
41
41
  properties: {
@@ -45,7 +45,7 @@ let perRecordsValidatorSchema = {
45
45
  status: {
46
46
  type: 'string',
47
47
  },
48
- errorFounds: {
48
+ errorsFound: {
49
49
  type: 'array',
50
50
  default: []
51
51
  },
@@ -93,7 +93,7 @@ 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.errorFounds)
96
+ passOnProperties.push(record.body.Message.errorsFound)
97
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
@@ -143,6 +143,12 @@ module.exports.createObjectComplete = async (
143
143
  _izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
144
144
  await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
145
145
 
146
+ await asyncFlowSharedLib.removeAwaitingMultipleStep(
147
+ _izContext,
148
+ awaitingStepId,
149
+ pendingStepId
150
+ );
151
+
146
152
  //(<afterSendMessage>)
147
153
  //(</afterSendMessage>)
148
154
  }
@@ -36,7 +36,7 @@ let perRecordsValidatorSchema = {
36
36
  required: [
37
37
  'returnValue',
38
38
  'status',
39
- 'errorFounds'
39
+ 'errorsFound'
40
40
  ],
41
41
  properties: {
42
42
  returnValue: {
@@ -45,7 +45,7 @@ let perRecordsValidatorSchema = {
45
45
  status: {
46
46
  type: 'string',
47
47
  },
48
- errorFounds: {
48
+ errorsFound: {
49
49
  type: 'array',
50
50
  default: []
51
51
  }
@@ -90,7 +90,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
90
90
  // add argument (to invoke lambda) to passOnProperties[]
91
91
  passOnProperties.push(record.body.Message.returnValue)
92
92
  passOnProperties.push(record.body.Message.status)
93
- passOnProperties.push(record.body.Message.errorFounds)
93
+ passOnProperties.push(record.body.Message.errorsFound)
94
94
  passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
95
95
  // passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
96
96
  record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
@@ -35,7 +35,7 @@ let perRecordsValidatorSchema = {
35
35
  required: [
36
36
  'returnValue',
37
37
  'status',
38
- 'errorFounds'
38
+ 'errorsFound'
39
39
  ],
40
40
  properties: {
41
41
  returnValue: {
@@ -44,7 +44,7 @@ let perRecordsValidatorSchema = {
44
44
  status: {
45
45
  type: 'string',
46
46
  },
47
- errorFounds: {
47
+ errorsFound: {
48
48
  type: 'array',
49
49
  default: []
50
50
  }
@@ -89,7 +89,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
89
89
  // add argument (to invoke lambda) to passOnProperties[]
90
90
  passOnProperties.push(record.body.Message.returnValue)
91
91
  passOnProperties.push(record.body.Message.status)
92
- passOnProperties.push(record.body.Message.errorFounds)
92
+ passOnProperties.push(record.body.Message.errorsFound)
93
93
  passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
94
94
  // passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
95
95
  record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
@@ -35,7 +35,7 @@ let perRecordsValidatorSchema = {
35
35
  required: [
36
36
  'returnValue',
37
37
  'status',
38
- 'errorFounds'
38
+ 'errorsFound'
39
39
  ],
40
40
  properties: {
41
41
  returnValue: {
@@ -44,7 +44,7 @@ let perRecordsValidatorSchema = {
44
44
  status: {
45
45
  type: 'string',
46
46
  },
47
- errorFounds: {
47
+ errorsFound: {
48
48
  type: 'array',
49
49
  default: []
50
50
  }
@@ -89,7 +89,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
89
89
  // add argument (to invoke lambda) to passOnProperties[]
90
90
  passOnProperties.push(record.body.Message.returnValue)
91
91
  passOnProperties.push(record.body.Message.status)
92
- passOnProperties.push(record.body.Message.errorFounds)
92
+ passOnProperties.push(record.body.Message.errorsFound)
93
93
  passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
94
94
  // passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
95
95
  record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
@@ -73,12 +73,12 @@ module.exports.<%- functionName %>Main = async (
73
73
  _izContext.logger.debug("<%- functionName %> requestParams", requestParams)
74
74
  _izContext.logger.debug("<%- functionName %> callingFlowConfig", callingFlowConfig)
75
75
 
76
- let errorFounds = [];
76
+ let errorsFound = [];
77
77
  const userId = _izContext.correlationIds.get(coreConsts.BASE_USER_ID);
78
78
  const targetId = _izContext.correlationIds.get(coreConsts.TARGET_ID);
79
79
 
80
80
  if (!userId) {
81
- errorFounds.push("Not have userId")
81
+ errorsFound.push("Not have userId")
82
82
  }
83
83
 
84
84
  const OBJECT_TYPE = "<%- objectType %>"
@@ -105,7 +105,7 @@ module.exports.<%- functionName %>Main = async (
105
105
  _izContext.logger.debug("objectSchema", objectSchema);
106
106
 
107
107
  if (objectSchema.hasOwnProperty("belongTo") && !targetId) {
108
- errorFounds.push('not have targetId')
108
+ errorsFound.push('not have targetId')
109
109
  }
110
110
 
111
111
  let updateDataDetails = await createUpdateDataDetail(_izContext, objectSchema);
@@ -149,26 +149,26 @@ module.exports.<%- functionName %>Main = async (
149
149
  _izContext.logger.debug("missingVersionedDataIdLabels:: ", missingVersionedDataIdLabels);
150
150
 
151
151
  if (missingVersionedDataIdLabels.length) {
152
- errorFounds.push(`missing versionedDataIds of versionedDataLabel '${missingVersionedDataIdLabels.join(", ")}'`)
152
+ errorsFound.push(`missing versionedDataIds of versionedDataLabel '${missingVersionedDataIdLabels.join(", ")}'`)
153
153
  }
154
154
 
155
155
  // check missing update data of versionedDataLabels
156
156
  const missingDataVersionedDataLabels = versionedDataIdLabelKeys.filter(label => !versionedDataIdLabelKeys.includes(label))
157
157
  if (missingDataVersionedDataLabels.length) {
158
- errorFounds.push(`missing data of versionedDataLabels '${missingDataVersionedDataLabels.join(", ")}'`);
158
+ errorsFound.push(`missing data of versionedDataLabels '${missingDataVersionedDataLabels.join(", ")}'`);
159
159
  }
160
160
  // check mainNode Data should not exists
161
161
  if (Object.keys(updateMainNodeData).length) {
162
- errorFounds.push("cannot update mainNode if have versionedDataIds");
162
+ errorsFound.push("cannot update mainNode if have versionedDataIds");
163
163
  }
164
164
  }
165
165
 
166
166
  let messageAttributes
167
167
 
168
- if (errorFounds.length) {
168
+ if (errorsFound.length) {
169
169
  let updateNodeCompleteMessage = {
170
170
  objType: {
171
- objecType: OBJECT_TYPE,
171
+ objectType: OBJECT_TYPE,
172
172
  serviceTag: SERVICE_TAG
173
173
  },
174
174
  objInstanceFull: {
@@ -177,7 +177,7 @@ module.exports.<%- functionName %>Main = async (
177
177
  },
178
178
  versionedDataIds: versionedDataIds,
179
179
  status: 'error',
180
- errorFounds: errorFounds
180
+ errorsFound: errorsFound
181
181
  };
182
182
 
183
183
 
@@ -205,7 +205,7 @@ module.exports.<%- functionName %>Main = async (
205
205
  if (updateDataDetail.storageType === consts.STORAGE_TYPES.graph) {
206
206
  // let graphServiceName = await getGraphServiceTagWithCache(_izContext, getDataDetail.graphServiceTag)
207
207
 
208
- awaitingStepIds.push( // createAwaitingstepId if updateGraph
208
+ awaitingStepIds.push( // create Awaiting stepId if updateGraph
209
209
  asyncFlowSharedLib.createAwaitingStepId(
210
210
  hash({
211
211
  objectType: OBJECT_TYPE,
@@ -266,7 +266,7 @@ module.exports.<%- functionName %>Main = async (
266
266
  TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateNode, storageTag, )
267
267
  }
268
268
 
269
- _izContext.logger.debug('requset param before send to topic InUpdateNode:::', updateNodeMessageBody);
269
+ _izContext.logger.debug('request param before send to topic InUpdateNode:::', updateNodeMessageBody);
270
270
 
271
271
  let resSNS = await sns.publishAsync(_izContext, updateNodeMessageBody)
272
272
  _izContext.logger.debug('resSNS send to topic InUpdateNode finish!', resSNS);
@@ -341,7 +341,7 @@ module.exports.<%- functionName %>Main = async (
341
341
  versionedDataIds: versionedDataIds
342
342
  },
343
343
  status: "complete",
344
- errorFounds
344
+ errorsFound
345
345
  }
346
346
  } catch (err) {
347
347
  _izContext.logger.error('error AddressUpdate: ', err)
@@ -34,7 +34,7 @@ const modules = {
34
34
  */
35
35
  async function generateCodeWithTemplate(_izContext, objSchemaPath, settings) {
36
36
  try {
37
- console.log("settings generateCodeWithTemplate", settings)
37
+ // console.log("settings generateCodeWithTemplate", settings)
38
38
  let allCreateSource = [];
39
39
  const srcPath = join(objSchemaPath, '../');
40
40
 
@@ -56,7 +56,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath, settings) {
56
56
  // } else {
57
57
  // throw Error(`Generate propertyNode schema Invalid generateName:${settings.generateName} `);
58
58
  // }
59
- console.log("allCreateSource propertyValues", JSON.stringify(allCreateSource, null, 2))
59
+ // console.log("allCreateSource propertyValues", JSON.stringify(allCreateSource, null, 2))
60
60
  return allCreateSource;
61
61
  } catch (error) {
62
62
  _izContext.logger.error('Error generating code with template propertyNode schema:', error);
@@ -35,7 +35,7 @@ const { createBasicRelationshipsProperties } = require('../../../../GenerateCode
35
35
  const { ADD_ON_DATA_STRUCTURE_TYPE } = require('../../../../TemplateManager/src/libs/Consts');
36
36
 
37
37
  async function data(_izContext, settings, srcPath) {
38
- console.log("create Data function ::", { settings })
38
+ // console.log("create Data function ::", { settings })
39
39
  let createSourceRecords = []
40
40
  for (const settingPropertyValue of settings) {
41
41
  let objectSchema = await objectschemaLocalByPath.getLocalObjectSchemasWithHierarchy(
@@ -88,8 +88,8 @@ module.exports.createRelationship = async (
88
88
  relType,
89
89
  relationshipDirection,
90
90
  relationshipProperties
91
- //(<requestparamCreateRel>)
92
- //(</requestparamCreateRel>)
91
+ //(<requestParamCreateRel>)
92
+ //(</requestParamCreateRel>)
93
93
  } = requestParams;
94
94
 
95
95
  let errorsFound = [];
@@ -258,7 +258,7 @@ module.exports.createRelationship = async (
258
258
  //(<inCreateRelCompleteMsgCrateRel>)
259
259
  //(</inCreateRelCompleteMsgCrateRel>)
260
260
  status: 'error',
261
- errorFounds: errorsFound
261
+ errorsFound: errorsFound
262
262
  };
263
263
 
264
264
  // if have callingFlow will send to message complete
@@ -323,7 +323,7 @@ module.exports.createRelationship = async (
323
323
  }
324
324
  )
325
325
 
326
- // putitem second Object DynamoDb
326
+ // put Item second Object DynamoDb
327
327
  await dynamodbSharedLib.putItem(_izContext,
328
328
  await dynamodbSharedLib.tableName(_izContext, tableNameTo),
329
329
  {
@@ -365,8 +365,10 @@ module.exports.createRelationship = async (
365
365
  createRelMessageBody,
366
366
  callingFlowSharedLib.addParentCallingFlowConfig(
367
367
  callingFlowConfig, // receive parent callingFlowConfig.
368
- callingFlowSharedLib.createCallingFlowConfig( // callinfflow own service
368
+ callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
369
+ //(<callingFlowProperties>)
369
370
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createRelComplete),
371
+ //(</callingFlowProperties>)
370
372
  {
371
373
  graphServiceTag: storageResource.graphServiceTag
372
374
  }
@@ -87,8 +87,10 @@ function createParamForCreateSource(srcPath) {
87
87
  SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
88
88
  ]
89
89
  },
90
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
91
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
90
+ [
91
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
92
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
93
+ ]
92
94
  )
93
95
  )
94
96
 
@@ -98,7 +98,7 @@ module.exports.createRelationshipComplete = async (
98
98
  relType: returnValue.relType,
99
99
  relationshipProperties: returnValue.relationshipProperties,
100
100
  status: status,
101
- errorFounds: errorsFound
101
+ errorsFound: errorsFound
102
102
  };
103
103
 
104
104
  createCompleteMsg = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, createCompleteMsg);
@@ -107,13 +107,13 @@ module.exports.createRelationshipComplete = async (
107
107
  let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
108
108
  _izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", createCompleteMsg);
109
109
 
110
- let sendMessageToOutCreateRelatonshipComplete = {
110
+ let sendMessageToOutCreateRelationshipComplete = {
111
111
  Message: JSON.stringify(createCompleteMsg),
112
112
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
113
113
  TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
114
114
  };
115
- _izContext.logger.debug("Send message to OutCreateRelationshipComplete :::>", sendMessageToOutCreateRelatonshipComplete);
116
- await sns.publishAsync(_izContext, sendMessageToOutCreateRelatonshipComplete);
115
+ _izContext.logger.debug("Send message to OutCreateRelationshipComplete :::>", sendMessageToOutCreateRelationshipComplete);
116
+ await sns.publishAsync(_izContext, sendMessageToOutCreateRelationshipComplete);
117
117
 
118
118
 
119
119
  // remove awaitingMultipleStep after finished
@@ -85,8 +85,8 @@ module.exports.deleteRelationship = async (
85
85
  relType,
86
86
  relationshipProperties,
87
87
  relationshipDirection
88
- //(<requestparamDeleteRel>)
89
- //(</requestparamDeleteRel>)
88
+ //(<requestParamDeleteRel>)
89
+ //(</requestParamDeleteRel>)
90
90
  } = requestParams;
91
91
 
92
92
  let errorsFound = [];
@@ -224,7 +224,7 @@ module.exports.deleteRelationship = async (
224
224
  //(<inDeleteRelCompleteMsg>)
225
225
  //(</inDeleteRelCompleteMsg>)
226
226
  status: 'error',
227
- errorFounds: errorsFound
227
+ errorsFound: errorsFound
228
228
  };
229
229
 
230
230
  // if have callingFlow will send to message complete
@@ -286,7 +286,7 @@ module.exports.deleteRelationship = async (
286
286
  }
287
287
  )
288
288
 
289
- // putitem second Object DynamoDb
289
+ // put item second Object DynamoDb
290
290
  await dynamodbSharedLib.deleteItem(_izContext,
291
291
  await dynamodbSharedLib.tableName(_izContext, tableNameTo),
292
292
  {
@@ -328,8 +328,10 @@ module.exports.deleteRelationship = async (
328
328
  deleteRelMessageBody,
329
329
  callingFlowSharedLib.addParentCallingFlowConfig(
330
330
  callingFlowConfig, // receive parent callingFlowConfig.
331
- callingFlowSharedLib.createCallingFlowConfig( // callinfflow own service
331
+ callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
332
+ //(<callingFlowProperties>)
332
333
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.deleteRelComplete), {}
334
+ //(</callingFlowProperties>)
333
335
  )
334
336
  )
335
337
  );
@@ -85,9 +85,12 @@ function createParamForCreateSource(srcPath) {
85
85
  SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
86
86
  ]
87
87
  },
88
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
89
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
90
- ))
88
+ [
89
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
90
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
91
+ ]
92
+ )
93
+ )
91
94
  additionalResourcePermission.push(awaitingMultipleStepsRole())
92
95
 
93
96
  return {
@@ -99,7 +99,7 @@ module.exports.deleteRelationshipComplete = async (
99
99
  relType: returnValue.relType,
100
100
  relationshipProperties: returnValue.relationshipProperties,
101
101
  status: status,
102
- errorFounds: errorsFound
102
+ errorsFound: errorsFound
103
103
  };
104
104
 
105
105
  deleteRelComp = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, deleteRelComp);
@@ -108,13 +108,13 @@ module.exports.deleteRelationshipComplete = async (
108
108
  let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
109
109
  _izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", deleteRelComp);
110
110
 
111
- let sendMessageToOutDeleteRelatonshipComplete = {
111
+ let sendMessageToOutDeleteRelationshipComplete = {
112
112
  Message: JSON.stringify(deleteRelComp),
113
113
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
114
114
  TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete)
115
115
  };
116
- _izContext.logger.debug("Send message to OutdeleteRelationshipComplete :::>", sendMessageToOutDeleteRelatonshipComplete);
117
- await sns.publishAsync(_izContext, sendMessageToOutDeleteRelatonshipComplete);
116
+ _izContext.logger.debug("Send message to OutDeleteRelationshipComplete :::>", sendMessageToOutDeleteRelationshipComplete);
117
+ await sns.publishAsync(_izContext, sendMessageToOutDeleteRelationshipComplete);
118
118
 
119
119
 
120
120
  // remove awaitingMultipleStep after finished
@@ -86,8 +86,8 @@ module.exports.getRelationship = async (
86
86
  relType,
87
87
  relId,
88
88
  relationshipDirection,
89
- //(<requestparamGetRel>)
90
- //(</requestparamGetRel>)
89
+ //(<requestParamGetRel>)
90
+ //(</requestParamGetRel>)
91
91
  } = requestParams;
92
92
 
93
93
  let errorsFound = [];
@@ -208,7 +208,7 @@ module.exports.getRelationship = async (
208
208
  //(<inGetRelCompleteMsgCrateRel>)
209
209
  //(</inGetRelCompleteMsgCrateRel>)
210
210
  status: 'error',
211
- errorFounds: errorsFound
211
+ errorsFound: errorsFound
212
212
  };
213
213
 
214
214
  // if have callingFlow will send to message complete
@@ -85,9 +85,12 @@ function createParamForCreateSource(srcPath) {
85
85
  SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
86
86
  ]
87
87
  },
88
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
89
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
90
- ))
88
+ [
89
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
90
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
91
+ ]
92
+ )
93
+ )
91
94
 
92
95
  additionalResourcePermission.push(awaitingMultipleStepsRole())
93
96
 
@@ -99,7 +99,7 @@ module.exports.getRelationshipComplete = async (
99
99
  relType: returnValue.relType,
100
100
  relationshipProperties: returnValue.relationshipProperties,
101
101
  status: status,
102
- errorFounds: errorsFound
102
+ errorsFound: errorsFound
103
103
  };
104
104
 
105
105
  createCompleteMsg = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, createCompleteMsg);
@@ -92,8 +92,8 @@ module.exports.updateRelationship = async (
92
92
  relId,
93
93
  relationshipProperties,
94
94
  relationshipDirection
95
- //(<requestparamUpdateRel>)
96
- //(</requestparamUpdateRel>)
95
+ //(<requestParamUpdateRel>)
96
+ //(</requestParamUpdateRel>)
97
97
  } = requestParams;
98
98
 
99
99
  let errorsFound = [];
@@ -221,7 +221,7 @@ module.exports.updateRelationship = async (
221
221
  relType: relType,
222
222
  relationshipDirection,
223
223
  status: 'error',
224
- errorFounds: errorsFound
224
+ errorsFound: errorsFound
225
225
  //(<inUpdateCompleteMsgUpdateRel>)
226
226
  //(</inUpdateCompleteMsgUpdateRel>)
227
227
  };
@@ -328,7 +328,9 @@ module.exports.updateRelationship = async (
328
328
  callingFlowSharedLib.addParentCallingFlowConfig(
329
329
  callingFlowConfig, // receive parent callingFlowConfig.
330
330
  callingFlowSharedLib.createCallingFlowConfig( // callinfflow own service
331
+ //(<callingFlowProperties>)
331
332
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.updateRelComplete),
333
+ //(</callingFlowProperties>)
332
334
  {
333
335
  graphServiceTag: storageResource.graphServiceTag
334
336
  }
@@ -85,9 +85,12 @@ function createParamForCreateSource(srcPath) {
85
85
  SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
86
86
  ]
87
87
  },
88
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
89
- resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
90
- ))
88
+ [
89
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
90
+ resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
91
+ ]
92
+ )
93
+ )
91
94
 
92
95
  additionalResourcePermission.push(awaitingMultipleStepsRole())
93
96
 
@@ -99,7 +99,7 @@ module.exports.updateRelationshipComplete = async (
99
99
  relId: returnValue.relId,
100
100
  relType: returnValue.relType,
101
101
  status: status,
102
- errorFounds: errorsFound
102
+ errorsFound: errorsFound
103
103
  //(<inUpdateCompleteMsg>)
104
104
  //(</inUpdateCompleteMsg>)
105
105
  };
@@ -110,13 +110,13 @@ module.exports.updateRelationshipComplete = async (
110
110
  let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
111
111
  _izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", updateCompleteMsg);
112
112
 
113
- let sendMessageToOutUpdateRelatonshipComplete = {
113
+ let sendMessageToOutUpdateRelationshipComplete = {
114
114
  Message: JSON.stringify(updateCompleteMsg),
115
115
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
116
116
  TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateRelComplete)
117
117
  };
118
- _izContext.logger.debug("Send message to OutUpdateRelationshipComplete :::>", sendMessageToOutUpdateRelatonshipComplete);
119
- await sns.publishAsync(_izContext, sendMessageToOutUpdateRelatonshipComplete);
118
+ _izContext.logger.debug("Send message to OutUpdateRelationshipComplete :::>", sendMessageToOutUpdateRelationshipComplete);
119
+ await sns.publishAsync(_izContext, sendMessageToOutUpdateRelationshipComplete);
120
120
 
121
121
 
122
122
  // remove awaitingMultipleStep after finished
@@ -24,7 +24,7 @@ async function validateAddOnDataStructure(
24
24
  settings
25
25
  ) {
26
26
 
27
- let errorFounds = [];
27
+ let errorsFound = [];
28
28
  let returnObjectValue = {}
29
29
 
30
30
  const objTypeString = objType => `{ serviceTag: ${objType.serviceTag}, objectType: ${objType.objectType} }`;
@@ -32,11 +32,11 @@ async function validateAddOnDataStructure(
32
32
  const objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, settings.objType);
33
33
 
34
34
  if (!objectSchema) {
35
- errorFounds.push(`Invalid objType:${objTypeString(settings.objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
35
+ errorsFound.push(`Invalid objType:${objTypeString(settings.objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
36
36
  };
37
37
 
38
38
  if (!objectSchema.hasOwnProperty("addOnDataStructure") || !Array.isArray(objectSchema.addOnDataStructure) || !objectSchema.addOnDataStructure.length) {
39
- errorFounds.push(`objType: ${objTypeString(settings.objType)}.cause addOnDataStructure is not exists or empty`)
39
+ errorsFound.push(`objType: ${objTypeString(settings.objType)}.cause addOnDataStructure is not exists or empty`)
40
40
  };
41
41
 
42
42
 
@@ -48,7 +48,7 @@ async function validateAddOnDataStructure(
48
48
  addOnAttributeTree: addOnAttributeTree,
49
49
  });
50
50
  if (!addOnAttributeTree) {
51
- errorFounds.push(`objType: ${objTypeString(settings.objType)}. cannot generate attribute tree schema cause not found addOnDataStructure with attributeTreeTag: ${settings.attributeTag}`)
51
+ errorsFound.push(`objType: ${objTypeString(settings.objType)}. cannot generate attribute tree schema cause not found addOnDataStructure with attributeTreeTag: ${settings.attributeTag}`)
52
52
  }
53
53
  };
54
54
 
@@ -56,6 +56,6 @@ async function validateAddOnDataStructure(
56
56
  objectSchema: objectSchema
57
57
  });
58
58
 
59
- return [returnObjectValue, errorFounds];
59
+ return [returnObjectValue, errorsFound];
60
60
  }
61
61
  module.exports = validateAddOnDataStructure