@izara_project/izara-market-library-service-schemas 1.0.27 → 1.0.29
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 +9 -5
- package/src/GenerateCodeLibs/src/Consts.js +5 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +5 -5
- package/src/MainLibs/src/Consts.js +46 -2
- package/src/reStructure/GenerateCode.js +0 -4
- package/src/reStructure/GenerateSchema.js +17 -5
- package/src/reStructure/SchemaConfig.js +3 -2
- package/src/reStructure/TemplateData/attributeTreeSchema/generateTemplateData.js +58 -6
- package/src/reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema/data.js +161 -101
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +3 -4
- package/src/reStructure/TemplateData/findData/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +2 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +2 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +2 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +5 -6
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +1 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +3 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/handler/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/mainFunction/template.ejs +3 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +2 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +5 -6
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +4 -5
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +1 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +1 -0
- package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +2 -3
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +4 -5
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +4 -6
- package/src/reStructure/TemplateData/perActionComplete/generateTemplateData.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +2 -3
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +4 -6
- package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +2 -3
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +4 -6
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/template.ejs +1 -3
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +3 -3
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +6 -7
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +5 -4
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/template.ejs +5 -6
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +5 -6
- package/src/reStructure/TemplateData/processLogical/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +5 -6
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/template.ejs +6 -5
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +29 -6
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +27 -4
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +27 -4
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +28 -4
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +66 -18
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +2 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +5 -6
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +27 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +26 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +28 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +28 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +55 -5
- package/src/reStructure/TemplateData/relationshipPerAction/generateTemplateData.js +62 -6
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +121 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +134 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +121 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/template.ejs +13 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +134 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/template.ejs +17 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/data.js +57 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/template.ejs +138 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/data.js +58 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/template.ejs +183 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/template.ejs +125 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/template.ejs +163 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +322 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +77 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +110 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +60 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +125 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +55 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +141 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/template.ejs +47 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +71 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-out/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-out/template.ejs +10 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +27 -22
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +27 -5
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +28 -5
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +26 -4
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +55 -7
- package/src/reStructure/TemplateData/relationshipPerAction.zip +0 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +50 -42
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +100 -0
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +4 -5
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/template.ejs +1 -1
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +11 -2
- package/src/reStructure/TemplateData/testTemplate/data.js +27 -0
- package/src/reStructure/TemplateData/testTemplate/template.ejs +5 -0
- /package/src/reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema/{attributeLink.ejs → attributeLinkTemplate.ejs} +0 -0
package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js
CHANGED
|
@@ -52,12 +52,14 @@ const {
|
|
|
52
52
|
SAVE_FILE_NAME,
|
|
53
53
|
FUNCTION_NAME,
|
|
54
54
|
SNS_RESOURCE,
|
|
55
|
-
DYNAMO_RESOURCE,
|
|
56
55
|
defaultIamRolePerAction,
|
|
57
56
|
awaitingMultipleStepsRole,
|
|
58
57
|
shortNameHandler,
|
|
59
58
|
SHORT_FUNCTION_NAME,
|
|
60
|
-
SOURCE_GENERATE_IAM_ROLE
|
|
59
|
+
SOURCE_GENERATE_IAM_ROLE,
|
|
60
|
+
checkDynamoTypeRelationship,
|
|
61
|
+
createDynamoDbComponentByLinks,
|
|
62
|
+
DYNAMO_RESOURCE
|
|
61
63
|
} = require("../../../../../../../MainLibs/index.js").consts;
|
|
62
64
|
|
|
63
65
|
const templatePath = path.join(__dirname, './template.ejs')
|
|
@@ -70,16 +72,16 @@ const templatePath = path.join(__dirname, './template.ejs')
|
|
|
70
72
|
* @return {{ templatePath, templateData, setting } }
|
|
71
73
|
*/
|
|
72
74
|
|
|
73
|
-
function data(_izContext, srcPath) {
|
|
75
|
+
function data(_izContext, allObjectRelationships, srcPath) {
|
|
74
76
|
let createSourceArray = [];
|
|
75
77
|
|
|
76
|
-
const createSourceParam = createParamForCreateSource(srcPath);
|
|
78
|
+
const createSourceParam = createParamForCreateSource(allObjectRelationships, srcPath);
|
|
77
79
|
createSourceArray.push(createSourceParam);
|
|
78
80
|
return createSourceArray
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
|
|
82
|
-
function createParamForCreateSource(srcPath) {
|
|
84
|
+
function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
83
85
|
|
|
84
86
|
let handlerType = HANDLER.hdrDsq
|
|
85
87
|
let functionName = FUNCTION_NAME.updateRel
|
|
@@ -108,6 +110,26 @@ function createParamForCreateSource(srcPath) {
|
|
|
108
110
|
|
|
109
111
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
110
112
|
|
|
113
|
+
for (const relationship of allObjectRelationships) {
|
|
114
|
+
let [storageType, relationshipTag, links] = checkDynamoTypeRelationship(relationship)
|
|
115
|
+
if (storageType === STORAGE_TYPES.dynamoDB) {
|
|
116
|
+
for (const link of links) {
|
|
117
|
+
let dynamoComponent = createDynamoDbComponentByLinks(link, relationshipTag)
|
|
118
|
+
additionalResourcePermission.push(
|
|
119
|
+
createIamRole(
|
|
120
|
+
{
|
|
121
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [DYNAMO_RESOURCE.updateItem]
|
|
122
|
+
},
|
|
123
|
+
[
|
|
124
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameFrom)),
|
|
125
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameTo))
|
|
126
|
+
]
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
111
133
|
return {
|
|
112
134
|
templatePath: templatePath,
|
|
113
135
|
templateData: {
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js
CHANGED
|
@@ -54,12 +54,14 @@ const {
|
|
|
54
54
|
SAVE_FILE_NAME,
|
|
55
55
|
FUNCTION_NAME,
|
|
56
56
|
SNS_RESOURCE,
|
|
57
|
-
DYNAMO_RESOURCE,
|
|
58
57
|
defaultIamRolePerAction,
|
|
59
58
|
awaitingMultipleStepsRole,
|
|
60
59
|
shortNameHandler,
|
|
61
60
|
SHORT_FUNCTION_NAME,
|
|
62
|
-
SOURCE_GENERATE_IAM_ROLE
|
|
61
|
+
SOURCE_GENERATE_IAM_ROLE,
|
|
62
|
+
checkDynamoTypeRelationship,
|
|
63
|
+
createDynamoDbComponentByLinks,
|
|
64
|
+
DYNAMO_RESOURCE
|
|
63
65
|
} = require("../../../../../../../MainLibs/index.js").consts;
|
|
64
66
|
|
|
65
67
|
const templatePath = path.join(__dirname, './template.ejs')
|
|
@@ -72,16 +74,16 @@ const templatePath = path.join(__dirname, './template.ejs')
|
|
|
72
74
|
* @return {{ templatePath, templateData, setting } }
|
|
73
75
|
*/
|
|
74
76
|
|
|
75
|
-
function data(_izContext, srcPath) {
|
|
77
|
+
function data(_izContext, allObjectRelationships, srcPath) {
|
|
76
78
|
let createSourceArray = [];
|
|
77
79
|
|
|
78
|
-
const createSourceParam = createParamForCreateSource(srcPath);
|
|
80
|
+
const createSourceParam = createParamForCreateSource(allObjectRelationships, srcPath);
|
|
79
81
|
createSourceArray.push(createSourceParam);
|
|
80
82
|
return createSourceArray
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
|
|
84
|
-
function createParamForCreateSource(srcPath) {
|
|
86
|
+
function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
85
87
|
|
|
86
88
|
let handlerType = HANDLER.hdrInv
|
|
87
89
|
let functionName = FUNCTION_NAME.updateRel
|
|
@@ -98,6 +100,27 @@ function createParamForCreateSource(srcPath) {
|
|
|
98
100
|
]
|
|
99
101
|
)
|
|
100
102
|
)
|
|
103
|
+
|
|
104
|
+
for (const relationship of allObjectRelationships) {
|
|
105
|
+
let [storageType, relationshipTag, links] = checkDynamoTypeRelationship(relationship)
|
|
106
|
+
if (storageType === STORAGE_TYPES.dynamoDB) {
|
|
107
|
+
for (const link of links) {
|
|
108
|
+
let dynamoComponent = createDynamoDbComponentByLinks(link, relationshipTag)
|
|
109
|
+
additionalResourcePermission.push(
|
|
110
|
+
createIamRole(
|
|
111
|
+
{
|
|
112
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [DYNAMO_RESOURCE.updateItem]
|
|
113
|
+
},
|
|
114
|
+
[
|
|
115
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameFrom)),
|
|
116
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameTo))
|
|
117
|
+
]
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
101
124
|
return {
|
|
102
125
|
templatePath: templatePath,
|
|
103
126
|
templateData: {
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js
CHANGED
|
@@ -56,7 +56,9 @@ const {
|
|
|
56
56
|
defaultIamRolePerAction,
|
|
57
57
|
resourceNames,
|
|
58
58
|
shortNameHandler,
|
|
59
|
-
SOURCE_GENERATE_IAM_ROLE
|
|
59
|
+
SOURCE_GENERATE_IAM_ROLE,
|
|
60
|
+
checkDynamoTypeRelationship,
|
|
61
|
+
createDynamoDbComponentByLinks,
|
|
60
62
|
} = require("../../../../../../../MainLibs/index.js").consts;
|
|
61
63
|
|
|
62
64
|
|
|
@@ -70,9 +72,9 @@ const templatePath = path.join(__dirname, './template.ejs')
|
|
|
70
72
|
* @return {{ templatePath, templateData, setting } }
|
|
71
73
|
*/
|
|
72
74
|
|
|
73
|
-
function data(_izContext, srcPath) {
|
|
75
|
+
function data(_izContext, allObjectRelationships, srcPath) {
|
|
74
76
|
let createSourceArray = [];
|
|
75
|
-
const createSourceParam = createParamForCreateSource(srcPath);
|
|
77
|
+
const createSourceParam = createParamForCreateSource(allObjectRelationships, srcPath);
|
|
76
78
|
createSourceArray.push(createSourceParam);
|
|
77
79
|
// console.log("createSourceArrayInUpdaterelationShipSchemahdrSqs", createSourceArray)
|
|
78
80
|
return createSourceArray
|
|
@@ -80,7 +82,7 @@ function data(_izContext, srcPath) {
|
|
|
80
82
|
|
|
81
83
|
|
|
82
84
|
|
|
83
|
-
function createParamForCreateSource(srcPath) {
|
|
85
|
+
function createParamForCreateSource(allObjectRelationships, srcPath) {
|
|
84
86
|
|
|
85
87
|
let handlerType = HANDLER.hdrSqs
|
|
86
88
|
let functionName = FUNCTION_NAME.updateRel
|
|
@@ -108,8 +110,28 @@ function createParamForCreateSource(srcPath) {
|
|
|
108
110
|
]
|
|
109
111
|
),
|
|
110
112
|
)
|
|
113
|
+
|
|
111
114
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
112
115
|
|
|
116
|
+
for (const relationship of allObjectRelationships) {
|
|
117
|
+
let [storageType, relationshipTag, links] = checkDynamoTypeRelationship(relationship)
|
|
118
|
+
if (storageType === STORAGE_TYPES.dynamoDB) {
|
|
119
|
+
for (const link of links) {
|
|
120
|
+
let dynamoComponent = createDynamoDbComponentByLinks(link, relationshipTag)
|
|
121
|
+
additionalResourcePermission.push(
|
|
122
|
+
createIamRole(
|
|
123
|
+
{
|
|
124
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [DYNAMO_RESOURCE.updateItem]
|
|
125
|
+
},
|
|
126
|
+
[
|
|
127
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameFrom)),
|
|
128
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameTo))
|
|
129
|
+
]
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
113
135
|
return {
|
|
114
136
|
templatePath: templatePath,
|
|
115
137
|
templateData: {
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs
CHANGED
|
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
const izara = require("@izara_project/izara-middleware");
|
|
20
20
|
const middleware = izara.middlewareHandler;
|
|
21
|
-
const callingFlowSharedLib = require('@izara_project/izara-
|
|
21
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
22
22
|
const {
|
|
23
23
|
validateSchemaMiddleware
|
|
24
24
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs
CHANGED
|
@@ -19,12 +19,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
19
19
|
const izara = require("@izara_project/izara-middleware");
|
|
20
20
|
const middleware = izara.middlewareHandler;
|
|
21
21
|
|
|
22
|
-
const callingFlowSharedLib = require('@izara_project/izara-
|
|
22
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
23
|
|
|
24
24
|
// const CorrelationIds = require('@izara_project/izara-core-library-correlation-ids')
|
|
25
25
|
// const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
26
|
// const IntegrationTestDetail = require('@izara_project/izara-core-library-integration-tests')
|
|
27
|
-
const recordHandlerSharedLib = require('@izara_project/izara-
|
|
27
|
+
const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
|
|
28
28
|
const Logger = require("@izara_project/izara-core-library-logger/src/Logger");
|
|
29
29
|
const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
|
|
30
30
|
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs
CHANGED
|
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
const izara = require("@izara_project/izara-middleware");
|
|
19
19
|
const middleware = izara.middlewareHandler;
|
|
20
20
|
|
|
21
|
-
const callingFlowSharedLib = require('@izara_project/izara-
|
|
21
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
22
22
|
|
|
23
23
|
// const CorrelationIds = require('@izara_project/izara-core-library-correlation-ids')
|
|
24
24
|
// const Logger = require('@izara_project/izara-core-library-logger');
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs
CHANGED
|
@@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
const izara = require("@izara_project/izara-middleware");
|
|
20
20
|
const middleware = izara.middlewareHandler;
|
|
21
|
-
const callingFlowSharedLib = require('@izara_project/izara-
|
|
21
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
22
22
|
const {
|
|
23
23
|
validateSchemaMiddleware
|
|
24
24
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
25
25
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
|
-
const recordHandlerSharedLib = require('@izara_project/izara-
|
|
26
|
+
const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
|
|
27
27
|
|
|
28
28
|
const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
|
|
29
29
|
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs
CHANGED
|
@@ -19,13 +19,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
19
19
|
|
|
20
20
|
const hash = require("object-hash");
|
|
21
21
|
|
|
22
|
-
const callingFlowSharedLib = require('@izara_project/izara-
|
|
23
|
-
const lambdaSharedLib = require(
|
|
22
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
|
+
const lambdaSharedLib = require("@izara_project/izara-core-library-lambda");
|
|
24
|
+
const snsSharedLib = require("@izara_project/izara-core-library-sns");
|
|
25
|
+
const dynamodbSharedLib = require("@izara_project/izara-core-library-dynamodb");
|
|
26
|
+
const asyncFlowSharedLib = require("@izara_project/izara-core-library-asynchronous-flow");
|
|
24
27
|
|
|
25
|
-
const
|
|
26
|
-
const sns = require("@izara_project/izara-core-library-external-request/src/resources/Sns");
|
|
28
|
+
const identifiersObject = require('@izara_project/izara-core-library-service-schemas/src/IdentifiersObject');
|
|
27
29
|
|
|
28
|
-
const
|
|
30
|
+
const sns = require("@izara_project/izara-core-library-external-request/src/resources/Sns");
|
|
29
31
|
|
|
30
32
|
// const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
|
|
31
33
|
|
|
@@ -265,6 +267,30 @@ module.exports.updateRelationship = async (
|
|
|
265
267
|
PREFIX.updateRel // prefix, use constant further
|
|
266
268
|
)
|
|
267
269
|
);
|
|
270
|
+
} else if (storageResource.storageType === consts.STORAGE_TYPES.dynamoDB) {
|
|
271
|
+
let tableNameFrom = `${firstObject.objType.serviceTag}_${firstObject.objType.objectType}__${relType.relationshipTag}__${secondObject.objType.serviceTag}_${secondObject.objType.objectType}`;
|
|
272
|
+
let tableNameTo = `${secondObject.objType.serviceTag}_${secondObject.objType.objectType}__${relType.relationshipTag}__${firstObject.objType.serviceTag}_${firstObject.objType.objectType}`;
|
|
273
|
+
|
|
274
|
+
let identifiersConcatFirstObject = await identifiersObject.identifiersConcatFromIdentifiers(_izContext, firstObject.objType, firstObject.identifiers);
|
|
275
|
+
let identifiersConcatSecondObject = await identifiersObject.identifiersConcatFromIdentifiers(_izContext, secondObject.objType, secondObject.identifiers);
|
|
276
|
+
const firstObjectIdentifiersConcat = `${firstObject.objType.serviceTag}_${firstObject.objType.objectType}__identifiersConcat`;
|
|
277
|
+
const secondObjectIdentifiersConcat = `${secondObject.objType.serviceTag}_${secondObject.objType.objectType}__identifiersConcat`;
|
|
278
|
+
|
|
279
|
+
await dynamodbSharedLib.updateItem(_izContext,
|
|
280
|
+
await dynamodbSharedLib.tableName(_izContext, tableNameFrom),
|
|
281
|
+
{
|
|
282
|
+
[identifiersConcatFirstObject]: firstObjectIdentifiersConcat,
|
|
283
|
+
[identifiersConcatSecondObject]: secondObjectIdentifiersConcat
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
|
|
287
|
+
await dynamodbSharedLib.updateItem(_izContext,
|
|
288
|
+
await dynamodbSharedLib.tableName(_izContext, tableNameTo),
|
|
289
|
+
{
|
|
290
|
+
[identifiersConcatSecondObject]: secondObjectIdentifiersConcat,
|
|
291
|
+
[identifiersConcatFirstObject]: firstObjectIdentifiersConcat
|
|
292
|
+
}
|
|
293
|
+
)
|
|
268
294
|
}
|
|
269
295
|
}
|
|
270
296
|
|
|
@@ -320,8 +346,30 @@ module.exports.updateRelationship = async (
|
|
|
320
346
|
})
|
|
321
347
|
)
|
|
322
348
|
|
|
323
|
-
} else {
|
|
324
|
-
|
|
349
|
+
} else if (!awaitingStepIds.length) {
|
|
350
|
+
_izContext.logger.debug("dynamoDb storageResourceTag")
|
|
351
|
+
let messageObject = {
|
|
352
|
+
firstObject: firstObject,
|
|
353
|
+
secondObject: secondObject,
|
|
354
|
+
relType: relType,
|
|
355
|
+
relationshipDirection,
|
|
356
|
+
relationshipProperties
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
if (callingFlowConfig[callingFlowSharedLib.consts.CALLINGFLOW_PROPERTYNAME]) {
|
|
360
|
+
_izContext.logger.debug("have callingFlow");
|
|
361
|
+
messageObject = callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(callingFlowConfig, messageObject);
|
|
362
|
+
|
|
363
|
+
let messageAttributes = callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {});
|
|
364
|
+
let sendMessageToOutCreateRelComplete = {
|
|
365
|
+
Message: JSON.stringify(messageObject),
|
|
366
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
367
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
|
|
368
|
+
}
|
|
369
|
+
_izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutCreateRelComplete);
|
|
370
|
+
await sns.publishAsync(_izContext, sendMessageToOutCreateRelComplete);
|
|
371
|
+
}
|
|
372
|
+
|
|
325
373
|
}
|
|
326
374
|
|
|
327
375
|
return {
|
|
Binary file
|
|
@@ -46,82 +46,88 @@ const createAwaitingMultipleStepDynamoDbData = (_izContext, srcPath) => {
|
|
|
46
46
|
|
|
47
47
|
defaultDynamoDataLists.push(
|
|
48
48
|
{
|
|
49
|
-
|
|
50
|
-
"
|
|
49
|
+
tableName: "AwaitingMultipleSteps",
|
|
50
|
+
resourceName: "AwaitingMultipleSteps",
|
|
51
|
+
attributes: [
|
|
51
52
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
keyType: "partitionKey",
|
|
54
|
+
AttributeName: "awaitingStepId",
|
|
55
|
+
AttributeType: "S"
|
|
55
56
|
},
|
|
56
57
|
{
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
keyType: "sortKey",
|
|
59
|
+
AttributeName: "pendingStepId",
|
|
60
|
+
AttributeType: "S"
|
|
60
61
|
}
|
|
61
62
|
]
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
|
-
|
|
65
|
-
"
|
|
65
|
+
tableName: "AwaitingMultipleStepByPending",
|
|
66
|
+
resourceName: "AwaitingMultipleStepByPending",
|
|
67
|
+
attributes: [
|
|
66
68
|
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
keyType: "partitionKey",
|
|
70
|
+
AttributeName: "pendingStepId",
|
|
71
|
+
AttributeType: "S"
|
|
70
72
|
},
|
|
71
73
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
keyType: "sortKey",
|
|
75
|
+
AttributeName: "awaitingStepId",
|
|
76
|
+
AttributeType: "S"
|
|
75
77
|
}
|
|
76
78
|
]
|
|
77
79
|
},
|
|
78
80
|
{
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
+
tableName: "FindDataMain",
|
|
82
|
+
resourceName: "FindDataMain",
|
|
83
|
+
attributes: [
|
|
81
84
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
keyType: "partitionKey",
|
|
86
|
+
AttributeName: "findDataId",
|
|
87
|
+
AttributeType: "S"
|
|
85
88
|
}
|
|
86
89
|
]
|
|
87
90
|
},
|
|
88
91
|
{
|
|
89
|
-
|
|
90
|
-
"
|
|
92
|
+
tableName: "LogicalResultsMain",
|
|
93
|
+
resourceName: "LogicalResultsMain",
|
|
94
|
+
attributes: [
|
|
91
95
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
96
|
+
keyType: "partitionKey",
|
|
97
|
+
AttributeName: "logicalResultId",
|
|
98
|
+
AttributeType: "S"
|
|
95
99
|
}
|
|
96
100
|
]
|
|
97
101
|
},
|
|
98
102
|
{
|
|
99
|
-
|
|
100
|
-
"
|
|
103
|
+
tableName: "LogicalResultsData",
|
|
104
|
+
resourceName: "LogicalResultsData",
|
|
105
|
+
attributes: [
|
|
101
106
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
107
|
+
keyType: "partitionKey",
|
|
108
|
+
AttributeName: "logicalResultId",
|
|
109
|
+
AttributeType: "S"
|
|
105
110
|
},
|
|
106
111
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
keyType: "sortKey",
|
|
113
|
+
AttributeName: "identifiersId",
|
|
114
|
+
AttributeType: "S"
|
|
110
115
|
}
|
|
111
116
|
]
|
|
112
117
|
},
|
|
113
118
|
{
|
|
114
|
-
|
|
115
|
-
"
|
|
119
|
+
tableName: "AwaitingStep",
|
|
120
|
+
resourceName: "AwaitingStep",
|
|
121
|
+
attributes: [
|
|
116
122
|
{
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
keyType: "partitionKey",
|
|
124
|
+
AttributeName: "awaitingStepId",
|
|
125
|
+
AttributeType: "S"
|
|
120
126
|
},
|
|
121
127
|
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
128
|
+
keyType: "sortKey",
|
|
129
|
+
AttributeName: "pendingStepId",
|
|
130
|
+
AttributeType: "S"
|
|
125
131
|
}
|
|
126
132
|
]
|
|
127
133
|
}
|
|
@@ -140,6 +146,8 @@ const createAwaitingMultipleStepDynamoDbData = (_izContext, srcPath) => {
|
|
|
140
146
|
}
|
|
141
147
|
});
|
|
142
148
|
}
|
|
149
|
+
console.log("resultsForCreateSource default dynamo", resultsForCreateSource)
|
|
150
|
+
|
|
143
151
|
return resultsForCreateSource;
|
|
144
152
|
}
|
|
145
153
|
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
const path = require("path")
|
|
21
|
+
|
|
22
|
+
const STORAGE_TYPES = {
|
|
23
|
+
dynamoDB: "dynamoDB",
|
|
24
|
+
graph: "graph"
|
|
25
|
+
}
|
|
26
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
27
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, checkDynamoTypeRelationship, createDynamoDbComponentByLinks } = require('../../../../MainLibs').consts
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* create param of crateSouce for FindData And processLogical
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} _izContext
|
|
33
|
+
* @param {String} srcPath
|
|
34
|
+
* @returns {Object[]}
|
|
35
|
+
*/
|
|
36
|
+
const createDynamoPerRelationshipLink = (_izContext, allObjectRelationships, srcPath) => {
|
|
37
|
+
let resultsForCreateSource = [];
|
|
38
|
+
const dynamoTablePerLinks = [];
|
|
39
|
+
|
|
40
|
+
for (const relationship of allObjectRelationships) {
|
|
41
|
+
let [storageType, relationshipTag, links] = checkDynamoTypeRelationship(relationship)
|
|
42
|
+
if (storageType === STORAGE_TYPES.dynamoDB) {
|
|
43
|
+
for (const link of links) {
|
|
44
|
+
let dynamoComponent = createDynamoDbComponentByLinks(link, relationshipTag)
|
|
45
|
+
dynamoTablePerLinks.push(
|
|
46
|
+
{
|
|
47
|
+
tableName: dynamoComponent.tableNameFrom,
|
|
48
|
+
resourceName: dynamoComponent.resourceNameFrom,
|
|
49
|
+
attributes: [
|
|
50
|
+
{
|
|
51
|
+
keyType: "partitionKey",
|
|
52
|
+
AttributeName: dynamoComponent.identifiersConcatFrom,
|
|
53
|
+
AttributeType: "S"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
keyType: "sortKey",
|
|
57
|
+
AttributeName: dynamoComponent.identifiersConcatTo,
|
|
58
|
+
AttributeType: "S"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
tableName: dynamoComponent.tableNameTo,
|
|
64
|
+
resourceName: dynamoComponent.resourceNameTo,
|
|
65
|
+
attributes: [
|
|
66
|
+
{
|
|
67
|
+
keyType: "partitionKey",
|
|
68
|
+
AttributeName: dynamoComponent.identifiersConcatTo,
|
|
69
|
+
AttributeType: "S"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
keyType: "sortKey",
|
|
73
|
+
AttributeName: dynamoComponent.identifiersConcatFrom,
|
|
74
|
+
AttributeType: "S"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
for (let dynamoTablePerLink of dynamoTablePerLinks) {
|
|
84
|
+
resultsForCreateSource.push({
|
|
85
|
+
templatePath: templatePath,
|
|
86
|
+
templateData: dynamoTablePerLink,
|
|
87
|
+
setting: {
|
|
88
|
+
initialData: 'Resources:\n',
|
|
89
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
90
|
+
saveFileName: SAVE_FILE_NAME.dynamoDbYaml,
|
|
91
|
+
fileExtension: '.yml',
|
|
92
|
+
isAppend: true
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
console.log("resultsForCreateSource generate per link", resultsForCreateSource)
|
|
97
|
+
return resultsForCreateSource;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
module.exports = createDynamoPerRelationshipLink
|
package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js
CHANGED
|
@@ -30,7 +30,7 @@ const STORAGE_TYPES = {
|
|
|
30
30
|
dynamoDB: "dynamoDB",
|
|
31
31
|
graph: "graph"
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
const { firstLetterUpperCase: upperCase } = require('../../../../MainLibs/src/Utils.js')
|
|
34
34
|
const { SOURCE_PATH, SAVE_FILE_NAME } = require('../../../../MainLibs/index.js').consts
|
|
35
35
|
const templatePath = path.join(__dirname, './template.ejs')
|
|
36
36
|
|
|
@@ -52,7 +52,6 @@ function dataForMainDynamoDbYamlFromObjectSchema(_izContext, objectSchema, srcPa
|
|
|
52
52
|
let dynamoDbYamlTempleteData = [];
|
|
53
53
|
|
|
54
54
|
let identifierDetail = {};
|
|
55
|
-
|
|
56
55
|
for (let identifier of objectSchema.identifiers) { //check identifiers from objectSchema
|
|
57
56
|
// console.log("identifier");
|
|
58
57
|
if (identifier.type === "partitionKey" || identifier.type === 'sortKey') {
|
|
@@ -141,11 +140,11 @@ function dataForMainDynamoDbYamlFromObjectSchema(_izContext, objectSchema, srcPa
|
|
|
141
140
|
)
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
|
-
|
|
143
|
+
templateData.resourceName = upperCase(objectSchema.objectType)
|
|
145
144
|
dynamoDbYamlTempleteData.push(templateData)
|
|
146
|
-
// console.log("templateData")
|
|
147
145
|
}
|
|
148
146
|
}
|
|
147
|
+
|
|
149
148
|
return dynamoDbYamlTempleteData
|
|
150
149
|
}
|
|
151
150
|
|
|
@@ -169,7 +168,7 @@ const createSourceDataDynamoDB = (_izContext, objectSchema, srcPath) => {
|
|
|
169
168
|
}
|
|
170
169
|
});
|
|
171
170
|
}
|
|
172
|
-
|
|
171
|
+
console.log("resultsForCreateSource per objectSchema", resultsForCreateSource)
|
|
173
172
|
|
|
174
173
|
return resultsForCreateSource;
|
|
175
174
|
}
|
|
@@ -36,7 +36,7 @@ const createSourceSnsAndSqs = require('./sns-in-sqs/snsAndSqsPerActionData');
|
|
|
36
36
|
const createDefaultSnsOutForFindDataAndProcessLogical = require('./sns-out/defaultSnsOutForFindDataAndProcessLogical');
|
|
37
37
|
const createDataForCreateSourceSnsOut = require('./sns-out/data');
|
|
38
38
|
const createFindDataAndProcessLogicalDefaultSnsInSqs = require('./sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical');
|
|
39
|
-
|
|
39
|
+
const createDynamoPerRelationshipLink = require('./dynamodb/generateDynamoPerLink.js')
|
|
40
40
|
/**
|
|
41
41
|
* Generates code from templates based on object schemas
|
|
42
42
|
* @param {Object} _izContext - Context object
|
|
@@ -47,6 +47,8 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
47
47
|
try {
|
|
48
48
|
const saveFilePath = join(objSchemaPath, '../');
|
|
49
49
|
const allObjSchemas = await getAllLocalObjectSchemasWithHierarchy(_izContext, objSchemaPath);
|
|
50
|
+
const allLocalRelationshipSchema = getAllLocalRelationshipSchema(_izContext, objSchemaPath);
|
|
51
|
+
console.log("allLocalRelationship", allLocalRelationshipSchema)
|
|
50
52
|
let createSourceParams = [];
|
|
51
53
|
let createdTableYaml = {}; // Declare createdTableYaml
|
|
52
54
|
|
|
@@ -81,14 +83,21 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
81
83
|
const defaultSnsInSqsResources = createFindDataAndProcessLogicalDefaultSnsInSqs(_izContext, saveFilePath);
|
|
82
84
|
const defaultSnsOutResources = createDefaultSnsOutForFindDataAndProcessLogical(_izContext, saveFilePath);
|
|
83
85
|
|
|
86
|
+
const dynamoDbResourcePerRelationshipLink = createDynamoPerRelationshipLink(_izContext, allLocalRelationshipSchema, saveFilePath)
|
|
84
87
|
// Add default resources to parameter list
|
|
85
88
|
createSourceParams = [
|
|
86
89
|
...createSourceParams,
|
|
87
90
|
...defaultDynamoDbResources,
|
|
88
91
|
...defaultSnsInSqsResources,
|
|
89
|
-
...defaultSnsOutResources
|
|
92
|
+
...defaultSnsOutResources,
|
|
90
93
|
];
|
|
91
94
|
|
|
95
|
+
if (allLocalRelationshipSchema.length) {
|
|
96
|
+
createSourceParams.push(
|
|
97
|
+
...dynamoDbResourcePerRelationshipLink
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
92
101
|
return createSourceParams;
|
|
93
102
|
} catch (error) {
|
|
94
103
|
_izContext.logger.error('Error generating code with template resourceYaml: ', error);
|