@izara_project/izara-market-library-service-schemas 1.0.36 → 1.0.38

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.
Files changed (150) hide show
  1. package/package.json +8 -7
  2. package/src/GenerateCodeLibs/src/Consts.js +2 -2
  3. package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +36 -6
  4. package/src/MainLibs/src/Consts.js +5 -2
  5. package/src/MainLibs/src/GenerateCodeUtils.js +3 -1
  6. package/src/MainLibs/src/Utils.js +12 -0
  7. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/handler/template.ejs +1 -1
  8. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/template.ejs +1 -1
  9. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +1 -1
  10. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/mainFunction/template.ejs +1 -1
  11. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +1 -1
  12. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +1 -1
  13. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +1 -1
  14. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +1 -1
  15. package/src/reStructure/GenerateCode.js +2 -2
  16. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +1 -1
  17. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +37 -12
  18. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +25 -2
  19. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +26 -0
  20. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +23 -1
  21. package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +37 -7
  22. package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +7 -7
  23. package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +1 -1
  24. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +4 -2
  25. package/src/reStructure/TemplateData/findData/GetByStorage/getByGraph.ejs +4 -3
  26. package/src/reStructure/TemplateData/findData/handler/template.ejs +2 -1
  27. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +4 -10
  28. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +1 -1
  29. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +3 -1
  30. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +3 -2
  31. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +3 -12
  32. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +6 -2
  33. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +18 -2
  34. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +1 -1
  35. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +9 -6
  36. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +2 -2
  37. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +3 -3
  38. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/template.ejs +1 -1
  39. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +2 -2
  40. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +2 -2
  41. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +1 -1
  42. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js +1 -1
  43. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +1 -1
  44. package/src/reStructure/TemplateData/flowSchema/externalTopic/functionYaml/data.js +127 -0
  45. package/src/reStructure/TemplateData/flowSchema/externalTopic/handler/data.js +121 -0
  46. package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/FlowSchemaCompleteComponent → externalTopic}/handler/template.ejs +4 -3
  47. package/src/reStructure/TemplateData/flowSchema/externalTopic/mainFunction/data.js +74 -0
  48. package/src/reStructure/TemplateData/flowSchema/externalTopic/mainFunction/template.ejs +131 -0
  49. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +61 -34
  50. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +1 -1
  51. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +9 -8
  52. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +3 -2
  53. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +19 -8
  54. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +19 -25
  55. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +2 -4
  56. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +1 -1
  57. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +2 -5
  58. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +4 -3
  59. package/src/reStructure/TemplateData/flowSchema/{externalTopic/sqs → flowSchemaOwnTopic/flowStep}/functionYaml/data.js +43 -38
  60. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowStep/functionYaml/template.ejs +20 -0
  61. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowStep/handler/data.js +80 -0
  62. package/src/reStructure/TemplateData/flowSchema/{externalTopic/sqs → flowSchemaOwnTopic/flowStep}/handler/template.ejs +16 -61
  63. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowStep/mainFunction/data.js +92 -0
  64. package/src/reStructure/TemplateData/flowSchema/{externalTopic/websocket → flowSchemaOwnTopic/flowStep}/mainFunction/template.ejs +12 -14
  65. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +48 -30
  66. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +21 -24
  67. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{FlowSchemaCompleteComponent → webSocketComplete}/functionYaml/data.js +7 -22
  68. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/webSocketComplete/functionYaml/template.ejs +20 -0
  69. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{FlowSchemaCompleteComponent → webSocketComplete}/handler/data.js +2 -2
  70. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/webSocketComplete/handler/template.ejs +84 -0
  71. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{FlowSchemaCompleteComponent → webSocketComplete}/mainFunction/data.js +2 -2
  72. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/{FlowSchemaCompleteComponent → webSocketComplete}/mainFunction/template.ejs +27 -11
  73. package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +25 -30
  74. package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/complete/functionYaml/data.js +0 -27
  75. package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/complete/handler/template.ejs +1 -1
  76. package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/complete/mainFunction/data.js +3 -3
  77. package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +172 -0
  78. package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/dynamoDB/register.js +1 -1
  79. package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/subscriptionOutAll/data.js +29 -19
  80. package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/wbs/functionYaml/data.js +28 -50
  81. package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/wbs/handler/template.ejs +1 -1
  82. package/src/reStructure/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +165 -0
  83. package/src/reStructure/TemplateData/flowSchema/templateBystatusType/storedCacheTemplate.ejs +38 -0
  84. package/src/reStructure/TemplateData/flowSchema/templateBystatusType/triggerCacheTemplate.ejs +39 -0
  85. package/src/reStructure/TemplateData/generateRole/sharedResourceTemplate.ejs +0 -29
  86. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +1 -1
  87. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +1 -1
  88. package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +1 -1
  89. package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +4 -1
  90. package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +6 -2
  91. package/src/reStructure/TemplateData/perActionEndpoint/libs/template.ejs +1 -1
  92. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +1 -1
  93. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +1 -1
  94. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +1 -1
  95. package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +2 -7
  96. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +22 -3
  97. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +14 -9
  98. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +26 -6
  99. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +11 -7
  100. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +1 -1
  101. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +17 -7
  102. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +1 -1
  103. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +23 -4
  104. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +14 -9
  105. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +26 -6
  106. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +10 -7
  107. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +1 -1
  108. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +11 -7
  109. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +1 -1
  110. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +23 -4
  111. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +14 -9
  112. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +26 -7
  113. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +10 -7
  114. package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +1 -2
  115. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +12 -7
  116. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +1 -1
  117. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +22 -3
  118. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +14 -6
  119. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +20 -3
  120. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +9 -3
  121. package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +1 -1
  122. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +12 -6
  123. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +1 -1
  124. package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +6 -2
  125. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/complete/mainFunction/template.ejs +0 -131
  126. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/storedCacheTemplate.ejs +0 -11
  127. package/src/reStructure/TemplateData/flowSchema/createRecordByStatusType/wbs/mainFunction/template.ejs +0 -222
  128. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +0 -74
  129. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/template.ejs +0 -8
  130. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/template.ejs +0 -17
  131. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/data.js +0 -64
  132. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/data.js +0 -61
  133. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/template.ejs +0 -45
  134. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +0 -110
  135. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/template.ejs +0 -18
  136. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/data.js +0 -57
  137. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/template.ejs +0 -40
  138. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +0 -67
  139. package/src/reStructure/TemplateData/testTemplate/data.js +0 -27
  140. package/src/reStructure/TemplateData/testTemplate/template.ejs +0 -0
  141. /package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/FlowSchemaCompleteComponent → externalTopic}/functionYaml/template.ejs +0 -0
  142. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/complete/functionYaml/template.ejs +0 -0
  143. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/complete/handler/data.js +0 -0
  144. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/sns-in/data.js +0 -0
  145. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/sns-in/template.ejs +0 -0
  146. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/subscriptionOutAll/template.ejs +0 -0
  147. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/wbs/functionYaml/template.ejs +0 -0
  148. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/wbs/handler/data.js +0 -0
  149. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → register}/wbs/mainFunction/data.js +0 -0
  150. /package/src/reStructure/TemplateData/flowSchema/{createRecordByStatusType → templateBystatusType}/statusFieldTemplate.ejs +0 -0
@@ -0,0 +1,74 @@
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
+
21
+ const { SOURCE_PATH, FUNCTION_NAME, HANDLER } = require('../../../../../MainLibs/src/Consts');
22
+
23
+ const { firstLetterUpperCase: upperCase } = require('../../../../../MainLibs/src/Utils')
24
+ const templatePath = path.join(__dirname, "template.ejs");
25
+ const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
26
+ const { STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
27
+ const statusFieldTemplate = path.join(__dirname, "../../createRecordByStatusType/statusFieldTemplate.ejs")
28
+ const storedCacheTemplate = path.join(__dirname, "../../createRecordByStatusType/storedCacheTemplate.ejs")
29
+
30
+ /**
31
+ * receive objectSchema
32
+ * create data for WebScoket handler template
33
+ *
34
+ * @param {Object} objectSchema
35
+ * @return {{templatePath, templateData,setting}}
36
+ */
37
+
38
+
39
+ async function data(_izContext, flowSchema, srcPath) {
40
+ return [await createParamsForCreateSource(_izContext, flowSchema, srcPath)]
41
+ }
42
+
43
+ async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
44
+ let functionName = "Process" + upperCase(flowSchema.flowTag);
45
+ let tableName = null;
46
+ if (flowSchema.statusType === "storedCache") {
47
+ let objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], path.join(srcPath, "./schemas")).then(res => res.records[0]);
48
+ for (const storageResource of Object.values(objectSchema.storageResources)) {
49
+ if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
50
+ tableName = storageResource.tableName
51
+ }
52
+ }
53
+ }
54
+ let flowSchemaComplete = upperCase(flowSchema.flowTag) + "Complete"
55
+ return {
56
+ templatePath: templatePath,
57
+ templateData: {
58
+ statusType: flowSchema.statusType,
59
+ statusFieldTemplate,
60
+ storedCacheTemplate,
61
+ flowTag: flowSchema.flowTag,
62
+ functionName,
63
+ tableName,
64
+ flowSchemaComplete
65
+ },
66
+ setting: {
67
+ savePath: path.join(srcPath, SOURCE_PATH.flowSchema, flowSchema.flowTag, "source/"),
68
+ saveFileName: `${functionName}_Main`,
69
+ fileExtension: ".js",
70
+ isAppend: false
71
+ }
72
+ }
73
+ }
74
+ module.exports = data
@@ -0,0 +1,131 @@
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
+ callingFlowConfig = {},
65
+ //(<additionalParams>)
66
+ //(</additionalParams>)
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
+ //(<endpointHookMainFunction>)
78
+ //(</endpointHookMainFunction>)
79
+
80
+ const flowSchema = await getObjectSchema.getFlowSchemaS3WithCache(_izContext, {
81
+ flowTag: requestParams.action,
82
+ serviceTag: process.env.iz_serviceTag
83
+ })
84
+
85
+ <% if (statusType === "statusField") { %>
86
+ <%- include(statusFieldTemplate) %>
87
+ <% } else if (statusType === "storedCache") { %>
88
+ <%- include(storedCacheTemplate, {tableName:tableName}) %>
89
+ let messageObject = requestParams
90
+
91
+ //(<beforeSendMessage>)
92
+ //(</beforeSendMessage>)
93
+ // create callingFlow
94
+ messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
95
+ messageObject,
96
+ callingFlowSharedLib.addParentCallingFlowConfig(
97
+ callingFlowConfig,
98
+ callingFlowSharedLib.createCallingFlowConfig(
99
+ await lambdaSharedLib.lambdaFunctionName(_izContext, "<%- flowSchemaComplete %>"), {}
100
+ )
101
+ )
102
+ )
103
+
104
+ <% } else if (statusType === "none") { %>
105
+
106
+ let messageObject = requestParams
107
+
108
+ // create callingFlow
109
+ messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
110
+ messageObject,
111
+ callingFlowSharedLib.addParentCallingFlowConfig(
112
+ callingFlowConfig,
113
+ callingFlowSharedLib.createCallingFlowConfig(
114
+ await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.flowSchemaOwnTopicComplete), {}
115
+ )
116
+ )
117
+ )
118
+ <% } %>
119
+
120
+ //(<endpointHook>)
121
+ //(</endpointHook>)
122
+
123
+ return {
124
+ //(<endpointReturn>)
125
+ //(</endpointReturn>)
126
+ }
127
+ } catch (err) {
128
+ _izContext.logger.error('error WebSocketInvoke: ', err)
129
+ throw (err)
130
+ }
131
+ }
@@ -19,21 +19,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
 
20
20
  const path = require("path")
21
21
 
22
- const templatePath = path.join(__dirname, './template.ejs');
23
-
24
- const {
25
- firstLetterLowerCase: lowerCase,
26
- firstLetterUpperCase: upperCase,
27
- firstLetterUpperCase,
28
- } = require("../../../../../MainLibs/src/Utils");
29
- const {
30
- DEFAULT_HANDLER_PER_ACTION,
31
- SOURCE_PATH,
32
- FUNCTION_NAME,
33
- SAVE_FILE_NAME,
34
- SOURCE_GENERATE_IAM_ROLE,
35
- HANDLER,
36
- } = require("../../../../../MainLibs/src/Consts");
22
+
23
+ // const {
24
+ // HANDLER,
25
+ // STORAGE_TYPES
26
+ // } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
27
+
28
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils.js");
29
+ const STORAGE_TYPES = {
30
+ dynamoDB: "dynamoDB",
31
+ graph: "graph"
32
+ }
33
+
34
+ const snsTemplatePath = path.join(__dirname, '/template.ejs');
35
+ const subscriptionSqsTemplatePath = path.join(__dirname, './sqsTemplate.ejs');
36
+
37
+ const { SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, HANDLER } = require('../../../../../MainLibs/src/Consts.js');
37
38
 
38
39
  /**
39
40
  * create data for dynamoDbYaml tempalte from objectSchema
@@ -45,25 +46,51 @@ const {
45
46
  * @returns {Object[]} - data of multiple dynamoDb template
46
47
  */
47
48
 
48
- function data(_izContext, flowSchema, srcPath) {
49
- const flowStepSplitKeyOut = Object.keys(flowSchema.flowSteps)[1].split("_");
50
- // console.log({ flowStepSplitKey })
51
- let queueName = upperCase(flowSchema.flowTag) + "ExternalTopicOut" + upperCase(HANDLER.hdrSqs)
52
- return [{
53
- templatePath,
54
- templateData: {
55
- queueName: upperCase(queueName),
56
- roleName: SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole,
57
- firstLetterUpperCase: upperCase
58
- },
59
- setting: {
60
- initialData: "Resource\n",
61
- savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
62
- saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
63
- fileExtension: ".yml",
64
- isAppend: true
49
+ function createDataForDefaultSnsInSqs(_izContext, flowSchema, srcPath) {
50
+ let resultsForCreateDefaultSnsInSqs = [];
51
+ let flowSteps = Object.keys(flowSchema.flowSteps);
52
+ const setting = {
53
+ initialData: "Resources:\n",
54
+ savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
55
+ saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
56
+ fileExtension: ".yml",
57
+ isAppend: true
58
+ }
59
+
60
+ let topicIn = `${upperCase(flowSchema.flowTag)}`;
61
+
62
+ const generatedSnsTopicInForFlowSchema = [];
63
+ if (flowSteps.includes("In")) {
64
+ generatedSnsTopicInForFlowSchema.push(
65
+ {
66
+ queueName: "Process" + upperCase(topicIn) + upperCase(HANDLER.hdrSqs)
67
+
68
+ }
69
+ )
70
+ }
71
+
72
+
73
+
74
+ if (flowSchema.outputTopic) {
75
+ if (flowSteps.includes("Out")) {
76
+ let topicOut = `${upperCase(flowSchema.flowTag)}`;
77
+ defaultDsqQueueDataList.push({
78
+ queueName: `WebSocketComplete` + upperCase(HANDLER.hdrSqs),
79
+ subscribeTo: topicOut
80
+ }
81
+ )
65
82
  }
66
- }]
83
+ }
84
+
85
+ for (let defaultSnsInSqsData of generatedSnsTopicInForFlowSchema) {
86
+ resultsForCreateDefaultSnsInSqs.push({
87
+ templatePath: snsTemplatePath,
88
+ templateData: defaultSnsInSqsData,
89
+ setting: setting
90
+ })
91
+ }
92
+
93
+ return resultsForCreateDefaultSnsInSqs;
67
94
  }
68
95
 
69
- module.exports = data
96
+ module.exports = createDataForDefaultSnsInSqs;
@@ -1,4 +1,3 @@
1
- ##===== ExternalTopic
2
1
  ##===== [Queue]
3
2
  <%- queueName %>:
4
3
  Type: "AWS::SQS::Queue"
@@ -45,3 +44,4 @@
45
44
  <%_ function firstLetterLowerCase(str) {
46
45
  return str.charAt(0).toLowerCase() + str.slice(1)
47
46
  } _%>
47
+
@@ -37,6 +37,7 @@ const {
37
37
  LAMBDA_RESOURCE
38
38
  } = require('../../../../../../MainLibs/src/Consts');
39
39
  const { TOPIC_NAME_GENERATE_CODE } = require('../../../../../../GenerateCodeLibs/src/Consts');
40
+ const { NoRetryError } = require('@izara_project/izara-core-library-core');
40
41
  const getObjectSchema = require('@izara_project/izara-core-library-service-schemas').getObjectSchema;
41
42
 
42
43
  const templatePath = path.join(__dirname, "template.ejs");
@@ -56,18 +57,16 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
56
57
  let functionName = "Process" + upperCase(flowSchema.flowTag)
57
58
  let handlerType = upperCase(HANDLER.hdrSqs)
58
59
  let additionalResourcePermission = defaultIamRolePerAction();
59
- let route = flowSchema.flowTag;
60
- let flowSteps = Object.keys(flowSchema.flowSteps)
61
- let flowStepsIn = flowSteps[0];
62
- let splitFlowStepsOut = flowStepsIn.split("_");
63
- let queueName = splitFlowStepsOut[3] + handlerType
60
+ let route = upperCase(flowSchema.flowTag);
61
+ let queueName = "Process" + upperCase(flowSchema.flowTag) + handlerType;
64
62
  additionalResourcePermission.push(
65
63
  createIamRole(
66
64
  {
67
65
  [RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
68
66
  },
69
67
  [
70
- resourceNames(RESOURCE_CLASSES.sqs, queueName)
68
+ resourceNames(RESOURCE_CLASSES.sqs, queueName),
69
+ resourceNames(RESOURCE_CLASSES.sqs, queueName + "DLQ")
71
70
  ]
72
71
  ),
73
72
  createIamRole(
@@ -82,8 +81,10 @@ async function createSourceParams(_izContext, flowSchema, srcPath) {
82
81
 
83
82
  if (flowSchema.statusType === "storedCache") {
84
83
  let tableStroedCaches = [];
85
- const objectSchemaPath = path.join(srcPath, "./schemas")
86
- let objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], objectSchemaPath).then(res => res.records[0])
84
+ let objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], path.join(srcPath, "./schemas")).then(res => res.records[0])
85
+ if (!objectSchema) {
86
+ throw new NoRetryError('ObjectSchema not found')
87
+ }
87
88
  for (const storageResource of Object.values(objectSchema.storageResources)) {
88
89
  if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
89
90
  if (!tableStroedCaches.includes(storageResource.tableName)) {
@@ -38,8 +38,9 @@ function data(_izContext, flowSchema, srcPath) {
38
38
  function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
39
39
  let functionName = "Process" + upperCase(flowSchema.flowTag)
40
40
  let handlerType = upperCase(HANDLER.hdrSqs)
41
- let route = flowSchema.flowTag;
42
- let queueName = functionName
41
+ let route = upperCase(flowSchema.flowTag);
42
+ let queueName = `Process${upperCase(flowSchema.flowTag)}${upperCase(handlerType)}`
43
+
43
44
  return {
44
45
  templatePath: templatePath,
45
46
  templateData: {
@@ -23,8 +23,9 @@ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = req
23
23
  const templatePath = path.join(__dirname, "template.ejs");
24
24
  const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
25
25
  const { STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
26
- const statusFieldTemplate = path.join(__dirname, "../../../createRecordByStatusType/statusFieldTemplate.ejs")
27
- const storedCacheTemplate = path.join(__dirname, "../../../createRecordByStatusType/storedCacheTemplate.ejs")
26
+ const statusFieldTemplate = path.join(__dirname, "../../../templateBystatusType/statusFieldTemplate.ejs")
27
+ const storedCacheTemplate = path.join(__dirname, "../../../templateBystatusType/storedCacheTemplate.ejs")
28
+ const triggerCacheTemplate = path.join(__dirname, "../../../templateBystatusType/triggerCacheTemplate.ejs")
28
29
 
29
30
  /**
30
31
  * receive objectSchema
@@ -41,24 +42,34 @@ async function data(_izContext, flowSchema, srcPath) {
41
42
 
42
43
  async function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
43
44
  let functionName = "Process" + upperCase(flowSchema.flowTag);
44
- let tableName;
45
- let objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], path.join(srcPath, "./schemas")).then(res => res.records[0]);
46
- for (const storageResource of Object.values(objectSchema.storageResources)) {
47
- if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
48
- tableName = storageResource.tableName
45
+ let tableName = null;
46
+ if (flowSchema.statusType === "storedCache" || flowSchema.statusType === "triggerCache") {
47
+ let objectSchema = await getObjectSchema.getLocalObjectSchemas(_izContext, [flowSchema.objType.objectType], path.join(srcPath, "./schemas")).then(res => res.records[0]);
48
+ for (const storageResource of Object.values(objectSchema.storageResources)) {
49
+ if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
50
+ tableName = storageResource.tableName
51
+ }
49
52
  }
50
53
  }
54
+
55
+ let triggerType;
56
+ if (flowSchema.statusType === "triggerCache" && flowSchema.hasOwnProperty("triggerType")) {
57
+ triggerType = flowSchema.triggerType;
58
+ }
51
59
  let flowSchemaComplete = upperCase(flowSchema.flowTag) + "Complete"
60
+
52
61
  return {
53
62
  templatePath: templatePath,
54
63
  templateData: {
55
64
  statusType: flowSchema.statusType,
56
65
  statusFieldTemplate,
57
66
  storedCacheTemplate,
67
+ triggerCacheTemplate,
58
68
  flowTag: flowSchema.flowTag,
59
69
  functionName,
60
70
  tableName,
61
- flowSchemaComplete
71
+ flowSchemaComplete,
72
+ triggerType
62
73
  },
63
74
  setting: {
64
75
  savePath: path.join(srcPath, SOURCE_PATH.flowSchema, flowSchema.flowTag, "source/"),
@@ -18,7 +18,7 @@ along with this program. If not, see
18
18
 
19
19
  'use strict';
20
20
 
21
- const hash = require("object-hash");
21
+ const hash = require('@izara_project/izara-shared-core').objectHash;
22
22
  const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
23
23
 
24
24
  const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
@@ -27,12 +27,13 @@ const sqsSharedLib = require('@izara_project/izara-core-library-sqs');
27
27
  const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
28
28
  const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
29
29
  const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
30
-
30
+ const storedCacheSharedLib = require('@izara_project/izara-core-library-stored-cache')
31
+ const triggeredCacheSharedLib = require('@izara_project/izara-core-library-trigger-cache')
31
32
  const externalRequest = require('@izara_project/izara-core-library-external-request');
32
33
  const sns = externalRequest.sns
33
34
  const sqs = externalRequest.sqs
34
35
  const lambda = externalRequest.lambda
35
- const { postToConnection } = require("../../../../libs/source/GenerateCodeLibs");
36
+ const { postToConnection } = require("../../../libs/source/GenerateCodeLibs");
36
37
  const utils = require('@izara_project/izara-market-library-service-schemas/src/MainLibs/src/Utils')
37
38
  const NoRetryError = require('@izara_project/izara-core-library-core').NoRetryError
38
39
  const { v4: uuidv4 } = require('uuid')
@@ -40,7 +41,8 @@ const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
40
41
  const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
41
42
  const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
42
43
  const { createFieldNamesFromRequestParamsByObjectSchema } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs.js')
43
-
44
+ //(<optionalRequire>)
45
+ //(</optionalRequire>)
44
46
  /**
45
47
  *
46
48
  *
@@ -69,36 +71,21 @@ module.exports.<%- functionName %> = async (
69
71
  _izContext.logger.debug("<%- functionName %> requestParams", requestParams)
70
72
  _izContext.logger.debug("<%- functionName %> callingFlowConfig", callingFlowConfig)
71
73
 
72
- let correlationId = _izContext.correlationIds.get(consts.X_CORRELATION_ID)
73
- let connectionId = _izContext.correlationIds.get(consts.CONNECTION_ID);
74
-
75
- //(<endpointHookMainFunction>)
76
- //(</endpointHookMainFunction>)
74
+ _izContext.correlationIds.get(consts.X_CORRELATION_ID)
75
+ _izContext.correlationIds.get(consts.CONNECTION_ID);
77
76
 
78
77
  const flowSchema = await getObjectSchema.getFlowSchemaS3WithCache(_izContext, {
79
78
  flowTag: requestParams.action,
80
79
  serviceTag: process.env.iz_serviceTag
81
80
  })
82
81
 
82
+ //(<endpointHookMainFunction>)
83
+ //(</endpointHookMainFunction>)
84
+
83
85
  <% if (statusType === "statusField") { %>
84
86
  <%- include(statusFieldTemplate) %>
85
87
  <% } else if (statusType === "storedCache") { %>
86
- <%- include(storedCacheTemplate, {tableName:tableName}) %>
87
- let messageObject = requestParams
88
-
89
- //(<beforeSendMessage>)
90
- //(</beforeSendMessage>)
91
- // create callingFlow
92
- messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
93
- messageObject,
94
- callingFlowSharedLib.addParentCallingFlowConfig(
95
- callingFlowConfig,
96
- callingFlowSharedLib.createCallingFlowConfig(
97
- await lambdaSharedLib.lambdaFunctionName(_izContext, "<%- flowSchemaComplete %>"), {}
98
- )
99
- )
100
- )
101
-
88
+ <%- include(storedCacheTemplate, {tableName:tableName,flowSchemaComplete:flowSchemaComplete}) %>
102
89
  <% } else if (statusType === "none") { %>
103
90
 
104
91
  let messageObject = requestParams
@@ -113,8 +100,15 @@ module.exports.<%- functionName %> = async (
113
100
  )
114
101
  )
115
102
  )
103
+ <% } else if (statusType === "triggerCache") { %>
104
+ <%- include(triggerCacheTemplate, {
105
+ tableName: tableName,
106
+ flowSchemaComplete: flowSchemaComplete,
107
+ triggerType: triggerType
108
+ }) %>
116
109
  <% } %>
117
110
 
111
+
118
112
  //(<endpointHook>)
119
113
  //(</endpointHook>)
120
114
 
@@ -55,10 +55,8 @@ function createSourceParams(_izContext, flowSchema, srcPath) {
55
55
  let handlerType = upperCase("hdrWbs")
56
56
  let additionalResourcePermission = defaultIamRolePerAction();
57
57
  let route = flowSchema.flowTag;
58
- let flowStep = Object.keys(flowSchema.flowSteps)
59
- let flowStepsOut = flowStep[0];
60
- let splitFlowStepsIn = flowStepsOut.split("_");
61
- let topicIn = `${splitFlowStepsIn[3]}_${splitFlowStepsIn[4]}`
58
+ let topicIn = `Process${upperCase(flowSchema.flowTag)}_In`
59
+
62
60
  additionalResourcePermission.push(
63
61
  createIamRole(
64
62
  {
@@ -23,7 +23,7 @@ const middleware = izara.middlewareHandler;
23
23
  // const api = new AWS.ApiGatewayManagementApi({ endpoint: process.env.iz_webSocketEndpoint });
24
24
  const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb')
25
25
  const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow')
26
- const hash = require('object-hash')
26
+ const hash = require('@izara_project/izara-shared-core').objectHash;
27
27
  // const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
28
28
  const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
29
29
  const { postToConnection } = require('../../../libs/source/GenerateCodeLibs')
@@ -50,11 +50,8 @@ function data(_izContext, flowSchema, srcPath) {
50
50
 
51
51
  function createParamsForCreateSource(_izContext, flowSchema, srcPath) {
52
52
  let functionName = upperCase(flowSchema.flowTag)
53
- // let topicArn = Object.keys(flowSchema.flowSteps)[0];
54
- let flowStep = Object.keys(flowSchema.flowSteps)
55
- let flowStepsIn = flowStep[0];
56
- let splitFlowStepsIn = flowStepsIn.split("_");
57
- let topicArn = `${splitFlowStepsIn[3]}_${splitFlowStepsIn[4]}`
53
+ let topicArn = `Process${upperCase(flowSchema.flowTag)}_In`
54
+
58
55
  return {
59
56
  templatePath: templatePath,
60
57
  templateData: {
@@ -18,7 +18,7 @@ along with this program. If not, see
18
18
 
19
19
  'use strict';
20
20
 
21
- const hash = require("object-hash");
21
+ const hash = require('@izara_project/izara-shared-core').objectHash;
22
22
  const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
23
23
 
24
24
  const dynamodbSharedLib = require('@izara_project/izara-core-library-dynamodb');
@@ -26,7 +26,7 @@ const snsSharedLib = require('@izara_project/izara-core-library-sns');
26
26
  const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
27
27
  const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
28
28
  const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
29
-
29
+ const storedCacheSharedLib = require('@izara_project/izara-core-library-stored-cache')
30
30
  const externalRequest = require('@izara_project/izara-core-library-external-request');
31
31
  const sns = externalRequest.sns
32
32
 
@@ -35,7 +35,8 @@ const NoRetryError = require('@izara_project/izara-core-library-core').NoRetryEr
35
35
  const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
36
36
  const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
37
37
  const { postToConnection } = require('../../../libs/source/GenerateCodeLibs')
38
-
38
+ //(<optionalRequire>)
39
+ //(</optionalRequire>)
39
40
  /**
40
41
  *
41
42
  *