@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.
- package/package.json +1 -1
- package/src/GenerateCode.js +1 -1
- package/src/TemplateData/flowSchema/event/eventBridge/functionYaml/data.js +4 -8
- package/src/TemplateData/flowSchema/event/eventBridge/handler/inv/data.js +3 -2
- package/src/TemplateData/flowSchema/event/eventBridge/mainFunction/data.js +3 -2
- package/src/TemplateData/flowSchema/event/externalTopic/Complete/functionYaml/data.js +3 -3
- package/src/TemplateData/flowSchema/event/externalTopic/Complete/handler/data.js +3 -6
- package/src/TemplateData/flowSchema/event/externalTopic/Complete/mainFunction/data.js +2 -2
- package/src/TemplateData/flowSchema/event/externalTopic/Process/functionYaml/data.js +3 -3
- package/src/TemplateData/flowSchema/event/externalTopic/Process/handler/data.js +2 -2
- package/src/TemplateData/flowSchema/event/externalTopic/sns-in-sqs/data.js +2 -2
- package/src/TemplateData/flowSchema/event/externalTopic/sns-out/data.js +7 -3
- package/src/TemplateData/flowSchema/event/lambdaSync/Api/functionYaml/data.js +3 -3
- package/src/TemplateData/flowSchema/event/lambdaSync/Api/handler/data.js +2 -2
- package/src/TemplateData/flowSchema/event/lambdaSync/Inv/functionYaml/data.js +6 -12
- package/src/TemplateData/flowSchema/event/lambdaSync/Inv/handler/data.js +3 -2
- package/src/TemplateData/flowSchema/event/ownTopic/EndpointComplete/functionYaml/data.js +3 -3
- package/src/TemplateData/flowSchema/event/ownTopic/EndpointComplete/handler/data.js +4 -3
- package/src/TemplateData/flowSchema/event/ownTopic/EndpointComplete/mainFunction/data.js +4 -3
- package/src/TemplateData/flowSchema/event/ownTopic/EndpointComponent/functionYaml/data.js +40 -21
- package/src/TemplateData/flowSchema/event/ownTopic/EndpointComponent/handler/data.js +19 -8
- package/src/TemplateData/flowSchema/event/ownTopic/FlowSchemaComponent/functionYaml/data.js +4 -4
- package/src/TemplateData/flowSchema/event/ownTopic/FlowSchemaComponent/handler/data.js +4 -3
- package/src/TemplateData/flowSchema/event/ownTopic/FlowSchemaComponent/mainFunction/data.js +2 -2
- package/src/TemplateData/flowSchema/event/ownTopic/sns-in/data.js +9 -10
- package/src/TemplateData/flowSchema/event/ownTopic/sns-out/data.js +6 -4
- package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/FunctionYaml/data.js +4 -4
- package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/Handler/data.js +3 -2
- package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/MainFunction/data.js +3 -2
- package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/sns/data.js +4 -2
- package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/functionYaml/data.js +6 -4
- package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/handler/data.js +4 -3
- package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/mainFunction/data.js +1 -1
- package/src/TemplateData/flowSchema/event/s3/upload/confirmReserved/queue/data.js +1 -1
- package/src/TemplateData/flowSchema/event/s3/upload/createObject/functionYaml/data.js +5 -4
- package/src/TemplateData/flowSchema/event/s3/upload/createObject/handler/data.js +4 -3
- package/src/TemplateData/flowSchema/event/s3/upload/createObject/mainFunction/data.js +2 -2
- package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/functionYaml/data.js +7 -5
- package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/handler/data.js +4 -3
- package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/mainFunction/data.js +4 -3
- package/src/TemplateData/flowSchema/event/s3/upload/createObjectComplete/sns-sqs/data.js +4 -3
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/functionYaml/data.js +3 -3
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/handler/data.js +4 -3
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/mainFunction/data.js +4 -3
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/createPreSignUrl/queue/data.js +1 -2
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/functionYaml/data.js +3 -3
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/handler/data.js +5 -3
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/mainFunction/data.js +3 -2
- package/src/TemplateData/flowSchema/event/s3/upload/preSignUrl/reservedLimit/sqs/data.js +3 -2
- package/src/TemplateData/flowSchema/event/s3/upload/processFile/functionYml/HdrS3/data.js +3 -3
- package/src/TemplateData/flowSchema/event/s3/upload/processFile/handler/handlerS3/data.js +2 -2
- package/src/TemplateData/flowSchema/event/s3/upload/processFile/mainFunction/data.js +3 -2
- package/src/TemplateData/flowSchema/event/s3/upload/processFile/queue/data.js +1 -1
- package/src/TemplateData/flowSchema/event/s3/upload/relate/S3/data.js +2 -1
- package/src/TemplateData/flowSchema/event/s3/upload/relate/libs/data.js +2 -1
- package/src/TemplateData/flowSchema/event/s3/upload/relate/sns-out/data.js +3 -2
- package/src/TemplateData/flowSchema/event/s3/websocket/connect/functionYaml/data.js +6 -14
- package/src/TemplateData/flowSchema/event/s3/websocket/connect/handler/data.js +1 -1
- package/src/TemplateData/flowSchema/event/s3/websocket/dynamoDb/ReservedTableData.js +2 -1
- package/src/TemplateData/flowSchema/event/s3/websocket/dynamoDb/WebSocketTaskData.js +1 -1
- package/src/TemplateData/flowSchema/event/s3/websocket/dynamoDb/userUploadRecords.js +1 -1
- package/src/TemplateData/flowSchema/flowStep/afterPluginHook/templateMain.ejs +22 -16
- package/src/TemplateData/flowSchema/flowStep/firstFlowStep/templateMain.ejs +3 -133
- package/src/TemplateData/flowSchema/flowStep/flowStep.js +44 -263
- package/src/TemplateData/flowSchema/generateTemplateData.js +39 -4
- package/src/TemplateData/flowSchema/register/registerComponent.js +22 -24
- package/src/TemplateData/flowSchema/register/wbs/handler/data.js +2 -2
- package/src/TemplateData/flowSchema/register/wbs/mainFunction/data.js +2 -2
- package/src/TemplateData/flowSchema/webSocketComplete/handler/data.js +1 -0
- package/src/TemplateData/flowSchema/webSocketComplete/webSocketCompleteComponent.js +9 -5
- package/src/TemplateData/relationshipPerAction/generateTemplateData.js +2 -3
- package/src/TemplateData/flowSchema/flowStep/functionYaml/data.js +0 -131
- package/src/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +0 -20
- package/src/TemplateData/flowSchema/flowStep/handler/data.js +0 -98
- package/src/TemplateData/flowSchema/flowStep/handler/template.ejs +0 -94
- package/src/TemplateData/flowSchema/flowStep/mainFunction/data.js +0 -92
- package/src/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +0 -209
- package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/handler/templateSqs.ejs +0 -94
- package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/templateMain.ejs +0 -54
- package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/templateResource.ejs +0 -59
- package/src/TemplateData/flowSchema/flowStep/plugInHookTagComplete/templateYaml.ejs +0 -20
- package/src/TemplateData/flowSchema/flowStep/pluginHooks/data.js +0 -50
- package/src/TemplateData/flowSchema/flowStep/pluginHooks/handler/templateSqs.ejs +0 -94
- package/src/TemplateData/flowSchema/flowStep/pluginHooks/templateMain.ejs +0 -58
- package/src/TemplateData/flowSchema/flowStep/pluginHooks/templateYaml.ejs +0 -20
- package/src/TemplateData/flowSchema/flowStep/sns-in/data.js +0 -125
- package/src/TemplateData/flowSchema/flowStep/sns-in/template.ejs +0 -59
package/package.json
CHANGED
package/src/GenerateCode.js
CHANGED
|
@@ -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 '
|
|
24
|
-
import utils from '
|
|
25
|
-
import libs from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
25
|
-
import libs from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 '
|
|
26
|
-
import utils from '
|
|
27
|
-
import libs from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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(
|
|
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 '
|
|
27
|
-
import utils from '
|
|
28
|
-
import libs from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
23
|
-
import
|
|
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 '
|
|
24
|
-
import utils from '
|
|
25
|
-
import libs from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 } =
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 } =
|
|
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
|
-
|
|
26
|
-
import
|
|
27
|
-
import
|
|
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(
|
|
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 (
|
|
85
|
-
|
|
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 =
|
|
129
|
+
let dsqQueueName =
|
|
130
|
+
upperCase(flowSchema.flowTag) + upperCase(HANDLER.hdrDsq);
|
|
116
131
|
additionalResourcePermission.push(...tableRoleForFlowSchema(objectSchema));
|
|
117
132
|
additionalResourcePermission.push(
|
|
118
|
-
createIamRole(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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:
|
|
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:
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 } =
|
|
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(
|
|
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 ===
|
|
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(
|
|
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 '
|
|
24
|
-
import utils from '
|
|
25
|
-
import libs from '
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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 } =
|
|
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 '
|
|
24
|
-
import utils from '
|
|
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
|
-
|
|
23
|
-
import
|
|
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 } =
|
|
27
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
|
|
28
|
+
utils;
|
|
27
29
|
|
|
28
30
|
const snsTemplatePath = path.join(
|
|
29
31
|
__dirname,
|
|
30
|
-
'
|
|
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
|
-
|
|
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
|
-
|
|
23
|
-
import
|
|
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 } =
|
|
27
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
|
|
28
|
+
utils;
|
|
27
29
|
|
|
28
30
|
const templatePath = path.join(
|
|
29
31
|
__dirname,
|
|
30
|
-
'
|
|
32
|
+
'../../../../resourceYaml/sns-out/template.ejs'
|
|
31
33
|
);
|
|
32
34
|
|
|
33
35
|
/**
|
package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/FunctionYaml/data.js
CHANGED
|
@@ -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 '
|
|
26
|
-
import utils from '
|
|
27
|
-
import libs from '
|
|
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
|
-
|
|
23
|
-
import
|
|
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 } =
|
package/src/TemplateData/flowSchema/event/ownTopic/statusFieldComponent/MainFunction/data.js
CHANGED
|
@@ -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
|
-
|
|
23
|
-
import
|
|
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
|
-
|
|
23
|
-
import
|
|
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;
|