@izara_project/izara-market-library-service-schemas 1.0.49 → 1.0.50
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/index.js +3 -1
- package/package.json +3 -3
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +28 -29
- package/src/GenerateCodeLibs/src/TranslateIdsLibs.js +9 -6
- package/src/MainLibs/src/Consts.js +29 -23
- package/src/MainLibs/src/Utils.js +4 -4
- package/src/reStructure/GenerateCode.js +3 -3
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/template.ejs +3 -3
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +24 -8
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +8 -3
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +7 -2
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +7 -2
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +0 -1
- package/src/reStructure/TemplateData/findData/GetByStorage/getByDynamo.ejs +5 -4
- package/src/reStructure/TemplateData/findData/GetByStorage/getByGraph.ejs +12 -32
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +32 -62
- package/src/reStructure/TemplateData/findData/generateTemplateData.js +2 -2
- package/src/reStructure/TemplateData/findData/handler/template.ejs +1 -2
- package/src/reStructure/TemplateData/findData/mainFunction/data.js +19 -12
- package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/template.ejs +0 -15
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/mainFunction/data.js +4 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/mainFunction/template.ejs +9 -42
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +0 -10
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +2 -14
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +2 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/data.js +14 -17
- package/src/reStructure/TemplateData/flowSchema/flowStep/handler/data.js +15 -18
- package/src/reStructure/TemplateData/flowSchema/flowStep/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/data.js +16 -19
- package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/data.js +21 -19
- package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/template.ejs +20 -6
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +33 -12
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/functionYaml/data.js +128 -0
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/functionYaml/templateApi.ejs +20 -0
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/functionYaml/templateInv.ejs +13 -0
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/handler/data.js +85 -0
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/handler/templateApi.ejs +80 -0
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/handler/templateInv.ejs +47 -0
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/mainFunction/data.js +74 -0
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/mainFunction/template.ejs +96 -0
- package/src/reStructure/TemplateData/flowSchema/register/complete/handler/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +6 -7
- package/src/reStructure/TemplateData/flowSchema/templateBystatusType/storedCacheTemplate.ejs +4 -5
- package/src/reStructure/TemplateData/flowSchema/templateBystatusType/triggerCacheTemplate.ejs +2 -7
- package/src/reStructure/TemplateData/generateRole/data.js +0 -20
- package/src/reStructure/TemplateData/generateRole/template.ejs +4 -2
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +18 -7
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +10 -10
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +10 -10
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +2 -2
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +5 -5
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +2 -2
package/index.js
CHANGED
|
@@ -17,11 +17,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
+
|
|
21
|
+
|
|
20
22
|
module.exports = {
|
|
21
23
|
templateMgr: require('./src/TemplateManager'),
|
|
22
24
|
sourceMgr: require('./src/SourceManager'),
|
|
23
25
|
generateCodeLibs: require('./src/GenerateCodeLibs'),
|
|
24
|
-
|
|
26
|
+
utils: require('./src/MainLibs'),
|
|
25
27
|
generateSchemaWithTemplate: require('./src/TemplateManager/src/GenerateSchema').generateSchemaWithTemplate,
|
|
26
28
|
generateCodeWithTemplate: require('./src/reStructure/GenerateCode').generateCodeWithTemplate,
|
|
27
29
|
generateSchema: require('./src/reStructure/GenerateSchema')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-market-library-service-schemas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.50",
|
|
4
4
|
"description": "Schemas for Izara Market project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@izara_project/izara-core-library-core": "^1.0.19",
|
|
25
25
|
"@izara_project/izara-core-library-external-request": "^1.0.20",
|
|
26
26
|
"@izara_project/izara-core-library-logger": "^1.0.7",
|
|
27
|
-
"@izara_project/izara-core-library-service-schemas": "^1.0.
|
|
27
|
+
"@izara_project/izara-core-library-service-schemas": "^1.0.78",
|
|
28
28
|
"@izara_project/izara-core-library-sns": "^1.0.6",
|
|
29
29
|
"@izara_project/izara-core-library-sqs": "^1.0.4",
|
|
30
30
|
"@izara_project/izara-shared": "^1.0.126",
|
|
31
|
-
"@izara_project/izara-shared-service-schemas": "^1.0.
|
|
31
|
+
"@izara_project/izara-shared-service-schemas": "^1.0.23",
|
|
32
32
|
"@izara_project/izara-shared-core": "^1.0.2",
|
|
33
33
|
"ejs": "^3.1.10",
|
|
34
34
|
"js-beautify": "^1.15.4",
|
|
@@ -72,6 +72,7 @@ function validateSchemaMiddleware(
|
|
|
72
72
|
middleware,
|
|
73
73
|
// objectType,
|
|
74
74
|
action,
|
|
75
|
+
bucketName = consts.OBJECT_SCHEMA_BUCKET_NAME
|
|
75
76
|
// setting = {}
|
|
76
77
|
) {
|
|
77
78
|
|
|
@@ -85,7 +86,8 @@ function validateSchemaMiddleware(
|
|
|
85
86
|
{
|
|
86
87
|
// objectType: objectType,
|
|
87
88
|
// specificFieldNames: setting?.specificFieldNames ? setting.specificFieldNames : [],
|
|
88
|
-
action: action
|
|
89
|
+
action: action,
|
|
90
|
+
bucketName: bucketName
|
|
89
91
|
},
|
|
90
92
|
);
|
|
91
93
|
}
|
|
@@ -106,7 +108,7 @@ async function validateSchemaPerRecord(
|
|
|
106
108
|
lambdaFunctionName,
|
|
107
109
|
objType,
|
|
108
110
|
action,
|
|
109
|
-
setting
|
|
111
|
+
setting = { bucketName: consts.OBJECT_SCHEMA_BUCKET_NAME }
|
|
110
112
|
) {
|
|
111
113
|
try {
|
|
112
114
|
record._izContext.logger.debug("validateSchemaPerRecord: ",
|
|
@@ -348,7 +350,7 @@ async function messageToDlq(record, messageFailError, queueUrl) {
|
|
|
348
350
|
* @param {Object} _izContext
|
|
349
351
|
* @param {Object} objectSchema
|
|
350
352
|
*/
|
|
351
|
-
async function createGetDataDetails(_izContext, objectSchema) {
|
|
353
|
+
async function createGetDataDetails(_izContext, objectSchema, settings = { bucketName: consts.OBJECT_SCHEMA_BUCKET_NAME }) {
|
|
352
354
|
|
|
353
355
|
// group versionedData per storageTag
|
|
354
356
|
// or should group versionedData per graph serviceTag
|
|
@@ -395,7 +397,7 @@ async function createGetDataDetails(_izContext, objectSchema) {
|
|
|
395
397
|
if (storageData.storageType === consts.STORAGE_TYPES.graph) {
|
|
396
398
|
|
|
397
399
|
let useStorageTag = storageTag;
|
|
398
|
-
let graphServiceTag = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageData.graphServerTag);
|
|
400
|
+
let graphServiceTag = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageData.graphServerTag, settings.bucketName);
|
|
399
401
|
|
|
400
402
|
// check duplicate graph serviceTag
|
|
401
403
|
if (!graphStorageTagPerGraphServiceTag.hasOwnProperty(graphServiceTag)) {
|
|
@@ -544,7 +546,7 @@ async function createGetDataDetails(_izContext, objectSchema) {
|
|
|
544
546
|
* @param {Object} objectSchema
|
|
545
547
|
* @param {Object} reqIdentifiers - input identifier from calling function
|
|
546
548
|
*/
|
|
547
|
-
async function generateDynamoDbIdentifiers(_izContext, objectSchema, reqIdentifiers) {
|
|
549
|
+
async function generateDynamoDbIdentifiers(_izContext, objectSchema, reqIdentifiers, bucketName = consts.OBJECT_SCHEMA_BUCKET_NAME) {
|
|
548
550
|
|
|
549
551
|
// start create identifiers for dynamo
|
|
550
552
|
let dynamoIdentifiers = {};
|
|
@@ -558,7 +560,7 @@ async function generateDynamoDbIdentifiers(_izContext, objectSchema, reqIdentifi
|
|
|
558
560
|
for (let fieldName of identifier.fieldNames) {
|
|
559
561
|
concatenateValue.push(reqIdentifiers[fieldName]);
|
|
560
562
|
|
|
561
|
-
let deliminatorTreeFieldName = await generateDeliminatorTreePerFieldName(_izContext, fieldName, objectSchema.fieldNames[fieldName]);
|
|
563
|
+
let deliminatorTreeFieldName = await generateDeliminatorTreePerFieldName(_izContext, fieldName, objectSchema.fieldNames[fieldName], {}, bucketName);
|
|
562
564
|
_izContext.logger.debug("deliminatorTreeFieldName: ", deliminatorTreeFieldName);
|
|
563
565
|
|
|
564
566
|
if (deliminatorTreeFieldName[fieldName]?.deliminatorList?.[deliminator]) {
|
|
@@ -615,15 +617,15 @@ const generateDynamoDbIdentifiersWithCache = inMemoryCacheLib(
|
|
|
615
617
|
* @param {Object} dynamoStorageResource
|
|
616
618
|
* @param {Object} reqIdentifiers
|
|
617
619
|
*/
|
|
618
|
-
async function dynamoDbIdentifiersByStorageResource(_izContext, objectSchema, dynamoStorageResource, reqIdentifiers) {
|
|
620
|
+
async function dynamoDbIdentifiersByStorageResource(_izContext, objectSchema, dynamoStorageResource, reqIdentifiers, bucketName = consts.OBJECT_SCHEMA_BUCKET_NAME) {
|
|
619
621
|
|
|
620
|
-
let dynamoIdentifiers = await generateDynamoDbIdentifiersWithCache(_izContext, objectSchema, reqIdentifiers)
|
|
622
|
+
let dynamoIdentifiers = await generateDynamoDbIdentifiersWithCache(_izContext, objectSchema, reqIdentifiers, bucketName)
|
|
621
623
|
|
|
622
624
|
let identifiersByStorageResource = {};
|
|
623
625
|
|
|
624
626
|
if (dynamoStorageResource.groupByPartitionKeyField) {
|
|
625
627
|
|
|
626
|
-
let deliminatorTreeIdentifiers = await generateDeliminatorTreeIdentifier(_izContext, objectSchema);
|
|
628
|
+
let deliminatorTreeIdentifiers = await generateDeliminatorTreeIdentifier(_izContext, objectSchema, bucketName);
|
|
627
629
|
_izContext.logger.debug("deliminatorTree: ", deliminatorTreeIdentifiers);
|
|
628
630
|
|
|
629
631
|
let compositeKeyDeliminator = objectSchema.compositeKeyDeliminator || consts.DEFAULT_IDENTIFIER_DELIMINATOR;
|
|
@@ -697,32 +699,31 @@ function collectGetData(_izContext, getResults, objectSchema, returnSystemFields
|
|
|
697
699
|
|
|
698
700
|
// this process will add result from graph and dynamo to collectedData object by add identifiers and fieldName from getData
|
|
699
701
|
if (getDataDetail.storageType === consts.STORAGE_TYPES.graph) {
|
|
700
|
-
if (getData.objInstanceFull && Object.keys(getData.objInstanceFull).length) {
|
|
701
|
-
|
|
702
|
+
if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull && Object.keys(getData.returnValue.queryResults.refactoredNodes.objInstanceFull).length) {
|
|
702
703
|
for (const getDetailFieldName of getDataDetail.fieldNames) {
|
|
703
704
|
if (addedFieldNames.has(getDetailFieldName)) {
|
|
704
705
|
continue;
|
|
705
706
|
}
|
|
706
707
|
|
|
707
|
-
if (getData.objInstanceFull.identifiers.hasOwnProperty(getDetailFieldName)) {
|
|
708
|
+
if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull.identifiers.hasOwnProperty(getDetailFieldName)) {
|
|
708
709
|
Object.assign(
|
|
709
710
|
collectedData.identifiers,
|
|
710
|
-
{ [getDetailFieldName]: getData.objInstanceFull.identifiers[getDetailFieldName] }
|
|
711
|
+
{ [getDetailFieldName]: getData.returnValue.queryResults.refactoredNodes.objInstanceFull.identifiers[getDetailFieldName] }
|
|
711
712
|
);
|
|
712
713
|
addedFieldNames.add(getDetailFieldName);
|
|
713
714
|
isFound = true;
|
|
714
|
-
} else if (getData.objInstanceFull.fields.hasOwnProperty(getDetailFieldName)) {
|
|
715
|
+
} else if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull.fields.hasOwnProperty(getDetailFieldName)) {
|
|
715
716
|
Object.assign(
|
|
716
717
|
collectedData.fields,
|
|
717
|
-
{ [getDetailFieldName]: getData.objInstanceFull.fields[getDetailFieldName] }
|
|
718
|
+
{ [getDetailFieldName]: getData.returnValue.queryResults.refactoredNodes.objInstanceFull.fields[getDetailFieldName] }
|
|
718
719
|
);
|
|
719
720
|
addedFieldNames.add(getDetailFieldName);
|
|
720
721
|
isFound = true;
|
|
721
722
|
}
|
|
722
723
|
}
|
|
723
724
|
}
|
|
724
|
-
if (getData.versionDataSystemFields || returnSystemFieldsName == true) {
|
|
725
|
-
Object.assign(collectedData.versionDataSystemFields, getData.versionDataSystemFields)
|
|
725
|
+
if (getData.returnValue.queryResults.refactoredNodes.versionDataSystemFields || returnSystemFieldsName == true) {
|
|
726
|
+
Object.assign(collectedData.versionDataSystemFields, getData.returnValue.queryResults.refactoredNodes.versionDataSystemFields)
|
|
726
727
|
}
|
|
727
728
|
} else if (getDataDetail.storageType === consts.STORAGE_TYPES.dynamoDB) {
|
|
728
729
|
for (const getDetailFieldName of getDataDetail.fieldNames) {
|
|
@@ -761,7 +762,7 @@ function collectGetData(_izContext, getResults, objectSchema, returnSystemFields
|
|
|
761
762
|
}
|
|
762
763
|
|
|
763
764
|
|
|
764
|
-
async function createUpdateDataDetail(_izContext, objectSchema) {
|
|
765
|
+
async function createUpdateDataDetail(_izContext, objectSchema, settings = { bucketName: consts.OBJECT_SCHEMA_BUCKET_NAME }) {
|
|
765
766
|
let getGraphDataDetails = {};
|
|
766
767
|
let getDynamoDbDataDetails = {};
|
|
767
768
|
let allUpdateDataDetail = {};
|
|
@@ -778,7 +779,7 @@ async function createUpdateDataDetail(_izContext, objectSchema) {
|
|
|
778
779
|
if (storageProperties.storageType === consts.STORAGE_TYPES.graph) {
|
|
779
780
|
let graphStorageTagPerGraphServiceTag = {}
|
|
780
781
|
let useStorageTag = storageTag;
|
|
781
|
-
let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag)
|
|
782
|
+
let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag, settings.bucketName)
|
|
782
783
|
if (!graphStorageTagPerGraphServiceTag.hasOwnProperty(graphServiceName)) {
|
|
783
784
|
graphStorageTagPerGraphServiceTag[graphServiceName] = storageTag;
|
|
784
785
|
_izContext.logger.debug("graphStorageTagPerGraphServiceTag", graphStorageTagPerGraphServiceTag)
|
|
@@ -825,13 +826,10 @@ async function createUpdateDataDetail(_izContext, objectSchema) {
|
|
|
825
826
|
return allUpdateDataDetail
|
|
826
827
|
}
|
|
827
828
|
|
|
828
|
-
async function createDataDetailsLib(
|
|
829
|
-
_izContext,
|
|
830
|
-
objectSchemas
|
|
831
|
-
) {
|
|
829
|
+
async function createDataDetailsLib(_izContext, objectSchemas, settings = { bucketName: consts.OBJECT_SCHEMA_BUCKET_NAME }) {
|
|
832
830
|
_izContext.logger.debug("Lib: createDataDetailsLib:", { objectSchemas: objectSchemas });
|
|
833
831
|
/**
|
|
834
|
-
* TODO: crate DataDetail now will get
|
|
832
|
+
* TODO: crate DataDetail now will get parent objectSchema if have extendObjType
|
|
835
833
|
* will split fieldNames for each serviceTag and storageREsourceTags
|
|
836
834
|
* */
|
|
837
835
|
|
|
@@ -847,7 +845,7 @@ async function createDataDetailsLib(
|
|
|
847
845
|
// _izContext.logger.debug("Loop eachStorageResourceTags", eachStorageResourceTag);
|
|
848
846
|
|
|
849
847
|
if (!storageResources.hasOwnProperty(eachStorageResourceTag)) {
|
|
850
|
-
throw new Error("storageResources is'n exist"); // should be
|
|
848
|
+
throw new Error("storageResources is'n exist"); // should be validate in step upload in s3
|
|
851
849
|
} else {
|
|
852
850
|
if (storageResources[eachStorageResourceTag].storageType == consts.STORAGE_TYPES.dynamoDB) {
|
|
853
851
|
if (createDataDetails.hasOwnProperty(eachStorageResourceTag)) {
|
|
@@ -872,7 +870,8 @@ async function createDataDetailsLib(
|
|
|
872
870
|
} else if (storageResources[eachStorageResourceTag].storageType == consts.STORAGE_TYPES.graph) {
|
|
873
871
|
let checkGraphServerTags = await serviceConfig.getGraphServiceTagWithCache(
|
|
874
872
|
_izContext,
|
|
875
|
-
storageResources[eachStorageResourceTag].graphServerTag
|
|
873
|
+
storageResources[eachStorageResourceTag].graphServerTag,
|
|
874
|
+
settings.bucketName
|
|
876
875
|
);
|
|
877
876
|
if (checkGraphServerTags) {
|
|
878
877
|
if (createDataDetails.hasOwnProperty(checkGraphServerTags)) {
|
|
@@ -896,7 +895,7 @@ async function createDataDetailsLib(
|
|
|
896
895
|
|
|
897
896
|
if (objectSchemas.hasOwnProperty("extendObjType")) {
|
|
898
897
|
if (objectSchemas.extendObjType.serviceTag !== process.env.iz_serviceTag) {
|
|
899
|
-
let parentObjectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, objectSchemas.extendObjType);
|
|
898
|
+
let parentObjectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, objectSchemas.extendObjType, settings.bucketName);
|
|
900
899
|
_izContext.logger.debug("parentObjectSchema", parentObjectSchema);
|
|
901
900
|
for (const [fieldName, fieldNameSetting] of Object.entries(parentObjectSchema.fieldNames)) {
|
|
902
901
|
for (let eachParentStorageResourceTag of fieldNameSetting.storageResourceTags) {
|
|
@@ -921,7 +920,7 @@ async function createDataDetailsLib(
|
|
|
921
920
|
return createDataDetails;
|
|
922
921
|
};
|
|
923
922
|
|
|
924
|
-
async function createDeleteDataDetail(_izContext, objectSchema) {
|
|
923
|
+
async function createDeleteDataDetail(_izContext, objectSchema, settings = { bucketName: consts.OBJECT_SCHEMA_BUCKET_NAME }) {
|
|
925
924
|
let deleteDynamoDataDetail = {};
|
|
926
925
|
let deleteGraphDataDetail = {};
|
|
927
926
|
let allDeleteDataDetail = {};
|
|
@@ -947,7 +946,7 @@ async function createDeleteDataDetail(_izContext, objectSchema) {
|
|
|
947
946
|
} else if (storageProperties.storageType === consts.STORAGE_TYPES.graph) {
|
|
948
947
|
let dataDetailPerGraphStorage = {};
|
|
949
948
|
let useStorageTag = storageTag
|
|
950
|
-
let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag);
|
|
949
|
+
let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag, settings.bucketName);
|
|
951
950
|
if (!dataDetailPerGraphStorage.hasOwnProperty(graphServiceName)) {
|
|
952
951
|
dataDetailPerGraphStorage[graphServiceName] = storageTag;
|
|
953
952
|
} else {
|
|
@@ -16,6 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
+
const { OBJECT_SCHEMA_BUCKET_NAME } = require("@izara_project/izara-core-library-service-schemas/src/Consts");
|
|
19
20
|
const getObjectSchema = require("@izara_project/izara-core-library-service-schemas/src/GetObjectSchema")
|
|
20
21
|
const identifiersObject = require("@izara_project/izara-core-library-service-schemas/src/IdentifiersObject")
|
|
21
22
|
/**
|
|
@@ -32,9 +33,9 @@ const identifiersObject = require("@izara_project/izara-core-library-service-sch
|
|
|
32
33
|
* @returns {boolean}
|
|
33
34
|
*/
|
|
34
35
|
|
|
35
|
-
async function validateFromTypeToToTypeWithRelType(_izContext, fromType, toType, relType) {
|
|
36
|
+
async function validateFromTypeToToTypeWithRelType(_izContext, fromType, toType, relType, bucketName = OBJECT_SCHEMA_BUCKET_NAME) {
|
|
36
37
|
let validateStatus;
|
|
37
|
-
let relationshipSchema = await getObjectSchema.getRelationshipSchemaWithCache(_izContext, relType);
|
|
38
|
+
let relationshipSchema = await getObjectSchema.getRelationshipSchemaWithCache(_izContext, relType, bucketName);
|
|
38
39
|
let fromObjType = relationshipSchema.links[0].from.objType
|
|
39
40
|
let toObjType = relationshipSchema.links[0].to.objType
|
|
40
41
|
|
|
@@ -48,16 +49,18 @@ async function validateFromTypeToToTypeWithRelType(_izContext, fromType, toType,
|
|
|
48
49
|
return validateStatus
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
async function
|
|
52
|
+
async function validateObjTypesAndRelType(
|
|
52
53
|
_izContext,
|
|
53
54
|
objTypes,
|
|
54
55
|
relType,
|
|
56
|
+
bucketName = OBJECT_SCHEMA_BUCKET_NAME
|
|
55
57
|
) {
|
|
56
58
|
_izContext.logger.debug("findRelationshipLink: ", {
|
|
57
59
|
objTypes,
|
|
58
|
-
relType
|
|
60
|
+
relType,
|
|
61
|
+
bucketName
|
|
59
62
|
})
|
|
60
|
-
let relationshipSchema = await getObjectSchema.getRelationshipSchemaWithCache(_izContext, relType)
|
|
63
|
+
let relationshipSchema = await getObjectSchema.getRelationshipSchemaWithCache(_izContext, relType, bucketName)
|
|
61
64
|
|
|
62
65
|
const { serviceTag: firstServiceTag, objectType: firstObjectType } = objTypes[0]
|
|
63
66
|
const { serviceTag: secondServiceTag, objectType: secondObjectType } = objTypes[1]
|
|
@@ -85,5 +88,5 @@ async function validateObjtypesAndRelType(
|
|
|
85
88
|
|
|
86
89
|
module.exports = {
|
|
87
90
|
validateFromTypeToToTypeWithRelType,
|
|
88
|
-
|
|
91
|
+
validateObjTypesAndRelType
|
|
89
92
|
}
|
|
@@ -20,7 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
const {
|
|
21
21
|
HANDLER,
|
|
22
22
|
ACTIONS,
|
|
23
|
-
STORAGE_TYPES
|
|
23
|
+
STORAGE_TYPES,
|
|
24
|
+
OBJECT_SCHEMA_BUCKET_NAME
|
|
24
25
|
} = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
25
26
|
|
|
26
27
|
const { firstLetterUpperCase: upperCase } = require("./Utils")
|
|
@@ -122,9 +123,14 @@ const SOURCE_PATH = {
|
|
|
122
123
|
// * FlowSchema event
|
|
123
124
|
flowSchema: "../src/generatedCode/FlowSchema/",
|
|
124
125
|
resourceLocationFlowSchema: "src/generatedCode/FlowSchema/",
|
|
125
|
-
|
|
126
|
+
|
|
127
|
+
// * FlowSchema eventBridge
|
|
126
128
|
flowSchemaEventBridge: "../src/generatedCode/FlowSchema/EventBridge/",
|
|
127
129
|
resourceLocationFlowSchemaEventBridge: "src/generatedCode/FlowSchema/EventBridge/",
|
|
130
|
+
// * FlowSchema lambdaSync
|
|
131
|
+
flowSchemaLambdaSync: "../src/generatedCode/FlowSchema/lambdaSync/",
|
|
132
|
+
resourceLocationFlowSchemaLambdaSync: "src/generatedCode/FlowSchema/lambdaSync/",
|
|
133
|
+
|
|
128
134
|
// * FlowSchema Register
|
|
129
135
|
flowSchemaRegister: "../src/generatedCode/FlowSchema/Register/",
|
|
130
136
|
resourceLocationFlowSchemaRegister: "src/generatedCode/FlowSchema/Register/",
|
|
@@ -304,7 +310,7 @@ const SHORT_FUNCTION_NAME = {
|
|
|
304
310
|
getRelComplete: "getRelComp"
|
|
305
311
|
}
|
|
306
312
|
|
|
307
|
-
const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) => {
|
|
313
|
+
const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas, settings = { bucketName: OBJECT_SCHEMA_BUCKET_NAME }) => {
|
|
308
314
|
const graphServiceNameSet = new Set();
|
|
309
315
|
await Promise.all(allRelSchemas.map(async relSchema => {
|
|
310
316
|
let relTag = Object.keys(relSchema)[0];
|
|
@@ -312,7 +318,7 @@ const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) =>
|
|
|
312
318
|
|
|
313
319
|
await Promise.all(Object.values(relSchemaData.storageResources).map(async storageResource => {
|
|
314
320
|
if (storageResource.storageType === STORAGE_TYPES.graph) {
|
|
315
|
-
const getGraphServiceName = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag);
|
|
321
|
+
const getGraphServiceName = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag, settings.bucketName);
|
|
316
322
|
graphServiceNameSet.add(getGraphServiceName)
|
|
317
323
|
}
|
|
318
324
|
}))
|
|
@@ -332,8 +338,8 @@ function defaultIamRolePerAction() {
|
|
|
332
338
|
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
333
339
|
},
|
|
334
340
|
[
|
|
335
|
-
resourceNames(RESOURCE_CLASSES.s3, "
|
|
336
|
-
resourceNames(RESOURCE_CLASSES.s3, "
|
|
341
|
+
resourceNames(RESOURCE_CLASSES.s3, "${self:custom.iz_serviceSchemaBucketName}/perServiceSchemas/*"),
|
|
342
|
+
resourceNames(RESOURCE_CLASSES.s3, "${self:custom.iz_serviceSchemaBucketName}/serviceConfig/GraphServerTags.json"),
|
|
337
343
|
]
|
|
338
344
|
)
|
|
339
345
|
);
|
|
@@ -342,7 +348,7 @@ function defaultIamRolePerAction() {
|
|
|
342
348
|
createIamRole(
|
|
343
349
|
{ [RESOURCE_CLASSES.s3]: ["ListBucket"] },
|
|
344
350
|
[
|
|
345
|
-
resourceNames(RESOURCE_CLASSES.s3, "
|
|
351
|
+
resourceNames(RESOURCE_CLASSES.s3, "${self:custom.iz_serviceSchemaBucketName}"),
|
|
346
352
|
]
|
|
347
353
|
)
|
|
348
354
|
);
|
|
@@ -350,12 +356,12 @@ function defaultIamRolePerAction() {
|
|
|
350
356
|
return defaultIamRole
|
|
351
357
|
};
|
|
352
358
|
|
|
353
|
-
async function getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas) {
|
|
359
|
+
async function getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas, settings = { bucketName: OBJECT_SCHEMA_BUCKET_NAME }) {
|
|
354
360
|
const graphServiceName = new Set();
|
|
355
361
|
for (const objectSchema of allObjSchemas) {
|
|
356
362
|
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
357
363
|
if (storageResource.storageType === STORAGE_TYPES.graph) {
|
|
358
|
-
let getGraphServiceName = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag)
|
|
364
|
+
let getGraphServiceName = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag, settings.bucketName)
|
|
359
365
|
graphServiceName.add(getGraphServiceName)
|
|
360
366
|
}
|
|
361
367
|
}
|
|
@@ -418,12 +424,12 @@ const ATTRIBUTE_TAG = {
|
|
|
418
424
|
attributeTagPropertyLabel: "PropertyLabel",
|
|
419
425
|
};
|
|
420
426
|
|
|
421
|
-
const
|
|
427
|
+
const PROPERTY_VALUE_TAG = {
|
|
422
428
|
property: "PropertyValue",
|
|
423
429
|
propertyLabel: "PropertyLabel",
|
|
424
430
|
};
|
|
425
431
|
|
|
426
|
-
const
|
|
432
|
+
const FIELD_NAME_TYPE = {
|
|
427
433
|
identifiers: "identifiers",
|
|
428
434
|
nonIdentifiers: "nonIdentifiers",
|
|
429
435
|
requiredOnCreateFieldName: "requiredOnCreateFieldName",
|
|
@@ -434,7 +440,7 @@ const FIELD_NAME_TPYE = {
|
|
|
434
440
|
function fieldNameSetting(fieldNameType) {
|
|
435
441
|
const stringValidation = "^[a-zA-Z0-9-_]+$"
|
|
436
442
|
return {
|
|
437
|
-
[
|
|
443
|
+
[FIELD_NAME_TYPE.identifiers]: {
|
|
438
444
|
type: "string",
|
|
439
445
|
requiredOnCreate: true,
|
|
440
446
|
optionalOnCreate: false,
|
|
@@ -444,7 +450,7 @@ function fieldNameSetting(fieldNameType) {
|
|
|
444
450
|
pattern: stringValidation
|
|
445
451
|
}
|
|
446
452
|
},
|
|
447
|
-
[
|
|
453
|
+
[FIELD_NAME_TYPE.nonIdentifiers]: {
|
|
448
454
|
type: "string",
|
|
449
455
|
requiredOnCreate: false,
|
|
450
456
|
optionalOnCreate: false,
|
|
@@ -454,7 +460,7 @@ function fieldNameSetting(fieldNameType) {
|
|
|
454
460
|
pattern: stringValidation
|
|
455
461
|
}
|
|
456
462
|
},
|
|
457
|
-
[
|
|
463
|
+
[FIELD_NAME_TYPE.requiredOnCreateFieldName]: {
|
|
458
464
|
type: "string",
|
|
459
465
|
requiredOnCreate: true,
|
|
460
466
|
optionalOnCreate: false,
|
|
@@ -464,7 +470,7 @@ function fieldNameSetting(fieldNameType) {
|
|
|
464
470
|
pattern: stringValidation
|
|
465
471
|
}
|
|
466
472
|
},
|
|
467
|
-
[
|
|
473
|
+
[FIELD_NAME_TYPE.randomOnCreateFieldName]: {
|
|
468
474
|
type: "string",
|
|
469
475
|
requiredOnCreate: false,
|
|
470
476
|
optionalOnCreate: false,
|
|
@@ -474,7 +480,7 @@ function fieldNameSetting(fieldNameType) {
|
|
|
474
480
|
pattern: stringValidation
|
|
475
481
|
}
|
|
476
482
|
},
|
|
477
|
-
[
|
|
483
|
+
[FIELD_NAME_TYPE.optionalOnCreate]: {
|
|
478
484
|
type: "string",
|
|
479
485
|
requiredOnCreate: false,
|
|
480
486
|
optionalOnCreate: true,
|
|
@@ -495,10 +501,10 @@ const PREFIX_RELATIONSHIP = {
|
|
|
495
501
|
|
|
496
502
|
function checkDynamoTypeRelationship(relationship) {
|
|
497
503
|
let storageType;
|
|
498
|
-
let
|
|
504
|
+
let relationshipTag;
|
|
499
505
|
let links;
|
|
500
506
|
for (const [relTag, relProperties] of Object.entries(relationship)) {
|
|
501
|
-
|
|
507
|
+
relationshipTag = relTag
|
|
502
508
|
for (const [storageResourceTag, storageResource] of Object.entries(relProperties.storageResources)) {
|
|
503
509
|
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
504
510
|
storageType = STORAGE_TYPES.dynamoDB;
|
|
@@ -510,7 +516,7 @@ function checkDynamoTypeRelationship(relationship) {
|
|
|
510
516
|
}
|
|
511
517
|
}
|
|
512
518
|
}
|
|
513
|
-
return [storageType,
|
|
519
|
+
return [storageType, relationshipTag, links];
|
|
514
520
|
}
|
|
515
521
|
|
|
516
522
|
function createDynamoDbComponentByLinks(link, relationshipTag) {
|
|
@@ -532,7 +538,7 @@ function createDynamoDbComponentByLinks(link, relationshipTag) {
|
|
|
532
538
|
}
|
|
533
539
|
}
|
|
534
540
|
|
|
535
|
-
async function getStorageResourceFromObjectSchemas(_izContext, allObjSchemas) {
|
|
541
|
+
async function getStorageResourceFromObjectSchemas(_izContext, allObjSchemas, settings = { bucketName: OBJECT_SCHEMA_BUCKET_NAME }) {
|
|
536
542
|
if (Array.isArray(allObjSchemas)) {
|
|
537
543
|
allObjSchemas = [allObjSchemas]
|
|
538
544
|
}
|
|
@@ -543,7 +549,7 @@ async function getStorageResourceFromObjectSchemas(_izContext, allObjSchemas) {
|
|
|
543
549
|
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
544
550
|
resourceDynamoTableName.add(storageResource.tableName);
|
|
545
551
|
} else if (storageResource.storageType === STORAGE_TYPES.graph) {
|
|
546
|
-
let graphServiceTag = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag);
|
|
552
|
+
let graphServiceTag = await getGraphServiceTagWithCache(_izContext, storageResource.graphServerTag, settings.bucketName);
|
|
547
553
|
resourceGraphServiceTag.add(graphServiceTag);
|
|
548
554
|
}
|
|
549
555
|
}
|
|
@@ -585,10 +591,10 @@ module.exports = {
|
|
|
585
591
|
S3_RESOURCE,
|
|
586
592
|
SOURCE_GENERATE_IAM_ROLE,
|
|
587
593
|
fieldNameSetting,
|
|
588
|
-
|
|
594
|
+
FIELD_NAME_TYPE,
|
|
589
595
|
ADD_ON_DATA_STRUCTURE_TYPE,
|
|
590
596
|
ATTRIBUTE_TAG,
|
|
591
|
-
|
|
597
|
+
PROPERTY_VALUE_TAG,
|
|
592
598
|
PREFIX_RELATIONSHIP,
|
|
593
599
|
checkDynamoTypeRelationship,
|
|
594
600
|
createDynamoDbComponentByLinks,
|
|
@@ -41,13 +41,13 @@ module.exports.checkOverWriteGenerateMainFunction = (objectSchema, action) => {
|
|
|
41
41
|
return overWriteStatus
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
module.exports.
|
|
45
|
-
const configPath = path.join(srcPath, '
|
|
44
|
+
module.exports.getLocalConfig = (srcPath, params) => {
|
|
45
|
+
const configPath = path.join(srcPath, '../config/serverless.config.yml');
|
|
46
46
|
const serverlessConfig = fs.readFileSync(configPath, 'utf8');
|
|
47
47
|
const config = yaml.parse(serverlessConfig);
|
|
48
|
-
const
|
|
48
|
+
const returnConfig = config.main_config[params];
|
|
49
49
|
|
|
50
|
-
return
|
|
50
|
+
return returnConfig
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// module.exports.renameObjectType = (objectSchema, srcPath) => {
|
|
@@ -35,7 +35,7 @@ const functionNameConfigYamlData = require('./TemplateData/externalService/funct
|
|
|
35
35
|
const { createSharedResource } = require('./TemplateData/generateRole/createSharedResource');
|
|
36
36
|
const { generateRole } = require('./TemplateData/generateRole/data');
|
|
37
37
|
|
|
38
|
-
async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
38
|
+
async function generateCodeWithTemplate(_izContext, objSchemaPath, settings = {}) {
|
|
39
39
|
try {
|
|
40
40
|
// console.log('objSchemaPath', objSchemaPath);
|
|
41
41
|
// --------- Prepare path -------------
|
|
@@ -69,7 +69,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
69
69
|
// console.log('Loading template:', templateName);
|
|
70
70
|
|
|
71
71
|
let generateTemplateData = require(join(__dirname, templateConfig.TemplateAndData[templateName]));
|
|
72
|
-
let createSourceResult = await generateTemplateData(_izContext, objSchemaPath);
|
|
72
|
+
let createSourceResult = await generateTemplateData(_izContext, objSchemaPath, settings);
|
|
73
73
|
|
|
74
74
|
// Filter out empty or invalid objects before adding to allCreateSource
|
|
75
75
|
if (Array.isArray(createSourceResult)) {
|
|
@@ -111,7 +111,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
111
111
|
);
|
|
112
112
|
|
|
113
113
|
if (status === false) {
|
|
114
|
-
console.log('templatePath in generateCode', templatePath)
|
|
114
|
+
// console.log('templatePath in generateCode', templatePath)
|
|
115
115
|
throw Error(errors)
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -31,7 +31,7 @@ const { <%- action %>Main } =require('./<%- firstLetterUpperCase(action) %>_Main
|
|
|
31
31
|
//validate event params in middleware before into main function
|
|
32
32
|
validateSchemaMiddleware(
|
|
33
33
|
middleware,
|
|
34
|
-
"<%- action %>"
|
|
34
|
+
"<%- action %>",
|
|
35
35
|
//(<validateSchemaSetting>
|
|
36
36
|
//</validateSchemaSetting>)
|
|
37
37
|
)
|
|
@@ -58,7 +58,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
58
58
|
record._izContext.logger.debug('record RecieveMsgOutHdrSqs', record);
|
|
59
59
|
|
|
60
60
|
let passOnProperties = [];
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
const OBJTYPE = {
|
|
63
63
|
objectType: record.body.Message.objectType,
|
|
64
64
|
serviceTag: process.env.iz_serviceTag
|
|
@@ -69,7 +69,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
69
69
|
record,
|
|
70
70
|
"<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handler) %>",
|
|
71
71
|
OBJTYPE,
|
|
72
|
-
"<%- action %>"
|
|
72
|
+
"<%- action %>",
|
|
73
73
|
//(<validateSchemaSetting>)
|
|
74
74
|
//(</validateSchemaSetting>)
|
|
75
75
|
)
|
|
@@ -33,7 +33,7 @@ const { <%- action %>Main } =require('./<%- firstLetterUpperCase(action) %>_Main
|
|
|
33
33
|
//validate event params in middleware before into main function
|
|
34
34
|
validateSchemaMiddleware(
|
|
35
35
|
middleware,
|
|
36
|
-
"<%- action %>"
|
|
36
|
+
"<%- action %>",
|
|
37
37
|
//(<validateSchemaSetting>
|
|
38
38
|
//</validateSchemaSetting>)
|
|
39
39
|
)
|
|
@@ -25,8 +25,8 @@ const recordHandlerSharedLib = require('@izara_project/izara-core-library-record
|
|
|
25
25
|
|
|
26
26
|
const { <%- action %>Main } =require('./<%- firstLetterUpperCase(action) %>_Main.js')
|
|
27
27
|
|
|
28
|
-
//(<globalVarible>
|
|
29
|
-
|
|
28
|
+
//(<globalVarible>)
|
|
29
|
+
//(</globalVarible>)
|
|
30
30
|
|
|
31
31
|
//validate event params in middleware before into main function
|
|
32
32
|
middleware.setValidatorSchema(
|
|
@@ -66,7 +66,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
66
66
|
record,
|
|
67
67
|
"<%- firstLetterUpperCase(action) %><%- firstLetterUpperCase(handler) %>",
|
|
68
68
|
OBJTYPE,
|
|
69
|
-
"<%- action %>"
|
|
69
|
+
"<%- action %>",
|
|
70
70
|
//(<validateSchemaSetting>)
|
|
71
71
|
//(</validateSchemaSetting>)
|
|
72
72
|
)
|
|
@@ -88,7 +88,8 @@ module.exports.createMain = async (
|
|
|
88
88
|
|
|
89
89
|
let objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(
|
|
90
90
|
_izContext,
|
|
91
|
-
objType
|
|
91
|
+
objType,
|
|
92
|
+
process.env.iz_serviceSchemaBucketName
|
|
92
93
|
);
|
|
93
94
|
_izContext.logger.debug("objectSchema", objectSchema);
|
|
94
95
|
|
|
@@ -119,7 +120,11 @@ module.exports.createMain = async (
|
|
|
119
120
|
|
|
120
121
|
|
|
121
122
|
|
|
122
|
-
let createDataDetails = await createDataDetailsLib(
|
|
123
|
+
let createDataDetails = await createDataDetailsLib(
|
|
124
|
+
_izContext,
|
|
125
|
+
objectSchemas,
|
|
126
|
+
{bucketName: process.env.iz_serviceSchemaBucketName}
|
|
127
|
+
);
|
|
123
128
|
_izContext.logger.debug("createDataDetails is =", createDataDetails);
|
|
124
129
|
|
|
125
130
|
|
|
@@ -127,7 +132,14 @@ module.exports.createMain = async (
|
|
|
127
132
|
//(<beforeValidateRelationships>)
|
|
128
133
|
//(</beforeValidateRelationships>)
|
|
129
134
|
}
|
|
130
|
-
errorsFound.push(
|
|
135
|
+
errorsFound.push(
|
|
136
|
+
...await createNodeLib.validateRequiredOnCreateLinks(
|
|
137
|
+
_izContext,
|
|
138
|
+
objType,
|
|
139
|
+
requestParams.relationships,
|
|
140
|
+
process.env.iz_serviceSchemaBucketName
|
|
141
|
+
)
|
|
142
|
+
)
|
|
131
143
|
_izContext.logger.debug("errorsFound", errorsFound)
|
|
132
144
|
|
|
133
145
|
// end validate
|
|
@@ -178,7 +190,8 @@ module.exports.createMain = async (
|
|
|
178
190
|
}
|
|
179
191
|
}
|
|
180
192
|
};
|
|
181
|
-
}
|
|
193
|
+
}
|
|
194
|
+
if (objectSchemas.fieldNames[identifier.fieldName].hasOwnProperty("hashOnCreate")) {
|
|
182
195
|
if (objectSchemas.fieldNames[identifier.fieldName].hashOnCreate.length &&
|
|
183
196
|
objectSchemas.fieldNames[identifier.fieldName].hashOnCreate.length > 0) {
|
|
184
197
|
for (const fieldName of objectSchemas.fieldNames[identifier.fieldName].hashOnCreate) {
|
|
@@ -296,6 +309,8 @@ module.exports.createMain = async (
|
|
|
296
309
|
...objInstanceFullForDynamoDb.fields
|
|
297
310
|
}
|
|
298
311
|
);
|
|
312
|
+
// (<afterCreateRecordDynamo>)
|
|
313
|
+
//(</afterCreateRecordDynamo>)
|
|
299
314
|
} else if (createDataDetail.storageType == consts.STORAGE_TYPES.graph) {
|
|
300
315
|
//(<beforeCreateNode>)
|
|
301
316
|
//(</beforeCreateNode>)
|
|
@@ -309,7 +324,8 @@ module.exports.createMain = async (
|
|
|
309
324
|
(hash({
|
|
310
325
|
objType: objType,
|
|
311
326
|
graphServerTag: storageTag,
|
|
312
|
-
identifiers: objInstanceFullForGraph.identifiers
|
|
327
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
328
|
+
callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
|
|
313
329
|
})),
|
|
314
330
|
PREFIX.CREATE_OBJECT_ASYNC
|
|
315
331
|
));
|
|
@@ -412,7 +428,7 @@ module.exports.createMain = async (
|
|
|
412
428
|
|
|
413
429
|
Object.assign(messageObject, {
|
|
414
430
|
settings: { updatePropertiesOnMatch: false },
|
|
415
|
-
originTimestamp: Date.now()
|
|
431
|
+
originTimestamp: Date.now(),
|
|
416
432
|
});
|
|
417
433
|
|
|
418
434
|
messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
|
|
@@ -420,9 +436,9 @@ module.exports.createMain = async (
|
|
|
420
436
|
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
421
437
|
callingFlowConfig, // receive parent callingFlowConfig.
|
|
422
438
|
callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
|
|
423
|
-
|
|
439
|
+
//(<callingFlowProperties>)
|
|
424
440
|
await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createNodeComplete), {}
|
|
425
|
-
|
|
441
|
+
//(</callingFlowProperties>)
|
|
426
442
|
)
|
|
427
443
|
)
|
|
428
444
|
);
|