@webiny/api-sync-system 6.3.0 → 6.4.0-beta.1

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 (239) hide show
  1. package/constants.js +2 -1
  2. package/constants.js.map +1 -1
  3. package/index.js +0 -2
  4. package/package.json +14 -14
  5. package/resolver/app/RecordHandler.js +83 -105
  6. package/resolver/app/RecordHandler.js.map +1 -1
  7. package/resolver/app/RecordsValidation.js +11 -14
  8. package/resolver/app/RecordsValidation.js.map +1 -1
  9. package/resolver/app/ResolverApplication.js +24 -31
  10. package/resolver/app/ResolverApplication.js.map +1 -1
  11. package/resolver/app/abstractions/RecordHandler.js +0 -3
  12. package/resolver/app/abstractions/RecordsValidation.js +0 -3
  13. package/resolver/app/abstractions/ResolverApplication.js +0 -3
  14. package/resolver/app/abstractions/ResolverRecord.js +0 -3
  15. package/resolver/app/bundler/BaseBundle.js +17 -16
  16. package/resolver/app/bundler/BaseBundle.js.map +1 -1
  17. package/resolver/app/bundler/Bundler.js +13 -18
  18. package/resolver/app/bundler/Bundler.js.map +1 -1
  19. package/resolver/app/bundler/Bundles.js +21 -26
  20. package/resolver/app/bundler/Bundles.js.map +1 -1
  21. package/resolver/app/bundler/CommandBundle.js +7 -16
  22. package/resolver/app/bundler/CommandBundle.js.map +1 -1
  23. package/resolver/app/bundler/TableBundle.js +6 -13
  24. package/resolver/app/bundler/TableBundle.js.map +1 -1
  25. package/resolver/app/bundler/types.js +0 -3
  26. package/resolver/app/commandHandler/DeleteCommandHandler.js +22 -29
  27. package/resolver/app/commandHandler/DeleteCommandHandler.js.map +1 -1
  28. package/resolver/app/commandHandler/PutCommandHandler.js +16 -22
  29. package/resolver/app/commandHandler/PutCommandHandler.js.map +1 -1
  30. package/resolver/app/commandHandler/delete.js +11 -12
  31. package/resolver/app/commandHandler/delete.js.map +1 -1
  32. package/resolver/app/commandHandler/put.js +11 -12
  33. package/resolver/app/commandHandler/put.js.map +1 -1
  34. package/resolver/app/data/SourceDataContainer.js +28 -30
  35. package/resolver/app/data/SourceDataContainer.js.map +1 -1
  36. package/resolver/app/data/types.js +0 -3
  37. package/resolver/app/fetcher/Fetcher.js +84 -109
  38. package/resolver/app/fetcher/Fetcher.js.map +1 -1
  39. package/resolver/app/fetcher/types.js +0 -3
  40. package/resolver/app/ingestor/Ingestor.js +27 -32
  41. package/resolver/app/ingestor/Ingestor.js.map +1 -1
  42. package/resolver/app/ingestor/IngestorResult.js +28 -32
  43. package/resolver/app/ingestor/IngestorResult.js.map +1 -1
  44. package/resolver/app/ingestor/types.js +0 -3
  45. package/resolver/app/storer/Storer.js +71 -85
  46. package/resolver/app/storer/Storer.js.map +1 -1
  47. package/resolver/app/storer/types.js +0 -3
  48. package/resolver/app/transform/TransformHandler.js +45 -56
  49. package/resolver/app/transform/TransformHandler.js.map +1 -1
  50. package/resolver/app/transform/middleware.js +13 -20
  51. package/resolver/app/transform/middleware.js.map +1 -1
  52. package/resolver/app/utils/Retry.js +21 -24
  53. package/resolver/app/utils/Retry.js.map +1 -1
  54. package/resolver/app/utils/sleep.js +4 -5
  55. package/resolver/app/utils/sleep.js.map +1 -1
  56. package/resolver/app/validation/body.js +26 -31
  57. package/resolver/app/validation/body.js.map +1 -1
  58. package/resolver/app/validation/createJsonTransform.js +12 -13
  59. package/resolver/app/validation/createJsonTransform.js.map +1 -1
  60. package/resolver/app/validation/detail.js +30 -35
  61. package/resolver/app/validation/detail.js.map +1 -1
  62. package/resolver/app/validation/event.js +17 -18
  63. package/resolver/app/validation/event.js.map +1 -1
  64. package/resolver/app/validation/numericString.js +8 -11
  65. package/resolver/app/validation/numericString.js.map +1 -1
  66. package/resolver/app/validation/system.js +8 -9
  67. package/resolver/app/validation/system.js.map +1 -1
  68. package/resolver/createEventHandlerPlugin.js +70 -99
  69. package/resolver/createEventHandlerPlugin.js.map +1 -1
  70. package/resolver/createResolverHandler.js +49 -57
  71. package/resolver/createResolverHandler.js.map +1 -1
  72. package/resolver/deployment/Deployment.js +28 -31
  73. package/resolver/deployment/Deployment.js.map +1 -1
  74. package/resolver/deployment/Deployments.js +20 -23
  75. package/resolver/deployment/Deployments.js.map +1 -1
  76. package/resolver/deployment/DeploymentsFetcher.js +75 -84
  77. package/resolver/deployment/DeploymentsFetcher.js.map +1 -1
  78. package/resolver/deployment/types.js +0 -3
  79. package/resolver/lambda/LambdaTrigger.js +24 -26
  80. package/resolver/lambda/LambdaTrigger.js.map +1 -1
  81. package/resolver/plugins/CommandHandlerPlugin.js +16 -15
  82. package/resolver/plugins/CommandHandlerPlugin.js.map +1 -1
  83. package/resolver/plugins/StorerAfterEachPlugin.js +20 -19
  84. package/resolver/plugins/StorerAfterEachPlugin.js.map +1 -1
  85. package/resolver/plugins/TransformRecordPlugin.js +19 -18
  86. package/resolver/plugins/TransformRecordPlugin.js.map +1 -1
  87. package/resolver/recordTypes/fileManager/CopyFile.js +44 -67
  88. package/resolver/recordTypes/fileManager/CopyFile.js.map +1 -1
  89. package/resolver/recordTypes/fileManager/DeleteFile.js +40 -58
  90. package/resolver/recordTypes/fileManager/DeleteFile.js.map +1 -1
  91. package/resolver/recordTypes/fileManager/fileManager.js +5 -3
  92. package/resolver/recordTypes/fileManager/fileManager.js.map +1 -1
  93. package/resolver/recordTypes/fileManager/fileManagerOnDelete.js +24 -35
  94. package/resolver/recordTypes/fileManager/fileManagerOnDelete.js.map +1 -1
  95. package/resolver/recordTypes/fileManager/fileManagerOnPut.js +24 -35
  96. package/resolver/recordTypes/fileManager/fileManagerOnPut.js.map +1 -1
  97. package/resolver/recordTypes/fileManager/shouldBeHandled.js +10 -27
  98. package/resolver/recordTypes/fileManager/shouldBeHandled.js.map +1 -1
  99. package/resolver/recordTypes/fileManager/types.js +0 -3
  100. package/resolver/recordTypes/users/CopyUser.js +44 -54
  101. package/resolver/recordTypes/users/CopyUser.js.map +1 -1
  102. package/resolver/recordTypes/users/DeleteUser.js +40 -51
  103. package/resolver/recordTypes/users/DeleteUser.js.map +1 -1
  104. package/resolver/recordTypes/users/shouldBeHandled.js +10 -26
  105. package/resolver/recordTypes/users/shouldBeHandled.js.map +1 -1
  106. package/resolver/recordTypes/users/types.js +0 -3
  107. package/resolver/recordTypes/users/users.js +5 -3
  108. package/resolver/recordTypes/users/users.js.map +1 -1
  109. package/resolver/recordTypes/users/usersOnDelete.js +23 -34
  110. package/resolver/recordTypes/users/usersOnDelete.js.map +1 -1
  111. package/resolver/recordTypes/users/usersOnPut.js +24 -35
  112. package/resolver/recordTypes/users/usersOnPut.js.map +1 -1
  113. package/sync/FilterOutRecord.js +9 -17
  114. package/sync/FilterOutRecord.js.map +1 -1
  115. package/sync/attachToDynamoDbDocument.js +46 -65
  116. package/sync/attachToDynamoDbDocument.js.map +1 -1
  117. package/sync/createHandler.js +31 -40
  118. package/sync/createHandler.js.map +1 -1
  119. package/sync/createSendDataToEventBridgeOnRequestEnd.js +32 -37
  120. package/sync/createSendDataToEventBridgeOnRequestEnd.js.map +1 -1
  121. package/sync/createSyncSystem.js +24 -26
  122. package/sync/createSyncSystem.js.map +1 -1
  123. package/sync/filter/createDefaultFilterOutRecordPlugins.js +37 -76
  124. package/sync/filter/createDefaultFilterOutRecordPlugins.js.map +1 -1
  125. package/sync/handler/Handler.js +64 -76
  126. package/sync/handler/Handler.js.map +1 -1
  127. package/sync/handler/HandlerConverter.js +21 -29
  128. package/sync/handler/HandlerConverter.js.map +1 -1
  129. package/sync/handler/converter/BatchGetCommandConverter.js +12 -11
  130. package/sync/handler/converter/BatchGetCommandConverter.js.map +1 -1
  131. package/sync/handler/converter/BatchWriteCommandConverter.js +12 -11
  132. package/sync/handler/converter/BatchWriteCommandConverter.js.map +1 -1
  133. package/sync/handler/converter/DeleteCommandConverter.js +12 -11
  134. package/sync/handler/converter/DeleteCommandConverter.js.map +1 -1
  135. package/sync/handler/converter/GetCommandConverter.js +12 -11
  136. package/sync/handler/converter/GetCommandConverter.js.map +1 -1
  137. package/sync/handler/converter/PutCommandConverter.js +12 -11
  138. package/sync/handler/converter/PutCommandConverter.js.map +1 -1
  139. package/sync/handler/converter/QueryCommandConverter.js +12 -11
  140. package/sync/handler/converter/QueryCommandConverter.js.map +1 -1
  141. package/sync/handler/converter/ScanCommandConverter.js +12 -11
  142. package/sync/handler/converter/ScanCommandConverter.js.map +1 -1
  143. package/sync/handler/converter/UpdateCommandConverter.js +12 -11
  144. package/sync/handler/converter/UpdateCommandConverter.js.map +1 -1
  145. package/sync/handler/converter/commands/BatchWriteCommandValue.js +34 -37
  146. package/sync/handler/converter/commands/BatchWriteCommandValue.js.map +1 -1
  147. package/sync/handler/converter/commands/DeleteCommandValue.js +19 -16
  148. package/sync/handler/converter/commands/DeleteCommandValue.js.map +1 -1
  149. package/sync/handler/converter/commands/NullCommandValue.js +8 -8
  150. package/sync/handler/converter/commands/NullCommandValue.js.map +1 -1
  151. package/sync/handler/converter/commands/PutCommandValue.js +19 -16
  152. package/sync/handler/converter/commands/PutCommandValue.js.map +1 -1
  153. package/sync/handler/converter/commands/UpdateCommandValue.js +19 -16
  154. package/sync/handler/converter/commands/UpdateCommandValue.js.map +1 -1
  155. package/sync/handler/types.js +0 -3
  156. package/sync/plugins/FilterOutRecordPlugin.js +17 -19
  157. package/sync/plugins/FilterOutRecordPlugin.js.map +1 -1
  158. package/sync/requestPlugin.js +33 -48
  159. package/sync/requestPlugin.js.map +1 -1
  160. package/sync/types.js +0 -3
  161. package/sync/utils/getTableType.js +10 -9
  162. package/sync/utils/getTableType.js.map +1 -1
  163. package/sync/utils/manifest.js +28 -35
  164. package/sync/utils/manifest.js.map +1 -1
  165. package/sync/utils/validateSystemInput.js +21 -29
  166. package/sync/utils/validateSystemInput.js.map +1 -1
  167. package/types.js +6 -5
  168. package/types.js.map +1 -1
  169. package/utils/createSystemName.js +5 -3
  170. package/utils/createSystemName.js.map +1 -1
  171. package/worker/actions/copyFile/CopyFile.js +183 -258
  172. package/worker/actions/copyFile/CopyFile.js.map +1 -1
  173. package/worker/actions/copyFile/copyFileAction.js +26 -34
  174. package/worker/actions/copyFile/copyFileAction.js.map +1 -1
  175. package/worker/actions/copyFile/copyFileSchema.js +13 -14
  176. package/worker/actions/copyFile/copyFileSchema.js.map +1 -1
  177. package/worker/actions/copyFile/types.js +0 -3
  178. package/worker/actions/createUser/CreateUser.js +51 -74
  179. package/worker/actions/createUser/CreateUser.js.map +1 -1
  180. package/worker/actions/createUser/createUserAction.js +24 -28
  181. package/worker/actions/createUser/createUserAction.js.map +1 -1
  182. package/worker/actions/createUser/createUserSchema.js +13 -14
  183. package/worker/actions/createUser/createUserSchema.js.map +1 -1
  184. package/worker/actions/createUser/types.js +0 -3
  185. package/worker/actions/deleteFile/DeleteFile.js +52 -67
  186. package/worker/actions/deleteFile/DeleteFile.js.map +1 -1
  187. package/worker/actions/deleteFile/deleteFileAction.js +21 -29
  188. package/worker/actions/deleteFile/deleteFileAction.js.map +1 -1
  189. package/worker/actions/deleteFile/deleteFileSchema.js +13 -14
  190. package/worker/actions/deleteFile/deleteFileSchema.js.map +1 -1
  191. package/worker/actions/deleteFile/types.js +0 -3
  192. package/worker/actions/deleteUser/DeleteUser.js +38 -52
  193. package/worker/actions/deleteUser/DeleteUser.js.map +1 -1
  194. package/worker/actions/deleteUser/deleteUserAction.js +22 -26
  195. package/worker/actions/deleteUser/deleteUserAction.js.map +1 -1
  196. package/worker/actions/deleteUser/deleteUserSchema.js +12 -13
  197. package/worker/actions/deleteUser/deleteUserSchema.js.map +1 -1
  198. package/worker/actions/deleteUser/types.js +0 -3
  199. package/worker/actions/logValidationError.js +5 -6
  200. package/worker/actions/logValidationError.js.map +1 -1
  201. package/worker/actions/removeCognitoUserAttributes.js +9 -15
  202. package/worker/actions/removeCognitoUserAttributes.js.map +1 -1
  203. package/worker/actions/updateUser/UpdateUser.js +48 -65
  204. package/worker/actions/updateUser/UpdateUser.js.map +1 -1
  205. package/worker/actions/updateUser/types.js +0 -3
  206. package/worker/actions/updateUser/updateUserAction.js +24 -28
  207. package/worker/actions/updateUser/updateUserAction.js.map +1 -1
  208. package/worker/actions/updateUser/updateUserSchema.js +13 -14
  209. package/worker/actions/updateUser/updateUserSchema.js.map +1 -1
  210. package/worker/createWorkerHandler.js +24 -30
  211. package/worker/createWorkerHandler.js.map +1 -1
  212. package/worker/handler/WorkerActionHandler.js +19 -21
  213. package/worker/handler/WorkerActionHandler.js.map +1 -1
  214. package/worker/handler/eventHandler.js +14 -16
  215. package/worker/handler/eventHandler.js.map +1 -1
  216. package/worker/plugins/WorkerActionPlugin.js +17 -16
  217. package/worker/plugins/WorkerActionPlugin.js.map +1 -1
  218. package/worker/types.js +0 -3
  219. package/index.js.map +0 -1
  220. package/resolver/app/abstractions/RecordHandler.js.map +0 -1
  221. package/resolver/app/abstractions/RecordsValidation.js.map +0 -1
  222. package/resolver/app/abstractions/ResolverApplication.js.map +0 -1
  223. package/resolver/app/abstractions/ResolverRecord.js.map +0 -1
  224. package/resolver/app/bundler/types.js.map +0 -1
  225. package/resolver/app/data/types.js.map +0 -1
  226. package/resolver/app/fetcher/types.js.map +0 -1
  227. package/resolver/app/ingestor/types.js.map +0 -1
  228. package/resolver/app/storer/types.js.map +0 -1
  229. package/resolver/deployment/types.js.map +0 -1
  230. package/resolver/recordTypes/fileManager/types.js.map +0 -1
  231. package/resolver/recordTypes/users/types.js.map +0 -1
  232. package/sync/handler/types.js.map +0 -1
  233. package/sync/types.js.map +0 -1
  234. package/worker/actions/copyFile/types.js.map +0 -1
  235. package/worker/actions/createUser/types.js.map +0 -1
  236. package/worker/actions/deleteFile/types.js.map +0 -1
  237. package/worker/actions/deleteUser/types.js.map +0 -1
  238. package/worker/actions/updateUser/types.js.map +0 -1
  239. package/worker/types.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["getTableType","DeleteCommandValue","command","constructor","input","tableName","TableName","item","PK","Key","SK","tableType","getItems"],"sources":["DeleteCommandValue.ts"],"sourcesContent":["import type { DeleteCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nexport class DeleteCommandValue implements ICommandValue {\n public readonly command = \"delete\";\n public readonly item: ICommandValueItemExtended;\n\n public constructor(input: DeleteCommand) {\n const tableName = input.input.TableName as string;\n this.item = {\n command: this.command,\n PK: input.input.Key!.PK,\n SK: input.input.Key!.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n };\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> {\n return [this.item];\n }\n}\n"],"mappings":"AAGA,SAASA,YAAY;AAErB,OAAO,MAAMC,kBAAkB,CAA0B;EACrCC,OAAO,GAAG,QAAQ;EAG3BC,WAAWA,CAACC,KAAoB,EAAE;IACrC,MAAMC,SAAS,GAAGD,KAAK,CAACA,KAAK,CAACE,SAAmB;IACjD,IAAI,CAACC,IAAI,GAAG;MACRL,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBM,EAAE,EAAEJ,KAAK,CAACA,KAAK,CAACK,GAAG,CAAED,EAAE;MACvBE,EAAE,EAAEN,KAAK,CAACA,KAAK,CAACK,GAAG,CAAEC,EAAE;MACvBL,SAAS;MACTM,SAAS,EAAEX,YAAY,CAACK,SAAS,CAAC;MAClCD;IACJ,CAAC;EACL;EAEOQ,QAAQA,CAAA,EAA6C;IACxD,OAAO,CAAC,IAAI,CAACL,IAAI,CAAC;EACtB;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"sync/handler/converter/commands/DeleteCommandValue.js","sources":["../../../../../src/sync/handler/converter/commands/DeleteCommandValue.ts"],"sourcesContent":["import type { DeleteCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nexport class DeleteCommandValue implements ICommandValue {\n public readonly command = \"delete\";\n public readonly item: ICommandValueItemExtended;\n\n public constructor(input: DeleteCommand) {\n const tableName = input.input.TableName as string;\n this.item = {\n command: this.command,\n PK: input.input.Key!.PK,\n SK: input.input.Key!.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n };\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> {\n return [this.item];\n }\n}\n"],"names":["DeleteCommandValue","input","tableName","getTableType"],"mappings":";AAKO,MAAMA;IAIT,YAAmBC,KAAoB,CAAE;aAHzB,OAAO,GAAG;QAItB,MAAMC,YAAYD,MAAM,KAAK,CAAC,SAAS;QACvC,IAAI,CAAC,IAAI,GAAG;YACR,SAAS,IAAI,CAAC,OAAO;YACrB,IAAIA,MAAM,KAAK,CAAC,GAAG,CAAE,EAAE;YACvB,IAAIA,MAAM,KAAK,CAAC,GAAG,CAAE,EAAE;YACvBC;YACA,WAAWC,aAAaD;YACxBD;QACJ;IACJ;IAEO,WAAqD;QACxD,OAAO;YAAC,IAAI,CAAC,IAAI;SAAC;IACtB;AACJ"}
@@ -1,11 +1,11 @@
1
- export class NullCommandValue {
2
- /**
3
- * Does not matter what will be here, we will not use it.
4
- */
5
- command = "null";
6
- getItems() {
7
- return null;
8
- }
1
+ class NullCommandValue {
2
+ getItems() {
3
+ return null;
4
+ }
5
+ constructor(){
6
+ this.command = "null";
7
+ }
9
8
  }
9
+ export { NullCommandValue };
10
10
 
11
11
  //# sourceMappingURL=NullCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NullCommandValue","command","getItems"],"sources":["NullCommandValue.ts"],"sourcesContent":["import type { ICommandValue } from \"~/sync/types.js\";\n\nexport class NullCommandValue implements ICommandValue {\n /**\n * Does not matter what will be here, we will not use it.\n */\n public readonly command = \"null\";\n\n public getItems(): null {\n return null;\n }\n}\n"],"mappings":"AAEA,OAAO,MAAMA,gBAAgB,CAA0B;EACnD;AACJ;AACA;EACoBC,OAAO,GAAG,MAAM;EAEzBC,QAAQA,CAAA,EAAS;IACpB,OAAO,IAAI;EACf;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"sync/handler/converter/commands/NullCommandValue.js","sources":["../../../../../src/sync/handler/converter/commands/NullCommandValue.ts"],"sourcesContent":["import type { ICommandValue } from \"~/sync/types.js\";\n\nexport class NullCommandValue implements ICommandValue {\n /**\n * Does not matter what will be here, we will not use it.\n */\n public readonly command = \"null\";\n\n public getItems(): null {\n return null;\n }\n}\n"],"names":["NullCommandValue"],"mappings":"AAEO,MAAMA;IAMF,WAAiB;QACpB,OAAO;IACX;;QALC,KACe,OAAO,GAAG;;AAK9B"}
@@ -1,20 +1,23 @@
1
1
  import { getTableType } from "../../../utils/getTableType.js";
2
- export class PutCommandValue {
3
- command = "put";
4
- constructor(input) {
5
- const tableName = input.input.TableName;
6
- this.item = {
7
- command: this.command,
8
- PK: input.input.Item.PK,
9
- SK: input.input.Item.SK,
10
- tableName,
11
- tableType: getTableType(tableName),
12
- input
13
- };
14
- }
15
- getItems() {
16
- return [this.item];
17
- }
2
+ class PutCommandValue {
3
+ constructor(input){
4
+ this.command = "put";
5
+ const tableName = input.input.TableName;
6
+ this.item = {
7
+ command: this.command,
8
+ PK: input.input.Item.PK,
9
+ SK: input.input.Item.SK,
10
+ tableName,
11
+ tableType: getTableType(tableName),
12
+ input
13
+ };
14
+ }
15
+ getItems() {
16
+ return [
17
+ this.item
18
+ ];
19
+ }
18
20
  }
21
+ export { PutCommandValue };
19
22
 
20
23
  //# sourceMappingURL=PutCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getTableType","PutCommandValue","command","constructor","input","tableName","TableName","item","PK","Item","SK","tableType","getItems"],"sources":["PutCommandValue.ts"],"sourcesContent":["import type { PutCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nexport class PutCommandValue implements ICommandValue {\n public readonly command = \"put\";\n public readonly item: ICommandValueItemExtended;\n\n public constructor(input: PutCommand) {\n const tableName = input.input.TableName as string;\n this.item = {\n command: this.command,\n PK: input.input.Item!.PK,\n SK: input.input.Item!.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n };\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> {\n return [this.item];\n }\n}\n"],"mappings":"AAGA,SAASA,YAAY;AAErB,OAAO,MAAMC,eAAe,CAA0B;EAClCC,OAAO,GAAG,KAAK;EAGxBC,WAAWA,CAACC,KAAiB,EAAE;IAClC,MAAMC,SAAS,GAAGD,KAAK,CAACA,KAAK,CAACE,SAAmB;IACjD,IAAI,CAACC,IAAI,GAAG;MACRL,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBM,EAAE,EAAEJ,KAAK,CAACA,KAAK,CAACK,IAAI,CAAED,EAAE;MACxBE,EAAE,EAAEN,KAAK,CAACA,KAAK,CAACK,IAAI,CAAEC,EAAE;MACxBL,SAAS;MACTM,SAAS,EAAEX,YAAY,CAACK,SAAS,CAAC;MAClCD;IACJ,CAAC;EACL;EAEOQ,QAAQA,CAAA,EAA6C;IACxD,OAAO,CAAC,IAAI,CAACL,IAAI,CAAC;EACtB;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"sync/handler/converter/commands/PutCommandValue.js","sources":["../../../../../src/sync/handler/converter/commands/PutCommandValue.ts"],"sourcesContent":["import type { PutCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nexport class PutCommandValue implements ICommandValue {\n public readonly command = \"put\";\n public readonly item: ICommandValueItemExtended;\n\n public constructor(input: PutCommand) {\n const tableName = input.input.TableName as string;\n this.item = {\n command: this.command,\n PK: input.input.Item!.PK,\n SK: input.input.Item!.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n };\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> {\n return [this.item];\n }\n}\n"],"names":["PutCommandValue","input","tableName","getTableType"],"mappings":";AAKO,MAAMA;IAIT,YAAmBC,KAAiB,CAAE;aAHtB,OAAO,GAAG;QAItB,MAAMC,YAAYD,MAAM,KAAK,CAAC,SAAS;QACvC,IAAI,CAAC,IAAI,GAAG;YACR,SAAS,IAAI,CAAC,OAAO;YACrB,IAAIA,MAAM,KAAK,CAAC,IAAI,CAAE,EAAE;YACxB,IAAIA,MAAM,KAAK,CAAC,IAAI,CAAE,EAAE;YACxBC;YACA,WAAWC,aAAaD;YACxBD;QACJ;IACJ;IAEO,WAAqD;QACxD,OAAO;YAAC,IAAI,CAAC,IAAI;SAAC;IACtB;AACJ"}
@@ -1,20 +1,23 @@
1
1
  import { getTableType } from "../../../utils/getTableType.js";
2
- export class UpdateCommandValue {
3
- command = "update";
4
- constructor(input) {
5
- const tableName = input.input.TableName;
6
- this.item = {
7
- command: this.command,
8
- PK: input.input.Key.PK,
9
- SK: input.input.Key.SK,
10
- tableName,
11
- tableType: getTableType(tableName),
12
- input
13
- };
14
- }
15
- getItems() {
16
- return [this.item];
17
- }
2
+ class UpdateCommandValue {
3
+ constructor(input){
4
+ this.command = "update";
5
+ const tableName = input.input.TableName;
6
+ this.item = {
7
+ command: this.command,
8
+ PK: input.input.Key.PK,
9
+ SK: input.input.Key.SK,
10
+ tableName,
11
+ tableType: getTableType(tableName),
12
+ input
13
+ };
14
+ }
15
+ getItems() {
16
+ return [
17
+ this.item
18
+ ];
19
+ }
18
20
  }
21
+ export { UpdateCommandValue };
19
22
 
20
23
  //# sourceMappingURL=UpdateCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getTableType","UpdateCommandValue","command","constructor","input","tableName","TableName","item","PK","Key","SK","tableType","getItems"],"sources":["UpdateCommandValue.ts"],"sourcesContent":["import type { UpdateCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nexport class UpdateCommandValue implements ICommandValue {\n public readonly command = \"update\";\n public readonly item: ICommandValueItemExtended;\n\n public constructor(input: UpdateCommand) {\n const tableName = input.input.TableName as string;\n this.item = {\n command: this.command,\n PK: input.input.Key!.PK,\n SK: input.input.Key!.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n };\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> {\n return [this.item];\n }\n}\n"],"mappings":"AAGA,SAASA,YAAY;AAErB,OAAO,MAAMC,kBAAkB,CAA0B;EACrCC,OAAO,GAAG,QAAQ;EAG3BC,WAAWA,CAACC,KAAoB,EAAE;IACrC,MAAMC,SAAS,GAAGD,KAAK,CAACA,KAAK,CAACE,SAAmB;IACjD,IAAI,CAACC,IAAI,GAAG;MACRL,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBM,EAAE,EAAEJ,KAAK,CAACA,KAAK,CAACK,GAAG,CAAED,EAAE;MACvBE,EAAE,EAAEN,KAAK,CAACA,KAAK,CAACK,GAAG,CAAEC,EAAE;MACvBL,SAAS;MACTM,SAAS,EAAEX,YAAY,CAACK,SAAS,CAAC;MAClCD;IACJ,CAAC;EACL;EAEOQ,QAAQA,CAAA,EAA6C;IACxD,OAAO,CAAC,IAAI,CAACL,IAAI,CAAC;EACtB;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"sync/handler/converter/commands/UpdateCommandValue.js","sources":["../../../../../src/sync/handler/converter/commands/UpdateCommandValue.ts"],"sourcesContent":["import type { UpdateCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nexport class UpdateCommandValue implements ICommandValue {\n public readonly command = \"update\";\n public readonly item: ICommandValueItemExtended;\n\n public constructor(input: UpdateCommand) {\n const tableName = input.input.TableName as string;\n this.item = {\n command: this.command,\n PK: input.input.Key!.PK,\n SK: input.input.Key!.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n };\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> {\n return [this.item];\n }\n}\n"],"names":["UpdateCommandValue","input","tableName","getTableType"],"mappings":";AAKO,MAAMA;IAIT,YAAmBC,KAAoB,CAAE;aAHzB,OAAO,GAAG;QAItB,MAAMC,YAAYD,MAAM,KAAK,CAAC,SAAS;QACvC,IAAI,CAAC,IAAI,GAAG;YACR,SAAS,IAAI,CAAC,OAAO;YACrB,IAAIA,MAAM,KAAK,CAAC,GAAG,CAAE,EAAE;YACvB,IAAIA,MAAM,KAAK,CAAC,GAAG,CAAE,EAAE;YACvBC;YACA,WAAWC,aAAaD;YACxBD;QACJ;IACJ;IAEO,WAAqD;QACxD,OAAO;YAAC,IAAI,CAAC,IAAI;SAAC;IACtB;AACJ"}
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1,23 +1,21 @@
1
1
  import { Plugin } from "@webiny/plugins/Plugin.js";
2
- export class FilterOutRecordPlugin extends Plugin {
3
- static type = "sync.filterOut.record";
4
- constructor(params) {
5
- super();
6
- this.name = params.name;
7
- this.cb = params.filterOut;
8
- }
9
- /**
10
- * If method returns `true`, the record will be filtered out.
11
- */
12
- execute(item) {
13
- return this.cb(item);
14
- }
15
- static createName(name) {
16
- return `${FilterOutRecordPlugin.type}.${name}`;
17
- }
2
+ class FilterOutRecordPlugin extends Plugin {
3
+ static{
4
+ this.type = "sync.filterOut.record";
5
+ }
6
+ constructor(params){
7
+ super();
8
+ this.name = params.name;
9
+ this.cb = params.filterOut;
10
+ }
11
+ execute(item) {
12
+ return this.cb(item);
13
+ }
14
+ static createName(name) {
15
+ return `${FilterOutRecordPlugin.type}.${name}`;
16
+ }
18
17
  }
19
- export const createFilterOutRecordPlugin = params => {
20
- return new FilterOutRecordPlugin(params);
21
- };
18
+ const createFilterOutRecordPlugin = (params)=>new FilterOutRecordPlugin(params);
19
+ export { FilterOutRecordPlugin, createFilterOutRecordPlugin };
22
20
 
23
21
  //# sourceMappingURL=FilterOutRecordPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Plugin","FilterOutRecordPlugin","type","constructor","params","name","cb","filterOut","execute","item","createName","createFilterOutRecordPlugin"],"sources":["FilterOutRecordPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { ICommandValueItemExtended } from \"~/sync/types.js\";\n\nexport interface IFilterOutRecordPluginCallable {\n (record: ICommandValueItemExtended): boolean;\n}\n\nexport interface IFilterOutRecordPluginParams {\n /**\n * Filter out returns true if the record should be filtered out.\n */\n filterOut: IFilterOutRecordPluginCallable;\n name: string;\n}\n\nexport class FilterOutRecordPlugin extends Plugin {\n public static override readonly type: string = \"sync.filterOut.record\";\n\n private readonly cb: IFilterOutRecordPluginCallable;\n\n public constructor(params: IFilterOutRecordPluginParams) {\n super();\n this.name = params.name;\n this.cb = params.filterOut;\n }\n /**\n * If method returns `true`, the record will be filtered out.\n */\n public execute(item: ICommandValueItemExtended): boolean {\n return this.cb(item);\n }\n\n public static createName(name: string): string {\n return `${FilterOutRecordPlugin.type}.${name}`;\n }\n}\n\nexport const createFilterOutRecordPlugin = (\n params: IFilterOutRecordPluginParams\n): FilterOutRecordPlugin => {\n return new FilterOutRecordPlugin(params);\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,2BAA2B;AAelD,OAAO,MAAMC,qBAAqB,SAASD,MAAM,CAAC;EAC9C,OAAgCE,IAAI,GAAW,uBAAuB;EAI/DC,WAAWA,CAACC,MAAoC,EAAE;IACrD,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,IAAI,GAAGD,MAAM,CAACC,IAAI;IACvB,IAAI,CAACC,EAAE,GAAGF,MAAM,CAACG,SAAS;EAC9B;EACA;AACJ;AACA;EACWC,OAAOA,CAACC,IAA+B,EAAW;IACrD,OAAO,IAAI,CAACH,EAAE,CAACG,IAAI,CAAC;EACxB;EAEA,OAAcC,UAAUA,CAACL,IAAY,EAAU;IAC3C,OAAO,GAAGJ,qBAAqB,CAACC,IAAI,IAAIG,IAAI,EAAE;EAClD;AACJ;AAEA,OAAO,MAAMM,2BAA2B,GACpCP,MAAoC,IACZ;EACxB,OAAO,IAAIH,qBAAqB,CAACG,MAAM,CAAC;AAC5C,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"sync/plugins/FilterOutRecordPlugin.js","sources":["../../../src/sync/plugins/FilterOutRecordPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { ICommandValueItemExtended } from \"~/sync/types.js\";\n\nexport interface IFilterOutRecordPluginCallable {\n (record: ICommandValueItemExtended): boolean;\n}\n\nexport interface IFilterOutRecordPluginParams {\n /**\n * Filter out returns true if the record should be filtered out.\n */\n filterOut: IFilterOutRecordPluginCallable;\n name: string;\n}\n\nexport class FilterOutRecordPlugin extends Plugin {\n public static override readonly type: string = \"sync.filterOut.record\";\n\n private readonly cb: IFilterOutRecordPluginCallable;\n\n public constructor(params: IFilterOutRecordPluginParams) {\n super();\n this.name = params.name;\n this.cb = params.filterOut;\n }\n /**\n * If method returns `true`, the record will be filtered out.\n */\n public execute(item: ICommandValueItemExtended): boolean {\n return this.cb(item);\n }\n\n public static createName(name: string): string {\n return `${FilterOutRecordPlugin.type}.${name}`;\n }\n}\n\nexport const createFilterOutRecordPlugin = (\n params: IFilterOutRecordPluginParams\n): FilterOutRecordPlugin => {\n return new FilterOutRecordPlugin(params);\n};\n"],"names":["FilterOutRecordPlugin","Plugin","params","item","name","createFilterOutRecordPlugin"],"mappings":";AAeO,MAAMA,8BAA8BC;;aACP,IAAI,GAAW;;IAI/C,YAAmBC,MAAoC,CAAE;QACrD,KAAK;QACL,IAAI,CAAC,IAAI,GAAGA,OAAO,IAAI;QACvB,IAAI,CAAC,EAAE,GAAGA,OAAO,SAAS;IAC9B;IAIO,QAAQC,IAA+B,EAAW;QACrD,OAAO,IAAI,CAAC,EAAE,CAACA;IACnB;IAEA,OAAc,WAAWC,IAAY,EAAU;QAC3C,OAAO,GAAGJ,sBAAsB,IAAI,CAAC,CAAC,EAAEI,MAAM;IAClD;AACJ;AAEO,MAAMC,8BAA8B,CACvCH,SAEO,IAAIF,sBAAsBE"}
@@ -4,55 +4,40 @@ import { attachToDynamoDbDocument } from "./attachToDynamoDbDocument.js";
4
4
  import { createSendDataToEventBridgeOnRequestEnd } from "./createSendDataToEventBridgeOnRequestEnd.js";
5
5
  import { createHandler } from "./createHandler.js";
6
6
  import { convertException } from "@webiny/utils/exception.js";
7
- export const createSyncSystemHandlerOnRequestPlugin = params => {
8
- return createHandlerOnRequest(async (_, __, context) => {
9
- const {
10
- data: manifest,
11
- error
12
- } = await getManifest(params);
13
- if (error) {
14
- if (process.env.DEBUG !== "true") {
15
- return;
16
- }
17
- console.error("Error happened when fetching manifest.");
18
- console.log(JSON.stringify({
19
- error: convertException(error)
20
- }));
21
- return;
22
- } else if (!manifest?.sync?.region) {
23
- if (process.env.DEBUG !== "true") {
24
- return;
25
- }
26
- console.error("There is no manifest.");
27
- console.log(JSON.stringify({
28
- manifest
29
- }));
30
- return;
31
- }
32
- const {
33
- handler
34
- } = createHandler({
35
- getEventBridgeClient: () => {
36
- return params.getEventBridgeClient({
37
- region: manifest.sync.region
7
+ const createSyncSystemHandlerOnRequestPlugin = (params)=>createHandlerOnRequest(async (_, __, context)=>{
8
+ const { data: manifest, error } = await getManifest(params);
9
+ if (error) {
10
+ if ("true" !== process.env.DEBUG) return;
11
+ console.error("Error happened when fetching manifest.");
12
+ console.log(JSON.stringify({
13
+ error: convertException(error)
14
+ }));
15
+ return;
16
+ }
17
+ if (!manifest?.sync?.region) {
18
+ if ("true" !== process.env.DEBUG) return;
19
+ console.error("There is no manifest.");
20
+ console.log(JSON.stringify({
21
+ manifest
22
+ }));
23
+ return;
24
+ }
25
+ const { handler } = createHandler({
26
+ getEventBridgeClient: ()=>params.getEventBridgeClient({
27
+ region: manifest.sync.region
28
+ }),
29
+ system: params.system,
30
+ manifest,
31
+ commandConverters: params.commandConverters,
32
+ getPlugins: ()=>context.plugins
38
33
  });
39
- },
40
- system: params.system,
41
- manifest,
42
- commandConverters: params.commandConverters,
43
- getPlugins: () => {
44
- return context.plugins;
45
- }
46
- });
47
- attachToDynamoDbDocument({
48
- handler
34
+ attachToDynamoDbDocument({
35
+ handler
36
+ });
37
+ context.plugins.register([
38
+ createSendDataToEventBridgeOnRequestEnd(handler)
39
+ ]);
49
40
  });
50
- context.plugins.register([
51
- /**
52
- * When request ends, send the data to the EventBridge.
53
- */
54
- createSendDataToEventBridgeOnRequestEnd(handler)]);
55
- });
56
- };
41
+ export { createSyncSystemHandlerOnRequestPlugin };
57
42
 
58
43
  //# sourceMappingURL=requestPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createHandlerOnRequest","getManifest","attachToDynamoDbDocument","createSendDataToEventBridgeOnRequestEnd","createHandler","convertException","createSyncSystemHandlerOnRequestPlugin","params","_","__","context","data","manifest","error","process","env","DEBUG","console","log","JSON","stringify","sync","region","handler","getEventBridgeClient","system","commandConverters","getPlugins","plugins","register"],"sources":["requestPlugin.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IGetEventBridgeCallable, ISystem } from \"~/sync/types.js\";\nimport { createHandlerOnRequest } from \"@webiny/handler\";\nimport { getManifest } from \"~/sync/utils/manifest.js\";\nimport { attachToDynamoDbDocument } from \"~/sync/attachToDynamoDbDocument.js\";\nimport { createSendDataToEventBridgeOnRequestEnd } from \"~/sync/createSendDataToEventBridgeOnRequestEnd.js\";\nimport { createHandler } from \"./createHandler.js\";\nimport { convertException } from \"@webiny/utils/exception.js\";\n\nexport interface ICreateSyncSystemHandlerOnRequestPluginParams {\n getDocumentClient(): Pick<DynamoDBDocument, \"send\">;\n getEventBridgeClient: IGetEventBridgeCallable;\n system: ISystem;\n commandConverters?: ICommandConverter[];\n}\n\nexport const createSyncSystemHandlerOnRequestPlugin = (\n params: ICreateSyncSystemHandlerOnRequestPluginParams\n) => {\n return createHandlerOnRequest(async (_, __, context) => {\n const { data: manifest, error } = await getManifest(params);\n if (error) {\n if (process.env.DEBUG !== \"true\") {\n return;\n }\n console.error(\"Error happened when fetching manifest.\");\n console.log(\n JSON.stringify({\n error: convertException(error)\n })\n );\n return;\n } else if (!manifest?.sync?.region) {\n if (process.env.DEBUG !== \"true\") {\n return;\n }\n console.error(\"There is no manifest.\");\n console.log(\n JSON.stringify({\n manifest\n })\n );\n return;\n }\n\n const { handler } = createHandler({\n getEventBridgeClient: () => {\n return params.getEventBridgeClient({\n region: manifest.sync.region\n });\n },\n system: params.system,\n manifest,\n commandConverters: params.commandConverters,\n getPlugins: () => {\n return context.plugins;\n }\n });\n\n attachToDynamoDbDocument({\n handler\n });\n context.plugins.register([\n /**\n * When request ends, send the data to the EventBridge.\n */\n createSendDataToEventBridgeOnRequestEnd(handler)\n ]);\n });\n};\n"],"mappings":"AAEA,SAASA,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,WAAW;AACpB,SAASC,wBAAwB;AACjC,SAASC,uCAAuC;AAChD,SAASC,aAAa;AACtB,SAASC,gBAAgB,QAAQ,4BAA4B;AAS7D,OAAO,MAAMC,sCAAsC,GAC/CC,MAAqD,IACpD;EACD,OAAOP,sBAAsB,CAAC,OAAOQ,CAAC,EAAEC,EAAE,EAAEC,OAAO,KAAK;IACpD,MAAM;MAAEC,IAAI,EAAEC,QAAQ;MAAEC;IAAM,CAAC,GAAG,MAAMZ,WAAW,CAACM,MAAM,CAAC;IAC3D,IAAIM,KAAK,EAAE;MACP,IAAIC,OAAO,CAACC,GAAG,CAACC,KAAK,KAAK,MAAM,EAAE;QAC9B;MACJ;MACAC,OAAO,CAACJ,KAAK,CAAC,wCAAwC,CAAC;MACvDI,OAAO,CAACC,GAAG,CACPC,IAAI,CAACC,SAAS,CAAC;QACXP,KAAK,EAAER,gBAAgB,CAACQ,KAAK;MACjC,CAAC,CACL,CAAC;MACD;IACJ,CAAC,MAAM,IAAI,CAACD,QAAQ,EAAES,IAAI,EAAEC,MAAM,EAAE;MAChC,IAAIR,OAAO,CAACC,GAAG,CAACC,KAAK,KAAK,MAAM,EAAE;QAC9B;MACJ;MACAC,OAAO,CAACJ,KAAK,CAAC,uBAAuB,CAAC;MACtCI,OAAO,CAACC,GAAG,CACPC,IAAI,CAACC,SAAS,CAAC;QACXR;MACJ,CAAC,CACL,CAAC;MACD;IACJ;IAEA,MAAM;MAAEW;IAAQ,CAAC,GAAGnB,aAAa,CAAC;MAC9BoB,oBAAoB,EAAEA,CAAA,KAAM;QACxB,OAAOjB,MAAM,CAACiB,oBAAoB,CAAC;UAC/BF,MAAM,EAAEV,QAAQ,CAACS,IAAI,CAACC;QAC1B,CAAC,CAAC;MACN,CAAC;MACDG,MAAM,EAAElB,MAAM,CAACkB,MAAM;MACrBb,QAAQ;MACRc,iBAAiB,EAAEnB,MAAM,CAACmB,iBAAiB;MAC3CC,UAAU,EAAEA,CAAA,KAAM;QACd,OAAOjB,OAAO,CAACkB,OAAO;MAC1B;IACJ,CAAC,CAAC;IAEF1B,wBAAwB,CAAC;MACrBqB;IACJ,CAAC,CAAC;IACFb,OAAO,CAACkB,OAAO,CAACC,QAAQ,CAAC;IACrB;AACZ;AACA;IACY1B,uCAAuC,CAACoB,OAAO,CAAC,CACnD,CAAC;EACN,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"sync/requestPlugin.js","sources":["../../src/sync/requestPlugin.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IGetEventBridgeCallable, ISystem } from \"~/sync/types.js\";\nimport { createHandlerOnRequest } from \"@webiny/handler\";\nimport { getManifest } from \"~/sync/utils/manifest.js\";\nimport { attachToDynamoDbDocument } from \"~/sync/attachToDynamoDbDocument.js\";\nimport { createSendDataToEventBridgeOnRequestEnd } from \"~/sync/createSendDataToEventBridgeOnRequestEnd.js\";\nimport { createHandler } from \"./createHandler.js\";\nimport { convertException } from \"@webiny/utils/exception.js\";\n\nexport interface ICreateSyncSystemHandlerOnRequestPluginParams {\n getDocumentClient(): Pick<DynamoDBDocument, \"send\">;\n getEventBridgeClient: IGetEventBridgeCallable;\n system: ISystem;\n commandConverters?: ICommandConverter[];\n}\n\nexport const createSyncSystemHandlerOnRequestPlugin = (\n params: ICreateSyncSystemHandlerOnRequestPluginParams\n) => {\n return createHandlerOnRequest(async (_, __, context) => {\n const { data: manifest, error } = await getManifest(params);\n if (error) {\n if (process.env.DEBUG !== \"true\") {\n return;\n }\n console.error(\"Error happened when fetching manifest.\");\n console.log(\n JSON.stringify({\n error: convertException(error)\n })\n );\n return;\n } else if (!manifest?.sync?.region) {\n if (process.env.DEBUG !== \"true\") {\n return;\n }\n console.error(\"There is no manifest.\");\n console.log(\n JSON.stringify({\n manifest\n })\n );\n return;\n }\n\n const { handler } = createHandler({\n getEventBridgeClient: () => {\n return params.getEventBridgeClient({\n region: manifest.sync.region\n });\n },\n system: params.system,\n manifest,\n commandConverters: params.commandConverters,\n getPlugins: () => {\n return context.plugins;\n }\n });\n\n attachToDynamoDbDocument({\n handler\n });\n context.plugins.register([\n /**\n * When request ends, send the data to the EventBridge.\n */\n createSendDataToEventBridgeOnRequestEnd(handler)\n ]);\n });\n};\n"],"names":["createSyncSystemHandlerOnRequestPlugin","params","createHandlerOnRequest","_","__","context","manifest","error","getManifest","process","console","JSON","convertException","handler","createHandler","attachToDynamoDbDocument","createSendDataToEventBridgeOnRequestEnd"],"mappings":";;;;;;AAgBO,MAAMA,yCAAyC,CAClDC,SAEOC,uBAAuB,OAAOC,GAAGC,IAAIC;QACxC,MAAM,EAAE,MAAMC,QAAQ,EAAEC,KAAK,EAAE,GAAG,MAAMC,YAAYP;QACpD,IAAIM,OAAO;YACP,IAAIE,AAAsB,WAAtBA,QAAQ,GAAG,CAAC,KAAK,EACjB;YAEJC,QAAQ,KAAK,CAAC;YACdA,QAAQ,GAAG,CACPC,KAAK,SAAS,CAAC;gBACX,OAAOC,iBAAiBL;YAC5B;YAEJ;QACJ;QAAO,IAAI,CAACD,UAAU,MAAM,QAAQ;YAChC,IAAIG,AAAsB,WAAtBA,QAAQ,GAAG,CAAC,KAAK,EACjB;YAEJC,QAAQ,KAAK,CAAC;YACdA,QAAQ,GAAG,CACPC,KAAK,SAAS,CAAC;gBACXL;YACJ;YAEJ;QACJ;QAEA,MAAM,EAAEO,OAAO,EAAE,GAAGC,cAAc;YAC9B,sBAAsB,IACXb,OAAO,oBAAoB,CAAC;oBAC/B,QAAQK,SAAS,IAAI,CAAC,MAAM;gBAChC;YAEJ,QAAQL,OAAO,MAAM;YACrBK;YACA,mBAAmBL,OAAO,iBAAiB;YAC3C,YAAY,IACDI,QAAQ,OAAO;QAE9B;QAEAU,yBAAyB;YACrBF;QACJ;QACAR,QAAQ,OAAO,CAAC,QAAQ,CAAC;YAIrBW,wCAAwCH;SAC3C;IACL"}
package/sync/types.js CHANGED
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
@@ -1,13 +1,14 @@
1
1
  import { DynamoDBTableType } from "../../types.js";
2
- export const getTableType = tableName => {
3
- switch (tableName) {
4
- case process.env.DB_TABLE:
5
- return DynamoDBTableType.REGULAR;
6
- case process.env.DB_TABLE_OPENSEARCH:
7
- return DynamoDBTableType.OPENSEARCH;
8
- default:
9
- return DynamoDBTableType.UNKNOWN;
10
- }
2
+ const getTableType = (tableName)=>{
3
+ switch(tableName){
4
+ case process.env.DB_TABLE:
5
+ return DynamoDBTableType.REGULAR;
6
+ case process.env.DB_TABLE_OPENSEARCH:
7
+ return DynamoDBTableType.OPENSEARCH;
8
+ default:
9
+ return DynamoDBTableType.UNKNOWN;
10
+ }
11
11
  };
12
+ export { getTableType };
12
13
 
13
14
  //# sourceMappingURL=getTableType.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DynamoDBTableType","getTableType","tableName","process","env","DB_TABLE","REGULAR","DB_TABLE_OPENSEARCH","OPENSEARCH","UNKNOWN"],"sources":["getTableType.ts"],"sourcesContent":["import { DynamoDBTableType } from \"~/types.js\";\n\nexport const getTableType = (tableName: string): DynamoDBTableType => {\n switch (tableName) {\n case process.env.DB_TABLE:\n return DynamoDBTableType.REGULAR;\n case process.env.DB_TABLE_OPENSEARCH:\n return DynamoDBTableType.OPENSEARCH;\n default:\n return DynamoDBTableType.UNKNOWN;\n }\n};\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,OAAO,MAAMC,YAAY,GAAIC,SAAiB,IAAwB;EAClE,QAAQA,SAAS;IACb,KAAKC,OAAO,CAACC,GAAG,CAACC,QAAQ;MACrB,OAAOL,iBAAiB,CAACM,OAAO;IACpC,KAAKH,OAAO,CAACC,GAAG,CAACG,mBAAmB;MAChC,OAAOP,iBAAiB,CAACQ,UAAU;IACvC;MACI,OAAOR,iBAAiB,CAACS,OAAO;EACxC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"sync/utils/getTableType.js","sources":["../../../src/sync/utils/getTableType.ts"],"sourcesContent":["import { DynamoDBTableType } from \"~/types.js\";\n\nexport const getTableType = (tableName: string): DynamoDBTableType => {\n switch (tableName) {\n case process.env.DB_TABLE:\n return DynamoDBTableType.REGULAR;\n case process.env.DB_TABLE_OPENSEARCH:\n return DynamoDBTableType.OPENSEARCH;\n default:\n return DynamoDBTableType.UNKNOWN;\n }\n};\n"],"names":["getTableType","tableName","process","DynamoDBTableType"],"mappings":";AAEO,MAAMA,eAAe,CAACC;IACzB,OAAQA;QACJ,KAAKC,QAAQ,GAAG,CAAC,QAAQ;YACrB,OAAOC,kBAAkB,OAAO;QACpC,KAAKD,QAAQ,GAAG,CAAC,mBAAmB;YAChC,OAAOC,kBAAkB,UAAU;QACvC;YACI,OAAOA,kBAAkB,OAAO;IACxC;AACJ"}
@@ -2,43 +2,36 @@ import { ServiceDiscovery } from "@webiny/api";
2
2
  import zod from "zod";
3
3
  import { createZodError } from "@webiny/utils";
4
4
  const validateManifest = zod.object({
5
- sync: zod.object({
6
- eventBusArn: zod.string(),
7
- eventBusName: zod.string(),
8
- region: zod.string()
9
- })
5
+ sync: zod.object({
6
+ eventBusArn: zod.string(),
7
+ eventBusName: zod.string(),
8
+ region: zod.string()
9
+ })
10
10
  });
11
- export const getManifest = async params => {
12
- const documentClient = params.getDocumentClient();
13
- try {
14
- ServiceDiscovery.setDocumentClient(documentClient);
15
- const manifest = await ServiceDiscovery.load();
16
- if (!manifest?.sync) {
17
- return {
18
- /**
19
- * This error will be silent. We do not want to log or throw at this point.
20
- */
21
- error: new Error("Sync System Manifest not found. Probably Sync System is not turned on.")
22
- };
11
+ const getManifest = async (params)=>{
12
+ const documentClient = params.getDocumentClient();
13
+ try {
14
+ ServiceDiscovery.setDocumentClient(documentClient);
15
+ const manifest = await ServiceDiscovery.load();
16
+ if (!manifest?.sync) return {
17
+ error: new Error("Sync System Manifest not found. Probably Sync System is not turned on.")
18
+ };
19
+ const { data, error } = validateManifest.safeParse(manifest);
20
+ if (error) {
21
+ const err = createZodError(error);
22
+ return {
23
+ error: err
24
+ };
25
+ }
26
+ return {
27
+ data
28
+ };
29
+ } catch (ex) {
30
+ return {
31
+ error: ex
32
+ };
23
33
  }
24
- const {
25
- data,
26
- error
27
- } = validateManifest.safeParse(manifest);
28
- if (error) {
29
- const err = createZodError(error);
30
- return {
31
- error: err
32
- };
33
- }
34
- return {
35
- data
36
- };
37
- } catch (ex) {
38
- return {
39
- error: ex
40
- };
41
- }
42
34
  };
35
+ export { getManifest };
43
36
 
44
37
  //# sourceMappingURL=manifest.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ServiceDiscovery","zod","createZodError","validateManifest","object","sync","eventBusArn","string","eventBusName","region","getManifest","params","documentClient","getDocumentClient","setDocumentClient","manifest","load","error","Error","data","safeParse","err","ex"],"sources":["manifest.ts"],"sourcesContent":["import { ServiceDiscovery } from \"@webiny/api\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\n\nconst validateManifest = zod.object({\n sync: zod.object({\n eventBusArn: zod.string(),\n eventBusName: zod.string(),\n region: zod.string()\n })\n});\n\nexport interface IGetManifestParams {\n getDocumentClient(): Pick<DynamoDBDocument, \"send\">;\n}\n\nexport const getManifest = async (params: IGetManifestParams) => {\n const documentClient = params.getDocumentClient();\n try {\n ServiceDiscovery.setDocumentClient(documentClient);\n const manifest = await ServiceDiscovery.load();\n if (!manifest?.sync) {\n return {\n /**\n * This error will be silent. We do not want to log or throw at this point.\n */\n error: new Error(\n \"Sync System Manifest not found. Probably Sync System is not turned on.\"\n )\n };\n }\n const { data, error } = validateManifest.safeParse(manifest);\n if (error) {\n const err = createZodError(error);\n return {\n error: err\n };\n }\n return {\n data\n };\n } catch (ex) {\n return {\n error: ex\n };\n }\n};\n"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,aAAa;AAC9C,OAAOC,GAAG,MAAM,KAAK;AACrB,SAASC,cAAc,QAAQ,eAAe;AAG9C,MAAMC,gBAAgB,GAAGF,GAAG,CAACG,MAAM,CAAC;EAChCC,IAAI,EAAEJ,GAAG,CAACG,MAAM,CAAC;IACbE,WAAW,EAAEL,GAAG,CAACM,MAAM,CAAC,CAAC;IACzBC,YAAY,EAAEP,GAAG,CAACM,MAAM,CAAC,CAAC;IAC1BE,MAAM,EAAER,GAAG,CAACM,MAAM,CAAC;EACvB,CAAC;AACL,CAAC,CAAC;AAMF,OAAO,MAAMG,WAAW,GAAG,MAAOC,MAA0B,IAAK;EAC7D,MAAMC,cAAc,GAAGD,MAAM,CAACE,iBAAiB,CAAC,CAAC;EACjD,IAAI;IACAb,gBAAgB,CAACc,iBAAiB,CAACF,cAAc,CAAC;IAClD,MAAMG,QAAQ,GAAG,MAAMf,gBAAgB,CAACgB,IAAI,CAAC,CAAC;IAC9C,IAAI,CAACD,QAAQ,EAAEV,IAAI,EAAE;MACjB,OAAO;QACH;AAChB;AACA;QACgBY,KAAK,EAAE,IAAIC,KAAK,CACZ,wEACJ;MACJ,CAAC;IACL;IACA,MAAM;MAAEC,IAAI;MAAEF;IAAM,CAAC,GAAGd,gBAAgB,CAACiB,SAAS,CAACL,QAAQ,CAAC;IAC5D,IAAIE,KAAK,EAAE;MACP,MAAMI,GAAG,GAAGnB,cAAc,CAACe,KAAK,CAAC;MACjC,OAAO;QACHA,KAAK,EAAEI;MACX,CAAC;IACL;IACA,OAAO;MACHF;IACJ,CAAC;EACL,CAAC,CAAC,OAAOG,EAAE,EAAE;IACT,OAAO;MACHL,KAAK,EAAEK;IACX,CAAC;EACL;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"sync/utils/manifest.js","sources":["../../../src/sync/utils/manifest.ts"],"sourcesContent":["import { ServiceDiscovery } from \"@webiny/api\";\nimport zod from \"zod\";\nimport { createZodError } from \"@webiny/utils\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\n\nconst validateManifest = zod.object({\n sync: zod.object({\n eventBusArn: zod.string(),\n eventBusName: zod.string(),\n region: zod.string()\n })\n});\n\nexport interface IGetManifestParams {\n getDocumentClient(): Pick<DynamoDBDocument, \"send\">;\n}\n\nexport const getManifest = async (params: IGetManifestParams) => {\n const documentClient = params.getDocumentClient();\n try {\n ServiceDiscovery.setDocumentClient(documentClient);\n const manifest = await ServiceDiscovery.load();\n if (!manifest?.sync) {\n return {\n /**\n * This error will be silent. We do not want to log or throw at this point.\n */\n error: new Error(\n \"Sync System Manifest not found. Probably Sync System is not turned on.\"\n )\n };\n }\n const { data, error } = validateManifest.safeParse(manifest);\n if (error) {\n const err = createZodError(error);\n return {\n error: err\n };\n }\n return {\n data\n };\n } catch (ex) {\n return {\n error: ex\n };\n }\n};\n"],"names":["validateManifest","zod","getManifest","params","documentClient","ServiceDiscovery","manifest","Error","data","error","err","createZodError","ex"],"mappings":";;;AAKA,MAAMA,mBAAmBC,IAAI,MAAM,CAAC;IAChC,MAAMA,IAAI,MAAM,CAAC;QACb,aAAaA,IAAI,MAAM;QACvB,cAAcA,IAAI,MAAM;QACxB,QAAQA,IAAI,MAAM;IACtB;AACJ;AAMO,MAAMC,cAAc,OAAOC;IAC9B,MAAMC,iBAAiBD,OAAO,iBAAiB;IAC/C,IAAI;QACAE,iBAAiB,iBAAiB,CAACD;QACnC,MAAME,WAAW,MAAMD,iBAAiB,IAAI;QAC5C,IAAI,CAACC,UAAU,MACX,OAAO;YAIH,OAAO,IAAIC,MACP;QAER;QAEJ,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGT,iBAAiB,SAAS,CAACM;QACnD,IAAIG,OAAO;YACP,MAAMC,MAAMC,eAAeF;YAC3B,OAAO;gBACH,OAAOC;YACX;QACJ;QACA,OAAO;YACHF;QACJ;IACJ,EAAE,OAAOI,IAAI;QACT,OAAO;YACH,OAAOA;QACX;IACJ;AACJ"}
@@ -1,37 +1,29 @@
1
1
  import { createSystemName } from "../../utils/createSystemName.js";
2
- export const validateSystemInput = input => {
3
- const {
4
- env,
5
- region,
6
- variant,
7
- version
8
- } = input;
9
- if (!env) {
10
- return {
11
- error: "Sync System: No environment variable provided. Sync System will not be attached."
2
+ const validateSystemInput = (input)=>{
3
+ const { env, region, variant, version } = input;
4
+ if (!env) return {
5
+ error: "Sync System: No environment variable provided. Sync System will not be attached."
12
6
  };
13
- } else if (!region) {
14
- return {
15
- error: "Sync System: No region variable provided. Sync System will not be attached."
7
+ if (!region) return {
8
+ error: "Sync System: No region variable provided. Sync System will not be attached."
9
+ };
10
+ if (!version) return {
11
+ error: "Sync System: No version variable provided. Sync System will not be attached."
16
12
  };
17
- } else if (!version) {
13
+ const name = createSystemName({
14
+ env,
15
+ variant
16
+ });
18
17
  return {
19
- error: "Sync System: No version variable provided. Sync System will not be attached."
18
+ system: {
19
+ env,
20
+ name,
21
+ region,
22
+ variant,
23
+ version
24
+ }
20
25
  };
21
- }
22
- const name = createSystemName({
23
- env,
24
- variant
25
- });
26
- return {
27
- system: {
28
- env,
29
- name,
30
- region,
31
- variant,
32
- version
33
- }
34
- };
35
26
  };
27
+ export { validateSystemInput };
36
28
 
37
29
  //# sourceMappingURL=validateSystemInput.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createSystemName","validateSystemInput","input","env","region","variant","version","error","name","system"],"sources":["validateSystemInput.ts"],"sourcesContent":["import type { ISystem } from \"~/sync/types.js\";\nimport { createSystemName } from \"~/utils/createSystemName.js\";\n\nexport interface IValidResponse {\n system: ISystem;\n error?: never;\n}\n\nexport interface IErrorResponse {\n error: string;\n system?: never;\n}\n\nexport type ValidateSystemInputResponse = IValidResponse | IErrorResponse;\n\nexport const validateSystemInput = (input: Partial<ISystem>): ValidateSystemInputResponse => {\n const { env, region, variant, version } = input;\n if (!env) {\n return {\n error: \"Sync System: No environment variable provided. Sync System will not be attached.\"\n };\n } else if (!region) {\n return {\n error: \"Sync System: No region variable provided. Sync System will not be attached.\"\n };\n } else if (!version) {\n return {\n error: \"Sync System: No version variable provided. Sync System will not be attached.\"\n };\n }\n const name = createSystemName({\n env,\n variant\n });\n\n return {\n system: {\n env,\n name,\n region,\n variant,\n version\n }\n };\n};\n"],"mappings":"AACA,SAASA,gBAAgB;AAczB,OAAO,MAAMC,mBAAmB,GAAIC,KAAuB,IAAkC;EACzF,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,OAAO;IAAEC;EAAQ,CAAC,GAAGJ,KAAK;EAC/C,IAAI,CAACC,GAAG,EAAE;IACN,OAAO;MACHI,KAAK,EAAE;IACX,CAAC;EACL,CAAC,MAAM,IAAI,CAACH,MAAM,EAAE;IAChB,OAAO;MACHG,KAAK,EAAE;IACX,CAAC;EACL,CAAC,MAAM,IAAI,CAACD,OAAO,EAAE;IACjB,OAAO;MACHC,KAAK,EAAE;IACX,CAAC;EACL;EACA,MAAMC,IAAI,GAAGR,gBAAgB,CAAC;IAC1BG,GAAG;IACHE;EACJ,CAAC,CAAC;EAEF,OAAO;IACHI,MAAM,EAAE;MACJN,GAAG;MACHK,IAAI;MACJJ,MAAM;MACNC,OAAO;MACPC;IACJ;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"sync/utils/validateSystemInput.js","sources":["../../../src/sync/utils/validateSystemInput.ts"],"sourcesContent":["import type { ISystem } from \"~/sync/types.js\";\nimport { createSystemName } from \"~/utils/createSystemName.js\";\n\nexport interface IValidResponse {\n system: ISystem;\n error?: never;\n}\n\nexport interface IErrorResponse {\n error: string;\n system?: never;\n}\n\nexport type ValidateSystemInputResponse = IValidResponse | IErrorResponse;\n\nexport const validateSystemInput = (input: Partial<ISystem>): ValidateSystemInputResponse => {\n const { env, region, variant, version } = input;\n if (!env) {\n return {\n error: \"Sync System: No environment variable provided. Sync System will not be attached.\"\n };\n } else if (!region) {\n return {\n error: \"Sync System: No region variable provided. Sync System will not be attached.\"\n };\n } else if (!version) {\n return {\n error: \"Sync System: No version variable provided. Sync System will not be attached.\"\n };\n }\n const name = createSystemName({\n env,\n variant\n });\n\n return {\n system: {\n env,\n name,\n region,\n variant,\n version\n }\n };\n};\n"],"names":["validateSystemInput","input","env","region","variant","version","name","createSystemName"],"mappings":";AAeO,MAAMA,sBAAsB,CAACC;IAChC,MAAM,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAE,GAAGJ;IAC1C,IAAI,CAACC,KACD,OAAO;QACH,OAAO;IACX;IACG,IAAI,CAACC,QACR,OAAO;QACH,OAAO;IACX;IACG,IAAI,CAACE,SACR,OAAO;QACH,OAAO;IACX;IAEJ,MAAMC,OAAOC,iBAAiB;QAC1BL;QACAE;IACJ;IAEA,OAAO;QACH,QAAQ;YACJF;YACAI;YACAH;YACAC;YACAC;QACJ;IACJ;AACJ"}
package/types.js CHANGED
@@ -1,8 +1,9 @@
1
- export let DynamoDBTableType = /*#__PURE__*/function (DynamoDBTableType) {
2
- DynamoDBTableType["REGULAR"] = "regular";
3
- DynamoDBTableType["OPENSEARCH"] = "opensearch";
4
- DynamoDBTableType["UNKNOWN"] = "unknown";
5
- return DynamoDBTableType;
1
+ var types_DynamoDBTableType = /*#__PURE__*/ function(DynamoDBTableType) {
2
+ DynamoDBTableType["REGULAR"] = "regular";
3
+ DynamoDBTableType["OPENSEARCH"] = "opensearch";
4
+ DynamoDBTableType["UNKNOWN"] = "unknown";
5
+ return DynamoDBTableType;
6
6
  }({});
7
+ export { types_DynamoDBTableType as DynamoDBTableType };
7
8
 
8
9
  //# sourceMappingURL=types.js.map
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["DynamoDBTableType"],"sources":["types.ts"],"sourcesContent":["import type { Context as BaseContext } from \"@webiny/handler-aws/types.js\";\n\nexport type CommandType = \"put\" | \"delete\";\nexport type ExtendedCommandType = \"put\" | \"delete\" | \"update\";\nexport type AllCommandType = ExtendedCommandType | \"batchWrite\" | \"null\";\n\nexport enum DynamoDBTableType {\n REGULAR = \"regular\",\n OPENSEARCH = \"opensearch\",\n UNKNOWN = \"unknown\"\n}\n\nexport type Context = BaseContext;\n\nexport interface IFileLambdaPayloadInfo {\n bucket: string;\n region: string;\n}\n\nexport interface ICopyFileLambdaPayload {\n action: \"copyFile\";\n key: string;\n source: IFileLambdaPayloadInfo;\n target: IFileLambdaPayloadInfo;\n}\n\nexport interface IDeleteFileLambdaPayload {\n action: \"deleteFile\";\n key: string;\n target: IFileLambdaPayloadInfo;\n}\n\nexport interface IUserLambdaPayloadInfo {\n region: string;\n userPoolId: string;\n}\n\nexport interface IDeleteUserLambdaPayload {\n action: \"deleteUser\";\n username: string;\n target: IUserLambdaPayloadInfo;\n}\n\nexport interface ICopyUserLambdaPayload {\n action: \"createUser\" | \"updateUser\";\n username: string;\n source: IUserLambdaPayloadInfo;\n target: IUserLambdaPayloadInfo;\n}\n"],"mappings":"AAMA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type { Context as BaseContext } from \"@webiny/handler-aws/types.js\";\n\nexport type CommandType = \"put\" | \"delete\";\nexport type ExtendedCommandType = \"put\" | \"delete\" | \"update\";\nexport type AllCommandType = ExtendedCommandType | \"batchWrite\" | \"null\";\n\nexport enum DynamoDBTableType {\n REGULAR = \"regular\",\n OPENSEARCH = \"opensearch\",\n UNKNOWN = \"unknown\"\n}\n\nexport type Context = BaseContext;\n\nexport interface IFileLambdaPayloadInfo {\n bucket: string;\n region: string;\n}\n\nexport interface ICopyFileLambdaPayload {\n action: \"copyFile\";\n key: string;\n source: IFileLambdaPayloadInfo;\n target: IFileLambdaPayloadInfo;\n}\n\nexport interface IDeleteFileLambdaPayload {\n action: \"deleteFile\";\n key: string;\n target: IFileLambdaPayloadInfo;\n}\n\nexport interface IUserLambdaPayloadInfo {\n region: string;\n userPoolId: string;\n}\n\nexport interface IDeleteUserLambdaPayload {\n action: \"deleteUser\";\n username: string;\n target: IUserLambdaPayloadInfo;\n}\n\nexport interface ICopyUserLambdaPayload {\n action: \"createUser\" | \"updateUser\";\n username: string;\n source: IUserLambdaPayloadInfo;\n target: IUserLambdaPayloadInfo;\n}\n"],"names":["DynamoDBTableType"],"mappings":"AAMO,IAAKA,0BAAiBA,WAAAA,GAAAA,SAAjBA,iBAAiB;;;;WAAjBA"}
@@ -1,5 +1,7 @@
1
- export const createSystemName = params => {
2
- return [params.env, params.variant].filter(Boolean).join("#");
3
- };
1
+ const createSystemName = (params)=>[
2
+ params.env,
3
+ params.variant
4
+ ].filter(Boolean).join("#");
5
+ export { createSystemName };
4
6
 
5
7
  //# sourceMappingURL=createSystemName.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createSystemName","params","env","variant","filter","Boolean","join"],"sources":["createSystemName.ts"],"sourcesContent":["export interface ICreateSystemNameParams {\n env: string;\n variant: string | undefined;\n}\n\nexport const createSystemName = (params: ICreateSystemNameParams): string => {\n return [params.env, params.variant].filter(Boolean).join(\"#\");\n};\n"],"mappings":"AAKA,OAAO,MAAMA,gBAAgB,GAAIC,MAA+B,IAAa;EACzE,OAAO,CAACA,MAAM,CAACC,GAAG,EAAED,MAAM,CAACE,OAAO,CAAC,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;AACjE,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"utils/createSystemName.js","sources":["../../src/utils/createSystemName.ts"],"sourcesContent":["export interface ICreateSystemNameParams {\n env: string;\n variant: string | undefined;\n}\n\nexport const createSystemName = (params: ICreateSystemNameParams): string => {\n return [params.env, params.variant].filter(Boolean).join(\"#\");\n};\n"],"names":["createSystemName","params","Boolean"],"mappings":"AAKO,MAAMA,mBAAmB,CAACC,SACtB;QAACA,OAAO,GAAG;QAAEA,OAAO,OAAO;KAAC,CAAC,MAAM,CAACC,SAAS,IAAI,CAAC"}