@izara_project/izara-market-library-service-schemas 1.0.35 → 1.0.37
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 +8 -7
- package/src/GenerateCodeLibs/src/Consts.js +2 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +3 -2
- package/src/MainLibs/src/Consts.js +8 -8
- package/src/MainLibs/src/GenerateCodeUtils.js +3 -1
- package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/generateTemplateData.js +35 -20
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/data.js +84 -0
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/tempReferenceRelationshipSchema.ejs +9 -0
- package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/relationshipSchema/data.js +1 -1
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/handler/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +1 -1
- package/src/reStructure/SchemaConfig.js +1 -4
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +701 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +35 -163
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +3 -1
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +3 -4
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +3 -1
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +45 -19
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +5 -2
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +24 -14
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +4 -1
- package/src/reStructure/TemplateData/findData/GetByStorage/getByGraph.ejs +4 -3
- package/src/reStructure/TemplateData/findData/handler/template.ejs +2 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +4 -10
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +69 -34
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +3 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +3 -12
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +18 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +10 -7
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +12 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +14 -9
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/data.js +16 -40
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/functionYaml/template.ejs +9 -9
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/handler/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/data.js +3 -3
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/template.ejs +78 -27
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/dynamoDB/register.js +82 -0
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/sns-in/template.ejs +34 -1
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/storedCacheTemplate.ejs +9 -32
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/data.js +30 -20
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/template.ejs +6 -6
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/data.js +32 -32
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/template.ejs +5 -5
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/handler/template.ejs +8 -9
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/mainFunction/template.ejs +116 -26
- package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +83 -44
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +4 -5
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +1 -7
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +6 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/template.ejs +2 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/data.js +31 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/data.js +7 -8
- 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 +43 -39
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +5 -7
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/data.js +2 -9
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/template.ejs +46 -48
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +5 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/template.ejs +3 -11
- 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 +6 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +49 -84
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +60 -10
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +7 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +22 -7
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +27 -34
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data.js +21 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/template.ejs +1 -3
- 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 +10 -6
- 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 +4 -4
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +8 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +21 -14
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +23 -8
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +11 -6
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +50 -45
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +3 -2
- package/src/reStructure/TemplateData/generateRole/sharedResourceTemplate.ejs +2 -28
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +10 -9
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +6 -2
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/perActionEndpoint/libs/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +1 -0
- package/src/reStructure/TemplateData/{propertyNodeSchema → propertyValueSchema}/generateTemplateData.js +4 -4
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +131 -0
- package/src/reStructure/TemplateData/{propertyNodeSchema/relationshipPropertyNodeSchema → propertyValueSchema/relationshipPropertyValueSchema}/data.js +32 -55
- 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 +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +5 -5
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +6 -5
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +5 -4
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +3 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +3 -2
- 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/TemplateData/propertyNodeSchema/objectPropertyNodeSchema/data.js +0 -151
- package/src/reStructure/TemplateData/propertyNodeSchema/relationshipPropertyNodeSchema/templateRelationshipPropertyNodeSchema.ejs +0 -7
- package/src/reStructure/TemplateData/testTemplate/data.js +0 -27
- package/src/reStructure/TemplateData/testTemplate/template.ejs +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/attributeLinkTemplate.ejs +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/data.js +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/mainAttributeTree/request.json +0 -0
- /package/src/{reStructure/TemplateData → TemplateManager/src}/attributeTreeSchema/relationshipSchema/template.ejs +0 -0
- /package/src/reStructure/TemplateData/{propertyNodeSchema/objectPropertyNodeSchema/templateObjectPropertyNodeSchema.ejs → propertyValueSchema/objectPropertyValueSchema/templateObjectPropertyValueSchema.ejs} +0 -0
|
@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
// Import required modules
|
|
21
|
-
console.log("generate main
|
|
21
|
+
console.log("generate main PropertyValue Schema");
|
|
22
22
|
const { join } = require('path');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
const modules = {
|
|
26
|
-
objectPropertyNodeSchema: require('
|
|
27
|
-
relationshipPropertyNodeSchema: require('
|
|
26
|
+
objectPropertyNodeSchema: require('./objectPropertyValueSchema/data'),
|
|
27
|
+
relationshipPropertyNodeSchema: require('./relationshipPropertyValueSchema/data')
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
30
|
* Generates code with templates for different actions
|
|
@@ -37,7 +37,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath, settings) {
|
|
|
37
37
|
let allCreateSource = [];
|
|
38
38
|
const srcPath = join(objSchemaPath, '../');
|
|
39
39
|
|
|
40
|
-
if (settings.generateName === "
|
|
40
|
+
if (settings.generateName === "propertyValue") {
|
|
41
41
|
let objSchemaPropertyNode = await modules.objectPropertyNodeSchema(
|
|
42
42
|
_izContext,
|
|
43
43
|
settings,
|
|
@@ -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
|
|
@@ -17,67 +17,46 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
console.log("=== relationship property
|
|
20
|
+
console.log("=== relationship property value schema ===");
|
|
21
21
|
|
|
22
22
|
const path = require('path');
|
|
23
23
|
const fs = require('fs');
|
|
24
24
|
const {
|
|
25
25
|
SOURCE_PATH,
|
|
26
26
|
PREFIX_RELATIONSHIP,
|
|
27
|
-
|
|
27
|
+
PROPERTYVALUE_TAG,
|
|
28
28
|
SAVE_FILE_NAME
|
|
29
29
|
} = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
30
30
|
|
|
31
|
-
const templatePath = path.join(__dirname, "./
|
|
32
|
-
|
|
31
|
+
const templatePath = path.join(__dirname, "./tempRelationship.ejs");
|
|
33
32
|
const yaml = require("yaml")
|
|
33
|
+
|
|
34
34
|
const objectschemaLocalByPath = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
35
|
-
|
|
36
|
-
const Consts = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
35
|
+
|
|
37
36
|
const { firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
38
37
|
const { createBasicRelationshipsProperties } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
39
38
|
|
|
40
39
|
async function data(_izContext, settings, srcPath) {
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
let
|
|
41
|
+
|
|
42
|
+
let objectSchema = await objectschemaLocalByPath.getObjSchemaS3(
|
|
44
43
|
_izContext,
|
|
45
|
-
|
|
44
|
+
settings.objType
|
|
46
45
|
);
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (allObjectSchemas.records.length == 0) {
|
|
47
|
+
if (!objectSchema) {
|
|
51
48
|
throw Error(`Invalid objType:${objTypeString(objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
|
|
52
49
|
};
|
|
53
|
-
nextObjectSchema:
|
|
54
|
-
for (const objectSchema of allObjectSchemas.records) {
|
|
55
50
|
|
|
56
|
-
// validate only addOnndataStructure is type propertyNode.
|
|
57
|
-
if (!objectSchema.hasOwnProperty("addOnDataStructure") || !Array.isArray(objectSchema.addOnDataStructure) || !objectSchema.addOnDataStructure.length) {
|
|
58
|
-
console.log("Not have data in addOnDataStructure ,continute nextObjectSchema")
|
|
59
|
-
continue
|
|
60
|
-
};
|
|
61
51
|
|
|
62
|
-
for (let eachAddOnDataStructure of objectSchema.addOnDataStructure) {
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
objectSchema,
|
|
72
|
-
srcPath
|
|
73
|
-
);
|
|
74
|
-
console.log("generateRelationship", generateRelationships);
|
|
75
|
-
|
|
76
|
-
createSourceRecords.push(...generateRelationships);
|
|
77
|
-
|
|
78
|
-
};//End loop addOn
|
|
79
|
-
}; //End loop objectSchema
|
|
80
|
-
console.log("createSourceRecords: ", createSourceRecords);
|
|
53
|
+
let createSourceRecords = []
|
|
54
|
+
let generateRelationships = createSourceParams(
|
|
55
|
+
_izContext,
|
|
56
|
+
objectSchema,
|
|
57
|
+
srcPath
|
|
58
|
+
);
|
|
59
|
+
createSourceRecords.push(...generateRelationships);
|
|
81
60
|
|
|
82
61
|
if (createSourceRecords.length) {
|
|
83
62
|
return {
|
|
@@ -86,12 +65,11 @@ async function data(_izContext, settings, srcPath) {
|
|
|
86
65
|
datas: createSourceRecords
|
|
87
66
|
},
|
|
88
67
|
setting: {
|
|
89
|
-
savePath: path.join(srcPath, SOURCE_PATH.
|
|
90
|
-
hookPath: path.join(srcPath, "schemaHook", "
|
|
68
|
+
savePath: path.join(srcPath, SOURCE_PATH.generatedPropertyValue),
|
|
69
|
+
hookPath: path.join(srcPath, "schemaHook", "propertyValue", "/"),
|
|
91
70
|
saveFileName: SAVE_FILE_NAME.objectRelationship,
|
|
92
71
|
fileExtension: ".js",
|
|
93
72
|
isAppend: false,
|
|
94
|
-
// encloseTemplate: "\n ]",
|
|
95
73
|
}
|
|
96
74
|
}
|
|
97
75
|
};
|
|
@@ -111,42 +89,41 @@ function createSourceParams(
|
|
|
111
89
|
const config = yaml.parse(serverlessConfig);
|
|
112
90
|
const serviceTag = config.main_config.iz_serviceTag;
|
|
113
91
|
|
|
114
|
-
|
|
115
92
|
attributeRelationships.push(
|
|
116
|
-
{ // has{objectType}
|
|
117
|
-
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(objectType) +
|
|
93
|
+
{ // has{objectType}propertyValue
|
|
94
|
+
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
118
95
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
119
96
|
{
|
|
120
97
|
serviceTag: serviceTag,
|
|
121
98
|
objectType: objectType,
|
|
122
|
-
linkType: "
|
|
99
|
+
linkType: "one",
|
|
123
100
|
requiredOnCreate: false
|
|
124
101
|
},
|
|
125
102
|
{
|
|
126
103
|
serviceTag: serviceTag,
|
|
127
|
-
objectType: upperCase(objectType) +
|
|
104
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
128
105
|
linkType: "many",
|
|
129
|
-
requiredOnCreate:
|
|
106
|
+
requiredOnCreate: true
|
|
130
107
|
},
|
|
131
108
|
storageResources,
|
|
132
109
|
"from"
|
|
133
110
|
)
|
|
134
111
|
},
|
|
135
|
-
// disabled{objectType}
|
|
112
|
+
// disabled{objectType}propertyValue
|
|
136
113
|
{
|
|
137
|
-
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(objectType) +
|
|
114
|
+
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
138
115
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
139
116
|
{
|
|
140
117
|
serviceTag: serviceTag,
|
|
141
118
|
objectType: objectType,
|
|
142
|
-
linkType: "
|
|
119
|
+
linkType: "one",
|
|
143
120
|
requiredOnCreate: false
|
|
144
121
|
},
|
|
145
122
|
{
|
|
146
123
|
serviceTag: serviceTag,
|
|
147
|
-
objectType: upperCase(objectType) +
|
|
124
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
148
125
|
linkType: "many",
|
|
149
|
-
requiredOnCreate:
|
|
126
|
+
requiredOnCreate: true
|
|
150
127
|
},
|
|
151
128
|
storageResources,
|
|
152
129
|
"from"
|
|
@@ -154,18 +131,18 @@ function createSourceParams(
|
|
|
154
131
|
},
|
|
155
132
|
|
|
156
133
|
{ // is{objectType}PropertyLabel
|
|
157
|
-
relationshipTag: PREFIX_RELATIONSHIP.is + upperCase(objectType) +
|
|
134
|
+
relationshipTag: PREFIX_RELATIONSHIP.is + upperCase(objectType) + PROPERTYVALUE_TAG.propertyLabel,
|
|
158
135
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
159
136
|
{
|
|
160
137
|
serviceTag: serviceTag,
|
|
161
|
-
objectType: upperCase(objectType) +
|
|
138
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.property,
|
|
162
139
|
linkType: "many",
|
|
163
140
|
requiredOnCreate: true
|
|
164
141
|
},
|
|
165
142
|
{
|
|
166
143
|
serviceTag: serviceTag,
|
|
167
|
-
objectType: upperCase(objectType) +
|
|
168
|
-
linkType: "
|
|
144
|
+
objectType: upperCase(objectType) + PROPERTYVALUE_TAG.propertyLabel,
|
|
145
|
+
linkType: "one",
|
|
169
146
|
requiredOnCreate: false
|
|
170
147
|
},
|
|
171
148
|
storageResources,
|
|
@@ -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
|
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const hash = require(
|
|
20
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
21
21
|
|
|
22
22
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
23
|
const lambdaSharedLib = require("@izara_project/izara-core-library-lambda");
|
|
@@ -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
|
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
-
const hash = require(
|
|
19
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
20
20
|
|
|
21
21
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
22
22
|
const lambdaSharedLib = require("@izara_project/izara-core-library-lambda");
|
|
@@ -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
|
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const hash = require(
|
|
20
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
@@ -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
|
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
-
const hash = require(
|
|
19
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
20
20
|
|
|
21
21
|
const izaraShared = require('@izara_project/izara-shared');
|
|
22
22
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
@@ -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
|
@@ -17,8 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const hash = require(
|
|
21
|
-
|
|
20
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
22
21
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
22
|
const lambdaSharedLib = require("@izara_project/izara-core-library-lambda");
|
|
24
23
|
const snsSharedLib = require("@izara_project/izara-core-library-sns");
|
|
@@ -53,7 +52,8 @@ const {
|
|
|
53
52
|
TOPIC_NAME_GENERATE_CODE,
|
|
54
53
|
TOPIC_NAME_GRAPH_HANDLER
|
|
55
54
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
56
|
-
|
|
55
|
+
//(<optionalRequire>)
|
|
56
|
+
//(</optionalRequire>)
|
|
57
57
|
/**
|
|
58
58
|
* update relationship endpoint
|
|
59
59
|
*
|
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
|
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
-
const hash = require(
|
|
19
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
20
20
|
|
|
21
21
|
const izaraShared = require('@izara_project/izara-shared');
|
|
22
22
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
@@ -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
|
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const hash = require(
|
|
20
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
21
21
|
|
|
22
22
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
23
|
const lambdaSharedLib = require("@izara_project/izara-core-library-lambda");
|
|
@@ -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
|
*
|
package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs
CHANGED
|
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
-
const hash = require(
|
|
19
|
+
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
20
20
|
|
|
21
21
|
const izaraShared = require('@izara_project/izara-shared');
|
|
22
22
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
@@ -35,7 +35,8 @@ const {
|
|
|
35
35
|
TOPIC_NAME_GRAPH_HANDLER,
|
|
36
36
|
TOPIC_NAME_GENERATE_CODE
|
|
37
37
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
38
|
-
|
|
38
|
+
//(<optionalRequire>)
|
|
39
|
+
//(</optionalRequire>)
|
|
39
40
|
module.exports.updateRelationshipComplete = async (
|
|
40
41
|
_izContext,
|
|
41
42
|
returnValue,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Type: "AWS::DynamoDB::Table"
|
|
3
3
|
Properties:
|
|
4
4
|
TableName: ${self:custom.iz_resourcePrefix}<%- tableName %>
|
|
5
|
+
BillingMode: PAY_PER_REQUEST
|
|
5
6
|
AttributeDefinitions:
|
|
6
7
|
<%_ attributes.forEach(attribute => { -%>
|
|
7
8
|
- AttributeName: <%- attribute['AttributeName'] %>
|
|
@@ -18,9 +19,6 @@
|
|
|
18
19
|
KeyType: RANGE
|
|
19
20
|
<%_ } -%>
|
|
20
21
|
<%_ }) _%>
|
|
21
|
-
ProvisionedThroughput:
|
|
22
|
-
ReadCapacityUnits: 1
|
|
23
|
-
WriteCapacityUnits: 1
|
|
24
22
|
#<#<%- firstLetterUpperCase(tableName) %>DynamoDbSetting#>
|
|
25
23
|
#<#/<%- firstLetterUpperCase(tableName) %>DynamoDbSetting#>
|
|
26
24
|
<%_ function firstLetterUpperCase(text){
|