@izara_project/izara-market-library-service-schemas 1.0.3 → 1.0.4
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 +5 -5
- package/src/GenerateCodeLibs/src/Consts.js +40 -0
- package/src/TemplateManager/src/FunctionYaml/HdrApi/data.js +4 -4
- package/src/TemplateManager/src/FunctionYaml/HdrDsq/data.js +7 -5
- package/src/TemplateManager/src/FunctionYaml/HdrInv/data.js +3 -3
- package/src/TemplateManager/src/FunctionYaml/HdrSqs/data.js +11 -13
- package/src/TemplateManager/src/FunctionYaml/HdrSqs/template.ejs +1 -1
- package/src/TemplateManager/src/GenerateCode.js +117 -29
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +1 -1
- package/src/TemplateManager/src/ResourceYaml/dynamodb/awaitingMultipleStepData.js +98 -0
- package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +7 -7
- package/src/TemplateManager/src/ResourceYaml/dynamodb/processLogicalAndFindData.js +4 -3
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +4 -4
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/snsAndSqsPerActiondata.js +4 -4
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/sqsTemplate.ejs +1 -0
- package/src/TemplateManager/src/ResourceYaml/sns-out/data.js +89 -0
- package/src/TemplateManager/src/ResourceYaml/sns-out/request.json +3 -0
- package/src/TemplateManager/src/ResourceYaml/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +151 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/request.json +3 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/data.js +76 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/template.ejs +127 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/data.js +55 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/request.json +1 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/template.ejs +140 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/data.js +75 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/request.json +3 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/template.ejs +45 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/data.js +70 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/request.json +3 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +127 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/request.json +0 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +33 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +148 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/request.json +0 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +125 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/request.json +0 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +148 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/mainFunction/data.js +80 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/mainFunction/request.json +1 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/mainFunction/template.ejs +324 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data.js +72 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/request.json +7 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/template.ejs +120 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/data.js +73 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/request.json +7 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/template.ejs +167 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/data.js +73 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/request.json +5 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/template.ejs +126 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +73 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/request.json +7 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/template.ejs +146 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/perAction/request.json +31 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/data.js +91 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/request.json +3 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/sns-out/data.js +70 -0
- package/src/TemplateManager/src/UpdateRelationshipSchema/updateRelationship/sns-out/request.json +3 -0
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +56 -10
- package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +6 -2
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +67 -2
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/request.json +12 -0
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/template.ejs +10 -14
- package/src/TemplateManager/src/libs/Consts.js +16 -25
- package/src/TemplateManager/src/MainResourcesYaml/CreateSourceData.js +0 -76
- package/src/TemplateManager/src/MainResourcesYaml/TemplateAndData/DynamoDbMain/Data/MainDynamoDbYamlData.js +0 -155
- package/src/TemplateManager/src/MainResourcesYaml/TemplateAndData/DynamoDbMain/Template/DynamoDb.ejs +0 -31
- package/src/TemplateManager/src/MainResourcesYaml/TemplateAndData/DynamoDbMain/Template/DynamoDb.exampleData.js +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@izara_project/izara-market-library-service-schemas",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Schemas for Izara Market project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"testEnvironment": "node"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@izara_project/izara-core-library-core": "^1.0.
|
|
24
|
-
"@izara_project/izara-core-library-logger": "^1.0.
|
|
25
|
-
"@izara_project/izara-core-library-service-schemas": "^1.0.
|
|
26
|
-
"@izara_project/izara-shared": "^1.0.
|
|
23
|
+
"@izara_project/izara-core-library-core": "^1.0.13",
|
|
24
|
+
"@izara_project/izara-core-library-logger": "^1.0.5",
|
|
25
|
+
"@izara_project/izara-core-library-service-schemas": "^1.0.7",
|
|
26
|
+
"@izara_project/izara-shared": "^1.0.96",
|
|
27
27
|
"ejs": "^3.1.10",
|
|
28
28
|
"js-beautify": "^1.15.1",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright(C) 2021 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
|
+
// constant for updateRelationship
|
|
21
|
+
|
|
22
|
+
const PREFIX = {
|
|
23
|
+
updateRel: "updateRelationshipEndpoint"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const TOPIC_NAME_GRAPH_HANDLER = {
|
|
27
|
+
outUpdateRelationshipComplete: "OutUpdateRelationshipComplete",
|
|
28
|
+
inUpdateRel: "InUpdateRelationship"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const TOPIC_NAME_GENERATE_CODE = {
|
|
32
|
+
updateRelComplete: "UpdateRelationshipComplete"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
module.exports = {
|
|
37
|
+
TOPIC_NAME_GENERATE_CODE,
|
|
38
|
+
TOPIC_NAME_GRAPH_HANDLER,
|
|
39
|
+
PREFIX
|
|
40
|
+
}
|
|
@@ -52,7 +52,7 @@ function defaultIamRolePerAction() {
|
|
|
52
52
|
]
|
|
53
53
|
)
|
|
54
54
|
);
|
|
55
|
-
console.log("defaultIamRole Api", defaultIamRole)
|
|
55
|
+
// console.log("defaultIamRole Api", defaultIamRole)
|
|
56
56
|
return defaultIamRole
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -128,13 +128,13 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
let event = httpEvent(action)
|
|
131
|
-
console.log("event:", event)
|
|
131
|
+
// console.log("event:", event)
|
|
132
132
|
|
|
133
133
|
return {
|
|
134
134
|
templatePath: templatePath,
|
|
135
135
|
templateData: {
|
|
136
136
|
functionName: functionName,
|
|
137
|
-
resourceLocation: SOURCE_PATH.
|
|
137
|
+
resourceLocation: SOURCE_PATH.resourceLocationPerAction,
|
|
138
138
|
handlerType: "HdrApi",
|
|
139
139
|
additionalResourcePermission,
|
|
140
140
|
event: event,
|
|
@@ -143,7 +143,7 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
143
143
|
},
|
|
144
144
|
setting: {
|
|
145
145
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
146
|
-
saveFileName: `function`,
|
|
146
|
+
saveFileName: `per-action-function`,
|
|
147
147
|
fileExtension: '.yml',
|
|
148
148
|
isAppend: true
|
|
149
149
|
}
|
|
@@ -52,7 +52,7 @@ function defaultIamRolePerAction() {
|
|
|
52
52
|
]
|
|
53
53
|
)
|
|
54
54
|
);
|
|
55
|
-
console.log("defaultIamRole Api", defaultIamRole)
|
|
55
|
+
// console.log("defaultIamRole Api", defaultIamRole)
|
|
56
56
|
return defaultIamRole
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -129,8 +129,10 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
129
129
|
[
|
|
130
130
|
SQS_RESOURCE.deleteMessage,
|
|
131
131
|
SQS_RESOURCE.getQueueAttributes,
|
|
132
|
-
SQS_RESOURCE.
|
|
133
|
-
SQS_RESOURCE.sendMessage
|
|
132
|
+
SQS_RESOURCE.receiveMessage,
|
|
133
|
+
SQS_RESOURCE.sendMessage,
|
|
134
|
+
SQS_RESOURCE.deleteMessageBatch,
|
|
135
|
+
SQS_RESOURCE.getQueueUrl
|
|
134
136
|
]
|
|
135
137
|
}, [
|
|
136
138
|
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrDsq)),
|
|
@@ -145,13 +147,13 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
145
147
|
templatePath: templatePath,
|
|
146
148
|
templateData: {
|
|
147
149
|
functionName: functionName,
|
|
148
|
-
resourceLocation: SOURCE_PATH.
|
|
150
|
+
resourceLocation: SOURCE_PATH.resourceLocationPerAction,
|
|
149
151
|
handlerType: "HdrDsq",
|
|
150
152
|
additionalResourcePermission
|
|
151
153
|
},
|
|
152
154
|
setting: {
|
|
153
155
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
154
|
-
saveFileName: `function`,
|
|
156
|
+
saveFileName: `per-action-function`,
|
|
155
157
|
fileExtension: '.yml',
|
|
156
158
|
isAppend: true
|
|
157
159
|
}
|
|
@@ -69,7 +69,7 @@ function data(_izContext, objectSchema, srcPath) {
|
|
|
69
69
|
|
|
70
70
|
// const shortName = fs.existsSync(shortNamePath) ? require(shortNamePath) : {};
|
|
71
71
|
|
|
72
|
-
console.log("objectSchema in mainFunction: ", objectSchema)
|
|
72
|
+
// console.log("objectSchema in mainFunction: ", objectSchema)
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
let createSourceArray = [];
|
|
@@ -136,13 +136,13 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
136
136
|
templatePath: templatePath,
|
|
137
137
|
templateData: {
|
|
138
138
|
functionName: functionName,
|
|
139
|
-
resourceLocation: SOURCE_PATH.
|
|
139
|
+
resourceLocation: SOURCE_PATH.resourceLocationPerAction,
|
|
140
140
|
handlerType: "HdrInv",
|
|
141
141
|
additionalResourcePermission
|
|
142
142
|
},
|
|
143
143
|
setting: {
|
|
144
144
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
145
|
-
saveFileName: `function`,
|
|
145
|
+
saveFileName: `per-action-function`,
|
|
146
146
|
fileExtension: '.yml',
|
|
147
147
|
isAppend: true
|
|
148
148
|
}
|
|
@@ -129,35 +129,33 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
129
129
|
[
|
|
130
130
|
SQS_RESOURCE.deleteMessage,
|
|
131
131
|
SQS_RESOURCE.getQueueAttributes,
|
|
132
|
-
SQS_RESOURCE.
|
|
133
|
-
SQS_RESOURCE.sendMessage
|
|
134
|
-
|
|
132
|
+
SQS_RESOURCE.receiveMessage,
|
|
133
|
+
SQS_RESOURCE.sendMessage,
|
|
134
|
+
SQS_RESOURCE.deleteMessageBatch,
|
|
135
|
+
SQS_RESOURCE.getQueueUrl
|
|
136
|
+
], [RESOURCE_CLASSES.sns]: ["Publish", "Subscribe"]
|
|
135
137
|
}, [
|
|
136
138
|
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrSqs)),
|
|
137
|
-
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrSqs) + "DLQ")
|
|
139
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + upperCase(HANDLER.hdrSqs) + "DLQ"),
|
|
140
|
+
resourceNames(RESOURCE_CLASSES.sns, "In" + functionName),
|
|
141
|
+
resourceNames(RESOURCE_CLASSES.sns, "Out" + functionName)
|
|
138
142
|
]
|
|
139
143
|
)
|
|
140
144
|
)
|
|
141
145
|
|
|
142
|
-
|
|
143
|
-
createIamRole({
|
|
144
|
-
[RESOURCE_CLASSES.sns]: ["Publish", "Subscribe"]
|
|
145
|
-
}, [resourceNames(RESOURCE_CLASSES.sns, functionName + upperCase(HANDLER.hdrSqs))])
|
|
146
|
-
)
|
|
147
|
-
|
|
148
|
-
console.log("additionalResourcePermissionBeforeReturn", additionalResourcePermission)
|
|
146
|
+
// console.log("additionalResourcePermissionBeforeReturn", additionalResourcePermission)
|
|
149
147
|
return {
|
|
150
148
|
templatePath: templatePath,
|
|
151
149
|
templateData: {
|
|
152
150
|
functionName: functionName,
|
|
153
151
|
actionHandler: actionHandler,
|
|
154
|
-
resourceLocation: SOURCE_PATH.
|
|
152
|
+
resourceLocation: SOURCE_PATH.resourceLocationPerAction,
|
|
155
153
|
handlerType: "HdrSqs",
|
|
156
154
|
additionalResourcePermission
|
|
157
155
|
},
|
|
158
156
|
setting: {
|
|
159
157
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
160
|
-
saveFileName: `function`,
|
|
158
|
+
saveFileName: `per-action-function`,
|
|
161
159
|
fileExtension: '.yml',
|
|
162
160
|
isAppend: true
|
|
163
161
|
}
|
|
@@ -23,7 +23,7 @@ const { readFileSync } = require('fs');
|
|
|
23
23
|
|
|
24
24
|
const {
|
|
25
25
|
getAllLocalObjectSchemasWithHierarchy,
|
|
26
|
-
getAllLocalRelationshipSchemas
|
|
26
|
+
getAllLocalRelationshipSchemas,
|
|
27
27
|
} = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
28
28
|
|
|
29
29
|
|
|
@@ -51,20 +51,47 @@ const functionGetYamlDataHdrDsq = require('./FunctionYaml/HdrDsq/data');
|
|
|
51
51
|
|
|
52
52
|
// create Main resource
|
|
53
53
|
const { createSourceDataDynamoDB } = require('./ResourceYaml/dynamodb/mainResourcePerObjectSchemaData');
|
|
54
|
-
const { createDefaultSourceDataDynamoDB } = require('./ResourceYaml/dynamodb/processLogicalAndFindData')
|
|
54
|
+
const { createDefaultSourceDataDynamoDB } = require('./ResourceYaml/dynamodb/processLogicalAndFindData');
|
|
55
55
|
const { createSourceSnsAndSqs } = require('./ResourceYaml/sns-in-sqs/snsAndSqsPerActiondata');
|
|
56
|
-
const
|
|
56
|
+
const createDataForCreateSourceSnsOut = require('./ResourceYaml/sns-out/data')
|
|
57
|
+
const createFindDataAndProcessLogicalDefaultSnsInSqs = require('./ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical');
|
|
58
|
+
const { createAwaitingMultipleStepDynamoDbData } = require('./ResourceYaml/dynamodb/awaitingMultipleStepData');
|
|
57
59
|
|
|
58
60
|
// create External Service
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
+
const createExternalLambdaRole = require('./externalService/LambdaRole/data');
|
|
62
|
+
const createExternalSnsSubscriptions = require('./externalService/SnsTopicSubscriotions/data');
|
|
61
63
|
|
|
64
|
+
// create update relationship schema
|
|
65
|
+
// const createUpdateRelationshipFunctionYamlHdrApi = require('./UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data')
|
|
66
|
+
const createUpdateRelationshipFunctionYamlHdrInv = require('./UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data');
|
|
67
|
+
const createUpdateRelationshipFunctionYamlHdrDsq = require('./UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data');
|
|
68
|
+
const createUpdateRelationshipFunctionYamlHdrSqs = require('./UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data');
|
|
62
69
|
|
|
70
|
+
// create main function updateRelationship schema main function
|
|
71
|
+
const createUpdateRelationshipSchemaMainFunction = require('./UpdateRelationshipSchema/updateRelationship/mainFunction/data');
|
|
63
72
|
|
|
64
|
-
//create
|
|
65
|
-
|
|
73
|
+
// create handler Update Relationship schema
|
|
74
|
+
const createUpdateRelationshipSchemaHdrInv = require('./UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/data');
|
|
75
|
+
// const createUpdateRelationshipSchemaHdrApi = require('./UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data');
|
|
76
|
+
const createUpdateRelationshipSchemaHdrDsq = require('./UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/data');
|
|
77
|
+
const createUpdateRelationshipSchemaHdrSqs = require('./UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data');
|
|
66
78
|
|
|
79
|
+
// create sns for update relationship schema
|
|
80
|
+
const createUpdateRelationshipSchemaSnsInSqsResource = require('./UpdateRelationshipSchema/updateRelationship/sns-in-sqs/data');
|
|
81
|
+
// const createUpdateRelationshipSchemaSnsOutResource = require('./UpdateRelationshipSchema/updateRelationship/sns-out/data');
|
|
67
82
|
|
|
83
|
+
// create updateRelationshipFunctionYaml
|
|
84
|
+
const createUpdateRelationshipSchemaCompleteYaml = require('./UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data');
|
|
85
|
+
|
|
86
|
+
// create update relationship hdrSqs
|
|
87
|
+
const createUpdateRelationshipSchemaCompleteHdrSqs = require('./UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/data');
|
|
88
|
+
|
|
89
|
+
// create sns-in-sqs resource yaml updateRelationshipSchemaComplete
|
|
90
|
+
const createUpdateRelationshipSchemaCompleteSnsInSqs = require('./UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/data');
|
|
91
|
+
|
|
92
|
+
const createUpdateRelationshipSchemaCompleteSnsOut = require('./UpdateRelationshipSchema/updateRalationshipComplete/sns-out/data');
|
|
93
|
+
|
|
94
|
+
const createUpdateRelationshipSchemaCompleteMainFunction = require('./UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/data');
|
|
68
95
|
/**
|
|
69
96
|
*
|
|
70
97
|
* get template and send to
|
|
@@ -88,9 +115,12 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
88
115
|
const GENERATECODE_SOURCE_PATH = {
|
|
89
116
|
appYaml: join(saveFilePath, `../sls_yaml/generatedCode/source/`),
|
|
90
117
|
resourceYaml: join(saveFilePath, `../../resource/sls_yaml/generatedCode/source/`),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
118
|
+
lambdaPerAction: join(saveFilePath, '../src/generatedCode/ObjectTypePerActionEndpoint/source/'),
|
|
119
|
+
externalService: join(saveFilePath, '../initial_setup/generatedCode/source/'),
|
|
120
|
+
resourceLocation: join(saveFilePath, 'src/generatedCode/perAction/source/'),
|
|
121
|
+
lamdaPerCombindActionPath: join(saveFilePath, `/generatedCode/lamdaPerCombindAction/source/`), // test
|
|
122
|
+
lambdaPerObjectTypePath: join(saveFilePath, `/generatedCode/lambdaPerObjectType/source/`), // test
|
|
123
|
+
updateRelationship: join(saveFilePath, `../src/generatedCode/RelationshipPerAction/source/`),
|
|
94
124
|
};
|
|
95
125
|
|
|
96
126
|
|
|
@@ -119,10 +149,9 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
119
149
|
}
|
|
120
150
|
|
|
121
151
|
// create External service
|
|
122
|
-
const createFunctionIamRole = await
|
|
123
|
-
|
|
152
|
+
const createFunctionIamRole = await createExternalLambdaRole(_izContext, allObjSchemas.records, allObjectRelationships, saveFilePath);
|
|
153
|
+
const createSnsSubscription = await createExternalSnsSubscriptions(_izContext, allObjectRelationships, saveFilePath);
|
|
124
154
|
for (let objectSchema of allObjSchemas.records) {
|
|
125
|
-
console.log("objectSchema: ", objectSchema);
|
|
126
155
|
|
|
127
156
|
// create main resource per objectSchema
|
|
128
157
|
// const createSourceMainResourcesObjectSchema = mainResources.createSourceDataObjectSchema(_izContext, objectSchema, saveFilePath);
|
|
@@ -132,38 +161,34 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
132
161
|
// let createSourcePerAction = perAction.createSourceDataObjectSchema(_izContext, objectSchema, saveFilePath);
|
|
133
162
|
// console.log("createSourcePerAction: ", createSourcePerAction)
|
|
134
163
|
|
|
135
|
-
// generate handler
|
|
164
|
+
// generate handler perAction
|
|
136
165
|
const createSourceHdrInv = perActionHdrInvData(_izContext, objectSchema, saveFilePath);
|
|
137
166
|
const createSourceHdrApi = perActionHdrApiData(_izContext, objectSchema, saveFilePath);
|
|
138
167
|
const createSourceHdrSqs = perActionHdrSqsData(_izContext, objectSchema, saveFilePath);
|
|
139
|
-
const createSourceHdrDsq = perActionHdrDsqData(_izContext, objectSchema, saveFilePath)
|
|
168
|
+
const createSourceHdrDsq = perActionHdrDsqData(_izContext, objectSchema, saveFilePath);
|
|
140
169
|
|
|
141
170
|
// wrap Handler Function
|
|
142
|
-
const createSourceHandler = [...createSourceHdrInv, ...createSourceHdrApi, ...createSourceHdrSqs, ...createSourceHdrDsq]
|
|
171
|
+
const createSourceHandler = [...createSourceHdrInv, ...createSourceHdrApi, ...createSourceHdrSqs, ...createSourceHdrDsq];
|
|
143
172
|
|
|
144
173
|
// generate main function
|
|
145
|
-
const createMainFunctionGet = await mainFunctionGetData(_izContext, objectSchema, saveFilePath)
|
|
174
|
+
const createMainFunctionGet = await mainFunctionGetData(_izContext, objectSchema, saveFilePath);
|
|
146
175
|
|
|
147
176
|
// generate functionYaml File
|
|
148
|
-
const createFunctionGetYamlHdrInv = functionGetYamlDataHdrInv(_izContext, objectSchema, saveFilePath)
|
|
149
|
-
const createFunctionGetYamlHdrApi = functionGetYamlDataHdrApi(_izContext, objectSchema, saveFilePath)
|
|
150
|
-
const createFunctionGetYamlHdrSqs = functionGetYamlDataHdrSqs(_izContext, objectSchema, saveFilePath)
|
|
151
|
-
const createFunctionGetYamlHdrDsq = functionGetYamlDataHdrDsq(_izContext, objectSchema, saveFilePath)
|
|
177
|
+
const createFunctionGetYamlHdrInv = functionGetYamlDataHdrInv(_izContext, objectSchema, saveFilePath);
|
|
178
|
+
const createFunctionGetYamlHdrApi = functionGetYamlDataHdrApi(_izContext, objectSchema, saveFilePath);
|
|
179
|
+
const createFunctionGetYamlHdrSqs = functionGetYamlDataHdrSqs(_izContext, objectSchema, saveFilePath);
|
|
180
|
+
const createFunctionGetYamlHdrDsq = functionGetYamlDataHdrDsq(_izContext, objectSchema, saveFilePath);
|
|
152
181
|
|
|
153
182
|
// wrapMain Function
|
|
154
|
-
const createFunctionYaml = [...createFunctionGetYamlHdrApi, ...createFunctionGetYamlHdrDsq, ...createFunctionGetYamlHdrInv, ...createFunctionGetYamlHdrSqs]
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
// const createSnsSunbscription = createSnsSubscriptions.createSnsSubscription(_izContext, objectSchema, saveFilePath)
|
|
183
|
+
const createFunctionYaml = [...createFunctionGetYamlHdrApi, ...createFunctionGetYamlHdrDsq, ...createFunctionGetYamlHdrInv, ...createFunctionGetYamlHdrSqs];
|
|
158
184
|
|
|
159
185
|
// generate Resource ..via dynamoDb sns-in-sqs sns-put
|
|
160
186
|
const createResourceDynamo = createSourceDataDynamoDB(_izContext, objectSchema, saveFilePath);
|
|
161
187
|
const createResourceSnsInSqs = createSourceSnsAndSqs(_izContext, objectSchema, saveFilePath);
|
|
162
|
-
const
|
|
163
|
-
const createResourceDefaultSnsInSqsFindDataAndProcessLogical = createFindDataAndProcessLogicalDefaultSnsInSqs(_izContext, saveFilePath);
|
|
188
|
+
const createResourceSnsOut = createDataForCreateSourceSnsOut(_izContext, objectSchema, saveFilePath)
|
|
164
189
|
|
|
165
190
|
// wrap main Resource
|
|
166
|
-
const createMainResource = [...createResourceDynamo, ...createResourceSnsInSqs, ...
|
|
191
|
+
const createMainResource = [...createResourceDynamo, ...createResourceSnsInSqs, ...createResourceSnsOut];
|
|
167
192
|
|
|
168
193
|
createSourceParams = createSourceParams.concat([
|
|
169
194
|
// ...createSourceMainResourcesObjectSchema,
|
|
@@ -171,13 +196,76 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
171
196
|
...createMainFunctionGet, // create main function
|
|
172
197
|
...createFunctionYaml, // create function.yaml
|
|
173
198
|
...createMainResource, // create resource yaml
|
|
174
|
-
createFunctionIamRole,
|
|
175
199
|
]);
|
|
176
200
|
|
|
177
201
|
// console.log("createSourceParams after concat: ", createSourceParams);
|
|
178
202
|
}
|
|
179
203
|
|
|
180
204
|
|
|
205
|
+
// create default data resource such as findData ProcessLogical and awaitingMultipleStep
|
|
206
|
+
const createResourceFindDataAndProcessLogical = createDefaultSourceDataDynamoDB(_izContext, saveFilePath);
|
|
207
|
+
const createResourceAwaitingMultipleStep = createAwaitingMultipleStepDynamoDbData(_izContext, saveFilePath);
|
|
208
|
+
const createResourceDefaultSnsInSqsFindDataAndProcessLogical = createFindDataAndProcessLogicalDefaultSnsInSqs(_izContext, saveFilePath);
|
|
209
|
+
|
|
210
|
+
const createMainResourceDefault = [...createResourceFindDataAndProcessLogical, ...createResourceDefaultSnsInSqsFindDataAndProcessLogical, ...createResourceAwaitingMultipleStep];
|
|
211
|
+
|
|
212
|
+
// create function yaml for update relationshipSchema per handler
|
|
213
|
+
const createYamlUpdateRelationshipSchemaHdrSqs = createUpdateRelationshipFunctionYamlHdrSqs(_izContext, saveFilePath);
|
|
214
|
+
const createYamlUpdateRelationshipSchemaHdrInv = createUpdateRelationshipFunctionYamlHdrInv(_izContext, saveFilePath);
|
|
215
|
+
const createYamlUpdateRelationshipSchemaHdrDsq = createUpdateRelationshipFunctionYamlHdrDsq(_izContext, saveFilePath);
|
|
216
|
+
// const createYamlUpdateRelationshipSchemaHdrApi = createUpdateRelationshipFunctionYamlHdrApi(_izContext, saveFilePath)
|
|
217
|
+
const createYamlUpdateRelationshipSchema = [...createYamlUpdateRelationshipSchemaHdrSqs, ...createYamlUpdateRelationshipSchemaHdrInv, ...createYamlUpdateRelationshipSchemaHdrDsq];
|
|
218
|
+
|
|
219
|
+
// create main function
|
|
220
|
+
const createMainFunctionUpdateRelationshipSchema = createUpdateRelationshipSchemaMainFunction(_izContext, saveFilePath);
|
|
221
|
+
|
|
222
|
+
// create handler function for each updateRelationshipSchema
|
|
223
|
+
const createUpdateRelationshipSchemaPerActionHdrInv = createUpdateRelationshipSchemaHdrInv(_izContext, saveFilePath);
|
|
224
|
+
// const createUpdateRelationshipSchemaPerActionHdrApi = createUpdateRelationshipSchemaHdrApi(_izContext, saveFilePath);
|
|
225
|
+
const createUpdateRelationshipSchemaPerActionHdrDsq = createUpdateRelationshipSchemaHdrDsq(_izContext, saveFilePath);
|
|
226
|
+
const createUpdateRelationshipSchemaPerActionHdrSqs = createUpdateRelationshipSchemaHdrSqs(_izContext, saveFilePath);
|
|
227
|
+
|
|
228
|
+
const createUpdateRelationshipSchemaPerAction = [...createUpdateRelationshipSchemaPerActionHdrInv,
|
|
229
|
+
// ...createUpdateRelationshipSchemaPerActionHdrApi,
|
|
230
|
+
...createUpdateRelationshipSchemaPerActionHdrDsq, ...createUpdateRelationshipSchemaPerActionHdrSqs];
|
|
231
|
+
|
|
232
|
+
// create resource sns-in-sqs for update relationship schema
|
|
233
|
+
const createUpdateRelationshipSchemaSnsIn = createUpdateRelationshipSchemaSnsInSqsResource(_izContext, saveFilePath);
|
|
234
|
+
// const createUpdateRelationshipSchemaSnsOut = createUpdateRelationshipSchemaSnsOutResource(_izContext, saveFilePath);
|
|
235
|
+
|
|
236
|
+
const createResourceUpdateRelationshipSchema = [...createUpdateRelationshipSchemaSnsIn,];
|
|
237
|
+
|
|
238
|
+
// warp function updateRelationshipSchemaData
|
|
239
|
+
const createUpdateRelationshipSchemaData = [...createUpdateRelationshipSchemaPerAction, ...createResourceUpdateRelationshipSchema, ...createMainFunctionUpdateRelationshipSchema]
|
|
240
|
+
|
|
241
|
+
// create UpdateRelationshipComplete Main Function
|
|
242
|
+
const createUpdateRelationshipSchemaCompleteMain = createUpdateRelationshipSchemaCompleteMainFunction(_izContext, saveFilePath);
|
|
243
|
+
|
|
244
|
+
// create function yaml updateRelationshipComplete
|
|
245
|
+
const createUpdateRelationshipSchemaCompleteFunctionYaml = createUpdateRelationshipSchemaCompleteYaml(_izContext, saveFilePath)
|
|
246
|
+
|
|
247
|
+
// create handler updateRelationshipSchemaComplete HdrSqs
|
|
248
|
+
const createUpdateRelationshipSchemaCompleteHandler = createUpdateRelationshipSchemaCompleteHdrSqs(_izContext, saveFilePath)
|
|
249
|
+
|
|
250
|
+
// create resource yaml updateRelationshipSchemaComplete
|
|
251
|
+
const createUpdateRelationshipSchemaCompleteSnsInSqsResource = createUpdateRelationshipSchemaCompleteSnsInSqs(_izContext, saveFilePath)
|
|
252
|
+
const createUpdateRelationshipSchemaCompleteSnsOutResource = createUpdateRelationshipSchemaCompleteSnsOut(_izContext, saveFilePath)
|
|
253
|
+
|
|
254
|
+
// warp function updateRelationshipSchemaCompleteData
|
|
255
|
+
const createUpdateRelationshipSchemaCompleteData = [...createUpdateRelationshipSchemaCompleteFunctionYaml, ...createUpdateRelationshipSchemaCompleteHandler, ...createUpdateRelationshipSchemaCompleteSnsInSqsResource,
|
|
256
|
+
...createUpdateRelationshipSchemaCompleteSnsOutResource, ...createUpdateRelationshipSchemaCompleteMain]
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
createSourceParams.push(...createMainResourceDefault, ...createYamlUpdateRelationshipSchema,
|
|
262
|
+
...createUpdateRelationshipSchemaData,
|
|
263
|
+
...createUpdateRelationshipSchemaCompleteData,
|
|
264
|
+
createFunctionIamRole,
|
|
265
|
+
createSnsSubscription
|
|
266
|
+
);
|
|
267
|
+
// console.log("createSourceParams", createSourceParams);
|
|
268
|
+
|
|
181
269
|
// delete file .yml before start to prevent confilct of data
|
|
182
270
|
for (let folderPathToEmpty of Object.keys(GENERATECODE_SOURCE_PATH)) {
|
|
183
271
|
await deleteFileInDir(GENERATECODE_SOURCE_PATH[folderPathToEmpty]);
|
|
@@ -65,7 +65,7 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
|
|
|
65
65
|
let objectType = objectSchema.objectType;
|
|
66
66
|
let actionHandler = action;
|
|
67
67
|
let functionName = objectType + upperCase(action);
|
|
68
|
-
let queueName = objectType + firstLetterUpperCase(action) + "
|
|
68
|
+
let queueName = objectType + firstLetterUpperCase(action) + "HdrDsq";
|
|
69
69
|
let identifiers = [];
|
|
70
70
|
for (const identifier of Object.values(objectSchema.identifiers)) {
|
|
71
71
|
identifiers.push(identifier.fieldName)
|
|
@@ -52,7 +52,7 @@ async function createParamForCreateSource(_izContext, objectSchema, action, srcP
|
|
|
52
52
|
let actionHandler = action;
|
|
53
53
|
let functionName = objectType + upperCase(action);
|
|
54
54
|
let getDataDetail = await createGetDataDetails(_izContext, objectSchema);
|
|
55
|
-
console.log({ getDataDetail })
|
|
55
|
+
// console.log({ getDataDetail })
|
|
56
56
|
return {
|
|
57
57
|
templatePath: templatePath,
|
|
58
58
|
templateData: {
|
|
@@ -163,7 +163,7 @@ Copyright (C) 2020 Sven Mason <http: //izara.io>
|
|
|
163
163
|
|
|
164
164
|
let dataFromDynamoDb = await dynamodbSharedLib.getItem(
|
|
165
165
|
_izContext,
|
|
166
|
-
dynamodbSharedLib.tableName(getDataDetail.tableName),
|
|
166
|
+
await dynamodbSharedLib.tableName(_izContext, getDataDetail.tableName),
|
|
167
167
|
identifiersForGetData
|
|
168
168
|
);
|
|
169
169
|
|
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
|
|
23
|
+
// const {
|
|
24
|
+
// HANDLER,
|
|
25
|
+
// STORAGE_TYPES
|
|
26
|
+
// } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
27
|
+
|
|
28
|
+
const STORAGE_TYPES = {
|
|
29
|
+
dynamoDB: "dynamoDB",
|
|
30
|
+
graph: "graph"
|
|
31
|
+
}
|
|
32
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
33
|
+
const { SOURCE_PATH } = require('../../libs/Consts');
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* create param of crateSouce for FindData And processLogical
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} _izContext
|
|
39
|
+
* @param {String} srcPath
|
|
40
|
+
* @returns {Object[]}
|
|
41
|
+
*/
|
|
42
|
+
module.exports.createAwaitingMultipleStepDynamoDbData = (_izContext, srcPath) => {
|
|
43
|
+
|
|
44
|
+
let resultsForCreateSource = [];
|
|
45
|
+
|
|
46
|
+
const awaitingStepDynamoDbDataList = [
|
|
47
|
+
{
|
|
48
|
+
"tableName": "AwaitingMultipleSteps",
|
|
49
|
+
"attributes": [
|
|
50
|
+
{
|
|
51
|
+
"keyType": "partitionKey",
|
|
52
|
+
"AttributeName": "awaitingStepId",
|
|
53
|
+
"AttributeType": "S"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"keyType": "sortKey",
|
|
57
|
+
"AttributeName": "pendingStepId",
|
|
58
|
+
"AttributeType": "S"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"tableName": "AwaitingMultipleStepByPending",
|
|
64
|
+
"attributes": [
|
|
65
|
+
{
|
|
66
|
+
"keyType": "partitionKey",
|
|
67
|
+
"AttributeName": "pendingStepId",
|
|
68
|
+
"AttributeType": "S"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"keyType": "sortKey",
|
|
72
|
+
"AttributeName": "awaitingStepId",
|
|
73
|
+
"AttributeType": "S"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// console.log("defaultlDynamoDataList: ", (awaitingStepDynamoDbDataList));
|
|
80
|
+
|
|
81
|
+
for (let defaultlDynamoData of awaitingStepDynamoDbDataList) {
|
|
82
|
+
resultsForCreateSource.push({
|
|
83
|
+
templatePath: templatePath,
|
|
84
|
+
templateData: defaultlDynamoData,
|
|
85
|
+
setting: {
|
|
86
|
+
initialData: 'Resources:\n',
|
|
87
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
88
|
+
saveFileName: 'generated-dynamoDB-table',
|
|
89
|
+
fileExtension: '.yml',
|
|
90
|
+
isAppend: true
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// console.log("resultForCreateDefaultDynamoDb: ", (resultsForCreateSource));
|
|
96
|
+
|
|
97
|
+
return resultsForCreateSource;
|
|
98
|
+
}
|
|
@@ -48,13 +48,13 @@ const templatePath = path.join(__dirname, './template.ejs')
|
|
|
48
48
|
* @returns {Object[]} - data of multiple dynamoDb template
|
|
49
49
|
*/
|
|
50
50
|
|
|
51
|
-
function dataForMainDynamoDbYamlFromObjectSchema(_izContext, objectSchema) {
|
|
51
|
+
function dataForMainDynamoDbYamlFromObjectSchema(_izContext, objectSchema, srcPath) {
|
|
52
52
|
let dynamoDbYamlTempleteData = [];
|
|
53
53
|
|
|
54
54
|
let identifierDetail = {};
|
|
55
55
|
|
|
56
56
|
for (let identifier of objectSchema.identifiers) { //check identifiers from objectSchema
|
|
57
|
-
console.log("identifier");
|
|
57
|
+
// console.log("identifier");
|
|
58
58
|
if (identifier.type === "partitionKey" || identifier.type === 'sortKey') {
|
|
59
59
|
identifierDetail[identifier.type] = {};
|
|
60
60
|
|
|
@@ -85,7 +85,7 @@ function dataForMainDynamoDbYamlFromObjectSchema(_izContext, objectSchema) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
console.log("identifierDetail :", identifierDetail)
|
|
88
|
+
// console.log("identifierDetail :", identifierDetail)
|
|
89
89
|
if (!identifierDetail.hasOwnProperty("partitionKey")) {
|
|
90
90
|
return []
|
|
91
91
|
}
|
|
@@ -117,7 +117,7 @@ function dataForMainDynamoDbYamlFromObjectSchema(_izContext, objectSchema) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
dynamoDbYamlTempleteData.push(templateData)
|
|
120
|
-
console.log("templateData")
|
|
120
|
+
// console.log("templateData")
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return dynamoDbYamlTempleteData
|
|
@@ -145,7 +145,7 @@ module.exports.createSourceDataDynamoDB = (_izContext, objectSchema, srcPath) =>
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
const dynamoDbMainYamlDataList = dataForMainDynamoDbYamlFromObjectSchema(_izContext, objectSchema, srcPath)
|
|
148
|
-
console.log("dynamoDbMainYamlDataList: ", dynamoDbMainYamlDataList);
|
|
148
|
+
// console.log("dynamoDbMainYamlDataList: ", dynamoDbMainYamlDataList);
|
|
149
149
|
|
|
150
150
|
for (let dynamoDbMainYamlData of dynamoDbMainYamlDataList) {
|
|
151
151
|
// create iam role of handler here
|
|
@@ -155,14 +155,14 @@ module.exports.createSourceDataDynamoDB = (_izContext, objectSchema, srcPath) =>
|
|
|
155
155
|
setting: {
|
|
156
156
|
initialData: 'Resources:\n',
|
|
157
157
|
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
158
|
-
saveFileName: 'dynamoDB-table',
|
|
158
|
+
saveFileName: 'generated-dynamoDB-table',
|
|
159
159
|
fileExtension: '.yml',
|
|
160
160
|
isAppend: true
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
console.log("resultsForCreateSource: ", resultsForCreateSource);
|
|
165
|
+
// console.log("resultsForCreateSource: ", resultsForCreateSource);
|
|
166
166
|
|
|
167
167
|
return resultsForCreateSource;
|
|
168
168
|
}
|