@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
package/package.json
CHANGED
|
@@ -78,7 +78,8 @@ const TOPIC_NAME_GENERATE_CODE = {
|
|
|
78
78
|
reservedLimitComplete: "ReservedLimitComplete",
|
|
79
79
|
createPresignUrl: "CreatePresignUrl",
|
|
80
80
|
flowSchemaOwnTopicComplete: "FlowSchemaOwnTopicComplete",
|
|
81
|
-
flowSchemaOwnTopicEndpointComplete: "
|
|
81
|
+
flowSchemaOwnTopicEndpointComplete: "FlowSchemaOwnTopicEndpointComplete",
|
|
82
|
+
createRecordComplete: "CreateRecordComplete"
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
const GRAPH_HANDLER_SERVICE_NAME = {
|
|
@@ -82,11 +82,11 @@ function validateSchemaMiddleware(
|
|
|
82
82
|
middleware.setServiceSchema(
|
|
83
83
|
schemaFunctionPerAction[action],
|
|
84
84
|
explodeDataPerAction[action],
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
{
|
|
86
|
+
// objectType: objectType,
|
|
87
|
+
// specificFieldNames: setting?.specificFieldNames ? setting.specificFieldNames : [],
|
|
88
|
+
action: action
|
|
89
|
+
},
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -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 }
|
|
@@ -28,7 +28,7 @@ const { firstLetterUpperCase: upperCase } = require("./Utils")
|
|
|
28
28
|
const { getGraphServiceNameFromGraphServerTagWithCache, getGraphServiceTagWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig');
|
|
29
29
|
|
|
30
30
|
const DEFAULT_HANDLER_PER_ACTION = {
|
|
31
|
-
[ACTIONS.create]: [HANDLER.hdrApi, HANDLER.hdrSqs],
|
|
31
|
+
[ACTIONS.create]: [HANDLER.hdrApi, HANDLER.hdrSqs, HANDLER.hdrInv],
|
|
32
32
|
[ACTIONS.update]: [HANDLER.hdrApi, HANDLER.hdrSqs],
|
|
33
33
|
[ACTIONS.get]: [HANDLER.hdrApi, HANDLER.hdrInv],
|
|
34
34
|
[ACTIONS.delete]: [HANDLER.hdrApi, HANDLER.hdrSqs]
|
|
@@ -116,22 +116,31 @@ const SOURCE_PATH = {
|
|
|
116
116
|
resourceLocationRelationshipPerAction: 'src/generatedCode/RelationshipPerAction/source/',
|
|
117
117
|
resourceLocationTranslateId: 'src/generatedCode/TranslateId/source/',
|
|
118
118
|
resourceLocationProcessLogical: "src/generatedCode/ProcessLogical/source/",
|
|
119
|
+
// ** FlowSchema
|
|
119
120
|
webSocket: "../src/generatedCode/FlowSchema/UploadS3/",
|
|
120
121
|
resourceLocationWebSocket: "src/generatedCode/FlowSchema/UploadS3/",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
// * FlowSchema event
|
|
123
|
+
flowSchema: "../src/generatedCode/FlowSchema/",
|
|
124
|
+
resourceLocationFlowSchema: "src/generatedCode/FlowSchema/",
|
|
125
|
+
// * FlowSchema event
|
|
125
126
|
flowSchemaEventBridge: "../src/generatedCode/FlowSchema/EventBridge/",
|
|
126
127
|
resourceLocationFlowSchemaEventBridge: "src/generatedCode/FlowSchema/EventBridge/",
|
|
128
|
+
// * FlowSchema Register
|
|
129
|
+
flowSchemaRegister: "../src/generatedCode/FlowSchema/Register/",
|
|
130
|
+
resourceLocationFlowSchemaRegister: "src/generatedCode/FlowSchema/Register/",
|
|
131
|
+
|
|
127
132
|
generateCodeLib: "../src/generatedCode/libs/source/",
|
|
128
133
|
logicalFunctionHook: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source/",
|
|
129
134
|
resourceLocationLogicalFunctionHook: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookLogicFunction/source",
|
|
130
135
|
generatedCodeHookFunction: "../src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
131
136
|
resourceLocationGeneratedCodeHookFunction: "src/generatedCode/WebSocket/source/FlowSchemaHook/HookFunctionGeneratedCode/source/",
|
|
132
|
-
generatedAttributeTree: "../src/schemas/generatedCode/
|
|
137
|
+
generatedAttributeTree: "../src/schemas/generatedCode/attributeTree/",
|
|
138
|
+
generatedPropertyValue: "../src/schemas/generatedCode/propertyValue/",
|
|
139
|
+
generatedRefRelationshipAttribute: "../src/schemas/generatedCode/refRelationshipAttribute/",
|
|
133
140
|
endpointPerService: "../src/generatedCode/ActionEndpoint/source/",
|
|
134
|
-
resourceLocationHandlerEndpointPerService: "src/generatedCode/ActionEndpoint/source/"
|
|
141
|
+
resourceLocationHandlerEndpointPerService: "src/generatedCode/ActionEndpoint/source/",
|
|
142
|
+
createRecordComplete: "../src/generatedCode/CreateRecordComplete/",
|
|
143
|
+
resourceLocationCreateRecordComplete: "src/generatedCode/CreateRerordComplete/"
|
|
135
144
|
};
|
|
136
145
|
|
|
137
146
|
const DEFAULT_LAMBDA_ROLE_PER_ACTION = {
|
|
@@ -228,9 +237,11 @@ const SAVE_FILE_NAME = {
|
|
|
228
237
|
flowSchema: "flowSchema",
|
|
229
238
|
S3Bucket: "generated-s3-bucket",
|
|
230
239
|
sharedResourceYaml: "generate-SharedResource",
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
240
|
+
objectRelationship: "ObjectRelationships",
|
|
241
|
+
refObjectRelationship: "RefObjectRelationships",
|
|
242
|
+
objectSchema: "ObjectFieldSchema",
|
|
243
|
+
|
|
244
|
+
|
|
234
245
|
};
|
|
235
246
|
|
|
236
247
|
const FUNCTION_NAME = {
|
|
@@ -263,6 +274,9 @@ const FUNCTION_NAME = {
|
|
|
263
274
|
flowSchemaOwnTopicEndpoint: "flowSchemaOwnTopicEndpoint",
|
|
264
275
|
flowSchemaOwnTopicEndpointComplete: "flowSchemaOwnTopicEndpointComplete",
|
|
265
276
|
flowSchemaExternalTopic: "externalTopic",
|
|
277
|
+
flowSchemaEventBridge: "flowSchemaEventBridge",
|
|
278
|
+
createRecordComplete: "createRecordComplete",
|
|
279
|
+
flowSchemaRegister: "register",
|
|
266
280
|
};
|
|
267
281
|
|
|
268
282
|
const SHORT_FUNCTION_NAME = {
|
|
@@ -382,11 +396,16 @@ const SOURCE_GENERATE_IAM_ROLE = {
|
|
|
382
396
|
PerActionEndpoint: "PerActionEndpoint",
|
|
383
397
|
ExternalTopicRole: "ExternalTopic",
|
|
384
398
|
EventBridge: "EventBridge",
|
|
399
|
+
CreateRecordComplete: "CreateRecordComplete",
|
|
400
|
+
RegisterRole: "Register",
|
|
385
401
|
};
|
|
386
402
|
|
|
387
403
|
const ADD_ON_DATA_STRUCTURE_TYPE = {
|
|
388
404
|
versionedData: "versionedData",
|
|
389
|
-
attributeTree: "attributeTree"
|
|
405
|
+
attributeTree: "attributeTree",
|
|
406
|
+
propertyNode: "propertyNode",
|
|
407
|
+
translation: "translation",
|
|
408
|
+
|
|
390
409
|
};
|
|
391
410
|
|
|
392
411
|
const ATTRIBUTE_TAG = {
|
|
@@ -396,6 +415,11 @@ const ATTRIBUTE_TAG = {
|
|
|
396
415
|
attributeTagPropertyLabel: "PropertyLabel",
|
|
397
416
|
};
|
|
398
417
|
|
|
418
|
+
const PROPERTYVALUE_TAG = {
|
|
419
|
+
property: "PropertyValue",
|
|
420
|
+
propertyLabel: "PropertyLabel",
|
|
421
|
+
};
|
|
422
|
+
|
|
399
423
|
const FIELD_NAME_TPYE = {
|
|
400
424
|
identifiers: "identifiers",
|
|
401
425
|
nonIdentifiers: "nonIdentifiers",
|
|
@@ -439,10 +463,10 @@ function fieldNameSetting(fieldNameType) {
|
|
|
439
463
|
},
|
|
440
464
|
[FIELD_NAME_TPYE.randomOnCreateFieldName]: {
|
|
441
465
|
type: "string",
|
|
442
|
-
requiredOnCreate:
|
|
466
|
+
requiredOnCreate: false,
|
|
443
467
|
optionalOnCreate: false,
|
|
444
468
|
canUpdate: false,
|
|
445
|
-
randomOnCreate:
|
|
469
|
+
randomOnCreate: true,
|
|
446
470
|
validation: {
|
|
447
471
|
pattern: stringValidation
|
|
448
472
|
}
|
|
@@ -525,6 +549,13 @@ async function getStorageResourceFromObjectSchemas(_izContext, allObjSchemas) {
|
|
|
525
549
|
return { resourceGraphServiceTag: [...resourceGraphServiceTag], resourceDynamoTableName: [...resourceDynamoTableName] }
|
|
526
550
|
}
|
|
527
551
|
|
|
552
|
+
const FLOW_SCHEMA_EVENT_TYPE = {
|
|
553
|
+
s3: "s3",
|
|
554
|
+
ownTopic: "ownTopic",
|
|
555
|
+
extTopic: "extTopic",
|
|
556
|
+
eventBridge: "eventBridge",
|
|
557
|
+
}
|
|
558
|
+
|
|
528
559
|
module.exports = {
|
|
529
560
|
ACTIONS,
|
|
530
561
|
DEFAULT_HANDLER_PER_ACTION,
|
|
@@ -554,8 +585,10 @@ module.exports = {
|
|
|
554
585
|
FIELD_NAME_TPYE,
|
|
555
586
|
ADD_ON_DATA_STRUCTURE_TYPE,
|
|
556
587
|
ATTRIBUTE_TAG,
|
|
588
|
+
PROPERTYVALUE_TAG,
|
|
557
589
|
PREFIX_RELATIONSHIP,
|
|
558
590
|
checkDynamoTypeRelationship,
|
|
559
591
|
createDynamoDbComponentByLinks,
|
|
560
|
-
getStorageResourceFromObjectSchemas
|
|
592
|
+
getStorageResourceFromObjectSchemas,
|
|
593
|
+
FLOW_SCHEMA_EVENT_TYPE
|
|
561
594
|
}
|
|
@@ -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
|
|
|
@@ -0,0 +1,103 @@
|
|
|
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 attri ");
|
|
22
|
+
const { join } = require('path');
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// const { data: mainAttributeData } = require('./mainAttributeTree/data');
|
|
26
|
+
|
|
27
|
+
// const serviceSchemaCore = require("@izara_project/izara-core-library-service-schemas");
|
|
28
|
+
// const getObjectSchema = serviceSchemaCore.getObjectSchema;
|
|
29
|
+
|
|
30
|
+
const serviceSchemaShared = require('@izara_project/izara-shared-service-schemas');
|
|
31
|
+
const { validateObjType } = serviceSchemaShared.validateObjType
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const modules = {
|
|
35
|
+
mainAttributeTreeSchema: require('./mainAttributeTree/data'),
|
|
36
|
+
relaAttributeTreeSchema: require('./relationshipSchema/data'),
|
|
37
|
+
referenceRelaAttributeTreeSchema: require('./referenceRelationshipSchema/data')
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Generates code with templates for different actions
|
|
41
|
+
* @param {Object} _izContext - Context object
|
|
42
|
+
* @param {string} objSchemaPath - Path to the schema
|
|
43
|
+
* @returns {Array} Array of generated code parameters
|
|
44
|
+
*/
|
|
45
|
+
async function generateCodeWithTemplate(
|
|
46
|
+
_izContext,
|
|
47
|
+
objSchemaPath,
|
|
48
|
+
settings
|
|
49
|
+
) {
|
|
50
|
+
try {
|
|
51
|
+
let allCreateSource = [];
|
|
52
|
+
const srcPath = join(objSchemaPath, '../');
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if (settings.generateName === "referenceAttributeTree") {
|
|
56
|
+
console.log("case: generateName === referenceAttributeTree");
|
|
57
|
+
|
|
58
|
+
let referenceRelaSchemaAttributeTree = await modules.referenceRelaAttributeTreeSchema(
|
|
59
|
+
_izContext,
|
|
60
|
+
settings,
|
|
61
|
+
srcPath
|
|
62
|
+
);
|
|
63
|
+
allCreateSource.push(referenceRelaSchemaAttributeTree);
|
|
64
|
+
console.log("referenceRelaSchemaAttributeTree finish");
|
|
65
|
+
} else {
|
|
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
|
+
};
|
|
95
|
+
_izContext.logger.debug("allCreateSource is", allCreateSource);
|
|
96
|
+
return [...allCreateSource];
|
|
97
|
+
} catch (error) {
|
|
98
|
+
_izContext.logger.error('Error generating code with template attribute tree schema:', error);
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
module.exports = generateCodeWithTemplate;
|
|
@@ -4,13 +4,9 @@ let { pattern } = izara.validatorSchema.stringNotEmpty(); // should not be empty
|
|
|
4
4
|
module.exports = [
|
|
5
5
|
{
|
|
6
6
|
objectType: "<%- objectType %>",
|
|
7
|
-
|
|
8
|
-
//(<
|
|
9
|
-
//(</
|
|
10
|
-
},
|
|
11
|
-
overwriteGeneratedMainFunction: [
|
|
12
|
-
//(<overwriteGeneratedMainFunction<%- objectType %>>)
|
|
13
|
-
//(</overwriteGeneratedMainFunction<%- objectType %>>)
|
|
7
|
+
addOnDataStructure: [ // optional, add for additional setting to objectType
|
|
8
|
+
//(<addOnDataStructure<%- objectType %>>)
|
|
9
|
+
//(</addOnDataStructure<%- objectType %>>)
|
|
14
10
|
],
|
|
15
11
|
canDelete: true,
|
|
16
12
|
storageResources: <%- storageResources %>,
|
|
@@ -0,0 +1,134 @@
|
|
|
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("=== attribute tree schemas ===");
|
|
21
|
+
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const fs = require('fs');
|
|
24
|
+
|
|
25
|
+
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
SOURCE_PATH,
|
|
29
|
+
ADD_ON_DATA_STRUCTURE_TYPE,
|
|
30
|
+
ATTRIBUTE_TAG,
|
|
31
|
+
fieldNameSetting,
|
|
32
|
+
FIELD_NAME_TPYE,
|
|
33
|
+
SAVE_FILE_NAME
|
|
34
|
+
} = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
const modules = {
|
|
38
|
+
validateAddOnDataStructure: require('../../../libs/ValidateAddOnDataStructure')
|
|
39
|
+
}
|
|
40
|
+
const templatePath = path.join(__dirname, "./attributeLinkTemplate.ejs");
|
|
41
|
+
|
|
42
|
+
async function data(_izContext, settings, srcPath) {
|
|
43
|
+
|
|
44
|
+
let [returnValue, errorFounds] = await modules.validateAddOnDataStructure(_izContext, settings);
|
|
45
|
+
|
|
46
|
+
if (returnValue.hasOwnProperty("addOnAttributeTree") && errorFounds.length > 0) {
|
|
47
|
+
errorFounds.push(`Not have data addOnAttributeTree and have error:${errorFounds}`)
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
if (errorFounds.length > 0) {
|
|
51
|
+
throw Error(errorFounds)
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const addOnAttributeTree = returnValue.addOnAttributeTree;
|
|
55
|
+
const storageResources = returnValue.objectSchema.storageResources; // storageResource from main objectType
|
|
56
|
+
const storageResourceTag = Object.keys(storageResources); // storage ResourceTag from main objectType
|
|
57
|
+
const compositeKeyDeliminator = returnValue.objectSchema.compositeKeyDeliminator;
|
|
58
|
+
|
|
59
|
+
let attributeTreeObjSchemas = [];
|
|
60
|
+
let createSources = [];
|
|
61
|
+
|
|
62
|
+
attributeTreeObjSchemas.push(
|
|
63
|
+
{ // {subject}
|
|
64
|
+
objectType: addOnAttributeTree.attributeTreeTag,
|
|
65
|
+
fieldNames: {
|
|
66
|
+
[addOnAttributeTree.attributeTreeTag + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName),
|
|
67
|
+
},
|
|
68
|
+
identifiers: [
|
|
69
|
+
{
|
|
70
|
+
type: "identifier",
|
|
71
|
+
fieldName: addOnAttributeTree.attributeTreeTag + "Id"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{ // {subject}Link
|
|
76
|
+
objectType: addOnAttributeTree.attributeTreeTag + ATTRIBUTE_TAG.attributeTagLink,
|
|
77
|
+
fieldNames: {
|
|
78
|
+
[addOnAttributeTree.attributeTreeTag + ATTRIBUTE_TAG.attributeTagLink + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName)
|
|
79
|
+
},
|
|
80
|
+
identifiers: [
|
|
81
|
+
{
|
|
82
|
+
type: "identifier",
|
|
83
|
+
fieldName: addOnAttributeTree.attributeTreeTag + ATTRIBUTE_TAG.attributeTagLink + "Id"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{ //{subject}Label
|
|
88
|
+
objectType: addOnAttributeTree.attributeTreeTag + ATTRIBUTE_TAG.attributeTagLabel,
|
|
89
|
+
fieldNames: {
|
|
90
|
+
[addOnAttributeTree.attributeTreeTag + ATTRIBUTE_TAG.attributeTagLabel + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName)
|
|
91
|
+
},
|
|
92
|
+
identifiers: [
|
|
93
|
+
{
|
|
94
|
+
type: "identifier",
|
|
95
|
+
fieldName: `${addOnAttributeTree.attributeTreeTag + ATTRIBUTE_TAG.attributeTagLabel}Id`
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
)
|
|
101
|
+
for (let attributeTreeObjSchema of attributeTreeObjSchemas) {
|
|
102
|
+
Object.assign(attributeTreeObjSchema, {
|
|
103
|
+
storageResources: storageResources, // add storageResources
|
|
104
|
+
compositeKeyDeliminator: compositeKeyDeliminator
|
|
105
|
+
})
|
|
106
|
+
for (let attributeTreeFieldName of Object.values(attributeTreeObjSchema.fieldNames)) {
|
|
107
|
+
Object.assign(attributeTreeFieldName, { storageResourceTags: storageResourceTag }) // add storageResourceTags for each fieldName
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
_izContext.logger.debug("check is attributeTreeObjSchemas", attributeTreeObjSchemas)
|
|
111
|
+
for (const attributeTreeObjSchema of attributeTreeObjSchemas) {
|
|
112
|
+
createSources.push({
|
|
113
|
+
templatePath: templatePath,
|
|
114
|
+
templateData: {
|
|
115
|
+
fieldNames: JSON.stringify(attributeTreeObjSchema.fieldNames, null, 2),
|
|
116
|
+
identifiers: JSON.stringify(attributeTreeObjSchema.identifiers, null, 2),
|
|
117
|
+
objectType: attributeTreeObjSchema.objectType,
|
|
118
|
+
storageResources: JSON.stringify(attributeTreeObjSchema.storageResources, null, 2),
|
|
119
|
+
compositeKeyDeliminator: attributeTreeObjSchema.compositeKeyDeliminator
|
|
120
|
+
},
|
|
121
|
+
setting: {
|
|
122
|
+
savePath: path.join(srcPath, SOURCE_PATH.generatedAttributeTree, attributeTreeObjSchema.objectType + "/"),
|
|
123
|
+
hookPath: path.join(srcPath, "schemaHook", "attributeTree", attributeTreeObjSchema.objectType, "/"),
|
|
124
|
+
saveFileName: SAVE_FILE_NAME.objectSchema,
|
|
125
|
+
fileExtension: ".js",
|
|
126
|
+
isAppend: false
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return createSources;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
module.exports = data
|
|
@@ -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
|