@izara_project/izara-market-library-service-schemas 1.0.18 → 1.0.20

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 (179) hide show
  1. package/package.json +2 -2
  2. package/src/GenerateCodeLibs/src/Consts.js +32 -2
  3. package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +3 -61
  4. package/src/SourceManager/src/Utils.js +40 -1
  5. package/src/TemplateManager/src/FindData/FindDataYaml/data.js +4 -1
  6. package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +1 -14
  7. package/src/TemplateManager/src/GenerateCode.js +152 -46
  8. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +23 -3
  9. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs +1 -14
  10. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +22 -3
  11. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/template.ejs +1 -14
  12. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/data.js +23 -3
  13. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/template.ejs +1 -14
  14. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +23 -3
  15. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs +1 -14
  16. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +6 -6
  17. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/template.ejs +1 -14
  18. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +2 -1
  19. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs +1 -14
  20. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +1 -1
  21. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/template.ejs +1 -14
  22. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +3 -1
  23. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +1 -14
  24. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/data.js +1 -1
  25. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +65 -26
  26. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +0 -1
  27. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +13 -11
  28. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +34 -18
  29. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/mainFunction → PerActionEndpoint/libs}/data.js +12 -23
  30. package/src/TemplateManager/src/PerActionEndpoint/libs/template.ejs +46 -0
  31. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +18 -2
  32. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +1 -14
  33. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +20 -3
  34. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +1 -14
  35. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +21 -3
  36. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +1 -14
  37. package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/template.ejs +1 -1
  38. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +16 -2
  39. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/template.ejs +1 -14
  40. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +17 -2
  41. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +1 -14
  42. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +16 -2
  43. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +1 -14
  44. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +18 -3
  45. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +1 -14
  46. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/data.js +18 -3
  47. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/template.ejs +1 -14
  48. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +15 -2
  49. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +1 -14
  50. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +17 -2
  51. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +1 -14
  52. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +16 -2
  53. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +1 -14
  54. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +18 -3
  55. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +1 -14
  56. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +18 -3
  57. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +1 -14
  58. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +19 -4
  59. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +1 -14
  60. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +19 -2
  61. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +1 -14
  62. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +19 -2
  63. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +1 -14
  64. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +20 -2
  65. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +1 -14
  66. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +20 -2
  67. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +1 -14
  68. package/src/TemplateManager/src/Role/createSharedResource.js +270 -0
  69. package/src/TemplateManager/src/Role/sharedResourceTemplate.ejs +58 -0
  70. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +1 -1
  71. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +1 -1
  72. package/src/TemplateManager/src/externalService/LambdaRole/data.js +119 -9
  73. package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +3 -4
  74. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +31 -6
  75. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js +65 -0
  76. package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/data.js +3 -2
  77. package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/data.js +1 -1
  78. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/data.js +77 -0
  79. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/functionYaml/template.ejs +9 -3
  80. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js +47 -0
  81. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/handler/template.ejs +25 -52
  82. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/data.js +46 -0
  83. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/template.ejs +0 -0
  84. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js +36 -0
  85. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/template.ejs +0 -0
  86. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js +35 -0
  87. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs +0 -0
  88. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/data.js +35 -0
  89. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs +0 -0
  90. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js +35 -0
  91. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs +0 -0
  92. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/data.js +35 -0
  93. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs +0 -0
  94. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/data.js +102 -0
  95. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/template.ejs +30 -0
  96. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/data.js +58 -0
  97. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/template.ejs +126 -0
  98. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/data.js +51 -0
  99. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/template.ejs +121 -0
  100. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/data.js +64 -0
  101. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/template.ejs +45 -0
  102. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/functionYaml/data.js +42 -13
  103. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/template.ejs +37 -0
  104. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/data.js +75 -0
  105. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +120 -0
  106. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/handler → flowSchema/UploadS3Case/createObject/mainFunction}/data.js +11 -15
  107. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/mainFunction/template.ejs +4 -4
  108. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/functionYaml/data.js +6 -4
  109. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/template.ejs +30 -0
  110. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/data.js +1 -1
  111. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/template.ejs +10 -10
  112. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/mainFunction/data.js +3 -4
  113. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/template.ejs +86 -0
  114. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/sns-sqs/data.js +4 -2
  115. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/template.ejs +49 -0
  116. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/data.js +85 -0
  117. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc}/functionYaml/template.ejs +1 -1
  118. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/data.js +57 -0
  119. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/template.ejs +120 -0
  120. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/data.js +51 -0
  121. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +164 -0
  122. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/data.js +65 -0
  123. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/template.ejs +53 -0
  124. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/data.js +112 -0
  125. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/template.ejs +30 -0
  126. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/data.js +57 -0
  127. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/template.ejs +126 -0
  128. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/data.js +54 -0
  129. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +254 -0
  130. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/data.js +64 -0
  131. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/template.ejs +45 -0
  132. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/data.js +94 -0
  133. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateAsyncHandler.ejs +110 -0
  134. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateSyncHandler.ejs +49 -0
  135. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/hookLogic/data.js +44 -0
  136. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/data.js +66 -0
  137. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/template.ejs +7 -0
  138. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/data.js +73 -0
  139. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/snsTemplate.ejs +59 -0
  140. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/sqsTemplate.ejs +43 -0
  141. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/data.js +102 -0
  142. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/template.ejs +43 -0
  143. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/data.js +94 -0
  144. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateAsyncHandler.ejs +110 -0
  145. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateSyncHandler.ejs +49 -0
  146. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/hookLogic/data.js +65 -0
  147. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/data.js +67 -0
  148. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/template.ejs +30 -0
  149. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/data.js +125 -0
  150. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/snsTemplate.ejs +59 -0
  151. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/data.js +87 -0
  152. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/template.ejs +30 -0
  153. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/data.js +112 -0
  154. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/template.ejs +38 -0
  155. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/data.js +45 -0
  156. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/template.ejs +151 -0
  157. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/data.js +43 -0
  158. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/template.ejs +68 -0
  159. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/data.js +43 -0
  160. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +392 -0
  161. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/data.js +77 -0
  162. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/dsqTemplatePath.ejs +32 -0
  163. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/s3Template.ejs +59 -0
  164. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/data.js +51 -0
  165. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/template.ejs +13 -0
  166. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/data.js +42 -0
  167. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +137 -0
  168. package/src/TemplateManager/src/libs/Consts.js +89 -34
  169. package/src/TemplateManager/src/reStructureExample/GenerateCodeTest.js +31 -0
  170. package/src/TemplateManager/src/reStructureExample/TemplateConfig.js +11 -0
  171. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/data.js +0 -0
  172. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generateCodeShared.js +1 -0
  173. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generatePerAction.js +5 -0
  174. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/template.ejs +0 -0
  175. package/src/TemplateManager/src/flowTag/webSocket/webSocketComplete/mainFunction/template.ejs +0 -180
  176. /package/src/TemplateManager/src/{flowTag/resources/dynamoDb/data.js → flowSchema/DefaultWebSocketResource/dynamoDb/WebSocketTaskData.js} +0 -0
  177. /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/template.ejs +0 -0
  178. /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/template.ejs +0 -0
  179. /package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete/sns-sqs/template.ejs → flowSchema/UploadS3Case/hookCode(old)/queue/sqsTemplate.ejs} +0 -0
@@ -22,7 +22,25 @@ const fs = require('fs');
22
22
  const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
23
23
  const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
24
24
  const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
25
- const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, SHORT_FUNCTION_NAME } = require("../../../libs/Consts");
25
+ const {
26
+ DEFAULT_HANDLER_PER_ACTION,
27
+ createIamRole,
28
+ resourceNames,
29
+ RESOURCE_CLASSES,
30
+ DEFAULT_LAMBDA_ROLE_PER_ACTION,
31
+ SOURCE_PATH,
32
+ externalResourceName,
33
+ getGraphServiceNameFromAllRelSchema,
34
+ FUNCTION_NAME,
35
+ SAVE_FILE_NAME,
36
+ getGraphServiceNameFromObjectSchema,
37
+ defaultIamRolePerAction,
38
+ SQS_RESOURCE,
39
+ SNS_RESOURCE,
40
+ DYNAMO_RESOURCE,
41
+ SHORT_FUNCTION_NAME,
42
+ SOURCE_GENERATE_IAM_ROLE
43
+ } = require("../../../libs/Consts");
26
44
 
27
45
  const templatePath = path.join(__dirname, './template.ejs');
28
46
 
@@ -49,7 +67,7 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
49
67
  ],
50
68
  [RESOURCE_CLASSES.sns]: [
51
69
  SNS_RESOURCE.publish,
52
- SNS_RESOURCE.subscription
70
+ SNS_RESOURCE.subscribe
53
71
  ]
54
72
  },
55
73
  [
@@ -68,7 +86,8 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
68
86
  handlerType,
69
87
  additionalResourcePermission,
70
88
  resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete,
71
- functionNameConfig
89
+ functionNameConfig,
90
+ roleName: SOURCE_GENERATE_IAM_ROLE.ObjectCompleteRole,
72
91
  },
73
92
  setting: {
74
93
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -9,20 +9,7 @@
9
9
  filterPatterns: #**** need to update serverless framwork upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
- iamRoleStatements:
13
- <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
14
- - Effect: <%- resourcePermission.effect %>
15
- Action:
16
- <%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
17
- <%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
18
- - <%- resourcePerAction %>:<%- permission %>
19
- <%_}) _%>
20
- <%_ }) _%>
21
- Resource:
22
- <%_ resourcePermission.resource.forEach(resource => { _%>
23
- - <%- resource %>
24
- <%_ }) _%>
25
- <%_}) _%>
12
+ role: <%- roleName %>Role
26
13
  #<#<%- functionName %><%- handlerType %>IamRole#>
27
14
  #<#/<%- functionName %><%- handlerType %>IamRole#>
28
15
  <%_ function firstLetterUpperCase(text){
@@ -22,7 +22,26 @@ const fs = require('fs');
22
22
  const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
23
23
  const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
24
24
  const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
25
- const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, awaitingMultipleStepsRole, SHORT_FUNCTION_NAME } = require("../../../libs/Consts");
25
+ const {
26
+ DEFAULT_HANDLER_PER_ACTION,
27
+ createIamRole,
28
+ resourceNames,
29
+ RESOURCE_CLASSES,
30
+ DEFAULT_LAMBDA_ROLE_PER_ACTION,
31
+ SOURCE_PATH,
32
+ externalResourceName,
33
+ getGraphServiceNameFromAllRelSchema,
34
+ FUNCTION_NAME,
35
+ SAVE_FILE_NAME,
36
+ getGraphServiceNameFromObjectSchema,
37
+ defaultIamRolePerAction,
38
+ SQS_RESOURCE,
39
+ SNS_RESOURCE,
40
+ DYNAMO_RESOURCE,
41
+ awaitingMultipleStepsRole,
42
+ SHORT_FUNCTION_NAME,
43
+ SOURCE_GENERATE_IAM_ROLE
44
+ } = require("../../../libs/Consts");
26
45
 
27
46
  const templatePath = path.join(__dirname, './template.ejs');
28
47
 
@@ -49,7 +68,7 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
49
68
  ],
50
69
  [RESOURCE_CLASSES.sns]: [
51
70
  SNS_RESOURCE.publish,
52
- SNS_RESOURCE.subscription
71
+ SNS_RESOURCE.subscribe
53
72
  ]
54
73
  },
55
74
  [
@@ -71,7 +90,8 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
71
90
  handlerType,
72
91
  additionalResourcePermission,
73
92
  resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete,
74
- functionNameConfig
93
+ functionNameConfig,
94
+ roleName: SOURCE_GENERATE_IAM_ROLE.roleName,
75
95
  },
76
96
  setting: {
77
97
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -9,20 +9,7 @@
9
9
  filterPatterns: #**** need to update serverless framwork upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
- iamRoleStatements:
13
- <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
14
- - Effect: <%- resourcePermission.effect %>
15
- Action:
16
- <%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
17
- <%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
18
- - <%- resourcePerAction %>:<%- permission %>
19
- <%_}) _%>
20
- <%_ }) _%>
21
- Resource:
22
- <%_ resourcePermission.resource.forEach(resource => { _%>
23
- - <%- resource %>
24
- <%_ }) _%>
25
- <%_}) _%>
12
+ role: <%- roleName %>Role
26
13
  #<#<%- functionName %><%- handlerType %>IamRole#>
27
14
  #<#/<%- functionName %><%- handlerType %>IamRole#>
28
15
  <%_ function firstLetterUpperCase(text){
@@ -22,7 +22,26 @@ const fs = require('fs');
22
22
  const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
23
23
  const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
24
24
  const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
25
- const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, awaitingMultipleStepsRole, SHORT_FUNCTION_NAME } = require("../../../libs/Consts");
25
+ const {
26
+ DEFAULT_HANDLER_PER_ACTION,
27
+ createIamRole,
28
+ resourceNames,
29
+ RESOURCE_CLASSES,
30
+ DEFAULT_LAMBDA_ROLE_PER_ACTION,
31
+ SOURCE_PATH,
32
+ externalResourceName,
33
+ getGraphServiceNameFromAllRelSchema,
34
+ FUNCTION_NAME,
35
+ SAVE_FILE_NAME,
36
+ getGraphServiceNameFromObjectSchema,
37
+ defaultIamRolePerAction,
38
+ SQS_RESOURCE,
39
+ SNS_RESOURCE,
40
+ DYNAMO_RESOURCE,
41
+ awaitingMultipleStepsRole,
42
+ SHORT_FUNCTION_NAME,
43
+ SOURCE_GENERATE_IAM_ROLE
44
+ } = require("../../../libs/Consts");
26
45
 
27
46
  const templatePath = path.join(__dirname, './template.ejs');
28
47
 
@@ -49,7 +68,7 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
49
68
  ],
50
69
  [RESOURCE_CLASSES.sns]: [
51
70
  SNS_RESOURCE.publish,
52
- SNS_RESOURCE.subscription
71
+ SNS_RESOURCE.subscribe
53
72
  ]
54
73
  },
55
74
  [
@@ -71,7 +90,8 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
71
90
  handlerType,
72
91
  additionalResourcePermission,
73
92
  resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete,
74
- functionNameConfig
93
+ functionNameConfig,
94
+ roleName: SOURCE_GENERATE_IAM_ROLE.ObjectCompleteRole,
75
95
  },
76
96
  setting: {
77
97
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -9,20 +9,7 @@
9
9
  filterPatterns: #**** need to update serverless framwork upper v.2.69.1
10
10
  - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
11
11
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
12
- iamRoleStatements:
13
- <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
14
- - Effect: <%- resourcePermission.effect %>
15
- Action:
16
- <%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
17
- <%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
18
- - <%- resourcePerAction %>:<%- permission %>
19
- <%_}) _%>
20
- <%_ }) _%>
21
- Resource:
22
- <%_ resourcePermission.resource.forEach(resource => { _%>
23
- - <%- resource %>
24
- <%_ }) _%>
25
- <%_}) _%>
12
+ role: <%- roleName %>Role
26
13
  #<#<%- functionName %><%- handlerType %>IamRole#>
27
14
  #<#/<%- functionName %><%- handlerType %>IamRole#>
28
15
  <%_ function firstLetterUpperCase(text){
@@ -161,14 +161,14 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
161
161
  event: event,
162
162
  objectType: objectType,
163
163
  action: action,
164
- functionNameConfig
164
+ functionNameConfig,
165
165
  },
166
- setting: {
167
- savePath: path.join(srcPath, SOURCE_PATH.appYaml),
168
- saveFileName: SAVE_FILE_NAME.functionPerActionYaml,
166
+ setting: {
167
+ savePath: path.join(srcPath, SOURCE_PATH.appYaml),
168
+ saveFileName: SAVE_FILE_NAME.functionPerActionYaml,
169
169
  fileExtension: '.yml',
170
- isAppend: true
171
- }
170
+ isAppend: true
171
+ }
172
172
  }
173
173
  }
174
174
 
@@ -9,20 +9,7 @@
9
9
  cors: true
10
10
  #<#<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>Authorizer#>
11
11
  #<#/<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>Authorizer#>
12
- iamRoleStatements:
13
- <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
14
- - Effect: <%- resourcePermission.effect %>
15
- Action:
16
- <%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
17
- <%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
18
- - <%- resourcePerAction %>:<%- permission %>
19
- <%_}) _%>
20
- <%_ }) _%>
21
- Resource:
22
- <%_ resourcePermission.resource.forEach(resource => { _%>
23
- - <%- resource %>
24
- <%_ }) _%>
25
- <%_}) _%>
12
+ role: <%- objectType %>Role
26
13
  #<#<%- functionName %><%- handlerType %>IamRole#>
27
14
  #<#/<%- functionName %><%- handlerType %>IamRole#>
28
15
  <%_ function firstLetterUpperCase(text){
@@ -168,7 +168,8 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
168
168
  resourceLocation: SOURCE_PATH.resourceLocationPerAction,
169
169
  handlerType: HANDLER.hdrDsq,
170
170
  additionalResourcePermission,
171
- functionNameConfig
171
+ functionNameConfig,
172
+ roleName: `${objectType}`,
172
173
  },
173
174
  setting: {
174
175
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -6,20 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
8
8
  batchSize: 10
9
- iamRoleStatements:
10
- <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
11
- - Effect: <%- resourcePermission.effect %>
12
- Action:
13
- <%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
14
- <%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
15
- - <%- resourcePerAction %>:<%- permission %>
16
- <%_}) _%>
17
- <%_ }) _%>
18
- Resource:
19
- <%_ resourcePermission.resource.forEach(resource => { _%>
20
- - "<%- resource %>"
21
- <%_ }) _%>
22
- <%_}) _%>
9
+ role: <%- roleName %>Role
23
10
  #<#<%- functionName %><%- handlerType %>IamRole#>
24
11
  #<#/<%- functionName %><%- handlerType %>IamRole#>
25
12
  <%_ function firstLetterUpperCase(text){
@@ -152,7 +152,7 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
152
152
  additionalResourcePermission,
153
153
  objectType,
154
154
  // functionNameConfig: upperCase(objectType) + upperCase(action) + upperCase(shortNameHandler(HANDLER.hdrInv))
155
- functionNameConfig: upperCase(functionNameObjectType) + upperCase(action) + upperCase(shortNameHandler(HANDLER.hdrInv))
155
+ functionNameConfig: upperCase(functionNameObjectType) + upperCase(action) + upperCase(shortNameHandler(HANDLER.hdrInv)),
156
156
  },
157
157
  setting: {
158
158
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -2,20 +2,7 @@
2
2
  <%- firstLetterUpperCase(functionNameConfig) %>:
3
3
  handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
4
4
  name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
5
- iamRoleStatements:
6
- <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
7
- - Effect: <%- resourcePermission.effect %>
8
- Action:
9
- <%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
10
- <%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
11
- - <%- resourcePerAction %>:<%- permission %>
12
- <%_}) _%>
13
- <%_ }) _%>
14
- Resource:
15
- <%_ resourcePermission.resource.forEach(resource => { _%>
16
- - <%- resource %>
17
- <%_ }) _%>
18
- <%_}) _%>
5
+ role: <%- objectType %>Role
19
6
  #<#<%- functionName %><%- handlerType %>IamRole#>
20
7
  #<#/<%- functionName %><%- handlerType %>IamRole#>
21
8
  <%_ function firstLetterUpperCase(text){
@@ -171,7 +171,9 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
171
171
  resourceLocation: SOURCE_PATH.resourceLocationPerAction,
172
172
  handlerType: HANDLER.hdrSqs,
173
173
  additionalResourcePermission,
174
- functionNameConfig
174
+ functionNameConfig,
175
+ objectType,
176
+ roleName: `${objectType}`,
175
177
  },
176
178
  setting: {
177
179
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -6,20 +6,7 @@
6
6
  - sqs:
7
7
  arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
8
8
  batchSize: 10
9
- iamRoleStatements:
10
- <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
11
- - Effect: <%- resourcePermission.effect %>
12
- Action:
13
- <%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
14
- <%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
15
- - <%- resourcePerAction %>:<%- permission %>
16
- <%_ }) _%>
17
- <%_ }) _%>
18
- Resource:
19
- <%_ resourcePermission.resource.forEach(resource => { _%>
20
- - "<%- resource %>"
21
- <%_ }) _%>
22
- <%_}) _%>
9
+ role: <%- roleName %>Role
23
10
  #<#<%- functionName %><%- handlerType %>IamRole#>
24
11
  #<#/<%- functionName %><%- handlerType %>IamRole#>
25
12
  <%_ function firstLetterUpperCase(text){
@@ -157,7 +157,7 @@ function createParamForCreateSource(objectSchema, action, srcPath) {
157
157
  handlerType: HANDLER.hdrWbs,
158
158
  additionalResourcePermission,
159
159
  functionNameConfig,
160
- objectType
160
+ objectType,
161
161
  },
162
162
  setting: {
163
163
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -16,13 +16,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
  */
17
17
 
18
18
  'use strict';
19
- const asyncFlowSharedLib = require('@izara_project/izara-shared/src/AsyncFlowSharedLib');
20
- const dynamodbSharedLib = require('@izara_project/izara-shared/src/DynamodbSharedLib');
21
- const lambdaSharedLib = require('@izara_project/izara-shared/src/LambdaSharedLib')
22
- const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
23
-
24
- const sns = require('@izara_project/izara-core-library-external-request/src/resources/Sns');
19
+ const izaraShared = require('@izara_project/izara-shared');
20
+ const asyncFlowSharedLib = izaraShared.asyncFlowSharedLib;
21
+ const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
22
+ const lambdaSharedLib = izaraShared.lambdaSharedLib;
23
+ const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
25
24
  const snsSharedLib = require('@izara_project/izara-shared/src/SnsSharedLib');
25
+
26
+ const externalRequest = require('@izara_project/izara-core-library-external-request');
27
+ const sns = externalRequest.sns;
28
+ const lambda = externalRequest.lambda
29
+
26
30
  const getObjectSchema = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema');
27
31
  const serviceConfigLib = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
28
32
 
@@ -59,6 +63,8 @@ const { createDataDetailsLib } = require('@izara_project/izara-market-library-se
59
63
  const { createLinkTypeId } = require('@izara_project/izara-core-library-service-schemas/src/Utils');
60
64
  const { findLinksByObjTypes } = require("@izara_project/izara-core-library-service-schemas/src/libs/RelSchemaLib")
61
65
  const lodash = require("lodash")
66
+
67
+
62
68
  /**
63
69
  - all storageType( DB and Graph) use objInstance({identifiers,fields})
64
70
  - storageType[DB] async
@@ -95,6 +101,7 @@ module.exports.<%- functionName %>Main = async (
95
101
  let errorsFound = [];
96
102
 
97
103
  const userId = _izContext.correlationIds.get(coreConsts.BASE_USER_ID);
104
+ const targetId = _izContext.correlationIds.get(coreConsts.TARGET_ID)
98
105
  if (!userId) {
99
106
  errorsFound.push("Not have userId")
100
107
  }
@@ -103,12 +110,10 @@ module.exports.<%- functionName %>Main = async (
103
110
  const SERVICE_TAG = process.env.iz_serviceTag;
104
111
  //(<beforeQuery>)
105
112
  //(</beforeQuery>)
106
-
107
113
  const MAIN_OBJTYPE = {
108
114
  objectType: OBJECT_TYPE,
109
115
  serviceTag: SERVICE_TAG
110
116
  }
111
- //test npm install from local
112
117
  let objectSchema = await getObjectSchema.getObjSchemaS3WithCache(
113
118
  _izContext,
114
119
  MAIN_OBJTYPE
@@ -121,6 +126,10 @@ module.exports.<%- functionName %>Main = async (
121
126
  );
122
127
  _izContext.logger.debug("objectSchemas", objectSchemas);
123
128
 
129
+ if (objectSchema.hasOwnProperty("belongTo") && !targetId) {
130
+ errorsFound.push('not have targetId')
131
+ }
132
+
124
133
  let createDataDetails = await createDataDetailsLib(_izContext, objectSchemas);
125
134
  _izContext.logger.debug("createDataDetails is =", createDataDetails);
126
135
 
@@ -181,7 +190,7 @@ module.exports.<%- functionName %>Main = async (
181
190
  errorsFound.push(`relationship direction ${JSON.stringify(requestParams.relationships[index])} is invalid`)
182
191
  }
183
192
  }
184
-
193
+ _izContext.logger.debug("finish validate Relationships from RequestParams")
185
194
  let requiredOnCreateLinks = {};
186
195
  let createLinkTypeIds = [];
187
196
  // validate relationships link
@@ -230,24 +239,27 @@ module.exports.<%- functionName %>Main = async (
230
239
  })
231
240
  }
232
241
 
233
- for (const createRelationship of requestParams.relationships) {
234
- const onCreateLinkTypeId = createLinkTypeId(
235
- _izContext,
236
- MAIN_OBJTYPE,
237
- createRelationship.targetObjType,
238
- createRelationship.relType,
239
- createRelationship.relationshipDirection
240
- );
242
+ if (requestParams.hasOwnProperty("relationships") && requestParams.relationships.length) {
243
+ for (const createRelationship of requestParams.relationships) {
244
+ const onCreateLinkTypeId = createLinkTypeId(
245
+ _izContext,
246
+ MAIN_OBJTYPE,
247
+ createRelationship.targetObjType,
248
+ createRelationship.relType,
249
+ createRelationship.relationshipDirection
250
+ );
241
251
 
242
- if (!requiredOnCreateLinks.hasOwnProperty(onCreateLinkTypeId)) {
243
- errorsFound.push(`relType:${JSON.stringify(createRelationship.relType)} not allow to create when use create action`)
244
- continue;
245
- } else {
246
- createLinkTypeIds.push(onCreateLinkTypeId);
252
+ if (!requiredOnCreateLinks.hasOwnProperty(onCreateLinkTypeId)) {
253
+ errorsFound.push(`relType:${JSON.stringify(createRelationship.relType)} not allow to create when use create action`)
254
+ continue;
255
+ } else {
256
+ createLinkTypeIds.push(onCreateLinkTypeId);
257
+ }
247
258
  }
248
259
  }
249
260
  }
250
261
 
262
+
251
263
  // validate missing relType when create that should create
252
264
  const remainRequiredOnCreateLinkTypeIds = Object.keys(requiredOnCreateLinks)
253
265
  .filter(requiredInCreateLinkTypeId => !createLinkTypeIds.includes(requiredInCreateLinkTypeId))
@@ -310,10 +322,26 @@ module.exports.<%- functionName %>Main = async (
310
322
  }
311
323
  }
312
324
  };
325
+ } else if (objectSchemas.fieldNames[identifier.fieldName].hasOwnProperty("hashOnCreate")) {
326
+ if (objectSchemas.fieldNames[identifier.fieldName].hashOnCreate.length &&
327
+ objectSchemas.fieldNames[identifier.fieldName].hashOnCreate.length > 0) {
328
+ for (const fieldName of objectSchemas.fieldNames[identifier.fieldName].hashOnCreate) {
329
+ Object.assign(
330
+ requestParams.fieldNames, {
331
+ [identifier.fieldName]: hash({
332
+ [fieldName]: requestParams.fieldNames[fieldName]
333
+ })
334
+ }
335
+ )
336
+ }
337
+ } else {
338
+ errorsFound.push("[invalid] no data to hash for create")
339
+ }
313
340
  } else {
314
- if ((objectSchemas.fieldNames[identifier.fieldName].requiredOnCreate == false) &&
315
- (objectSchemas.fieldNames[identifier.fieldName].optionalOnCreate == false) &&
316
- (objectSchemas.fieldNames[identifier.fieldName].canUpdate == false)) {
341
+ if ((objectSchemas.fieldNames[identifier.fieldName].requiredOnCreate === false) &&
342
+ (objectSchemas.fieldNames[identifier.fieldName].optionalOnCreate === false) &&
343
+ (objectSchemas.fieldNames[identifier.fieldName].canUpdate === false) &&
344
+ objectSchemas.fieldNames[identifier.fieldName].hashOnCreate === false) {
317
345
  errorsFound.push("[invalid]case single identifier invalid objectSchemass");
318
346
  };
319
347
  };
@@ -332,6 +360,10 @@ module.exports.<%- functionName %>Main = async (
332
360
  listOfRequiredOnCreate.push(keyFieldNames)
333
361
  };
334
362
 
363
+ if (valueFieldNames.hasOwnProperty("hashOnCreate") && valueFieldNames.hashOnCreate.length) {
364
+ listOfRequiredOnCreate.push(keyFieldNames)
365
+ }
366
+
335
367
  if (valueFieldNames.hasOwnProperty("optionalOnCreate") && valueFieldNames.optionalOnCreate === true) {
336
368
  if ((valueFieldNames.requiredOnCreate === false) && valueFieldNames.optionalOnCreate === true) {
337
369
  listOfOptionalOnCreate.push(keyFieldNames)
@@ -477,7 +509,7 @@ module.exports.<%- functionName %>Main = async (
477
509
  messageObject = {
478
510
  objType: MAIN_OBJTYPE,
479
511
  objInstanceFull: objecForCreate.objInstanceFull,
480
- relationships: requestParams.relationships
512
+ relationships: requestParams.relationships || []
481
513
  };
482
514
  };
483
515
 
@@ -583,6 +615,13 @@ module.exports.<%- functionName %>Main = async (
583
615
  await sns.publishAsync(_izContext, messageParams);
584
616
  }
585
617
  }
618
+ return {
619
+ objType: MAIN_OBJTYPE,
620
+ fieldNames: requestParams.fieldNames,
621
+ relationship: requestParams.relationships,
622
+ status: "complete",
623
+ errorsFound: errorsFound
624
+ }
586
625
  }
587
626
  } catch (err) {
588
627
  throw (err)
@@ -28,7 +28,6 @@ const serviceConfigLib = require('@izara_project/izara-core-library-service-sche
28
28
 
29
29
  const uploadUseCase = require('@izara_project/izara-core-library-service-schemas/src/libs/UploadUseCase')
30
30
 
31
-
32
31
  const hash = require("object-hash")
33
32
  const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
34
33
  const path = require('path')
@@ -38,18 +38,21 @@ const {
38
38
  createGetDataDetails,
39
39
  } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
40
40
 
41
+ const { createObjTypeConcat } = require('@izara_project/izara-core-library-service-schemas/src/Utils');
41
42
 
42
43
  const izaraShared = require('@izara_project/izara-shared');
43
44
  const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
44
45
  const graphSharedLib = izaraShared.graphSharedLib;
45
46
  const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
46
47
  const snsSharedLib = izaraShared.snsSharedLib;
48
+ const lambdaSharedLib = izaraShared.lambdaSharedLib;
47
49
 
48
50
  const externalRequest = require('@izara_project/izara-core-library-external-request');
49
51
  const sns = externalRequest.sns
50
52
 
51
53
  const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
52
54
  const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
55
+ const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
53
56
 
54
57
  /**
55
58
  *
@@ -82,25 +85,24 @@ module.exports.<%- functionName %>Main = async (
82
85
  const returnSystemFieldsName = requestParams.additionalRequest?.setting?.returnSystemFieldsName || false;
83
86
  const throwWhenNotFoundSomeRecord = requestParams.additionalRequest?.setting?.throwWhenNotFoundSomeRecord || true;
84
87
 
85
-
86
88
  const OBJECT_TYPE = "<%- objectType %>";
87
89
  const SERVICE_TAG = process.env.iz_serviceTag;
88
90
 
89
91
  //(<beforeQuery>)
90
92
  //(</beforeQuery>)
91
93
 
92
- let objectSchema = await getObjSchemaS3WithHierarchy(
93
- _izContext,
94
- {
95
- objectType: OBJECT_TYPE,
96
- serviceTag: SERVICE_TAG
97
- }
98
- );
94
+ let objectSchema = await getObjSchemaS3WithHierarchy(
95
+ _izContext,
96
+ {
97
+ objectType: OBJECT_TYPE,
98
+ serviceTag: SERVICE_TAG
99
+ }
100
+ );
99
101
 
100
- _izContext.logger.debug("objectSchema: ", objectSchema);
102
+ _izContext.logger.debug("objectSchema: ", objectSchema);
101
103
 
102
- let getDataDetails = await createGetDataDetails(_izContext, objectSchema);
103
- _izContext.logger.debug("getDataDetails:", getDataDetails)
104
+ let getDataDetails = await createGetDataDetails(_izContext, objectSchema);
105
+ _izContext.logger.debug("getDataDetails:", getDataDetails)
104
106
 
105
107
  // start to get data
106
108
  let getResults = []; // for collect result data from