@izara_project/izara-market-library-service-schemas 1.0.53 → 1.0.55
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 +2 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +1 -1
- package/src/reStructure/TemplateConfig.js +4 -1
- package/src/reStructure/TemplateData/Auth/generateAuthYml/data.js +58 -0
- package/src/reStructure/TemplateData/Auth/generateAuthYml/template.ejs +16 -0
- package/src/reStructure/TemplateData/Auth/generateTemplateData.js +51 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +2 -1
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/template.ejs +2 -1
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +2 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/template.ejs +2 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +78 -54
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +42 -22
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +44 -9
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +30 -10
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +6 -3
- package/src/reStructure/TemplateData/EndpointPerService/yaml/template.ejs +12 -16
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +22 -6
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +4 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +14 -11
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/data.js +2 -47
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +4 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +9 -13
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/EndpointComponent/mainFunction → flowSchemaMainFunction}/data.js +6 -6
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/EndpointComponent/mainFunction → flowSchemaMainFunction}/template.ejs +11 -14
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +12 -8
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +6 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/handler/template.ejs +8 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +2 -7
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +22 -24
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +11 -2
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/functionYaml/template.ejs +11 -5
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/handler/template.ejs +27 -23
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/handler/template.ejs +10 -4
- package/src/reStructure/TemplateData/flowSchema/{templateBystatusType → templateByStatusType}/storedCacheTemplate.ejs +3 -0
- package/src/reStructure/TemplateData/flowSchema/{templateBystatusType → templateByStatusType}/triggerCacheTemplate.ejs +3 -0
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +0 -1
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/data.js +10 -2
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +18 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +5 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/mainFunction/data.js +0 -75
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/mainFunction/template.ejs +0 -98
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/sqsTemplate.ejs +0 -52
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/mainFunction/data.js +0 -57
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/mainFunction/template.ejs +0 -81
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/mainFunction/data.js +0 -58
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/mainFunction/template.ejs +0 -81
- /package/src/reStructure/TemplateData/flowSchema/{templateBystatusType → templateByStatusType}/statusFieldTemplate.ejs +0 -0
package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/mainFunction/template.ejs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
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
|
|
16
|
-
<http: //www.gnu.org/licenses />.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
'use strict';
|
|
20
|
-
|
|
21
|
-
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
22
|
-
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
23
|
-
|
|
24
|
-
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
|
|
25
|
-
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
26
|
-
const sqsSharedLib = require('@izara_project/izara-core-library-sqs');
|
|
27
|
-
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
28
|
-
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
29
|
-
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
30
|
-
const storedCacheSharedLib = require('@izara_project/izara-core-library-stored-cache')
|
|
31
|
-
|
|
32
|
-
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
33
|
-
const sns = externalRequest.sns
|
|
34
|
-
const sqs = externalRequest.sqs
|
|
35
|
-
const lambda = externalRequest.lambda
|
|
36
|
-
const { postToConnection } = require("../../../libs/source/GenerateCodeLibs");
|
|
37
|
-
const utils = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Utils')
|
|
38
|
-
const NoRetryError = require('@izara_project/izara-core-library-core').NoRetryError
|
|
39
|
-
const { v4: uuidv4 } = require('uuid')
|
|
40
|
-
const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
41
|
-
const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
42
|
-
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
43
|
-
const { createFieldNamesFromRequestParamsByObjectSchema } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs.js')
|
|
44
|
-
//(<optionalRequire>)
|
|
45
|
-
//(</optionalRequire>)
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* description of function.
|
|
50
|
-
* @param {Object} _izContext
|
|
51
|
-
* @param {CorrelationIds} _izContext.correlationIds - property of _izContext
|
|
52
|
-
* @param {Logger} _izContext.logger - property of _izContext
|
|
53
|
-
* @param {Object} requestParams - request params
|
|
54
|
-
* @param {Object} requestParams.identifiers - identifiers for get data
|
|
55
|
-
* @param {Object} requestParams.additionalRequest - additionalRequest
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @returns {object} description of return value
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
module.exports.<%- functionName %> = async (
|
|
62
|
-
_izContext,
|
|
63
|
-
requestParams,
|
|
64
|
-
//(<additionalParams>)
|
|
65
|
-
//(</additionalParams>)
|
|
66
|
-
callingFlowConfig = {},
|
|
67
|
-
) => {
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
_izContext.logger.debug("<%- functionName %> _izContext", _izContext)
|
|
71
|
-
_izContext.logger.debug("<%- functionName %> requestParams", requestParams)
|
|
72
|
-
_izContext.logger.debug("<%- functionName %> callingFlowConfig", callingFlowConfig)
|
|
73
|
-
|
|
74
|
-
let correlationId = _izContext.correlationIds.get(consts.X_CORRELATION_ID)
|
|
75
|
-
let connectionId = _izContext.correlationIds.get(consts.CONNECTION_ID);
|
|
76
|
-
|
|
77
|
-
<% if (statusType === "statusField") { %>
|
|
78
|
-
<%- include(statusFieldTemplate) %>
|
|
79
|
-
<% } else if (statusType === "storedCache") { %>
|
|
80
|
-
<%- include(storedCacheTemplate, {tableName:tableName,flowSchemaComplete:flowSchemaComplete}) %>
|
|
81
|
-
|
|
82
|
-
<% } else if (statusType === "triggerCache") { %>
|
|
83
|
-
<%- include(triggerCacheTemplate, {
|
|
84
|
-
tableName: tableName,
|
|
85
|
-
flowSchemaComplete: flowSchemaComplete,
|
|
86
|
-
triggerType: triggerType
|
|
87
|
-
}) %>
|
|
88
|
-
<% } %>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
//(<endpointHook>)
|
|
92
|
-
//(</endpointHook>)
|
|
93
|
-
|
|
94
|
-
} catch (err) {
|
|
95
|
-
_izContext.logger.error('error WebSocketInvoke: ', err)
|
|
96
|
-
throw (err)
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
##===== [subsription to topic In]
|
|
2
|
-
Subscription<%- queueName-%>:
|
|
3
|
-
Type: AWS::SNS::Subscription
|
|
4
|
-
Properties:
|
|
5
|
-
TopicArn: !Ref <%- subScription %>
|
|
6
|
-
Endpoint: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>"
|
|
7
|
-
Protocol: "sqs"
|
|
8
|
-
##===== [Queue]
|
|
9
|
-
<%- queueName %>:
|
|
10
|
-
Type: "AWS::SQS::Queue"
|
|
11
|
-
Properties:
|
|
12
|
-
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
13
|
-
RedrivePolicy:
|
|
14
|
-
deadLetterTargetArn:
|
|
15
|
-
# !GetAtt
|
|
16
|
-
Fn::GetAtt:
|
|
17
|
-
- <%- queueName %>DLQ
|
|
18
|
-
- Arn
|
|
19
|
-
maxReceiveCount: 3
|
|
20
|
-
VisibilityTimeout: 120
|
|
21
|
-
##==== [QueueDLQ]
|
|
22
|
-
<%- queueName %>DLQ:
|
|
23
|
-
Type: AWS::SQS::Queue
|
|
24
|
-
Properties:
|
|
25
|
-
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
|
|
26
|
-
##==== [QueuePolicy]
|
|
27
|
-
<%- queueName %>Policy:
|
|
28
|
-
Type: AWS::SQS::QueuePolicy
|
|
29
|
-
Properties:
|
|
30
|
-
PolicyDocument:
|
|
31
|
-
Version: "2012-10-17"
|
|
32
|
-
Statement:
|
|
33
|
-
- Sid: "allow-sns-messages"
|
|
34
|
-
Effect: Allow
|
|
35
|
-
Principal: "*"
|
|
36
|
-
Resource:
|
|
37
|
-
# !GetAtt
|
|
38
|
-
Fn::GetAtt:
|
|
39
|
-
- <%- queueName %>
|
|
40
|
-
- Arn
|
|
41
|
-
Action: "SQS:SendMessage"
|
|
42
|
-
Queues:
|
|
43
|
-
- Ref: <%- queueName %>
|
|
44
|
-
#<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
45
|
-
#<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
46
|
-
|
|
47
|
-
<%_ function firstLetterUpperCase(text){
|
|
48
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
49
|
-
} _%>
|
|
50
|
-
<%_ function firstLetterLowerCase(str) {
|
|
51
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
52
|
-
} _%>
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
const path = require('path');
|
|
20
|
-
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas').getObjectSchema
|
|
21
|
-
const { SOURCE_PATH, FUNCTION_NAME, HANDLER } = require('../../../../../../MainLibs/src/Consts');
|
|
22
|
-
const { STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
23
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
24
|
-
const templatePath = path.join(__dirname, "./template.ejs");
|
|
25
|
-
const statusFieldTemplate = path.join(__dirname, "../../../templateBystatusType/statusFieldTemplate.ejs")
|
|
26
|
-
const storedCacheTemplate = path.join(__dirname, "../../../templateBystatusType/storedCacheTemplate.ejs")
|
|
27
|
-
const triggerCacheTemplate = path.join(__dirname, "../../../templateBystatusType/triggerCacheTemplate.ejs");
|
|
28
|
-
/**
|
|
29
|
-
* receive objectSchema
|
|
30
|
-
* create data for WebScoket handler template
|
|
31
|
-
*
|
|
32
|
-
* @param {Object} objectSchema
|
|
33
|
-
* @return {{templatePath, templateData,setting}}
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
function data(_izContext, flowSchema, srcPath) {
|
|
38
|
-
return createParamsForCreateSource(_izContext, flowSchema, srcPath)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
|
|
42
|
-
let functionName = upperCase(flowSchema.flowTag);
|
|
43
|
-
return {
|
|
44
|
-
templatePath: templatePath,
|
|
45
|
-
templateData: {
|
|
46
|
-
flowTag: flowSchema.flowTag,
|
|
47
|
-
functionName,
|
|
48
|
-
},
|
|
49
|
-
setting: {
|
|
50
|
-
savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), "source/"),
|
|
51
|
-
saveFileName: `${functionName}_Main`,
|
|
52
|
-
fileExtension: ".js",
|
|
53
|
-
isAppend: false
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
module.exports = data
|
|
@@ -1,81 +0,0 @@
|
|
|
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
|
|
16
|
-
<http: //www.gnu.org/licenses />.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
'use strict';
|
|
20
|
-
|
|
21
|
-
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
22
|
-
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
23
|
-
|
|
24
|
-
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
|
|
25
|
-
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
26
|
-
const sqsSharedLib = require('@izara_project/izara-core-library-sqs');
|
|
27
|
-
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
28
|
-
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
29
|
-
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
30
|
-
const storedCacheSharedLib = require('@izara_project/izara-core-library-stored-cache')
|
|
31
|
-
|
|
32
|
-
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
33
|
-
const sns = externalRequest.sns
|
|
34
|
-
const sqs = externalRequest.sqs
|
|
35
|
-
const lambda = externalRequest.lambda
|
|
36
|
-
const { postToConnection } = require("../../../libs/source/GenerateCodeLibs");
|
|
37
|
-
const utils = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Utils')
|
|
38
|
-
const NoRetryError = require('@izara_project/izara-core-library-core').NoRetryError
|
|
39
|
-
const { v4: uuidv4 } = require('uuid')
|
|
40
|
-
const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
41
|
-
const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
42
|
-
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
43
|
-
const { createFieldNamesFromRequestParamsByObjectSchema } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs.js')
|
|
44
|
-
//(<optionalRequire>)
|
|
45
|
-
//(</optionalRequire>)
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* description of function.
|
|
50
|
-
* @param {Object} _izContext
|
|
51
|
-
* @param {CorrelationIds} _izContext.correlationIds - property of _izContext
|
|
52
|
-
* @param {Logger} _izContext.logger - property of _izContext
|
|
53
|
-
* @param {Object} requestParams - request params
|
|
54
|
-
* @param {Object} requestParams.identifiers - identifiers for get data
|
|
55
|
-
* @param {Object} requestParams.additionalRequest - additionalRequest
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @returns {object} description of return value
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
module.exports.<%- functionName %>Main = async (
|
|
62
|
-
_izContext,
|
|
63
|
-
requestParams,
|
|
64
|
-
callingFlowConfig = {},
|
|
65
|
-
//(<additionalParams>)
|
|
66
|
-
//(</additionalParams>)
|
|
67
|
-
) => {
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
_izContext.logger.debug("<%- functionName %>Main _izContext", _izContext)
|
|
71
|
-
_izContext.logger.debug("<%- functionName %>Main requestParams", requestParams)
|
|
72
|
-
_izContext.logger.debug("<%- functionName %>Main callingFlowConfig", callingFlowConfig)
|
|
73
|
-
|
|
74
|
-
//(<endpointHook>)
|
|
75
|
-
//(</endpointHook>)
|
|
76
|
-
|
|
77
|
-
} catch (err) {
|
|
78
|
-
_izContext.logger.error('error WebSocketInvoke: ', err)
|
|
79
|
-
throw (err)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
const path = require('path');
|
|
20
|
-
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas').getObjectSchema
|
|
21
|
-
const { SOURCE_PATH, FUNCTION_NAME, HANDLER } = require('../../../../../../MainLibs/src/Consts');
|
|
22
|
-
const { STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
23
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
24
|
-
const templatePath = path.join(__dirname, "./template.ejs");
|
|
25
|
-
const statusFieldTemplate = path.join(__dirname, "../../../templateBystatusType/statusFieldTemplate.ejs")
|
|
26
|
-
const storedCacheTemplate = path.join(__dirname, "../../../templateBystatusType/storedCacheTemplate.ejs")
|
|
27
|
-
const triggerCacheTemplate = path.join(__dirname, "../../../templateBystatusType/triggerCacheTemplate.ejs");
|
|
28
|
-
/**
|
|
29
|
-
* receive objectSchema
|
|
30
|
-
* create data for WebScoket handler template
|
|
31
|
-
*
|
|
32
|
-
* @param {Object} objectSchema
|
|
33
|
-
* @return {{templatePath, templateData,setting}}
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
function data(_izContext, flowSchema, srcPath) {
|
|
38
|
-
return createParamsForCreateSource(_izContext, flowSchema, srcPath)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
|
|
42
|
-
let functionName = upperCase(flowSchema.flowTag);
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
templatePath: templatePath,
|
|
46
|
-
templateData: {
|
|
47
|
-
flowTag: flowSchema.flowTag,
|
|
48
|
-
functionName,
|
|
49
|
-
},
|
|
50
|
-
setting: {
|
|
51
|
-
savePath: path.join(srcPath, SOURCE_PATH.flowSchema, upperCase(flowSchema.flowTag), "source/"),
|
|
52
|
-
saveFileName: `${functionName}_Main`,
|
|
53
|
-
fileExtension: ".js",
|
|
54
|
-
isAppend: false
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
module.exports = data
|
|
@@ -1,81 +0,0 @@
|
|
|
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
|
|
16
|
-
<http: //www.gnu.org/licenses />.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
'use strict';
|
|
20
|
-
|
|
21
|
-
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
22
|
-
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
|
|
23
|
-
|
|
24
|
-
const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
|
|
25
|
-
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
26
|
-
const sqsSharedLib = require('@izara_project/izara-core-library-sqs');
|
|
27
|
-
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
28
|
-
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
29
|
-
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
30
|
-
const storedCacheSharedLib = require('@izara_project/izara-core-library-stored-cache')
|
|
31
|
-
|
|
32
|
-
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
33
|
-
const sns = externalRequest.sns
|
|
34
|
-
const sqs = externalRequest.sqs
|
|
35
|
-
const lambda = externalRequest.lambda
|
|
36
|
-
const { postToConnection } = require("../../../libs/source/GenerateCodeLibs");
|
|
37
|
-
const utils = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Utils')
|
|
38
|
-
const NoRetryError = require('@izara_project/izara-core-library-core').NoRetryError
|
|
39
|
-
const { v4: uuidv4 } = require('uuid')
|
|
40
|
-
const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
41
|
-
const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
42
|
-
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
43
|
-
const { createFieldNamesFromRequestParamsByObjectSchema } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs.js')
|
|
44
|
-
//(<optionalRequire>)
|
|
45
|
-
//(</optionalRequire>)
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* description of function.
|
|
50
|
-
* @param {Object} _izContext
|
|
51
|
-
* @param {CorrelationIds} _izContext.correlationIds - property of _izContext
|
|
52
|
-
* @param {Logger} _izContext.logger - property of _izContext
|
|
53
|
-
* @param {Object} requestParams - request params
|
|
54
|
-
* @param {Object} requestParams.identifiers - identifiers for get data
|
|
55
|
-
* @param {Object} requestParams.additionalRequest - additionalRequest
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @returns {object} description of return value
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
module.exports.<%- functionName %>Main = async (
|
|
62
|
-
_izContext,
|
|
63
|
-
requestParams,
|
|
64
|
-
callingFlowConfig = {},
|
|
65
|
-
//(<additionalParams>)
|
|
66
|
-
//(</additionalParams>)
|
|
67
|
-
) => {
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
_izContext.logger.debug("<%- functionName %>Main _izContext", _izContext)
|
|
71
|
-
_izContext.logger.debug("<%- functionName %>Main requestParams", requestParams)
|
|
72
|
-
_izContext.logger.debug("<%- functionName %>Main callingFlowConfig", callingFlowConfig)
|
|
73
|
-
|
|
74
|
-
//(<endpointHook>)
|
|
75
|
-
//(</endpointHook>)
|
|
76
|
-
|
|
77
|
-
} catch (err) {
|
|
78
|
-
_izContext.logger.error('error WebSocketInvoke: ', err)
|
|
79
|
-
throw (err)
|
|
80
|
-
}
|
|
81
|
-
}
|