@izara_project/izara-market-library-service-schemas 1.0.39 → 1.0.41
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/MainLibs/src/Consts.js +2 -2
- package/src/TemplateManager/src/libs/Consts.js +2 -1
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +1 -14
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +82 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +9 -8
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +1 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +9 -4
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +11 -10
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +90 -49
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowStep/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowStep/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowStep/handler/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowStep/mainFunction/data.js +5 -4
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +2 -1
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +21 -16
- package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/data.js +2 -1
- package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +28 -23
- package/src/reStructure/TemplateData/flowSchema/register/dynamoDB/register.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/register/subscriptionOutAll/data.js +2 -1
- package/src/reStructure/TemplateData/flowSchema/register/wbs/handler/template.ejs +4 -1
- package/src/reStructure/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +23 -21
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/webSocketComplete → webSocketComplete}/functionYaml/data.js +13 -7
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/webSocketComplete → webSocketComplete}/functionYaml/template.ejs +1 -2
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/webSocketComplete → webSocketComplete}/handler/data.js +6 -6
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/webSocketComplete → webSocketComplete}/mainFunction/data.js +5 -5
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +4 -4
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +1 -0
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/propertyValueSchema/generateTemplateData.js +1 -0
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +14 -14
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +27 -17
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +3 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +2 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +4 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +5 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +5 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +5 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +5 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +5 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +5 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +0 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +1 -2
- package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +4 -3
- package/src/reStructure/libs/ValidateAddOnDataStructure.js +0 -1
- /package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/webSocketComplete → webSocketComplete}/handler/template.ejs +0 -0
- /package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/webSocketComplete → webSocketComplete}/mainFunction/template.ejs +0 -0
|
@@ -34,18 +34,17 @@ const templatePath = path.join(__dirname, "./templateObjectPropertyValueSchema.e
|
|
|
34
34
|
const modules = {
|
|
35
35
|
validateAddOnDataStructure: require('../../../libs/ValidateAddOnDataStructure')
|
|
36
36
|
};
|
|
37
|
-
const yaml = require("yaml")
|
|
38
37
|
const objectschemaLocalByPath = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
39
|
-
const Consts = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts')
|
|
40
38
|
// const objectSchemasBySrc = srcPath
|
|
41
39
|
|
|
42
40
|
|
|
43
41
|
async function data(_izContext, settings, srcPath) {
|
|
44
42
|
|
|
45
|
-
let objectSchema = await objectschemaLocalByPath.
|
|
43
|
+
let objectSchema = await objectschemaLocalByPath.getLocalObjectSchemasWithHierarchy(
|
|
46
44
|
_izContext,
|
|
47
|
-
settings.objType
|
|
48
|
-
|
|
45
|
+
settings.objType.objectType,
|
|
46
|
+
path.join(srcPath, "./schemas")
|
|
47
|
+
).then(res => res.records[0]);
|
|
49
48
|
_izContext.logger.debug("objectSchema objectSchema::", objectSchema)
|
|
50
49
|
|
|
51
50
|
if (!objectSchema) {
|
|
@@ -55,12 +54,13 @@ async function data(_izContext, settings, srcPath) {
|
|
|
55
54
|
let propertyValueObjectSchemas = [];
|
|
56
55
|
let createSources = [];
|
|
57
56
|
|
|
58
|
-
let objectType = settings.objType.objectType;
|
|
57
|
+
// let objectType = settings.objType.objectType;
|
|
58
|
+
let propertyValueTag = settings.propertyValueTag
|
|
59
59
|
// validate only addOnndataStructure is type propertyNode.
|
|
60
60
|
|
|
61
61
|
if (!objectSchema.hasOwnProperty("addOnDataStructure") || !Array.isArray(objectSchema.addOnDataStructure) || !objectSchema.addOnDataStructure.length) {
|
|
62
|
-
console.log(`Not have data in addOnDataStructure in objectType:${objectType}`);
|
|
63
|
-
throw Error(`Not have data in addOnDataStructure in objectType:${objectType}`)
|
|
62
|
+
console.log(`Not have data in addOnDataStructure in objectType:${objectSchema.objectType}`);
|
|
63
|
+
throw Error(`Not have data in addOnDataStructure in objectType:${objectSchema.objectType}`)
|
|
64
64
|
|
|
65
65
|
};
|
|
66
66
|
|
|
@@ -70,26 +70,26 @@ async function data(_izContext, settings, srcPath) {
|
|
|
70
70
|
|
|
71
71
|
propertyValueObjectSchemas.push(
|
|
72
72
|
{ // {subject}property
|
|
73
|
-
objectType:
|
|
73
|
+
objectType: propertyValueTag + PROPERTYVALUE_TAG.property,
|
|
74
74
|
fieldNames: {
|
|
75
|
-
[
|
|
75
|
+
[propertyValueTag + PROPERTYVALUE_TAG.property + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName),
|
|
76
76
|
},
|
|
77
77
|
identifiers: [
|
|
78
78
|
{
|
|
79
79
|
type: "identifier",
|
|
80
|
-
fieldName:
|
|
80
|
+
fieldName: propertyValueTag + PROPERTYVALUE_TAG.property + "Id"
|
|
81
81
|
}
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
84
|
{ // {subject}propertyLabel
|
|
85
|
-
objectType:
|
|
85
|
+
objectType: propertyValueTag + PROPERTYVALUE_TAG.propertyLabel,
|
|
86
86
|
fieldNames: {
|
|
87
|
-
[
|
|
87
|
+
[propertyValueTag + PROPERTYVALUE_TAG.propertyLabel + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.randomOnCreateFieldName),
|
|
88
88
|
},
|
|
89
89
|
identifiers: [
|
|
90
90
|
{
|
|
91
91
|
type: "identifier",
|
|
92
|
-
fieldName:
|
|
92
|
+
fieldName: propertyValueTag + PROPERTYVALUE_TAG.propertyLabel + "Id"
|
|
93
93
|
}
|
|
94
94
|
]
|
|
95
95
|
}
|
package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js
CHANGED
|
@@ -27,31 +27,39 @@ const {
|
|
|
27
27
|
} = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
28
28
|
|
|
29
29
|
const templatePath = path.join(__dirname, "./tempRelationship.ejs");
|
|
30
|
-
const yaml = require("yaml")
|
|
31
30
|
|
|
32
31
|
const objectschemaLocalByPath = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
33
32
|
|
|
34
33
|
const { firstLetterUpperCase: upperCase, getLocalServiceTag } = require("../../../../MainLibs/src/Utils");
|
|
35
|
-
const { createBasicRelationshipsProperties } = require('
|
|
36
|
-
|
|
34
|
+
const { createBasicRelationshipsProperties } = require('../../../../GenerateCodeLibs/src/GenerateCodeLibs');
|
|
35
|
+
const { ADD_ON_DATA_STRUCTURE_TYPE } = require('../../../../TemplateManager/src/libs/Consts');
|
|
37
36
|
async function data(_izContext, settings, srcPath) {
|
|
38
37
|
|
|
39
38
|
|
|
40
|
-
let objectSchema = await objectschemaLocalByPath.
|
|
39
|
+
let objectSchema = await objectschemaLocalByPath.getLocalObjectSchemasWithHierarchy(
|
|
41
40
|
_izContext,
|
|
42
|
-
settings.objType
|
|
43
|
-
|
|
41
|
+
settings.objType.objectType,
|
|
42
|
+
path.join(srcPath, "./schemas")
|
|
43
|
+
).then(res => res.records[0]);
|
|
44
44
|
|
|
45
45
|
if (!objectSchema) {
|
|
46
46
|
throw Error(`Invalid objType:${objTypeString(objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
// validate addOnData type PropertyValues
|
|
50
|
+
let addOn = objectSchema.addOnDataStructure.find(addOn => {
|
|
51
|
+
return addOn.type === ADD_ON_DATA_STRUCTURE_TYPE.propertyValue && objectSchema.objectType === settings.objType.objectType
|
|
52
|
+
})
|
|
53
|
+
console.log("addOn in generate Relationship", addOn)
|
|
54
|
+
if (!addOn) {
|
|
55
|
+
throw Error(`Invalid objType:${objTypeString(objType)}, not have setting for generate propertyValues`)
|
|
56
|
+
}
|
|
50
57
|
|
|
51
58
|
let createSourceRecords = []
|
|
52
59
|
let generateRelationships = createSourceParams(
|
|
53
60
|
_izContext,
|
|
54
61
|
objectSchema,
|
|
62
|
+
settings,
|
|
55
63
|
srcPath
|
|
56
64
|
);
|
|
57
65
|
createSourceRecords.push(...generateRelationships);
|
|
@@ -77,26 +85,28 @@ async function data(_izContext, settings, srcPath) {
|
|
|
77
85
|
function createSourceParams(
|
|
78
86
|
_izContext,
|
|
79
87
|
objectSchema,
|
|
88
|
+
settings,
|
|
80
89
|
srcPath
|
|
81
90
|
) {
|
|
82
91
|
const attributeRelationships = [];
|
|
83
|
-
const objectType = objectSchema.objectType; // main objectType
|
|
92
|
+
// const objectType = objectSchema.objectType; // main objectType
|
|
93
|
+
let propertyValue = settings.propertyValueTag
|
|
84
94
|
const storageResources = objectSchema.storageResources // storageResource from main objectType
|
|
85
95
|
const serviceTag = getLocalServiceTag(srcPath)
|
|
86
96
|
|
|
87
97
|
attributeRelationships.push(
|
|
88
98
|
{ // has{objectType}propertyValue
|
|
89
|
-
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(
|
|
99
|
+
relationshipTag: PREFIX_RELATIONSHIP.has + upperCase(propertyValue) + PROPERTYVALUE_TAG.property,
|
|
90
100
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
91
101
|
{
|
|
92
102
|
serviceTag: serviceTag,
|
|
93
|
-
objectType:
|
|
103
|
+
objectType: propertyValue,
|
|
94
104
|
linkType: "one",
|
|
95
105
|
requiredOnCreate: false
|
|
96
106
|
},
|
|
97
107
|
{
|
|
98
108
|
serviceTag: serviceTag,
|
|
99
|
-
objectType:
|
|
109
|
+
objectType: propertyValue + PROPERTYVALUE_TAG.property,
|
|
100
110
|
linkType: "many",
|
|
101
111
|
requiredOnCreate: true
|
|
102
112
|
},
|
|
@@ -106,17 +116,17 @@ function createSourceParams(
|
|
|
106
116
|
},
|
|
107
117
|
// disabled{objectType}propertyValue
|
|
108
118
|
{
|
|
109
|
-
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(
|
|
119
|
+
relationshipTag: PREFIX_RELATIONSHIP.disabled + upperCase(propertyValue) + PROPERTYVALUE_TAG.property,
|
|
110
120
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
111
121
|
{
|
|
112
122
|
serviceTag: serviceTag,
|
|
113
|
-
objectType:
|
|
123
|
+
objectType: propertyValue,
|
|
114
124
|
linkType: "one",
|
|
115
125
|
requiredOnCreate: false
|
|
116
126
|
},
|
|
117
127
|
{
|
|
118
128
|
serviceTag: serviceTag,
|
|
119
|
-
objectType:
|
|
129
|
+
objectType: propertyValue + PROPERTYVALUE_TAG.property,
|
|
120
130
|
linkType: "many",
|
|
121
131
|
requiredOnCreate: true
|
|
122
132
|
},
|
|
@@ -126,17 +136,17 @@ function createSourceParams(
|
|
|
126
136
|
},
|
|
127
137
|
|
|
128
138
|
{ // is{objectType}PropertyLabel
|
|
129
|
-
relationshipTag: PREFIX_RELATIONSHIP.is + upperCase(
|
|
139
|
+
relationshipTag: PREFIX_RELATIONSHIP.is + upperCase(propertyValue) + PROPERTYVALUE_TAG.propertyLabel,
|
|
130
140
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
131
141
|
{
|
|
132
142
|
serviceTag: serviceTag,
|
|
133
|
-
objectType:
|
|
143
|
+
objectType: propertyValue + PROPERTYVALUE_TAG.property,
|
|
134
144
|
linkType: "many",
|
|
135
145
|
requiredOnCreate: true
|
|
136
146
|
},
|
|
137
147
|
{
|
|
138
148
|
serviceTag: serviceTag,
|
|
139
|
-
objectType:
|
|
149
|
+
objectType: propertyValue + PROPERTYVALUE_TAG.propertyLabel,
|
|
140
150
|
linkType: "one",
|
|
141
151
|
requiredOnCreate: false
|
|
142
152
|
},
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js
CHANGED
|
@@ -83,6 +83,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
83
83
|
[
|
|
84
84
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
85
85
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
86
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
87
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
86
88
|
]
|
|
87
89
|
),
|
|
88
90
|
createIamRole(
|
|
@@ -96,7 +98,6 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
96
98
|
]
|
|
97
99
|
)
|
|
98
100
|
)
|
|
99
|
-
|
|
100
101
|
for (const relationship of allObjectRelationships) {
|
|
101
102
|
let [storageType, relationshipTag, links] = checkDynamoTypeRelationship(relationship)
|
|
102
103
|
if (storageType === STORAGE_TYPES.dynamoDB) {
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js
CHANGED
|
@@ -38,7 +38,7 @@ const {
|
|
|
38
38
|
checkDynamoTypeRelationship,
|
|
39
39
|
createDynamoDbComponentByLinks,
|
|
40
40
|
DYNAMO_RESOURCE
|
|
41
|
-
} = require("../../../../../../../MainLibs/
|
|
41
|
+
} = require("../../../../../../../MainLibs/src/Consts");
|
|
42
42
|
|
|
43
43
|
const templatePath = path.join(__dirname, './template.ejs')
|
|
44
44
|
|
|
@@ -81,6 +81,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
81
81
|
[
|
|
82
82
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
83
83
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
84
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
85
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
84
86
|
]
|
|
85
87
|
),
|
|
86
88
|
createIamRole(
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js
CHANGED
|
@@ -83,6 +83,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
83
83
|
[
|
|
84
84
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
85
85
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
86
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
87
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
86
88
|
]
|
|
87
89
|
),
|
|
88
90
|
createIamRole(
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js
CHANGED
|
@@ -65,6 +65,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
65
65
|
let functionName = FUNCTION_NAME.createRel
|
|
66
66
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
67
67
|
|
|
68
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
69
|
+
|
|
68
70
|
additionalResourcePermission.push(
|
|
69
71
|
createIamRole(
|
|
70
72
|
{
|
|
@@ -80,6 +82,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
80
82
|
[
|
|
81
83
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
82
84
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
85
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
86
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
83
87
|
]
|
|
84
88
|
),
|
|
85
89
|
createIamRole(
|
package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
11
|
role: <%- roleName %>Role
|
|
13
12
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
13
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js
CHANGED
|
@@ -68,6 +68,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
68
68
|
|
|
69
69
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
70
70
|
|
|
71
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
72
|
+
|
|
71
73
|
additionalResourcePermission.push(
|
|
72
74
|
createIamRole(
|
|
73
75
|
{
|
|
@@ -83,6 +85,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
83
85
|
[
|
|
84
86
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
85
87
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
88
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
89
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
86
90
|
]
|
|
87
91
|
),
|
|
88
92
|
createIamRole(
|
|
@@ -90,7 +94,7 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
90
94
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe]
|
|
91
95
|
},
|
|
92
96
|
[
|
|
93
|
-
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.
|
|
97
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.createRelComplete) + "_Out"),
|
|
94
98
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
95
99
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out"),
|
|
96
100
|
]
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js
CHANGED
|
@@ -66,6 +66,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
66
66
|
let functionName = FUNCTION_NAME.deleteRel
|
|
67
67
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
68
68
|
|
|
69
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
70
|
+
|
|
69
71
|
additionalResourcePermission.push(
|
|
70
72
|
createIamRole(
|
|
71
73
|
{
|
|
@@ -81,6 +83,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
81
83
|
[
|
|
82
84
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
83
85
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
86
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
87
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
84
88
|
]
|
|
85
89
|
),
|
|
86
90
|
createIamRole(
|
|
@@ -88,13 +92,12 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
88
92
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe]
|
|
89
93
|
},
|
|
90
94
|
[
|
|
91
|
-
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.
|
|
95
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.createRelComplete) + "_Out"),
|
|
92
96
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
93
97
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out"),
|
|
94
98
|
]
|
|
95
99
|
)
|
|
96
100
|
)
|
|
97
|
-
|
|
98
101
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
99
102
|
|
|
100
103
|
for (const relationship of allObjectRelationships) {
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js
CHANGED
|
@@ -68,6 +68,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
68
68
|
|
|
69
69
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
70
70
|
|
|
71
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
72
|
+
|
|
71
73
|
additionalResourcePermission.push(
|
|
72
74
|
createIamRole(
|
|
73
75
|
{
|
|
@@ -83,6 +85,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
83
85
|
[
|
|
84
86
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
85
87
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
88
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
89
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
86
90
|
]
|
|
87
91
|
),
|
|
88
92
|
createIamRole(
|
|
@@ -90,7 +94,7 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
90
94
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe]
|
|
91
95
|
},
|
|
92
96
|
[
|
|
93
|
-
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.
|
|
97
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.createRelComplete) + "_Out"),
|
|
94
98
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
95
99
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out"),
|
|
96
100
|
]
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js
CHANGED
|
@@ -65,6 +65,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
65
65
|
let functionName = FUNCTION_NAME.deleteRel
|
|
66
66
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
67
67
|
|
|
68
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
69
|
+
|
|
68
70
|
additionalResourcePermission.push(
|
|
69
71
|
createIamRole(
|
|
70
72
|
{
|
|
@@ -80,6 +82,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
80
82
|
[
|
|
81
83
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
82
84
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
85
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
86
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
83
87
|
]
|
|
84
88
|
),
|
|
85
89
|
createIamRole(
|
|
@@ -87,7 +91,7 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
87
91
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe]
|
|
88
92
|
},
|
|
89
93
|
[
|
|
90
|
-
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.
|
|
94
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.createRelComplete) + "_Out"),
|
|
91
95
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
92
96
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out"),
|
|
93
97
|
]
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
11
|
role: <%- roleName %>Role
|
|
13
12
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
13
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js
CHANGED
|
@@ -66,6 +66,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
66
66
|
let functionName = FUNCTION_NAME.getRel
|
|
67
67
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
68
68
|
|
|
69
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
70
|
+
|
|
69
71
|
additionalResourcePermission.push(
|
|
70
72
|
createIamRole(
|
|
71
73
|
{
|
|
@@ -81,6 +83,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
81
83
|
[
|
|
82
84
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
83
85
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
86
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
87
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
84
88
|
]
|
|
85
89
|
),
|
|
86
90
|
createIamRole(
|
|
@@ -88,13 +92,12 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
88
92
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe]
|
|
89
93
|
},
|
|
90
94
|
[
|
|
91
|
-
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.
|
|
95
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.createRelComplete) + "_Out"),
|
|
92
96
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
93
97
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out"),
|
|
94
98
|
]
|
|
95
99
|
)
|
|
96
100
|
)
|
|
97
|
-
|
|
98
101
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
99
102
|
|
|
100
103
|
for (const relationship of allObjectRelationships) {
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
11
|
role: <%- roleName %>Role
|
|
13
12
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
13
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js
CHANGED
|
@@ -87,6 +87,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
87
87
|
let functionName = FUNCTION_NAME.updateRel
|
|
88
88
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
89
89
|
|
|
90
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
91
|
+
|
|
90
92
|
additionalResourcePermission.push(
|
|
91
93
|
createIamRole(
|
|
92
94
|
{
|
|
@@ -102,6 +104,8 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
102
104
|
[
|
|
103
105
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs)),
|
|
104
106
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
107
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq)),
|
|
108
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(HANDLER.hdrDsq) + "DLQ"),
|
|
105
109
|
]
|
|
106
110
|
),
|
|
107
111
|
createIamRole(
|
|
@@ -109,7 +113,7 @@ function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
|
109
113
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe]
|
|
110
114
|
},
|
|
111
115
|
[
|
|
112
|
-
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.
|
|
116
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.createRelComplete) + "_Out"),
|
|
113
117
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
114
118
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out"),
|
|
115
119
|
]
|
package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
11
|
role: <%- roleName %>Role
|
|
13
12
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
13
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
@@ -24,7 +24,7 @@ const STORAGE_TYPES = {
|
|
|
24
24
|
graph: "graph"
|
|
25
25
|
}
|
|
26
26
|
const templatePath = path.join(__dirname, './template.ejs')
|
|
27
|
-
const { SOURCE_PATH, SAVE_FILE_NAME, checkDynamoTypeRelationship, createDynamoDbComponentByLinks } = require('../../../../MainLibs')
|
|
27
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, checkDynamoTypeRelationship, createDynamoDbComponentByLinks } = require('../../../../MainLibs/src/Consts');
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* create param of crateSouce for FindData And processLogical
|
|
@@ -79,7 +79,6 @@ const createDynamoPerRelationshipLink = (_izContext, allObjectRelationships, src
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
|
|
83
82
|
for (let dynamoTablePerLink of dynamoTablePerLinks) {
|
|
84
83
|
resultsForCreateSource.push({
|
|
85
84
|
templatePath: templatePath,
|
|
@@ -39,9 +39,9 @@ async function filterCreateResourceYaml(_izContext, createSourceParams, objSchem
|
|
|
39
39
|
const allLocalFlowSchema = await getObjectSchema.getAllLocalFlowSchemas(_izContext, objSchemaPath);
|
|
40
40
|
await Promise.all(allLocalFlowSchema.records.map(async (flowSchema) => {
|
|
41
41
|
if (flowSchema.statusType === "storedCache") {
|
|
42
|
-
tableNamesToFilter.add(...await getStoredCacheTableFromFlowSchema(_izContext, flowSchema))
|
|
42
|
+
tableNamesToFilter.add(...await getStoredCacheTableFromFlowSchema(_izContext, flowSchema, objSchemaPath))
|
|
43
43
|
} else if (flowSchema.statusType === "triggerCache" && flowSchema?.triggerType === "storedCache") {
|
|
44
|
-
tableNamesToFilter.add(...await getStoredCacheTableFromFlowSchema(_izContext, flowSchema))
|
|
44
|
+
tableNamesToFilter.add(...await getStoredCacheTableFromFlowSchema(_izContext, flowSchema, objSchemaPath))
|
|
45
45
|
}
|
|
46
46
|
}))
|
|
47
47
|
|
|
@@ -55,7 +55,7 @@ async function filterCreateResourceYaml(_izContext, createSourceParams, objSchem
|
|
|
55
55
|
|
|
56
56
|
module.exports = filterCreateResourceYaml;
|
|
57
57
|
|
|
58
|
-
async function getStoredCacheTableFromFlowSchema(_izContext, flowSchema) {
|
|
58
|
+
async function getStoredCacheTableFromFlowSchema(_izContext, flowSchema, objSchemaPath) {
|
|
59
59
|
let tableNameStoredCache = new Set();
|
|
60
60
|
const objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], objSchemaPath).then(res => res.records[0])
|
|
61
61
|
if (objectSchema) {
|
|
@@ -67,4 +67,5 @@ async function getStoredCacheTableFromFlowSchema(_izContext, flowSchema) {
|
|
|
67
67
|
} else {
|
|
68
68
|
throw new NoRetryError('not have objectSchema in service to get')
|
|
69
69
|
}
|
|
70
|
+
return tableNameStoredCache;
|
|
70
71
|
}
|
|
@@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
-
const Consts = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts')
|
|
20
19
|
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
21
20
|
const { ADD_ON_DATA_STRUCTURE_TYPE } = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Consts');
|
|
22
21
|
|
|
File without changes
|