@izara_project/izara-market-library-service-schemas 1.0.4 → 1.0.6
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 +2 -2
- package/src/GenerateCodeLibs/index.js +2 -1
- package/src/GenerateCodeLibs/src/Consts.js +20 -5
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +298 -12
- package/src/GenerateCodeLibs/src/TranslateIdsLibs.js +89 -0
- package/src/MainLibs/src/Utils.js +10 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +119 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +133 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +120 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +133 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/mainFunction/data.js +59 -0
- package/src/TemplateManager/src/CreateRelationship/createRelationship/mainFunction/template.ejs +340 -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 +59 -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 +78 -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 +61 -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/FindData/FindDataYaml/data.js +188 -0
- package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +27 -0
- package/src/TemplateManager/src/FindData/GetByStorage/getByDynamo.ejs +53 -0
- package/src/TemplateManager/src/FindData/GetByStorage/getByGraph.ejs +99 -0
- package/src/TemplateManager/src/FindData/Handler/data.js +48 -0
- package/src/TemplateManager/src/FindData/Handler/template.ejs +140 -0
- package/src/TemplateManager/src/FindData/mainFunction/data.js +279 -0
- package/src/TemplateManager/src/FindData/mainFunction/template.ejs +155 -0
- package/src/TemplateManager/src/GenerateCode(Old).js +1 -1
- package/src/TemplateManager/src/GenerateCode.js +205 -45
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +98 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/createObjectComplete_main.js +172 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/data.js +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/data.js +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/data.js +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/template.ejs +0 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +98 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +59 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/template.ejs +129 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/data.js +53 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +126 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sns-out/data.js +62 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sqs-in-sns/data.js +58 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sqs-in-sns/template.ejs +47 -0
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrApi/data.js +24 -20
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrApi/template.ejs +2 -2
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrDsq/data.js +27 -20
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrInv/data.js +54 -22
- package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrSqs/data.js +28 -23
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +30 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +6 -22
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/getTemplate.ejs +76 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/updateTemplate.ejs +67 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +47 -37
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/getTemplate.ejs +105 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/updateTemplate.ejs +109 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/createTemplate.ejs +75 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +68 -33
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/getTemplate.ejs +82 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/updateTemplate.ejs +75 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +46 -30
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/getTemplate.ejs +124 -0
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/updateTemplate.ejs +133 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/CreateObject_main.js +760 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/data.js +67 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/request.json +0 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +581 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +0 -21
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +34 -31
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/testParam.json +5 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/data.js +61 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/request.json +0 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +267 -0
- package/src/TemplateManager/src/ProcessLogical/Handler/data.js +49 -0
- package/src/TemplateManager/src/ProcessLogical/Handler/template.ejs +129 -0
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +175 -0
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +25 -0
- package/src/TemplateManager/src/ProcessLogical/mainFunction/data.js +47 -0
- package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +421 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/DsqYaml/data.js +50 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/DsqYaml/template.ejs +32 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +167 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +25 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +169 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +25 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/data.js +48 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/template.ejs +163 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/data.js +48 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/template.ejs +146 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/data.js +48 -0
- package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/template.ejs +212 -0
- package/src/TemplateManager/src/ResourceYaml/CreateSourceData.js +2 -2
- 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 +6 -10
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +28 -16
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/snsAndSqsPerActiondata.js +5 -5
- package/src/TemplateManager/src/ResourceYaml/sns-out/data.js +3 -3
- package/src/TemplateManager/src/ResourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +75 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +95 -0
- package/src/TemplateManager/src/{FunctionYaml/HdrSqs → TranslateIdReq/ProcessingTranslateIds/functionYaml}/template.ejs +1 -1
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js +52 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/template.ejs +194 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/data.js +48 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs +330 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sns-out/data.js +47 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sqs-sns/data.js +58 -0
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/sqs-sns/template.ejs +43 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +116 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +116 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/data.js +60 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +157 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/data.js +59 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/template.ejs +175 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/data.js +61 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/template.ejs +155 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/resourceYaml/dynamoDb/data.js +120 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/resourceYaml/sns-sqs/data.js +75 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +8 -24
- 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 +13 -21
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +11 -29
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +16 -21
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +12 -27
- 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 +181 -59
- package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +17 -15
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +56 -44
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/template.ejs +3 -4
- package/src/TemplateManager/src/libs/Consts.js +162 -13
- package/src/TemplateManager/src/PerActionEndpoint/Handler/testRequest.json +0 -5
- /package/src/TemplateManager/src/{FunctionYaml → PerActionEndpoint/FunctionYaml}/HdrApi/request.json +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
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
|
|
20
|
+
const izaraShared = require("@izara_project/izara-shared");
|
|
21
|
+
const configSharedLib = izaraShared.configSharedLib;
|
|
22
|
+
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
23
|
+
const lambdaSharedLib = izaraShared.lambdaSharedLib;
|
|
24
|
+
const graphSharedLib = izaraShared.graphSharedLib;
|
|
25
|
+
const sqsSharedLib = izaraShared.sqsSharedLib;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const externalRequest = require('@izara_project/izara-core-library-external-request')
|
|
29
|
+
const translateIdsSharedLib = require('@izara_project/izara-translateids/src/TranslateIdsLib');
|
|
30
|
+
const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
|
|
31
|
+
const lambda = require('@izara_project/izara-core-library-external-request/src/resources/Lambda');
|
|
32
|
+
const serviceSchemas = require("@izara_project/izara-core-library-service-schemas");
|
|
33
|
+
const identifiersObject = require('@izara_project/izara-core-library-service-schemas/src/IdentifiersObject');
|
|
34
|
+
const getObjectSchema = require("@izara_project/izara-core-library-service-schemas/src/GetObjectSchema");
|
|
35
|
+
const sqs = externalRequest.sqs
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* translate ids from one object to another related object
|
|
40
|
+
* @param {Object} _izContext
|
|
41
|
+
* @param {object} fromObjType - the type of object we are translating ids from
|
|
42
|
+
* @param {string} concatinateIdentifier
|
|
43
|
+
* @param {string} fromTypeId - the type of object we are translating ids from
|
|
44
|
+
* @param {string} fromTable - table name
|
|
45
|
+
* @param {string} fromPartitionKeyId - partition key value
|
|
46
|
+
* @param {string} fromPartitionKeyFieldName - partition key field/attribute name
|
|
47
|
+
* @param {string} fromDataFieldName - data field/attribute name
|
|
48
|
+
* @param {object} toObjType - the type of object we are translating ids to
|
|
49
|
+
* @param {string} toTypeId - the type of object we are translating ids to
|
|
50
|
+
* @param {Object} [additionalData={}] - additional data to send back in completed message
|
|
51
|
+
* @param {Object} [startKey={}] - first invoke will be empty
|
|
52
|
+
* @param {Nummic} invocationCount
|
|
53
|
+
* @param {string[]} passOnStatus
|
|
54
|
+
* @param {string[]} passOnErrorsFound
|
|
55
|
+
* @param {string} callingFlow
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
module.exports.translateIdsRequest = async (
|
|
59
|
+
_izContext,
|
|
60
|
+
fromObjType,
|
|
61
|
+
fromTypeId,
|
|
62
|
+
concatinateIdentifier,
|
|
63
|
+
fromTable,
|
|
64
|
+
fromPartitionKeyId,
|
|
65
|
+
fromPartitionKeyFieldName,
|
|
66
|
+
fromDataFieldName,
|
|
67
|
+
toObjType,
|
|
68
|
+
toTypeId,
|
|
69
|
+
relType,
|
|
70
|
+
// startKey ,
|
|
71
|
+
// invocationCount,
|
|
72
|
+
// passOnStatus,
|
|
73
|
+
// passOnErrorsFound,
|
|
74
|
+
callingFlow = "",
|
|
75
|
+
) => {
|
|
76
|
+
// translateIds request to change from propertyIds to mediaLinkIds.
|
|
77
|
+
// MediaLinkProperty: filter dataId is propertyIds
|
|
78
|
+
// MediaLinkPropertyTranslation: filter dataId is propertyIds
|
|
79
|
+
// translate 2 time , propertyIds from MediaLinkProperty and propertyIds from MediaLinkPropertyTranslation
|
|
80
|
+
try {
|
|
81
|
+
_izContext.logger.debug("=== Function:TranslateIdsRequest ===", {
|
|
82
|
+
fromObjType: fromObjType,
|
|
83
|
+
fromTypeId: fromTypeId,
|
|
84
|
+
concatinateIdentifier: concatinateIdentifier,
|
|
85
|
+
fromTable: fromTable,
|
|
86
|
+
fromPartitionKeyId: fromPartitionKeyId,
|
|
87
|
+
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
88
|
+
fromDataFieldName: fromDataFieldName,
|
|
89
|
+
toObjType: toObjType,
|
|
90
|
+
toTypeId: toTypeId,
|
|
91
|
+
relType: relType,
|
|
92
|
+
|
|
93
|
+
callingFlow: callingFlow
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
receive params
|
|
98
|
+
check main cache for all param that send in
|
|
99
|
+
use concatinateIdentifier to check cache
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
//check cache per filterMain
|
|
103
|
+
let [translateIdsCacheMainStatus, translateIdsCacheId, translateIdsCacheMain] = await translateIdsSharedLib.translateIdsCheckCacheMain(
|
|
104
|
+
_izContext,
|
|
105
|
+
fromObjType,
|
|
106
|
+
concatinateIdentifier,
|
|
107
|
+
fromTable,
|
|
108
|
+
fromPartitionKeyId,
|
|
109
|
+
fromPartitionKeyFieldName,
|
|
110
|
+
fromDataFieldName,
|
|
111
|
+
toObjType,
|
|
112
|
+
relType,
|
|
113
|
+
callingFlow
|
|
114
|
+
);
|
|
115
|
+
_izContext.logger.debug("After translateIdsCheckCache main status:", {
|
|
116
|
+
translateIdsCacheMainStatus: translateIdsCacheMainStatus,
|
|
117
|
+
translateIdsCacheId: translateIdsCacheId,
|
|
118
|
+
translateIdsCacheMain: translateIdsCacheMain
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
if (translateIdsCacheMainStatus !== "process") {
|
|
122
|
+
return;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
let sendMessageToProcessingTranslateIdsHdrDsq = {
|
|
126
|
+
MessageBody: JSON.stringify({
|
|
127
|
+
fromObjType: fromObjType,
|
|
128
|
+
fromTypeId: fromTypeId,
|
|
129
|
+
concatinateIdentifier: concatinateIdentifier,
|
|
130
|
+
fromTable: fromTable,
|
|
131
|
+
fromPartitionKeyId: fromPartitionKeyId,
|
|
132
|
+
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
133
|
+
fromDataFieldName: fromDataFieldName,
|
|
134
|
+
toObjType: toObjType,
|
|
135
|
+
toTypeId: toTypeId,
|
|
136
|
+
relType: relType,
|
|
137
|
+
invocationCount: 1,
|
|
138
|
+
translateIdsCacheId: translateIdsCacheId,
|
|
139
|
+
uniqueRequestId: translateIdsCacheMain.cacheUniqueRequestId,
|
|
140
|
+
callingFlow: callingFlow,
|
|
141
|
+
}),
|
|
142
|
+
QueueUrl: await sqsSharedLib.sqsQueueUrl(_izContext, "ProcessTranslateIdsHdrDsq")
|
|
143
|
+
}
|
|
144
|
+
await sqs.sendMessage(_izContext, sendMessageToProcessingTranslateIdsHdrDsq).promise();
|
|
145
|
+
|
|
146
|
+
_izContext.logger.debug("sendMessageToProcessingTranslateIdsHdrDsq", sendMessageToProcessingTranslateIdsHdrDsq)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
return "success"
|
|
150
|
+
|
|
151
|
+
} catch (err) {
|
|
152
|
+
_izContext.logger.error('error TranslateIdsRequest: ', err)
|
|
153
|
+
throw (err)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
|
|
20
|
+
const path = require("path")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// const {
|
|
24
|
+
// HANDLER,
|
|
25
|
+
// STORAGE_TYPES
|
|
26
|
+
// } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
27
|
+
|
|
28
|
+
const STORAGE_TYPES = {
|
|
29
|
+
dynamoDB: "dynamoDB",
|
|
30
|
+
graph: "graph"
|
|
31
|
+
}
|
|
32
|
+
const templatePath = path.join(__dirname, '../../../../ResourceYaml/dynamodb/template.ejs')
|
|
33
|
+
const { SOURCE_PATH, SAVE_FILE_NAME } = require('../../../../libs/Consts');
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* create param of crateSouce for FindData And processLogical
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} _izContext
|
|
39
|
+
* @param {String} srcPath
|
|
40
|
+
* @returns {Object[]}
|
|
41
|
+
*/
|
|
42
|
+
const createAwaitingMultipleStepDynamoDbData = (_izContext, srcPath) => {
|
|
43
|
+
|
|
44
|
+
let resultsForCreateSource = [];
|
|
45
|
+
|
|
46
|
+
const TranslateIdsTables =
|
|
47
|
+
[
|
|
48
|
+
{
|
|
49
|
+
tableName: "TranslateIdsCacheMain",
|
|
50
|
+
attributes:
|
|
51
|
+
[
|
|
52
|
+
{
|
|
53
|
+
keyType: "partitionKey",
|
|
54
|
+
AttributeName: "translateIdsCacheId",
|
|
55
|
+
AttributeType: "S"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
tableName: "TranslateIdsCacheFromIdMain",
|
|
61
|
+
attributes:
|
|
62
|
+
[
|
|
63
|
+
{
|
|
64
|
+
keyType: "partitionKey",
|
|
65
|
+
AttributeName: "translateIdsCacheFromId",
|
|
66
|
+
AttributeType: "S"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
tableName: "TranslateIdsCacheFromIdData",
|
|
72
|
+
attributes:
|
|
73
|
+
[
|
|
74
|
+
{
|
|
75
|
+
keyType: "partitionKey",
|
|
76
|
+
AttributeName: "translateIdsCacheFromId",
|
|
77
|
+
AttributeType: "S"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
keyType: "sortKey",
|
|
81
|
+
AttributeName: "toDataId",
|
|
82
|
+
AttributeType: "S"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
tableName: "TranslateIdsCacheData",
|
|
88
|
+
attributes:
|
|
89
|
+
[
|
|
90
|
+
{
|
|
91
|
+
keyType: "partitionKey",
|
|
92
|
+
AttributeName: "translateIdsCacheId",
|
|
93
|
+
AttributeType: "S"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
keyType: "sortKey",
|
|
97
|
+
AttributeName: "toDataId",
|
|
98
|
+
AttributeType: "S"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
for (let TranslateIdsTable of TranslateIdsTables) {
|
|
105
|
+
resultsForCreateSource.push({
|
|
106
|
+
templatePath: templatePath,
|
|
107
|
+
templateData: TranslateIdsTable,
|
|
108
|
+
setting: {
|
|
109
|
+
initialData: 'Resources:\n',
|
|
110
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
111
|
+
saveFileName: SAVE_FILE_NAME.dynamoDbYaml,
|
|
112
|
+
fileExtension: '.yml',
|
|
113
|
+
isAppend: true
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return resultsForCreateSource;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
module.exports = createAwaitingMultipleStepDynamoDbData
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
|
|
20
|
+
const path = require("path")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
HANDLER,
|
|
25
|
+
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
26
|
+
|
|
27
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
28
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
29
|
+
const snsTemplatePath = path.join(__dirname, "../../../../ResourceYaml/sns-in-sqs/snsTemplate.ejs")
|
|
30
|
+
const sqsTemplatePath = path.join(__dirname, "../../../../ResourceYaml/sns-in-sqs/sqsTemplate.ejs")
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* create data for sns and sqs template
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
function data(_izContext, srcPath) {
|
|
37
|
+
let resultForCreateTranslateIdsQueueName = [];
|
|
38
|
+
const setting = {
|
|
39
|
+
initialSetup: "Resources\n",
|
|
40
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
41
|
+
saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
|
|
42
|
+
fileExtension: ".yml",
|
|
43
|
+
isAppend: true
|
|
44
|
+
}
|
|
45
|
+
const createTranslateIdsQueueNames = [
|
|
46
|
+
{
|
|
47
|
+
queueName: upperCase(FUNCTION_NAME.translateId)
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
queueName: upperCase(FUNCTION_NAME.translateId) + upperCase(HANDLER.hdrDsq)
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
for (let createTranslateIdsQueueName of createTranslateIdsQueueNames) {
|
|
54
|
+
if (createTranslateIdsQueueName.queueName.includes("HdrDsq")) {
|
|
55
|
+
resultForCreateTranslateIdsQueueName.push(
|
|
56
|
+
{
|
|
57
|
+
templatePath: sqsTemplatePath,
|
|
58
|
+
templateData: createTranslateIdsQueueName,
|
|
59
|
+
setting: setting
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
} else {
|
|
63
|
+
resultForCreateTranslateIdsQueueName.push(
|
|
64
|
+
{
|
|
65
|
+
templatePath: snsTemplatePath,
|
|
66
|
+
templateData: createTranslateIdsQueueName,
|
|
67
|
+
setting: setting
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return resultForCreateTranslateIdsQueueName
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
module.exports = data;
|
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
24
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 } = require("../../../libs/Consts");
|
|
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
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
28
|
|
|
@@ -75,14 +75,12 @@ function data(_izContext, srcPath) {
|
|
|
75
75
|
|
|
76
76
|
function createParamForCreateSource(srcPath) {
|
|
77
77
|
let awaitingTable = ["AwaitingMultipleSteps", "AwaitingMultipleStepByPending"]
|
|
78
|
-
let handlerType =
|
|
79
|
-
let functionName =
|
|
78
|
+
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
79
|
+
let functionName = FUNCTION_NAME.updateRelComplete
|
|
80
80
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
81
81
|
|
|
82
82
|
additionalResourcePermission.push(
|
|
83
|
-
|
|
84
|
-
// { [RESOURCE_CLASSES.lambda]: ["InvokeFunction"] },
|
|
85
|
-
// [resourceNames(RESOURCE_CLASSES.lambda, "*GetNodeHdrInv")]),
|
|
83
|
+
|
|
86
84
|
createIamRole(
|
|
87
85
|
{
|
|
88
86
|
[RESOURCE_CLASSES.sqs]: [
|
|
@@ -98,8 +96,8 @@ function createParamForCreateSource(srcPath) {
|
|
|
98
96
|
]
|
|
99
97
|
},
|
|
100
98
|
[
|
|
101
|
-
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName)
|
|
102
|
-
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName)
|
|
99
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName)),
|
|
100
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName)),
|
|
103
101
|
resourceNames(RESOURCE_CLASSES.sns, "In" + upperCase(functionName)),
|
|
104
102
|
resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(functionName))
|
|
105
103
|
],
|
|
@@ -120,11 +118,11 @@ function createParamForCreateSource(srcPath) {
|
|
|
120
118
|
functionName,
|
|
121
119
|
handlerType,
|
|
122
120
|
additionalResourcePermission,
|
|
123
|
-
resourceLocation: SOURCE_PATH.
|
|
121
|
+
resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction
|
|
124
122
|
},
|
|
125
123
|
setting: {
|
|
126
124
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
127
|
-
saveFileName:
|
|
125
|
+
saveFileName: SAVE_FILE_NAME.functionRelationshipYaml,
|
|
128
126
|
fileExtension: '.yml',
|
|
129
127
|
isAppend: true
|
|
130
128
|
}
|
|
@@ -134,18 +132,4 @@ function createParamForCreateSource(srcPath) {
|
|
|
134
132
|
|
|
135
133
|
|
|
136
134
|
|
|
137
|
-
// [
|
|
138
|
-
// {
|
|
139
|
-
// templatePath: '/home/toughnut/BasProgram/empty-service-template/app/node_modules/@izara_project/izara-market-library-service-schemas/src/TemplateManager/src/MainResourcesYaml/TemplateAndData/DynamoDbMain/Template/DynamoDb.ejs',
|
|
140
|
-
// templateData: { tableName: 'ObjectTypeSingle', attributes: [Array] },
|
|
141
|
-
// setting: {
|
|
142
|
-
// savePath: '/generatedCode/source/',
|
|
143
|
-
// saveFileName: 'ObjectTypeGet',
|
|
144
|
-
// fileExtension: '.js',
|
|
145
|
-
// isAppend: false
|
|
146
|
-
// }
|
|
147
|
-
// }
|
|
148
|
-
// ]
|
|
149
|
-
|
|
150
|
-
|
|
151
135
|
module.exports = data;
|
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
24
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
28
|
|
|
@@ -39,19 +39,19 @@ function data(_izContext, srcPath) {
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
function createParamForCreateSource(srcPath) {
|
|
42
|
-
const functionName =
|
|
43
|
-
const
|
|
42
|
+
const functionName = FUNCTION_NAME.updateRelComplete;
|
|
43
|
+
const handler = HANDLER.hdrSqs
|
|
44
|
+
|
|
44
45
|
return {
|
|
45
46
|
templatePath: templatePath,
|
|
46
47
|
templateData: {
|
|
47
48
|
functionName: upperCase(functionName),
|
|
48
|
-
|
|
49
|
-
queueName: upperCase(functionName) + "HdrSqs",
|
|
49
|
+
queueName: upperCase(functionName) + upperCase(handler),
|
|
50
50
|
isCreateMainFunction: false
|
|
51
51
|
},
|
|
52
52
|
setting: {
|
|
53
|
-
savePath: path.join(srcPath, SOURCE_PATH.
|
|
54
|
-
saveFileName: `${upperCase(functionName)}
|
|
53
|
+
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
54
|
+
saveFileName: `${upperCase(functionName)}_${upperCase(handler)}`,
|
|
55
55
|
fileExtension: '.js',
|
|
56
56
|
isAppend: false
|
|
57
57
|
}
|
|
@@ -59,18 +59,4 @@ function createParamForCreateSource(srcPath) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
// [
|
|
63
|
-
// {
|
|
64
|
-
// templatePath: '/home/toughnut/BasProgram/empty-service-template/app/node_modules/@izara_project/izara-market-library-service-schemas/src/TemplateManager/src/MainResourcesYaml/TemplateAndData/DynamoDbMain/Template/DynamoDb.ejs',
|
|
65
|
-
// templateData: { tableName: 'ObjectTypeSingle', attributes: [Array] },
|
|
66
|
-
// setting: {
|
|
67
|
-
// savePath: '/generatedCode/source/',
|
|
68
|
-
// saveFileName: 'ObjectTypeGet',
|
|
69
|
-
// fileExtension: '.js',
|
|
70
|
-
// isAppend: false
|
|
71
|
-
// }
|
|
72
|
-
// }
|
|
73
|
-
// ]
|
|
74
|
-
|
|
75
|
-
|
|
76
62
|
module.exports = data;
|
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
24
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
|
|
25
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME } = require("../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
28
|
|
|
@@ -39,13 +39,14 @@ function data(_izContext, srcPath) {
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
function createParamForCreateSource(srcPath) {
|
|
42
|
+
const functionName = FUNCTION_NAME.updateRelComplete;
|
|
42
43
|
return {
|
|
43
44
|
templatePath: templatePath,
|
|
44
45
|
templateData: {
|
|
45
46
|
},
|
|
46
47
|
setting: {
|
|
47
|
-
savePath: path.join(srcPath, SOURCE_PATH.
|
|
48
|
-
saveFileName:
|
|
48
|
+
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
49
|
+
saveFileName: `${upperCase(functionName)}_Main`,
|
|
49
50
|
fileExtension: '.js',
|
|
50
51
|
isAppend: false
|
|
51
52
|
}
|
|
@@ -113,7 +113,7 @@ module.exports.updateRelationshipComplete = async (
|
|
|
113
113
|
let sendMessageToOutUpdateRelatonshipComplete = {
|
|
114
114
|
Message: JSON.stringify(updateCompleteMsg),
|
|
115
115
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
116
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext,
|
|
116
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateRelComplete)
|
|
117
117
|
};
|
|
118
118
|
_izContext.logger.debug("Send message to OutUpdateRelationshipComplete :::>", sendMessageToOutUpdateRelatonshipComplete);
|
|
119
119
|
await sns.publishAsync(_izContext, sendMessageToOutUpdateRelatonshipComplete);
|
|
@@ -32,7 +32,8 @@ const STORAGE_TYPES = {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const templatePath = path.join(__dirname, './template.ejs');
|
|
35
|
-
const { SOURCE_PATH } = require('../../../libs/Consts')
|
|
35
|
+
const { SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require('../../../libs/Consts')
|
|
36
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
/**
|
|
@@ -46,30 +47,26 @@ const { SOURCE_PATH } = require('../../../libs/Consts')
|
|
|
46
47
|
*/
|
|
47
48
|
|
|
48
49
|
function createDataForDefaultSnsInSqs(_izContext, srcPath) {
|
|
49
|
-
let
|
|
50
|
-
|
|
50
|
+
let createUpdateRelationshipQueue = [];
|
|
51
|
+
let updateRelationshipCompleteQueues = [
|
|
51
52
|
{
|
|
52
|
-
|
|
53
|
+
queueName: upperCase(FUNCTION_NAME.updateRelComplete)
|
|
53
54
|
}
|
|
54
55
|
]
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for (let defaultSnsInSqsData of defaultSnsInSqsDataList) {
|
|
59
|
-
resultsForCreateDefaultSnsInSqs.push({
|
|
56
|
+
for (let updateRelationshipCompleteQueue of updateRelationshipCompleteQueues) {
|
|
57
|
+
createUpdateRelationshipQueue.push({
|
|
60
58
|
templatePath,
|
|
61
|
-
templateData:
|
|
59
|
+
templateData: updateRelationshipCompleteQueue,
|
|
62
60
|
setting: {
|
|
63
61
|
initialData: "Resources:\n",
|
|
64
62
|
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
65
|
-
saveFileName:
|
|
63
|
+
saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
|
|
66
64
|
fileExtension: ".yml",
|
|
67
65
|
isAppend: true
|
|
68
66
|
}
|
|
69
67
|
})
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
return resultsForCreateDefaultSnsInSqs;
|
|
69
|
+
return createUpdateRelationshipQueue
|
|
73
70
|
}
|
|
74
71
|
|
|
75
72
|
module.exports = createDataForDefaultSnsInSqs;
|
package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/data.js
CHANGED
|
@@ -31,8 +31,8 @@ const STORAGE_TYPES = {
|
|
|
31
31
|
graph: "graph"
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase
|
|
35
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../../../libs/Consts");
|
|
34
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
|
|
35
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../libs/Consts");
|
|
36
36
|
const templatePath = path.join(__dirname, '../../../ResourceYaml/sns-out/template.ejs')
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -47,20 +47,21 @@ const templatePath = path.join(__dirname, '../../../ResourceYaml/sns-out/templat
|
|
|
47
47
|
|
|
48
48
|
function createDefaultSnsOut(_izContext, srcPath) {
|
|
49
49
|
const createSourceParams = createParamsForCreateSource(_izContext, srcPath)
|
|
50
|
+
// console.log("createSourceParamUpdateRelationshipComplete", createSourceParams)
|
|
50
51
|
return [createSourceParams]
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
function createParamsForCreateSource(_izContext, srcPath) {
|
|
54
|
-
let queueName =
|
|
55
|
+
let queueName = FUNCTION_NAME.updateRelComplete;
|
|
55
56
|
return {
|
|
56
57
|
templatePath: templatePath,
|
|
57
58
|
templateData: {
|
|
58
|
-
queueName: queueName
|
|
59
|
+
queueName: upperCase(queueName)
|
|
59
60
|
},
|
|
60
61
|
setting: {
|
|
61
62
|
initialData: 'Resources:\n',
|
|
62
63
|
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
63
|
-
saveFileName:
|
|
64
|
+
saveFileName: SAVE_FILE_NAME.snsOutYaml,
|
|
64
65
|
fileExtension: '.yml',
|
|
65
66
|
isAppend: true
|
|
66
67
|
}
|