@webiny/api-sync-system 0.0.0-unstable.9bd236cf5e → 0.0.0-unstable.ac6ebf63c6

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 (304) hide show
  1. package/README.md +6 -108
  2. package/constants.js +1 -7
  3. package/constants.js.map +1 -1
  4. package/index.js +3 -38
  5. package/index.js.map +1 -1
  6. package/package.json +20 -23
  7. package/resolver/app/RecordHandler.d.ts +6 -6
  8. package/resolver/app/RecordHandler.js +7 -15
  9. package/resolver/app/RecordHandler.js.map +1 -1
  10. package/resolver/app/RecordsValidation.js +6 -14
  11. package/resolver/app/RecordsValidation.js.map +1 -1
  12. package/resolver/app/ResolverApplication.d.ts +1 -1
  13. package/resolver/app/ResolverApplication.js +10 -18
  14. package/resolver/app/ResolverApplication.js.map +1 -1
  15. package/resolver/app/abstractions/RecordHandler.d.ts +1 -1
  16. package/resolver/app/abstractions/RecordHandler.js +1 -5
  17. package/resolver/app/abstractions/RecordsValidation.d.ts +2 -2
  18. package/resolver/app/abstractions/RecordsValidation.js +1 -5
  19. package/resolver/app/abstractions/RecordsValidation.js.map +1 -1
  20. package/resolver/app/abstractions/ResolverApplication.js +1 -5
  21. package/resolver/app/abstractions/ResolverRecord.d.ts +1 -1
  22. package/resolver/app/abstractions/ResolverRecord.js +1 -5
  23. package/resolver/app/abstractions/ResolverRecord.js.map +1 -1
  24. package/resolver/app/bundler/BaseBundle.d.ts +6 -6
  25. package/resolver/app/bundler/BaseBundle.js +1 -8
  26. package/resolver/app/bundler/BaseBundle.js.map +1 -1
  27. package/resolver/app/bundler/Bundler.d.ts +1 -1
  28. package/resolver/app/bundler/Bundler.js +2 -10
  29. package/resolver/app/bundler/Bundler.js.map +1 -1
  30. package/resolver/app/bundler/Bundles.d.ts +2 -2
  31. package/resolver/app/bundler/Bundles.js +2 -10
  32. package/resolver/app/bundler/Bundles.js.map +1 -1
  33. package/resolver/app/bundler/CommandBundle.d.ts +1 -1
  34. package/resolver/app/bundler/CommandBundle.js +3 -11
  35. package/resolver/app/bundler/CommandBundle.js.map +1 -1
  36. package/resolver/app/bundler/TableBundle.d.ts +1 -1
  37. package/resolver/app/bundler/TableBundle.js +3 -11
  38. package/resolver/app/bundler/TableBundle.js.map +1 -1
  39. package/resolver/app/bundler/types.d.ts +2 -2
  40. package/resolver/app/bundler/types.js +1 -5
  41. package/resolver/app/commandHandler/DeleteCommandHandler.d.ts +3 -3
  42. package/resolver/app/commandHandler/DeleteCommandHandler.js +1 -8
  43. package/resolver/app/commandHandler/DeleteCommandHandler.js.map +1 -1
  44. package/resolver/app/commandHandler/PutCommandHandler.d.ts +4 -4
  45. package/resolver/app/commandHandler/PutCommandHandler.js +1 -8
  46. package/resolver/app/commandHandler/PutCommandHandler.js.map +1 -1
  47. package/resolver/app/commandHandler/delete.d.ts +1 -1
  48. package/resolver/app/commandHandler/delete.js +6 -13
  49. package/resolver/app/commandHandler/delete.js.map +1 -1
  50. package/resolver/app/commandHandler/put.d.ts +1 -1
  51. package/resolver/app/commandHandler/put.js +6 -13
  52. package/resolver/app/commandHandler/put.js.map +1 -1
  53. package/resolver/app/data/SourceDataContainer.d.ts +3 -3
  54. package/resolver/app/data/SourceDataContainer.js +1 -8
  55. package/resolver/app/data/SourceDataContainer.js.map +1 -1
  56. package/resolver/app/data/types.d.ts +2 -2
  57. package/resolver/app/data/types.js +1 -5
  58. package/resolver/app/fetcher/Fetcher.d.ts +3 -3
  59. package/resolver/app/fetcher/Fetcher.js +13 -22
  60. package/resolver/app/fetcher/Fetcher.js.map +1 -1
  61. package/resolver/app/fetcher/types.d.ts +2 -2
  62. package/resolver/app/fetcher/types.js +1 -5
  63. package/resolver/app/ingestor/Ingestor.d.ts +1 -1
  64. package/resolver/app/ingestor/Ingestor.js +2 -10
  65. package/resolver/app/ingestor/Ingestor.js.map +1 -1
  66. package/resolver/app/ingestor/IngestorResult.js +3 -11
  67. package/resolver/app/ingestor/IngestorResult.js.map +1 -1
  68. package/resolver/app/ingestor/types.d.ts +2 -2
  69. package/resolver/app/ingestor/types.js +1 -5
  70. package/resolver/app/storer/Storer.d.ts +3 -3
  71. package/resolver/app/storer/Storer.js +12 -20
  72. package/resolver/app/storer/Storer.js.map +1 -1
  73. package/resolver/app/storer/types.d.ts +2 -2
  74. package/resolver/app/storer/types.js +1 -5
  75. package/resolver/app/storer/types.js.map +1 -1
  76. package/resolver/app/transform/TransformHandler.d.ts +4 -4
  77. package/resolver/app/transform/TransformHandler.js +5 -12
  78. package/resolver/app/transform/TransformHandler.js.map +1 -1
  79. package/resolver/app/transform/middleware.d.ts +1 -1
  80. package/resolver/app/transform/middleware.js +1 -7
  81. package/resolver/app/transform/middleware.js.map +1 -1
  82. package/resolver/app/utils/Retry.js +4 -12
  83. package/resolver/app/utils/Retry.js.map +1 -1
  84. package/resolver/app/utils/sleep.js +1 -8
  85. package/resolver/app/utils/sleep.js.map +1 -1
  86. package/resolver/app/validation/body.d.ts +43 -43
  87. package/resolver/app/validation/body.js +22 -30
  88. package/resolver/app/validation/body.js.map +1 -1
  89. package/resolver/app/validation/createJsonTransform.js +6 -14
  90. package/resolver/app/validation/createJsonTransform.js.map +1 -1
  91. package/resolver/app/validation/detail.d.ts +22 -22
  92. package/resolver/app/validation/detail.js +16 -24
  93. package/resolver/app/validation/detail.js.map +1 -1
  94. package/resolver/app/validation/event.d.ts +57 -57
  95. package/resolver/app/validation/event.js +19 -27
  96. package/resolver/app/validation/event.js.map +1 -1
  97. package/resolver/app/validation/numericString.js +5 -13
  98. package/resolver/app/validation/numericString.js.map +1 -1
  99. package/resolver/app/validation/system.d.ts +4 -4
  100. package/resolver/app/validation/system.js +8 -16
  101. package/resolver/app/validation/system.js.map +1 -1
  102. package/resolver/createEventHandlerPlugin.d.ts +2 -1
  103. package/resolver/createEventHandlerPlugin.js +35 -42
  104. package/resolver/createEventHandlerPlugin.js.map +1 -1
  105. package/resolver/createResolverHandler.d.ts +1 -1
  106. package/resolver/createResolverHandler.js +24 -31
  107. package/resolver/createResolverHandler.js.map +1 -1
  108. package/resolver/deployment/Deployment.d.ts +2 -3
  109. package/resolver/deployment/Deployment.js +6 -14
  110. package/resolver/deployment/Deployment.js.map +1 -1
  111. package/resolver/deployment/Deployments.js +2 -10
  112. package/resolver/deployment/Deployments.js.map +1 -1
  113. package/resolver/deployment/DeploymentsFetcher.js +33 -42
  114. package/resolver/deployment/DeploymentsFetcher.js.map +1 -1
  115. package/resolver/deployment/types.d.ts +4 -4
  116. package/resolver/deployment/types.js +1 -5
  117. package/resolver/deployment/types.js.map +1 -1
  118. package/resolver/lambda/LambdaTrigger.js +5 -12
  119. package/resolver/lambda/LambdaTrigger.js.map +1 -1
  120. package/resolver/plugins/CommandHandlerPlugin.d.ts +3 -3
  121. package/resolver/plugins/CommandHandlerPlugin.js +3 -11
  122. package/resolver/plugins/CommandHandlerPlugin.js.map +1 -1
  123. package/resolver/plugins/StorerAfterEachPlugin.d.ts +2 -2
  124. package/resolver/plugins/StorerAfterEachPlugin.js +4 -13
  125. package/resolver/plugins/StorerAfterEachPlugin.js.map +1 -1
  126. package/resolver/plugins/TransformRecordPlugin.d.ts +3 -3
  127. package/resolver/plugins/TransformRecordPlugin.js +3 -11
  128. package/resolver/plugins/TransformRecordPlugin.js.map +1 -1
  129. package/resolver/recordTypes/fileManager/CopyFile.js +4 -11
  130. package/resolver/recordTypes/fileManager/CopyFile.js.map +1 -1
  131. package/resolver/recordTypes/fileManager/DeleteFile.d.ts +1 -1
  132. package/resolver/recordTypes/fileManager/DeleteFile.js +3 -10
  133. package/resolver/recordTypes/fileManager/DeleteFile.js.map +1 -1
  134. package/resolver/recordTypes/fileManager/fileManager.d.ts +1 -1
  135. package/resolver/recordTypes/fileManager/fileManager.js +4 -11
  136. package/resolver/recordTypes/fileManager/fileManager.js.map +1 -1
  137. package/resolver/recordTypes/fileManager/fileManagerOnDelete.d.ts +1 -1
  138. package/resolver/recordTypes/fileManager/fileManagerOnDelete.js +7 -14
  139. package/resolver/recordTypes/fileManager/fileManagerOnDelete.js.map +1 -1
  140. package/resolver/recordTypes/fileManager/fileManagerOnPut.d.ts +1 -1
  141. package/resolver/recordTypes/fileManager/fileManagerOnPut.js +7 -14
  142. package/resolver/recordTypes/fileManager/fileManagerOnPut.js.map +1 -1
  143. package/resolver/recordTypes/fileManager/shouldBeHandled.d.ts +1 -1
  144. package/resolver/recordTypes/fileManager/shouldBeHandled.js +1 -8
  145. package/resolver/recordTypes/fileManager/shouldBeHandled.js.map +1 -1
  146. package/resolver/recordTypes/fileManager/types.d.ts +2 -2
  147. package/resolver/recordTypes/fileManager/types.js +1 -5
  148. package/resolver/recordTypes/users/CopyUser.d.ts +2 -2
  149. package/resolver/recordTypes/users/CopyUser.js +3 -10
  150. package/resolver/recordTypes/users/CopyUser.js.map +1 -1
  151. package/resolver/recordTypes/users/DeleteUser.d.ts +2 -2
  152. package/resolver/recordTypes/users/DeleteUser.js +3 -10
  153. package/resolver/recordTypes/users/DeleteUser.js.map +1 -1
  154. package/resolver/recordTypes/users/shouldBeHandled.d.ts +1 -1
  155. package/resolver/recordTypes/users/shouldBeHandled.js +1 -8
  156. package/resolver/recordTypes/users/shouldBeHandled.js.map +1 -1
  157. package/resolver/recordTypes/users/types.d.ts +1 -1
  158. package/resolver/recordTypes/users/types.js +1 -5
  159. package/resolver/recordTypes/users/types.js.map +1 -1
  160. package/resolver/recordTypes/users/users.js +4 -11
  161. package/resolver/recordTypes/users/users.js.map +1 -1
  162. package/resolver/recordTypes/users/usersOnDelete.d.ts +2 -2
  163. package/resolver/recordTypes/users/usersOnDelete.js +7 -14
  164. package/resolver/recordTypes/users/usersOnDelete.js.map +1 -1
  165. package/resolver/recordTypes/users/usersOnPut.d.ts +2 -2
  166. package/resolver/recordTypes/users/usersOnPut.js +7 -14
  167. package/resolver/recordTypes/users/usersOnPut.js.map +1 -1
  168. package/sync/FilterOutRecord.d.ts +2 -2
  169. package/sync/FilterOutRecord.js +2 -10
  170. package/sync/FilterOutRecord.js.map +1 -1
  171. package/sync/attachToDynamoDbDocument.d.ts +1 -1
  172. package/sync/attachToDynamoDbDocument.js +9 -17
  173. package/sync/attachToDynamoDbDocument.js.map +1 -1
  174. package/sync/createHandler.js +27 -34
  175. package/sync/createHandler.js.map +1 -1
  176. package/sync/createSendDataToEventBridgeOnRequestEnd.js +6 -13
  177. package/sync/createSendDataToEventBridgeOnRequestEnd.js.map +1 -1
  178. package/sync/createSyncSystem.d.ts +1 -1
  179. package/sync/createSyncSystem.js +6 -13
  180. package/sync/createSyncSystem.js.map +1 -1
  181. package/sync/filter/createDefaultFilterOutRecordPlugins.d.ts +1 -1
  182. package/sync/filter/createDefaultFilterOutRecordPlugins.js +9 -19
  183. package/sync/filter/createDefaultFilterOutRecordPlugins.js.map +1 -1
  184. package/sync/handler/Handler.d.ts +2 -2
  185. package/sync/handler/Handler.js +9 -17
  186. package/sync/handler/Handler.js.map +1 -1
  187. package/sync/handler/HandlerConverter.js +2 -10
  188. package/sync/handler/HandlerConverter.js.map +1 -1
  189. package/sync/handler/converter/BatchGetCommandConverter.js +6 -14
  190. package/sync/handler/converter/BatchGetCommandConverter.js.map +1 -1
  191. package/sync/handler/converter/BatchWriteCommandConverter.js +6 -14
  192. package/sync/handler/converter/BatchWriteCommandConverter.js.map +1 -1
  193. package/sync/handler/converter/DeleteCommandConverter.js +6 -14
  194. package/sync/handler/converter/DeleteCommandConverter.js.map +1 -1
  195. package/sync/handler/converter/GetCommandConverter.js +6 -14
  196. package/sync/handler/converter/GetCommandConverter.js.map +1 -1
  197. package/sync/handler/converter/PutCommandConverter.js +6 -14
  198. package/sync/handler/converter/PutCommandConverter.js.map +1 -1
  199. package/sync/handler/converter/QueryCommandConverter.js +6 -14
  200. package/sync/handler/converter/QueryCommandConverter.js.map +1 -1
  201. package/sync/handler/converter/ScanCommandConverter.js +6 -14
  202. package/sync/handler/converter/ScanCommandConverter.js.map +1 -1
  203. package/sync/handler/converter/UpdateCommandConverter.js +6 -14
  204. package/sync/handler/converter/UpdateCommandConverter.js.map +1 -1
  205. package/sync/handler/converter/commands/BatchWriteCommandValue.d.ts +2 -2
  206. package/sync/handler/converter/commands/BatchWriteCommandValue.js +4 -11
  207. package/sync/handler/converter/commands/BatchWriteCommandValue.js.map +1 -1
  208. package/sync/handler/converter/commands/DeleteCommandValue.d.ts +2 -2
  209. package/sync/handler/converter/commands/DeleteCommandValue.js +3 -10
  210. package/sync/handler/converter/commands/DeleteCommandValue.js.map +1 -1
  211. package/sync/handler/converter/commands/NullCommandValue.d.ts +1 -1
  212. package/sync/handler/converter/commands/NullCommandValue.js +1 -8
  213. package/sync/handler/converter/commands/NullCommandValue.js.map +1 -1
  214. package/sync/handler/converter/commands/PutCommandValue.d.ts +2 -2
  215. package/sync/handler/converter/commands/PutCommandValue.js +3 -10
  216. package/sync/handler/converter/commands/PutCommandValue.js.map +1 -1
  217. package/sync/handler/converter/commands/UpdateCommandValue.d.ts +2 -2
  218. package/sync/handler/converter/commands/UpdateCommandValue.js +3 -10
  219. package/sync/handler/converter/commands/UpdateCommandValue.js.map +1 -1
  220. package/sync/handler/types.d.ts +3 -3
  221. package/sync/handler/types.js +1 -5
  222. package/sync/handler/types.js.map +1 -1
  223. package/sync/plugins/FilterOutRecordPlugin.d.ts +1 -1
  224. package/sync/plugins/FilterOutRecordPlugin.js +3 -11
  225. package/sync/plugins/FilterOutRecordPlugin.js.map +1 -1
  226. package/sync/requestPlugin.d.ts +1 -1
  227. package/sync/requestPlugin.js +19 -20
  228. package/sync/requestPlugin.js.map +1 -1
  229. package/sync/types.js +1 -5
  230. package/sync/utils/getTableType.js +7 -14
  231. package/sync/utils/getTableType.js.map +1 -1
  232. package/sync/utils/manifest.d.ts +1 -1
  233. package/sync/utils/manifest.js +12 -20
  234. package/sync/utils/manifest.js.map +1 -1
  235. package/sync/utils/validateSystemInput.d.ts +1 -1
  236. package/sync/utils/validateSystemInput.js +3 -10
  237. package/sync/utils/validateSystemInput.js.map +1 -1
  238. package/types.d.ts +3 -4
  239. package/types.js +2 -8
  240. package/types.js.map +1 -1
  241. package/utils/createSystemName.js +1 -8
  242. package/utils/createSystemName.js.map +1 -1
  243. package/worker/actions/copyFile/CopyFile.js +13 -21
  244. package/worker/actions/copyFile/CopyFile.js.map +1 -1
  245. package/worker/actions/copyFile/copyFileAction.d.ts +1 -1
  246. package/worker/actions/copyFile/copyFileAction.js +9 -16
  247. package/worker/actions/copyFile/copyFileAction.js.map +1 -1
  248. package/worker/actions/copyFile/copyFileSchema.d.ts +2 -2
  249. package/worker/actions/copyFile/copyFileSchema.js +8 -16
  250. package/worker/actions/copyFile/copyFileSchema.js.map +1 -1
  251. package/worker/actions/copyFile/types.js +1 -5
  252. package/worker/actions/createUser/CreateUser.d.ts +1 -1
  253. package/worker/actions/createUser/CreateUser.js +9 -16
  254. package/worker/actions/createUser/CreateUser.js.map +1 -1
  255. package/worker/actions/createUser/createUserAction.d.ts +2 -2
  256. package/worker/actions/createUser/createUserAction.js +9 -16
  257. package/worker/actions/createUser/createUserAction.js.map +1 -1
  258. package/worker/actions/createUser/createUserSchema.d.ts +2 -2
  259. package/worker/actions/createUser/createUserSchema.js +8 -16
  260. package/worker/actions/createUser/createUserSchema.js.map +1 -1
  261. package/worker/actions/createUser/types.js +1 -5
  262. package/worker/actions/deleteFile/DeleteFile.js +4 -11
  263. package/worker/actions/deleteFile/DeleteFile.js.map +1 -1
  264. package/worker/actions/deleteFile/deleteFileAction.d.ts +1 -1
  265. package/worker/actions/deleteFile/deleteFileAction.js +9 -16
  266. package/worker/actions/deleteFile/deleteFileAction.js.map +1 -1
  267. package/worker/actions/deleteFile/deleteFileSchema.d.ts +2 -2
  268. package/worker/actions/deleteFile/deleteFileSchema.js +8 -16
  269. package/worker/actions/deleteFile/deleteFileSchema.js.map +1 -1
  270. package/worker/actions/deleteFile/types.js +1 -5
  271. package/worker/actions/deleteUser/DeleteUser.d.ts +2 -2
  272. package/worker/actions/deleteUser/DeleteUser.js +7 -14
  273. package/worker/actions/deleteUser/DeleteUser.js.map +1 -1
  274. package/worker/actions/deleteUser/deleteUserAction.d.ts +1 -1
  275. package/worker/actions/deleteUser/deleteUserAction.js +9 -16
  276. package/worker/actions/deleteUser/deleteUserAction.js.map +1 -1
  277. package/worker/actions/deleteUser/deleteUserSchema.js +8 -16
  278. package/worker/actions/deleteUser/deleteUserSchema.js.map +1 -1
  279. package/worker/actions/deleteUser/types.js +1 -5
  280. package/worker/actions/logValidationError.js +4 -11
  281. package/worker/actions/logValidationError.js.map +1 -1
  282. package/worker/actions/removeCognitoUserAttributes.js +1 -8
  283. package/worker/actions/removeCognitoUserAttributes.js.map +1 -1
  284. package/worker/actions/updateUser/UpdateUser.d.ts +1 -1
  285. package/worker/actions/updateUser/UpdateUser.js +9 -16
  286. package/worker/actions/updateUser/UpdateUser.js.map +1 -1
  287. package/worker/actions/updateUser/types.js +1 -5
  288. package/worker/actions/updateUser/updateUserAction.d.ts +2 -2
  289. package/worker/actions/updateUser/updateUserAction.js +9 -16
  290. package/worker/actions/updateUser/updateUserAction.js.map +1 -1
  291. package/worker/actions/updateUser/updateUserSchema.d.ts +2 -2
  292. package/worker/actions/updateUser/updateUserSchema.js +8 -16
  293. package/worker/actions/updateUser/updateUserSchema.js.map +1 -1
  294. package/worker/createWorkerHandler.js +17 -24
  295. package/worker/createWorkerHandler.js.map +1 -1
  296. package/worker/handler/WorkerActionHandler.d.ts +2 -2
  297. package/worker/handler/WorkerActionHandler.js +3 -10
  298. package/worker/handler/WorkerActionHandler.js.map +1 -1
  299. package/worker/handler/eventHandler.js +9 -16
  300. package/worker/handler/eventHandler.js.map +1 -1
  301. package/worker/plugins/WorkerActionPlugin.d.ts +1 -1
  302. package/worker/plugins/WorkerActionPlugin.js +3 -11
  303. package/worker/plugins/WorkerActionPlugin.js.map +1 -1
  304. package/worker/types.js +1 -5
@@ -1 +1 @@
1
- {"version":3,"names":["_index","require","_NullCommandValue","ScanCommandConverter","name","can","input","ScanCommand","convert","NullCommandValue","exports","createScanCommandConverter"],"sources":["ScanCommandConverter.ts"],"sourcesContent":["import { ScanCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { NullCommandValue } from \"./commands/NullCommandValue.js\";\n\nexport class ScanCommandConverter implements ICommandConverter {\n public readonly name: string = \"query\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof ScanCommand;\n }\n\n public convert() {\n return new NullCommandValue();\n }\n}\n\nexport const createScanCommandConverter = (): ICommandConverter => {\n return new ScanCommandConverter();\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,CAA8B;EAC3CC,IAAI,GAAW,OAAO;EAE/BC,GAAGA,CAACC,KAAuB,EAAW;IACzC,OAAOA,KAAK,YAAYC,kBAAW;EACvC;EAEOC,OAAOA,CAAA,EAAG;IACb,OAAO,IAAIC,kCAAgB,CAAC,CAAC;EACjC;AACJ;AAACC,OAAA,CAAAP,oBAAA,GAAAA,oBAAA;AAEM,MAAMQ,0BAA0B,GAAGA,CAAA,KAAyB;EAC/D,OAAO,IAAIR,oBAAoB,CAAC,CAAC;AACrC,CAAC;AAACO,OAAA,CAAAC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"names":["ScanCommand","NullCommandValue","ScanCommandConverter","name","can","input","convert","createScanCommandConverter"],"sources":["ScanCommandConverter.ts"],"sourcesContent":["import { ScanCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { NullCommandValue } from \"./commands/NullCommandValue.js\";\n\nexport class ScanCommandConverter implements ICommandConverter {\n public readonly name: string = \"query\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof ScanCommand;\n }\n\n public convert() {\n return new NullCommandValue();\n }\n}\n\nexport const createScanCommandConverter = (): ICommandConverter => {\n return new ScanCommandConverter();\n};\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0CAA0C;AAEtE,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,oBAAoB,CAA8B;EAC3CC,IAAI,GAAW,OAAO;EAE/BC,GAAGA,CAACC,KAAuB,EAAW;IACzC,OAAOA,KAAK,YAAYL,WAAW;EACvC;EAEOM,OAAOA,CAAA,EAAG;IACb,OAAO,IAAIL,gBAAgB,CAAC,CAAC;EACjC;AACJ;AAEA,OAAO,MAAMM,0BAA0B,GAAGA,CAAA,KAAyB;EAC/D,OAAO,IAAIL,oBAAoB,CAAC,CAAC;AACrC,CAAC","ignoreList":[]}
@@ -1,24 +1,16 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createUpdateCommandConverter = exports.UpdateCommandConverter = void 0;
7
- var _index = require("@webiny/aws-sdk/client-dynamodb/index.js");
8
- var _UpdateCommandValue = require("./commands/UpdateCommandValue.js");
9
- class UpdateCommandConverter {
1
+ import { UpdateCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
+ import { UpdateCommandValue } from "./commands/UpdateCommandValue.js";
3
+ export class UpdateCommandConverter {
10
4
  name = "update";
11
5
  can(input) {
12
- return input instanceof _index.UpdateCommand;
6
+ return input instanceof UpdateCommand;
13
7
  }
14
8
  convert(input) {
15
- return new _UpdateCommandValue.UpdateCommandValue(input);
9
+ return new UpdateCommandValue(input);
16
10
  }
17
11
  }
18
- exports.UpdateCommandConverter = UpdateCommandConverter;
19
- const createUpdateCommandConverter = () => {
12
+ export const createUpdateCommandConverter = () => {
20
13
  return new UpdateCommandConverter();
21
14
  };
22
- exports.createUpdateCommandConverter = createUpdateCommandConverter;
23
15
 
24
16
  //# sourceMappingURL=UpdateCommandConverter.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_index","require","_UpdateCommandValue","UpdateCommandConverter","name","can","input","UpdateCommand","convert","UpdateCommandValue","exports","createUpdateCommandConverter"],"sources":["UpdateCommandConverter.ts"],"sourcesContent":["import { UpdateCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { UpdateCommandValue } from \"./commands/UpdateCommandValue.js\";\n\nexport class UpdateCommandConverter implements ICommandConverter {\n public readonly name: string = \"update\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof UpdateCommand;\n }\n public convert(input: UpdateCommand) {\n return new UpdateCommandValue(input);\n }\n}\n\nexport const createUpdateCommandConverter = (): ICommandConverter => {\n return new UpdateCommandConverter();\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AAEO,MAAME,sBAAsB,CAA8B;EAC7CC,IAAI,GAAW,QAAQ;EAEhCC,GAAGA,CAACC,KAAuB,EAAW;IACzC,OAAOA,KAAK,YAAYC,oBAAa;EACzC;EACOC,OAAOA,CAACF,KAAoB,EAAE;IACjC,OAAO,IAAIG,sCAAkB,CAACH,KAAK,CAAC;EACxC;AACJ;AAACI,OAAA,CAAAP,sBAAA,GAAAA,sBAAA;AAEM,MAAMQ,4BAA4B,GAAGA,CAAA,KAAyB;EACjE,OAAO,IAAIR,sBAAsB,CAAC,CAAC;AACvC,CAAC;AAACO,OAAA,CAAAC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"names":["UpdateCommand","UpdateCommandValue","UpdateCommandConverter","name","can","input","convert","createUpdateCommandConverter"],"sources":["UpdateCommandConverter.ts"],"sourcesContent":["import { UpdateCommand } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { ICommandConverter, IDynamoDbCommand } from \"../../types.js\";\nimport { UpdateCommandValue } from \"./commands/UpdateCommandValue.js\";\n\nexport class UpdateCommandConverter implements ICommandConverter {\n public readonly name: string = \"update\";\n\n public can(input: IDynamoDbCommand): boolean {\n return input instanceof UpdateCommand;\n }\n public convert(input: UpdateCommand) {\n return new UpdateCommandValue(input);\n }\n}\n\nexport const createUpdateCommandConverter = (): ICommandConverter => {\n return new UpdateCommandConverter();\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,0CAA0C;AAExE,SAASC,kBAAkB;AAE3B,OAAO,MAAMC,sBAAsB,CAA8B;EAC7CC,IAAI,GAAW,QAAQ;EAEhCC,GAAGA,CAACC,KAAuB,EAAW;IACzC,OAAOA,KAAK,YAAYL,aAAa;EACzC;EACOM,OAAOA,CAACD,KAAoB,EAAE;IACjC,OAAO,IAAIJ,kBAAkB,CAACI,KAAK,CAAC;EACxC;AACJ;AAEA,OAAO,MAAME,4BAA4B,GAAGA,CAAA,KAAyB;EACjE,OAAO,IAAIL,sBAAsB,CAAC,CAAC;AACvC,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import type { BatchWriteCommand } from "@webiny/aws-sdk/client-dynamodb";
2
- import type { ICommandValue, ICommandValueItemExtended } from "../../../types.js";
1
+ import type { BatchWriteCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
+ import type { ICommandValue, ICommandValueItemExtended } from "../../../../sync/types.js";
3
3
  import type { NonEmptyArray } from "@webiny/api/types.js";
4
4
  export declare class BatchWriteCommandValue implements ICommandValue {
5
5
  readonly command = "batchWrite";
@@ -1,17 +1,11 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BatchWriteCommandValue = void 0;
7
- var _getTableType = require("../../../utils/getTableType.js");
1
+ import { getTableType } from "../../../utils/getTableType.js";
8
2
  const convert = items => {
9
3
  if (items.length === 0) {
10
4
  return null;
11
5
  }
12
6
  return items;
13
7
  };
14
- class BatchWriteCommandValue {
8
+ export class BatchWriteCommandValue {
15
9
  command = "batchWrite";
16
10
  items = [];
17
11
  constructor(input) {
@@ -25,7 +19,7 @@ class BatchWriteCommandValue {
25
19
  PK: item.PK,
26
20
  SK: item.SK,
27
21
  tableName,
28
- tableType: (0, _getTableType.getTableType)(tableName),
22
+ tableType: getTableType(tableName),
29
23
  input
30
24
  });
31
25
  } else if (value.DeleteRequest?.Key) {
@@ -35,7 +29,7 @@ class BatchWriteCommandValue {
35
29
  PK: item.PK,
36
30
  SK: item.SK,
37
31
  tableName,
38
- tableType: (0, _getTableType.getTableType)(tableName),
32
+ tableType: getTableType(tableName),
39
33
  input
40
34
  });
41
35
  }
@@ -46,6 +40,5 @@ class BatchWriteCommandValue {
46
40
  return convert(this.items);
47
41
  }
48
42
  }
49
- exports.BatchWriteCommandValue = BatchWriteCommandValue;
50
43
 
51
44
  //# sourceMappingURL=BatchWriteCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_getTableType","require","convert","items","length","BatchWriteCommandValue","command","constructor","input","tableName","RequestItems","values","value","PutRequest","Item","item","push","PK","SK","tableType","getTableType","DeleteRequest","Key","getItems","exports"],"sources":["BatchWriteCommandValue.ts"],"sourcesContent":["import type { BatchWriteCommand } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { ICommandValue, ICommandValueItemExtended } from \"~/sync/types.js\";\nimport type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport { getTableType } from \"~/sync/utils/getTableType.js\";\n\nconst convert = (\n items: ICommandValueItemExtended[]\n): NonEmptyArray<ICommandValueItemExtended> | null => {\n if (items.length === 0) {\n return null;\n }\n return items as NonEmptyArray<ICommandValueItemExtended>;\n};\n\nexport class BatchWriteCommandValue implements ICommandValue {\n public readonly command = \"batchWrite\";\n public readonly items: ICommandValueItemExtended[] = [];\n\n public constructor(input: BatchWriteCommand) {\n for (const tableName in input.input.RequestItems) {\n const values = input.input.RequestItems[tableName];\n for (const value of values) {\n if (value.PutRequest?.Item) {\n const item = value.PutRequest.Item;\n\n this.items.push({\n command: \"put\",\n PK: item.PK,\n SK: item.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n });\n } else if (value.DeleteRequest?.Key) {\n const item = value.DeleteRequest.Key;\n\n this.items.push({\n command: \"delete\",\n PK: item.PK,\n SK: item.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n });\n }\n }\n }\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> | null {\n return convert(this.items);\n }\n}\n"],"mappings":";;;;;;AAGA,IAAAA,aAAA,GAAAC,OAAA;AAEA,MAAMC,OAAO,GACTC,KAAkC,IACgB;EAClD,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACpB,OAAO,IAAI;EACf;EACA,OAAOD,KAAK;AAChB,CAAC;AAEM,MAAME,sBAAsB,CAA0B;EACzCC,OAAO,GAAG,YAAY;EACtBH,KAAK,GAAgC,EAAE;EAEhDI,WAAWA,CAACC,KAAwB,EAAE;IACzC,KAAK,MAAMC,SAAS,IAAID,KAAK,CAACA,KAAK,CAACE,YAAY,EAAE;MAC9C,MAAMC,MAAM,GAAGH,KAAK,CAACA,KAAK,CAACE,YAAY,CAACD,SAAS,CAAC;MAClD,KAAK,MAAMG,KAAK,IAAID,MAAM,EAAE;QACxB,IAAIC,KAAK,CAACC,UAAU,EAAEC,IAAI,EAAE;UACxB,MAAMC,IAAI,GAAGH,KAAK,CAACC,UAAU,CAACC,IAAI;UAElC,IAAI,CAACX,KAAK,CAACa,IAAI,CAAC;YACZV,OAAO,EAAE,KAAK;YACdW,EAAE,EAAEF,IAAI,CAACE,EAAE;YACXC,EAAE,EAAEH,IAAI,CAACG,EAAE;YACXT,SAAS;YACTU,SAAS,EAAE,IAAAC,0BAAY,EAACX,SAAS,CAAC;YAClCD;UACJ,CAAC,CAAC;QACN,CAAC,MAAM,IAAII,KAAK,CAACS,aAAa,EAAEC,GAAG,EAAE;UACjC,MAAMP,IAAI,GAAGH,KAAK,CAACS,aAAa,CAACC,GAAG;UAEpC,IAAI,CAACnB,KAAK,CAACa,IAAI,CAAC;YACZV,OAAO,EAAE,QAAQ;YACjBW,EAAE,EAAEF,IAAI,CAACE,EAAE;YACXC,EAAE,EAAEH,IAAI,CAACG,EAAE;YACXT,SAAS;YACTU,SAAS,EAAE,IAAAC,0BAAY,EAACX,SAAS,CAAC;YAClCD;UACJ,CAAC,CAAC;QACN;MACJ;IACJ;EACJ;EAEOe,QAAQA,CAAA,EAAoD;IAC/D,OAAOrB,OAAO,CAAC,IAAI,CAACC,KAAK,CAAC;EAC9B;AACJ;AAACqB,OAAA,CAAAnB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"names":["getTableType","convert","items","length","BatchWriteCommandValue","command","constructor","input","tableName","RequestItems","values","value","PutRequest","Item","item","push","PK","SK","tableType","DeleteRequest","Key","getItems"],"sources":["BatchWriteCommandValue.ts"],"sourcesContent":["import type { BatchWriteCommand } 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\nconst convert = (\n items: ICommandValueItemExtended[]\n): NonEmptyArray<ICommandValueItemExtended> | null => {\n if (items.length === 0) {\n return null;\n }\n return items as NonEmptyArray<ICommandValueItemExtended>;\n};\n\nexport class BatchWriteCommandValue implements ICommandValue {\n public readonly command = \"batchWrite\";\n public readonly items: ICommandValueItemExtended[] = [];\n\n public constructor(input: BatchWriteCommand) {\n for (const tableName in input.input.RequestItems) {\n const values = input.input.RequestItems[tableName];\n for (const value of values) {\n if (value.PutRequest?.Item) {\n const item = value.PutRequest.Item;\n\n this.items.push({\n command: \"put\",\n PK: item.PK,\n SK: item.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n });\n } else if (value.DeleteRequest?.Key) {\n const item = value.DeleteRequest.Key;\n\n this.items.push({\n command: \"delete\",\n PK: item.PK,\n SK: item.SK,\n tableName,\n tableType: getTableType(tableName),\n input\n });\n }\n }\n }\n }\n\n public getItems(): NonEmptyArray<ICommandValueItemExtended> | null {\n return convert(this.items);\n }\n}\n"],"mappings":"AAGA,SAASA,YAAY;AAErB,MAAMC,OAAO,GACTC,KAAkC,IACgB;EAClD,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACpB,OAAO,IAAI;EACf;EACA,OAAOD,KAAK;AAChB,CAAC;AAED,OAAO,MAAME,sBAAsB,CAA0B;EACzCC,OAAO,GAAG,YAAY;EACtBH,KAAK,GAAgC,EAAE;EAEhDI,WAAWA,CAACC,KAAwB,EAAE;IACzC,KAAK,MAAMC,SAAS,IAAID,KAAK,CAACA,KAAK,CAACE,YAAY,EAAE;MAC9C,MAAMC,MAAM,GAAGH,KAAK,CAACA,KAAK,CAACE,YAAY,CAACD,SAAS,CAAC;MAClD,KAAK,MAAMG,KAAK,IAAID,MAAM,EAAE;QACxB,IAAIC,KAAK,CAACC,UAAU,EAAEC,IAAI,EAAE;UACxB,MAAMC,IAAI,GAAGH,KAAK,CAACC,UAAU,CAACC,IAAI;UAElC,IAAI,CAACX,KAAK,CAACa,IAAI,CAAC;YACZV,OAAO,EAAE,KAAK;YACdW,EAAE,EAAEF,IAAI,CAACE,EAAE;YACXC,EAAE,EAAEH,IAAI,CAACG,EAAE;YACXT,SAAS;YACTU,SAAS,EAAElB,YAAY,CAACQ,SAAS,CAAC;YAClCD;UACJ,CAAC,CAAC;QACN,CAAC,MAAM,IAAII,KAAK,CAACQ,aAAa,EAAEC,GAAG,EAAE;UACjC,MAAMN,IAAI,GAAGH,KAAK,CAACQ,aAAa,CAACC,GAAG;UAEpC,IAAI,CAAClB,KAAK,CAACa,IAAI,CAAC;YACZV,OAAO,EAAE,QAAQ;YACjBW,EAAE,EAAEF,IAAI,CAACE,EAAE;YACXC,EAAE,EAAEH,IAAI,CAACG,EAAE;YACXT,SAAS;YACTU,SAAS,EAAElB,YAAY,CAACQ,SAAS,CAAC;YAClCD;UACJ,CAAC,CAAC;QACN;MACJ;IACJ;EACJ;EAEOc,QAAQA,CAAA,EAAoD;IAC/D,OAAOpB,OAAO,CAAC,IAAI,CAACC,KAAK,CAAC;EAC9B;AACJ","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import type { DeleteCommand } from "@webiny/aws-sdk/client-dynamodb";
2
- import type { ICommandValue, ICommandValueItemExtended } from "../../../types.js";
1
+ import type { DeleteCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
+ import type { ICommandValue, ICommandValueItemExtended } from "../../../../sync/types.js";
3
3
  import type { NonEmptyArray } from "@webiny/api/types.js";
4
4
  export declare class DeleteCommandValue implements ICommandValue {
5
5
  readonly command = "delete";
@@ -1,11 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DeleteCommandValue = void 0;
7
- var _getTableType = require("../../../utils/getTableType.js");
8
- class DeleteCommandValue {
1
+ import { getTableType } from "../../../utils/getTableType.js";
2
+ export class DeleteCommandValue {
9
3
  command = "delete";
10
4
  constructor(input) {
11
5
  const tableName = input.input.TableName;
@@ -14,7 +8,7 @@ class DeleteCommandValue {
14
8
  PK: input.input.Key.PK,
15
9
  SK: input.input.Key.SK,
16
10
  tableName,
17
- tableType: (0, _getTableType.getTableType)(tableName),
11
+ tableType: getTableType(tableName),
18
12
  input
19
13
  };
20
14
  }
@@ -22,6 +16,5 @@ class DeleteCommandValue {
22
16
  return [this.item];
23
17
  }
24
18
  }
25
- exports.DeleteCommandValue = DeleteCommandValue;
26
19
 
27
20
  //# sourceMappingURL=DeleteCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_getTableType","require","DeleteCommandValue","command","constructor","input","tableName","TableName","item","PK","Key","SK","tableType","getTableType","getItems","exports"],"sources":["DeleteCommandValue.ts"],"sourcesContent":["import type { DeleteCommand } from \"@webiny/aws-sdk/client-dynamodb\";\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,IAAAA,aAAA,GAAAC,OAAA;AAEO,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,EAAE,IAAAC,0BAAY,EAACP,SAAS,CAAC;MAClCD;IACJ,CAAC;EACL;EAEOS,QAAQA,CAAA,EAA6C;IACxD,OAAO,CAAC,IAAI,CAACN,IAAI,CAAC;EACtB;AACJ;AAACO,OAAA,CAAAb,kBAAA,GAAAA,kBAAA","ignoreList":[]}
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,4 +1,4 @@
1
- import type { ICommandValue } from "../../../types.js";
1
+ import type { ICommandValue } from "../../../../sync/types.js";
2
2
  export declare class NullCommandValue implements ICommandValue {
3
3
  /**
4
4
  * Does not matter what will be here, we will not use it.
@@ -1,10 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NullCommandValue = void 0;
7
- class NullCommandValue {
1
+ export class NullCommandValue {
8
2
  /**
9
3
  * Does not matter what will be here, we will not use it.
10
4
  */
@@ -13,6 +7,5 @@ class NullCommandValue {
13
7
  return null;
14
8
  }
15
9
  }
16
- exports.NullCommandValue = NullCommandValue;
17
10
 
18
11
  //# sourceMappingURL=NullCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NullCommandValue","command","getItems","exports"],"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":";;;;;;AAEO,MAAMA,gBAAgB,CAA0B;EACnD;AACJ;AACA;EACoBC,OAAO,GAAG,MAAM;EAEzBC,QAAQA,CAAA,EAAS;IACpB,OAAO,IAAI;EACf;AACJ;AAACC,OAAA,CAAAH,gBAAA,GAAAA,gBAAA","ignoreList":[]}
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,5 +1,5 @@
1
- import type { PutCommand } from "@webiny/aws-sdk/client-dynamodb";
2
- import type { ICommandValue, ICommandValueItemExtended } from "../../../types.js";
1
+ import type { PutCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
+ import type { ICommandValue, ICommandValueItemExtended } from "../../../../sync/types.js";
3
3
  import type { NonEmptyArray } from "@webiny/api/types.js";
4
4
  export declare class PutCommandValue implements ICommandValue {
5
5
  readonly command = "put";
@@ -1,11 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PutCommandValue = void 0;
7
- var _getTableType = require("../../../utils/getTableType.js");
8
- class PutCommandValue {
1
+ import { getTableType } from "../../../utils/getTableType.js";
2
+ export class PutCommandValue {
9
3
  command = "put";
10
4
  constructor(input) {
11
5
  const tableName = input.input.TableName;
@@ -14,7 +8,7 @@ class PutCommandValue {
14
8
  PK: input.input.Item.PK,
15
9
  SK: input.input.Item.SK,
16
10
  tableName,
17
- tableType: (0, _getTableType.getTableType)(tableName),
11
+ tableType: getTableType(tableName),
18
12
  input
19
13
  };
20
14
  }
@@ -22,6 +16,5 @@ class PutCommandValue {
22
16
  return [this.item];
23
17
  }
24
18
  }
25
- exports.PutCommandValue = PutCommandValue;
26
19
 
27
20
  //# sourceMappingURL=PutCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_getTableType","require","PutCommandValue","command","constructor","input","tableName","TableName","item","PK","Item","SK","tableType","getTableType","getItems","exports"],"sources":["PutCommandValue.ts"],"sourcesContent":["import type { PutCommand } from \"@webiny/aws-sdk/client-dynamodb\";\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,IAAAA,aAAA,GAAAC,OAAA;AAEO,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,EAAE,IAAAC,0BAAY,EAACP,SAAS,CAAC;MAClCD;IACJ,CAAC;EACL;EAEOS,QAAQA,CAAA,EAA6C;IACxD,OAAO,CAAC,IAAI,CAACN,IAAI,CAAC;EACtB;AACJ;AAACO,OAAA,CAAAb,eAAA,GAAAA,eAAA","ignoreList":[]}
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,5 +1,5 @@
1
- import type { UpdateCommand } from "@webiny/aws-sdk/client-dynamodb";
2
- import type { ICommandValue, ICommandValueItemExtended } from "../../../types.js";
1
+ import type { UpdateCommand } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
+ import type { ICommandValue, ICommandValueItemExtended } from "../../../../sync/types.js";
3
3
  import type { NonEmptyArray } from "@webiny/api/types.js";
4
4
  export declare class UpdateCommandValue implements ICommandValue {
5
5
  readonly command = "update";
@@ -1,11 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.UpdateCommandValue = void 0;
7
- var _getTableType = require("../../../utils/getTableType.js");
8
- class UpdateCommandValue {
1
+ import { getTableType } from "../../../utils/getTableType.js";
2
+ export class UpdateCommandValue {
9
3
  command = "update";
10
4
  constructor(input) {
11
5
  const tableName = input.input.TableName;
@@ -14,7 +8,7 @@ class UpdateCommandValue {
14
8
  PK: input.input.Key.PK,
15
9
  SK: input.input.Key.SK,
16
10
  tableName,
17
- tableType: (0, _getTableType.getTableType)(tableName),
11
+ tableType: getTableType(tableName),
18
12
  input
19
13
  };
20
14
  }
@@ -22,6 +16,5 @@ class UpdateCommandValue {
22
16
  return [this.item];
23
17
  }
24
18
  }
25
- exports.UpdateCommandValue = UpdateCommandValue;
26
19
 
27
20
  //# sourceMappingURL=UpdateCommandValue.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_getTableType","require","UpdateCommandValue","command","constructor","input","tableName","TableName","item","PK","Key","SK","tableType","getTableType","getItems","exports"],"sources":["UpdateCommandValue.ts"],"sourcesContent":["import type { UpdateCommand } from \"@webiny/aws-sdk/client-dynamodb\";\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,IAAAA,aAAA,GAAAC,OAAA;AAEO,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,EAAE,IAAAC,0BAAY,EAACP,SAAS,CAAC;MAClCD;IACJ,CAAC;EACL;EAEOS,QAAQA,CAAA,EAA6C;IACxD,OAAO,CAAC,IAAI,CAACN,IAAI,CAAC;EACtB;AACJ;AAACO,OAAA,CAAAb,kBAAA,GAAAA,kBAAA","ignoreList":[]}
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,12 +1,12 @@
1
- import type { NonEmptyArray } from "@webiny/api/types";
1
+ import type { NonEmptyArray } from "@webiny/api/types.js";
2
2
  import type { DynamoDBTableType, ExtendedCommandType } from "../../types.js";
3
- import type { ISystem } from "../types";
3
+ import type { ISystem } from "../types.js";
4
4
  export interface IDetailItem {
5
5
  PK: string;
6
6
  SK: string;
7
7
  command: ExtendedCommandType;
8
8
  /**
9
- * There will be multiple tables that will get populated through the system (regular table and elasticsearch for start).
9
+ * There will be multiple tables that will get populated through the system (regular table and opensearch for start).
10
10
  */
11
11
  tableName: string;
12
12
  tableType: DynamoDBTableType;
@@ -1,7 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
6
2
 
7
3
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { NonEmptyArray } from \"@webiny/api/types\";\nimport type { DynamoDBTableType, ExtendedCommandType } from \"~/types.js\";\nimport type { ISystem } from \"../types\";\n\nexport interface IDetailItem {\n PK: string;\n SK: string;\n command: ExtendedCommandType;\n /**\n * There will be multiple tables that will get populated through the system (regular table and elasticsearch for start).\n */\n tableName: string;\n tableType: DynamoDBTableType;\n}\n\nexport interface IDetail {\n items: NonEmptyArray<IDetailItem>;\n source: ISystem;\n id: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { NonEmptyArray } from \"@webiny/api/types.js\";\nimport type { DynamoDBTableType, ExtendedCommandType } from \"~/types.js\";\nimport type { ISystem } from \"../types.js\";\n\nexport interface IDetailItem {\n PK: string;\n SK: string;\n command: ExtendedCommandType;\n /**\n * There will be multiple tables that will get populated through the system (regular table and opensearch for start).\n */\n tableName: string;\n tableType: DynamoDBTableType;\n}\n\nexport interface IDetail {\n items: NonEmptyArray<IDetailItem>;\n source: ISystem;\n id: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins/Plugin.js";
2
- import type { ICommandValueItemExtended } from "../types.js";
2
+ import type { ICommandValueItemExtended } from "../../sync/types.js";
3
3
  export interface IFilterOutRecordPluginCallable {
4
4
  (record: ICommandValueItemExtended): boolean;
5
5
  }
@@ -1,11 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createFilterOutRecordPlugin = exports.FilterOutRecordPlugin = void 0;
7
- var _Plugin = require("@webiny/plugins/Plugin.js");
8
- class FilterOutRecordPlugin extends _Plugin.Plugin {
1
+ import { Plugin } from "@webiny/plugins/Plugin.js";
2
+ export class FilterOutRecordPlugin extends Plugin {
9
3
  static type = "sync.filterOut.record";
10
4
  constructor(params) {
11
5
  super();
@@ -22,10 +16,8 @@ class FilterOutRecordPlugin extends _Plugin.Plugin {
22
16
  return `${FilterOutRecordPlugin.type}.${name}`;
23
17
  }
24
18
  }
25
- exports.FilterOutRecordPlugin = FilterOutRecordPlugin;
26
- const createFilterOutRecordPlugin = params => {
19
+ export const createFilterOutRecordPlugin = params => {
27
20
  return new FilterOutRecordPlugin(params);
28
21
  };
29
- exports.createFilterOutRecordPlugin = createFilterOutRecordPlugin;
30
22
 
31
23
  //# sourceMappingURL=FilterOutRecordPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_Plugin","require","FilterOutRecordPlugin","Plugin","type","constructor","params","name","cb","filterOut","execute","item","createName","exports","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,IAAAA,OAAA,GAAAC,OAAA;AAeO,MAAMC,qBAAqB,SAASC,cAAM,CAAC;EAC9C,OAAgCC,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,GAAGL,qBAAqB,CAACE,IAAI,IAAIG,IAAI,EAAE;EAClD;AACJ;AAACM,OAAA,CAAAX,qBAAA,GAAAA,qBAAA;AAEM,MAAMY,2BAA2B,GACpCR,MAAoC,IACZ;EACxB,OAAO,IAAIJ,qBAAqB,CAACI,MAAM,CAAC;AAC5C,CAAC;AAACO,OAAA,CAAAC,2BAAA,GAAAA,2BAAA","ignoreList":[]}
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,5 +1,5 @@
1
1
  import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
- import type { ICommandConverter, IGetEventBridgeCallable, ISystem } from "./types.js";
2
+ import type { ICommandConverter, IGetEventBridgeCallable, ISystem } from "../sync/types.js";
3
3
  export interface ICreateSyncSystemHandlerOnRequestPluginParams {
4
4
  getDocumentClient(): Pick<DynamoDBDocument, "send">;
5
5
  getEventBridgeClient: IGetEventBridgeCallable;
@@ -1,28 +1,28 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createSyncSystemHandlerOnRequestPlugin = void 0;
7
- var _handler = require("@webiny/handler");
8
- var _manifest = require("./utils/manifest.js");
9
- var _attachToDynamoDbDocument = require("./attachToDynamoDbDocument.js");
10
- var _createSendDataToEventBridgeOnRequestEnd = require("./createSendDataToEventBridgeOnRequestEnd.js");
11
- var _createHandler = require("./createHandler.js");
12
- var _exception = require("@webiny/utils/exception.js");
13
- const createSyncSystemHandlerOnRequestPlugin = params => {
14
- return (0, _handler.createHandlerOnRequest)(async (_, __, context) => {
1
+ import { createHandlerOnRequest } from "@webiny/handler";
2
+ import { getManifest } from "./utils/manifest.js";
3
+ import { attachToDynamoDbDocument } from "./attachToDynamoDbDocument.js";
4
+ import { createSendDataToEventBridgeOnRequestEnd } from "./createSendDataToEventBridgeOnRequestEnd.js";
5
+ import { createHandler } from "./createHandler.js";
6
+ import { convertException } from "@webiny/utils/exception.js";
7
+ export const createSyncSystemHandlerOnRequestPlugin = params => {
8
+ return createHandlerOnRequest(async (_, __, context) => {
15
9
  const {
16
10
  data: manifest,
17
11
  error
18
- } = await (0, _manifest.getManifest)(params);
12
+ } = await getManifest(params);
19
13
  if (error) {
14
+ if (process.env.DEBUG !== "true") {
15
+ return;
16
+ }
20
17
  console.error("Error happened when fetching manifest.");
21
18
  console.log(JSON.stringify({
22
- error: (0, _exception.convertException)(error)
19
+ error: convertException(error)
23
20
  }));
24
21
  return;
25
22
  } else if (!manifest?.sync?.region) {
23
+ if (process.env.DEBUG !== "true") {
24
+ return;
25
+ }
26
26
  console.error("There is no manifest.");
27
27
  console.log(JSON.stringify({
28
28
  manifest
@@ -31,7 +31,7 @@ const createSyncSystemHandlerOnRequestPlugin = params => {
31
31
  }
32
32
  const {
33
33
  handler
34
- } = (0, _createHandler.createHandler)({
34
+ } = createHandler({
35
35
  getEventBridgeClient: () => {
36
36
  return params.getEventBridgeClient({
37
37
  region: manifest.sync.region
@@ -44,16 +44,15 @@ const createSyncSystemHandlerOnRequestPlugin = params => {
44
44
  return context.plugins;
45
45
  }
46
46
  });
47
- (0, _attachToDynamoDbDocument.attachToDynamoDbDocument)({
47
+ attachToDynamoDbDocument({
48
48
  handler
49
49
  });
50
50
  context.plugins.register([
51
51
  /**
52
52
  * When request ends, send the data to the EventBridge.
53
53
  */
54
- (0, _createSendDataToEventBridgeOnRequestEnd.createSendDataToEventBridgeOnRequestEnd)(handler)]);
54
+ createSendDataToEventBridgeOnRequestEnd(handler)]);
55
55
  });
56
56
  };
57
- exports.createSyncSystemHandlerOnRequestPlugin = createSyncSystemHandlerOnRequestPlugin;
58
57
 
59
58
  //# sourceMappingURL=requestPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_handler","require","_manifest","_attachToDynamoDbDocument","_createSendDataToEventBridgeOnRequestEnd","_createHandler","_exception","createSyncSystemHandlerOnRequestPlugin","params","createHandlerOnRequest","_","__","context","data","manifest","error","getManifest","console","log","JSON","stringify","convertException","sync","region","handler","createHandler","getEventBridgeClient","system","commandConverters","getPlugins","plugins","attachToDynamoDbDocument","register","createSendDataToEventBridgeOnRequestEnd","exports"],"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 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 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,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,wCAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AASO,MAAMM,sCAAsC,GAC/CC,MAAqD,IACpD;EACD,OAAO,IAAAC,+BAAsB,EAAC,OAAOC,CAAC,EAAEC,EAAE,EAAEC,OAAO,KAAK;IACpD,MAAM;MAAEC,IAAI,EAAEC,QAAQ;MAAEC;IAAM,CAAC,GAAG,MAAM,IAAAC,qBAAW,EAACR,MAAM,CAAC;IAC3D,IAAIO,KAAK,EAAE;MACPE,OAAO,CAACF,KAAK,CAAC,wCAAwC,CAAC;MACvDE,OAAO,CAACC,GAAG,CACPC,IAAI,CAACC,SAAS,CAAC;QACXL,KAAK,EAAE,IAAAM,2BAAgB,EAACN,KAAK;MACjC,CAAC,CACL,CAAC;MACD;IACJ,CAAC,MAAM,IAAI,CAACD,QAAQ,EAAEQ,IAAI,EAAEC,MAAM,EAAE;MAChCN,OAAO,CAACF,KAAK,CAAC,uBAAuB,CAAC;MACtCE,OAAO,CAACC,GAAG,CACPC,IAAI,CAACC,SAAS,CAAC;QACXN;MACJ,CAAC,CACL,CAAC;MACD;IACJ;IAEA,MAAM;MAAEU;IAAQ,CAAC,GAAG,IAAAC,4BAAa,EAAC;MAC9BC,oBAAoB,EAAEA,CAAA,KAAM;QACxB,OAAOlB,MAAM,CAACkB,oBAAoB,CAAC;UAC/BH,MAAM,EAAET,QAAQ,CAACQ,IAAI,CAACC;QAC1B,CAAC,CAAC;MACN,CAAC;MACDI,MAAM,EAAEnB,MAAM,CAACmB,MAAM;MACrBb,QAAQ;MACRc,iBAAiB,EAAEpB,MAAM,CAACoB,iBAAiB;MAC3CC,UAAU,EAAEA,CAAA,KAAM;QACd,OAAOjB,OAAO,CAACkB,OAAO;MAC1B;IACJ,CAAC,CAAC;IAEF,IAAAC,kDAAwB,EAAC;MACrBP;IACJ,CAAC,CAAC;IACFZ,OAAO,CAACkB,OAAO,CAACE,QAAQ,CAAC;IACrB;AACZ;AACA;IACY,IAAAC,gFAAuC,EAACT,OAAO,CAAC,CACnD,CAAC;EACN,CAAC,CAAC;AACN,CAAC;AAACU,OAAA,CAAA3B,sCAAA,GAAAA,sCAAA","ignoreList":[]}
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":[]}
package/sync/types.js CHANGED
@@ -1,7 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
1
+ export {};
6
2
 
7
3
  //# sourceMappingURL=types.js.map
@@ -1,22 +1,15 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTableType = void 0;
7
- var _types = require("../../types.js");
8
- const getTableType = tableName => {
1
+ import { DynamoDBTableType } from "../../types.js";
2
+ export const getTableType = tableName => {
9
3
  switch (tableName) {
10
4
  case process.env.DB_TABLE:
11
- return _types.DynamoDBTableType.REGULAR;
12
- case process.env.DB_TABLE_ELASTICSEARCH:
13
- return _types.DynamoDBTableType.ELASTICSEARCH;
5
+ return DynamoDBTableType.REGULAR;
6
+ case process.env.DB_TABLE_OPENSEARCH:
7
+ return DynamoDBTableType.OPENSEARCH;
14
8
  case process.env.DB_TABLE_LOG:
15
- return _types.DynamoDBTableType.LOG;
9
+ return DynamoDBTableType.LOG;
16
10
  default:
17
- return _types.DynamoDBTableType.UNKNOWN;
11
+ return DynamoDBTableType.UNKNOWN;
18
12
  }
19
13
  };
20
- exports.getTableType = getTableType;
21
14
 
22
15
  //# sourceMappingURL=getTableType.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","getTableType","tableName","process","env","DB_TABLE","DynamoDBTableType","REGULAR","DB_TABLE_ELASTICSEARCH","ELASTICSEARCH","DB_TABLE_LOG","LOG","UNKNOWN","exports"],"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_ELASTICSEARCH:\n return DynamoDBTableType.ELASTICSEARCH;\n case process.env.DB_TABLE_LOG:\n return DynamoDBTableType.LOG;\n default:\n return DynamoDBTableType.UNKNOWN;\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,GAAIC,SAAiB,IAAwB;EAClE,QAAQA,SAAS;IACb,KAAKC,OAAO,CAACC,GAAG,CAACC,QAAQ;MACrB,OAAOC,wBAAiB,CAACC,OAAO;IACpC,KAAKJ,OAAO,CAACC,GAAG,CAACI,sBAAsB;MACnC,OAAOF,wBAAiB,CAACG,aAAa;IAC1C,KAAKN,OAAO,CAACC,GAAG,CAACM,YAAY;MACzB,OAAOJ,wBAAiB,CAACK,GAAG;IAChC;MACI,OAAOL,wBAAiB,CAACM,OAAO;EACxC;AACJ,CAAC;AAACC,OAAA,CAAAZ,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["DynamoDBTableType","getTableType","tableName","process","env","DB_TABLE","REGULAR","DB_TABLE_OPENSEARCH","OPENSEARCH","DB_TABLE_LOG","LOG","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 case process.env.DB_TABLE_LOG:\n return DynamoDBTableType.LOG;\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,KAAKL,OAAO,CAACC,GAAG,CAACK,YAAY;MACzB,OAAOT,iBAAiB,CAACU,GAAG;IAChC;MACI,OAAOV,iBAAiB,CAACW,OAAO;EACxC;AACJ,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
1
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
2
  export interface IGetManifestParams {
3
3
  getDocumentClient(): Pick<DynamoDBDocument, "send">;
4
4
  }
@@ -1,25 +1,18 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getManifest = void 0;
8
- var _api = require("@webiny/api");
9
- var _zod = _interopRequireDefault(require("zod"));
10
- var _utils = require("@webiny/utils");
11
- const validateManifest = _zod.default.object({
12
- sync: _zod.default.object({
13
- eventBusArn: _zod.default.string(),
14
- eventBusName: _zod.default.string(),
15
- region: _zod.default.string()
1
+ import { ServiceDiscovery } from "@webiny/api";
2
+ import zod from "zod";
3
+ import { createZodError } from "@webiny/utils";
4
+ const validateManifest = zod.object({
5
+ sync: zod.object({
6
+ eventBusArn: zod.string(),
7
+ eventBusName: zod.string(),
8
+ region: zod.string()
16
9
  })
17
10
  });
18
- const getManifest = async params => {
11
+ export const getManifest = async params => {
19
12
  const documentClient = params.getDocumentClient();
20
13
  try {
21
- _api.ServiceDiscovery.setDocumentClient(documentClient);
22
- const manifest = await _api.ServiceDiscovery.load();
14
+ ServiceDiscovery.setDocumentClient(documentClient);
15
+ const manifest = await ServiceDiscovery.load();
23
16
  if (!manifest?.sync) {
24
17
  return {
25
18
  /**
@@ -33,7 +26,7 @@ const getManifest = async params => {
33
26
  error
34
27
  } = validateManifest.safeParse(manifest);
35
28
  if (error) {
36
- const err = (0, _utils.createZodError)(error);
29
+ const err = createZodError(error);
37
30
  return {
38
31
  error: err
39
32
  };
@@ -47,6 +40,5 @@ const getManifest = async params => {
47
40
  };
48
41
  }
49
42
  };
50
- exports.getManifest = getManifest;
51
43
 
52
44
  //# sourceMappingURL=manifest.js.map