@izara_project/izara-core-generate-service-code 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/generateCode/generateFlowSchema/GenerateCodeFlowSchema.js +11 -8
- package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/functionYaml/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/functionYaml/template.ejs +3 -10
- package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/handler/inv/data.js +5 -4
- package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/handler/inv/template.ejs +5 -14
- package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/index.js +4 -13
- package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/mainFunction/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/extTopicComponent/index.js +5 -9
- package/src/generateCode/generateFlowSchema/event/extTopicComponent/process/functionYaml/data.js +6 -10
- package/src/generateCode/generateFlowSchema/event/extTopicComponent/process/functionYaml/template.ejs +4 -11
- package/src/generateCode/generateFlowSchema/event/extTopicComponent/process/handler/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/extTopicComponent/sns-in-sqs/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/extTopicComponent/sns-out/data.js +4 -3
- package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/functionYaml/data.js +4 -8
- package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/functionYaml/template.ejs +12 -21
- package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/handler/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/index.js +3 -7
- package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/functionYaml/data.js +11 -9
- package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/functionYaml/template.ejs +3 -10
- package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/handler/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/index.js +3 -7
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/endpointComponent/functionYaml/data.js +4 -3
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/endpointComponent/handler/data.js +3 -3
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/flowSchemaComponent/functionYaml/data.js +8 -11
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/flowSchemaComponent/handler/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/flowSchemaComponent/mainFunction/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/index.js +8 -24
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/sns-in/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/ownTopicComponent/sns-out/data.js +4 -3
- package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/data.js +14 -12
- package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/template.ejs +5 -8
- package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/templateByStatusType/statusFieldTemplate.ejs +30 -0
- package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/templateByStatusType/storedCacheTemplate.ejs +26 -0
- package/src/generateCode/generateFlowSchema/event/s3Component/flowSchemaMainFunction/templateByStatusType/triggerCacheTemplate.ejs +44 -0
- package/src/generateCode/generateFlowSchema/event/s3Component/index.js +23 -55
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/functionYaml/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/handler/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/mainFunction/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/confirmReserved/queue/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/createObject/functionYaml/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/createObject/handler/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/createObject/mainFunction/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/functionYaml/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/handler/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/mainFunction/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/createPreSignUrl/queue/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/functionYaml/data.js +6 -10
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/handler/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/mainFunction/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/preSignUrl/reservedLimit/sqs/data.js +2 -2
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/processFile/functionYml/HdrS3/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/processFile/handler/handlerS3/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/processFile/mainFunction/data.js +3 -7
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/relate/S3/data.js +4 -4
- package/src/generateCode/generateFlowSchema/event/s3Component/upload/relate/sns-out/data.js +5 -3
- package/src/generateCode/generateFlowSchema/event/s3Component/websocket/dynamoDb/ReservedTableData.js +3 -3
- package/src/generateCode/generateFlowSchema/flowSchemaMainFunction/data.js +4 -8
- package/src/generateCode/generateFlowSchema/flowSchemaMainFunction/template.ejs +3 -5
- package/src/generateCode/generateFlowSchema/flowStep/flowStep.js +7 -2
- package/src/generateCode/generateFlowSchema/libs/data.js +3 -7
- package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/functionYaml/data.js +9 -9
- package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/handler/data.js +1 -5
- package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/index.js +6 -18
- package/src/generateCode/generateFlowSchema/statusType/statusFieldComponent/mainFunction/data.js +15 -14
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +4 -8
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +15 -15
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +15 -15
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/index.js +13 -33
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/processTriggerCache/functionYaml/data.js +4 -8
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/processTriggerCache/handler/data.js +12 -14
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/processTriggerCache/mainFunction/data.js +11 -14
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/functionYaml/dsq/data.js +4 -9
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/functionYaml/sqs/data.js +4 -9
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/handler/dsq/data.js +11 -14
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/handler/sqs/data.js +11 -14
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +15 -15
- package/src/generateCode/generateFlowSchema/statusType/triggerCacheComponent/triggerCacheQueue/data.js +2 -3
- package/src/generateCode/generateSchema/actionEndpointCompleteComponent/create/mainFunction/template.ejs +185 -103
- package/src/generateCode/generateSchema/actionEndpointCompleteComponent/create/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/actionEndpointCompleteComponent/delete/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/actionEndpointCompleteComponent/get/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/actionEndpointCompleteComponent/update/mainFunction/template.ejs +137 -71
- package/src/generateCode/generateSchema/actionEndpointCompleteComponent/update/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/actionEndpointComponent/mainFunction/create/main/template.ejs +1 -1
- package/src/generateCode/generateSchema/actionEndpointComponent/yaml/data.js +6 -4
- package/src/generateCode/generateSchema/findDataComponent/mainFunction/data.js +1 -1
- package/src/generateCode/generateSchema/relationshipPerActionComponent/changeRelationship/complete/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/relationshipPerActionComponent/create/action/functionYaml/data.js +1 -0
- package/src/generateCode/generateSchema/relationshipPerActionComponent/create/complete/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/relationshipPerActionComponent/delete/action/functionYaml/data.js +1 -0
- package/src/generateCode/generateSchema/relationshipPerActionComponent/delete/complete/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/relationshipPerActionComponent/get/action/functionYaml/data.js +1 -0
- package/src/generateCode/generateSchema/relationshipPerActionComponent/get/complete/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/relationshipPerActionComponent/moveRelationship/complete/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/relationshipPerActionComponent/update/action/functionYaml/data.js +1 -0
- package/src/generateCode/generateSchema/relationshipPerActionComponent/update/action/sns-out/data.js +2 -1
- package/src/generateCode/generateSchema/relationshipPerActionComponent/update/complete/sns-out/data.js +2 -1
- package/src/generateCode/resourceYamlComponent/sns-out/data.js +2 -1
- package/src/generateCode/resourceYamlComponent/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +2 -1
- package/src/generateCode/resourceYamlComponent/sns-out/template.ejs +2 -6
- package/src/generateCode.js +9 -7
- package/src/libs/Consts.js +9 -12
- package/src/libs/Utils.js +26 -1
- package/src/__TemplateData/flowSchema/event/externalTopic/Process/handler/data.js +0 -64
- package/src/__TemplateData/flowSchema/event/externalTopic/sns-out/data.js +0 -75
package/package.json
CHANGED
|
@@ -85,17 +85,20 @@ async function generateTemplateDataFromFlowSchema(
|
|
|
85
85
|
|
|
86
86
|
// ── per-flowSchema resources ─────────────────────────────────────────
|
|
87
87
|
const perFlowParams = [
|
|
88
|
-
|
|
89
|
-
...(!flowSchema.event.includes('s3')
|
|
90
|
-
? await createFlowSchemaEndpointMainFunction(
|
|
91
|
-
_izContext,
|
|
92
|
-
flowSchema,
|
|
93
|
-
appPath
|
|
94
|
-
)
|
|
95
|
-
: []),
|
|
88
|
+
createWebSocketGenerateCodeLibs(_izContext, flowSchema, appPath),
|
|
96
89
|
...buildFlowStepResources(_izContext, flowSchema, appPath)
|
|
97
90
|
];
|
|
98
91
|
|
|
92
|
+
if (!flowSchema.event.includes('s3')) {
|
|
93
|
+
perFlowParams.push(
|
|
94
|
+
await createFlowSchemaEndpointMainFunction(
|
|
95
|
+
_izContext,
|
|
96
|
+
flowSchema,
|
|
97
|
+
appPath
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
99
102
|
// ── event handlers ───────────────────────────────────────────────────
|
|
100
103
|
const eventPromises = events
|
|
101
104
|
.filter(event => {
|
|
@@ -45,7 +45,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
45
45
|
* @param {Object} objectSchema
|
|
46
46
|
* @return {{templatePath, templateData,setting}}
|
|
47
47
|
*/
|
|
48
|
-
function createSourceParams(_izContext, flowSchema,
|
|
48
|
+
function createSourceParams(_izContext, flowSchema, appPath) {
|
|
49
49
|
const functionName = upperCase(FUNCTION_NAME.flowSchemaEventBridge);
|
|
50
50
|
// const action = SOURCE_GENERATE_IAM_ROLE.EventBridge;
|
|
51
51
|
const functionNameConfig = upperCase(SOURCE_GENERATE_IAM_ROLE.EventBridge);
|
|
@@ -153,7 +153,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
153
153
|
schedules
|
|
154
154
|
},
|
|
155
155
|
setting: {
|
|
156
|
-
savePath: path.join(
|
|
156
|
+
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
157
157
|
saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
|
|
158
158
|
fileExtension: '.yml',
|
|
159
159
|
isAppend: true
|
package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/functionYaml/template.ejs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionNameConfig) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- `${resourceLocation}${functionName}_${handlerType}.main` %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionNameConfig %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
5
|
#<#<%- functionName %>FunctionSetting#>
|
|
7
6
|
#<#/<%- functionName %>FunctionSetting#>
|
|
@@ -13,9 +12,3 @@
|
|
|
13
12
|
rate: <%- schedule.rate %>
|
|
14
13
|
input: <%- JSON.stringify(schedule.input) %>
|
|
15
14
|
<%_ }) _%>
|
|
16
|
-
<%_ function firstLetterUpperCase(text){
|
|
17
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
18
|
-
} _%>
|
|
19
|
-
<%_ function firstLetterLowerCase(str) {
|
|
20
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
21
|
-
} _%>
|
|
@@ -33,10 +33,10 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
33
33
|
*
|
|
34
34
|
* @param {Object} _izContext
|
|
35
35
|
* @param {Object} flowSchema
|
|
36
|
-
* @param {String}
|
|
36
|
+
* @param {String} appPath
|
|
37
37
|
* @return {Object[]}
|
|
38
38
|
*/
|
|
39
|
-
function data(_izContext, flowSchema,
|
|
39
|
+
function data(_izContext, flowSchema, appPath) {
|
|
40
40
|
const handler = HANDLER.hdrInv;
|
|
41
41
|
const flowTag = flowSchema.flowTag;
|
|
42
42
|
// const action = SOURCE_GENERATE_IAM_ROLE.EventBridge;
|
|
@@ -46,7 +46,8 @@ function data(_izContext, flowSchema, srcPath) {
|
|
|
46
46
|
templatePath: templatePath,
|
|
47
47
|
templateData: {
|
|
48
48
|
functionName: functionName,
|
|
49
|
-
flowTag: flowTag,
|
|
49
|
+
flowTag: upperCase(flowTag),
|
|
50
|
+
// flowTag: ,
|
|
50
51
|
// action: action,
|
|
51
52
|
handler
|
|
52
53
|
// roleName: SOURCE_GENERATE_IAM_ROLE.EventBridge,
|
|
@@ -54,7 +55,7 @@ function data(_izContext, flowSchema, srcPath) {
|
|
|
54
55
|
},
|
|
55
56
|
setting: {
|
|
56
57
|
savePath: path.join(
|
|
57
|
-
|
|
58
|
+
appPath,
|
|
58
59
|
SOURCE_PATH.flowSchemaEventBridge,
|
|
59
60
|
flowSchema.flowTag,
|
|
60
61
|
'source/'
|
package/src/generateCode/generateFlowSchema/event/eventBridgeComponent/handler/inv/template.ejs
CHANGED
|
@@ -15,12 +15,10 @@ You should have received a copy of the GNU Affero General Public License
|
|
|
15
15
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import { middlewareHandleras middlewar } from "@izara_project/izara-middleware";
|
|
18
|
+
import { middlewareHandler as middleware } from "@izara_project/izara-middleware";
|
|
21
19
|
import callingFlowSharedLib from '@izara_project/zara-core-library-calling-flow';
|
|
22
20
|
|
|
23
|
-
import <%- functionName %>Main from './<%-
|
|
21
|
+
import <%- functionName %>Main from './<%- functionName %>_Main.js'
|
|
24
22
|
|
|
25
23
|
//(<globalVariable>
|
|
26
24
|
//</globalVariable>)
|
|
@@ -40,21 +38,14 @@ export const main = middlewareHandler.wrap(async (event, context) => {
|
|
|
40
38
|
//(</beforeInvoke>)
|
|
41
39
|
|
|
42
40
|
// invoke LambdaFunction
|
|
43
|
-
return await
|
|
41
|
+
return await <%- functionName %> Main(
|
|
44
42
|
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
|
|
45
43
|
event,
|
|
46
44
|
callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
|
|
47
45
|
);
|
|
48
46
|
|
|
49
47
|
} catch (err) {
|
|
50
|
-
event._izContext.logger.error('Error, <%-
|
|
48
|
+
event._izContext.logger.error('Error, <%- flowTag %>: ', err);
|
|
51
49
|
throw (err);
|
|
52
50
|
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
<% _ function firstLetterUpperCase(text) {
|
|
56
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
57
|
-
} _ %>
|
|
58
|
-
<% _ function firstLetterLowerCase(str) {
|
|
59
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
60
|
-
} _ %>
|
|
51
|
+
});
|
|
@@ -2,22 +2,13 @@ import createFlowSchemaEventBridgeFunctionYaml from './functionYaml/data.js';
|
|
|
2
2
|
import createFlowSchemaEventBridgeHandler from './handler/inv/data.js';
|
|
3
3
|
import createFlowSchemaEventBridgeMainFunction from './mainFunction/data.js';
|
|
4
4
|
|
|
5
|
-
function createEventBridgeComponent(_izContext, flowSchema,
|
|
5
|
+
function createEventBridgeComponent(_izContext, flowSchema, appPath) {
|
|
6
6
|
const component = [
|
|
7
|
-
createFlowSchemaEventBridgeHandler(_izContext, flowSchema,
|
|
8
|
-
createFlowSchemaEventBridgeMainFunction(
|
|
9
|
-
|
|
10
|
-
flowSchema,
|
|
11
|
-
saveFilePath
|
|
12
|
-
),
|
|
13
|
-
createFlowSchemaEventBridgeFunctionYaml(
|
|
14
|
-
_izContext,
|
|
15
|
-
flowSchema,
|
|
16
|
-
saveFilePath
|
|
17
|
-
)
|
|
7
|
+
createFlowSchemaEventBridgeHandler(_izContext, flowSchema, appPath),
|
|
8
|
+
createFlowSchemaEventBridgeMainFunction(_izContext, flowSchema, appPath),
|
|
9
|
+
createFlowSchemaEventBridgeFunctionYaml(_izContext, flowSchema, appPath)
|
|
18
10
|
];
|
|
19
11
|
|
|
20
|
-
console.info('generateEventBridgeComponent ✅');
|
|
21
12
|
return component;
|
|
22
13
|
}
|
|
23
14
|
|
|
@@ -35,7 +35,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
35
35
|
* @param {Object} flowSchema
|
|
36
36
|
* @return {{ templatePath, templateData, setting } }
|
|
37
37
|
*/
|
|
38
|
-
function data(_izContext, flowSchema,
|
|
38
|
+
function data(_izContext, flowSchema, appPath) {
|
|
39
39
|
// const handler = HANDLER.hdrInv;
|
|
40
40
|
const flowTag = flowSchema.flowTag;
|
|
41
41
|
// const functionName = "EventBridge" + upperCase(handler);
|
|
@@ -52,7 +52,7 @@ function data(_izContext, flowSchema, srcPath) {
|
|
|
52
52
|
},
|
|
53
53
|
setting: {
|
|
54
54
|
savePath: path.join(
|
|
55
|
-
|
|
55
|
+
appPath,
|
|
56
56
|
SOURCE_PATH.flowSchemaEventBridge,
|
|
57
57
|
flowSchema.flowTag,
|
|
58
58
|
'source/'
|
|
@@ -3,16 +3,12 @@ import createExternalSqsHandler from './process/handler/data.js';
|
|
|
3
3
|
import createExternalTopicSnsInSqs from './sns-in-sqs/data.js';
|
|
4
4
|
import createExternalTopicSnsOut from './sns-out/data.js';
|
|
5
5
|
|
|
6
|
-
async function createExternalTopicComponent(
|
|
7
|
-
_izContext,
|
|
8
|
-
flowSchema,
|
|
9
|
-
saveFilePath
|
|
10
|
-
) {
|
|
6
|
+
async function createExternalTopicComponent(_izContext, flowSchema, appPath) {
|
|
11
7
|
const component = [
|
|
12
|
-
createExternalSqsFunctionYaml(_izContext, flowSchema,
|
|
13
|
-
createExternalSqsHandler(_izContext, flowSchema,
|
|
14
|
-
...createExternalTopicSnsInSqs(_izContext, flowSchema,
|
|
15
|
-
...createExternalTopicSnsOut(_izContext, flowSchema,
|
|
8
|
+
await createExternalSqsFunctionYaml(_izContext, flowSchema, appPath),
|
|
9
|
+
createExternalSqsHandler(_izContext, flowSchema, appPath),
|
|
10
|
+
...createExternalTopicSnsInSqs(_izContext, flowSchema, appPath),
|
|
11
|
+
...createExternalTopicSnsOut(_izContext, flowSchema, appPath)
|
|
16
12
|
];
|
|
17
13
|
|
|
18
14
|
return component;
|
package/src/generateCode/generateFlowSchema/event/extTopicComponent/process/functionYaml/data.js
CHANGED
|
@@ -38,7 +38,7 @@ const {
|
|
|
38
38
|
LAMBDA_RESOURCE
|
|
39
39
|
} = consts;
|
|
40
40
|
|
|
41
|
-
const { firstLetterUpperCase: upperCase } = utils;
|
|
41
|
+
const { firstLetterUpperCase: upperCase, savePath } = utils;
|
|
42
42
|
|
|
43
43
|
const {
|
|
44
44
|
shortNameHandler,
|
|
@@ -53,10 +53,10 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
53
53
|
* Creates source parameters for function YAML generation
|
|
54
54
|
* @param {Object} _izContext - The Izara context object
|
|
55
55
|
* @param {Object} flowSchema - The flow schema configuration
|
|
56
|
-
* @param {string}
|
|
56
|
+
* @param {string} appPath - The source path for the project
|
|
57
57
|
* @returns {Promise<Array>} Array containing template configuration object
|
|
58
58
|
*/
|
|
59
|
-
async function createSourceParams(_izContext, flowSchema,
|
|
59
|
+
async function createSourceParams(_izContext, flowSchema, appPath) {
|
|
60
60
|
let functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
61
61
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
62
62
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
@@ -92,7 +92,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
92
92
|
.getLocalObjectSchemas(
|
|
93
93
|
_izContext,
|
|
94
94
|
[flowSchema.objType.objectType],
|
|
95
|
-
path.join(
|
|
95
|
+
path.join(appPath, 'src/schemas')
|
|
96
96
|
)
|
|
97
97
|
.then(res => res.records[0]);
|
|
98
98
|
if (!objectSchema) {
|
|
@@ -132,11 +132,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
132
132
|
return {
|
|
133
133
|
templatePath: templatePath,
|
|
134
134
|
templateData: {
|
|
135
|
-
resourceLocation:
|
|
136
|
-
SOURCE_PATH.resourceLocationFlowSchema,
|
|
137
|
-
upperCase(flowSchema.flowTag),
|
|
138
|
-
'source/'
|
|
139
|
-
),
|
|
135
|
+
resourceLocation: savePath.flowSchemaFlowTag(flowSchema.flowTag),
|
|
140
136
|
functionName,
|
|
141
137
|
handlerType,
|
|
142
138
|
additionalResourcePermission,
|
|
@@ -147,7 +143,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
147
143
|
queueName
|
|
148
144
|
},
|
|
149
145
|
setting: {
|
|
150
|
-
savePath: path.join(
|
|
146
|
+
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
151
147
|
saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
|
|
152
148
|
fileExtension: '.yml',
|
|
153
149
|
isAppend: true
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- `${resourceLocation}${functionName}_${handlerType}.main`%>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- handlerType %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
5
|
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
6
|
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
@@ -11,10 +10,4 @@
|
|
|
11
10
|
batchSize: 10
|
|
12
11
|
filterPatterns: #**** need to update serverless framework upper v.2.69.1
|
|
13
12
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- functionName %>"]}}} # functionName of callingFlow
|
|
14
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
15
|
-
<%_ function firstLetterUpperCase(text){
|
|
16
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
17
|
-
} _%>
|
|
18
|
-
<%_ function firstLetterLowerCase(str) {
|
|
19
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
20
|
-
} _%>
|
|
13
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
@@ -35,7 +35,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
35
35
|
* @return {{templatePath, templateData,setting}}
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
function createSourceParams(_izContext, flowSchema,
|
|
38
|
+
function createSourceParams(_izContext, flowSchema, appPath) {
|
|
39
39
|
let functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
40
40
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
41
41
|
let queueName = 'Process' + upperCase(flowSchema.flowTag) + handlerType;
|
|
@@ -49,7 +49,7 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
49
49
|
},
|
|
50
50
|
setting: {
|
|
51
51
|
savePath: path.join(
|
|
52
|
-
|
|
52
|
+
appPath,
|
|
53
53
|
SOURCE_PATH.flowSchema,
|
|
54
54
|
upperCase(flowSchema.flowTag),
|
|
55
55
|
'MainHandler/',
|
|
@@ -37,12 +37,12 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
37
37
|
* @returns {Object[]} - data of multiple dynamoDb template
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
function createDataForDefaultSnsInSqs(_izContext, flowSchema,
|
|
40
|
+
function createDataForDefaultSnsInSqs(_izContext, flowSchema, appPath) {
|
|
41
41
|
let resultsForCreateDefaultSnsInSqs = [];
|
|
42
42
|
let flowSteps = Object.keys(flowSchema.flowSteps);
|
|
43
43
|
const setting = {
|
|
44
44
|
initialData: 'Resources:\n',
|
|
45
|
-
savePath: path.join(
|
|
45
|
+
savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
|
|
46
46
|
saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
|
|
47
47
|
fileExtension: '.yml',
|
|
48
48
|
isAppend: true
|
|
@@ -41,15 +41,16 @@ const templatePath = path.join(
|
|
|
41
41
|
* @returns {Object[]} - data of multiple dynamoDb template
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
|
-
function createDataForDefaultSnsInSqs(_izContext, flowSchema,
|
|
44
|
+
function createDataForDefaultSnsInSqs(_izContext, flowSchema, appPath) {
|
|
45
45
|
let resultsForCreateDefaultSnsInSqs = [];
|
|
46
46
|
let flowSteps = Object.keys(flowSchema.flowSteps);
|
|
47
47
|
const setting = {
|
|
48
48
|
initialData: 'Resources:\n',
|
|
49
|
-
savePath: path.join(
|
|
49
|
+
savePath: path.join(appPath, SOURCE_PATH.resourceYaml),
|
|
50
50
|
saveFileName: SAVE_FILE_NAME.snsOutYaml,
|
|
51
51
|
fileExtension: '.yml',
|
|
52
|
-
isAppend: true
|
|
52
|
+
isAppend: true,
|
|
53
|
+
fromFile: 'external/sns-out/data.js'
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
let topicOut = `${upperCase(flowSchema.flowTag)}`;
|
package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/functionYaml/data.js
CHANGED
|
@@ -41,12 +41,12 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
41
41
|
* @param {Object} objectSchema
|
|
42
42
|
* @return {{templatePath, templateData,setting}}
|
|
43
43
|
*/
|
|
44
|
-
function createSourceParamsApi(_izContext, flowSchema,
|
|
44
|
+
function createSourceParamsApi(_izContext, flowSchema, appPath) {
|
|
45
45
|
let functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
46
46
|
let handlerType = upperCase(HANDLER.hdrApi);
|
|
47
47
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
48
48
|
|
|
49
|
-
const configPath = path.join(
|
|
49
|
+
const configPath = path.join(appPath, '../config/serverless.config.yml');
|
|
50
50
|
const serverlessConfig = fs.readFileSync(configPath, 'utf8');
|
|
51
51
|
const config = yaml.parse(serverlessConfig);
|
|
52
52
|
const serviceTag = config.main_config.iz_serviceTag;
|
|
@@ -54,11 +54,7 @@ function createSourceParamsApi(_izContext, flowSchema, srcPath) {
|
|
|
54
54
|
return {
|
|
55
55
|
templatePath: templatePath,
|
|
56
56
|
templateData: {
|
|
57
|
-
|
|
58
|
-
SOURCE_PATH.resourceLocationFlowSchema,
|
|
59
|
-
upperCase(flowSchema.flowTag),
|
|
60
|
-
'source/'
|
|
61
|
-
),
|
|
57
|
+
resourceYamlFlowSchemaFlowTag,
|
|
62
58
|
functionName,
|
|
63
59
|
handlerType,
|
|
64
60
|
additionalResourcePermission,
|
|
@@ -69,7 +65,7 @@ function createSourceParamsApi(_izContext, flowSchema, srcPath) {
|
|
|
69
65
|
serviceTag: serviceTag
|
|
70
66
|
},
|
|
71
67
|
setting: {
|
|
72
|
-
savePath: path.join(
|
|
68
|
+
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
73
69
|
saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
|
|
74
70
|
fileExtension: '.yml',
|
|
75
71
|
isAppend: true
|
package/src/generateCode/generateFlowSchema/event/lambdaSyncApiComponent/functionYaml/template.ejs
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
#<#/<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- `${resourceLocation}${functionName}_${handlerType}.main` %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- handlerType %>
|
|
4
|
+
role: <%- roleName %>Role
|
|
5
|
+
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
6
|
+
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
8
7
|
events:
|
|
9
8
|
- httpApi:
|
|
10
|
-
path: /<%- serviceTag %>/<%-
|
|
9
|
+
path: /<%- serviceTag %>/<%- functionName %>/<%- functionName %>
|
|
11
10
|
method: <%- event %>
|
|
12
11
|
authorizer: authorizerServiceSchema
|
|
13
|
-
#<#<%-
|
|
14
|
-
#<#/<%-
|
|
12
|
+
#<#<%- functionName %><%- handlerType %>AppLevelAuthorizer#>
|
|
13
|
+
#<#/<%- functionName %><%- handlerType %>AppLevelAuthorizer#>
|
|
15
14
|
- httpApi:
|
|
16
|
-
path: /<%- serviceTag %>/<%-
|
|
15
|
+
path: /<%- serviceTag %>/<%- functionName %>/<%- functionName %>/{targetUserId}
|
|
17
16
|
method: <%- event %>
|
|
18
17
|
authorizer: authorizerServiceSchema
|
|
19
|
-
#<#<%-
|
|
20
|
-
#<#/<%-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<%_ function firstLetterUpperCase(text){
|
|
24
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
25
|
-
} _%>
|
|
26
|
-
<%_ function firstLetterLowerCase(str) {
|
|
27
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
28
|
-
} _%>
|
|
18
|
+
#<#<%- functionName %><%- handlerType %>UserLevelAuthorizer#>
|
|
19
|
+
#<#/<%- functionName %><%- handlerType %>UserLevelAuthorizer#>
|
|
@@ -35,7 +35,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
35
35
|
* @param {Object} objectSchema
|
|
36
36
|
* @return {{templatePath, templateData,setting}}
|
|
37
37
|
*/
|
|
38
|
-
function createSourceParamsApi(_izContext, flowSchema,
|
|
38
|
+
function createSourceParamsApi(_izContext, flowSchema, appPath) {
|
|
39
39
|
const functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
40
40
|
const handlerType = upperCase(HANDLER.hdrApi);
|
|
41
41
|
|
|
@@ -49,7 +49,7 @@ function createSourceParamsApi(_izContext, flowSchema, srcPath) {
|
|
|
49
49
|
},
|
|
50
50
|
setting: {
|
|
51
51
|
savePath: path.join(
|
|
52
|
-
|
|
52
|
+
appPath,
|
|
53
53
|
SOURCE_PATH.flowSchema,
|
|
54
54
|
upperCase(flowSchema.flowTag),
|
|
55
55
|
'MainHandler/',
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import createFlowSchemaLambdaSyncFunctionYamlApi from './functionYaml/data.js';
|
|
2
2
|
import createFlowSchemaLambdaSyncHandlerApi from './handler/data.js';
|
|
3
3
|
|
|
4
|
-
function createLambdaSyncApiComponent(_izContext, flowSchema,
|
|
4
|
+
function createLambdaSyncApiComponent(_izContext, flowSchema, appPath) {
|
|
5
5
|
const component = [
|
|
6
|
-
createFlowSchemaLambdaSyncFunctionYamlApi(
|
|
7
|
-
|
|
8
|
-
flowSchema,
|
|
9
|
-
saveFilePath
|
|
10
|
-
),
|
|
11
|
-
createFlowSchemaLambdaSyncHandlerApi(_izContext, flowSchema, saveFilePath)
|
|
6
|
+
createFlowSchemaLambdaSyncFunctionYamlApi(_izContext, flowSchema, appPath),
|
|
7
|
+
createFlowSchemaLambdaSyncHandlerApi(_izContext, flowSchema, appPath)
|
|
12
8
|
];
|
|
13
9
|
|
|
14
10
|
return component;
|
package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/functionYaml/data.js
CHANGED
|
@@ -28,7 +28,7 @@ const { HANDLER, SOURCE_PATH, SAVE_FILE_NAME } = consts;
|
|
|
28
28
|
|
|
29
29
|
const { shortNameHandler, defaultIamRolePerAction } = libs;
|
|
30
30
|
|
|
31
|
-
const { firstLetterUpperCase: upperCase } = utils;
|
|
31
|
+
const { firstLetterUpperCase: upperCase, savePath } = utils;
|
|
32
32
|
|
|
33
33
|
const templatePath = path.join(__dirname, 'template.ejs');
|
|
34
34
|
/**
|
|
@@ -38,7 +38,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
38
38
|
* @param {Object} objectSchema
|
|
39
39
|
* @return {{templatePath, templateData,setting}}
|
|
40
40
|
*/
|
|
41
|
-
function createSourceParamsInvoke(_izContext, flowSchema,
|
|
41
|
+
function createSourceParamsInvoke(_izContext, flowSchema, appPath) {
|
|
42
42
|
const functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
43
43
|
const handlerType = upperCase(HANDLER.hdrInv);
|
|
44
44
|
const additionalResourcePermission = defaultIamRolePerAction();
|
|
@@ -46,12 +46,14 @@ function createSourceParamsInvoke(_izContext, flowSchema, srcPath) {
|
|
|
46
46
|
return {
|
|
47
47
|
templatePath: templatePath,
|
|
48
48
|
templateData: {
|
|
49
|
-
resourceLocation:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
resourceLocation:
|
|
50
|
+
// path.join(
|
|
51
|
+
// SOURCE_PATH.resourceLocationFlowSchema,
|
|
52
|
+
// upperCase(flowSchema.flowTag),
|
|
53
|
+
// 'MainHandler/',
|
|
54
|
+
// 'source/'
|
|
55
|
+
// ),
|
|
56
|
+
savePath.flowSchemaFlowTag(flowSchema.flowTag),
|
|
55
57
|
handlerType,
|
|
56
58
|
additionalResourcePermission,
|
|
57
59
|
functionNameConfig:
|
|
@@ -59,7 +61,7 @@ function createSourceParamsInvoke(_izContext, flowSchema, srcPath) {
|
|
|
59
61
|
roleName: upperCase(flowSchema.flowTag)
|
|
60
62
|
},
|
|
61
63
|
setting: {
|
|
62
|
-
savePath: path.join(
|
|
64
|
+
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
63
65
|
saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
|
|
64
66
|
fileExtension: '.yml',
|
|
65
67
|
isAppend: true
|
package/src/generateCode/generateFlowSchema/event/lambdaSyncInvComponent/functionYaml/template.ejs
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<%-
|
|
3
|
-
|
|
4
|
-
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
|
|
1
|
+
<%- functionNameConfig %>:
|
|
2
|
+
handler: <%- `${resourceLocation}${functionName}_${handlerType}.main` %>
|
|
3
|
+
name: ${self:custom.iz_resourcePrefix}<%- functionName %><%- handlerType %>
|
|
5
4
|
role: <%- roleName %>Role
|
|
6
5
|
#<#<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
7
6
|
#<#/<%- functionName %><%- handlerType %>FunctionSetting#>
|
|
8
|
-
<%_ function firstLetterUpperCase(text){
|
|
9
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
10
|
-
} _%>
|
|
11
|
-
<%_ function firstLetterLowerCase(str) {
|
|
12
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
13
|
-
} _%>
|
|
@@ -35,7 +35,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
35
35
|
* @return {{templatePath, templateData,setting}}
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
function createSourceParamsInvoke(_izContext, flowSchema,
|
|
38
|
+
function createSourceParamsInvoke(_izContext, flowSchema, appPath) {
|
|
39
39
|
const functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
40
40
|
const handlerType = upperCase(HANDLER.hdrInv);
|
|
41
41
|
|
|
@@ -47,7 +47,7 @@ function createSourceParamsInvoke(_izContext, flowSchema, srcPath) {
|
|
|
47
47
|
},
|
|
48
48
|
setting: {
|
|
49
49
|
savePath: path.join(
|
|
50
|
-
|
|
50
|
+
appPath,
|
|
51
51
|
SOURCE_PATH.flowSchema,
|
|
52
52
|
upperCase(flowSchema.flowTag),
|
|
53
53
|
'MainHandler/',
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import createFlowSchemaLambdaSyncFunctionYamlInv from './functionYaml/data.js';
|
|
2
2
|
import createFlowSchemaLambdaSyncHandlerInv from './handler/data.js';
|
|
3
3
|
|
|
4
|
-
function CreateLambdaSyncInvokeComponent(_izContext, flowSchema,
|
|
4
|
+
function CreateLambdaSyncInvokeComponent(_izContext, flowSchema, appPath) {
|
|
5
5
|
const component = [
|
|
6
|
-
createFlowSchemaLambdaSyncFunctionYamlInv(
|
|
7
|
-
|
|
8
|
-
flowSchema,
|
|
9
|
-
saveFilePath
|
|
10
|
-
),
|
|
11
|
-
createFlowSchemaLambdaSyncHandlerInv(_izContext, flowSchema, saveFilePath)
|
|
6
|
+
createFlowSchemaLambdaSyncFunctionYamlInv(_izContext, flowSchema, appPath),
|
|
7
|
+
createFlowSchemaLambdaSyncHandlerInv(_izContext, flowSchema, appPath)
|
|
12
8
|
];
|
|
13
9
|
|
|
14
10
|
return component.flat();
|
|
@@ -55,7 +55,7 @@ const templatePath = path.join(__dirname, 'template.ejs');
|
|
|
55
55
|
* @return {{templatePath, templateData,setting}}
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
|
-
async function createSourceParams(_izContext, flowSchema,
|
|
58
|
+
async function createSourceParams(_izContext, flowSchema, appPath) {
|
|
59
59
|
let createSources = [];
|
|
60
60
|
let functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
61
61
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
@@ -64,7 +64,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
64
64
|
let objectSchema;
|
|
65
65
|
|
|
66
66
|
let setting = {
|
|
67
|
-
savePath: path.join(
|
|
67
|
+
savePath: path.join(appPath, SOURCE_PATH.appYaml),
|
|
68
68
|
saveFileName: SAVE_FILE_NAME.flowSchemaYaml,
|
|
69
69
|
fileExtension: '.yml',
|
|
70
70
|
isAppend: true
|
|
@@ -78,6 +78,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
78
78
|
handlerFilePath: path.join(
|
|
79
79
|
SOURCE_PATH.resourceLocationFlowSchema,
|
|
80
80
|
upperCase(flowSchema.flowTag),
|
|
81
|
+
'MainHandler/',
|
|
81
82
|
'source/'
|
|
82
83
|
),
|
|
83
84
|
functionName,
|
|
@@ -95,7 +96,7 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
|
95
96
|
.getLocalObjectSchemas(
|
|
96
97
|
_izContext,
|
|
97
98
|
[flowSchema.objType.objectType],
|
|
98
|
-
path.join(
|
|
99
|
+
path.join(appPath, 'src/schemas')
|
|
99
100
|
)
|
|
100
101
|
.then(res => res.records[0]);
|
|
101
102
|
if (!objectSchema) {
|
|
@@ -36,7 +36,7 @@ const dsqTemplatePath = path.join(__dirname, 'DsqHandlerTemplate.ejs');
|
|
|
36
36
|
* @param {Object} objectSchema
|
|
37
37
|
* @return {{templatePath, templateData,setting}}
|
|
38
38
|
*/
|
|
39
|
-
function createParamsForCreateSource(_izContext, flowSchema,
|
|
39
|
+
function createParamsForCreateSource(_izContext, flowSchema, appPath) {
|
|
40
40
|
const createSources = [];
|
|
41
41
|
const functionName = 'Process' + upperCase(flowSchema.flowTag);
|
|
42
42
|
const handlerTypeSqs = upperCase(HANDLER.hdrSqs);
|
|
@@ -52,7 +52,7 @@ function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
|
|
|
52
52
|
},
|
|
53
53
|
setting: {
|
|
54
54
|
savePath: path.join(
|
|
55
|
-
|
|
55
|
+
appPath,
|
|
56
56
|
SOURCE_PATH.flowSchema,
|
|
57
57
|
upperCase(flowSchema.flowTag),
|
|
58
58
|
'MainHandler/',
|
|
@@ -74,7 +74,7 @@ function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
|
|
|
74
74
|
},
|
|
75
75
|
setting: {
|
|
76
76
|
savePath: path.join(
|
|
77
|
-
|
|
77
|
+
appPath,
|
|
78
78
|
SOURCE_PATH.flowSchema,
|
|
79
79
|
upperCase(flowSchema.flowTag),
|
|
80
80
|
'MainHandler/',
|