@izara_project/izara-market-library-service-schemas 1.0.26 → 1.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -1
- package/package.json +9 -4
- package/src/GenerateCodeLibs/src/Consts.js +5 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +6 -6
- package/src/MainLibs/src/Consts.js +45 -2
- package/src/TemplateManager/src/libs/Consts.js +0 -1
- package/src/reStructure/GenerateCode.js +23 -4
- package/src/reStructure/GenerateSchema.js +153 -0
- package/src/reStructure/SchemaConfig.js +29 -0
- package/src/reStructure/TemplateConfig.js +20 -0
- package/src/reStructure/TemplateData/attributeTreeSchema/generateTemplateData.js +104 -0
- package/src/reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema/attributeLinkTemplate.ejs +21 -0
- package/src/reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema/data.js +188 -0
- package/src/reStructure/TemplateData/attributeTreeSchema/mainAttributeTreeSchema/request.json +11 -0
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +3 -4
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +1 -1
- 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/functionYaml/data.js +3 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +1 -14
- 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/functionYaml/data.js +4 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +1 -14
- 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/functionYaml/data.js +3 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +1 -14
- 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/functionYaml/data.js +3 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/functionYaml/template.ejs +1 -14
- 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/functionYaml/data.js +3 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +1 -14
- 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/functionYml/HdrS3/data.js +4 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/template.ejs +1 -14
- 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/connect/functionYaml/data.js +4 -2
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +2 -1
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +2 -1
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +10 -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/perActionComplete/update/sns-in-sqs/data.js +1 -1
- 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 +27 -6
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +25 -4
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +26 -4
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +26 -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 +25 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +25 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +25 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +26 -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 +119 -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 +131 -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 +119 -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 +131 -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 +25 -22
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +25 -5
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +26 -5
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +25 -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/resourceYaml/dynamodb/defaultDynamoDbTable.js +50 -42
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +98 -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/libs/GenerateCodeLibs.js +38 -0
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
console.log("data main attribute tree schema");
|
|
21
|
+
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const fs = require('fs');
|
|
24
|
+
|
|
25
|
+
const serviceSchemaCore = require("@izara_project/izara-core-library-service-schemas");
|
|
26
|
+
const getObjectSchema = serviceSchemaCore.getObjectSchema;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
30
|
+
const { SOURCE_PATH, ADD_ON_DATA_STRUCTURE_TYPE, ATTRIBUTE_TAG, fieldNameSetting, FIELD_NAME_TPYE, SAVE_FILE_NAME } = require('../../../../MainLibs/src/Consts');
|
|
31
|
+
|
|
32
|
+
const templatePath = path.join(__dirname, "./attributeLinkTemplate.ejs");
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
async function data(_izContext, settings, srcPath) {
|
|
37
|
+
const objTypeString = objType => `{ serviceTag: ${objType.serviceTag}, objectType: ${objType.objectType} }`;
|
|
38
|
+
|
|
39
|
+
const objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, settings.objType);
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
validate settings with objectSchema
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
if (!objectSchema) {
|
|
46
|
+
throw Error(`Invalid objType:${objTypeString(settings.objType)}, cannot generate attribute tree schema cause objectSchema is not exists`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!objectSchema.hasOwnProperty("addOnDataStructure") || !Array.isArray(objectSchema.addOnDataStructure) || !objectSchema.addOnDataStructure.length) {
|
|
50
|
+
throw Error(`objType: ${objTypeString(settings.objType)}. cannot generate attribute tree schema cause addOnDataStructure is not exists or empty`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!objectSchema.hasOwnProperty("addOnDataStructure")) {
|
|
54
|
+
throw Error("Invalid objectSchema does not have addOnDataStructure");
|
|
55
|
+
}
|
|
56
|
+
// {
|
|
57
|
+
// generateName: "mainAttributeTree",
|
|
58
|
+
// objType: {
|
|
59
|
+
// serviceTag: "GenerateCodeTemplate",
|
|
60
|
+
// objectType: "person"
|
|
61
|
+
// },
|
|
62
|
+
// attributeTag: "productAttribute"
|
|
63
|
+
// }
|
|
64
|
+
|
|
65
|
+
let addOnAttributeTree = objectSchema.addOnDataStructure.find(addOn => {
|
|
66
|
+
return addOn.type === ADD_ON_DATA_STRUCTURE_TYPE.attributeTree && addOn.attributeTreeTag === settings.attributeTag;
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
if (!addOnAttributeTree) {
|
|
71
|
+
throw Error(`objType: ${objTypeString(settings.objType)}. cannot generate attribute tree schema cause not found addOnDataStructure with attributeTreeTag: ${settings.attributeTag}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// TODO: use addOnAttributeTree to generate attribute tree schema
|
|
75
|
+
// if addOnAttributeTree.havePropertyNode === true will generate property node schema
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// console.log("objectSchema", objectSchema)
|
|
79
|
+
// console.log("srcPath", objectSchema)
|
|
80
|
+
// const createSources = [];
|
|
81
|
+
// let attributeTreeObjSchemas = [];
|
|
82
|
+
// if (objectSchema.hasOwnProperty("addOnDataStructure")) {
|
|
83
|
+
|
|
84
|
+
// for (const versionedData of objectSchema.addOnDataStructure) {
|
|
85
|
+
// if (versionedData.type === ADD_ON_DATA_STRUCTURE_TYPE.attributeTree) {
|
|
86
|
+
// const attributeTreeSubject = objectSchema.objectType; // main objectType
|
|
87
|
+
// const storageResources = objectSchema.storageResources // storageResource from main objectType
|
|
88
|
+
// const storageResourceTags = Object.keys(storageResources) // storage ResourceTag from main objectType
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
// attributeTreeObjSchemas.push(
|
|
92
|
+
// {
|
|
93
|
+
// objectType: attributeTreeSubject + ATTRIBUTE_TAG.attributeTagLabel,
|
|
94
|
+
// storageResources: storageResources,
|
|
95
|
+
// fieldNames: {
|
|
96
|
+
// labelId: fieldNameSetting(FIELD_NAME_TPYE.identifiers)
|
|
97
|
+
// },
|
|
98
|
+
// identifiers: [
|
|
99
|
+
// {
|
|
100
|
+
// type: "identifier",
|
|
101
|
+
// fieldName: "labelId"
|
|
102
|
+
// }
|
|
103
|
+
// ]
|
|
104
|
+
// },
|
|
105
|
+
// {
|
|
106
|
+
// objectType: attributeTreeSubject + ATTRIBUTE_TAG.attributeTagLink,
|
|
107
|
+
// storageResources: storageResources,
|
|
108
|
+
// fieldNames: {
|
|
109
|
+
// [attributeTreeSubject + ATTRIBUTE_TAG.attributeTagLink + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.identifiers),
|
|
110
|
+
// [attributeTreeSubject + "Id"]: fieldNameSetting(FIELD_NAME_TPYE.requiredOnCreateFieldName),
|
|
111
|
+
// topLevelParentIdentifierProperties: fieldNameSetting(FIELD_NAME_TPYE.requiredOnCreateFieldName),
|
|
112
|
+
// parentNodeIdentifierLabel: fieldNameSetting(FIELD_NAME_TPYE.requiredOnCreateFieldName),
|
|
113
|
+
// parentNodeIdentifierProperties: fieldNameSetting(FIELD_NAME_TPYE.requiredOnCreateFieldName),
|
|
114
|
+
// },
|
|
115
|
+
// identifiers: [
|
|
116
|
+
// {
|
|
117
|
+
// type: "identifier",
|
|
118
|
+
// fieldName: `${attributeTreeSubject + ATTRIBUTE_TAG.attributeTagLink}Id`
|
|
119
|
+
// }
|
|
120
|
+
// ]
|
|
121
|
+
// },
|
|
122
|
+
// {
|
|
123
|
+
// objectType: attributeTreeSubject + ATTRIBUTE_TAG.attributeTagProperty,
|
|
124
|
+
// storageResources: storageResources,
|
|
125
|
+
// fieldNames: {
|
|
126
|
+
// propertyId: fieldNameSetting(FIELD_NAME_TPYE.identifiers),
|
|
127
|
+
// propertyLabelId: fieldNameSetting(FIELD_NAME_TPYE.optionalOnCreate)
|
|
128
|
+
// },
|
|
129
|
+
// identifiers: [
|
|
130
|
+
// {
|
|
131
|
+
// type: "identifier",
|
|
132
|
+
// fieldName: "propertyId"
|
|
133
|
+
// }
|
|
134
|
+
// ]
|
|
135
|
+
// },
|
|
136
|
+
// {
|
|
137
|
+
// objectType: attributeTreeSubject + ATTRIBUTE_TAG.attributeTagPropertyLabel,
|
|
138
|
+
// storageResources: storageResources,
|
|
139
|
+
// fieldNames: {
|
|
140
|
+
// propertyLabelId: fieldNameSetting(FIELD_NAME_TPYE.identifiers)
|
|
141
|
+
// },
|
|
142
|
+
// identifiers: [
|
|
143
|
+
// {
|
|
144
|
+
// type: "identifier",
|
|
145
|
+
// fieldName: "propertyLabelId"
|
|
146
|
+
// }
|
|
147
|
+
// ]
|
|
148
|
+
// }
|
|
149
|
+
// )
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
// for (let attributeTreeObjSchema of attributeTreeObjSchemas) {
|
|
153
|
+
// for (let attributeTreeFieldName of Object.values(attributeTreeObjSchema.fieldNames)) {
|
|
154
|
+
// Object.assign(attributeTreeFieldName, { storageResourceTags: storageResourceTags }) // add storageResourceTags for each fieldName
|
|
155
|
+
// }
|
|
156
|
+
// }
|
|
157
|
+
// }
|
|
158
|
+
|
|
159
|
+
// }
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
// // console.log("attributeTreeObjSchemas", attributeTreeObjSchemas)
|
|
164
|
+
// for (const attributeTreeObjSchema of attributeTreeObjSchemas) {
|
|
165
|
+
// createSources.push({
|
|
166
|
+
// templatePath: templatePath,
|
|
167
|
+
// templateData: {
|
|
168
|
+
// fieldNames: JSON.stringify(attributeTreeObjSchema.fieldNames, null, 2),
|
|
169
|
+
// identifiers: JSON.stringify(attributeTreeObjSchema.identifiers, null, 2),
|
|
170
|
+
// objectType: attributeTreeObjSchema.objectType,
|
|
171
|
+
// storageResources: JSON.stringify(attributeTreeObjSchema.storageResources, null, 2),
|
|
172
|
+
// compositeKeyDeliminator: attributeTreeObjSchema.compositeKeyDeliminator
|
|
173
|
+
// },
|
|
174
|
+
// setting: {
|
|
175
|
+
// savePath: path.join(srcPath, SOURCE_PATH.generatedAttributeTree, attributeTreeObjSchema.objectType + "/"),
|
|
176
|
+
// hookPath: path.join(srcPath, "schemaHook", attributeTreeObjSchema.objectType, "/"),
|
|
177
|
+
// saveFileName: SAVE_FILE_NAME.attributeTreeObjectSchema,
|
|
178
|
+
// fileExtension: ".js",
|
|
179
|
+
// isAppend: false
|
|
180
|
+
// }
|
|
181
|
+
// })
|
|
182
|
+
// }
|
|
183
|
+
// }
|
|
184
|
+
// console.log("createSources", createSources)
|
|
185
|
+
return createSources;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
module.exports = data
|
|
@@ -18,10 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
const Logger = require('@izara_project/izara-core-library-logger')
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const snsSharedLib = izaraShared.snsSharedLib
|
|
21
|
+
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb')
|
|
22
|
+
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda')
|
|
23
|
+
const snsSharedLib = require('@izara_project/izara-core-library-sns')
|
|
25
24
|
const initialSetupConfig = require('../../config/Config') // config external serviceName
|
|
26
25
|
const basicNodeSchemaLib = require('@izara_project/izara-attribute-tree').basicNodeSchemaLib
|
|
27
26
|
const _izContext = {logger : Logger}
|
|
@@ -76,7 +76,7 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
console.log("snsServiceConfigArray::", snsServiceConfigArray)
|
|
79
|
+
// console.log("snsServiceConfigArray::", snsServiceConfigArray)
|
|
80
80
|
|
|
81
81
|
return {
|
|
82
82
|
templatePath: templatePath,
|
|
@@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
22
22
|
|
|
23
23
|
const izara = require("@izara_project/izara-middleware");
|
|
24
24
|
const middleware = izara.middlewareHandler;
|
|
25
|
-
const recordHandlerSharedLib = require("@izara_project/izara-
|
|
25
|
+
const recordHandlerSharedLib = require("@izara_project/izara-core-library-record-handler");
|
|
26
26
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
27
27
|
|
|
28
28
|
const findData = require('./FindData_Main');
|
|
@@ -18,9 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
20
|
const izaraShared = require("@izara_project/izara-shared");
|
|
21
|
-
const findDataSharedLib =
|
|
22
|
-
const graphSharedLib =
|
|
23
|
-
const dynamodbSharedLib =
|
|
21
|
+
const findDataSharedLib = require('@izara_project/izara-core-library-find-data');
|
|
22
|
+
const graphSharedLib = require('@izara_project/izara-core-library-graph-service');
|
|
23
|
+
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb')
|
|
24
24
|
|
|
25
25
|
const serviceSchemas = require('@izara_project/izara-core-library-service-schemas');
|
|
26
26
|
const serviceConfig = serviceSchemas.serviceConfig;
|
|
@@ -37,7 +37,8 @@ const {
|
|
|
37
37
|
externalResourceSns,
|
|
38
38
|
externalResourceName,
|
|
39
39
|
DYNAMO_RESOURCE,
|
|
40
|
-
LAMBDA_RESOURCE
|
|
40
|
+
LAMBDA_RESOURCE,
|
|
41
|
+
SOURCE_GENERATE_IAM_ROLE
|
|
41
42
|
} = require('../../../../../../../MainLibs/src/Consts');
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -105,6 +106,7 @@ function createSourceParams(_izContext, srcPath) {
|
|
|
105
106
|
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
106
107
|
additionalResourcePermission,
|
|
107
108
|
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
109
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
108
110
|
},
|
|
109
111
|
setting: {
|
|
110
112
|
saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
|
|
@@ -9,20 +9,7 @@
|
|
|
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) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
|
|
11
11
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
|
|
13
|
-
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
14
|
-
- Effect: <%- resourcePermission.effect %>
|
|
15
|
-
Action:
|
|
16
|
-
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
17
|
-
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
18
|
-
- <%- resourcePerAction %>:<%- permission %>
|
|
19
|
-
<%_ }) _%>
|
|
20
|
-
<%_ }) _%>
|
|
21
|
-
Resource:
|
|
22
|
-
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
23
|
-
- "<%- resource %>"
|
|
24
|
-
<%_ }) _%>
|
|
25
|
-
<%_}) _%>
|
|
12
|
+
role: <%- roleName %>Role
|
|
26
13
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
27
14
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
28
15
|
<%_ function firstLetterUpperCase(text){
|
|
@@ -22,10 +22,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
22
22
|
|
|
23
23
|
const izara = require("@izara_project/izara-middleware");
|
|
24
24
|
const middleware = izara.middlewareHandler;
|
|
25
|
-
const recordHandlerSharedLib = require("@izara_project/izara-
|
|
25
|
+
const recordHandlerSharedLib = require("@izara_project/izara-core-library-record-handler");
|
|
26
26
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
27
|
-
const
|
|
28
|
-
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
27
|
+
const callingFlowSharedLib = require("@izara_project/izara-core-library-calling-flow")
|
|
29
28
|
|
|
30
29
|
const confirmNewReserved = require('./ConfirmNewReserved_Main')
|
|
31
30
|
|
|
@@ -17,9 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const snsSharedLib = izaraShared.snsSharedLib;
|
|
20
|
+
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb')
|
|
21
|
+
const snsSharedLib = require('@izara_project/izara-core-library-sns')
|
|
23
22
|
const sns = require('@izara_project/izara-core-library-external-request').sns
|
|
24
23
|
const consts = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
25
24
|
const { getNestObject } = require('../../libs/source/ImportDataLib')
|
package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js
CHANGED
|
@@ -31,7 +31,8 @@ const {
|
|
|
31
31
|
SAVE_FILE_NAME,
|
|
32
32
|
FUNCTION_NAME,
|
|
33
33
|
shortNameHandler,
|
|
34
|
-
externalResourceYaml
|
|
34
|
+
externalResourceYaml,
|
|
35
|
+
SOURCE_GENERATE_IAM_ROLE
|
|
35
36
|
} = require('../../../../../../../MainLibs/src/Consts');
|
|
36
37
|
|
|
37
38
|
const templatePath = path.join(__dirname, "template.ejs");
|
|
@@ -126,7 +127,8 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
126
127
|
handlerType,
|
|
127
128
|
additionalResourcePermission,
|
|
128
129
|
route,
|
|
129
|
-
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType))
|
|
130
|
+
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
131
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
130
132
|
},
|
|
131
133
|
setting: {
|
|
132
134
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -13,20 +13,7 @@
|
|
|
13
13
|
route: <%- route %>
|
|
14
14
|
# authorizer: ${self:custom.iz_authorizerAppLevel}
|
|
15
15
|
# identifierResource: 'route.request.header.Auth'
|
|
16
|
-
|
|
17
|
-
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
18
|
-
- Effect: <%- resourcePermission.effect %>
|
|
19
|
-
Action:
|
|
20
|
-
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
21
|
-
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
22
|
-
- <%- resourcePerAction %>:<%- permission %>
|
|
23
|
-
<%_}) _%>
|
|
24
|
-
<%_ }) _%>
|
|
25
|
-
Resource:
|
|
26
|
-
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
27
|
-
- <%- resource %>
|
|
28
|
-
<%_ }) _%>
|
|
29
|
-
<%_}) _%>
|
|
16
|
+
role: <%- roleName %>Role
|
|
30
17
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
31
18
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
32
19
|
<%_ function firstLetterUpperCase(text){
|
package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs
CHANGED
|
@@ -21,9 +21,8 @@ const izara = require("@izara_project/izara-middleware");
|
|
|
21
21
|
const middleware = izara.middlewareHandler;
|
|
22
22
|
// const AWS = require('aws-sdk');
|
|
23
23
|
// const api = new AWS.ApiGatewayManagementApi({ endpoint: process.env.iz_webSocketEndpoint });
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
24
|
+
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb')
|
|
25
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-calling-flow')
|
|
27
26
|
const hash = require('object-hash')
|
|
28
27
|
// const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
29
28
|
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
@@ -21,12 +21,11 @@ along with this program. If not, see
|
|
|
21
21
|
const hash = require("object-hash");
|
|
22
22
|
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const lambdaSharedLib = izaraShared.lambdaSharedLib
|
|
24
|
+
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
|
|
25
|
+
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
26
|
+
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
27
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
28
|
+
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
30
29
|
|
|
31
30
|
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
32
31
|
const sns = externalRequest.sns
|
|
@@ -35,7 +35,8 @@ const {
|
|
|
35
35
|
shortNameHandler,
|
|
36
36
|
defaultIamRolePerAction,
|
|
37
37
|
DYNAMO_RESOURCE,
|
|
38
|
-
SHORT_FUNCTION_NAME
|
|
38
|
+
SHORT_FUNCTION_NAME,
|
|
39
|
+
SOURCE_GENERATE_IAM_ROLE
|
|
39
40
|
} = require('../../../../../../../MainLibs/src/Consts');
|
|
40
41
|
|
|
41
42
|
|
|
@@ -102,6 +103,7 @@ function createSourceParams(_izContext, srcPath) {
|
|
|
102
103
|
handlerType: handlerType,
|
|
103
104
|
additionalResourcePermission: additionalResourcePermission,
|
|
104
105
|
functionNameConfig: upperCase(SHORT_FUNCTION_NAME.createObjectS3Complete) + upperCase(shortNameHandler(handlerType)),
|
|
106
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
105
107
|
},
|
|
106
108
|
setting: {
|
|
107
109
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -9,20 +9,7 @@
|
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
11
11
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
|
|
13
|
-
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
14
|
-
- Effect: <%- resourcePermission.effect %>
|
|
15
|
-
Action:
|
|
16
|
-
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
17
|
-
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
18
|
-
- <%- resourcePerAction %>:<%- permission %>
|
|
19
|
-
<%_ }) _%>
|
|
20
|
-
<%_ }) _%>
|
|
21
|
-
Resource:
|
|
22
|
-
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
23
|
-
- "<%- resource %>"
|
|
24
|
-
<%_ }) _%>
|
|
25
|
-
<%_}) _%>
|
|
12
|
+
role: <%- roleName %>Role
|
|
26
13
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
27
14
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
28
15
|
<%_ function firstLetterUpperCase(text){
|
|
@@ -22,8 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
22
22
|
const izara = require('@izara_project/izara-middleware');
|
|
23
23
|
const middleware = izara.middlewareHandler;;
|
|
24
24
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
25
|
-
const
|
|
26
|
-
const recordHandlerSharedLib = izaraShared.recordHandlerSharedLib
|
|
25
|
+
const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
|
|
27
26
|
|
|
28
27
|
const webSocketTaskComplete = require('./WebSocketTaskComplete_Main')
|
|
29
28
|
|
|
@@ -16,10 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
'use strict';
|
|
18
18
|
const { NoRetryError } = require('@izara_project/izara-core-library-core');
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const asyncFlowSharedLib = izaraShared.asyncFlowSharedLib;
|
|
19
|
+
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
|
|
20
|
+
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
21
|
+
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
23
22
|
let coreConsts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
24
23
|
|
|
25
24
|
const { postToConnection } = require('../../libs/source/ImportDataLib')
|
|
@@ -35,7 +35,8 @@ const {
|
|
|
35
35
|
SAVE_FILE_NAME,
|
|
36
36
|
awaitingMultipleStepsRole,
|
|
37
37
|
externalResourceSns,
|
|
38
|
-
externalResourceName
|
|
38
|
+
externalResourceName,
|
|
39
|
+
SOURCE_GENERATE_IAM_ROLE
|
|
39
40
|
} = require('../../../../../../../../MainLibs/src/Consts');
|
|
40
41
|
|
|
41
42
|
const {
|
|
@@ -89,6 +90,7 @@ function createSourceParams(_izContext, srcPath) {
|
|
|
89
90
|
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
90
91
|
additionalResourcePermission,
|
|
91
92
|
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
93
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
92
94
|
},
|
|
93
95
|
setting: {
|
|
94
96
|
saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
|
|
@@ -6,20 +6,7 @@
|
|
|
6
6
|
- sqs:
|
|
7
7
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
8
8
|
batchSize: 10
|
|
9
|
-
|
|
10
|
-
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
11
|
-
- Effect: <%- resourcePermission.effect %>
|
|
12
|
-
Action:
|
|
13
|
-
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
14
|
-
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
15
|
-
- <%- resourcePerAction %>:<%- permission %>
|
|
16
|
-
<%_ }) _%>
|
|
17
|
-
<%_ }) _%>
|
|
18
|
-
Resource:
|
|
19
|
-
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
20
|
-
- "<%- resource %>"
|
|
21
|
-
<%_ }) _%>
|
|
22
|
-
<%_}) _%>
|
|
9
|
+
role: <%- roleName %>Role
|
|
23
10
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
24
11
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
25
12
|
<%_ function firstLetterUpperCase(text){
|
|
@@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
const izara = require("@izara_project/izara-middleware");
|
|
21
21
|
const middleware = izara.middlewareHandler;
|
|
22
22
|
const izaraShared = require('@izara_project/izara-shared');
|
|
23
|
-
const recordHandlerSharedLib =
|
|
24
|
-
const callingFlowSharedLib =
|
|
23
|
+
const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
|
|
24
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
25
25
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
26
|
|
|
27
27
|
const getPresignUrl = require('./GetPresignUrl_Main');
|
|
@@ -17,10 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const snsSharedLib = izaraShared.snsSharedLib
|
|
20
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
21
|
+
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
22
|
+
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
24
23
|
|
|
25
24
|
const externalRequest = require('@izara_project/izara-core-library-external-request')
|
|
26
25
|
const sns = externalRequest.sns;
|
|
@@ -37,7 +37,8 @@ const {
|
|
|
37
37
|
externalResourceSns,
|
|
38
38
|
externalResourceName,
|
|
39
39
|
DYNAMO_RESOURCE,
|
|
40
|
-
LAMBDA_RESOURCE
|
|
40
|
+
LAMBDA_RESOURCE,
|
|
41
|
+
SOURCE_GENERATE_IAM_ROLE
|
|
41
42
|
} = require('../../../../../../../../MainLibs/src/Consts');
|
|
42
43
|
|
|
43
44
|
const {
|
|
@@ -118,6 +119,7 @@ function createSourceParams(_izContext, srcPath) {
|
|
|
118
119
|
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
119
120
|
additionalResourcePermission,
|
|
120
121
|
functionNameConfig: upperCase("ReservedLimitComp") + upperCase(shortNameHandler(handlerType)),
|
|
122
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
121
123
|
},
|
|
122
124
|
setting: {
|
|
123
125
|
saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
|
|
@@ -9,20 +9,7 @@
|
|
|
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) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
|
|
11
11
|
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
-
|
|
13
|
-
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
14
|
-
- Effect: <%- resourcePermission.effect %>
|
|
15
|
-
Action:
|
|
16
|
-
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
17
|
-
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
18
|
-
- <%- resourcePerAction %>:<%- permission %>
|
|
19
|
-
<%_ }) _%>
|
|
20
|
-
<%_ }) _%>
|
|
21
|
-
Resource:
|
|
22
|
-
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
23
|
-
- "<%- resource %>"
|
|
24
|
-
<%_ }) _%>
|
|
25
|
-
<%_}) _%>
|
|
12
|
+
role: <%- roleName %>Role
|
|
26
13
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
27
14
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
28
15
|
<%_ function firstLetterUpperCase(text){
|
|
@@ -22,10 +22,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
22
22
|
|
|
23
23
|
const izara = require("@izara_project/izara-middleware");
|
|
24
24
|
const middleware = izara.middlewareHandler;
|
|
25
|
-
const recordHandlerSharedLib = require(
|
|
25
|
+
const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
|
|
26
26
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
27
|
-
const
|
|
28
|
-
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
27
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
29
28
|
|
|
30
29
|
const reservedLimitComplete = require('./ReservedLimitComplete_Main');
|
|
31
30
|
|
|
@@ -17,12 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
20
|
+
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
21
|
+
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
22
|
+
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
|
+
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
24
|
+
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
|
|
26
25
|
|
|
27
26
|
const externalRequest = require('@izara_project/izara-core-library-external-request')
|
|
28
27
|
const lambda = externalRequest.lambda;
|
|
@@ -33,7 +33,8 @@ const {
|
|
|
33
33
|
SNS_RESOURCE,
|
|
34
34
|
shortNameHandler,
|
|
35
35
|
FUNCTION_NAME,
|
|
36
|
-
LAMBDA_RESOURCE
|
|
36
|
+
LAMBDA_RESOURCE,
|
|
37
|
+
SOURCE_GENERATE_IAM_ROLE
|
|
37
38
|
} = require('../../../../../../../../MainLibs/src/Consts');
|
|
38
39
|
|
|
39
40
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
@@ -113,7 +114,8 @@ function createSourceParam(_izContext, flowSchema, srcPath) {
|
|
|
113
114
|
additionalResourcePermission,
|
|
114
115
|
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
115
116
|
bucketName,
|
|
116
|
-
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType))
|
|
117
|
+
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
118
|
+
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
117
119
|
},
|
|
118
120
|
setting: {
|
|
119
121
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|