@izara_project/izara-market-library-service-schemas 1.0.35 → 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/GenerateCodeLibs.js +2 -1
- package/src/MainLibs/src/Consts.js +8 -8
- package/src/MainLibs/src/GenerateCodeUtils.js +2 -0
- 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/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 +34 -162
- 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/mainFunction/template.ejs +68 -33
- 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/createRecordByStatusType/complete/functionYaml/data.js +16 -13
- 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/template.ejs +7 -9
- 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 +10 -33
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/data.js +5 -5
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/subscriptionOutAll/template.ejs +6 -6
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/data.js +26 -4
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/functionYaml/template.ejs +5 -5
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/handler/template.ejs +7 -8
- package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/mainFunction/template.ejs +118 -16
- 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 +2 -3
- 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 +44 -69
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +4 -6
- 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 +40 -87
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +5 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/template.ejs +2 -10
- 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 +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 +20 -7
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +24 -33
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data.js +20 -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 +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 +8 -3
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +17 -11
- 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 +50 -42
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +3 -2
- 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/{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 +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/TemplateData/propertyNodeSchema/objectPropertyNodeSchema/data.js +0 -151
- package/src/reStructure/TemplateData/propertyNodeSchema/relationshipPropertyNodeSchema/templateRelationshipPropertyNodeSchema.ejs +0 -7
- /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
package/package.json
CHANGED
|
@@ -428,7 +428,8 @@ async function createGetDataDetails(_izContext, objectSchema) {
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
for (let versionedData of versionedDataPerStorageTag[storageTag]) {
|
|
431
|
-
|
|
431
|
+
_izContext.logger.debug("versionedData.fieldNames", versionedData.fieldNames)
|
|
432
|
+
let versionedDataFieldNames = Object.keys(versionedData.fieldNames);
|
|
432
433
|
Object.assign(
|
|
433
434
|
getGraphDataDetails[useStorageTag].versionedDatas,
|
|
434
435
|
{ [versionedData.versionedDataLabel]: versionedDataFieldNames }
|
|
@@ -120,10 +120,9 @@ const SOURCE_PATH = {
|
|
|
120
120
|
webSocket: "../src/generatedCode/FlowSchema/UploadS3/",
|
|
121
121
|
resourceLocationWebSocket: "src/generatedCode/FlowSchema/UploadS3/",
|
|
122
122
|
// * FlowSchema event
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
resourceLocationFlowSchemaExternalTopic: "src/generatedCode/flowSchemaExternalTopic/",
|
|
123
|
+
flowSchema: "../src/generatedCode/FlowSchema/",
|
|
124
|
+
resourceLocationFlowSchema: "src/generatedCode/FlowSchema/",
|
|
125
|
+
// * FlowSchema event
|
|
127
126
|
flowSchemaEventBridge: "../src/generatedCode/FlowSchema/EventBridge/",
|
|
128
127
|
resourceLocationFlowSchemaEventBridge: "src/generatedCode/FlowSchema/EventBridge/",
|
|
129
128
|
// * FlowSchema Register
|
|
@@ -136,7 +135,8 @@ const SOURCE_PATH = {
|
|
|
136
135
|
generatedCodeHookFunction: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
137
136
|
resourceLocationGeneratedCodeHookFunction: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
138
137
|
generatedAttributeTree: "../src/schemas/generatedCode/attributeTree/",
|
|
139
|
-
|
|
138
|
+
generatedPropertyValue: "../src/schemas/generatedCode/propertyValue/",
|
|
139
|
+
generatedRefRelationshipAttribute: "../src/schemas/generatedCode/refRelationshipAttribute/",
|
|
140
140
|
endpointPerService: "../src/generatedCode/ActionEndpoint/source/",
|
|
141
141
|
resourceLocationHandlerEndpointPerService: "src/generatedCode/ActionEndpoint/source/",
|
|
142
142
|
createRecordComplete: "../src/generatedCode/CreateRecordComplete/",
|
|
@@ -415,8 +415,8 @@ const ATTRIBUTE_TAG = {
|
|
|
415
415
|
attributeTagPropertyLabel: "PropertyLabel",
|
|
416
416
|
};
|
|
417
417
|
|
|
418
|
-
const
|
|
419
|
-
property: "
|
|
418
|
+
const PROPERTYVALUE_TAG = {
|
|
419
|
+
property: "PropertyValue",
|
|
420
420
|
propertyLabel: "PropertyLabel",
|
|
421
421
|
};
|
|
422
422
|
|
|
@@ -585,7 +585,7 @@ module.exports = {
|
|
|
585
585
|
FIELD_NAME_TPYE,
|
|
586
586
|
ADD_ON_DATA_STRUCTURE_TYPE,
|
|
587
587
|
ATTRIBUTE_TAG,
|
|
588
|
-
|
|
588
|
+
PROPERTYVALUE_TAG,
|
|
589
589
|
PREFIX_RELATIONSHIP,
|
|
590
590
|
checkDynamoTypeRelationship,
|
|
591
591
|
createDynamoDbComponentByLinks,
|
|
@@ -51,6 +51,8 @@ function checkValidTableYaml(_izContext, currentTableSetting, existsTableSetting
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
// console.log("filteredDynamoDbYamlSetting: ", JSON.stringify(filteredDynamoDbYamlSetting, null, 2),
|
|
55
|
+
// "existsTableSetting:", JSON.stringify(existsTableSetting, null, 2))
|
|
54
56
|
return [filteredDynamoDbYamlSetting, existsTableSetting];
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -33,7 +33,8 @@ const { validateObjType } = serviceSchemaShared.validateObjType
|
|
|
33
33
|
|
|
34
34
|
const modules = {
|
|
35
35
|
mainAttributeTreeSchema: require('./mainAttributeTree/data'),
|
|
36
|
-
relaAttributeTreeSchema: require('./relationshipSchema/data')
|
|
36
|
+
relaAttributeTreeSchema: require('./relationshipSchema/data'),
|
|
37
|
+
referenceRelaAttributeTreeSchema: require('./referenceRelationshipSchema/data')
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Generates code with templates for different actions
|
|
@@ -50,33 +51,47 @@ async function generateCodeWithTemplate(
|
|
|
50
51
|
let allCreateSource = [];
|
|
51
52
|
const srcPath = join(objSchemaPath, '../');
|
|
52
53
|
|
|
53
|
-
if (!settings || !settings.generateName || !settings.objType || !settings.attributeTag) {
|
|
54
|
-
validateObjType(settings.objType);
|
|
55
|
-
throw new Error("Invalid settings object. Must contain objType and attributeTag properties.");
|
|
56
|
-
}
|
|
57
|
-
if (settings.generateName === "mainAttributeTree") {
|
|
58
|
-
let objSchemaAttributeTree = await modules.mainAttributeTreeSchema(
|
|
59
|
-
_izContext,
|
|
60
|
-
settings,
|
|
61
|
-
srcPath
|
|
62
|
-
);
|
|
63
|
-
allCreateSource.push(...objSchemaAttributeTree);
|
|
64
|
-
console.log("objSchemaAttributeTree finish");
|
|
65
54
|
|
|
55
|
+
if (settings.generateName === "referenceAttributeTree") {
|
|
56
|
+
console.log("case: generateName === referenceAttributeTree");
|
|
66
57
|
|
|
67
|
-
let
|
|
58
|
+
let referenceRelaSchemaAttributeTree = await modules.referenceRelaAttributeTreeSchema(
|
|
68
59
|
_izContext,
|
|
69
60
|
settings,
|
|
70
61
|
srcPath
|
|
71
62
|
);
|
|
72
|
-
allCreateSource.push(
|
|
73
|
-
console.log("
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
allCreateSource.push(referenceRelaSchemaAttributeTree);
|
|
64
|
+
console.log("referenceRelaSchemaAttributeTree finish");
|
|
76
65
|
} else {
|
|
77
|
-
throw Error(`Generate attribute tree schema Invalid generateName:${settings.generateName} `);
|
|
78
|
-
}
|
|
79
66
|
|
|
67
|
+
if (!settings || !settings.generateName || !settings.objType || !settings.attributeTag) {
|
|
68
|
+
validateObjType(settings.objType);
|
|
69
|
+
throw new Error("Invalid settings object. Must contain objType and attributeTag properties.");
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
if (settings.generateName === "mainAttributeTree") {
|
|
73
|
+
let objSchemaAttributeTree = await modules.mainAttributeTreeSchema(
|
|
74
|
+
_izContext,
|
|
75
|
+
settings,
|
|
76
|
+
srcPath
|
|
77
|
+
);
|
|
78
|
+
allCreateSource.push(...objSchemaAttributeTree);
|
|
79
|
+
console.log("objSchemaAttributeTree finish");
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
let relaSchemaAttributeTree = await modules.relaAttributeTreeSchema(
|
|
83
|
+
_izContext,
|
|
84
|
+
settings,
|
|
85
|
+
srcPath
|
|
86
|
+
);
|
|
87
|
+
allCreateSource.push(relaSchemaAttributeTree);
|
|
88
|
+
console.log("relaSchemaAttributeTree finish");
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
} else {
|
|
92
|
+
throw Error(`Generate attribute tree schema Invalid generateName:${settings.generateName} `);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
80
95
|
_izContext.logger.debug("allCreateSource is", allCreateSource);
|
|
81
96
|
return [...allCreateSource];
|
|
82
97
|
} catch (error) {
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
console.log("====== process referenceRelationship =====");
|
|
20
|
+
|
|
21
|
+
const path = require('path');
|
|
22
|
+
const fs = require('fs');
|
|
23
|
+
const yaml = require("yaml")
|
|
24
|
+
const { firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
25
|
+
const {
|
|
26
|
+
SOURCE_PATH,
|
|
27
|
+
SAVE_FILE_NAME,
|
|
28
|
+
PREFIX_RELATIONSHIP,
|
|
29
|
+
ATTRIBUTE_TAG
|
|
30
|
+
} = require('../../../../MainLibs/src/Consts');
|
|
31
|
+
const templatePath = path.join(__dirname, "./tempReferenceRelationshipSchema.ejs");
|
|
32
|
+
// const getObjectSchema = require("@izara_project/izara-shared-service-schemas/src/")
|
|
33
|
+
// const modules = {
|
|
34
|
+
// validateAddOnDataStructure: require('../../../libs/ValidateAddOnDataStructure')
|
|
35
|
+
// };
|
|
36
|
+
|
|
37
|
+
// const configPath = path.join(srcPath, '../../config/serverless.config.yml');
|
|
38
|
+
// const serverlessConfig = fs.readFileSync(configPath, 'utf8');
|
|
39
|
+
// const config = yaml.parse(serverlessConfig);
|
|
40
|
+
// const serviceTag = config.main_config.iz_serviceTag;
|
|
41
|
+
|
|
42
|
+
async function data(
|
|
43
|
+
_izContext,
|
|
44
|
+
settings,
|
|
45
|
+
srcPath
|
|
46
|
+
) {
|
|
47
|
+
console.log("settings:::::::::", settings)
|
|
48
|
+
// settings:{
|
|
49
|
+
// generateName: "referenceAttributeTree",
|
|
50
|
+
// objectType: "School",
|
|
51
|
+
// attributeTag: "primaryEducation",
|
|
52
|
+
// attributeTreeServiceTag: "primaryEducation"
|
|
53
|
+
// }
|
|
54
|
+
|
|
55
|
+
let generateRefRelationships = [];
|
|
56
|
+
|
|
57
|
+
generateRefRelationships.push(
|
|
58
|
+
{
|
|
59
|
+
objectType: settings.objectType,
|
|
60
|
+
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(settings.attributeTag) + ATTRIBUTE_TAG.attributeTagLink,
|
|
61
|
+
relationshipServiceTag: settings.attributeTreeServiceTag,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
objectType: settings.objectType,
|
|
65
|
+
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(settings.attributeTag) + ATTRIBUTE_TAG.attributeTagLink,
|
|
66
|
+
relationshipServiceTag: settings.attributeTreeServiceTag,
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
templatePath: templatePath,
|
|
72
|
+
templateData: { datas: generateRefRelationships },
|
|
73
|
+
setting: {
|
|
74
|
+
savePath: path.join(srcPath, SOURCE_PATH.generatedRefRelationshipAttribute),
|
|
75
|
+
hookPath: path.join(srcPath, "schemaHook", "refRelationshipAttribute", "/"),
|
|
76
|
+
saveFileName: SAVE_FILE_NAME.refObjectRelationship,
|
|
77
|
+
fileExtension: ".js",
|
|
78
|
+
isAppend: true
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
module.exports = data
|
|
@@ -32,7 +32,7 @@ const { createBasicRelationshipsProperties } = require("../../../../GenerateCode
|
|
|
32
32
|
const templatePath = path.join(__dirname, "./template.ejs");
|
|
33
33
|
|
|
34
34
|
const modules = {
|
|
35
|
-
validateAddOnDataStructure: require('
|
|
35
|
+
validateAddOnDataStructure: require('../../../../reStructure/libs/ValidateAddOnDataStructure')
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
async function data(_izContext, settings, srcPath) {
|
|
@@ -19,10 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
19
19
|
|
|
20
20
|
module.exports = {
|
|
21
21
|
TemplateAndData: {
|
|
22
|
-
|
|
23
|
-
mainAttributeTree: './TemplateData/attributeTreeSchema/generateTemplateData.js',
|
|
24
|
-
propertyNode: './TemplateData/propertyNodeSchema/generateTemplateData.js',
|
|
25
|
-
test: './TemplateData/testTemplate/data.js',
|
|
22
|
+
propertyValue: './TemplateData/propertyValueSchema/generateTemplateData.js',
|
|
26
23
|
},
|
|
27
24
|
Plugin: {
|
|
28
25
|
|