@izara_project/izara-market-library-service-schemas 1.0.4 → 1.0.5
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/GenerateCodeLibs/src/Consts.js +11 -5
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +69 -8
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +111 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +132 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +110 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +132 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/mainFunction/data.js +59 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/mainFunction/template.ejs +338 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrApi/data.js +58 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrApi/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrApi/template.ejs +120 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrDsq/data.js +60 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrDsq/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrDsq/template.ejs +167 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrInv/data.js +60 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrInv/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrInv/template.ejs +107 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrSqs/data.js +60 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/HdrSqs/template.ejs +146 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/perAction/request.json +30 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/sns-in-sqs/data.js +80 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/functionYaml/data.js +133 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/functionYaml/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/handler/HdrSqs/data.js +62 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/handler/HdrSqs/template.ejs +125 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/mainFunction/data.js +56 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/mainFunction/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/mainFunction/template.ejs +137 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/sns-in-sqs/data.js +72 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/sns-in-sqs/request.json +0 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/sns-out/data.js +72 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationshipComplete/sns-out/request.json +0 -0
- package/src/TemplateManager/src/GenerateCode.js +63 -18
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrApi/data.js +4 -20
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrDsq/data.js +4 -20
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrInv/data.js +4 -21
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrSqs/data.js +4 -21
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrSqs/template.ejs +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +2 -16
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +3 -17
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +2 -15
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +3 -16
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +0 -15
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +27 -29
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/testParam.json +5 -0
- package/src/TemplateManager/src/ResourceYaml/dynamodb/awaitingMultipleStepData.js +5 -8
- package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +4 -26
- package/src/TemplateManager/src/ResourceYaml/dynamodb/processLogicalAndFindData.js +4 -8
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +2 -5
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/snsAndSqsPerActiondata.js +5 -5
- package/src/TemplateManager/src/ResourceYaml/sns-out/data.js +2 -2
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +6 -22
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/data.js +7 -21
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/data.js +4 -3
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/data.js +10 -13
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/template.ejs +1 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/data.js +6 -5
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +4 -19
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +6 -26
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +6 -21
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +6 -23
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/mainFunction/data.js +3 -18
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/mainFunction/template.ejs +18 -11
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data.js +5 -18
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/data.js +5 -19
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/data.js +7 -18
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +6 -20
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/request.json +3 -4
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/data.js +5 -6
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/sns-out/data.js +4 -4
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +41 -40
- package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +2 -1
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +27 -44
- package/src/TemplateManager/src/libs/Consts.js +42 -4
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrApi/request.json +0 -0
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrApi/template.ejs +0 -0
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrDsq/request.json +0 -0
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrDsq/template.ejs +0 -0
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrInv/example req.js +0 -0
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrInv/request.json +0 -0
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrInv/template.ejs +0 -0
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrSqs/request.json +0 -0
package/package.json
CHANGED
|
@@ -17,19 +17,25 @@ along with this program.If not, see < http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
// constant for updateRelationship
|
|
20
|
+
// constant for updateRelationship and createRelationship
|
|
21
21
|
|
|
22
22
|
const PREFIX = {
|
|
23
|
-
updateRel: "updateRelationshipEndpoint"
|
|
23
|
+
updateRel: "updateRelationshipEndpoint",
|
|
24
|
+
createRel: "createRelationshipEndpoint"
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
const TOPIC_NAME_GRAPH_HANDLER = {
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
inUpdateRel: "InUpdateRelationship",
|
|
29
|
+
inCreateRel: "InCreateRelationshipV2",
|
|
30
|
+
outUpdateRel: "OutUpdateRelationship",
|
|
31
|
+
outCreateRel: "OutCreateRelationship"
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
const TOPIC_NAME_GENERATE_CODE = {
|
|
32
|
-
updateRelComplete: "UpdateRelationshipComplete"
|
|
35
|
+
updateRelComplete: "UpdateRelationshipComplete",
|
|
36
|
+
createRelComplete: "CreateRelationshipComplete",
|
|
37
|
+
outUpdateRelComplete: "OutUpdateRelationshipComplete",
|
|
38
|
+
outCreateRelComplete: "OutCreateRelationshipComplete"
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
|
|
@@ -527,9 +527,9 @@ function collectGetData(_izContext, getDataResult, getDataDetail) {
|
|
|
527
527
|
let collectedData = {};
|
|
528
528
|
|
|
529
529
|
if (getDataDetail.storageType === consts.STORAGE_TYPES.graph) {
|
|
530
|
-
// collect return data form main node
|
|
531
|
-
if (getDataResult.
|
|
532
|
-
for (let [mainFieldName, mainFieldNameValue] of Object.entries(getDataResult.
|
|
530
|
+
// collect return data form main node only form properties
|
|
531
|
+
if (getDataResult.properties) {
|
|
532
|
+
for (let [mainFieldName, mainFieldNameValue] of Object.entries(getDataResult.properties)) {
|
|
533
533
|
if (getDataDetail.fieldNames.includes(mainFieldName)) {
|
|
534
534
|
Object.assign(collectedData, { [mainFieldName]: mainFieldNameValue });
|
|
535
535
|
}
|
|
@@ -538,15 +538,26 @@ function collectGetData(_izContext, getDataResult, getDataDetail) {
|
|
|
538
538
|
|
|
539
539
|
// collect data from versionedData
|
|
540
540
|
if (getDataDetail.hasOwnProperty("versionedDatas") && Object.keys(getDataDetail.versionedDatas).length) {
|
|
541
|
+
_izContext.logger.debug("getDataDetail has versionedData")
|
|
542
|
+
|
|
541
543
|
let versionedDataLabels = Object.keys(getDataDetail.versionedDatas);
|
|
542
544
|
|
|
543
545
|
for (let versionedDataLabel of versionedDataLabels) {
|
|
544
|
-
if (getDataResult[versionedDataLabel]?.nodeProperties && Object.keys(getDataResult[versionedDataLabel].nodeProperties).length) {
|
|
545
|
-
let neededVersionedDataFieldNames = getDataDetail.versionedDatas[versionedDataLabel];
|
|
546
546
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
547
|
+
_izContext.logger.debug(`per versionedData:${versionedDataLabel}`);
|
|
548
|
+
|
|
549
|
+
if (getDataResult.versionedDatas[versionedDataLabel]?.properties
|
|
550
|
+
&& Object.keys(getDataResult.versionedDatas[versionedDataLabel].properties).length
|
|
551
|
+
) {
|
|
552
|
+
|
|
553
|
+
_izContext.logger.debug(`has versionedData result:${versionedDataLabel}`);
|
|
554
|
+
|
|
555
|
+
// let neededVersionedDataFieldNames = Object.keys(getDataDetail.versionedDatas[versionedDataLabel]);
|
|
556
|
+
|
|
557
|
+
for (let neededVersionedDataFieldName of getDataDetail.versionedDatas[versionedDataLabel]) {
|
|
558
|
+
_izContext.logger.debug(`per needed versionedData fieldName:${versionedDataLabel}`);
|
|
559
|
+
if (getDataResult.versionedDatas[versionedDataLabel].properties.hasOwnProperty(neededVersionedDataFieldName)) {
|
|
560
|
+
Object.assign(collectedData, { [neededVersionedDataFieldName]: getDataResult.versionedDatas[versionedDataLabel].properties[neededVersionedDataFieldName] });
|
|
550
561
|
}
|
|
551
562
|
}
|
|
552
563
|
}
|
|
@@ -568,6 +579,56 @@ function collectGetData(_izContext, getDataResult, getDataDetail) {
|
|
|
568
579
|
return collectedData
|
|
569
580
|
}
|
|
570
581
|
|
|
582
|
+
// old
|
|
583
|
+
// function collectGetData(_izContext, getDataResult, getDataDetail) {
|
|
584
|
+
|
|
585
|
+
// if (!getDataResult) {
|
|
586
|
+
// return {};
|
|
587
|
+
// }
|
|
588
|
+
|
|
589
|
+
// let collectedData = {};
|
|
590
|
+
|
|
591
|
+
// if (getDataDetail.storageType === consts.STORAGE_TYPES.graph) {
|
|
592
|
+
// // collect return data form main node
|
|
593
|
+
// if (getDataResult.nodeProperties) {
|
|
594
|
+
// for (let [mainFieldName, mainFieldNameValue] of Object.entries(getDataResult.nodeProperties)) {
|
|
595
|
+
// if (getDataDetail.fieldNames.includes(mainFieldName)) {
|
|
596
|
+
// Object.assign(collectedData, { [mainFieldName]: mainFieldNameValue });
|
|
597
|
+
// }
|
|
598
|
+
// }
|
|
599
|
+
// }
|
|
600
|
+
|
|
601
|
+
// // collect data from versionedData
|
|
602
|
+
// if (getDataDetail.hasOwnProperty("versionedDatas") && Object.keys(getDataDetail.versionedDatas).length) {
|
|
603
|
+
// let versionedDataLabels = Object.keys(getDataDetail.versionedDatas);
|
|
604
|
+
|
|
605
|
+
// for (let versionedDataLabel of versionedDataLabels) {
|
|
606
|
+
// if (getDataResult[versionedDataLabel]?.nodeProperties && Object.keys(getDataResult[versionedDataLabel].nodeProperties).length) {
|
|
607
|
+
// let neededVersionedDataFieldNames = getDataDetail.versionedDatas[versionedDataLabel];
|
|
608
|
+
|
|
609
|
+
// for (let neededVersionedDataFieldName of neededVersionedDataFieldNames) {
|
|
610
|
+
// if (getDataResult[versionedDataLabel].nodeProperties[neededVersionedDataFieldName]) {
|
|
611
|
+
// Object.assign(collectedData, { [neededVersionedDataFieldName]: getDataResult[versionedDataLabel].nodeProperties[neededVersionedDataFieldName] });
|
|
612
|
+
// }
|
|
613
|
+
// }
|
|
614
|
+
// }
|
|
615
|
+
// }
|
|
616
|
+
// }
|
|
617
|
+
|
|
618
|
+
// } else if (getDataDetail.storageType === consts.STORAGE_TYPES.dynamoDB) {
|
|
619
|
+
|
|
620
|
+
// for (let [dynamoDbKey, dynamoDbValue] of Object.entries(getDataResult)) {
|
|
621
|
+
// if (getDataDetail.fieldNames.includes(dynamoDbKey)) {
|
|
622
|
+
// Object.assign(collectedData, { [dynamoDbKey]: dynamoDbValue });
|
|
623
|
+
// }
|
|
624
|
+
// }
|
|
625
|
+
|
|
626
|
+
// } else {
|
|
627
|
+
// throw new NoRetryError(`Unhandled storageType:${getDataDetail.storageType}`);
|
|
628
|
+
// }
|
|
629
|
+
|
|
630
|
+
// return collectedData
|
|
631
|
+
// }
|
|
571
632
|
|
|
572
633
|
|
|
573
634
|
|
package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
|
+
|
|
29
|
+
function defaultIamRolePerAction() {
|
|
30
|
+
|
|
31
|
+
let defaultIamRole = [];
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
defaultIamRole.push(
|
|
35
|
+
createIamRole(
|
|
36
|
+
{
|
|
37
|
+
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
38
|
+
},
|
|
39
|
+
[
|
|
40
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
41
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
42
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json"),
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
defaultIamRole.push(
|
|
48
|
+
createIamRole(
|
|
49
|
+
{ [RESOURCE_CLASSES.s3]: ["ListBucket"] },
|
|
50
|
+
[
|
|
51
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema"),
|
|
52
|
+
]
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return defaultIamRole
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* receive objectSchema
|
|
61
|
+
* create data for updateRelationshipSchema
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} objectSchema
|
|
64
|
+
* @return {{ templatePath, templateData, setting } }
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
function data(_izContext, srcPath) {
|
|
68
|
+
let createSourceArray = [];
|
|
69
|
+
|
|
70
|
+
const createSourceParam = createParamForCreateSource(srcPath);
|
|
71
|
+
createSourceArray.push(createSourceParam);
|
|
72
|
+
// console.log("createSourceArrayInUpdaterelationShipSchemahdrSqs", createSourceArray)
|
|
73
|
+
return createSourceArray
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
function createParamForCreateSource(srcPath) {
|
|
78
|
+
|
|
79
|
+
let handlerType = HANDLER.hdrApi
|
|
80
|
+
let functionName = FUNCTION_NAME.createRel
|
|
81
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
82
|
+
|
|
83
|
+
additionalResourcePermission.push(
|
|
84
|
+
createIamRole(
|
|
85
|
+
{ [RESOURCE_CLASSES.dynamoDbTable]: ["PutItem"] },
|
|
86
|
+
[
|
|
87
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleSteps"),
|
|
88
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleStepByPending")
|
|
89
|
+
]
|
|
90
|
+
))
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
templatePath: templatePath,
|
|
95
|
+
templateData: {
|
|
96
|
+
functionName,
|
|
97
|
+
handlerType,
|
|
98
|
+
additionalResourcePermission,
|
|
99
|
+
resourceLocation: SOURCE_PATH.resourceLocationUpdateRelationshipSchema
|
|
100
|
+
},
|
|
101
|
+
setting: {
|
|
102
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
103
|
+
saveFileName: SAVE_FILE_NAME.functionRelationshipYaml,
|
|
104
|
+
fileExtension: '.yml',
|
|
105
|
+
isAppend: true
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
module.exports = data;
|
package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, '../../../../PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs')
|
|
28
|
+
|
|
29
|
+
function defaultIamRolePerAction() {
|
|
30
|
+
|
|
31
|
+
let defaultIamRole = [];
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
defaultIamRole.push(
|
|
35
|
+
createIamRole(
|
|
36
|
+
{
|
|
37
|
+
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
38
|
+
},
|
|
39
|
+
[
|
|
40
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
41
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
42
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json"),
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
defaultIamRole.push(
|
|
48
|
+
createIamRole(
|
|
49
|
+
{ [RESOURCE_CLASSES.s3]: ["ListBucket"] },
|
|
50
|
+
[
|
|
51
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema"),
|
|
52
|
+
]
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return defaultIamRole
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* receive objectSchema
|
|
61
|
+
* create data for updateRelationshipSchema
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} objectSchema
|
|
64
|
+
* @return {{ templatePath, templateData, setting } }
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
function data(_izContext, srcPath) {
|
|
68
|
+
let createSourceArray = [];
|
|
69
|
+
|
|
70
|
+
const createSourceParam = createParamForCreateSource(srcPath);
|
|
71
|
+
createSourceArray.push(createSourceParam);
|
|
72
|
+
// console.log("createSourceArrayInUpdaterelationShipSchemahdrSqs", createSourceArray)
|
|
73
|
+
return createSourceArray
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
function createParamForCreateSource(srcPath) {
|
|
78
|
+
|
|
79
|
+
let handlerType = HANDLER.hdrDsq
|
|
80
|
+
let functionName = FUNCTION_NAME.createRel
|
|
81
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
82
|
+
|
|
83
|
+
additionalResourcePermission.push(
|
|
84
|
+
// createIamRole(
|
|
85
|
+
// { [RESOURCE_CLASSES.lambda]: ["InvokeFunction"] },
|
|
86
|
+
// [resourceNames(RESOURCE_CLASSES.lambda, "*GetNodeHdrInv")]),
|
|
87
|
+
createIamRole(
|
|
88
|
+
{
|
|
89
|
+
[RESOURCE_CLASSES.sqs]: [
|
|
90
|
+
SQS_RESOURCE.deleteMessage,
|
|
91
|
+
SQS_RESOURCE.getQueueAttributes,
|
|
92
|
+
SQS_RESOURCE.receiveMessage,
|
|
93
|
+
SQS_RESOURCE.sendMessage,
|
|
94
|
+
SQS_RESOURCE.deleteMessageBatch,
|
|
95
|
+
SQS_RESOURCE.getQueueUrl
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
[
|
|
99
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
100
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ")
|
|
101
|
+
]
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
additionalResourcePermission.push(
|
|
106
|
+
createIamRole(
|
|
107
|
+
{ [RESOURCE_CLASSES.dynamoDbTable]: ["PutItem"] },
|
|
108
|
+
[
|
|
109
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleSteps"),
|
|
110
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleStepByPending")
|
|
111
|
+
]
|
|
112
|
+
))
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
templatePath: templatePath,
|
|
116
|
+
templateData: {
|
|
117
|
+
functionName,
|
|
118
|
+
handlerType,
|
|
119
|
+
additionalResourcePermission,
|
|
120
|
+
resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction
|
|
121
|
+
},
|
|
122
|
+
setting: {
|
|
123
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
124
|
+
saveFileName: SAVE_FILE_NAME.functionRelationshipYaml,
|
|
125
|
+
fileExtension: '.yml',
|
|
126
|
+
isAppend: true
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
module.exports = data;
|
package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, '../../../../PerActionEndpoint/FunctionYaml/HdrInv/template.ejs')
|
|
28
|
+
|
|
29
|
+
function defaultIamRolePerAction() {
|
|
30
|
+
|
|
31
|
+
let defaultIamRole = [];
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
defaultIamRole.push(
|
|
35
|
+
createIamRole(
|
|
36
|
+
{
|
|
37
|
+
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
38
|
+
},
|
|
39
|
+
[
|
|
40
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
41
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
42
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json"),
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
defaultIamRole.push(
|
|
48
|
+
createIamRole(
|
|
49
|
+
{ [RESOURCE_CLASSES.s3]: ["ListBucket"] },
|
|
50
|
+
[
|
|
51
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema"),
|
|
52
|
+
]
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return defaultIamRole
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* receive objectSchema
|
|
61
|
+
* create data for updateRelationshipSchema
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} objectSchema
|
|
64
|
+
* @return {{ templatePath, templateData, setting } }
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
function data(_izContext, srcPath) {
|
|
68
|
+
let createSourceArray = [];
|
|
69
|
+
|
|
70
|
+
const createSourceParam = createParamForCreateSource(srcPath);
|
|
71
|
+
createSourceArray.push(createSourceParam);
|
|
72
|
+
// console.log("createSourceArrayInUpdaterelationShipSchemahdrSqs", createSourceArray)
|
|
73
|
+
return createSourceArray
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
function createParamForCreateSource(srcPath) {
|
|
78
|
+
|
|
79
|
+
let handlerType = HANDLER.hdrInv
|
|
80
|
+
let functionName = FUNCTION_NAME.createRel
|
|
81
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
82
|
+
|
|
83
|
+
additionalResourcePermission.push(
|
|
84
|
+
createIamRole(
|
|
85
|
+
{ [RESOURCE_CLASSES.dynamoDbTable]: ["PutItem"] },
|
|
86
|
+
[
|
|
87
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleSteps"),
|
|
88
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleStepByPending")
|
|
89
|
+
]
|
|
90
|
+
))
|
|
91
|
+
return {
|
|
92
|
+
templatePath: templatePath,
|
|
93
|
+
templateData: {
|
|
94
|
+
functionName,
|
|
95
|
+
handlerType,
|
|
96
|
+
additionalResourcePermission,
|
|
97
|
+
resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction
|
|
98
|
+
},
|
|
99
|
+
setting: {
|
|
100
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
101
|
+
saveFileName: SAVE_FILE_NAME.functionRelationshipYaml,
|
|
102
|
+
fileExtension: '.yml',
|
|
103
|
+
isAppend: true
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
module.exports = data;
|
package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, '../../../../PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs')
|
|
28
|
+
|
|
29
|
+
function defaultIamRolePerAction() {
|
|
30
|
+
|
|
31
|
+
let defaultIamRole = [];
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
defaultIamRole.push(
|
|
35
|
+
createIamRole(
|
|
36
|
+
{
|
|
37
|
+
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
38
|
+
},
|
|
39
|
+
[
|
|
40
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
41
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
42
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json"),
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
defaultIamRole.push(
|
|
48
|
+
createIamRole(
|
|
49
|
+
{ [RESOURCE_CLASSES.s3]: ["ListBucket"] },
|
|
50
|
+
[
|
|
51
|
+
resourceNames(RESOURCE_CLASSES.s3, "object-schema"),
|
|
52
|
+
]
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return defaultIamRole
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* receive objectSchema
|
|
61
|
+
* create data for updateRelationshipSchema
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} objectSchema
|
|
64
|
+
* @return {{ templatePath, templateData, setting } }
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
function data(_izContext, srcPath) {
|
|
68
|
+
let createSourceArray = [];
|
|
69
|
+
const createSourceParam = createParamForCreateSource(srcPath);
|
|
70
|
+
createSourceArray.push(createSourceParam);
|
|
71
|
+
// console.log("createSourceArrayInUpdaterelationShipSchemahdrSqs", createSourceArray)
|
|
72
|
+
return createSourceArray
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
function createParamForCreateSource(srcPath) {
|
|
77
|
+
|
|
78
|
+
let handlerType = HANDLER.hdrSqs
|
|
79
|
+
let functionName = FUNCTION_NAME.createRel
|
|
80
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
81
|
+
|
|
82
|
+
additionalResourcePermission.push(
|
|
83
|
+
// createIamRole(
|
|
84
|
+
// { [RESOURCE_CLASSES.lambda]: ["InvokeFunction"] },
|
|
85
|
+
// [resourceNames(RESOURCE_CLASSES.lambda, "*GetNodeHdrInv")]),
|
|
86
|
+
createIamRole(
|
|
87
|
+
{
|
|
88
|
+
[RESOURCE_CLASSES.sqs]: [
|
|
89
|
+
SQS_RESOURCE.deleteMessage,
|
|
90
|
+
SQS_RESOURCE.getQueueAttributes,
|
|
91
|
+
SQS_RESOURCE.receiveMessage,
|
|
92
|
+
SQS_RESOURCE.sendMessage,
|
|
93
|
+
SQS_RESOURCE.getQueueUrl,
|
|
94
|
+
SQS_RESOURCE.deleteMessageBatch
|
|
95
|
+
], [RESOURCE_CLASSES.sns]:
|
|
96
|
+
["Publish", "Subscribe"]
|
|
97
|
+
},
|
|
98
|
+
[
|
|
99
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
100
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
101
|
+
resourceNames(RESOURCE_CLASSES.sns, "In" + upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
102
|
+
resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(functionName) + upperCase(HANDLER.hdrSqs))
|
|
103
|
+
]
|
|
104
|
+
),
|
|
105
|
+
)
|
|
106
|
+
additionalResourcePermission.push(
|
|
107
|
+
createIamRole(
|
|
108
|
+
{ [RESOURCE_CLASSES.dynamoDbTable]: ["PutItem"] },
|
|
109
|
+
[
|
|
110
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleSteps"),
|
|
111
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleStepByPending")
|
|
112
|
+
]
|
|
113
|
+
))
|
|
114
|
+
return {
|
|
115
|
+
templatePath: templatePath,
|
|
116
|
+
templateData: {
|
|
117
|
+
functionName,
|
|
118
|
+
handlerType,
|
|
119
|
+
additionalResourcePermission,
|
|
120
|
+
resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction
|
|
121
|
+
},
|
|
122
|
+
setting: {
|
|
123
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
124
|
+
saveFileName: SAVE_FILE_NAME.functionRelationshipYaml,
|
|
125
|
+
fileExtension: '.yml',
|
|
126
|
+
isAppend: true
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
module.exports = data;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
const { createGetDataDetails } = require('../../../../../GenerateCodeLibs/src/GenerateCodeLibs')
|
|
24
|
+
|
|
25
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
|
|
26
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../../../libs/Consts");
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* receive objectSchema
|
|
33
|
+
* create data for hdrInv template
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} objectSchema
|
|
36
|
+
* @return {{ templatePath, templateData, setting } }
|
|
37
|
+
*/
|
|
38
|
+
function data(_izContext, srcPath) {
|
|
39
|
+
const createSourceParams = createParamForCreateSource(srcPath)
|
|
40
|
+
return [createSourceParams];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
function createParamForCreateSource(srcPath) {
|
|
45
|
+
return {
|
|
46
|
+
templatePath: templatePath,
|
|
47
|
+
templateData: {
|
|
48
|
+
},
|
|
49
|
+
setting: {
|
|
50
|
+
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
51
|
+
saveFileName: `CreateRelationship_Main`,
|
|
52
|
+
fileExtension: '.js',
|
|
53
|
+
isAppend: false
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
module.exports = data;
|