@izara_project/izara-market-library-service-schemas 1.0.9 → 1.0.10
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 +12 -12
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +63 -17
- package/src/TemplateManager/src/FindData/mainFunction/template.ejs +0 -7
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +4 -3
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +0 -2
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +9 -6
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +4 -3
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/data.js +0 -2
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs +5 -2
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +4 -2
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +0 -2
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +5 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +3 -3
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +6 -2
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +2 -2
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +47 -8
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +2 -2
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +2 -2
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +2 -3
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/mainFunction/data.js +2 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/mainFunction/template.ejs +63 -23
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/template.ejs +45 -28
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrDsq/template.ejs +42 -21
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrInv/template.ejs +41 -22
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrSqs/template.ejs +42 -21
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/data.js +2 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/template.ejs +1 -1
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/template.ejs +1 -1
- package/src/TemplateManager/src/ResourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +2 -2
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +2 -2
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +2 -2
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +2 -2
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +7 -6
- package/src/TemplateManager/src/libs/Consts.js +21 -1
- package/src/TemplateManager/src/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +0 -119
package/package.json
CHANGED
|
@@ -43,18 +43,18 @@ const TOPIC_NAME_GRAPH_HANDLER = {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
const TOPIC_NAME_GENERATE_CODE = {
|
|
46
|
-
updateRelComplete: "
|
|
47
|
-
createRelComplete: "
|
|
48
|
-
deleteRelComplete: "
|
|
49
|
-
outUpdateRelComplete: "
|
|
50
|
-
outCreateRelComplete: "
|
|
51
|
-
outDeleteRelComplete: "
|
|
52
|
-
updateNodeComplete: "
|
|
53
|
-
outUpdateNodeComplete: "
|
|
54
|
-
createNodeComplete: "
|
|
55
|
-
outCreateNodeComplete: "
|
|
56
|
-
deleteNodeComplete: "
|
|
57
|
-
outDeleteNodeComplete: "
|
|
46
|
+
updateRelComplete: "UpdateRelationshipComplete",
|
|
47
|
+
createRelComplete: "CreateRelationshipComplete",
|
|
48
|
+
deleteRelComplete: "DeleteRelationshipComplete",
|
|
49
|
+
outUpdateRelComplete: "OutUpdateRelationshipComplete",
|
|
50
|
+
outCreateRelComplete: "OutCreateRelationshipComplete",
|
|
51
|
+
outDeleteRelComplete: "OutDeleteRelationshipComplete",
|
|
52
|
+
updateNodeComplete: "UpdateNodeComplete",
|
|
53
|
+
outUpdateNodeComplete: "OutUpdateNodeComplete",
|
|
54
|
+
createNodeComplete: "CreateObjectComplete",
|
|
55
|
+
outCreateNodeComplete: "OutCreateObjectComplete",
|
|
56
|
+
deleteNodeComplete: "DeleteNodeComplete",
|
|
57
|
+
outDeleteNodeComplete: "OutDeleteNodeComplete"
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
const GRAPH_HANDLER_SERVICE_NAME = {
|
|
@@ -733,46 +733,92 @@ async function createDataDetailsLib(
|
|
|
733
733
|
for (let [keyFieldName, settingFieldName] of Object.entries(objectSchemas.fieldNames)) {
|
|
734
734
|
// _izContext.logger.debug("Loop fieldNamesObjectSchemas", { keyFieldName });
|
|
735
735
|
|
|
736
|
-
// check
|
|
736
|
+
// check field is identifier
|
|
737
737
|
if (objectSchemas.identifierFieldNames.includes(keyFieldName)) {
|
|
738
|
+
|
|
739
|
+
if (Object.keys(objectSchemas.fieldNames).length == 1) {
|
|
740
|
+
|
|
741
|
+
for (const storageIdentifiers of settingFieldName.storageResourceTags) {
|
|
742
|
+
_izContext.logger.debug("case only 1 fieldNames identifiers in ObjectSchema")
|
|
743
|
+
if (storageResources[storageIdentifiers].storageType === consts.STORAGE_TYPES.dynamoDB) {
|
|
744
|
+
if (createDataDetails.hasOwnProperty(storageIdentifiers)) {
|
|
745
|
+
_izContext.logger.debug("same table")
|
|
746
|
+
createDataDetails[storageIdentifiers].fieldNames.push(keyFieldName);
|
|
747
|
+
} else {
|
|
748
|
+
_izContext.logger.debug("new table")
|
|
749
|
+
Object.assign(createDataDetails, {
|
|
750
|
+
[storageResources[storageIdentifiers]]: {
|
|
751
|
+
storageType: consts.STORAGE_TYPES.dynamoDB,
|
|
752
|
+
tableName: storageResources[storageIdentifiers].tableName,
|
|
753
|
+
fieldNames: [keyFieldName]
|
|
754
|
+
}
|
|
755
|
+
})
|
|
756
|
+
if (storageResources[storageIdentifiers].hasOwnProperty("groupByPartitionKeyField")) {
|
|
757
|
+
Object.assign(createDataDetails[storageIdentifiers], {
|
|
758
|
+
groupByPartitionKeyField: storageResources[storageIdentifiers].groupByPartitionKeyField
|
|
759
|
+
})
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
} else if (storageResources[storageIdentifiers].storageType === consts.STORAGE_TYPES.graph) {
|
|
763
|
+
let getGraphServerTag = await serviceConfig.getGraphServiceTag(
|
|
764
|
+
_izContext,
|
|
765
|
+
storageResources[storageIdentifiers].graphServerTag
|
|
766
|
+
);
|
|
767
|
+
if (getGraphServerTag) {
|
|
768
|
+
if (createDataDetails.hasOwnProperty(getGraphServerTag)) {
|
|
769
|
+
createDataDetails[getGraphServerTag].fieldNames.push(keyFieldName)
|
|
770
|
+
} else {
|
|
771
|
+
Object.assign(createDataDetails, {
|
|
772
|
+
[getGraphServerTag]: {
|
|
773
|
+
storageType: consts.STORAGE_TYPES.graph,
|
|
774
|
+
fieldNames: [keyFieldName]
|
|
775
|
+
}
|
|
776
|
+
})
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
} else {
|
|
782
|
+
continue
|
|
783
|
+
}
|
|
738
784
|
continue
|
|
739
785
|
};
|
|
786
|
+
_izContext.logger.debug("case multiple fieldName");
|
|
740
787
|
// validate storageResourceTags.
|
|
741
788
|
_izContext.logger.debug("storageResourceTags is", settingFieldName.storageResourceTags);
|
|
742
789
|
|
|
743
|
-
for (let
|
|
744
|
-
_izContext.logger.debug("Loop eachStorageResourceTags",
|
|
790
|
+
for (let eachStorageResourceTag of settingFieldName.storageResourceTags) {
|
|
791
|
+
_izContext.logger.debug("Loop eachStorageResourceTags", eachStorageResourceTag);
|
|
745
792
|
|
|
746
|
-
if (!storageResources.hasOwnProperty(
|
|
793
|
+
if (!storageResources.hasOwnProperty(eachStorageResourceTag)) {
|
|
747
794
|
throw new Error("storageResources is'n exist"); // should be validata in step uplode in s3
|
|
748
795
|
} else {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
createDataDetails[eachStorageResourceTags].fieldNames.push(keyFieldName);
|
|
796
|
+
if (storageResources[eachStorageResourceTag].storageType == consts.STORAGE_TYPES.dynamoDB) {
|
|
797
|
+
if (createDataDetails.hasOwnProperty(eachStorageResourceTag)) {
|
|
798
|
+
_izContext.logger.debug("SAME STG DB", eachStorageResourceTag);
|
|
799
|
+
createDataDetails[eachStorageResourceTag].fieldNames.push(keyFieldName);
|
|
754
800
|
|
|
755
801
|
} else {
|
|
756
|
-
_izContext.logger.debug("NEW STG DB",
|
|
802
|
+
_izContext.logger.debug("NEW STG DB", eachStorageResourceTag);
|
|
757
803
|
Object.assign(createDataDetails, {
|
|
758
|
-
[
|
|
804
|
+
[eachStorageResourceTag]: {
|
|
759
805
|
storageType: consts.STORAGE_TYPES.dynamoDB,
|
|
760
|
-
tableName: storageResources[
|
|
806
|
+
tableName: storageResources[eachStorageResourceTag].tableName,
|
|
761
807
|
fieldNames: [keyFieldName]
|
|
762
808
|
}
|
|
763
809
|
});
|
|
764
810
|
|
|
765
|
-
if (storageResources[
|
|
766
|
-
Object.assign(createDataDetails[
|
|
767
|
-
groupByPartitionKeyField: storageResources[
|
|
811
|
+
if (storageResources[eachStorageResourceTag].hasOwnProperty("groupByPartitionKeyField")) {
|
|
812
|
+
Object.assign(createDataDetails[eachStorageResourceTag], {
|
|
813
|
+
groupByPartitionKeyField: storageResources[eachStorageResourceTag].groupByPartitionKeyField
|
|
768
814
|
});
|
|
769
815
|
}
|
|
770
816
|
}
|
|
771
817
|
|
|
772
|
-
} else if (storageResources[
|
|
818
|
+
} else if (storageResources[eachStorageResourceTag].storageType == consts.STORAGE_TYPES.graph) {
|
|
773
819
|
let checkGraphServerTags = await serviceConfig.getGraphServiceTag(
|
|
774
820
|
_izContext,
|
|
775
|
-
storageResources[
|
|
821
|
+
storageResources[eachStorageResourceTag].graphServerTag
|
|
776
822
|
);
|
|
777
823
|
if (checkGraphServerTags) {
|
|
778
824
|
if (createDataDetails.hasOwnProperty(checkGraphServerTags)) {
|
|
@@ -87,13 +87,6 @@ exports.findData = async (
|
|
|
87
87
|
return; // stop process
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
let identifiersObject = await identifierObj.concatIdentifiersObjectFromIdentifiersObject(
|
|
91
|
-
_izContext,
|
|
92
|
-
objType,
|
|
93
|
-
identifiers
|
|
94
|
-
);
|
|
95
|
-
_izContext.logger.debug("create identifiersObject from identifiers: ", identifiersObject) // object
|
|
96
|
-
|
|
97
90
|
let errorsFound = [];
|
|
98
91
|
|
|
99
92
|
let standardErrorParams = [
|
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
|
|
24
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
|
|
25
|
-
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, awaitingMultipleStepsRole } = require("../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, awaitingMultipleStepsRole, SHORT_FUNCTION_NAME } = require("../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, './template.ejs');
|
|
28
28
|
|
|
@@ -33,8 +33,8 @@ function data(_izContext, srcPath) {
|
|
|
33
33
|
function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
34
34
|
let functionName = upperCase(FUNCTION_NAME.createObjectComplete)
|
|
35
35
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
36
|
-
let awaitingTables = ["AwaitingMultipleSteps", "AwaitingMultipleStepByPending"]
|
|
37
36
|
let handlerType = upperCase(HANDLER.hdrSqs)
|
|
37
|
+
let functionNameConfig = upperCase(SHORT_FUNCTION_NAME.createObjectComplete)
|
|
38
38
|
|
|
39
39
|
additionalResourcePermission.push(
|
|
40
40
|
createIamRole(
|
|
@@ -70,7 +70,8 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
70
70
|
functionName,
|
|
71
71
|
handlerType,
|
|
72
72
|
additionalResourcePermission,
|
|
73
|
-
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete
|
|
73
|
+
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete,
|
|
74
|
+
functionNameConfig
|
|
74
75
|
},
|
|
75
76
|
setting: {
|
|
76
77
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%_ const join = require('path').join; _%>
|
|
2
|
-
<%- firstLetterUpperCase(
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
5
5
|
events:
|
|
@@ -39,7 +39,6 @@ function data(_izContext, srcPath) {
|
|
|
39
39
|
|
|
40
40
|
function createParamForCreateSource(srcPath) {
|
|
41
41
|
const functionName = FUNCTION_NAME.createObjectComplete;
|
|
42
|
-
let functionNameConfig = upperCase(functionName)
|
|
43
42
|
|
|
44
43
|
return {
|
|
45
44
|
templatePath: templatePath,
|
|
@@ -47,7 +46,6 @@ function createParamForCreateSource(srcPath) {
|
|
|
47
46
|
functionName,
|
|
48
47
|
queueName: upperCase(functionName),
|
|
49
48
|
functionName,
|
|
50
|
-
functionNameConfig
|
|
51
49
|
},
|
|
52
50
|
setting: {
|
|
53
51
|
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs
CHANGED
|
@@ -62,8 +62,6 @@ module.exports.createObjectComplete = async (
|
|
|
62
62
|
passBackProperties,
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
let errorFounds = [];
|
|
66
|
-
|
|
67
65
|
if (_.isEmpty(returnValue)) {
|
|
68
66
|
_izContext.logger.debug("message callingFlowProperties is empty");
|
|
69
67
|
throw new NoRetryError("message not an object")
|
|
@@ -97,10 +95,10 @@ module.exports.createObjectComplete = async (
|
|
|
97
95
|
errorFounds = errorFounds.concat(errorsFound);
|
|
98
96
|
};
|
|
99
97
|
|
|
100
|
-
let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId(
|
|
101
|
-
{
|
|
98
|
+
let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId(
|
|
99
|
+
(hash({
|
|
102
100
|
objType: returnValue.objType,
|
|
103
|
-
|
|
101
|
+
graphServerTag: graphServiceTag,
|
|
104
102
|
identifiers: returnValue.objInstanceFull.identifiers
|
|
105
103
|
})),
|
|
106
104
|
PREFIX.CREATE_OBJECT_ASYNC
|
|
@@ -146,7 +144,7 @@ module.exports.createObjectComplete = async (
|
|
|
146
144
|
let messageObject = {
|
|
147
145
|
objType: returnValue.objType,
|
|
148
146
|
objInstanceFull: returnValue.objInstanceFull,
|
|
149
|
-
|
|
147
|
+
errorsFound: errorsFound
|
|
150
148
|
};
|
|
151
149
|
|
|
152
150
|
messageObject = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, messageObject)
|
|
@@ -160,6 +158,11 @@ module.exports.createObjectComplete = async (
|
|
|
160
158
|
_izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
|
|
161
159
|
await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
|
|
162
160
|
|
|
161
|
+
return {
|
|
162
|
+
objType: returnValue.objType,
|
|
163
|
+
objInstanceFull: returnValue.objInstanceFull,
|
|
164
|
+
errorsFound: errorsFound
|
|
165
|
+
}
|
|
163
166
|
|
|
164
167
|
} catch (err) {
|
|
165
168
|
throw (err)
|
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
|
|
24
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
|
|
25
|
-
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE } = require("../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, SHORT_FUNCTION_NAME } = require("../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, './template.ejs');
|
|
28
28
|
|
|
@@ -32,8 +32,8 @@ function data(_izContext, srcPath) {
|
|
|
32
32
|
|
|
33
33
|
function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
34
34
|
let functionName = upperCase(FUNCTION_NAME.deleteNodeComplete)
|
|
35
|
+
let functionNameConfig = upperCase(SHORT_FUNCTION_NAME.deleteNodeComplete)
|
|
35
36
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
36
|
-
let awaitingTables = ["AwaitingMultipleSteps", "AwaitingMultipleStepByPending"]
|
|
37
37
|
let handlerType = upperCase(HANDLER.hdrSqs)
|
|
38
38
|
|
|
39
39
|
additionalResourcePermission.push(
|
|
@@ -67,7 +67,8 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
67
67
|
functionName,
|
|
68
68
|
handlerType,
|
|
69
69
|
additionalResourcePermission,
|
|
70
|
-
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete
|
|
70
|
+
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete,
|
|
71
|
+
functionNameConfig
|
|
71
72
|
},
|
|
72
73
|
setting: {
|
|
73
74
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/template.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%_ const join = require('path').join; _%>
|
|
2
|
-
<%- firstLetterUpperCase(
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
5
5
|
events:
|
|
@@ -39,7 +39,6 @@ function data(_izContext, srcPath) {
|
|
|
39
39
|
|
|
40
40
|
function createParamForCreateSource(srcPath) {
|
|
41
41
|
const functionName = FUNCTION_NAME.deleteNodeComplete;
|
|
42
|
-
let functionNameConfig = upperCase(functionName)
|
|
43
42
|
|
|
44
43
|
return {
|
|
45
44
|
templatePath: templatePath,
|
|
@@ -47,7 +46,6 @@ function createParamForCreateSource(srcPath) {
|
|
|
47
46
|
functionName,
|
|
48
47
|
queueName: upperCase(functionName),
|
|
49
48
|
functionName,
|
|
50
|
-
functionNameConfig
|
|
51
49
|
},
|
|
52
50
|
setting: {
|
|
53
51
|
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs
CHANGED
|
@@ -79,8 +79,11 @@ module.exports.deleteNodeComplete = async (
|
|
|
79
79
|
_izContext.logger.debug("Send Message to DeleteNodeComplete::", sendMessageToOutUpdateNodeComplete);
|
|
80
80
|
await sns.publishAsync(_izContext, sendMessageToOutUpdateNodeComplete)
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
return {
|
|
83
|
+
objType: returnValue.objType,
|
|
84
|
+
objInstanceFull: returnValue.objInstanceFull,
|
|
85
|
+
errorsFound: errorsFound
|
|
86
|
+
}
|
|
84
87
|
|
|
85
88
|
}
|
|
86
89
|
catch (err) {
|
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
|
|
24
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
|
|
25
|
-
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, awaitingMultipleStepsRole } = require("../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, awaitingMultipleStepsRole, SHORT_FUNCTION_NAME } = require("../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, './template.ejs');
|
|
28
28
|
|
|
@@ -32,6 +32,7 @@ function data(_izContext, srcPath) {
|
|
|
32
32
|
|
|
33
33
|
function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
34
34
|
let functionName = upperCase(FUNCTION_NAME.updateNodeComplete)
|
|
35
|
+
let functionNameConfig = upperCase(SHORT_FUNCTION_NAME.updateNodeComplete)
|
|
35
36
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
36
37
|
let handlerType = upperCase(HANDLER.hdrSqs)
|
|
37
38
|
|
|
@@ -69,7 +70,8 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
69
70
|
functionName,
|
|
70
71
|
handlerType,
|
|
71
72
|
additionalResourcePermission,
|
|
72
|
-
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete
|
|
73
|
+
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete,
|
|
74
|
+
functionNameConfig
|
|
73
75
|
},
|
|
74
76
|
setting: {
|
|
75
77
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%_ const join = require('path').join; _%>
|
|
2
|
-
<%- firstLetterUpperCase(
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
3
|
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
4
|
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
5
5
|
events:
|
|
@@ -39,7 +39,6 @@ function data(_izContext, srcPath) {
|
|
|
39
39
|
|
|
40
40
|
function createParamForCreateSource(srcPath) {
|
|
41
41
|
const functionName = FUNCTION_NAME.updateNodeComplete;
|
|
42
|
-
let functionNameConfig = upperCase(functionName)
|
|
43
42
|
|
|
44
43
|
return {
|
|
45
44
|
templatePath: templatePath,
|
|
@@ -47,7 +46,6 @@ function createParamForCreateSource(srcPath) {
|
|
|
47
46
|
functionName,
|
|
48
47
|
queueName: upperCase(functionName),
|
|
49
48
|
functionName,
|
|
50
|
-
functionNameConfig
|
|
51
49
|
},
|
|
52
50
|
setting: {
|
|
53
51
|
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs
CHANGED
|
@@ -117,7 +117,11 @@ module.exports.updateNodeComplete = async (
|
|
|
117
117
|
})
|
|
118
118
|
)
|
|
119
119
|
|
|
120
|
-
return {
|
|
120
|
+
return {
|
|
121
|
+
objType: returnValue.objType,
|
|
122
|
+
objInstanceFull: returnValue.objInstanceFull,
|
|
123
|
+
errorsFound: errorsFound
|
|
124
|
+
}
|
|
121
125
|
|
|
122
126
|
} catch (err) {
|
|
123
127
|
_izContext.logger.error("error UpdateNodeComplete : ", err)
|
|
@@ -61,7 +61,7 @@ function data(_izContext, objectSchema, srcPath) {
|
|
|
61
61
|
|
|
62
62
|
function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
63
63
|
let objectType = objectSchema.objectType
|
|
64
|
-
let functionName = objectType + upperCase(action);
|
|
64
|
+
let functionName = upperCase(objectType) + upperCase(action);
|
|
65
65
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
66
66
|
let tableForGetItem = [];
|
|
67
67
|
let hasGraphStorage = false;
|
|
@@ -62,7 +62,7 @@ function data(_izContext, objectSchema, srcPath) {
|
|
|
62
62
|
|
|
63
63
|
function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
64
64
|
let objectType = objectSchema.objectType;
|
|
65
|
-
let functionName = objectType + upperCase(action);
|
|
65
|
+
let functionName = upperCase(objectType) + upperCase(action);
|
|
66
66
|
let functionNameObjectType = objectSchema?.shortNameObjectType ? objectSchema.shortNameObjectType : objectSchema.objectType;
|
|
67
67
|
let functionNameConfig = upperCase(functionNameObjectType) + upperCase(action) + upperCase(shortNameHandler(HANDLER.hdrDsq))
|
|
68
68
|
console.log("functionNameConfigInFunctionYamlHdrDsq", functionNameConfig)
|
|
@@ -64,7 +64,7 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
64
64
|
let functionNameObjectType = objectSchema?.shortNameObjectType ? objectSchema.shortNameObjectType : objectSchema.objectType;
|
|
65
65
|
let objectType = objectSchema.objectType;
|
|
66
66
|
let actionHandler = action;
|
|
67
|
-
let functionName = objectType + upperCase(actionHandler);
|
|
67
|
+
let functionName = upperCase(objectType) + upperCase(actionHandler);
|
|
68
68
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
69
69
|
let tableForGetItem = [];
|
|
70
70
|
|
|
@@ -62,7 +62,7 @@ function data(_izContext, objectSchema, srcPath) {
|
|
|
62
62
|
function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
63
63
|
let objectType = objectSchema.objectType;
|
|
64
64
|
let actionHandler = action;
|
|
65
|
-
let functionName = objectType + upperCase(actionHandler);
|
|
65
|
+
let functionName = upperCase(objectType) + upperCase(actionHandler);
|
|
66
66
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
67
67
|
let tableForGetItem = [];
|
|
68
68
|
let hasGraphStorage = false;
|
|
@@ -108,8 +108,8 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
108
108
|
SQS_RESOURCE.getQueueUrl
|
|
109
109
|
], [RESOURCE_CLASSES.sns]: ["Publish", "Subscribe"]
|
|
110
110
|
}, [
|
|
111
|
-
resourceNames(RESOURCE_CLASSES.sqs, functionName),
|
|
112
|
-
resourceNames(RESOURCE_CLASSES.sqs, functionName + "DLQ"),
|
|
111
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrSqs)),
|
|
112
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
113
113
|
resourceNames(RESOURCE_CLASSES.sns, "In" + functionName),
|
|
114
114
|
resourceNames(RESOURCE_CLASSES.sns, "Out" + functionName)
|
|
115
115
|
]
|
|
@@ -67,7 +67,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
67
67
|
|
|
68
68
|
await validateSchemaPerRecord(
|
|
69
69
|
record,
|
|
70
|
-
<%- functionName
|
|
70
|
+
"<%- functionName %><%- firstLetterUpperCase(handler) %>",
|
|
71
71
|
"OBJTYPE,
|
|
72
72
|
<%- action %>"
|
|
73
73
|
//(<validateSchemaSetting>)
|
|
@@ -79,7 +79,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
79
79
|
/*
|
|
80
80
|
await recordHandlerSharedLib.validateRecord(
|
|
81
81
|
record,
|
|
82
|
-
<%- functionName
|
|
82
|
+
"<%- functionName %><%- firstLetterUpperCase(handler) %>",
|
|
83
83
|
perRecordsValidatorSchema
|
|
84
84
|
);
|
|
85
85
|
*/
|
|
@@ -118,3 +118,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
)
|
|
121
|
+
|
|
122
|
+
<%_ function firstLetterUpperCase(text){
|
|
123
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
124
|
+
} _%>
|
|
@@ -67,7 +67,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
67
67
|
|
|
68
68
|
await validateSchemaPerRecord(
|
|
69
69
|
record,
|
|
70
|
-
<%- functionName
|
|
70
|
+
"<%- functionName %><%- firstLetterUpperCase(handler) %>",
|
|
71
71
|
OBJTYPE,
|
|
72
72
|
"<%- action %>"
|
|
73
73
|
//(<validateSchemaSetting>)
|
|
@@ -79,7 +79,7 @@ module.exports.main = middleware.wrap(async (event,context, callback) => {
|
|
|
79
79
|
/*
|
|
80
80
|
await recordHandlerSharedLib.validateRecord(
|
|
81
81
|
record,
|
|
82
|
-
<%- functionName
|
|
82
|
+
"<%- functionName %><%- firstLetterUpperCase(handler) %>",
|
|
83
83
|
perRecordsValidatorSchema
|
|
84
84
|
);
|
|
85
85
|
*/
|
|
@@ -58,6 +58,7 @@ const PREFIX = {
|
|
|
58
58
|
const { TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER, GRAPH_HANDLER_SERVICE_NAME } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
59
59
|
const { createDataDetailsLib } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs')
|
|
60
60
|
const { createLinkTypeId } = require('@izara_project/izara-core-library-service-schemas/src/Utils');
|
|
61
|
+
const { findLinksByObjTypes } = require("@izara_project/izara-core-library-service-schemas/src/libs/RelSchemaLib")
|
|
61
62
|
|
|
62
63
|
/**
|
|
63
64
|
- all storageType( DB and Graph) use objInstance({identifiers,fields})
|
|
@@ -104,6 +105,7 @@ module.exports.<%- functionName %>Main = async (
|
|
|
104
105
|
const SERVICE_TAG = process.env.iz_serviceTag;
|
|
105
106
|
//(<beforeQuery>)
|
|
106
107
|
//(</beforeQuery>)
|
|
108
|
+
|
|
107
109
|
const MAIN_OBJTYPE = {
|
|
108
110
|
objectType: OBJECT_TYPE,
|
|
109
111
|
serviceTag: SERVICE_TAG
|
|
@@ -124,11 +126,14 @@ module.exports.<%- functionName %>Main = async (
|
|
|
124
126
|
let createDataDetails = await createDataDetailsLib(_izContext, objectSchemas);
|
|
125
127
|
_izContext.logger.debug("createDataDetails is =", createDataDetails);
|
|
126
128
|
|
|
129
|
+
let checkCorrectLinks = [];
|
|
130
|
+
|
|
127
131
|
//validate linkType
|
|
128
132
|
if ((requestParams.hasOwnProperty("relationships")) && (requestParams.relationships.length > 0)) {
|
|
129
133
|
|
|
130
134
|
for (let relationshipProperties of requestParams.relationships) {
|
|
131
|
-
_izContext.logger.debug("
|
|
135
|
+
_izContext.logger.debug("relationshipProperties", relationshipProperties);
|
|
136
|
+
_izContext.logger.debug("relType", relationshipProperties.relType);
|
|
132
137
|
let getObjectRelationship = await getObjectSchema.getRelationshipSchemaWithCache(
|
|
133
138
|
_izContext,
|
|
134
139
|
relationshipProperties.relType
|
|
@@ -142,6 +147,40 @@ module.exports.<%- functionName %>Main = async (
|
|
|
142
147
|
}
|
|
143
148
|
}
|
|
144
149
|
}
|
|
150
|
+
const links = await findLinksByObjTypes(_izContext, [MAIN_OBJTYPE, relationshipProperties.targetObjType], getObjectRelationship.links);
|
|
151
|
+
_izContext.logger.debug("links", links)
|
|
152
|
+
|
|
153
|
+
if (!links.length) {
|
|
154
|
+
errorsFound.push(`not found link between ${JSON.stringify({ mainObjType: MAIN_OBJTYPE })} and ${JSON.stringify({ toObjType: relationshipProperties.targetObjType })} `)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
for (let link of links) {
|
|
158
|
+
const { serviceTag: fromServiceTag, objectType: fromObjectType } = MAIN_OBJTYPE;
|
|
159
|
+
const { serviceTag: toServiceTag, objectType: toObjectType } = relationshipProperties.targetObjType
|
|
160
|
+
|
|
161
|
+
const { serviceTag: firstServiceTag, objectType: firstObjectType } = link.from.objType;
|
|
162
|
+
const { serviceTag: secondServiceTag, objectType: secondObjectType } = link.to.objType
|
|
163
|
+
|
|
164
|
+
const matchesFromTo =
|
|
165
|
+
fromServiceTag === firstServiceTag && fromObjectType === firstObjectType
|
|
166
|
+
&& toServiceTag === secondServiceTag && toObjectType === secondObjectType;
|
|
167
|
+
|
|
168
|
+
const matchesToFrom =
|
|
169
|
+
fromServiceTag === secondServiceTag && fromObjectType === secondObjectType
|
|
170
|
+
&& toServiceTag === firstServiceTag && toObjectType === firstObjectType
|
|
171
|
+
|
|
172
|
+
if ((relationshipProperties.relationshipDirection === "from" && matchesFromTo) ||
|
|
173
|
+
(relationshipProperties.relationshipDirection === "to" && matchesToFrom)) {
|
|
174
|
+
checkCorrectLinks.push(true)
|
|
175
|
+
} else {
|
|
176
|
+
checkCorrectLinks.push(false)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const [index, checkCorrectLink] of checkCorrectLinks.entries()) {
|
|
182
|
+
if (checkCorrectLink === false) {
|
|
183
|
+
errorsFound.push(`relationship direction ${JSON.stringify(requestParams.relationships[index])} is invalid`)
|
|
145
184
|
}
|
|
146
185
|
}
|
|
147
186
|
|
|
@@ -151,6 +190,7 @@ module.exports.<%- functionName %>Main = async (
|
|
|
151
190
|
let objectRelationshipSchema = await getObjectSchema.getRequiredOnCreateLinksWithCache(_izContext, MAIN_OBJTYPE);
|
|
152
191
|
_izContext.logger.debug("objectRelationshipSchema", objectRelationshipSchema);
|
|
153
192
|
|
|
193
|
+
// validate requiredOnCreateLinks
|
|
154
194
|
let filteredRequiredOnCreatedLinks = [];
|
|
155
195
|
|
|
156
196
|
await Promise.all(
|
|
@@ -181,9 +221,8 @@ module.exports.<%- functionName %>Main = async (
|
|
|
181
221
|
for (const requireLink of filteredRequiredOnCreatedLinks) {
|
|
182
222
|
const requiredOnCreateLinkTypeId = createLinkTypeId(
|
|
183
223
|
_izContext,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
],
|
|
224
|
+
MAIN_OBJTYPE,
|
|
225
|
+
requireLink.other.objType,
|
|
187
226
|
requireLink.relType
|
|
188
227
|
);
|
|
189
228
|
|
|
@@ -195,9 +234,8 @@ module.exports.<%- functionName %>Main = async (
|
|
|
195
234
|
for (const createRelationship of requestParams.relationships) {
|
|
196
235
|
const onCreateLinkTypeId = createLinkTypeId(
|
|
197
236
|
_izContext,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
],
|
|
237
|
+
MAIN_OBJTYPE,
|
|
238
|
+
createRelationship.targetObjType,
|
|
201
239
|
createRelationship.relType
|
|
202
240
|
);
|
|
203
241
|
|
|
@@ -226,6 +264,7 @@ module.exports.<%- functionName %>Main = async (
|
|
|
226
264
|
}
|
|
227
265
|
_izContext.logger.debug("createLinkTypeIds", createLinkTypeIds);
|
|
228
266
|
_izContext.logger.debug("requiredOnCreateLinks", requiredOnCreateLinks);
|
|
267
|
+
// end validate
|
|
229
268
|
|
|
230
269
|
let objInstanceFull = {
|
|
231
270
|
identifiers: {},
|
|
@@ -393,7 +432,7 @@ module.exports.<%- functionName %>Main = async (
|
|
|
393
432
|
_izContext.logger.debug("::::::Graphanler::::::", { storageTag, objInstanceFull });
|
|
394
433
|
|
|
395
434
|
// allStorageTagComplete = false;
|
|
396
|
-
allAwaitingStepsId.push(asyncFlowSharedLib.createAwaitingStepId(
|
|
435
|
+
allAwaitingStepsId.push(await asyncFlowSharedLib.createAwaitingStepId(
|
|
397
436
|
(hash({
|
|
398
437
|
objType: MAIN_OBJTYPE,
|
|
399
438
|
graphServerTag: storageTag,
|
|
@@ -26,7 +26,7 @@ const serviceConfig = serviceSchemas.serviceConfig;
|
|
|
26
26
|
|
|
27
27
|
const { HANDLER, STORAGE_TYPES, ACTIONS } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
28
28
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils")
|
|
29
|
-
const { createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, LAMBDA_RESOURCE, FUNCTION_NAME, DYNAMO_RESOURCE, SNS_RESOURCE, defaultIamRolePerAction, shortNameHandler } = require("../../libs/Consts");
|
|
29
|
+
const { createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, LAMBDA_RESOURCE, FUNCTION_NAME, DYNAMO_RESOURCE, SNS_RESOURCE, defaultIamRolePerAction, shortNameHandler, SHORT_FUNCTION_NAME } = require("../../libs/Consts");
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* receive objectSchema
|
|
@@ -130,7 +130,7 @@ async function data(_izContext, objectSchemas, srcPath) {
|
|
|
130
130
|
resourceLocation: SOURCE_PATH.resourceLocationProcessLogical,
|
|
131
131
|
handlerType: HANDLER.hdrSqs,
|
|
132
132
|
additionalResourcePermission,
|
|
133
|
-
functionNameConfig: upperCase(
|
|
133
|
+
functionNameConfig: upperCase(SHORT_FUNCTION_NAME.processLogical) + upperCase(shortNameHandler(HANDLER.hdrSqs))
|
|
134
134
|
},
|
|
135
135
|
setting: {
|
|
136
136
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|