@izara_project/izara-market-library-service-schemas 1.0.46 → 1.0.47

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 (79) hide show
  1. package/package.json +5 -5
  2. package/src/reStructure/GenerateCode.js +6 -2
  3. package/src/reStructure/TemplateData/EndpointPerService/handler/api/data.js +0 -1
  4. package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/data.js +0 -1
  5. package/src/reStructure/TemplateData/EndpointPerService/handler/inv/data.js +0 -1
  6. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +9 -9
  7. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +13 -14
  8. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +3 -5
  9. package/src/reStructure/TemplateData/EndpointPerService/yaml/template.ejs +2 -2
  10. package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +2 -2
  11. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +4 -4
  12. package/src/reStructure/TemplateData/findData/findDataYaml/template.ejs +2 -2
  13. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +1 -1
  14. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +1 -1
  15. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +1 -1
  16. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/template.ejs +1 -1
  17. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +1 -1
  18. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/functionYaml/template.ejs +1 -1
  19. package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +5 -5
  20. package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/functionYaml/template.ejs +1 -1
  21. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +1 -1
  22. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +1 -1
  23. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +5 -5
  24. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +1 -1
  25. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +1 -1
  26. package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/data.js +1 -1
  27. package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +1 -1
  28. package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/data.js +3 -3
  29. package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/template.ejs +1 -1
  30. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/functionYaml/template.ejs +1 -1
  31. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/sqs/data.js +36 -22
  32. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/sqs/template.ejs +0 -9
  33. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/sqs/templateSub.ejs +7 -0
  34. package/src/reStructure/TemplateData/generateRole/data.js +94 -0
  35. package/src/reStructure/TemplateData/generateRole/template.ejs +33 -0
  36. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +19 -17
  37. package/src/reStructure/TemplateData/perActionComplete/create/yaml/template.ejs +1 -1
  38. package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +6 -6
  39. package/src/reStructure/TemplateData/perActionComplete/delete/yaml/template.ejs +1 -1
  40. package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +16 -14
  41. package/src/reStructure/TemplateData/perActionComplete/get/yaml/template.ejs +1 -1
  42. package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +15 -13
  43. package/src/reStructure/TemplateData/perActionComplete/update/yaml/template.ejs +1 -1
  44. package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/template.ejs +2 -2
  45. package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/template.ejs +2 -2
  46. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/template.ejs +2 -2
  47. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/template.ejs +2 -2
  48. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/template.ejs +2 -2
  49. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/template.ejs +2 -2
  50. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +2 -0
  51. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +1 -1
  52. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +19 -18
  53. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +2 -2
  54. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/template.ejs +2 -2
  55. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +1 -1
  56. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/template.ejs +2 -2
  57. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +1 -1
  58. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/template.ejs +2 -2
  59. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +1 -1
  60. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/template.ejs +2 -2
  61. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +0 -3
  62. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +2 -24
  63. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +1 -1
  64. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +3 -5
  65. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +20 -19
  66. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/template.ejs +2 -2
  67. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +1 -1
  68. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/template.ejs +2 -2
  69. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/template.ejs +2 -2
  70. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/template.ejs +2 -2
  71. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +1 -1
  72. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +19 -18
  73. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/template.ejs +2 -2
  74. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +1 -1
  75. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/template.ejs +2 -2
  76. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/template.ejs +2 -2
  77. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/template.ejs +2 -2
  78. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +1 -1
  79. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +18 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izara_project/izara-market-library-service-schemas",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "Schemas for Izara Market project",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "license": "AGPL-3.0-or-later",
15
15
  "homepage": "https://bitbucket.org/izara-market-libraries/izara-market-library-service-schemas/src/master/README.md",
16
16
  "devDependencies": {
17
- "jest": "^29.7.0"
17
+ "jest": "^30.0.4"
18
18
  },
19
19
  "jest": {
20
20
  "testEnvironment": "node"
@@ -22,13 +22,13 @@
22
22
  "dependencies": {
23
23
  "@izara_project/izara-core-library-calling-flow": "^1.0.3",
24
24
  "@izara_project/izara-core-library-core": "^1.0.19",
25
- "@izara_project/izara-core-library-external-request": "^1.0.20",
25
+ "@izara_project/izara-core-library-external-request": "^1.0.21",
26
26
  "@izara_project/izara-core-library-logger": "^1.0.7",
27
- "@izara_project/izara-core-library-service-schemas": "^1.0.73",
27
+ "@izara_project/izara-core-library-service-schemas": "^1.0.76",
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.19",
31
+ "@izara_project/izara-shared-service-schemas": "^1.0.22",
32
32
  "@izara_project/izara-shared-core": "^1.0.2",
33
33
  "ejs": "^3.1.10",
34
34
  "js-beautify": "^1.15.4",
@@ -33,6 +33,7 @@ const { SOURCE_PATH } = require('../MainLibs/src/Consts');
33
33
  //* get functionNameConfig
34
34
  const functionNameConfigYamlData = require('./TemplateData/externalService/functionNameConfig/data');
35
35
  const { createSharedResource } = require('./TemplateData/generateRole/createSharedResource');
36
+ const { generateRole } = require('./TemplateData/generateRole/data');
36
37
 
37
38
  async function generateCodeWithTemplate(_izContext, objSchemaPath) {
38
39
  try {
@@ -83,9 +84,12 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
83
84
  const functionNameConfigs = functionNameConfigYamlData(_izContext, allCreateSource, saveFilePath);
84
85
  allCreateSource.push(...functionNameConfigs);
85
86
 
87
+ const generateRoleData = generateRole(_izContext, allCreateSource, saveFilePath);
88
+ allCreateSource.push(...generateRoleData);
89
+
86
90
  // ** create Generate-Shared-resource
87
- const generateSharedResource = createSharedResource(_izContext, allCreateSource, saveFilePath);
88
- allCreateSource.push(generateSharedResource);
91
+ // const generateSharedResource = createSharedResource(_izContext, allCreateSource, saveFilePath);
92
+ // allCreateSource.push(generateSharedResource);
89
93
  // console.log('---> allCreateSource', allCreateSource);
90
94
 
91
95
  // check each allCreateSource valid
@@ -60,7 +60,6 @@ function createParamForCreateSource(action, handler, srcPath) {
60
60
  return {
61
61
  templatePath: templatePath,
62
62
  templateData: {
63
- roleName: SOURCE_GENERATE_IAM_ROLE.perActionEndpoint,
64
63
  action: action,
65
64
  handler
66
65
  },
@@ -63,7 +63,6 @@ function createParamForCreateSource(action, handler, srcPath) {
63
63
  return {
64
64
  templatePath: templatePath,
65
65
  templateData: {
66
- roleName: SOURCE_GENERATE_IAM_ROLE.perActionEndpoint,
67
66
  queueName,
68
67
  action,
69
68
  handler
@@ -53,7 +53,6 @@ function createParamForCreateSource(action, handler, srcPath) {
53
53
  return {
54
54
  templatePath: templatePath,
55
55
  templateData: {
56
- roleName: SOURCE_GENERATE_IAM_ROLE.perActionEndpoint,
57
56
  action: action,
58
57
  handler
59
58
  },
@@ -338,7 +338,7 @@ module.exports.createMain = async (
338
338
  (objectSchemas.fieldNames[identifier.fieldName].optionalOnCreate === false) &&
339
339
  (objectSchemas.fieldNames[identifier.fieldName].canUpdate === false) &&
340
340
  objectSchemas.fieldNames[identifier.fieldName].hashOnCreate === false) {
341
- errorsFound.push("[invalid]case single identifier invalid objectSchemass");
341
+ errorsFound.push("[invalid]case single identifier invalid objectSchemas");
342
342
  };
343
343
  };
344
344
  }
@@ -368,7 +368,7 @@ module.exports.createMain = async (
368
368
 
369
369
  }; // end iteration of fieldNames
370
370
 
371
- _izContext.logger.debug("listOfRequriedOnCreate", listOfRequiredOnCreate);
371
+ _izContext.logger.debug("listOfRequiredOnCreate", listOfRequiredOnCreate);
372
372
  _izContext.logger.debug("listOfOptionalOnCreate", listOfOptionalOnCreate);
373
373
  for (let fieldName of Object.keys(requestParams.fieldNames)) {
374
374
 
@@ -487,7 +487,7 @@ module.exports.createMain = async (
487
487
  _izContext.logger.debug({ fields })
488
488
  return fields
489
489
  }
490
- /// step save awiatingMultipleStep of storageType graph ...........................................................
490
+ /// step save awaitingMultipleStep of storageType graph ...........................................................
491
491
 
492
492
  await asyncFlowSharedLib.createAwaitingMultipleSteps(
493
493
  _izContext,
@@ -500,17 +500,17 @@ module.exports.createMain = async (
500
500
  let messageObject = {};
501
501
  for (let objectCreate of listOfObjectForCreates) {
502
502
 
503
- for (let [graphServiceName, objecForCreate] of Object.entries(objectCreate)) {
503
+ for (let [graphServiceName, objectForCreate] of Object.entries(objectCreate)) {
504
504
  _izContext.logger.debug("Loop each graph:", {
505
- [graphServiceName]: objecForCreate
505
+ [graphServiceName]: objectForCreate
506
506
  });
507
507
 
508
- if (objecForCreate.allStorageTagComplete == false) { // needless check because in listOfObjectForCreates push case graph only!
508
+ if (objectForCreate.allStorageTagComplete == false) { // needless check because in listOfObjectForCreates push case graph only!
509
509
  //(<beforeSendMessageToGraph>)
510
510
  //(</beforeSendMessageToGraph>)
511
511
  messageObject = {
512
512
  objType: objType,
513
- objInstanceFull: objecForCreate.objInstanceFull,
513
+ objInstanceFull: objectForCreate.objInstanceFull,
514
514
  relationships: requestParams.relationships || []
515
515
  };
516
516
  };
@@ -528,8 +528,8 @@ module.exports.createMain = async (
528
528
  messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
529
529
  messageObject,
530
530
  callingFlowSharedLib.addParentCallingFlowConfig(
531
- callingFlowConfig, // resive parent callingFlowConfig.
532
- callingFlowSharedLib.createCallingFlowConfig( // callinfflow own service
531
+ callingFlowConfig, // receive parent callingFlowConfig.
532
+ callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
533
533
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createNodeComplete), {}
534
534
  )
535
535
  )
@@ -126,9 +126,8 @@ module.exports.createMain = async (
126
126
  if ((requestParams.hasOwnProperty("relationships")) && (requestParams.relationships.length > 0)) {
127
127
  //(<beforeValidateRelationships>)
128
128
  //(</beforeValidateRelationships>)
129
-
130
- errorsFound.push(...await createNodeLib.validateRequiredOnCreateLinks(_izContext, objType, requestParams.relationships))
131
129
  }
130
+ errorsFound.push(...await createNodeLib.validateRequiredOnCreateLinks(_izContext, objType, requestParams.relationships))
132
131
  _izContext.logger.debug("errorsFound", errorsFound)
133
132
 
134
133
  // end validate
@@ -149,7 +148,7 @@ module.exports.createMain = async (
149
148
  if (objectSchemas.identifiers.length === 1 && !objectSchemas.identifiers[0].hasOwnProperty("fieldNames")) {
150
149
 
151
150
  const identifier = objectSchemas.identifiers[0];
152
- _izContext.logger.debug(":::::case single identifer:::::", identifier);
151
+ _izContext.logger.debug(":::::case single identifier:::::", identifier);
153
152
 
154
153
  if (objectSchemas.fieldNames[identifier.fieldName].hasOwnProperty("randomOnCreate")) {
155
154
  if ((objectSchemas.fieldNames[identifier.fieldName].randomOnCreate == true)) {
@@ -167,7 +166,7 @@ module.exports.createMain = async (
167
166
 
168
167
  if ((objectSchemas.fieldNames[identifier.fieldName].requiredOnCreate == true) &&
169
168
  (objectSchemas.fieldNames[identifier.fieldName].canUpdate == false)) {
170
- // check Fns have resive
169
+ // check Fns have receive
171
170
 
172
171
  if (requestParams.fieldNames.hasOwnProperty([identifier.fieldName])) {
173
172
  _izContext.logger.debug("identifier is exist:", {
@@ -175,7 +174,7 @@ module.exports.createMain = async (
175
174
  });
176
175
 
177
176
  } else {
178
- errorsFound.push("[invalid]requestParams not have data fieldNames of requriedOnCreate");
177
+ errorsFound.push("[invalid]requestParams not have data fieldNames of requiredOnCreate");
179
178
  }
180
179
  }
181
180
  };
@@ -199,7 +198,7 @@ module.exports.createMain = async (
199
198
  (objectSchemas.fieldNames[identifier.fieldName].optionalOnCreate === false) &&
200
199
  (objectSchemas.fieldNames[identifier.fieldName].canUpdate === false) &&
201
200
  objectSchemas.fieldNames[identifier.fieldName].hashOnCreate === false) {
202
- errorsFound.push("[invalid]case single identifier invalid objectSchemass");
201
+ errorsFound.push("[invalid]case single identifier invalid objectSchemas");
203
202
  };
204
203
  };
205
204
  }
@@ -229,7 +228,7 @@ module.exports.createMain = async (
229
228
 
230
229
  }; // end iteration of fieldNames
231
230
 
232
- _izContext.logger.debug("listOfRequriedOnCreate", listOfRequiredOnCreate);
231
+ _izContext.logger.debug("listOfRequiredOnCreate", listOfRequiredOnCreate);
233
232
  _izContext.logger.debug("listOfOptionalOnCreate", listOfOptionalOnCreate);
234
233
  for (let fieldName of Object.keys(requestParams.fieldNames)) {
235
234
 
@@ -378,7 +377,7 @@ module.exports.createMain = async (
378
377
  _izContext.logger.debug({ fields })
379
378
  return fields
380
379
  }
381
- /// step save awiatingMultipleStep of storageType graph ...........................................................
380
+ /// step save awaitingMultipleStep of storageType graph ...........................................................
382
381
 
383
382
  await asyncFlowSharedLib.createAwaitingMultipleSteps(
384
383
  _izContext,
@@ -391,17 +390,17 @@ module.exports.createMain = async (
391
390
  let messageObject = {};
392
391
  for (let objectCreate of listOfObjectForCreates) {
393
392
 
394
- for (let [graphServiceName, objecForCreate] of Object.entries(objectCreate)) {
393
+ for (let [graphServiceName, objectForCreate] of Object.entries(objectCreate)) {
395
394
  _izContext.logger.debug("Loop each graph:", {
396
- [graphServiceName]: objecForCreate
395
+ [graphServiceName]: objectForCreate
397
396
  });
398
397
 
399
- if (objecForCreate.allStorageTagComplete == false) { // needless check because in listOfObjectForCreates push case graph only!
398
+ if (objectForCreate.allStorageTagComplete == false) { // needless check because in listOfObjectForCreates push case graph only!
400
399
  //(<beforeSendMessageToGraph>)
401
400
  //(</beforeSendMessageToGraph>)
402
401
  messageObject = {
403
402
  objType: objType,
404
- objInstanceFull: objecForCreate.objInstanceFull,
403
+ objInstanceFull: objectForCreate.objInstanceFull,
405
404
  relationships: requestParams.relationships || []
406
405
  };
407
406
  };
@@ -419,7 +418,7 @@ module.exports.createMain = async (
419
418
  messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
420
419
  messageObject,
421
420
  callingFlowSharedLib.addParentCallingFlowConfig(
422
- callingFlowConfig, // resive parent callingFlowConfig.
421
+ callingFlowConfig, // receive parent callingFlowConfig.
423
422
  callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
424
423
  //(<callingFlowProperties>)
425
424
  await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createNodeComplete), {}
@@ -454,7 +453,7 @@ module.exports.createMain = async (
454
453
  if (errorsFound.length > 0) {
455
454
  _izContext.logger.debug("Case have errorFound:::", errorsFound);
456
455
 
457
- // remove awaitngMultiplestep. [[[[[[[open when not test lolcal.]]]]]]]
456
+ // remove awaitingMultipleStep. [[[[[[[open when not test local.]]]]]]]
458
457
  await asyncFlowSharedLib.clearAllAwaitingSteps(
459
458
  _izContext,
460
459
  asyncFlowSharedLib.createPendingStepId((hash({
@@ -19,9 +19,7 @@ along with this program. If not, see
19
19
  'use strict';
20
20
 
21
21
  const hash = require('@izara_project/izara-shared-core').objectHash;
22
- const {
23
- getObjSchemaS3WithHierarchy,
24
- } = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
22
+ const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
25
23
  const consts = require('@izara_project/izara-core-library-service-schemas/src/Consts');
26
24
  const {
27
25
  dynamoDbIdentifiersByStorageResource,
@@ -203,7 +201,7 @@ module.exports.updateMain = async (
203
201
  if (updateDataDetail.storageType === consts.STORAGE_TYPES.graph) {
204
202
  // let graphServiceName = await getGraphServiceTagWithCache(_izContext, getDataDetail.graphServiceTag)
205
203
 
206
- awaitingStepIds.push( // createAwaitingstepId if updateGraph
204
+ awaitingStepIds.push( // createAwaitingStepId if updateGraph
207
205
  asyncFlowSharedLib.createAwaitingStepId(
208
206
  hash({
209
207
  objectType: objType.objectType,
@@ -263,7 +261,7 @@ module.exports.updateMain = async (
263
261
  TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateNode, storageTag,)
264
262
  }
265
263
 
266
- _izContext.logger.debug('requset param before send to topic InUpdateNode:::', updateNodeMessageBody);
264
+ _izContext.logger.debug('request param before send to topic InUpdateNode:::', updateNodeMessageBody);
267
265
 
268
266
  let resSNS = await sns.publishAsync(_izContext, updateNodeMessageBody)
269
267
  _izContext.logger.debug('resSNS send to topic InUpdateNode finish!', resSNS);
@@ -16,8 +16,8 @@
16
16
  #<#/<%- firstLetterUpperCase(action) _%><%- firstLetterUpperCase(handlerType) %>Authorizer#>
17
17
  <%_ } _%>
18
18
  role: <%- firstLetterUpperCase(roleName) _%>Role
19
- #<#<%_ action _%><%_ handlerType _%>IamRole#>
20
- #<#/<%_ action _%><%_ handlerType _%>IamRole#>
19
+ #<#<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>IamRole#>
20
+ #<#/<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handlerType) %>IamRole#>
21
21
  <%_ function firstLetterUpperCase(text){
22
22
  return text.charAt(0).toUpperCase() + text.slice(1)
23
23
  } _%>
@@ -60,7 +60,7 @@ const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas
60
60
  // validate relationship in ObjectRelationship
61
61
  if (allRelationshipSchemas.length) {
62
62
  // relationship external lambda role
63
- const externalLambdaIamRoleRelationshipPerAction = await externalLamdaIamRoleRelationships(_izContext, allRelSchemas);
63
+ const externalLambdaIamRoleRelationshipPerAction = await externalLambdaIamRoleRelationships(_izContext, allRelSchemas);
64
64
  externalLambdaIamRoleRelationshipPerAction && externalLambdaIamRoleArray.push(externalLambdaIamRoleRelationshipPerAction)
65
65
  }
66
66
 
@@ -141,7 +141,7 @@ async function externalLambdaIamRoleDataPerAction(_izContext, allObjSchemas) {
141
141
 
142
142
 
143
143
  // update Relationship
144
- async function externalLamdaIamRoleRelationships(_izContext, allRelSchemas) {
144
+ async function externalLambdaIamRoleRelationships(_izContext, allRelSchemas) {
145
145
  const additionalResourcePermission = [];
146
146
  const graphServiceNamesFromAllRelSchemas = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas);
147
147
  const objectType = SOURCE_GENERATE_IAM_ROLE.RelationshipRole
@@ -53,7 +53,7 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
53
53
  const snsServiceConfigCreateRelationshipComplete = await snsSubscriptionCreateRelationshipComplete(_izContext, allRelSchemas)
54
54
  snsServiceConfigCreateRelationshipComplete && snsServiceConfigArray.push(snsServiceConfigCreateRelationshipComplete)
55
55
 
56
- const snsServiceConfigDeleteRelationshipComplete = await snsSubscriptionDeleteRelatipnshipComplete(_izContext, allRelSchemas)
56
+ const snsServiceConfigDeleteRelationshipComplete = await snsSubscriptionDeleteRelationshipComplete(_izContext, allRelSchemas)
57
57
  snsServiceConfigDeleteRelationshipComplete && snsServiceConfigArray.push(snsServiceConfigDeleteRelationshipComplete);
58
58
 
59
59
  const snsServiceConfigUpdateNodeComplete = await snsSubscriptionOutUpdateNodeComplete(_izContext, allObjSchemas)
@@ -62,7 +62,7 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
62
62
  const snsServiceConfigCreateNodeComplete = await snsSubscriptionCreateNodeComplete(_izContext, allObjSchemas)
63
63
  snsServiceConfigCreateNodeComplete && snsServiceConfigArray.push(snsServiceConfigCreateNodeComplete);
64
64
 
65
- const snsServiceConfigDeleteNodeComplete = await snsSubscriptionDeleteNodeComplate(_izContext, allObjSchemas)
65
+ const snsServiceConfigDeleteNodeComplete = await snsSubscriptionDeleteNodeComplete(_izContext, allObjSchemas)
66
66
  snsServiceConfigDeleteNodeComplete && snsServiceConfigArray.push(snsServiceConfigDeleteNodeComplete);
67
67
 
68
68
  if (allLocalFlowSchemas) {
@@ -137,7 +137,7 @@ async function snsSubscriptionCreateNodeComplete(_izContext, allObjectSchemas) {
137
137
  }
138
138
  }
139
139
 
140
- async function snsSubscriptionDeleteNodeComplate(_izContext, allObjectSchemas) {
140
+ async function snsSubscriptionDeleteNodeComplete(_izContext, allObjectSchemas) {
141
141
  // let serviceNames = await getGraphServiceNameFromAllRelSchema(_izContext, allObjectSchemas)
142
142
 
143
143
  // return {
@@ -147,7 +147,7 @@ async function snsSubscriptionDeleteNodeComplate(_izContext, allObjectSchemas) {
147
147
  // }
148
148
  }
149
149
 
150
- async function snsSubscriptionDeleteRelatipnshipComplete(_izContext, allRelSchemas) {
150
+ async function snsSubscriptionDeleteRelationshipComplete(_izContext, allRelSchemas) {
151
151
  let serviceTag = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas)
152
152
 
153
153
  return {
@@ -7,8 +7,8 @@
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
8
8
  batchSize: 10
9
9
  role: <%- roleName %>Role
10
- #<#<%- functionName %><%- handlerType %>IamRole#>
11
- #<#/<%- functionName %><%- handlerType %>IamRole#>
10
+ #<#<%- functionName %><%- firstLetterUpperCase(handlerType) %>IamRole#>
11
+ #<#/<%- functionName %><%- firstLetterUpperCase(handlerType) %>IamRole#>
12
12
  <%_ function firstLetterUpperCase(text){
13
13
  return text.charAt(0).toUpperCase() + text.slice(1)
14
14
  } _%>
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -97,7 +97,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
97
97
  handlerType,
98
98
  additionalResourcePermission,
99
99
  functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
100
- roleName: SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole,
100
+ roleName: upperCase(flowSchema.flowTag),
101
101
  queueName
102
102
  },
103
103
  setting: {
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -95,15 +95,15 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
95
95
  }
96
96
 
97
97
  if (flowSchema.statusType === "storedCache") {
98
- let tableStroedCaches = [];
98
+ let tableStoredCache = [];
99
99
  let objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], path.join(srcPath, "./schemas")).then(res => res.records[0])
100
100
  if (!objectSchema) {
101
101
  throw new NoRetryError('ObjectSchema not found')
102
102
  }
103
103
  for (const storageResource of Object.values(objectSchema.storageResources)) {
104
104
  if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
105
- if (!tableStroedCaches.includes(storageResource.tableName)) {
106
- tableStroedCaches.push(storageResource.tableName)
105
+ if (!tableStoredCache.includes(storageResource.tableName)) {
106
+ tableStoredCache.push(storageResource.tableName)
107
107
  }
108
108
  }
109
109
  }
@@ -113,7 +113,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
113
113
  {
114
114
  [RESOURCE_CLASSES.dynamoDbTable]: Object.values(DYNAMO_RESOURCE)
115
115
  },
116
- tableStroedCaches.map(
116
+ tableStoredCache.map(
117
117
  tableName => resourceNames(RESOURCE_CLASSES.dynamoDbTable, tableName))
118
118
  )
119
119
  )
@@ -128,7 +128,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
128
128
  additionalResourcePermission,
129
129
  route,
130
130
  functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
131
- roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic,
131
+ roleName: upperCase(flowSchema.flowTag),
132
132
  queueName
133
133
  },
134
134
  setting: {
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -89,7 +89,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
89
89
  handlerType,
90
90
  additionalResourcePermission,
91
91
  functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
92
- roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic,
92
+ roleName: upperCase(flowSchema.flowTag),
93
93
  queueName: queueName
94
94
  },
95
95
  setting: {
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -80,15 +80,15 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
80
80
  )
81
81
 
82
82
  if (flowSchema.statusType === "storedCache") {
83
- let tableStroedCaches = [];
83
+ let tableStoredCache = [];
84
84
  let objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], path.join(srcPath, "./schemas")).then(res => res.records[0])
85
85
  if (!objectSchema) {
86
86
  throw new NoRetryError('ObjectSchema not found')
87
87
  }
88
88
  for (const storageResource of Object.values(objectSchema.storageResources)) {
89
89
  if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
90
- if (!tableStroedCaches.includes(storageResource.tableName)) {
91
- tableStroedCaches.push(storageResource.tableName)
90
+ if (!tableStoredCache.includes(storageResource.tableName)) {
91
+ tableStoredCache.push(storageResource.tableName)
92
92
  }
93
93
  }
94
94
  }
@@ -98,7 +98,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
98
98
  {
99
99
  [RESOURCE_CLASSES.dynamoDbTable]: Object.values(DYNAMO_RESOURCE)
100
100
  },
101
- tableStroedCaches.map(
101
+ tableStoredCache.map(
102
102
  tableName => resourceNames(RESOURCE_CLASSES.dynamoDbTable, tableName))
103
103
  )
104
104
  )
@@ -113,7 +113,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
113
113
  additionalResourcePermission,
114
114
  route,
115
115
  functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
116
- roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic,
116
+ roleName: upperCase(flowSchema.flowTag),
117
117
  queueName
118
118
  },
119
119
  setting: {
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -104,7 +104,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
104
104
  additionalResourcePermission,
105
105
  route,
106
106
  functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
107
- roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic
107
+ roleName: upperCase(flowSchema.flowTag),
108
108
  },
109
109
  setting: {
110
110
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -112,7 +112,7 @@ function createSourceParams(_izContext, flowStep, srcPath) {
112
112
  handlerType,
113
113
  additionalResourcePermission,
114
114
  functionNameConfig: upperCase(flowStep) + upperCase(shortNameHandler(handlerType)),
115
- roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic,
115
+ roleName: upperCase(flowStep),
116
116
  queueName: topicIn + handlerType
117
117
  },
118
118
  setting: {
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -44,7 +44,7 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
44
44
  fileExtension: ".yml",
45
45
  isAppend: true
46
46
  }
47
- const generatedSnsTopicInForFlowSchema = [];
47
+ const generatedSnsTopicInForFlowSchema = new Set();
48
48
  if (flowSchema.hasOwnProperty("flowSteps")) {
49
49
  let flowSteps = Object.keys(flowSchema.flowSteps);
50
50
  if (flowSteps.length && flowSteps.length > 0) {
@@ -52,7 +52,7 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
52
52
  if (flowSteps.includes("In") && flowSteps.includes("Out")) {
53
53
  if (flowSteps.length > 2) {
54
54
  for (let i = 2; i < flowSteps.length; i++) {
55
- generatedSnsTopicInForFlowSchema.push(
55
+ generatedSnsTopicInForFlowSchema.add(
56
56
  {
57
57
  queueName: upperCase(flowSteps[i])
58
58
  }
@@ -64,7 +64,7 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
64
64
  if (flowSteps.includes("In")) {
65
65
  if (flowSteps.length > 1) {
66
66
  for (let i = 2; i < flowSteps.length; i++) {
67
- generatedSnsTopicInForFlowSchema.push(
67
+ generatedSnsTopicInForFlowSchema.add(
68
68
  {
69
69
  queueName: upperCase(flowSteps[i])
70
70
  }
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role
@@ -6,7 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>
8
8
  batchSize: 10
9
- filterPatterns: #**** need to update serverless framwork upper v.2.69.1
9
+ filterPatterns: #**** need to update serverless framework upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
12
  role: <%- roleName %>Role