@izara_project/izara-core-generate-service-code 1.0.9 → 1.0.10

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 (87) hide show
  1. package/package.json +1 -1
  2. package/src/GenerateCode.js +1 -1
  3. package/src/TemplateData/flowSchema/event/eventBridge/functionYaml/data.js +4 -8
  4. package/src/TemplateData/flowSchema/event/eventBridge/handler/inv/data.js +3 -2
  5. package/src/TemplateData/flowSchema/event/eventBridge/mainFunction/data.js +3 -2
  6. package/src/TemplateData/flowSchema/event/externalTopic/Complete/functionYaml/data.js +3 -3
  7. package/src/TemplateData/flowSchema/event/externalTopic/Complete/handler/data.js +3 -6
  8. package/src/TemplateData/flowSchema/event/externalTopic/Complete/mainFunction/data.js +2 -2
  9. package/src/TemplateData/flowSchema/event/externalTopic/Process/functionYaml/data.js +3 -3
  10. package/src/TemplateData/flowSchema/event/externalTopic/Process/handler/data.js +2 -2
  11. package/src/TemplateData/flowSchema/event/externalTopic/sns-in-sqs/data.js +2 -2
  12. package/src/TemplateData/flowSchema/event/externalTopic/sns-out/data.js +7 -3
  13. package/src/TemplateData/flowSchema/event/lambdaSync/Api/functionYaml/data.js +3 -3
  14. package/src/TemplateData/flowSchema/event/lambdaSync/Api/handler/data.js +2 -2
  15. package/src/TemplateData/flowSchema/event/lambdaSync/Inv/functionYaml/data.js +6 -12
  16. package/src/TemplateData/flowSchema/event/lambdaSync/Inv/handler/data.js +3 -2
  17. package/src/TemplateData/flowSchema/event/ownTopic/EndpointComplete/functionYaml/data.js +3 -3
  18. package/src/TemplateData/flowSchema/event/ownTopic/EndpointComplete/handler/data.js +4 -3
  19. package/src/TemplateData/flowSchema/event/ownTopic/EndpointComplete/mainFunction/data.js +4 -3
  20. package/src/TemplateData/flowSchema/event/ownTopic/EndpointComponent/functionYaml/data.js +40 -21
  21. package/src/TemplateData/flowSchema/event/ownTopic/EndpointComponent/handler/data.js +19 -8
  22. package/src/TemplateData/flowSchema/event/ownTopic/FlowSchemaComponent/functionYaml/data.js +4 -4
  23. package/src/TemplateData/flowSchema/event/ownTopic/FlowSchemaComponent/handler/data.js +4 -3
  24. package/src/TemplateData/flowSchema/event/ownTopic/FlowSchemaComponent/mainFunction/data.js +2 -2
  25. package/src/TemplateData/flowSchema/event/ownTopic/sns-in/data.js +9 -10
  26. package/src/TemplateData/flowSchema/event/ownTopic/sns-out/data.js +6 -4
  27. package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/FunctionYaml/data.js +4 -4
  28. package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/Handler/data.js +3 -2
  29. package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/MainFunction/data.js +3 -2
  30. package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/sns/data.js +4 -2
  31. package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/functionYaml/data.js +6 -4
  32. package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/handler/data.js +4 -3
  33. package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/mainFunction/data.js +1 -1
  34. package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/queue/data.js +1 -1
  35. package/src/TemplateData/flowSchema/event/s3/upload/createObject/functionYaml/data.js +5 -4
  36. package/src/TemplateData/flowSchema/event/s3/upload/createObject/handler/data.js +4 -3
  37. package/src/TemplateData/flowSchema/event/s3/upload/createObject/mainFunction/data.js +2 -2
  38. package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/functionYaml/data.js +7 -5
  39. package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/handler/data.js +4 -3
  40. package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/mainFunction/data.js +4 -3
  41. package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/sns-sqs/data.js +4 -3
  42. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/functionYaml/data.js +3 -3
  43. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/handler/data.js +4 -3
  44. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/mainFunction/data.js +4 -3
  45. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/queue/data.js +1 -2
  46. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/functionYaml/data.js +3 -3
  47. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/handler/data.js +5 -3
  48. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/mainFunction/data.js +3 -2
  49. package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/sqs/data.js +3 -2
  50. package/src/TemplateData/flowSchema/event/s3/upload/processFile/functionYml/HdrS3/data.js +3 -3
  51. package/src/TemplateData/flowSchema/event/s3/upload/processFile/handler/handlerS3/data.js +2 -2
  52. package/src/TemplateData/flowSchema/event/s3/upload/processFile/mainFunction/data.js +3 -2
  53. package/src/TemplateData/flowSchema/event/s3/upload/processFile/queue/data.js +1 -1
  54. package/src/TemplateData/flowSchema/event/s3/upload/relate/S3/data.js +2 -1
  55. package/src/TemplateData/flowSchema/event/s3/upload/relate/libs/data.js +2 -1
  56. package/src/TemplateData/flowSchema/event/s3/upload/relate/sns-out/data.js +3 -2
  57. package/src/TemplateData/flowSchema/event/s3/websocket/connect/functionYaml/data.js +6 -14
  58. package/src/TemplateData/flowSchema/event/s3/websocket/connect/handler/data.js +1 -1
  59. package/src/TemplateData/flowSchema/event/s3/websocket/dynamoDb/ReservedTableData.js +2 -1
  60. package/src/TemplateData/flowSchema/event/s3/websocket/dynamoDb/WebSocketTaskData.js +1 -1
  61. package/src/TemplateData/flowSchema/event/s3/websocket/dynamoDb/userUploadRecords.js +1 -1
  62. package/src/TemplateData/flowSchema/flowStep/afterPluginHook/templateMain.ejs +22 -16
  63. package/src/TemplateData/flowSchema/flowStep/firstFlowStep/templateMain.ejs +3 -133
  64. package/src/TemplateData/flowSchema/flowStep/flowStep.js +44 -263
  65. package/src/TemplateData/flowSchema/generateTemplateData.js +39 -4
  66. package/src/TemplateData/flowSchema/register/registerComponent.js +22 -24
  67. package/src/TemplateData/flowSchema/register/wbs/handler/data.js +2 -2
  68. package/src/TemplateData/flowSchema/register/wbs/mainFunction/data.js +2 -2
  69. package/src/TemplateData/flowSchema/webSocketComplete/handler/data.js +1 -0
  70. package/src/TemplateData/flowSchema/webSocketComplete/webSocketCompleteComponent.js +9 -5
  71. package/src/TemplateData/relationshipPerAction/generateTemplateData.js +2 -3
  72. package/src/TemplateData/flowSchema/flowStep/functionYaml/data.js +0 -131
  73. package/src/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +0 -20
  74. package/src/TemplateData/flowSchema/flowStep/handler/data.js +0 -98
  75. package/src/TemplateData/flowSchema/flowStep/handler/template.ejs +0 -94
  76. package/src/TemplateData/flowSchema/flowStep/mainFunction/data.js +0 -92
  77. package/src/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +0 -209
  78. package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/handler/templateSqs.ejs +0 -94
  79. package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/templateMain.ejs +0 -54
  80. package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/templateResource.ejs +0 -59
  81. package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/templateYaml.ejs +0 -20
  82. package/src/TemplateData/flowSchema/flowStep/pluginHooks/data.js +0 -50
  83. package/src/TemplateData/flowSchema/flowStep/pluginHooks/handler/templateSqs.ejs +0 -94
  84. package/src/TemplateData/flowSchema/flowStep/pluginHooks/templateMain.ejs +0 -58
  85. package/src/TemplateData/flowSchema/flowStep/pluginHooks/templateYaml.ejs +0 -20
  86. package/src/TemplateData/flowSchema/flowStep/sns-in/data.js +0 -125
  87. package/src/TemplateData/flowSchema/flowStep/sns-in/template.ejs +0 -59
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izara_project/izara-core-generate-service-code",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Code for locally generating per service files",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@ import validatePathWithRootServicePath from './libs/GenerateCodeLibs.js';
27
27
  import { templateConfig } from './TemplateConfig.js';
28
28
  // SourceManager
29
29
  import createSource from './SourceManager/CreateSource.js';
30
- import utils from './libs/Utils.js'
30
+ import utils from './libs/Utils.js';
31
31
  const { deleteFileInDir } = utils;
32
32
 
33
33
  //* get functionNameConfig
@@ -20,9 +20,9 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../libs/Consts.js';
24
- import utils from '../../../../libs/Utils.js'
25
- import libs from '../../../../libs/Libs.js'
23
+ import consts from '../../../../../libs/Consts.js';
24
+ import utils from '../../../../../libs/Utils.js';
25
+ import libs from '../../../../../libs/Libs.js';
26
26
 
27
27
  const { firstLetterUpperCase: upperCase } = utils;
28
28
  const {
@@ -35,11 +35,7 @@ const {
35
35
  HANDLER
36
36
  } = consts;
37
37
 
38
- const {
39
- defaultIamRolePerAction,
40
- createIamRole,
41
- resourceNames
42
- } = libs;
38
+ const { defaultIamRolePerAction, createIamRole, resourceNames } = libs;
43
39
 
44
40
  const templatePath = path.join(__dirname, 'template.ejs');
45
41
  /**
@@ -20,8 +20,9 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js'
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
+
25
26
  const { firstLetterUpperCase: upperCase } = utils;
26
27
  const { SOURCE_PATH, HANDLER } = consts;
27
28
 
@@ -20,8 +20,9 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../libs/Consts.js';
24
- import utils from '../../../../libs/Utils.js'
23
+ import consts from '../../../../../libs/Consts.js';
24
+ import utils from '../../../../../libs/Utils.js';
25
+
25
26
  const { firstLetterUpperCase: upperCase } = utils;
26
27
  const { SOURCE_PATH, SOURCE_GENERATE_IAM_ROLE } = consts;
27
28
 
@@ -20,9 +20,9 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
25
- import libs from '../../../../../libs/Libs.js'
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
+ import libs from '../../../../../../libs/Libs.js';
26
26
 
27
27
  const {
28
28
  HANDLER,
@@ -20,13 +20,10 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
- const {
27
- HANDLER,
28
- SOURCE_PATH,
29
- } = consts;
26
+ const { HANDLER, SOURCE_PATH } = consts;
30
27
 
31
28
  const { firstLetterUpperCase: upperCase } = utils;
32
29
 
@@ -20,8 +20,8 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
26
  const { SOURCE_PATH } = consts;
27
27
 
@@ -22,9 +22,9 @@ const __dirname = path.dirname(__filename);
22
22
  import { NoRetryError } from '@izara_project/izara-core-library-core';
23
23
  import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
24
24
 
25
- import consts from '../../../../../libs/Consts.js';
26
- import utils from '../../../../../libs/Utils.js';
27
- import libs from '../../../../../libs/Libs.js';
25
+ import consts from '../../../../../../libs/Consts.js';
26
+ import utils from '../../../../../../libs/Utils.js';
27
+ import libs from '../../../../../../libs/Libs.js';
28
28
 
29
29
  const {
30
30
  HANDLER,
@@ -20,8 +20,8 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
26
  const { SOURCE_PATH, HANDLER } = consts;
27
27
  const { firstLetterUpperCase: upperCase } = utils;
@@ -20,8 +20,8 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../libs/Consts.js';
24
- import utils from '../../../../libs/Utils.js';
23
+ import consts from '../../../../../libs/Consts.js';
24
+ import utils from '../../../../../libs/Utils.js';
25
25
 
26
26
  const { SOURCE_PATH, HANDLER, SAVE_FILE_NAME } = consts;
27
27
  const { firstLetterUpperCase: upperCase } = utils;
@@ -20,12 +20,16 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../libs/Consts.js';
24
- import utils from '../../../../libs/Utils.js';
23
+ import consts from '../../../../../libs/Consts.js';
24
+ import utils from '../../../../../libs/Utils.js';
25
+
25
26
  const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
26
27
  const { firstLetterUpperCase: upperCase } = utils;
27
28
 
28
- const templatePath = path.join(__dirname, '../../../resourceYaml/sns-out/template.ejs');
29
+ const templatePath = path.join(
30
+ __dirname,
31
+ '../../../resourceYaml/sns-out/template.ejs'
32
+ );
29
33
 
30
34
  /**
31
35
  * create data for dynamoDbYaml tempalte from objectSchema
@@ -23,9 +23,9 @@ const __dirname = path.dirname(__filename);
23
23
  import fs from 'fs';
24
24
  import yaml from 'yaml';
25
25
 
26
- import consts from '../../../../../libs/Consts.js';
27
- import utils from '../../../../../libs/Utils.js';
28
- import libs from '../../../../../libs/Libs.js'
26
+ import consts from '../../../../../../libs/Consts.js';
27
+ import utils from '../../../../../../libs/Utils.js';
28
+ import libs from '../../../../../../libs/Libs.js'
29
29
 
30
30
  const {
31
31
  HANDLER,
@@ -20,8 +20,8 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
26
  const { HANDLER, SOURCE_PATH } = consts;
27
27
  const { firstLetterUpperCase: upperCase } = utils;
@@ -19,20 +19,14 @@ import path from 'path';
19
19
  import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
- import consts from '../../../../../libs/Consts.js';
23
- import utils from '../../../../../libs/Utils.js';
24
- import libs from '../../../../../libs/Libs.js'
25
22
 
26
- const {
27
- HANDLER,
28
- SOURCE_PATH,
29
- SAVE_FILE_NAME,
30
- } = consts;
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
+ import libs from '../../../../../../libs/Libs.js';
31
26
 
32
- const {
33
- shortNameHandler,
34
- defaultIamRolePerAction
35
- } = libs;
27
+ const { HANDLER, SOURCE_PATH, SAVE_FILE_NAME } = consts;
28
+
29
+ const { shortNameHandler, defaultIamRolePerAction } = libs;
36
30
 
37
31
  const { firstLetterUpperCase: upperCase } = utils;
38
32
 
@@ -19,8 +19,9 @@ import path from 'path';
19
19
  import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
- import consts from '../../../../../libs/Consts.js';
23
- import utils from '../../../../../libs/Utils.js';
22
+
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
24
25
 
25
26
  const { HANDLER, SOURCE_PATH } = consts;
26
27
  const { firstLetterUpperCase: upperCase } = utils;
@@ -20,9 +20,9 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
25
- import libs from '../../../../../libs/Libs.js'
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
+ import libs from '../../../../../../libs/Libs.js';
26
26
 
27
27
  const {
28
28
  HANDLER,
@@ -20,11 +20,12 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
26
  const { SOURCE_PATH, HANDLER } = consts;
27
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
27
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
28
+ utils;
28
29
  const templatePath = path.join(__dirname, 'template.ejs');
29
30
 
30
31
  /**
@@ -20,12 +20,13 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
26
  const { SOURCE_PATH } = consts;
27
27
 
28
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
28
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
29
+ utils;
29
30
  const templatePath = path.join(__dirname, 'template.ejs');
30
31
 
31
32
  /**
@@ -22,9 +22,10 @@ const __dirname = path.dirname(__filename);
22
22
 
23
23
  import { NoRetryError } from '@izara_project/izara-core-library-core';
24
24
  import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
25
- import consts from '../../../../../libs/Consts.js';
26
- import utils from '../../../../../libs/Utils.js';
27
- import libs from '../../../../../libs/Libs.js'
25
+
26
+ import consts from '../../../../../../libs/Consts.js';
27
+ import utils from '../../../../../../libs/Utils.js';
28
+ import libs from '../../../../../../libs/Libs.js';
28
29
 
29
30
  const {
30
31
  HANDLER,
@@ -66,23 +67,36 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
66
67
  let queueName = upperCase(flowSchema.flowTag) + handlerType;
67
68
  let objectSchema;
68
69
 
69
-
70
70
  let setting = {
71
71
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
72
72
  saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
73
73
  fileExtension: '.yml',
74
74
  isAppend: true
75
- }
75
+ };
76
76
  let baseTemplateData = {
77
- resourceLocation: path.join(SOURCE_PATH.resourceLocationFlowSchema, upperCase(flowSchema.flowTag), 'source/'),
77
+ resourceLocation: path.join(
78
+ SOURCE_PATH.resourceLocationFlowSchema,
79
+ upperCase(flowSchema.flowTag),
80
+ 'source/'
81
+ ),
78
82
  functionName,
79
83
  additionalResourcePermission,
80
- roleName: upperCase(flowSchema.flowTag),
81
- }
84
+ roleName: upperCase(flowSchema.flowTag)
85
+ };
82
86
 
83
87
  // getObjectSchema
84
- if (flowSchema.statusType === 'storedCache' || flowSchema.statusType === 'triggerCache' || flowSchema.statusType === 'statusField') {
85
- objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], path.join(srcPath, './schemas')).then(res => res.records[0]);
88
+ if (
89
+ flowSchema.statusType === 'storedCache' ||
90
+ flowSchema.statusType === 'triggerCache' ||
91
+ flowSchema.statusType === 'statusField'
92
+ ) {
93
+ objectSchema = await getObjectSchema
94
+ .getLocalObjectSchemas(
95
+ _izContext,
96
+ [flowSchema.objType.objectType],
97
+ path.join(srcPath, './schemas')
98
+ )
99
+ .then(res => res.records[0]);
86
100
  if (!objectSchema) {
87
101
  throw new NoRetryError('ObjectSchema not found');
88
102
  }
@@ -112,27 +126,31 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
112
126
  )
113
127
  );
114
128
  } else if (flowSchema.statusType === 'triggerCache') {
115
- let dsqQueueName = upperCase(flowSchema.flowTag) + upperCase(HANDLER.hdrDsq);
129
+ let dsqQueueName =
130
+ upperCase(flowSchema.flowTag) + upperCase(HANDLER.hdrDsq);
116
131
  additionalResourcePermission.push(...tableRoleForFlowSchema(objectSchema));
117
132
  additionalResourcePermission.push(
118
- createIamRole({
119
- [RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
120
- }, [
121
- resourceNames(RESOURCE_CLASSES.sqs, dsqQueueName),
122
- resourceNames(RESOURCE_CLASSES.sqs, dsqQueueName + 'DLQ')
123
- ]
133
+ createIamRole(
134
+ {
135
+ [RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
136
+ },
137
+ [
138
+ resourceNames(RESOURCE_CLASSES.sqs, dsqQueueName),
139
+ resourceNames(RESOURCE_CLASSES.sqs, dsqQueueName + 'DLQ')
140
+ ]
124
141
  )
125
- )
142
+ );
126
143
  createSources.push({
127
144
  templatePath: templatePath,
128
145
  templateData: {
129
146
  ...baseTemplateData,
130
147
  handlerType: upperCase(HANDLER.hdrDsq),
131
- functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(HANDLER.hdrDsq)),
148
+ functionNameConfig:
149
+ upperCase(functionName) + upperCase(shortNameHandler(HANDLER.hdrDsq)),
132
150
  queueName: dsqQueueName
133
151
  },
134
152
  setting: setting
135
- })
153
+ });
136
154
  }
137
155
 
138
156
  createSources.push({
@@ -140,7 +158,8 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
140
158
  templateData: {
141
159
  ...baseTemplateData,
142
160
  handlerType,
143
- functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
161
+ functionNameConfig:
162
+ upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
144
163
  queueName
145
164
  },
146
165
  setting: setting
@@ -20,10 +20,12 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
+
25
26
  const { HANDLER, SOURCE_PATH } = consts;
26
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
27
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
28
+ utils;
27
29
  const sqsTemplatePath = path.join(__dirname, 'SqsHandlerTemplate.ejs');
28
30
  const dsqTemplatePath = path.join(__dirname, 'DsqHandlerTemplate.ejs');
29
31
 
@@ -53,14 +55,19 @@ function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
53
55
  queueName
54
56
  },
55
57
  setting: {
56
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
58
+ savePath: path.join(
59
+ srcPath,
60
+ SOURCE_PATH.flowSchema,
61
+ upperCase(flowSchema.flowTag),
62
+ 'source/'
63
+ ),
57
64
  saveFileName: `${functionName}_${handlerType}`,
58
65
  fileExtension: '.js',
59
66
  isAppend: false
60
67
  }
61
68
  });
62
69
 
63
- if (flowSchema.statusType === "triggerCache") {
70
+ if (flowSchema.statusType === 'triggerCache') {
64
71
  createSources.push({
65
72
  templatePath: dsqTemplatePath,
66
73
  templateData: {
@@ -69,13 +76,17 @@ function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
69
76
  queueName: `${upperCase(flowSchema.flowTag)}${upperCase(HANDLER.hdrDsq)}`
70
77
  },
71
78
  setting: {
72
- savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), 'source/'),
79
+ savePath: path.join(
80
+ srcPath,
81
+ SOURCE_PATH.flowSchema,
82
+ upperCase(flowSchema.flowTag),
83
+ 'source/'
84
+ ),
73
85
  saveFileName: `${functionName}_${upperCase(HANDLER.hdrDsq)}`,
74
86
  fileExtension: '.js',
75
87
  isAppend: false
76
88
  }
77
- }
78
- )
89
+ });
79
90
  }
80
91
 
81
92
  return createSources;
@@ -20,16 +20,16 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
25
- import libs from '../../../../../libs/Libs.js'
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
+ import libs from '../../../../../../libs/Libs.js';
26
26
 
27
27
  const {
28
28
  SOURCE_PATH,
29
29
  RESOURCE_CLASSES,
30
30
  SNS_RESOURCE,
31
31
  DYNAMO_RESOURCE,
32
- SAVE_FILE_NAME,
32
+ SAVE_FILE_NAME
33
33
  } = consts;
34
34
 
35
35
  const {
@@ -20,11 +20,12 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
26
  const { SOURCE_PATH } = consts;
27
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
27
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
28
+ utils;
28
29
  const templatePath = path.join(__dirname, 'template.ejs');
29
30
 
30
31
  /**
@@ -20,8 +20,8 @@ import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
22
 
23
- import consts from '../../../../../libs/Consts.js';
24
- import utils from '../../../../../libs/Utils.js';
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
25
 
26
26
  const { firstLetterUpperCase: upperCase } = utils;
27
27
  const { SOURCE_PATH } = consts;
@@ -19,15 +19,17 @@ import path from 'path';
19
19
  import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
- import consts from '../../../../libs/Consts.js';
23
- import utils from '../../../../libs/Utils.js';
22
+
23
+ import consts from '../../../../../libs/Consts.js';
24
+ import utils from '../../../../../libs/Utils.js';
24
25
 
25
26
  const { SOURCE_PATH, SAVE_FILE_NAME, HANDLER } = consts;
26
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
27
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
28
+ utils;
27
29
 
28
30
  const snsTemplatePath = path.join(
29
31
  __dirname,
30
- '../../../resourceYaml/sns-in-sqs/snsTemplate.ejs'
32
+ '../../../../resourceYaml/sns-in-sqs/snsTemplate.ejs'
31
33
  );
32
34
  const subscriptionSqsTemplatePath = path.join(__dirname, './sqsTemplate.ejs');
33
35
 
@@ -65,12 +67,9 @@ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
65
67
  let defaultDsqQueueDataList = [];
66
68
 
67
69
  if (flowSchema.statusType === 'triggerCache') {
68
- defaultDsqQueueDataList.push(
69
- {
70
- queueName: upperCase(flowSchema.flowTag) + upperCase(HANDLER.hdrDsq)
71
- }
72
- )
73
-
70
+ defaultDsqQueueDataList.push({
71
+ queueName: upperCase(flowSchema.flowTag) + upperCase(HANDLER.hdrDsq)
72
+ });
74
73
  }
75
74
 
76
75
  // if (flowSchema.outputTopic) {
@@ -19,15 +19,17 @@ import path from 'path';
19
19
  import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
- import consts from '../../../../libs/Consts.js';
23
- import utils from '../../../../libs/Utils.js';
22
+
23
+ import consts from '../../../../../libs/Consts.js';
24
+ import utils from '../../../../../libs/Utils.js';
24
25
 
25
26
  const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
26
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = utils;
27
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
28
+ utils;
27
29
 
28
30
  const templatePath = path.join(
29
31
  __dirname,
30
- '../../../resourceYaml/sns-out/template.ejs'
32
+ '../../../../resourceYaml/sns-out/template.ejs'
31
33
  );
32
34
 
33
35
  /**
@@ -22,9 +22,9 @@ const __dirname = path.dirname(__filename);
22
22
  import { NoRetryError } from '@izara_project/izara-core-library-core';
23
23
  import { getObjectSchema } from '@izara_project/izara-core-library-service-schemas';
24
24
 
25
- import consts from '../../../../libs/Consts.js';
26
- import utils from '../../../../libs/Utils.js';
27
- import libs from '../../../../libs/Libs.js';
25
+ import consts from '../../../../../../libs/Consts.js';
26
+ import utils from '../../../../../../libs/Utils.js';
27
+ import libs from '../../../../../../libs/Libs.js';
28
28
 
29
29
  const {
30
30
  SOURCE_PATH,
@@ -47,7 +47,7 @@ const {
47
47
  awaitingMultipleStepsRole,
48
48
  resourceNames,
49
49
  defaultIamRolePerAction,
50
- createIamRole,
50
+ createIamRole
51
51
  } = libs;
52
52
 
53
53
  const templatePath = path.join(__dirname, 'template.ejs');
@@ -19,8 +19,9 @@ import path from 'path';
19
19
  import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
- import consts from '../../../../libs/Consts.js';
23
- import utils from '../../../../libs/Utils.js';
22
+
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
24
25
 
25
26
  const { SOURCE_PATH, HANDLER } = consts;
26
27
  const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
@@ -19,8 +19,9 @@ import path from 'path';
19
19
  import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
- import consts from '../../../../libs/Consts.js';
23
- import utils from '../../../../libs/Utils.js';
22
+
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
24
25
 
25
26
  const { SOURCE_PATH } = consts;
26
27
  const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
@@ -19,8 +19,10 @@ import path from 'path';
19
19
  import { fileURLToPath } from 'url';
20
20
  const __filename = fileURLToPath(import.meta.url);
21
21
  const __dirname = path.dirname(__filename);
22
- import consts from '../../../../libs/Consts.js';
23
- import utils from '../../../../libs/Utils.js';
22
+
23
+ import consts from '../../../../../../libs/Consts.js';
24
+ import utils from '../../../../../../libs/Utils.js';
25
+
24
26
  const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
25
27
  const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
26
28
  utils;