@izara_project/izara-market-library-service-schemas 1.0.34 → 1.0.36
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 +2 -1
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +7 -6
- package/src/MainLibs/src/Consts.js +47 -14
- package/src/MainLibs/src/GenerateCodeUtils.js +2 -0
- package/src/TemplateManager/src/attributeTree/relationshipSchema/data.js +1 -1
- package/src/TemplateManager/src/attributeTreeSchema/generateTemplateData.js +103 -0
- package/src/{reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema → TemplateManager/src/attributeTreeSchema/mainAttributeTree}/attributeLinkTemplate.ejs +3 -7
- package/src/TemplateManager/src/attributeTreeSchema/mainAttributeTree/data.js +134 -0
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/data.js +84 -0
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/tempReferenceRelationshipSchema.ejs +9 -0
- package/src/TemplateManager/src/attributeTreeSchema/relationshipSchema/data.js +172 -0
- package/src/TemplateManager/src/attributeTreeSchema/relationshipSchema/template.ejs +7 -0
- package/src/reStructure/GenerateCode.js +1 -0
- package/src/reStructure/SchemaConfig.js +1 -3
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +2 -2
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +2 -2
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +701 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +34 -159
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +2 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +3 -4
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +2 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +38 -12
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +5 -2
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +22 -14
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +4 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +123 -0
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +57 -0
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +85 -0
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +68 -0
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +131 -0
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +77 -0
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/queue/template.ejs +49 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +12 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +13 -8
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/data.js +141 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/handler/data.js +55 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/handler/template.ejs +83 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/template.ejs +131 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/dynamoDB/register.js +82 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/template.ejs +45 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/statusFieldTemplate.ejs +19 -6
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/storedCacheTemplate.ejs +9 -15
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/data.js +76 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/template.ejs +13 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/data.js +164 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/template.ejs +18 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/handler/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/handler/template.ejs +88 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/mainFunction/template.ejs +222 -0
- package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +83 -44
- package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/data.js +26 -59
- package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/data.js +8 -8
- package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/data.js +11 -9
- package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +5 -9
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +1 -7
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +2 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/template.ejs +2 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/data.js +37 -11
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/data.js +8 -9
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/template.ejs +13 -13
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/template.ejs +44 -69
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +7 -44
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/data.js +3 -10
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/template.ejs +40 -86
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +11 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/template.ejs +11 -8
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +17 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +8 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +49 -84
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +55 -10
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +27 -8
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +50 -20
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data.js +20 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/template.ejs +5 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/data.js +5 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/template.ejs +7 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +6 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +0 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +9 -9
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +17 -39
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +14 -8
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +4 -1
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +90 -21
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +22 -1
- package/src/reStructure/TemplateData/generateRole/sharedResourceTemplate.ejs +3 -0
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +9 -8
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +5 -1
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +1 -0
- package/src/reStructure/TemplateData/propertyValueSchema/generateTemplateData.js +66 -0
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +131 -0
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/templateObjectPropertyValueSchema.ejs +16 -0
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +156 -0
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/tempRelationship.ejs +13 -0
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/templateRelationshipPropertyValueSchema.ejs +7 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +5 -5
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +5 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +4 -3
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/template.ejs +1 -3
- package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +61 -0
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +13 -4
- package/src/reStructure/libs/ValidateAddOnDataStructure.js +62 -0
- package/src/reStructure/TemplateData/attributeTreeSchema/generateTemplateData.js +0 -104
- package/src/reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema/data.js +0 -188
- /package/src/{reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema → TemplateManager/src/attributeTreeSchema/mainAttributeTree}/request.json +0 -0
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
- s3:PutObject
|
|
25
25
|
- s3:GetObject
|
|
26
26
|
- s3:ListBucket
|
|
27
|
+
- s3:DeleteObject
|
|
27
28
|
Resource:
|
|
28
29
|
- arn:aws:s3:::object-schema/*
|
|
29
30
|
- arn:aws:s3:::object-schema/perServiceSchemas/${self:custom.iz_serviceTag}/*
|
|
@@ -54,5 +55,7 @@
|
|
|
54
55
|
Resource:<% statement.Resource.forEach(function(resource) { %>
|
|
55
56
|
- <%= resource -%><% }); %><% } else { %>
|
|
56
57
|
Resource: <%= statement.Resource %><% } %><% }); %>
|
|
58
|
+
#<#<%- role.roleName %>AdditionalRole#>
|
|
59
|
+
#<#/<%- role.roleName %>AdditionalRole#>
|
|
57
60
|
<% }); %>
|
|
58
61
|
<% } %>
|
|
@@ -27,6 +27,8 @@ const PREFIX = {
|
|
|
27
27
|
CREATE_OBJECT_ASYNC: "createObjectAsync",
|
|
28
28
|
CREATE_OBJECT_ASYNC_COMPLETE: "createObjectAsyncComplete"
|
|
29
29
|
}
|
|
30
|
+
//(<optionalRequire>)
|
|
31
|
+
//(</optionalRequire>)
|
|
30
32
|
|
|
31
33
|
/**
|
|
32
34
|
*
|
|
@@ -36,14 +38,8 @@ const PREFIX = {
|
|
|
36
38
|
* @param {*} errorsFounds
|
|
37
39
|
* @param {*} graphServiceTag
|
|
38
40
|
* @param {*} passBackProperties
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
objType,
|
|
42
|
-
objInstance,
|
|
43
|
-
relationships,
|
|
44
|
-
settings
|
|
45
|
-
}
|
|
46
|
-
*/
|
|
41
|
+
*/
|
|
42
|
+
|
|
47
43
|
module.exports.createObjectComplete = async (
|
|
48
44
|
_izContext,
|
|
49
45
|
returnValue,
|
|
@@ -145,9 +141,14 @@ module.exports.createObjectComplete = async (
|
|
|
145
141
|
};
|
|
146
142
|
_izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
|
|
147
143
|
await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
|
|
144
|
+
|
|
145
|
+
//(<afterSendMessage>)
|
|
146
|
+
//(</afterSendMessage>)
|
|
148
147
|
}
|
|
149
148
|
})
|
|
150
149
|
)
|
|
150
|
+
//(<beforeReturn>)
|
|
151
|
+
//(</beforeReturn>)
|
|
151
152
|
return {
|
|
152
153
|
returnValue: returnValue,
|
|
153
154
|
status: status,
|
|
@@ -27,7 +27,8 @@ const sns = require("@izara_project/izara-core-library-external-request").sns;
|
|
|
27
27
|
const NoRetryError = require("@izara_project/izara-core-library-core/src/NoRetryError");
|
|
28
28
|
|
|
29
29
|
const { explodedObjectTypeId, explodedRelationshipTypeId, createLinkTypeId } = require('@izara_project/izara-core-library-service-schemas/src/Utils');
|
|
30
|
-
|
|
30
|
+
//(<optionalRequire>)
|
|
31
|
+
//(</optionalRequire>)
|
|
31
32
|
const {
|
|
32
33
|
TOPIC_NAME_GENERATE_CODE,
|
|
33
34
|
TOPIC_NAME_GRAPH_HANDLER,
|
|
@@ -77,6 +78,9 @@ module.exports.deleteNodeComplete = async (
|
|
|
77
78
|
_izContext.logger.debug("Send Message to DeleteNodeComplete::", sendMessageToOutUpdateNodeComplete);
|
|
78
79
|
await sns.publishAsync(_izContext, sendMessageToOutUpdateNodeComplete)
|
|
79
80
|
|
|
81
|
+
//(<beforeReturn>)
|
|
82
|
+
//(</beforeReturn>)
|
|
83
|
+
|
|
80
84
|
return {
|
|
81
85
|
objType: returnValue.objType,
|
|
82
86
|
objInstanceFull: returnValue.objInstanceFull,
|
|
@@ -33,7 +33,8 @@ const {
|
|
|
33
33
|
TOPIC_NAME_GRAPH_HANDLER,
|
|
34
34
|
PREFIX
|
|
35
35
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
36
|
-
|
|
36
|
+
//(<optionalRequire>)
|
|
37
|
+
//(</optionalRequire>)
|
|
37
38
|
module.exports.updateNodeComplete = async (
|
|
38
39
|
_izContext,
|
|
39
40
|
returnValue,
|
|
@@ -22,6 +22,7 @@ const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
|
22
22
|
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
23
23
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
24
24
|
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
25
|
+
const logicalResultsSharedLib = require('@izara_project/izara-core-library-logical-result');
|
|
25
26
|
|
|
26
27
|
const serviceSchemas = require('@izara_project/izara-core-library-service-schemas');
|
|
27
28
|
const getObjectSchemas = serviceSchemas.getObjectSchema;
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
// Import required modules
|
|
21
|
+
console.log("generate main PropertyValue Schema");
|
|
22
|
+
const { join } = require('path');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
const modules = {
|
|
26
|
+
objectPropertyNodeSchema: require('./objectPropertyValueSchema/data'),
|
|
27
|
+
relationshipPropertyNodeSchema: require('./relationshipPropertyValueSchema/data')
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Generates code with templates for different actions
|
|
31
|
+
* @param {Object} _izContext - Context object
|
|
32
|
+
* @param {string} objSchemaPath - Path to the schema
|
|
33
|
+
* @returns {Array} Array of generated code parameters
|
|
34
|
+
*/
|
|
35
|
+
async function generateCodeWithTemplate(_izContext, objSchemaPath, settings) {
|
|
36
|
+
try {
|
|
37
|
+
let allCreateSource = [];
|
|
38
|
+
const srcPath = join(objSchemaPath, '../');
|
|
39
|
+
|
|
40
|
+
if (settings.generateName === "propertyValue") {
|
|
41
|
+
let objSchemaPropertyNode = await modules.objectPropertyNodeSchema(
|
|
42
|
+
_izContext,
|
|
43
|
+
settings,
|
|
44
|
+
srcPath
|
|
45
|
+
);
|
|
46
|
+
allCreateSource.push(...objSchemaPropertyNode);
|
|
47
|
+
|
|
48
|
+
let relationshipSchemaPropertyNode = await modules.relationshipPropertyNodeSchema(
|
|
49
|
+
_izContext,
|
|
50
|
+
settings,
|
|
51
|
+
srcPath
|
|
52
|
+
);
|
|
53
|
+
allCreateSource.push(relationshipSchemaPropertyNode);
|
|
54
|
+
|
|
55
|
+
} else {
|
|
56
|
+
throw Error(`Generate propertyNode schema Invalid generateName:${settings.generateName} `);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return allCreateSource;
|
|
60
|
+
} catch (error) {
|
|
61
|
+
_izContext.logger.error('Error generating code with template propertyNode schema:', error);
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = generateCodeWithTemplate;
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
console.log("=== property value schema ===");
|
|
21
|
+
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const fs = require('fs');
|
|
24
|
+
const {
|
|
25
|
+
SOURCE_PATH,
|
|
26
|
+
fieldNameSetting,
|
|
27
|
+
FIELD_NAME_TPYE,
|
|
28
|
+
PROPERTYVALUE_TAG,
|
|
29
|
+
SAVE_FILE_NAME
|
|
30
|
+
} = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
31
|
+
|
|
32
|
+
const templatePath = path.join(__dirname, "./templateObjectPropertyValueSchema.ejs");
|
|
33
|
+
|
|
34
|
+
const modules = {
|
|
35
|
+
validateAddOnDataStructure: require('../../../libs/ValidateAddOnDataStructure')
|
|
36
|
+
};
|
|
37
|
+
const yaml = require("yaml")
|
|
38
|
+
const objectschemaLocalByPath = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
39
|
+
const Consts = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts')
|
|
40
|
+
// const objectSchemasBySrc = srcPath
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
async function data(_izContext, settings, srcPath) {
|
|
44
|
+
|
|
45
|
+
let objectSchema = await objectschemaLocalByPath.getObjSchemaS3(
|
|
46
|
+
_izContext,
|
|
47
|
+
settings.objType
|
|
48
|
+
);
|
|
49
|
+
_izContext.logger.debug("objectSchema objectSchema::", objectSchema)
|
|
50
|
+
|
|
51
|
+
if (!objectSchema) {
|
|
52
|
+
throw Error(`Invalid objType:${objTypeString(objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
let propertyValueObjectSchemas = [];
|
|
56
|
+
let createSources = [];
|
|
57
|
+
|
|
58
|
+
let objectType = settings.objType.objectType;
|
|
59
|
+
// validate only addOnndataStructure is type propertyNode.
|
|
60
|
+
|
|
61
|
+
if (!objectSchema.hasOwnProperty("addOnDataStructure") || !Array.isArray(objectSchema.addOnDataStructure) || !objectSchema.addOnDataStructure.length) {
|
|
62
|
+
console.log(`Not have data in addOnDataStructure in objectType:${objectType}`);
|
|
63
|
+
throw Error(`Not have data in addOnDataStructure in objectType:${objectType}`)
|
|
64
|
+
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const storageResources = objectSchema.storageResources; // storageResource from main objectType
|
|
68
|
+
const storageResourceTag = Object.keys(storageResources); // storage ResourceTag from main objectType
|
|
69
|
+
const compositeKeyDeliminator = objectSchema.compositeKeyDeliminator;
|
|
70
|
+
|
|
71
|
+
propertyValueObjectSchemas.push(
|
|
72
|
+
{ // {subject}property
|
|
73
|
+
objectType: objectType + PROPERTYVALUE_TAG.property,
|
|
74
|
+
fieldNames: {
|
|
75
|
+
[objectType + PROPERTYVALUE_TAG.property + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName),
|
|
76
|
+
},
|
|
77
|
+
identifiers: [
|
|
78
|
+
{
|
|
79
|
+
type: "identifier",
|
|
80
|
+
fieldName: objectType + PROPERTYVALUE_TAG.property + "Id"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{ // {subject}propertyLabel
|
|
85
|
+
objectType: objectType + PROPERTYVALUE_TAG.propertyLabel,
|
|
86
|
+
fieldNames: {
|
|
87
|
+
[objectType + PROPERTYVALUE_TAG.propertyLabel + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName),
|
|
88
|
+
},
|
|
89
|
+
identifiers: [
|
|
90
|
+
{
|
|
91
|
+
type: "identifier",
|
|
92
|
+
fieldName: objectType + PROPERTYVALUE_TAG.propertyLabel + "Id"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
for (let propertyValueObjectSchema of propertyValueObjectSchemas) {
|
|
99
|
+
Object.assign(propertyValueObjectSchema, {
|
|
100
|
+
storageResources: storageResources, // add storageResources
|
|
101
|
+
compositeKeyDeliminator: compositeKeyDeliminator
|
|
102
|
+
})
|
|
103
|
+
for (let attributeTreeFieldName of Object.values(propertyValueObjectSchema.fieldNames)) {
|
|
104
|
+
Object.assign(attributeTreeFieldName, { storageResourceTags: storageResourceTag }) // add storageResourceTags for each fieldName
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
for (const propertyValueObjectSchema of propertyValueObjectSchemas) {
|
|
108
|
+
createSources.push({
|
|
109
|
+
templatePath: templatePath,
|
|
110
|
+
templateData: {
|
|
111
|
+
fieldNames: JSON.stringify(propertyValueObjectSchema.fieldNames, null, 2),
|
|
112
|
+
identifiers: JSON.stringify(propertyValueObjectSchema.identifiers, null, 2),
|
|
113
|
+
objectType: propertyValueObjectSchema.objectType,
|
|
114
|
+
storageResources: JSON.stringify(propertyValueObjectSchema.storageResources, null, 2),
|
|
115
|
+
compositeKeyDeliminator: propertyValueObjectSchema.compositeKeyDeliminator
|
|
116
|
+
},
|
|
117
|
+
setting: {
|
|
118
|
+
savePath: path.join(srcPath, SOURCE_PATH.generatedPropertyValue, propertyValueObjectSchema.objectType + "/"),
|
|
119
|
+
hookPath: path.join(srcPath, "schemaHook", "propertyValue", propertyValueObjectSchema.objectType, "/"),
|
|
120
|
+
saveFileName: SAVE_FILE_NAME.objectSchema,
|
|
121
|
+
fileExtension: ".js",
|
|
122
|
+
isAppend: false
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
};
|
|
126
|
+
return createSources;
|
|
127
|
+
|
|
128
|
+
};//End loop addOn
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
module.exports = data
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const izara = require("@izara_project/izara-middleware");
|
|
2
|
+
let { pattern } = izara.validatorSchema.stringNotEmpty(); // should not be empty string
|
|
3
|
+
|
|
4
|
+
module.exports = [
|
|
5
|
+
{
|
|
6
|
+
objectType: "<%- objectType %>",
|
|
7
|
+
addOnDataStructure: [ // optional, add for additional setting to objectType
|
|
8
|
+
//(<addOnDataStructure<%- objectType %>>)
|
|
9
|
+
//(</addOnDataStructure<%- objectType %>>)
|
|
10
|
+
],
|
|
11
|
+
canDelete: true,
|
|
12
|
+
storageResources: <%- storageResources %>,
|
|
13
|
+
fieldNames: <%- fieldNames %>,
|
|
14
|
+
identifiers: <%- identifiers %>
|
|
15
|
+
}
|
|
16
|
+
]
|
package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
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
|
+
console.log("=== relationship property value schema ===");
|
|
21
|
+
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const fs = require('fs');
|
|
24
|
+
const {
|
|
25
|
+
SOURCE_PATH,
|
|
26
|
+
PREFIX_RELATIONSHIP,
|
|
27
|
+
PROPERTYVALUE_TAG,
|
|
28
|
+
SAVE_FILE_NAME
|
|
29
|
+
} = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
30
|
+
|
|
31
|
+
const templatePath = path.join(__dirname, "./tempRelationship.ejs");
|
|
32
|
+
const yaml = require("yaml")
|
|
33
|
+
|
|
34
|
+
const objectschemaLocalByPath = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
35
|
+
|
|
36
|
+
const { firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
37
|
+
const { createBasicRelationshipsProperties } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
38
|
+
|
|
39
|
+
async function data(_izContext, settings, srcPath) {
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
let objectSchema = await objectschemaLocalByPath.getObjSchemaS3(
|
|
43
|
+
_izContext,
|
|
44
|
+
settings.objType
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
if (!objectSchema) {
|
|
48
|
+
throw Error(`Invalid objType:${objTypeString(objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
let createSourceRecords = []
|
|
54
|
+
let generateRelationships = createSourceParams(
|
|
55
|
+
_izContext,
|
|
56
|
+
objectSchema,
|
|
57
|
+
srcPath
|
|
58
|
+
);
|
|
59
|
+
createSourceRecords.push(...generateRelationships);
|
|
60
|
+
|
|
61
|
+
if (createSourceRecords.length) {
|
|
62
|
+
return {
|
|
63
|
+
templatePath: templatePath,
|
|
64
|
+
templateData: {
|
|
65
|
+
datas: createSourceRecords
|
|
66
|
+
},
|
|
67
|
+
setting: {
|
|
68
|
+
savePath: path.join(srcPath, SOURCE_PATH.generatedPropertyValue),
|
|
69
|
+
hookPath: path.join(srcPath, "schemaHook", "propertyValue", "/"),
|
|
70
|
+
saveFileName: SAVE_FILE_NAME.objectRelationship,
|
|
71
|
+
fileExtension: ".js",
|
|
72
|
+
isAppend: false,
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
function createSourceParams(
|
|
80
|
+
_izContext,
|
|
81
|
+
objectSchema,
|
|
82
|
+
srcPath
|
|
83
|
+
) {
|
|
84
|
+
const attributeRelationships = [];
|
|
85
|
+
const objectType = objectSchema.objectType; // main objectType
|
|
86
|
+
const storageResources = objectSchema.storageResources // storageResource from main objectType
|
|
87
|
+
const configPath = path.join(srcPath, '../../config/serverless.config.yml');
|
|
88
|
+
const serverlessConfig = fs.readFileSync(configPath, 'utf8');
|
|
89
|
+
const config = yaml.parse(serverlessConfig);
|
|
90
|
+
const serviceTag = config.main_config.iz_serviceTag;
|
|
91
|
+
|
|
92
|
+
attributeRelationships.push(
|
|
93
|
+
{ // has{objectType}propertyValue
|
|
94
|
+
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
95
|
+
relationshipProperties: createBasicRelationshipsProperties(
|
|
96
|
+
{
|
|
97
|
+
serviceTag: serviceTag,
|
|
98
|
+
objectType: objectType,
|
|
99
|
+
linkType: "one",
|
|
100
|
+
requiredOnCreate: false
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
serviceTag: serviceTag,
|
|
104
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
105
|
+
linkType: "many",
|
|
106
|
+
requiredOnCreate: true
|
|
107
|
+
},
|
|
108
|
+
storageResources,
|
|
109
|
+
"from"
|
|
110
|
+
)
|
|
111
|
+
},
|
|
112
|
+
// disabled{objectType}propertyValue
|
|
113
|
+
{
|
|
114
|
+
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
115
|
+
relationshipProperties: createBasicRelationshipsProperties(
|
|
116
|
+
{
|
|
117
|
+
serviceTag: serviceTag,
|
|
118
|
+
objectType: objectType,
|
|
119
|
+
linkType: "one",
|
|
120
|
+
requiredOnCreate: false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
serviceTag: serviceTag,
|
|
124
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
125
|
+
linkType: "many",
|
|
126
|
+
requiredOnCreate: true
|
|
127
|
+
},
|
|
128
|
+
storageResources,
|
|
129
|
+
"from"
|
|
130
|
+
)
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
{ // is{objectType}PropertyLabel
|
|
134
|
+
relationshipTag: PREFIX_RELATIONSHIP.is + upperCase(objectType) + PROPERTYVALUE_TAG.propertyLabel,
|
|
135
|
+
relationshipProperties: createBasicRelationshipsProperties(
|
|
136
|
+
{
|
|
137
|
+
serviceTag: serviceTag,
|
|
138
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
139
|
+
linkType: "many",
|
|
140
|
+
requiredOnCreate: true
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
serviceTag: serviceTag,
|
|
144
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.propertyLabel,
|
|
145
|
+
linkType: "one",
|
|
146
|
+
requiredOnCreate: false
|
|
147
|
+
},
|
|
148
|
+
storageResources,
|
|
149
|
+
"from"
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
return attributeRelationships
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
module.exports = data
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
<%datas.forEach(data=> {%>
|
|
3
|
+
{
|
|
4
|
+
<%- data.relationshipTag %>: {
|
|
5
|
+
fieldNames:{
|
|
6
|
+
//(<fieldNames>)
|
|
7
|
+
//(<fieldNames>)
|
|
8
|
+
},
|
|
9
|
+
storageResources:<%- JSON.stringify(data.relationshipProperties.storageResources,null,2) %>,
|
|
10
|
+
links:<%- JSON.stringify(data.relationshipProperties.links,null,2) %>,
|
|
11
|
+
}
|
|
12
|
+
},<%})%>
|
|
13
|
+
]
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs
CHANGED
|
@@ -54,7 +54,8 @@ const {
|
|
|
54
54
|
TOPIC_NAME_GENERATE_CODE,
|
|
55
55
|
TOPIC_NAME_GRAPH_HANDLER
|
|
56
56
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
57
|
-
|
|
57
|
+
//(<optionalRequire>)
|
|
58
|
+
//(</optionalRequire>)
|
|
58
59
|
/**
|
|
59
60
|
* update relationship endpoint
|
|
60
61
|
*
|
package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs
CHANGED
|
@@ -34,7 +34,8 @@ const {
|
|
|
34
34
|
TOPIC_NAME_GRAPH_HANDLER,
|
|
35
35
|
PREFIX
|
|
36
36
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
37
|
-
|
|
37
|
+
//(<optionalRequire>)
|
|
38
|
+
//(</optionalRequire>)
|
|
38
39
|
module.exports.createRelationshipComplete = async (
|
|
39
40
|
_izContext,
|
|
40
41
|
returnValue,
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs
CHANGED
|
@@ -51,7 +51,8 @@ const {
|
|
|
51
51
|
TOPIC_NAME_GENERATE_CODE,
|
|
52
52
|
TOPIC_NAME_GRAPH_HANDLER
|
|
53
53
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
54
|
-
|
|
54
|
+
//(<optionalRequire>)
|
|
55
|
+
//(</optionalRequire>)
|
|
55
56
|
/**
|
|
56
57
|
* update relationship endpoint
|
|
57
58
|
*
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs
CHANGED
|
@@ -26,7 +26,7 @@ const izaraShared = require('@izara_project/izara-shared');
|
|
|
26
26
|
const recordHandlerSharedLib = izaraShared.recordHandlerSharedLib
|
|
27
27
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const deleteRelationshipComplete = require('./DeleteRelationshipComplete_Main');
|
|
30
30
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
31
31
|
// validate event properties in body.Message of sqs event
|
|
32
32
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
@@ -82,7 +82,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
82
82
|
//validate message (and MessageAttributes)
|
|
83
83
|
await recordHandlerSharedLib.validateRecord(
|
|
84
84
|
record, // one record will send to mainFunction
|
|
85
|
-
"
|
|
85
|
+
"DeleteRelationshipComplete", // queue name that need to retry or send to dlq
|
|
86
86
|
perRecordsValidatorSchema, // schema for record.Message
|
|
87
87
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
88
88
|
);
|
|
@@ -98,8 +98,8 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
98
98
|
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
99
99
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
100
100
|
record, // one record will send to mainFunction
|
|
101
|
-
|
|
102
|
-
"
|
|
101
|
+
deleteRelationshipComplete.deleteRelationshipComplete, // mainFunction that need to invoke.
|
|
102
|
+
"DeleteRelationshipComplete", // queue name that need to retry or send to dlq
|
|
103
103
|
passOnProperties, // all parameters that mainFunction needed.
|
|
104
104
|
);
|
|
105
105
|
record._izContext.logger.debug('after recordPromise in handler');
|
|
@@ -119,7 +119,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
119
119
|
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
120
120
|
|
|
121
121
|
} catch (err) {
|
|
122
|
-
Logger.error('Unhandled Error,
|
|
122
|
+
Logger.error('Unhandled Error, deleteRelationshipComplete: ', err);
|
|
123
123
|
throw (err);
|
|
124
124
|
}
|
|
125
125
|
});
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs
CHANGED
|
@@ -35,8 +35,9 @@ const {
|
|
|
35
35
|
TOPIC_NAME_GRAPH_HANDLER,
|
|
36
36
|
PREFIX
|
|
37
37
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
//(<optionalRequire>)
|
|
39
|
+
//(</optionalRequire>)
|
|
40
|
+
module.exports.deleteRelationshipComplete = async (
|
|
40
41
|
_izContext,
|
|
41
42
|
returnValue,
|
|
42
43
|
status,
|
|
@@ -45,7 +46,7 @@ module.exports.createRelationshipComplete = async (
|
|
|
45
46
|
|
|
46
47
|
) => {
|
|
47
48
|
try {
|
|
48
|
-
_izContext.logger.debug("Function:
|
|
49
|
+
_izContext.logger.debug("Function:deleteRelationshipComplete", {
|
|
49
50
|
returnValue: returnValue,
|
|
50
51
|
status: status,
|
|
51
52
|
errorsFound: errorsFound,
|
|
@@ -112,7 +113,7 @@ module.exports.createRelationshipComplete = async (
|
|
|
112
113
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
113
114
|
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete)
|
|
114
115
|
};
|
|
115
|
-
_izContext.logger.debug("Send message to
|
|
116
|
+
_izContext.logger.debug("Send message to OutdeleteRelationshipComplete :::>", sendMessageToOutDeleteRelatonshipComplete);
|
|
116
117
|
await sns.publishAsync(_izContext, sendMessageToOutDeleteRelatonshipComplete);
|
|
117
118
|
|
|
118
119
|
|
package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs
CHANGED
|
@@ -53,7 +53,8 @@ const {
|
|
|
53
53
|
TOPIC_NAME_GENERATE_CODE,
|
|
54
54
|
TOPIC_NAME_GRAPH_HANDLER
|
|
55
55
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
56
|
-
|
|
56
|
+
//(<optionalRequire>)
|
|
57
|
+
//(</optionalRequire>)
|
|
57
58
|
/**
|
|
58
59
|
* update relationship endpoint
|
|
59
60
|
*
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs
CHANGED
|
@@ -26,7 +26,7 @@ const izaraShared = require('@izara_project/izara-shared');
|
|
|
26
26
|
const recordHandlerSharedLib = izaraShared.recordHandlerSharedLib
|
|
27
27
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const getRelationshipComplete = require('./GetRelationshipComplete_Main');
|
|
30
30
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
31
31
|
// validate event properties in body.Message of sqs event
|
|
32
32
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
@@ -82,7 +82,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
82
82
|
//validate message (and MessageAttributes)
|
|
83
83
|
await recordHandlerSharedLib.validateRecord(
|
|
84
84
|
record, // one record will send to mainFunction
|
|
85
|
-
"
|
|
85
|
+
"GetRelationshipComplete", // queue name that need to retry or send to dlq
|
|
86
86
|
perRecordsValidatorSchema, // schema for record.Message
|
|
87
87
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
88
88
|
);
|
|
@@ -98,8 +98,8 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
98
98
|
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
99
99
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
100
100
|
record, // one record will send to mainFunction
|
|
101
|
-
|
|
102
|
-
"
|
|
101
|
+
getRelationshipComplete.getRelationshipComplete, // mainFunction that need to invoke.
|
|
102
|
+
"GetRelationshipComplete", // queue name that need to retry or send to dlq
|
|
103
103
|
passOnProperties, // all parameters that mainFunction needed.
|
|
104
104
|
);
|
|
105
105
|
record._izContext.logger.debug('after recordPromise in handler');
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs
CHANGED
|
@@ -35,8 +35,9 @@ const {
|
|
|
35
35
|
TOPIC_NAME_GRAPH_HANDLER,
|
|
36
36
|
PREFIX
|
|
37
37
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
//(<optionalRequire>)
|
|
39
|
+
//(</optionalRequire>)
|
|
40
|
+
module.exports.getRelationshipComplete = async (
|
|
40
41
|
_izContext,
|
|
41
42
|
returnValue,
|
|
42
43
|
status,
|
|
@@ -45,7 +46,7 @@ module.exports.createRelationshipComplete = async (
|
|
|
45
46
|
|
|
46
47
|
) => {
|
|
47
48
|
try {
|
|
48
|
-
_izContext.logger.debug("Function:
|
|
49
|
+
_izContext.logger.debug("Function:getRelationshipComplete", {
|
|
49
50
|
returnValue: returnValue,
|
|
50
51
|
status: status,
|
|
51
52
|
errorsFound: errorsFound,
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs
CHANGED
|
@@ -57,7 +57,8 @@ const {
|
|
|
57
57
|
TOPIC_NAME_GRAPH_HANDLER,
|
|
58
58
|
TOPIC_NAME_GENERATE_CODE
|
|
59
59
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
60
|
-
|
|
60
|
+
//(<optionalRequire>)
|
|
61
|
+
//(</optionalRequire>)
|
|
61
62
|
/**
|
|
62
63
|
* update relationship endpoint
|
|
63
64
|
*
|