@webiny/api-sync-system 0.0.0-unstable.06b2ede40f → 0.0.0-unstable.0d717d18dd

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 (349) hide show
  1. package/README.md +6 -108
  2. package/constants.js +2 -7
  3. package/constants.js.map +1 -1
  4. package/index.d.ts +11 -3
  5. package/index.js +8 -40
  6. package/package.json +31 -26
  7. package/resolver/SyncResolverConfig.d.ts +17 -0
  8. package/resolver/SyncResolverConfig.js +5 -0
  9. package/resolver/SyncResolverConfig.js.map +1 -0
  10. package/resolver/SyncResolverLambdaHandler.d.ts +14 -0
  11. package/resolver/SyncResolverLambdaHandler.js +159 -0
  12. package/resolver/SyncResolverLambdaHandler.js.map +1 -0
  13. package/resolver/app/RecordHandler.d.ts +6 -6
  14. package/resolver/app/RecordHandler.js +84 -114
  15. package/resolver/app/RecordHandler.js.map +1 -1
  16. package/resolver/app/RecordsValidation.js +13 -24
  17. package/resolver/app/RecordsValidation.js.map +1 -1
  18. package/resolver/app/ResolverApplication.d.ts +1 -1
  19. package/resolver/app/ResolverApplication.js +27 -42
  20. package/resolver/app/ResolverApplication.js.map +1 -1
  21. package/resolver/app/abstractions/RecordHandler.d.ts +1 -1
  22. package/resolver/app/abstractions/RecordHandler.js +0 -7
  23. package/resolver/app/abstractions/RecordsValidation.d.ts +2 -2
  24. package/resolver/app/abstractions/RecordsValidation.js +0 -7
  25. package/resolver/app/abstractions/ResolverApplication.js +0 -7
  26. package/resolver/app/abstractions/ResolverRecord.d.ts +1 -1
  27. package/resolver/app/abstractions/ResolverRecord.js +0 -7
  28. package/resolver/app/bundler/BaseBundle.d.ts +6 -6
  29. package/resolver/app/bundler/BaseBundle.js +16 -22
  30. package/resolver/app/bundler/BaseBundle.js.map +1 -1
  31. package/resolver/app/bundler/Bundler.d.ts +1 -1
  32. package/resolver/app/bundler/Bundler.js +12 -25
  33. package/resolver/app/bundler/Bundler.js.map +1 -1
  34. package/resolver/app/bundler/Bundles.d.ts +2 -2
  35. package/resolver/app/bundler/Bundles.js +20 -33
  36. package/resolver/app/bundler/Bundles.js.map +1 -1
  37. package/resolver/app/bundler/CommandBundle.d.ts +1 -1
  38. package/resolver/app/bundler/CommandBundle.js +8 -25
  39. package/resolver/app/bundler/CommandBundle.js.map +1 -1
  40. package/resolver/app/bundler/TableBundle.d.ts +1 -1
  41. package/resolver/app/bundler/TableBundle.js +7 -22
  42. package/resolver/app/bundler/TableBundle.js.map +1 -1
  43. package/resolver/app/bundler/types.d.ts +2 -2
  44. package/resolver/app/bundler/types.js +0 -7
  45. package/resolver/app/commandHandler/DeleteCommandHandler.d.ts +3 -3
  46. package/resolver/app/commandHandler/DeleteCommandHandler.js +21 -35
  47. package/resolver/app/commandHandler/DeleteCommandHandler.js.map +1 -1
  48. package/resolver/app/commandHandler/PutCommandHandler.d.ts +4 -4
  49. package/resolver/app/commandHandler/PutCommandHandler.js +15 -28
  50. package/resolver/app/commandHandler/PutCommandHandler.js.map +1 -1
  51. package/resolver/app/commandHandler/delete.d.ts +1 -1
  52. package/resolver/app/commandHandler/delete.js +13 -21
  53. package/resolver/app/commandHandler/delete.js.map +1 -1
  54. package/resolver/app/commandHandler/put.d.ts +1 -1
  55. package/resolver/app/commandHandler/put.js +13 -21
  56. package/resolver/app/commandHandler/put.js.map +1 -1
  57. package/resolver/app/data/SourceDataContainer.d.ts +3 -3
  58. package/resolver/app/data/SourceDataContainer.js +27 -36
  59. package/resolver/app/data/SourceDataContainer.js.map +1 -1
  60. package/resolver/app/data/types.d.ts +2 -2
  61. package/resolver/app/data/types.js +0 -7
  62. package/resolver/app/fetcher/Fetcher.d.ts +3 -3
  63. package/resolver/app/fetcher/Fetcher.js +87 -121
  64. package/resolver/app/fetcher/Fetcher.js.map +1 -1
  65. package/resolver/app/fetcher/types.d.ts +2 -2
  66. package/resolver/app/fetcher/types.js +0 -7
  67. package/resolver/app/ingestor/Ingestor.d.ts +1 -1
  68. package/resolver/app/ingestor/Ingestor.js +26 -39
  69. package/resolver/app/ingestor/Ingestor.js.map +1 -1
  70. package/resolver/app/ingestor/IngestorResult.js +27 -39
  71. package/resolver/app/ingestor/IngestorResult.js.map +1 -1
  72. package/resolver/app/ingestor/types.d.ts +2 -2
  73. package/resolver/app/ingestor/types.js +0 -7
  74. package/resolver/app/storer/Storer.d.ts +3 -3
  75. package/resolver/app/storer/Storer.js +73 -95
  76. package/resolver/app/storer/Storer.js.map +1 -1
  77. package/resolver/app/storer/types.d.ts +2 -2
  78. package/resolver/app/storer/types.js +0 -7
  79. package/resolver/app/transform/TransformHandler.d.ts +4 -4
  80. package/resolver/app/transform/TransformHandler.js +46 -64
  81. package/resolver/app/transform/TransformHandler.js.map +1 -1
  82. package/resolver/app/transform/middleware.d.ts +1 -1
  83. package/resolver/app/transform/middleware.js +12 -25
  84. package/resolver/app/transform/middleware.js.map +1 -1
  85. package/resolver/app/utils/Retry.js +21 -32
  86. package/resolver/app/utils/Retry.js.map +1 -1
  87. package/resolver/app/utils/sleep.js +4 -12
  88. package/resolver/app/utils/sleep.js.map +1 -1
  89. package/resolver/app/validation/body.d.ts +25 -124
  90. package/resolver/app/validation/body.js +31 -44
  91. package/resolver/app/validation/body.js.map +1 -1
  92. package/resolver/app/validation/createJsonTransform.d.ts +1 -1
  93. package/resolver/app/validation/createJsonTransform.js +13 -22
  94. package/resolver/app/validation/createJsonTransform.js.map +1 -1
  95. package/resolver/app/validation/detail.d.ts +19 -72
  96. package/resolver/app/validation/detail.js +33 -46
  97. package/resolver/app/validation/detail.js.map +1 -1
  98. package/resolver/app/validation/event.d.ts +29 -188
  99. package/resolver/app/validation/event.js +21 -30
  100. package/resolver/app/validation/event.js.map +1 -1
  101. package/resolver/app/validation/numericString.d.ts +1 -1
  102. package/resolver/app/validation/numericString.js +9 -20
  103. package/resolver/app/validation/numericString.js.map +1 -1
  104. package/resolver/app/validation/system.d.ts +2 -14
  105. package/resolver/app/validation/system.js +9 -18
  106. package/resolver/app/validation/system.js.map +1 -1
  107. package/resolver/deployment/Deployment.d.ts +2 -3
  108. package/resolver/deployment/Deployment.js +27 -44
  109. package/resolver/deployment/Deployment.js.map +1 -1
  110. package/resolver/deployment/Deployments.js +19 -30
  111. package/resolver/deployment/Deployments.js.map +1 -1
  112. package/resolver/deployment/DeploymentsFetcher.js +82 -102
  113. package/resolver/deployment/DeploymentsFetcher.js.map +1 -1
  114. package/resolver/deployment/types.d.ts +4 -6
  115. package/resolver/deployment/types.js +0 -7
  116. package/resolver/lambda/LambdaTrigger.js +25 -34
  117. package/resolver/lambda/LambdaTrigger.js.map +1 -1
  118. package/resolver/plugins/CommandHandlerPlugin.d.ts +3 -3
  119. package/resolver/plugins/CommandHandlerPlugin.js +17 -24
  120. package/resolver/plugins/CommandHandlerPlugin.js.map +1 -1
  121. package/resolver/plugins/StorerAfterEachPlugin.d.ts +2 -2
  122. package/resolver/plugins/StorerAfterEachPlugin.js +21 -29
  123. package/resolver/plugins/StorerAfterEachPlugin.js.map +1 -1
  124. package/resolver/plugins/TransformRecordPlugin.d.ts +3 -3
  125. package/resolver/plugins/TransformRecordPlugin.js +20 -27
  126. package/resolver/plugins/TransformRecordPlugin.js.map +1 -1
  127. package/resolver/recordTypes/fileManager/CopyFile.js +44 -74
  128. package/resolver/recordTypes/fileManager/CopyFile.js.map +1 -1
  129. package/resolver/recordTypes/fileManager/DeleteFile.d.ts +1 -1
  130. package/resolver/recordTypes/fileManager/DeleteFile.js +40 -65
  131. package/resolver/recordTypes/fileManager/DeleteFile.js.map +1 -1
  132. package/resolver/recordTypes/fileManager/fileManager.d.ts +1 -1
  133. package/resolver/recordTypes/fileManager/fileManager.js +7 -12
  134. package/resolver/recordTypes/fileManager/fileManager.js.map +1 -1
  135. package/resolver/recordTypes/fileManager/fileManagerOnDelete.d.ts +1 -1
  136. package/resolver/recordTypes/fileManager/fileManagerOnDelete.js +27 -45
  137. package/resolver/recordTypes/fileManager/fileManagerOnDelete.js.map +1 -1
  138. package/resolver/recordTypes/fileManager/fileManagerOnPut.d.ts +1 -1
  139. package/resolver/recordTypes/fileManager/fileManagerOnPut.js +27 -45
  140. package/resolver/recordTypes/fileManager/fileManagerOnPut.js.map +1 -1
  141. package/resolver/recordTypes/fileManager/shouldBeHandled.d.ts +1 -1
  142. package/resolver/recordTypes/fileManager/shouldBeHandled.js +10 -34
  143. package/resolver/recordTypes/fileManager/shouldBeHandled.js.map +1 -1
  144. package/resolver/recordTypes/fileManager/types.d.ts +2 -2
  145. package/resolver/recordTypes/fileManager/types.js +0 -7
  146. package/resolver/recordTypes/users/CopyUser.d.ts +2 -2
  147. package/resolver/recordTypes/users/CopyUser.js +44 -61
  148. package/resolver/recordTypes/users/CopyUser.js.map +1 -1
  149. package/resolver/recordTypes/users/DeleteUser.d.ts +2 -2
  150. package/resolver/recordTypes/users/DeleteUser.js +40 -58
  151. package/resolver/recordTypes/users/DeleteUser.js.map +1 -1
  152. package/resolver/recordTypes/users/shouldBeHandled.d.ts +1 -1
  153. package/resolver/recordTypes/users/shouldBeHandled.js +10 -33
  154. package/resolver/recordTypes/users/shouldBeHandled.js.map +1 -1
  155. package/resolver/recordTypes/users/types.d.ts +1 -1
  156. package/resolver/recordTypes/users/types.js +0 -7
  157. package/resolver/recordTypes/users/users.js +7 -12
  158. package/resolver/recordTypes/users/users.js.map +1 -1
  159. package/resolver/recordTypes/users/usersOnDelete.d.ts +2 -2
  160. package/resolver/recordTypes/users/usersOnDelete.js +26 -44
  161. package/resolver/recordTypes/users/usersOnDelete.js.map +1 -1
  162. package/resolver/recordTypes/users/usersOnPut.d.ts +2 -2
  163. package/resolver/recordTypes/users/usersOnPut.js +27 -45
  164. package/resolver/recordTypes/users/usersOnPut.js.map +1 -1
  165. package/sync/ApiGatewaySyncDecorator.d.ts +14 -0
  166. package/sync/ApiGatewaySyncDecorator.js +49 -0
  167. package/sync/ApiGatewaySyncDecorator.js.map +1 -0
  168. package/sync/FilterOutRecord.d.ts +2 -2
  169. package/sync/FilterOutRecord.js +8 -24
  170. package/sync/FilterOutRecord.js.map +1 -1
  171. package/sync/SyncSystemConfig.d.ts +11 -0
  172. package/sync/SyncSystemConfig.js +5 -0
  173. package/sync/SyncSystemConfig.js.map +1 -0
  174. package/sync/attachToDynamoDbDocument.d.ts +1 -1
  175. package/sync/attachToDynamoDbDocument.js +48 -75
  176. package/sync/attachToDynamoDbDocument.js.map +1 -1
  177. package/sync/createHandler.js +44 -60
  178. package/sync/createHandler.js.map +1 -1
  179. package/sync/filter/createDefaultFilterOutRecordPlugins.d.ts +1 -1
  180. package/sync/filter/createDefaultFilterOutRecordPlugins.js +37 -86
  181. package/sync/filter/createDefaultFilterOutRecordPlugins.js.map +1 -1
  182. package/sync/handler/Handler.d.ts +2 -2
  183. package/sync/handler/Handler.js +66 -86
  184. package/sync/handler/Handler.js.map +1 -1
  185. package/sync/handler/HandlerConverter.js +20 -36
  186. package/sync/handler/HandlerConverter.js.map +1 -1
  187. package/sync/handler/converter/BatchGetCommandConverter.js +13 -20
  188. package/sync/handler/converter/BatchGetCommandConverter.js.map +1 -1
  189. package/sync/handler/converter/BatchWriteCommandConverter.js +13 -20
  190. package/sync/handler/converter/BatchWriteCommandConverter.js.map +1 -1
  191. package/sync/handler/converter/DeleteCommandConverter.js +13 -20
  192. package/sync/handler/converter/DeleteCommandConverter.js.map +1 -1
  193. package/sync/handler/converter/GetCommandConverter.js +13 -20
  194. package/sync/handler/converter/GetCommandConverter.js.map +1 -1
  195. package/sync/handler/converter/PutCommandConverter.js +13 -20
  196. package/sync/handler/converter/PutCommandConverter.js.map +1 -1
  197. package/sync/handler/converter/QueryCommandConverter.js +13 -20
  198. package/sync/handler/converter/QueryCommandConverter.js.map +1 -1
  199. package/sync/handler/converter/ScanCommandConverter.js +13 -20
  200. package/sync/handler/converter/ScanCommandConverter.js.map +1 -1
  201. package/sync/handler/converter/UpdateCommandConverter.js +13 -20
  202. package/sync/handler/converter/UpdateCommandConverter.js.map +1 -1
  203. package/sync/handler/converter/commands/BatchWriteCommandValue.d.ts +2 -2
  204. package/sync/handler/converter/commands/BatchWriteCommandValue.js +34 -44
  205. package/sync/handler/converter/commands/BatchWriteCommandValue.js.map +1 -1
  206. package/sync/handler/converter/commands/DeleteCommandValue.d.ts +2 -2
  207. package/sync/handler/converter/commands/DeleteCommandValue.js +19 -23
  208. package/sync/handler/converter/commands/DeleteCommandValue.js.map +1 -1
  209. package/sync/handler/converter/commands/NullCommandValue.d.ts +1 -1
  210. package/sync/handler/converter/commands/NullCommandValue.js +7 -14
  211. package/sync/handler/converter/commands/NullCommandValue.js.map +1 -1
  212. package/sync/handler/converter/commands/PutCommandValue.d.ts +2 -2
  213. package/sync/handler/converter/commands/PutCommandValue.js +19 -23
  214. package/sync/handler/converter/commands/PutCommandValue.js.map +1 -1
  215. package/sync/handler/converter/commands/UpdateCommandValue.d.ts +2 -2
  216. package/sync/handler/converter/commands/UpdateCommandValue.js +19 -23
  217. package/sync/handler/converter/commands/UpdateCommandValue.js.map +1 -1
  218. package/sync/handler/types.d.ts +3 -3
  219. package/sync/handler/types.js +0 -7
  220. package/sync/plugins/FilterOutRecordPlugin.d.ts +1 -1
  221. package/sync/plugins/FilterOutRecordPlugin.js +18 -28
  222. package/sync/plugins/FilterOutRecordPlugin.js.map +1 -1
  223. package/sync/types.js +0 -7
  224. package/sync/utils/getTableType.js +11 -19
  225. package/sync/utils/getTableType.js.map +1 -1
  226. package/sync/utils/manifest.d.ts +3 -7
  227. package/sync/utils/manifest.js +30 -47
  228. package/sync/utils/manifest.js.map +1 -1
  229. package/sync/utils/validateSystemInput.d.ts +1 -1
  230. package/sync/utils/validateSystemInput.js +22 -37
  231. package/sync/utils/validateSystemInput.js.map +1 -1
  232. package/types.d.ts +1 -5
  233. package/types.js +6 -12
  234. package/types.js.map +1 -1
  235. package/utils/createSystemName.js +5 -10
  236. package/utils/createSystemName.js.map +1 -1
  237. package/worker/SyncWorkerConfig.d.ts +9 -0
  238. package/worker/SyncWorkerConfig.js +5 -0
  239. package/worker/SyncWorkerConfig.js.map +1 -0
  240. package/worker/SyncWorkerEventHandler.d.ts +14 -0
  241. package/worker/SyncWorkerEventHandler.js +5 -0
  242. package/worker/SyncWorkerEventHandler.js.map +1 -0
  243. package/worker/SyncWorkerEventType.d.ts +10 -0
  244. package/worker/SyncWorkerEventType.js +24 -0
  245. package/worker/SyncWorkerEventType.js.map +1 -0
  246. package/worker/SyncWorkerLambdaHandler.d.ts +13 -0
  247. package/worker/SyncWorkerLambdaHandler.js +61 -0
  248. package/worker/SyncWorkerLambdaHandler.js.map +1 -0
  249. package/worker/actions/copyFile/CopyFile.js +185 -268
  250. package/worker/actions/copyFile/CopyFile.js.map +1 -1
  251. package/worker/actions/copyFile/copyFileAction.d.ts +1 -1
  252. package/worker/actions/copyFile/copyFileAction.js +30 -45
  253. package/worker/actions/copyFile/copyFileAction.js.map +1 -1
  254. package/worker/actions/copyFile/copyFileSchema.d.ts +6 -38
  255. package/worker/actions/copyFile/copyFileSchema.js +14 -23
  256. package/worker/actions/copyFile/copyFileSchema.js.map +1 -1
  257. package/worker/actions/copyFile/types.js +0 -7
  258. package/worker/actions/createUser/CreateUser.d.ts +1 -1
  259. package/worker/actions/createUser/CreateUser.js +53 -83
  260. package/worker/actions/createUser/CreateUser.js.map +1 -1
  261. package/worker/actions/createUser/createUserAction.d.ts +2 -2
  262. package/worker/actions/createUser/createUserAction.js +28 -39
  263. package/worker/actions/createUser/createUserAction.js.map +1 -1
  264. package/worker/actions/createUser/createUserSchema.d.ts +6 -38
  265. package/worker/actions/createUser/createUserSchema.js +14 -23
  266. package/worker/actions/createUser/createUserSchema.js.map +1 -1
  267. package/worker/actions/createUser/types.js +0 -7
  268. package/worker/actions/deleteFile/DeleteFile.js +52 -74
  269. package/worker/actions/deleteFile/DeleteFile.js.map +1 -1
  270. package/worker/actions/deleteFile/deleteFileAction.d.ts +1 -1
  271. package/worker/actions/deleteFile/deleteFileAction.js +25 -40
  272. package/worker/actions/deleteFile/deleteFileAction.js.map +1 -1
  273. package/worker/actions/deleteFile/deleteFileSchema.d.ts +6 -38
  274. package/worker/actions/deleteFile/deleteFileSchema.js +14 -23
  275. package/worker/actions/deleteFile/deleteFileSchema.js.map +1 -1
  276. package/worker/actions/deleteFile/types.js +0 -7
  277. package/worker/actions/deleteUser/DeleteUser.d.ts +2 -2
  278. package/worker/actions/deleteUser/DeleteUser.js +39 -60
  279. package/worker/actions/deleteUser/DeleteUser.js.map +1 -1
  280. package/worker/actions/deleteUser/deleteUserAction.d.ts +1 -1
  281. package/worker/actions/deleteUser/deleteUserAction.js +26 -37
  282. package/worker/actions/deleteUser/deleteUserAction.js.map +1 -1
  283. package/worker/actions/deleteUser/deleteUserSchema.d.ts +5 -23
  284. package/worker/actions/deleteUser/deleteUserSchema.js +13 -22
  285. package/worker/actions/deleteUser/deleteUserSchema.js.map +1 -1
  286. package/worker/actions/deleteUser/types.js +0 -7
  287. package/worker/actions/logValidationError.js +6 -14
  288. package/worker/actions/logValidationError.js.map +1 -1
  289. package/worker/actions/removeCognitoUserAttributes.js +9 -22
  290. package/worker/actions/removeCognitoUserAttributes.js.map +1 -1
  291. package/worker/actions/updateUser/UpdateUser.d.ts +1 -1
  292. package/worker/actions/updateUser/UpdateUser.js +50 -74
  293. package/worker/actions/updateUser/UpdateUser.js.map +1 -1
  294. package/worker/actions/updateUser/types.js +0 -7
  295. package/worker/actions/updateUser/updateUserAction.d.ts +2 -2
  296. package/worker/actions/updateUser/updateUserAction.js +28 -39
  297. package/worker/actions/updateUser/updateUserAction.js.map +1 -1
  298. package/worker/actions/updateUser/updateUserSchema.d.ts +6 -38
  299. package/worker/actions/updateUser/updateUserSchema.js +14 -23
  300. package/worker/actions/updateUser/updateUserSchema.js.map +1 -1
  301. package/worker/handler/WorkerActionHandler.d.ts +2 -2
  302. package/worker/handler/WorkerActionHandler.js +19 -28
  303. package/worker/handler/WorkerActionHandler.js.map +1 -1
  304. package/worker/plugins/WorkerActionPlugin.d.ts +1 -1
  305. package/worker/plugins/WorkerActionPlugin.js +18 -25
  306. package/worker/plugins/WorkerActionPlugin.js.map +1 -1
  307. package/worker/types.js +0 -7
  308. package/index.js.map +0 -1
  309. package/resolver/app/abstractions/RecordHandler.js.map +0 -1
  310. package/resolver/app/abstractions/RecordsValidation.js.map +0 -1
  311. package/resolver/app/abstractions/ResolverApplication.js.map +0 -1
  312. package/resolver/app/abstractions/ResolverRecord.js.map +0 -1
  313. package/resolver/app/bundler/types.js.map +0 -1
  314. package/resolver/app/data/types.js.map +0 -1
  315. package/resolver/app/fetcher/types.js.map +0 -1
  316. package/resolver/app/ingestor/types.js.map +0 -1
  317. package/resolver/app/storer/types.js.map +0 -1
  318. package/resolver/createEventHandlerPlugin.d.ts +0 -10
  319. package/resolver/createEventHandlerPlugin.js +0 -127
  320. package/resolver/createEventHandlerPlugin.js.map +0 -1
  321. package/resolver/createResolverHandler.d.ts +0 -21
  322. package/resolver/createResolverHandler.js +0 -79
  323. package/resolver/createResolverHandler.js.map +0 -1
  324. package/resolver/deployment/types.js.map +0 -1
  325. package/resolver/recordTypes/fileManager/types.js.map +0 -1
  326. package/resolver/recordTypes/users/types.js.map +0 -1
  327. package/sync/createSendDataToEventBridgeOnRequestEnd.d.ts +0 -2
  328. package/sync/createSendDataToEventBridgeOnRequestEnd.js +0 -51
  329. package/sync/createSendDataToEventBridgeOnRequestEnd.js.map +0 -1
  330. package/sync/createSyncSystem.d.ts +0 -16
  331. package/sync/createSyncSystem.js +0 -42
  332. package/sync/createSyncSystem.js.map +0 -1
  333. package/sync/handler/types.js.map +0 -1
  334. package/sync/requestPlugin.d.ts +0 -9
  335. package/sync/requestPlugin.js +0 -59
  336. package/sync/requestPlugin.js.map +0 -1
  337. package/sync/types.js.map +0 -1
  338. package/worker/actions/copyFile/types.js.map +0 -1
  339. package/worker/actions/createUser/types.js.map +0 -1
  340. package/worker/actions/deleteFile/types.js.map +0 -1
  341. package/worker/actions/deleteUser/types.js.map +0 -1
  342. package/worker/actions/updateUser/types.js.map +0 -1
  343. package/worker/createWorkerHandler.d.ts +0 -11
  344. package/worker/createWorkerHandler.js +0 -48
  345. package/worker/createWorkerHandler.js.map +0 -1
  346. package/worker/handler/eventHandler.d.ts +0 -1
  347. package/worker/handler/eventHandler.js +0 -31
  348. package/worker/handler/eventHandler.js.map +0 -1
  349. package/worker/types.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import type { IBundle, IBundles, IBundlesAddParams } from "./types.js";
2
- import type { IIngestorResultItem } from "../ingestor/types.js";
1
+ import type { IBundle, IBundles, IBundlesAddParams } from "../../../resolver/app/bundler/types.js";
2
+ import type { IIngestorResultItem } from "../../../resolver/app/ingestor/types.js";
3
3
  export interface IBundlesParams {
4
4
  createBundle: (item: IIngestorResultItem) => IBundle;
5
5
  }
@@ -1,38 +1,25 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createBundles = exports.Bundles = void 0;
7
1
  class Bundles {
8
- bundles = [];
9
- constructor(params) {
10
- this.createBundle = params.createBundle;
11
- }
12
- add(params) {
13
- const {
14
- item
15
- } = params;
16
- const bundle = this.getBundle(item);
17
- bundle.add(item);
18
- }
19
- getBundles() {
20
- return this.bundles;
21
- }
22
- getBundle(item) {
23
- const last = this.bundles[this.bundles.length - 1];
24
- if (last?.canAdd(item)) {
25
- return last;
2
+ constructor(params){
3
+ this.bundles = [];
4
+ this.createBundle = params.createBundle;
5
+ }
6
+ add(params) {
7
+ const { item } = params;
8
+ const bundle = this.getBundle(item);
9
+ bundle.add(item);
10
+ }
11
+ getBundles() {
12
+ return this.bundles;
13
+ }
14
+ getBundle(item) {
15
+ const last = this.bundles[this.bundles.length - 1];
16
+ if (last?.canAdd(item)) return last;
17
+ const bundle = this.createBundle(item);
18
+ this.bundles.push(bundle);
19
+ return bundle;
26
20
  }
27
- const bundle = this.createBundle(item);
28
- this.bundles.push(bundle);
29
- return bundle;
30
- }
31
21
  }
32
- exports.Bundles = Bundles;
33
- const createBundles = params => {
34
- return new Bundles(params);
35
- };
36
- exports.createBundles = createBundles;
22
+ const createBundles = (params)=>new Bundles(params);
23
+ export { Bundles, createBundles };
37
24
 
38
25
  //# sourceMappingURL=Bundles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Bundles","bundles","constructor","params","createBundle","add","item","bundle","getBundle","getBundles","last","length","canAdd","push","exports","createBundles"],"sources":["Bundles.ts"],"sourcesContent":["import type { IBundle, IBundles, IBundlesAddParams } from \"~/resolver/app/bundler/types.js\";\nimport type { IIngestorResultItem } from \"~/resolver/app/ingestor/types.js\";\n\nexport interface IBundlesParams {\n createBundle: (item: IIngestorResultItem) => IBundle;\n}\n\nexport class Bundles implements IBundles {\n private readonly bundles: IBundle[] = [];\n private readonly createBundle: (item: IIngestorResultItem) => IBundle;\n\n public constructor(params: IBundlesParams) {\n this.createBundle = params.createBundle;\n }\n\n public add(params: IBundlesAddParams): void {\n const { item } = params;\n\n const bundle = this.getBundle(item);\n\n bundle.add(item);\n }\n\n public getBundles(): IBundle[] {\n return this.bundles;\n }\n\n private getBundle(item: IIngestorResultItem): IBundle {\n const last = this.bundles[this.bundles.length - 1];\n if (last?.canAdd(item)) {\n return last;\n }\n const bundle = this.createBundle(item);\n this.bundles.push(bundle);\n return bundle;\n }\n}\n\nexport const createBundles = (params: IBundlesParams) => {\n return new Bundles(params);\n};\n"],"mappings":";;;;;;AAOO,MAAMA,OAAO,CAAqB;EACpBC,OAAO,GAAc,EAAE;EAGjCC,WAAWA,CAACC,MAAsB,EAAE;IACvC,IAAI,CAACC,YAAY,GAAGD,MAAM,CAACC,YAAY;EAC3C;EAEOC,GAAGA,CAACF,MAAyB,EAAQ;IACxC,MAAM;MAAEG;IAAK,CAAC,GAAGH,MAAM;IAEvB,MAAMI,MAAM,GAAG,IAAI,CAACC,SAAS,CAACF,IAAI,CAAC;IAEnCC,MAAM,CAACF,GAAG,CAACC,IAAI,CAAC;EACpB;EAEOG,UAAUA,CAAA,EAAc;IAC3B,OAAO,IAAI,CAACR,OAAO;EACvB;EAEQO,SAASA,CAACF,IAAyB,EAAW;IAClD,MAAMI,IAAI,GAAG,IAAI,CAACT,OAAO,CAAC,IAAI,CAACA,OAAO,CAACU,MAAM,GAAG,CAAC,CAAC;IAClD,IAAID,IAAI,EAAEE,MAAM,CAACN,IAAI,CAAC,EAAE;MACpB,OAAOI,IAAI;IACf;IACA,MAAMH,MAAM,GAAG,IAAI,CAACH,YAAY,CAACE,IAAI,CAAC;IACtC,IAAI,CAACL,OAAO,CAACY,IAAI,CAACN,MAAM,CAAC;IACzB,OAAOA,MAAM;EACjB;AACJ;AAACO,OAAA,CAAAd,OAAA,GAAAA,OAAA;AAEM,MAAMe,aAAa,GAAIZ,MAAsB,IAAK;EACrD,OAAO,IAAIH,OAAO,CAACG,MAAM,CAAC;AAC9B,CAAC;AAACW,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/bundler/Bundles.js","sources":["../../../../src/resolver/app/bundler/Bundles.ts"],"sourcesContent":["import type { IBundle, IBundles, IBundlesAddParams } from \"~/resolver/app/bundler/types.js\";\nimport type { IIngestorResultItem } from \"~/resolver/app/ingestor/types.js\";\n\nexport interface IBundlesParams {\n createBundle: (item: IIngestorResultItem) => IBundle;\n}\n\nexport class Bundles implements IBundles {\n private readonly bundles: IBundle[] = [];\n private readonly createBundle: (item: IIngestorResultItem) => IBundle;\n\n public constructor(params: IBundlesParams) {\n this.createBundle = params.createBundle;\n }\n\n public add(params: IBundlesAddParams): void {\n const { item } = params;\n\n const bundle = this.getBundle(item);\n\n bundle.add(item);\n }\n\n public getBundles(): IBundle[] {\n return this.bundles;\n }\n\n private getBundle(item: IIngestorResultItem): IBundle {\n const last = this.bundles[this.bundles.length - 1];\n if (last?.canAdd(item)) {\n return last;\n }\n const bundle = this.createBundle(item);\n this.bundles.push(bundle);\n return bundle;\n }\n}\n\nexport const createBundles = (params: IBundlesParams) => {\n return new Bundles(params);\n};\n"],"names":["Bundles","params","item","bundle","last","createBundles"],"mappings":"AAOO,MAAMA;IAIT,YAAmBC,MAAsB,CAAE;aAH1B,OAAO,GAAc,EAAE;QAIpC,IAAI,CAAC,YAAY,GAAGA,OAAO,YAAY;IAC3C;IAEO,IAAIA,MAAyB,EAAQ;QACxC,MAAM,EAAEC,IAAI,EAAE,GAAGD;QAEjB,MAAME,SAAS,IAAI,CAAC,SAAS,CAACD;QAE9BC,OAAO,GAAG,CAACD;IACf;IAEO,aAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO;IACvB;IAEQ,UAAUA,IAAyB,EAAW;QAClD,MAAME,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,EAAE;QAClD,IAAIA,MAAM,OAAOF,OACb,OAAOE;QAEX,MAAMD,SAAS,IAAI,CAAC,YAAY,CAACD;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAACC;QAClB,OAAOA;IACX;AACJ;AAEO,MAAME,gBAAgB,CAACJ,SACnB,IAAID,QAAQC"}
@@ -6,7 +6,7 @@
6
6
  * This will be used for executing the commands in the target systems.
7
7
  */
8
8
  import type { IBundle } from "./types.js";
9
- import type { IIngestorResultItem } from "../ingestor/types";
9
+ import type { IIngestorResultItem } from "../ingestor/types.js";
10
10
  import type { IBaseBundleParams } from "./BaseBundle.js";
11
11
  import { BaseBundle } from "./BaseBundle.js";
12
12
  export declare class CommandBundle extends BaseBundle {
@@ -1,28 +1,11 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createCommandBundle = exports.CommandBundle = void 0;
7
- var _BaseBundle = require("./BaseBundle.js");
8
- /**
9
- * Used to bundle by source system, table and command.
10
- * If we receive >1 commands in a single batch, for example, put -> delete -> put -> delete, we need to make sure
11
- * that commands are executed in that order.
12
- *
13
- * This will be used for executing the commands in the target systems.
14
- */
15
-
16
- class CommandBundle extends _BaseBundle.BaseBundle {
17
- canAdd(item) {
18
- const command = this.getCommand(item.command);
19
- return this.command === command && this.table.name === item.table.name && this.source.name === item.source.name;
20
- }
1
+ import { BaseBundle } from "./BaseBundle.js";
2
+ class CommandBundle extends BaseBundle {
3
+ canAdd(item) {
4
+ const command = this.getCommand(item.command);
5
+ return this.command === command && this.table.name === item.table.name && this.source.name === item.source.name;
6
+ }
21
7
  }
22
- exports.CommandBundle = CommandBundle;
23
- const createCommandBundle = params => {
24
- return new CommandBundle(params);
25
- };
26
- exports.createCommandBundle = createCommandBundle;
8
+ const createCommandBundle = (params)=>new CommandBundle(params);
9
+ export { CommandBundle, createCommandBundle };
27
10
 
28
11
  //# sourceMappingURL=CommandBundle.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_BaseBundle","require","CommandBundle","BaseBundle","canAdd","item","command","getCommand","table","name","source","exports","createCommandBundle","params"],"sources":["CommandBundle.ts"],"sourcesContent":["/**\n * Used to bundle by source system, table and command.\n * If we receive >1 commands in a single batch, for example, put -> delete -> put -> delete, we need to make sure\n * that commands are executed in that order.\n *\n * This will be used for executing the commands in the target systems.\n */\nimport type { IBundle } from \"./types.js\";\nimport type { IIngestorResultItem } from \"../ingestor/types\";\nimport type { IBaseBundleParams } from \"./BaseBundle.js\";\nimport { BaseBundle } from \"./BaseBundle.js\";\n\nexport class CommandBundle extends BaseBundle {\n public canAdd(item: IIngestorResultItem): boolean {\n const command = this.getCommand(item.command);\n return (\n this.command === command &&\n this.table.name === item.table.name &&\n this.source.name === item.source.name\n );\n }\n}\n\nexport const createCommandBundle = (params: IBaseBundleParams): IBundle => {\n return new CommandBundle(params);\n};\n"],"mappings":";;;;;;AAUA,IAAAA,WAAA,GAAAC,OAAA;AAVA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMO,MAAMC,aAAa,SAASC,sBAAU,CAAC;EACnCC,MAAMA,CAACC,IAAyB,EAAW;IAC9C,MAAMC,OAAO,GAAG,IAAI,CAACC,UAAU,CAACF,IAAI,CAACC,OAAO,CAAC;IAC7C,OACI,IAAI,CAACA,OAAO,KAAKA,OAAO,IACxB,IAAI,CAACE,KAAK,CAACC,IAAI,KAAKJ,IAAI,CAACG,KAAK,CAACC,IAAI,IACnC,IAAI,CAACC,MAAM,CAACD,IAAI,KAAKJ,IAAI,CAACK,MAAM,CAACD,IAAI;EAE7C;AACJ;AAACE,OAAA,CAAAT,aAAA,GAAAA,aAAA;AAEM,MAAMU,mBAAmB,GAAIC,MAAyB,IAAc;EACvE,OAAO,IAAIX,aAAa,CAACW,MAAM,CAAC;AACpC,CAAC;AAACF,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/bundler/CommandBundle.js","sources":["../../../../src/resolver/app/bundler/CommandBundle.ts"],"sourcesContent":["/**\n * Used to bundle by source system, table and command.\n * If we receive >1 commands in a single batch, for example, put -> delete -> put -> delete, we need to make sure\n * that commands are executed in that order.\n *\n * This will be used for executing the commands in the target systems.\n */\nimport type { IBundle } from \"./types.js\";\nimport type { IIngestorResultItem } from \"../ingestor/types.js\";\nimport type { IBaseBundleParams } from \"./BaseBundle.js\";\nimport { BaseBundle } from \"./BaseBundle.js\";\n\nexport class CommandBundle extends BaseBundle {\n public canAdd(item: IIngestorResultItem): boolean {\n const command = this.getCommand(item.command);\n return (\n this.command === command &&\n this.table.name === item.table.name &&\n this.source.name === item.source.name\n );\n }\n}\n\nexport const createCommandBundle = (params: IBaseBundleParams): IBundle => {\n return new CommandBundle(params);\n};\n"],"names":["CommandBundle","BaseBundle","item","command","createCommandBundle","params"],"mappings":";AAYO,MAAMA,sBAAsBC;IACxB,OAAOC,IAAyB,EAAW;QAC9C,MAAMC,UAAU,IAAI,CAAC,UAAU,CAACD,KAAK,OAAO;QAC5C,OACI,IAAI,CAAC,OAAO,KAAKC,WACjB,IAAI,CAAC,KAAK,CAAC,IAAI,KAAKD,KAAK,KAAK,CAAC,IAAI,IACnC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAKA,KAAK,MAAM,CAAC,IAAI;IAE7C;AACJ;AAEO,MAAME,sBAAsB,CAACC,SACzB,IAAIL,cAAcK"}
@@ -4,7 +4,7 @@
4
4
  * It will be used to fetch the data from the source system tables.
5
5
  */
6
6
  import type { IBundle } from "./types.js";
7
- import type { IIngestorResultItem } from "../ingestor/types";
7
+ import type { IIngestorResultItem } from "../ingestor/types.js";
8
8
  import type { IBaseBundleParams } from "./BaseBundle.js";
9
9
  import { BaseBundle } from "./BaseBundle.js";
10
10
  export declare class TableBundle extends BaseBundle {
@@ -1,25 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createTableBundle = exports.TableBundle = void 0;
7
- var _BaseBundle = require("./BaseBundle.js");
8
- /**
9
- * This will bundle records by system and table.
10
- *
11
- * It will be used to fetch the data from the source system tables.
12
- */
13
-
14
- class TableBundle extends _BaseBundle.BaseBundle {
15
- canAdd(item) {
16
- return this.source.name === item.source.name && this.table.name === item.table.name;
17
- }
1
+ import { BaseBundle } from "./BaseBundle.js";
2
+ class TableBundle extends BaseBundle {
3
+ canAdd(item) {
4
+ return this.source.name === item.source.name && this.table.name === item.table.name;
5
+ }
18
6
  }
19
- exports.TableBundle = TableBundle;
20
- const createTableBundle = params => {
21
- return new TableBundle(params);
22
- };
23
- exports.createTableBundle = createTableBundle;
7
+ const createTableBundle = (params)=>new TableBundle(params);
8
+ export { TableBundle, createTableBundle };
24
9
 
25
10
  //# sourceMappingURL=TableBundle.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_BaseBundle","require","TableBundle","BaseBundle","canAdd","item","source","name","table","exports","createTableBundle","params"],"sources":["TableBundle.ts"],"sourcesContent":["/**\n * This will bundle records by system and table.\n *\n * It will be used to fetch the data from the source system tables.\n */\nimport type { IBundle } from \"./types.js\";\nimport type { IIngestorResultItem } from \"../ingestor/types\";\nimport type { IBaseBundleParams } from \"./BaseBundle.js\";\nimport { BaseBundle } from \"./BaseBundle.js\";\n\nexport class TableBundle extends BaseBundle {\n public canAdd(item: IIngestorResultItem): boolean {\n return this.source.name === item.source.name && this.table.name === item.table.name;\n }\n}\n\nexport const createTableBundle = (params: IBaseBundleParams): IBundle => {\n return new TableBundle(params);\n};\n"],"mappings":";;;;;;AAQA,IAAAA,WAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;;AAMO,MAAMC,WAAW,SAASC,sBAAU,CAAC;EACjCC,MAAMA,CAACC,IAAyB,EAAW;IAC9C,OAAO,IAAI,CAACC,MAAM,CAACC,IAAI,KAAKF,IAAI,CAACC,MAAM,CAACC,IAAI,IAAI,IAAI,CAACC,KAAK,CAACD,IAAI,KAAKF,IAAI,CAACG,KAAK,CAACD,IAAI;EACvF;AACJ;AAACE,OAAA,CAAAP,WAAA,GAAAA,WAAA;AAEM,MAAMQ,iBAAiB,GAAIC,MAAyB,IAAc;EACrE,OAAO,IAAIT,WAAW,CAACS,MAAM,CAAC;AAClC,CAAC;AAACF,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/bundler/TableBundle.js","sources":["../../../../src/resolver/app/bundler/TableBundle.ts"],"sourcesContent":["/**\n * This will bundle records by system and table.\n *\n * It will be used to fetch the data from the source system tables.\n */\nimport type { IBundle } from \"./types.js\";\nimport type { IIngestorResultItem } from \"../ingestor/types.js\";\nimport type { IBaseBundleParams } from \"./BaseBundle.js\";\nimport { BaseBundle } from \"./BaseBundle.js\";\n\nexport class TableBundle extends BaseBundle {\n public canAdd(item: IIngestorResultItem): boolean {\n return this.source.name === item.source.name && this.table.name === item.table.name;\n }\n}\n\nexport const createTableBundle = (params: IBaseBundleParams): IBundle => {\n return new TableBundle(params);\n};\n"],"names":["TableBundle","BaseBundle","item","createTableBundle","params"],"mappings":";AAUO,MAAMA,oBAAoBC;IACtB,OAAOC,IAAyB,EAAW;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAKA,KAAK,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAKA,KAAK,KAAK,CAAC,IAAI;IACvF;AACJ;AAEO,MAAMC,oBAAoB,CAACC,SACvB,IAAIJ,YAAYI"}
@@ -1,7 +1,7 @@
1
- import type { IIngestorResultItem } from "../ingestor/types.js";
1
+ import type { IIngestorResultItem } from "../../../resolver/app/ingestor/types.js";
2
2
  import type { CommandType } from "../../../types.js";
3
3
  import type { ITable } from "../../../sync/types.js";
4
- import type { IDeployment } from "../../deployment/types.js";
4
+ import type { IDeployment } from "../../../resolver/deployment/types.js";
5
5
  export interface IBundleItem {
6
6
  PK: string;
7
7
  SK: string;
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
- import type { IStoreItem, IStorer } from "../storer/types";
2
- import type { IDeployment } from "../../deployment/types.js";
1
+ import type { IStoreItem, IStorer } from "../storer/types.js";
2
+ import type { IDeployment } from "../../../resolver/deployment/types.js";
3
3
  import type { ITable } from "../../../sync/types.js";
4
- import type { IBundle } from "../bundler/types.js";
4
+ import type { IBundle } from "../../../resolver/app/bundler/types.js";
5
5
  export interface IDeleteCommandHandlerHandleParams {
6
6
  targetDeployment: IDeployment;
7
7
  targetTable: ITable;
@@ -1,39 +1,25 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DeleteCommandHandler = void 0;
7
1
  class DeleteCommandHandler {
8
- constructor(params) {
9
- this.storer = params.storer;
10
- }
11
- async handle(params) {
12
- const {
13
- targetDeployment,
14
- targetTable,
15
- bundle
16
- } = params;
17
- const result = bundle.items.map(item => {
18
- if (!item.PK || !item.SK) {
19
- return null;
20
- }
21
- return {
22
- PK: item.PK,
23
- SK: item.SK
24
- };
25
- }).filter(item => {
26
- return !!item;
27
- });
28
- await this.storer.store({
29
- command: "delete",
30
- deployment: targetDeployment,
31
- table: targetTable,
32
- items: result,
33
- bundle
34
- });
35
- }
2
+ constructor(params){
3
+ this.storer = params.storer;
4
+ }
5
+ async handle(params) {
6
+ const { targetDeployment, targetTable, bundle } = params;
7
+ const result = bundle.items.map((item)=>{
8
+ if (!item.PK || !item.SK) return null;
9
+ return {
10
+ PK: item.PK,
11
+ SK: item.SK
12
+ };
13
+ }).filter((item)=>!!item);
14
+ await this.storer.store({
15
+ command: "delete",
16
+ deployment: targetDeployment,
17
+ table: targetTable,
18
+ items: result,
19
+ bundle
20
+ });
21
+ }
36
22
  }
37
- exports.DeleteCommandHandler = DeleteCommandHandler;
23
+ export { DeleteCommandHandler };
38
24
 
39
25
  //# sourceMappingURL=DeleteCommandHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DeleteCommandHandler","constructor","params","storer","handle","targetDeployment","targetTable","bundle","result","items","map","item","PK","SK","filter","store","command","deployment","table","exports"],"sources":["DeleteCommandHandler.ts"],"sourcesContent":["import type { IStoreItem, IStorer } from \"../storer/types\";\nimport type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type { ITable } from \"~/sync/types.js\";\nimport type { IBundle } from \"~/resolver/app/bundler/types.js\";\n\nexport interface IDeleteCommandHandlerHandleParams {\n targetDeployment: IDeployment;\n targetTable: ITable;\n items: IStoreItem[];\n bundle: IBundle;\n}\n\nexport interface IDeleteCommandHandlerParams {\n storer: IStorer;\n}\n\nexport class DeleteCommandHandler {\n private readonly storer: IStorer;\n\n public constructor(params: IDeleteCommandHandlerParams) {\n this.storer = params.storer;\n }\n public async handle(params: IDeleteCommandHandlerHandleParams): Promise<void> {\n const { targetDeployment, targetTable, bundle } = params;\n const result = bundle.items\n .map(item => {\n if (!item.PK || !item.SK) {\n return null;\n }\n return {\n PK: item.PK,\n SK: item.SK\n };\n })\n .filter((item): item is IStoreItem => {\n return !!item;\n });\n\n await this.storer.store({\n command: \"delete\",\n deployment: targetDeployment,\n table: targetTable,\n items: result,\n bundle\n });\n }\n}\n"],"mappings":";;;;;;AAgBO,MAAMA,oBAAoB,CAAC;EAGvBC,WAAWA,CAACC,MAAmC,EAAE;IACpD,IAAI,CAACC,MAAM,GAAGD,MAAM,CAACC,MAAM;EAC/B;EACA,MAAaC,MAAMA,CAACF,MAAyC,EAAiB;IAC1E,MAAM;MAAEG,gBAAgB;MAAEC,WAAW;MAAEC;IAAO,CAAC,GAAGL,MAAM;IACxD,MAAMM,MAAM,GAAGD,MAAM,CAACE,KAAK,CACtBC,GAAG,CAACC,IAAI,IAAI;MACT,IAAI,CAACA,IAAI,CAACC,EAAE,IAAI,CAACD,IAAI,CAACE,EAAE,EAAE;QACtB,OAAO,IAAI;MACf;MACA,OAAO;QACHD,EAAE,EAAED,IAAI,CAACC,EAAE;QACXC,EAAE,EAAEF,IAAI,CAACE;MACb,CAAC;IACL,CAAC,CAAC,CACDC,MAAM,CAAEH,IAAI,IAAyB;MAClC,OAAO,CAAC,CAACA,IAAI;IACjB,CAAC,CAAC;IAEN,MAAM,IAAI,CAACR,MAAM,CAACY,KAAK,CAAC;MACpBC,OAAO,EAAE,QAAQ;MACjBC,UAAU,EAAEZ,gBAAgB;MAC5Ba,KAAK,EAAEZ,WAAW;MAClBG,KAAK,EAAED,MAAM;MACbD;IACJ,CAAC,CAAC;EACN;AACJ;AAACY,OAAA,CAAAnB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/commandHandler/DeleteCommandHandler.js","sources":["../../../../src/resolver/app/commandHandler/DeleteCommandHandler.ts"],"sourcesContent":["import type { IStoreItem, IStorer } from \"../storer/types.js\";\nimport type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type { ITable } from \"~/sync/types.js\";\nimport type { IBundle } from \"~/resolver/app/bundler/types.js\";\n\nexport interface IDeleteCommandHandlerHandleParams {\n targetDeployment: IDeployment;\n targetTable: ITable;\n items: IStoreItem[];\n bundle: IBundle;\n}\n\nexport interface IDeleteCommandHandlerParams {\n storer: IStorer;\n}\n\nexport class DeleteCommandHandler {\n private readonly storer: IStorer;\n\n public constructor(params: IDeleteCommandHandlerParams) {\n this.storer = params.storer;\n }\n public async handle(params: IDeleteCommandHandlerHandleParams): Promise<void> {\n const { targetDeployment, targetTable, bundle } = params;\n const result = bundle.items\n .map(item => {\n if (!item.PK || !item.SK) {\n return null;\n }\n return {\n PK: item.PK,\n SK: item.SK\n };\n })\n .filter((item): item is IStoreItem => {\n return !!item;\n });\n\n await this.storer.store({\n command: \"delete\",\n deployment: targetDeployment,\n table: targetTable,\n items: result,\n bundle\n });\n }\n}\n"],"names":["DeleteCommandHandler","params","targetDeployment","targetTable","bundle","result","item"],"mappings":"AAgBO,MAAMA;IAGT,YAAmBC,MAAmC,CAAE;QACpD,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;IAC/B;IACA,MAAa,OAAOA,MAAyC,EAAiB;QAC1E,MAAM,EAAEC,gBAAgB,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGH;QAClD,MAAMI,SAASD,OAAO,KAAK,CACtB,GAAG,CAACE,CAAAA;YACD,IAAI,CAACA,KAAK,EAAE,IAAI,CAACA,KAAK,EAAE,EACpB,OAAO;YAEX,OAAO;gBACH,IAAIA,KAAK,EAAE;gBACX,IAAIA,KAAK,EAAE;YACf;QACJ,GACC,MAAM,CAAC,CAACA,OACE,CAAC,CAACA;QAGjB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS;YACT,YAAYJ;YACZ,OAAOC;YACP,OAAOE;YACPD;QACJ;IACJ;AACJ"}
@@ -1,7 +1,7 @@
1
- import type { IStoreItem, IStorer } from "../storer/types";
2
- import type { ITable } from "../../../sync/types";
3
- import type { IDeployment } from "../../deployment/types.js";
4
- import type { IBundle } from "../bundler/types.js";
1
+ import type { IStoreItem, IStorer } from "../storer/types.js";
2
+ import type { ITable } from "../../../sync/types.js";
3
+ import type { IDeployment } from "../../../resolver/deployment/types.js";
4
+ import type { IBundle } from "../../../resolver/app/bundler/types.js";
5
5
  export interface IPutCommandHandlerHandleParams {
6
6
  items: IStoreItem[];
7
7
  bundle: IBundle;
@@ -1,32 +1,19 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PutCommandHandler = void 0;
7
1
  class PutCommandHandler {
8
- constructor(params) {
9
- this.storer = params.storer;
10
- }
11
- async handle(params) {
12
- const {
13
- items,
14
- targetDeployment,
15
- targetTable,
16
- bundle
17
- } = params;
18
- const result = items.filter(item => {
19
- return !!item.PK && !!item.SK;
20
- });
21
- await this.storer.store({
22
- command: "put",
23
- deployment: targetDeployment,
24
- table: targetTable,
25
- items: result,
26
- bundle
27
- });
28
- }
2
+ constructor(params){
3
+ this.storer = params.storer;
4
+ }
5
+ async handle(params) {
6
+ const { items, targetDeployment, targetTable, bundle } = params;
7
+ const result = items.filter((item)=>!!item.PK && !!item.SK);
8
+ await this.storer.store({
9
+ command: "put",
10
+ deployment: targetDeployment,
11
+ table: targetTable,
12
+ items: result,
13
+ bundle
14
+ });
15
+ }
29
16
  }
30
- exports.PutCommandHandler = PutCommandHandler;
17
+ export { PutCommandHandler };
31
18
 
32
19
  //# sourceMappingURL=PutCommandHandler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PutCommandHandler","constructor","params","storer","handle","items","targetDeployment","targetTable","bundle","result","filter","item","PK","SK","store","command","deployment","table","exports"],"sources":["PutCommandHandler.ts"],"sourcesContent":["import type { IStoreItem, IStorer } from \"../storer/types\";\nimport type { ITable } from \"~/sync/types\";\nimport type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type { IBundle } from \"~/resolver/app/bundler/types.js\";\n\nexport interface IPutCommandHandlerHandleParams {\n items: IStoreItem[];\n bundle: IBundle;\n targetDeployment: IDeployment;\n targetTable: ITable;\n}\n\nexport interface IPutCommandHandlerParams {\n storer: IStorer;\n}\n\nexport class PutCommandHandler {\n private readonly storer: IStorer;\n\n public constructor(params: IPutCommandHandlerParams) {\n this.storer = params.storer;\n }\n\n public async handle(params: IPutCommandHandlerHandleParams): Promise<void> {\n const { items, targetDeployment, targetTable, bundle } = params;\n\n const result = items.filter(item => {\n return !!item.PK && !!item.SK;\n });\n\n await this.storer.store({\n command: \"put\",\n deployment: targetDeployment,\n table: targetTable,\n items: result,\n bundle\n });\n }\n}\n"],"mappings":";;;;;;AAgBO,MAAMA,iBAAiB,CAAC;EAGpBC,WAAWA,CAACC,MAAgC,EAAE;IACjD,IAAI,CAACC,MAAM,GAAGD,MAAM,CAACC,MAAM;EAC/B;EAEA,MAAaC,MAAMA,CAACF,MAAsC,EAAiB;IACvE,MAAM;MAAEG,KAAK;MAAEC,gBAAgB;MAAEC,WAAW;MAAEC;IAAO,CAAC,GAAGN,MAAM;IAE/D,MAAMO,MAAM,GAAGJ,KAAK,CAACK,MAAM,CAACC,IAAI,IAAI;MAChC,OAAO,CAAC,CAACA,IAAI,CAACC,EAAE,IAAI,CAAC,CAACD,IAAI,CAACE,EAAE;IACjC,CAAC,CAAC;IAEF,MAAM,IAAI,CAACV,MAAM,CAACW,KAAK,CAAC;MACpBC,OAAO,EAAE,KAAK;MACdC,UAAU,EAAEV,gBAAgB;MAC5BW,KAAK,EAAEV,WAAW;MAClBF,KAAK,EAAEI,MAAM;MACbD;IACJ,CAAC,CAAC;EACN;AACJ;AAACU,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/commandHandler/PutCommandHandler.js","sources":["../../../../src/resolver/app/commandHandler/PutCommandHandler.ts"],"sourcesContent":["import type { IStoreItem, IStorer } from \"../storer/types.js\";\nimport type { ITable } from \"~/sync/types.js\";\nimport type { IDeployment } from \"~/resolver/deployment/types.js\";\nimport type { IBundle } from \"~/resolver/app/bundler/types.js\";\n\nexport interface IPutCommandHandlerHandleParams {\n items: IStoreItem[];\n bundle: IBundle;\n targetDeployment: IDeployment;\n targetTable: ITable;\n}\n\nexport interface IPutCommandHandlerParams {\n storer: IStorer;\n}\n\nexport class PutCommandHandler {\n private readonly storer: IStorer;\n\n public constructor(params: IPutCommandHandlerParams) {\n this.storer = params.storer;\n }\n\n public async handle(params: IPutCommandHandlerHandleParams): Promise<void> {\n const { items, targetDeployment, targetTable, bundle } = params;\n\n const result = items.filter(item => {\n return !!item.PK && !!item.SK;\n });\n\n await this.storer.store({\n command: \"put\",\n deployment: targetDeployment,\n table: targetTable,\n items: result,\n bundle\n });\n }\n}\n"],"names":["PutCommandHandler","params","items","targetDeployment","targetTable","bundle","result","item"],"mappings":"AAgBO,MAAMA;IAGT,YAAmBC,MAAgC,CAAE;QACjD,IAAI,CAAC,MAAM,GAAGA,OAAO,MAAM;IAC/B;IAEA,MAAa,OAAOA,MAAsC,EAAiB;QACvE,MAAM,EAAEC,KAAK,EAAEC,gBAAgB,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGJ;QAEzD,MAAMK,SAASJ,MAAM,MAAM,CAACK,CAAAA,OACjB,CAAC,CAACA,KAAK,EAAE,IAAI,CAAC,CAACA,KAAK,EAAE;QAGjC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YACpB,SAAS;YACT,YAAYJ;YACZ,OAAOC;YACP,OAAOE;YACPD;QACJ;IACJ;AACJ"}
@@ -1,2 +1,2 @@
1
- import { CommandHandlerPlugin } from "../../plugins/CommandHandlerPlugin.js";
1
+ import { CommandHandlerPlugin } from "../../../resolver/plugins/CommandHandlerPlugin.js";
2
2
  export declare const createDeleteCommandHandlerPlugin: () => CommandHandlerPlugin;
@@ -1,24 +1,16 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createDeleteCommandHandlerPlugin = void 0;
7
- var _CommandHandlerPlugin = require("../../plugins/CommandHandlerPlugin.js");
8
- var _DeleteCommandHandler = require("./DeleteCommandHandler");
9
- const createDeleteCommandHandlerPlugin = () => {
10
- const plugin = (0, _CommandHandlerPlugin.createCommandHandlerPlugin)({
11
- canHandle: command => {
12
- return command === "delete";
13
- },
14
- handle: async params => {
15
- const handler = new _DeleteCommandHandler.DeleteCommandHandler(params);
16
- return handler.handle(params);
17
- }
18
- });
19
- plugin.name = `${_CommandHandlerPlugin.CommandHandlerPlugin.type}.delete`;
20
- return plugin;
1
+ import { CommandHandlerPlugin, createCommandHandlerPlugin } from "../../plugins/CommandHandlerPlugin.js";
2
+ import { DeleteCommandHandler } from "./DeleteCommandHandler.js";
3
+ const createDeleteCommandHandlerPlugin = ()=>{
4
+ const plugin = createCommandHandlerPlugin({
5
+ canHandle: (command)=>"delete" === command,
6
+ handle: async (params)=>{
7
+ const handler = new DeleteCommandHandler(params);
8
+ return handler.handle(params);
9
+ }
10
+ });
11
+ plugin.name = `${CommandHandlerPlugin.type}.delete`;
12
+ return plugin;
21
13
  };
22
- exports.createDeleteCommandHandlerPlugin = createDeleteCommandHandlerPlugin;
14
+ export { createDeleteCommandHandlerPlugin };
23
15
 
24
16
  //# sourceMappingURL=delete.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_CommandHandlerPlugin","require","_DeleteCommandHandler","createDeleteCommandHandlerPlugin","plugin","createCommandHandlerPlugin","canHandle","command","handle","params","handler","DeleteCommandHandler","name","CommandHandlerPlugin","type","exports"],"sources":["delete.ts"],"sourcesContent":["import {\n CommandHandlerPlugin,\n createCommandHandlerPlugin\n} from \"~/resolver/plugins/CommandHandlerPlugin.js\";\nimport { DeleteCommandHandler } from \"./DeleteCommandHandler\";\n\nexport const createDeleteCommandHandlerPlugin = () => {\n const plugin = createCommandHandlerPlugin({\n canHandle: command => {\n return command === \"delete\";\n },\n handle: async params => {\n const handler = new DeleteCommandHandler(params);\n\n return handler.handle(params);\n }\n });\n\n plugin.name = `${CommandHandlerPlugin.type}.delete`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAIA,IAAAC,qBAAA,GAAAD,OAAA;AAEO,MAAME,gCAAgC,GAAGA,CAAA,KAAM;EAClD,MAAMC,MAAM,GAAG,IAAAC,gDAA0B,EAAC;IACtCC,SAAS,EAAEC,OAAO,IAAI;MAClB,OAAOA,OAAO,KAAK,QAAQ;IAC/B,CAAC;IACDC,MAAM,EAAE,MAAMC,MAAM,IAAI;MACpB,MAAMC,OAAO,GAAG,IAAIC,0CAAoB,CAACF,MAAM,CAAC;MAEhD,OAAOC,OAAO,CAACF,MAAM,CAACC,MAAM,CAAC;IACjC;EACJ,CAAC,CAAC;EAEFL,MAAM,CAACQ,IAAI,GAAG,GAAGC,0CAAoB,CAACC,IAAI,SAAS;EAEnD,OAAOV,MAAM;AACjB,CAAC;AAACW,OAAA,CAAAZ,gCAAA,GAAAA,gCAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/commandHandler/delete.js","sources":["../../../../src/resolver/app/commandHandler/delete.ts"],"sourcesContent":["import {\n CommandHandlerPlugin,\n createCommandHandlerPlugin\n} from \"~/resolver/plugins/CommandHandlerPlugin.js\";\nimport { DeleteCommandHandler } from \"./DeleteCommandHandler.js\";\n\nexport const createDeleteCommandHandlerPlugin = () => {\n const plugin = createCommandHandlerPlugin({\n canHandle: command => {\n return command === \"delete\";\n },\n handle: async params => {\n const handler = new DeleteCommandHandler(params);\n\n return handler.handle(params);\n }\n });\n\n plugin.name = `${CommandHandlerPlugin.type}.delete`;\n\n return plugin;\n};\n"],"names":["createDeleteCommandHandlerPlugin","plugin","createCommandHandlerPlugin","command","params","handler","DeleteCommandHandler","CommandHandlerPlugin"],"mappings":";;AAMO,MAAMA,mCAAmC;IAC5C,MAAMC,SAASC,2BAA2B;QACtC,WAAWC,CAAAA,UACAA,AAAY,aAAZA;QAEX,QAAQ,OAAMC;YACV,MAAMC,UAAU,IAAIC,qBAAqBF;YAEzC,OAAOC,QAAQ,MAAM,CAACD;QAC1B;IACJ;IAEAH,OAAO,IAAI,GAAG,GAAGM,qBAAqB,IAAI,CAAC,OAAO,CAAC;IAEnD,OAAON;AACX"}
@@ -1,2 +1,2 @@
1
- import { CommandHandlerPlugin } from "../../plugins/CommandHandlerPlugin.js";
1
+ import { CommandHandlerPlugin } from "../../../resolver/plugins/CommandHandlerPlugin.js";
2
2
  export declare const createPutCommandHandlerPlugin: () => CommandHandlerPlugin;
@@ -1,24 +1,16 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createPutCommandHandlerPlugin = void 0;
7
- var _CommandHandlerPlugin = require("../../plugins/CommandHandlerPlugin.js");
8
- var _PutCommandHandler = require("./PutCommandHandler");
9
- const createPutCommandHandlerPlugin = () => {
10
- const plugin = (0, _CommandHandlerPlugin.createCommandHandlerPlugin)({
11
- canHandle: command => {
12
- return command === "put";
13
- },
14
- handle: async params => {
15
- const handler = new _PutCommandHandler.PutCommandHandler(params);
16
- return handler.handle(params);
17
- }
18
- });
19
- plugin.name = `${_CommandHandlerPlugin.CommandHandlerPlugin.type}.put`;
20
- return plugin;
1
+ import { CommandHandlerPlugin, createCommandHandlerPlugin } from "../../plugins/CommandHandlerPlugin.js";
2
+ import { PutCommandHandler } from "./PutCommandHandler.js";
3
+ const createPutCommandHandlerPlugin = ()=>{
4
+ const plugin = createCommandHandlerPlugin({
5
+ canHandle: (command)=>"put" === command,
6
+ handle: async (params)=>{
7
+ const handler = new PutCommandHandler(params);
8
+ return handler.handle(params);
9
+ }
10
+ });
11
+ plugin.name = `${CommandHandlerPlugin.type}.put`;
12
+ return plugin;
21
13
  };
22
- exports.createPutCommandHandlerPlugin = createPutCommandHandlerPlugin;
14
+ export { createPutCommandHandlerPlugin };
23
15
 
24
16
  //# sourceMappingURL=put.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_CommandHandlerPlugin","require","_PutCommandHandler","createPutCommandHandlerPlugin","plugin","createCommandHandlerPlugin","canHandle","command","handle","params","handler","PutCommandHandler","name","CommandHandlerPlugin","type","exports"],"sources":["put.ts"],"sourcesContent":["import {\n CommandHandlerPlugin,\n createCommandHandlerPlugin\n} from \"~/resolver/plugins/CommandHandlerPlugin.js\";\nimport { PutCommandHandler } from \"./PutCommandHandler\";\n\nexport const createPutCommandHandlerPlugin = () => {\n const plugin = createCommandHandlerPlugin({\n canHandle: command => {\n return command === \"put\";\n },\n handle: async params => {\n const handler = new PutCommandHandler(params);\n\n return handler.handle(params);\n }\n });\n\n plugin.name = `${CommandHandlerPlugin.type}.put`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAIA,IAAAC,kBAAA,GAAAD,OAAA;AAEO,MAAME,6BAA6B,GAAGA,CAAA,KAAM;EAC/C,MAAMC,MAAM,GAAG,IAAAC,gDAA0B,EAAC;IACtCC,SAAS,EAAEC,OAAO,IAAI;MAClB,OAAOA,OAAO,KAAK,KAAK;IAC5B,CAAC;IACDC,MAAM,EAAE,MAAMC,MAAM,IAAI;MACpB,MAAMC,OAAO,GAAG,IAAIC,oCAAiB,CAACF,MAAM,CAAC;MAE7C,OAAOC,OAAO,CAACF,MAAM,CAACC,MAAM,CAAC;IACjC;EACJ,CAAC,CAAC;EAEFL,MAAM,CAACQ,IAAI,GAAG,GAAGC,0CAAoB,CAACC,IAAI,MAAM;EAEhD,OAAOV,MAAM;AACjB,CAAC;AAACW,OAAA,CAAAZ,6BAAA,GAAAA,6BAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/commandHandler/put.js","sources":["../../../../src/resolver/app/commandHandler/put.ts"],"sourcesContent":["import {\n CommandHandlerPlugin,\n createCommandHandlerPlugin\n} from \"~/resolver/plugins/CommandHandlerPlugin.js\";\nimport { PutCommandHandler } from \"./PutCommandHandler.js\";\n\nexport const createPutCommandHandlerPlugin = () => {\n const plugin = createCommandHandlerPlugin({\n canHandle: command => {\n return command === \"put\";\n },\n handle: async params => {\n const handler = new PutCommandHandler(params);\n\n return handler.handle(params);\n }\n });\n\n plugin.name = `${CommandHandlerPlugin.type}.put`;\n\n return plugin;\n};\n"],"names":["createPutCommandHandlerPlugin","plugin","createCommandHandlerPlugin","command","params","handler","PutCommandHandler","CommandHandlerPlugin"],"mappings":";;AAMO,MAAMA,gCAAgC;IACzC,MAAMC,SAASC,2BAA2B;QACtC,WAAWC,CAAAA,UACAA,AAAY,UAAZA;QAEX,QAAQ,OAAMC;YACV,MAAMC,UAAU,IAAIC,kBAAkBF;YAEtC,OAAOC,QAAQ,MAAM,CAACD;QAC1B;IACJ;IAEAH,OAAO,IAAI,GAAG,GAAGM,qBAAqB,IAAI,CAAC,IAAI,CAAC;IAEhD,OAAON;AACX"}
@@ -1,6 +1,6 @@
1
- import type { GenericRecord } from "@webiny/api/types";
2
- import type { IInputItem, IItem, ISourceDataContainer } from "./types.js";
3
- import type { IStoreItem } from "../storer/types.js";
1
+ import type { GenericRecord } from "@webiny/api/types.js";
2
+ import type { IInputItem, IItem, ISourceDataContainer } from "../../../resolver/app/data/types.js";
3
+ import type { IStoreItem } from "../../../resolver/app/storer/types.js";
4
4
  export declare class SourceDataContainer implements ISourceDataContainer {
5
5
  readonly items: GenericRecord<string, IItem>;
6
6
  private constructor();
@@ -1,42 +1,33 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SourceDataContainer = void 0;
7
1
  class SourceDataContainer {
8
- items = {};
9
- constructor() {
10
- // block
11
- }
12
- static create() {
13
- return new SourceDataContainer();
14
- }
15
- get(input) {
16
- const key = this.createKey(input);
17
- const item = this.items[key];
18
- return item?.data || null;
19
- }
20
- add(item, data) {
21
- const key = this.createKey(item);
22
- if (this.items[key]) {
23
- return;
2
+ constructor(){
3
+ this.items = {};
4
+ }
5
+ static create() {
6
+ return new SourceDataContainer();
7
+ }
8
+ get(input) {
9
+ const key = this.createKey(input);
10
+ const item = this.items[key];
11
+ return item?.data || null;
12
+ }
13
+ add(item, data) {
14
+ const key = this.createKey(item);
15
+ if (this.items[key]) return;
16
+ this.items[key] = {
17
+ ...item,
18
+ data
19
+ };
20
+ }
21
+ merge(container) {
22
+ for(const key in container.items){
23
+ const item = container.items[key];
24
+ this.add(item, item.data);
25
+ }
24
26
  }
25
- this.items[key] = {
26
- ...item,
27
- data
28
- };
29
- }
30
- merge(container) {
31
- for (const key in container.items) {
32
- const item = container.items[key];
33
- this.add(item, item.data);
27
+ createKey(item) {
28
+ return `${item.source.name}#${item.table.name}#${item.PK}#${item.SK}`;
34
29
  }
35
- }
36
- createKey(item) {
37
- return `${item.source.name}#${item.table.name}#${item.PK}#${item.SK}`;
38
- }
39
30
  }
40
- exports.SourceDataContainer = SourceDataContainer;
31
+ export { SourceDataContainer };
41
32
 
42
33
  //# sourceMappingURL=SourceDataContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SourceDataContainer","items","constructor","create","get","input","key","createKey","item","data","add","merge","container","source","name","table","PK","SK","exports"],"sources":["SourceDataContainer.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/api/types\";\nimport type { IInputItem, IItem, ISourceDataContainer } from \"~/resolver/app/data/types.js\";\nimport type { IStoreItem } from \"~/resolver/app/storer/types.js\";\n\nexport class SourceDataContainer implements ISourceDataContainer {\n public readonly items: GenericRecord<string, IItem> = {};\n\n private constructor() {\n // block\n }\n\n public static create(): ISourceDataContainer {\n return new SourceDataContainer();\n }\n\n public get(input: IInputItem): IStoreItem | null {\n const key = this.createKey(input);\n const item = this.items[key];\n return item?.data || null;\n }\n\n public add(item: IInputItem, data: IStoreItem | null): void {\n const key = this.createKey(item);\n if (this.items[key]) {\n return;\n }\n\n this.items[key] = {\n ...item,\n data\n };\n }\n\n public merge(container: ISourceDataContainer): void {\n for (const key in container.items) {\n const item = container.items[key];\n this.add(item, item.data);\n }\n }\n\n private createKey(item: IInputItem): string {\n return `${item.source.name}#${item.table.name}#${item.PK}#${item.SK}`;\n }\n}\n"],"mappings":";;;;;;AAIO,MAAMA,mBAAmB,CAAiC;EAC7CC,KAAK,GAAiC,CAAC,CAAC;EAEhDC,WAAWA,CAAA,EAAG;IAClB;EAAA;EAGJ,OAAcC,MAAMA,CAAA,EAAyB;IACzC,OAAO,IAAIH,mBAAmB,CAAC,CAAC;EACpC;EAEOI,GAAGA,CAACC,KAAiB,EAAqB;IAC7C,MAAMC,GAAG,GAAG,IAAI,CAACC,SAAS,CAACF,KAAK,CAAC;IACjC,MAAMG,IAAI,GAAG,IAAI,CAACP,KAAK,CAACK,GAAG,CAAC;IAC5B,OAAOE,IAAI,EAAEC,IAAI,IAAI,IAAI;EAC7B;EAEOC,GAAGA,CAACF,IAAgB,EAAEC,IAAuB,EAAQ;IACxD,MAAMH,GAAG,GAAG,IAAI,CAACC,SAAS,CAACC,IAAI,CAAC;IAChC,IAAI,IAAI,CAACP,KAAK,CAACK,GAAG,CAAC,EAAE;MACjB;IACJ;IAEA,IAAI,CAACL,KAAK,CAACK,GAAG,CAAC,GAAG;MACd,GAAGE,IAAI;MACPC;IACJ,CAAC;EACL;EAEOE,KAAKA,CAACC,SAA+B,EAAQ;IAChD,KAAK,MAAMN,GAAG,IAAIM,SAAS,CAACX,KAAK,EAAE;MAC/B,MAAMO,IAAI,GAAGI,SAAS,CAACX,KAAK,CAACK,GAAG,CAAC;MACjC,IAAI,CAACI,GAAG,CAACF,IAAI,EAAEA,IAAI,CAACC,IAAI,CAAC;IAC7B;EACJ;EAEQF,SAASA,CAACC,IAAgB,EAAU;IACxC,OAAO,GAAGA,IAAI,CAACK,MAAM,CAACC,IAAI,IAAIN,IAAI,CAACO,KAAK,CAACD,IAAI,IAAIN,IAAI,CAACQ,EAAE,IAAIR,IAAI,CAACS,EAAE,EAAE;EACzE;AACJ;AAACC,OAAA,CAAAlB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"file":"resolver/app/data/SourceDataContainer.js","sources":["../../../../src/resolver/app/data/SourceDataContainer.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { IInputItem, IItem, ISourceDataContainer } from \"~/resolver/app/data/types.js\";\nimport type { IStoreItem } from \"~/resolver/app/storer/types.js\";\n\nexport class SourceDataContainer implements ISourceDataContainer {\n public readonly items: GenericRecord<string, IItem> = {};\n\n private constructor() {\n // block\n }\n\n public static create(): ISourceDataContainer {\n return new SourceDataContainer();\n }\n\n public get(input: IInputItem): IStoreItem | null {\n const key = this.createKey(input);\n const item = this.items[key];\n return item?.data || null;\n }\n\n public add(item: IInputItem, data: IStoreItem | null): void {\n const key = this.createKey(item);\n if (this.items[key]) {\n return;\n }\n\n this.items[key] = {\n ...item,\n data\n };\n }\n\n public merge(container: ISourceDataContainer): void {\n for (const key in container.items) {\n const item = container.items[key];\n this.add(item, item.data);\n }\n }\n\n private createKey(item: IInputItem): string {\n return `${item.source.name}#${item.table.name}#${item.PK}#${item.SK}`;\n }\n}\n"],"names":["SourceDataContainer","input","key","item","data","container"],"mappings":"AAIO,MAAMA;IAGT,aAAsB;aAFN,KAAK,GAAiC,CAAC;IAIvD;IAEA,OAAc,SAA+B;QACzC,OAAO,IAAIA;IACf;IAEO,IAAIC,KAAiB,EAAqB;QAC7C,MAAMC,MAAM,IAAI,CAAC,SAAS,CAACD;QAC3B,MAAME,OAAO,IAAI,CAAC,KAAK,CAACD,IAAI;QAC5B,OAAOC,MAAM,QAAQ;IACzB;IAEO,IAAIA,IAAgB,EAAEC,IAAuB,EAAQ;QACxD,MAAMF,MAAM,IAAI,CAAC,SAAS,CAACC;QAC3B,IAAI,IAAI,CAAC,KAAK,CAACD,IAAI,EACf;QAGJ,IAAI,CAAC,KAAK,CAACA,IAAI,GAAG;YACd,GAAGC,IAAI;YACPC;QACJ;IACJ;IAEO,MAAMC,SAA+B,EAAQ;QAChD,IAAK,MAAMH,OAAOG,UAAU,KAAK,CAAE;YAC/B,MAAMF,OAAOE,UAAU,KAAK,CAACH,IAAI;YACjC,IAAI,CAAC,GAAG,CAACC,MAAMA,KAAK,IAAI;QAC5B;IACJ;IAEQ,UAAUA,IAAgB,EAAU;QACxC,OAAO,GAAGA,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,EAAEA,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC,EAAEA,KAAK,EAAE,CAAC,CAAC,EAAEA,KAAK,EAAE,EAAE;IACzE;AACJ"}
@@ -1,7 +1,7 @@
1
1
  import type { ITable } from "../../../sync/types.js";
2
- import type { IDeployment } from "../../deployment/types.js";
2
+ import type { IDeployment } from "../../../resolver/deployment/types.js";
3
3
  import type { GenericRecord } from "@webiny/api/types.js";
4
- import type { IStoreItem } from "../storer/types.js";
4
+ import type { IStoreItem } from "../../../resolver/app/storer/types.js";
5
5
  export interface IInputItem {
6
6
  PK: string;
7
7
  SK: string;