@ductape/sdk 0.1.7 → 0.1.8

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 (973) hide show
  1. package/package.json +4 -2
  2. package/dist/agents/agent-context.d.ts +0 -100
  3. package/dist/agents/agent-context.js +0 -604
  4. package/dist/agents/agent-context.js.map +0 -1
  5. package/dist/agents/agent-executor.d.ts +0 -180
  6. package/dist/agents/agent-executor.js +0 -715
  7. package/dist/agents/agent-executor.js.map +0 -1
  8. package/dist/agents/agents.service.d.ts +0 -310
  9. package/dist/agents/agents.service.js +0 -1255
  10. package/dist/agents/agents.service.js.map +0 -1
  11. package/dist/agents/index.d.ts +0 -55
  12. package/dist/agents/index.js +0 -110
  13. package/dist/agents/index.js.map +0 -1
  14. package/dist/agents/memory-manager.d.ts +0 -182
  15. package/dist/agents/memory-manager.js +0 -383
  16. package/dist/agents/memory-manager.js.map +0 -1
  17. package/dist/agents/tool-registry.d.ts +0 -141
  18. package/dist/agents/tool-registry.js +0 -355
  19. package/dist/agents/tool-registry.js.map +0 -1
  20. package/dist/agents/types/agents.types.d.ts +0 -1240
  21. package/dist/agents/types/agents.types.js +0 -12
  22. package/dist/agents/types/agents.types.js.map +0 -1
  23. package/dist/agents/types/index.d.ts +0 -6
  24. package/dist/agents/types/index.js +0 -23
  25. package/dist/agents/types/index.js.map +0 -1
  26. package/dist/agents/vector-store-adapter.d.ts +0 -108
  27. package/dist/agents/vector-store-adapter.js +0 -213
  28. package/dist/agents/vector-store-adapter.js.map +0 -1
  29. package/dist/api/services/appApi.service.d.ts +0 -78
  30. package/dist/api/services/appApi.service.js +0 -303
  31. package/dist/api/services/appApi.service.js.map +0 -1
  32. package/dist/api/services/logsApi.service.d.ts +0 -62
  33. package/dist/api/services/logsApi.service.js +0 -67
  34. package/dist/api/services/logsApi.service.js.map +0 -1
  35. package/dist/api/services/pricingApi.service.d.ts +0 -10
  36. package/dist/api/services/pricingApi.service.js +0 -34
  37. package/dist/api/services/pricingApi.service.js.map +0 -1
  38. package/dist/api/services/processorApi.service.d.ts +0 -927
  39. package/dist/api/services/processorApi.service.js +0 -787
  40. package/dist/api/services/processorApi.service.js.map +0 -1
  41. package/dist/api/services/productsApi.service.d.ts +0 -150
  42. package/dist/api/services/productsApi.service.js +0 -279
  43. package/dist/api/services/productsApi.service.js.map +0 -1
  44. package/dist/api/services/resilienceApi.service.d.ts +0 -106
  45. package/dist/api/services/resilienceApi.service.js +0 -224
  46. package/dist/api/services/resilienceApi.service.js.map +0 -1
  47. package/dist/api/services/secretsApi.service.d.ts +0 -51
  48. package/dist/api/services/secretsApi.service.js +0 -126
  49. package/dist/api/services/secretsApi.service.js.map +0 -1
  50. package/dist/api/services/userApi.service.d.ts +0 -10
  51. package/dist/api/services/userApi.service.js +0 -20
  52. package/dist/api/services/userApi.service.js.map +0 -1
  53. package/dist/api/services/webhooksApi.service.d.ts +0 -14
  54. package/dist/api/services/webhooksApi.service.js +0 -65
  55. package/dist/api/services/webhooksApi.service.js.map +0 -1
  56. package/dist/api/services/workflowApi.service.d.ts +0 -199
  57. package/dist/api/services/workflowApi.service.js +0 -201
  58. package/dist/api/services/workflowApi.service.js.map +0 -1
  59. package/dist/api/services/workspaceApi.service.d.ts +0 -20
  60. package/dist/api/services/workspaceApi.service.js +0 -54
  61. package/dist/api/services/workspaceApi.service.js.map +0 -1
  62. package/dist/api/urls.d.ts +0 -136
  63. package/dist/api/urls.js +0 -185
  64. package/dist/api/urls.js.map +0 -1
  65. package/dist/api/utils/auth.utils.d.ts +0 -10
  66. package/dist/api/utils/auth.utils.js +0 -24
  67. package/dist/api/utils/auth.utils.js.map +0 -1
  68. package/dist/api/utils/cache.utils.d.ts +0 -3
  69. package/dist/api/utils/cache.utils.js +0 -18
  70. package/dist/api/utils/cache.utils.js.map +0 -1
  71. package/dist/api/utils/strings.utils.d.ts +0 -7
  72. package/dist/api/utils/strings.utils.js +0 -64
  73. package/dist/api/utils/strings.utils.js.map +0 -1
  74. package/dist/apps/services/app.service.d.ts +0 -126
  75. package/dist/apps/services/app.service.js +0 -1436
  76. package/dist/apps/services/app.service.js.map +0 -1
  77. package/dist/apps/utils/auth-context-manager.d.ts +0 -137
  78. package/dist/apps/utils/auth-context-manager.js +0 -248
  79. package/dist/apps/utils/auth-context-manager.js.map +0 -1
  80. package/dist/apps/utils/credential-manager.d.ts +0 -128
  81. package/dist/apps/utils/credential-manager.js +0 -199
  82. package/dist/apps/utils/credential-manager.js.map +0 -1
  83. package/dist/apps/utils/index.d.ts +0 -10
  84. package/dist/apps/utils/index.js +0 -54
  85. package/dist/apps/utils/index.js.map +0 -1
  86. package/dist/apps/utils/input-helpers.d.ts +0 -67
  87. package/dist/apps/utils/input-helpers.js +0 -185
  88. package/dist/apps/utils/input-helpers.js.map +0 -1
  89. package/dist/apps/utils/input-resolver.d.ts +0 -165
  90. package/dist/apps/utils/input-resolver.js +0 -477
  91. package/dist/apps/utils/input-resolver.js.map +0 -1
  92. package/dist/apps/utils/oauth-manager.d.ts +0 -196
  93. package/dist/apps/utils/oauth-manager.js +0 -429
  94. package/dist/apps/utils/oauth-manager.js.map +0 -1
  95. package/dist/apps/utils/objects.utils.d.ts +0 -4
  96. package/dist/apps/utils/objects.utils.js +0 -59
  97. package/dist/apps/utils/objects.utils.js.map +0 -1
  98. package/dist/apps/utils/string.utils.d.ts +0 -9
  99. package/dist/apps/utils/string.utils.js +0 -89
  100. package/dist/apps/utils/string.utils.js.map +0 -1
  101. package/dist/apps/validators/index.d.ts +0 -17
  102. package/dist/apps/validators/index.js +0 -39
  103. package/dist/apps/validators/index.js.map +0 -1
  104. package/dist/apps/validators/joi-validators/create.app.validator.d.ts +0 -3
  105. package/dist/apps/validators/joi-validators/create.app.validator.js +0 -43
  106. package/dist/apps/validators/joi-validators/create.app.validator.js.map +0 -1
  107. package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +0 -3
  108. package/dist/apps/validators/joi-validators/create.appAction.validator.js +0 -72
  109. package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +0 -1
  110. package/dist/apps/validators/joi-validators/create.appActionResponse.validator.d.ts +0 -7
  111. package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js +0 -81
  112. package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js.map +0 -1
  113. package/dist/apps/validators/joi-validators/create.appAuth.validator.d.ts +0 -3
  114. package/dist/apps/validators/joi-validators/create.appAuth.validator.js +0 -64
  115. package/dist/apps/validators/joi-validators/create.appAuth.validator.js.map +0 -1
  116. package/dist/apps/validators/joi-validators/create.appBody.validators.d.ts +0 -4
  117. package/dist/apps/validators/joi-validators/create.appBody.validators.js +0 -44
  118. package/dist/apps/validators/joi-validators/create.appBody.validators.js.map +0 -1
  119. package/dist/apps/validators/joi-validators/create.appConstants.validator.d.ts +0 -4
  120. package/dist/apps/validators/joi-validators/create.appConstants.validator.js +0 -45
  121. package/dist/apps/validators/joi-validators/create.appConstants.validator.js.map +0 -1
  122. package/dist/apps/validators/joi-validators/create.appEnv.validator.d.ts +0 -4
  123. package/dist/apps/validators/joi-validators/create.appEnv.validator.js +0 -50
  124. package/dist/apps/validators/joi-validators/create.appEnv.validator.js.map +0 -1
  125. package/dist/apps/validators/joi-validators/create.appVariable.validator.d.ts +0 -4
  126. package/dist/apps/validators/joi-validators/create.appVariable.validator.js +0 -47
  127. package/dist/apps/validators/joi-validators/create.appVariable.validator.js.map +0 -1
  128. package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +0 -4
  129. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +0 -60
  130. package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +0 -1
  131. package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.d.ts +0 -3
  132. package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js +0 -48
  133. package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js.map +0 -1
  134. package/dist/apps/validators/joi-validators/sample.validator.d.ts +0 -6
  135. package/dist/apps/validators/joi-validators/sample.validator.js +0 -65
  136. package/dist/apps/validators/joi-validators/sample.validator.js.map +0 -1
  137. package/dist/apps/validators/joi-validators/update.app.validator.d.ts +0 -4
  138. package/dist/apps/validators/joi-validators/update.app.validator.js +0 -66
  139. package/dist/apps/validators/joi-validators/update.app.validator.js.map +0 -1
  140. package/dist/apps/validators/joi-validators/update.appAction.validator.d.ts +0 -4
  141. package/dist/apps/validators/joi-validators/update.appAction.validator.js +0 -76
  142. package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +0 -1
  143. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +0 -3
  144. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +0 -57
  145. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +0 -1
  146. package/dist/apps/validators/joi-validators/update.appAuth.validator.d.ts +0 -4
  147. package/dist/apps/validators/joi-validators/update.appAuth.validator.js +0 -52
  148. package/dist/apps/validators/joi-validators/update.appAuth.validator.js.map +0 -1
  149. package/dist/apps/validators/joi-validators/update.appConstants.validator.d.ts +0 -4
  150. package/dist/apps/validators/joi-validators/update.appConstants.validator.js +0 -45
  151. package/dist/apps/validators/joi-validators/update.appConstants.validator.js.map +0 -1
  152. package/dist/apps/validators/joi-validators/update.appEnv.validator.d.ts +0 -4
  153. package/dist/apps/validators/joi-validators/update.appEnv.validator.js +0 -50
  154. package/dist/apps/validators/joi-validators/update.appEnv.validator.js.map +0 -1
  155. package/dist/apps/validators/joi-validators/update.appVariables.validator.d.ts +0 -4
  156. package/dist/apps/validators/joi-validators/update.appVariables.validator.js +0 -47
  157. package/dist/apps/validators/joi-validators/update.appVariables.validator.js.map +0 -1
  158. package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +0 -4
  159. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +0 -59
  160. package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +0 -1
  161. package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.d.ts +0 -3
  162. package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js +0 -48
  163. package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js.map +0 -1
  164. package/dist/apps/validators/joi-validators/update.validation.entityData.validator.d.ts +0 -3
  165. package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js +0 -60
  166. package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js.map +0 -1
  167. package/dist/bin.d.ts +0 -26
  168. package/dist/bin.js +0 -28
  169. package/dist/bin.js.map +0 -1
  170. package/dist/brokers/brokers.service.d.ts +0 -438
  171. package/dist/brokers/brokers.service.js +0 -1294
  172. package/dist/brokers/brokers.service.js.map +0 -1
  173. package/dist/brokers/index.d.ts +0 -46
  174. package/dist/brokers/index.js +0 -83
  175. package/dist/brokers/index.js.map +0 -1
  176. package/dist/brokers/types/index.d.ts +0 -569
  177. package/dist/brokers/types/index.js +0 -8
  178. package/dist/brokers/types/index.js.map +0 -1
  179. package/dist/brokers/utils/broker.util.d.ts +0 -33
  180. package/dist/brokers/utils/broker.util.js +0 -125
  181. package/dist/brokers/utils/broker.util.js.map +0 -1
  182. package/dist/brokers/utils/providers/aws-sqs.service.d.ts +0 -16
  183. package/dist/brokers/utils/providers/aws-sqs.service.js +0 -71
  184. package/dist/brokers/utils/providers/aws-sqs.service.js.map +0 -1
  185. package/dist/brokers/utils/providers/google-pubsub.service.d.ts +0 -16
  186. package/dist/brokers/utils/providers/google-pubsub.service.js +0 -43
  187. package/dist/brokers/utils/providers/google-pubsub.service.js.map +0 -1
  188. package/dist/brokers/utils/providers/index.d.ts +0 -6
  189. package/dist/brokers/utils/providers/index.js +0 -16
  190. package/dist/brokers/utils/providers/index.js.map +0 -1
  191. package/dist/brokers/utils/providers/kafka.service.d.ts +0 -23
  192. package/dist/brokers/utils/providers/kafka.service.js +0 -131
  193. package/dist/brokers/utils/providers/kafka.service.js.map +0 -1
  194. package/dist/brokers/utils/providers/nats.service.d.ts +0 -18
  195. package/dist/brokers/utils/providers/nats.service.js +0 -63
  196. package/dist/brokers/utils/providers/nats.service.js.map +0 -1
  197. package/dist/brokers/utils/providers/rabbitmq.service.d.ts +0 -25
  198. package/dist/brokers/utils/providers/rabbitmq.service.js +0 -138
  199. package/dist/brokers/utils/providers/rabbitmq.service.js.map +0 -1
  200. package/dist/brokers/utils/providers/redis.service.d.ts +0 -18
  201. package/dist/brokers/utils/providers/redis.service.js +0 -93
  202. package/dist/brokers/utils/providers/redis.service.js.map +0 -1
  203. package/dist/cache/cache.manager.d.ts +0 -308
  204. package/dist/cache/cache.manager.js +0 -900
  205. package/dist/cache/cache.manager.js.map +0 -1
  206. package/dist/cache/cache.service.d.ts +0 -192
  207. package/dist/cache/cache.service.js +0 -596
  208. package/dist/cache/cache.service.js.map +0 -1
  209. package/dist/cache/index.d.ts +0 -52
  210. package/dist/cache/index.js +0 -81
  211. package/dist/cache/index.js.map +0 -1
  212. package/dist/cache/types/index.d.ts +0 -112
  213. package/dist/cache/types/index.js +0 -6
  214. package/dist/cache/types/index.js.map +0 -1
  215. package/dist/clients/apps.client.d.ts +0 -4
  216. package/dist/clients/apps.client.js +0 -31
  217. package/dist/clients/apps.client.js.map +0 -1
  218. package/dist/clients/email.client.d.ts +0 -4
  219. package/dist/clients/email.client.js +0 -29
  220. package/dist/clients/email.client.js.map +0 -1
  221. package/dist/clients/expo.client.d.ts +0 -3
  222. package/dist/clients/expo.client.js +0 -28
  223. package/dist/clients/expo.client.js.map +0 -1
  224. package/dist/clients/function.client.d.ts +0 -3
  225. package/dist/clients/function.client.js +0 -27
  226. package/dist/clients/function.client.js.map +0 -1
  227. package/dist/clients/http.client.d.ts +0 -3
  228. package/dist/clients/http.client.js +0 -27
  229. package/dist/clients/http.client.js.map +0 -1
  230. package/dist/clients/logs.client.d.ts +0 -4
  231. package/dist/clients/logs.client.js +0 -34
  232. package/dist/clients/logs.client.js.map +0 -1
  233. package/dist/clients/pricing.client.d.ts +0 -4
  234. package/dist/clients/pricing.client.js +0 -34
  235. package/dist/clients/pricing.client.js.map +0 -1
  236. package/dist/clients/products.client.d.ts +0 -3
  237. package/dist/clients/products.client.js +0 -32
  238. package/dist/clients/products.client.js.map +0 -1
  239. package/dist/clients/users.client.d.ts +0 -4
  240. package/dist/clients/users.client.js +0 -34
  241. package/dist/clients/users.client.js.map +0 -1
  242. package/dist/clients/webhooks.client.d.ts +0 -4
  243. package/dist/clients/webhooks.client.js +0 -34
  244. package/dist/clients/webhooks.client.js.map +0 -1
  245. package/dist/clients/workspace.client.d.ts +0 -7
  246. package/dist/clients/workspace.client.js +0 -39
  247. package/dist/clients/workspace.client.js.map +0 -1
  248. package/dist/database/actions/action-manager.d.ts +0 -170
  249. package/dist/database/actions/action-manager.js +0 -465
  250. package/dist/database/actions/action-manager.js.map +0 -1
  251. package/dist/database/actions/index.d.ts +0 -6
  252. package/dist/database/actions/index.js +0 -13
  253. package/dist/database/actions/index.js.map +0 -1
  254. package/dist/database/adapters/adapter.factory.d.ts +0 -62
  255. package/dist/database/adapters/adapter.factory.js +0 -97
  256. package/dist/database/adapters/adapter.factory.js.map +0 -1
  257. package/dist/database/adapters/base.adapter.d.ts +0 -423
  258. package/dist/database/adapters/base.adapter.js +0 -260
  259. package/dist/database/adapters/base.adapter.js.map +0 -1
  260. package/dist/database/adapters/cassandra.adapter.d.ts +0 -92
  261. package/dist/database/adapters/cassandra.adapter.js +0 -1091
  262. package/dist/database/adapters/cassandra.adapter.js.map +0 -1
  263. package/dist/database/adapters/dynamodb.adapter.d.ts +0 -110
  264. package/dist/database/adapters/dynamodb.adapter.js +0 -1564
  265. package/dist/database/adapters/dynamodb.adapter.js.map +0 -1
  266. package/dist/database/adapters/index.d.ts +0 -11
  267. package/dist/database/adapters/index.js +0 -27
  268. package/dist/database/adapters/index.js.map +0 -1
  269. package/dist/database/adapters/mariadb.adapter.d.ts +0 -100
  270. package/dist/database/adapters/mariadb.adapter.js +0 -247
  271. package/dist/database/adapters/mariadb.adapter.js.map +0 -1
  272. package/dist/database/adapters/mongodb.adapter.d.ts +0 -121
  273. package/dist/database/adapters/mongodb.adapter.js +0 -1284
  274. package/dist/database/adapters/mongodb.adapter.js.map +0 -1
  275. package/dist/database/adapters/mysql.adapter.d.ts +0 -86
  276. package/dist/database/adapters/mysql.adapter.js +0 -1371
  277. package/dist/database/adapters/mysql.adapter.js.map +0 -1
  278. package/dist/database/adapters/postgresql.adapter.d.ts +0 -90
  279. package/dist/database/adapters/postgresql.adapter.js +0 -1487
  280. package/dist/database/adapters/postgresql.adapter.js.map +0 -1
  281. package/dist/database/databases.service.d.ts +0 -1496
  282. package/dist/database/databases.service.js +0 -3294
  283. package/dist/database/databases.service.js.map +0 -1
  284. package/dist/database/index.d.ts +0 -46
  285. package/dist/database/index.js +0 -109
  286. package/dist/database/index.js.map +0 -1
  287. package/dist/database/migrations/index.d.ts +0 -6
  288. package/dist/database/migrations/index.js +0 -12
  289. package/dist/database/migrations/index.js.map +0 -1
  290. package/dist/database/migrations/migration-engine.d.ts +0 -136
  291. package/dist/database/migrations/migration-engine.js +0 -1421
  292. package/dist/database/migrations/migration-engine.js.map +0 -1
  293. package/dist/database/operators/aggregation-builder.d.ts +0 -67
  294. package/dist/database/operators/aggregation-builder.js +0 -841
  295. package/dist/database/operators/aggregation-builder.js.map +0 -1
  296. package/dist/database/operators/index.d.ts +0 -7
  297. package/dist/database/operators/index.js +0 -15
  298. package/dist/database/operators/index.js.map +0 -1
  299. package/dist/database/operators/query-builder.d.ts +0 -69
  300. package/dist/database/operators/query-builder.js +0 -447
  301. package/dist/database/operators/query-builder.js.map +0 -1
  302. package/dist/database/presave/decrypt.d.ts +0 -25
  303. package/dist/database/presave/decrypt.js +0 -146
  304. package/dist/database/presave/decrypt.js.map +0 -1
  305. package/dist/database/presave/index.d.ts +0 -9
  306. package/dist/database/presave/index.js +0 -18
  307. package/dist/database/presave/index.js.map +0 -1
  308. package/dist/database/presave/presave-processor.d.ts +0 -148
  309. package/dist/database/presave/presave-processor.js +0 -702
  310. package/dist/database/presave/presave-processor.js.map +0 -1
  311. package/dist/database/schema/index.d.ts +0 -7
  312. package/dist/database/schema/index.js +0 -13
  313. package/dist/database/schema/index.js.map +0 -1
  314. package/dist/database/schema/schema-manager.d.ts +0 -258
  315. package/dist/database/schema/schema-manager.js +0 -638
  316. package/dist/database/schema/schema-manager.js.map +0 -1
  317. package/dist/database/transactions/index.d.ts +0 -6
  318. package/dist/database/transactions/index.js +0 -13
  319. package/dist/database/transactions/index.js.map +0 -1
  320. package/dist/database/transactions/transaction-manager.d.ts +0 -113
  321. package/dist/database/transactions/transaction-manager.js +0 -344
  322. package/dist/database/transactions/transaction-manager.js.map +0 -1
  323. package/dist/database/triggers/index.d.ts +0 -7
  324. package/dist/database/triggers/index.js +0 -14
  325. package/dist/database/triggers/index.js.map +0 -1
  326. package/dist/database/triggers/trigger-processor.d.ts +0 -239
  327. package/dist/database/triggers/trigger-processor.js +0 -1034
  328. package/dist/database/triggers/trigger-processor.js.map +0 -1
  329. package/dist/database/types/action.interface.d.ts +0 -148
  330. package/dist/database/types/action.interface.js +0 -6
  331. package/dist/database/types/action.interface.js.map +0 -1
  332. package/dist/database/types/aggregation.interface.d.ts +0 -185
  333. package/dist/database/types/aggregation.interface.js +0 -6
  334. package/dist/database/types/aggregation.interface.js.map +0 -1
  335. package/dist/database/types/connection.interface.d.ts +0 -137
  336. package/dist/database/types/connection.interface.js +0 -6
  337. package/dist/database/types/connection.interface.js.map +0 -1
  338. package/dist/database/types/dashboard.interface.d.ts +0 -74
  339. package/dist/database/types/dashboard.interface.js +0 -7
  340. package/dist/database/types/dashboard.interface.js.map +0 -1
  341. package/dist/database/types/enums.d.ts +0 -195
  342. package/dist/database/types/enums.js +0 -244
  343. package/dist/database/types/enums.js.map +0 -1
  344. package/dist/database/types/index.d.ts +0 -15
  345. package/dist/database/types/index.js +0 -31
  346. package/dist/database/types/index.js.map +0 -1
  347. package/dist/database/types/migration.interface.d.ts +0 -686
  348. package/dist/database/types/migration.interface.js +0 -9
  349. package/dist/database/types/migration.interface.js.map +0 -1
  350. package/dist/database/types/presave.interface.d.ts +0 -292
  351. package/dist/database/types/presave.interface.js +0 -60
  352. package/dist/database/types/presave.interface.js.map +0 -1
  353. package/dist/database/types/query.interface.d.ts +0 -205
  354. package/dist/database/types/query.interface.js +0 -6
  355. package/dist/database/types/query.interface.js.map +0 -1
  356. package/dist/database/types/schema.interface.d.ts +0 -412
  357. package/dist/database/types/schema.interface.js +0 -6
  358. package/dist/database/types/schema.interface.js.map +0 -1
  359. package/dist/database/types/transaction.interface.d.ts +0 -84
  360. package/dist/database/types/transaction.interface.js +0 -6
  361. package/dist/database/types/transaction.interface.js.map +0 -1
  362. package/dist/database/types/trigger.interface.d.ts +0 -612
  363. package/dist/database/types/trigger.interface.js +0 -121
  364. package/dist/database/types/trigger.interface.js.map +0 -1
  365. package/dist/database/types/write.interface.d.ts +0 -216
  366. package/dist/database/types/write.interface.js +0 -6
  367. package/dist/database/types/write.interface.js.map +0 -1
  368. package/dist/database/utils/database-error.d.ts +0 -96
  369. package/dist/database/utils/database-error.js +0 -221
  370. package/dist/database/utils/database-error.js.map +0 -1
  371. package/dist/database/utils/index.d.ts +0 -6
  372. package/dist/database/utils/index.js +0 -11
  373. package/dist/database/utils/index.js.map +0 -1
  374. package/dist/graph/adapters/adapter.factory.d.ts +0 -47
  375. package/dist/graph/adapters/adapter.factory.js +0 -77
  376. package/dist/graph/adapters/adapter.factory.js.map +0 -1
  377. package/dist/graph/adapters/arangodb.adapter.d.ts +0 -86
  378. package/dist/graph/adapters/arangodb.adapter.js +0 -1588
  379. package/dist/graph/adapters/arangodb.adapter.js.map +0 -1
  380. package/dist/graph/adapters/base.adapter.d.ts +0 -264
  381. package/dist/graph/adapters/base.adapter.js +0 -156
  382. package/dist/graph/adapters/base.adapter.js.map +0 -1
  383. package/dist/graph/adapters/index.d.ts +0 -11
  384. package/dist/graph/adapters/index.js +0 -21
  385. package/dist/graph/adapters/index.js.map +0 -1
  386. package/dist/graph/adapters/memgraph.adapter.d.ts +0 -110
  387. package/dist/graph/adapters/memgraph.adapter.js +0 -1452
  388. package/dist/graph/adapters/memgraph.adapter.js.map +0 -1
  389. package/dist/graph/adapters/neo4j.adapter.d.ts +0 -81
  390. package/dist/graph/adapters/neo4j.adapter.js +0 -1317
  391. package/dist/graph/adapters/neo4j.adapter.js.map +0 -1
  392. package/dist/graph/adapters/neptune.adapter.d.ts +0 -82
  393. package/dist/graph/adapters/neptune.adapter.js +0 -1369
  394. package/dist/graph/adapters/neptune.adapter.js.map +0 -1
  395. package/dist/graph/graphs.service.d.ts +0 -617
  396. package/dist/graph/graphs.service.js +0 -2594
  397. package/dist/graph/graphs.service.js.map +0 -1
  398. package/dist/graph/index.d.ts +0 -57
  399. package/dist/graph/index.js +0 -77
  400. package/dist/graph/index.js.map +0 -1
  401. package/dist/graph/transactions/index.d.ts +0 -4
  402. package/dist/graph/transactions/index.js +0 -9
  403. package/dist/graph/transactions/index.js.map +0 -1
  404. package/dist/graph/transactions/transaction-manager.d.ts +0 -61
  405. package/dist/graph/transactions/transaction-manager.js +0 -126
  406. package/dist/graph/transactions/transaction-manager.js.map +0 -1
  407. package/dist/graph/types/connection.interface.d.ts +0 -149
  408. package/dist/graph/types/connection.interface.js +0 -9
  409. package/dist/graph/types/connection.interface.js.map +0 -1
  410. package/dist/graph/types/enums.d.ts +0 -101
  411. package/dist/graph/types/enums.js +0 -114
  412. package/dist/graph/types/enums.js.map +0 -1
  413. package/dist/graph/types/index.d.ts +0 -13
  414. package/dist/graph/types/index.js +0 -20
  415. package/dist/graph/types/index.js.map +0 -1
  416. package/dist/graph/types/node.interface.d.ts +0 -248
  417. package/dist/graph/types/node.interface.js +0 -9
  418. package/dist/graph/types/node.interface.js.map +0 -1
  419. package/dist/graph/types/query.interface.d.ts +0 -175
  420. package/dist/graph/types/query.interface.js +0 -9
  421. package/dist/graph/types/query.interface.js.map +0 -1
  422. package/dist/graph/types/relationship.interface.d.ts +0 -207
  423. package/dist/graph/types/relationship.interface.js +0 -9
  424. package/dist/graph/types/relationship.interface.js.map +0 -1
  425. package/dist/graph/types/schema.interface.d.ts +0 -295
  426. package/dist/graph/types/schema.interface.js +0 -9
  427. package/dist/graph/types/schema.interface.js.map +0 -1
  428. package/dist/graph/types/transaction.interface.d.ts +0 -55
  429. package/dist/graph/types/transaction.interface.js +0 -9
  430. package/dist/graph/types/transaction.interface.js.map +0 -1
  431. package/dist/graph/types/traversal.interface.d.ts +0 -181
  432. package/dist/graph/types/traversal.interface.js +0 -9
  433. package/dist/graph/types/traversal.interface.js.map +0 -1
  434. package/dist/graph/utils/graph-error.d.ts +0 -71
  435. package/dist/graph/utils/graph-error.js +0 -142
  436. package/dist/graph/utils/graph-error.js.map +0 -1
  437. package/dist/graph/utils/index.d.ts +0 -4
  438. package/dist/graph/utils/index.js +0 -9
  439. package/dist/graph/utils/index.js.map +0 -1
  440. package/dist/imports/imports.repo.d.ts +0 -0
  441. package/dist/imports/imports.repo.js +0 -1
  442. package/dist/imports/imports.repo.js.map +0 -1
  443. package/dist/imports/imports.service.d.ts +0 -23
  444. package/dist/imports/imports.service.js +0 -71
  445. package/dist/imports/imports.service.js.map +0 -1
  446. package/dist/imports/imports.types.d.ts +0 -350
  447. package/dist/imports/imports.types.js +0 -33
  448. package/dist/imports/imports.types.js.map +0 -1
  449. package/dist/imports/openAPI3.0.types.d.ts +0 -52
  450. package/dist/imports/openAPI3.0.types.js +0 -3
  451. package/dist/imports/openAPI3.0.types.js.map +0 -1
  452. package/dist/imports/repos/openApi.repo.d.ts +0 -6
  453. package/dist/imports/repos/openApi.repo.js +0 -422
  454. package/dist/imports/repos/openApi.repo.js.map +0 -1
  455. package/dist/imports/repos/postmanV21.repo.d.ts +0 -14
  456. package/dist/imports/repos/postmanV21.repo.js +0 -257
  457. package/dist/imports/repos/postmanV21.repo.js.map +0 -1
  458. package/dist/imports/utils/imports.utils.d.ts +0 -80
  459. package/dist/imports/utils/imports.utils.js +0 -114
  460. package/dist/imports/utils/imports.utils.js.map +0 -1
  461. package/dist/imports/validators/index.d.ts +0 -0
  462. package/dist/imports/validators/index.js +0 -1
  463. package/dist/imports/validators/index.js.map +0 -1
  464. package/dist/imports/validators/joi-validators/postmanV21.validator.d.ts +0 -5
  465. package/dist/imports/validators/joi-validators/postmanV21.validator.js +0 -96
  466. package/dist/imports/validators/joi-validators/postmanV21.validator.js.map +0 -1
  467. package/dist/index.d.ts +0 -4021
  468. package/dist/index.js +0 -5895
  469. package/dist/index.js.map +0 -1
  470. package/dist/init.interface.d.ts +0 -407
  471. package/dist/init.interface.js +0 -3
  472. package/dist/init.interface.js.map +0 -1
  473. package/dist/inputs/inputs.repo.d.ts +0 -7
  474. package/dist/inputs/inputs.repo.js +0 -16
  475. package/dist/inputs/inputs.repo.js.map +0 -1
  476. package/dist/inputs/inputs.service.d.ts +0 -61
  477. package/dist/inputs/inputs.service.js +0 -468
  478. package/dist/inputs/inputs.service.js.map +0 -1
  479. package/dist/inputs/utils/inputs.utils.create.d.ts +0 -11
  480. package/dist/inputs/utils/inputs.utils.create.js +0 -273
  481. package/dist/inputs/utils/inputs.utils.create.js.map +0 -1
  482. package/dist/inputs/validators/inputs.validator.parse.d.ts +0 -4
  483. package/dist/inputs/validators/inputs.validator.parse.js +0 -53
  484. package/dist/inputs/validators/inputs.validator.parse.js.map +0 -1
  485. package/dist/jobs/index.d.ts +0 -38
  486. package/dist/jobs/index.js +0 -50
  487. package/dist/jobs/index.js.map +0 -1
  488. package/dist/jobs/jobs.service.d.ts +0 -154
  489. package/dist/jobs/jobs.service.js +0 -491
  490. package/dist/jobs/jobs.service.js.map +0 -1
  491. package/dist/jobs/jobs.state.d.ts +0 -113
  492. package/dist/jobs/jobs.state.js +0 -447
  493. package/dist/jobs/jobs.state.js.map +0 -1
  494. package/dist/jobs/types.d.ts +0 -449
  495. package/dist/jobs/types.js +0 -74
  496. package/dist/jobs/types.js.map +0 -1
  497. package/dist/logs/logs.repo.d.ts +0 -6
  498. package/dist/logs/logs.repo.js +0 -12
  499. package/dist/logs/logs.repo.js.map +0 -1
  500. package/dist/logs/logs.service.d.ts +0 -30
  501. package/dist/logs/logs.service.js +0 -89
  502. package/dist/logs/logs.service.js.map +0 -1
  503. package/dist/logs/logs.types.d.ts +0 -85
  504. package/dist/logs/logs.types.js +0 -52
  505. package/dist/logs/logs.types.js.map +0 -1
  506. package/dist/logs/utils/logs.utils.create.d.ts +0 -0
  507. package/dist/logs/utils/logs.utils.create.js +0 -1
  508. package/dist/logs/utils/logs.utils.create.js.map +0 -1
  509. package/dist/logs/utils/logs.utils.errors.d.ts +0 -2
  510. package/dist/logs/utils/logs.utils.errors.js +0 -8
  511. package/dist/logs/utils/logs.utils.errors.js.map +0 -1
  512. package/dist/models/index.d.ts +0 -6
  513. package/dist/models/index.js +0 -11
  514. package/dist/models/index.js.map +0 -1
  515. package/dist/models/models.service.d.ts +0 -137
  516. package/dist/models/models.service.js +0 -195
  517. package/dist/models/models.service.js.map +0 -1
  518. package/dist/notifications/index.d.ts +0 -13
  519. package/dist/notifications/index.js +0 -26
  520. package/dist/notifications/index.js.map +0 -1
  521. package/dist/notifications/notifications.service.d.ts +0 -268
  522. package/dist/notifications/notifications.service.js +0 -907
  523. package/dist/notifications/notifications.service.js.map +0 -1
  524. package/dist/notifications/types/index.d.ts +0 -4
  525. package/dist/notifications/types/index.js +0 -21
  526. package/dist/notifications/types/index.js.map +0 -1
  527. package/dist/notifications/types/notifications.types.d.ts +0 -454
  528. package/dist/notifications/types/notifications.types.js +0 -51
  529. package/dist/notifications/types/notifications.types.js.map +0 -1
  530. package/dist/parsers/index.d.ts +0 -3
  531. package/dist/parsers/index.js +0 -27
  532. package/dist/parsers/index.js.map +0 -1
  533. package/dist/parsers/pipelines/postman.pipelines.d.ts +0 -15
  534. package/dist/parsers/pipelines/postman.pipelines.js +0 -103
  535. package/dist/parsers/pipelines/postman.pipelines.js.map +0 -1
  536. package/dist/parsers/types/postman.types.d.ts +0 -200
  537. package/dist/parsers/types/postman.types.js +0 -3
  538. package/dist/parsers/types/postman.types.js.map +0 -1
  539. package/dist/parsers/utils/postman.utils.d.ts +0 -12
  540. package/dist/parsers/utils/postman.utils.js +0 -116
  541. package/dist/parsers/utils/postman.utils.js.map +0 -1
  542. package/dist/parsers/validators/postman-auth.validators.d.ts +0 -10
  543. package/dist/parsers/validators/postman-auth.validators.js +0 -127
  544. package/dist/parsers/validators/postman-auth.validators.js.map +0 -1
  545. package/dist/parsers/validators/postman-request.validators.d.ts +0 -13
  546. package/dist/parsers/validators/postman-request.validators.js +0 -139
  547. package/dist/parsers/validators/postman-request.validators.js.map +0 -1
  548. package/dist/parsers/validators/postman-response.validators.d.ts +0 -13
  549. package/dist/parsers/validators/postman-response.validators.js +0 -150
  550. package/dist/parsers/validators/postman-response.validators.js.map +0 -1
  551. package/dist/parsers/validators/postman-variable.validators.d.ts +0 -14
  552. package/dist/parsers/validators/postman-variable.validators.js +0 -163
  553. package/dist/parsers/validators/postman-variable.validators.js.map +0 -1
  554. package/dist/pricing/pricing.repo.d.ts +0 -0
  555. package/dist/pricing/pricing.repo.js +0 -1
  556. package/dist/pricing/pricing.repo.js.map +0 -1
  557. package/dist/pricing/pricing.service.d.ts +0 -24
  558. package/dist/pricing/pricing.service.js +0 -51
  559. package/dist/pricing/pricing.service.js.map +0 -1
  560. package/dist/pricing/pricing.types.d.ts +0 -76
  561. package/dist/pricing/pricing.types.js +0 -21
  562. package/dist/pricing/pricing.types.js.map +0 -1
  563. package/dist/pricing/utils/string.utils.d.ts +0 -1
  564. package/dist/pricing/utils/string.utils.js +0 -9
  565. package/dist/pricing/utils/string.utils.js.map +0 -1
  566. package/dist/processor/repos/mongo.repo.d.ts +0 -39
  567. package/dist/processor/repos/mongo.repo.js +0 -260
  568. package/dist/processor/repos/mongo.repo.js.map +0 -1
  569. package/dist/processor/repos/postgres.repo.d.ts +0 -31
  570. package/dist/processor/repos/postgres.repo.js +0 -185
  571. package/dist/processor/repos/postgres.repo.js.map +0 -1
  572. package/dist/processor/repos/sms.repo.d.ts +0 -39
  573. package/dist/processor/repos/sms.repo.js +0 -124
  574. package/dist/processor/repos/sms.repo.js.map +0 -1
  575. package/dist/processor/services/processor.service.d.ts +0 -465
  576. package/dist/processor/services/processor.service.js +0 -5343
  577. package/dist/processor/services/processor.service.js.map +0 -1
  578. package/dist/processor/services/request.service.d.ts +0 -36
  579. package/dist/processor/services/request.service.js +0 -304
  580. package/dist/processor/services/request.service.js.map +0 -1
  581. package/dist/processor/types/request.types.d.ts +0 -14
  582. package/dist/processor/types/request.types.js +0 -3
  583. package/dist/processor/types/request.types.js.map +0 -1
  584. package/dist/processor/utils/processor.utils.d.ts +0 -104
  585. package/dist/processor/utils/processor.utils.js +0 -1066
  586. package/dist/processor/utils/processor.utils.js.map +0 -1
  587. package/dist/processor/utils/request.utils.d.ts +0 -20
  588. package/dist/processor/utils/request.utils.js +0 -113
  589. package/dist/processor/utils/request.utils.js.map +0 -1
  590. package/dist/processor/utils/storage.util.d.ts +0 -8
  591. package/dist/processor/utils/storage.util.js +0 -106
  592. package/dist/processor/utils/storage.util.js.map +0 -1
  593. package/dist/products/services/products.service.d.ts +0 -577
  594. package/dist/products/services/products.service.js +0 -5845
  595. package/dist/products/services/products.service.js.map +0 -1
  596. package/dist/products/utils/crypt.utils.d.ts +0 -1
  597. package/dist/products/utils/crypt.utils.js +0 -17
  598. package/dist/products/utils/crypt.utils.js.map +0 -1
  599. package/dist/products/utils/functions.utils.d.ts +0 -13
  600. package/dist/products/utils/functions.utils.js +0 -294
  601. package/dist/products/utils/functions.utils.js.map +0 -1
  602. package/dist/products/utils/objects.utils.d.ts +0 -13
  603. package/dist/products/utils/objects.utils.js +0 -89
  604. package/dist/products/utils/objects.utils.js.map +0 -1
  605. package/dist/products/utils/string.utils.d.ts +0 -12
  606. package/dist/products/utils/string.utils.js +0 -168
  607. package/dist/products/utils/string.utils.js.map +0 -1
  608. package/dist/products/validators/index.d.ts +0 -33
  609. package/dist/products/validators/index.js +0 -75
  610. package/dist/products/validators/index.js.map +0 -1
  611. package/dist/products/validators/joi-validators/create.html.validator.d.ts +0 -2
  612. package/dist/products/validators/joi-validators/create.html.validator.js +0 -55
  613. package/dist/products/validators/joi-validators/create.html.validator.js.map +0 -1
  614. package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +0 -3
  615. package/dist/products/validators/joi-validators/create.productAgent.validator.js +0 -266
  616. package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +0 -1
  617. package/dist/products/validators/joi-validators/create.productApp.validator.d.ts +0 -4
  618. package/dist/products/validators/joi-validators/create.productApp.validator.js +0 -61
  619. package/dist/products/validators/joi-validators/create.productApp.validator.js.map +0 -1
  620. package/dist/products/validators/joi-validators/create.productCache.validator.d.ts +0 -3
  621. package/dist/products/validators/joi-validators/create.productCache.validator.js +0 -46
  622. package/dist/products/validators/joi-validators/create.productCache.validator.js.map +0 -1
  623. package/dist/products/validators/joi-validators/create.productDatabase.validator.d.ts +0 -3
  624. package/dist/products/validators/joi-validators/create.productDatabase.validator.js +0 -77
  625. package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +0 -1
  626. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +0 -7
  627. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +0 -194
  628. package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +0 -1
  629. package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.d.ts +0 -4
  630. package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js +0 -63
  631. package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js.map +0 -1
  632. package/dist/products/validators/joi-validators/create.productEnv.validator.d.ts +0 -3
  633. package/dist/products/validators/joi-validators/create.productEnv.validator.js +0 -45
  634. package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +0 -1
  635. package/dist/products/validators/joi-validators/create.productFallback.validator.d.ts +0 -3
  636. package/dist/products/validators/joi-validators/create.productFallback.validator.js +0 -64
  637. package/dist/products/validators/joi-validators/create.productFallback.validator.js.map +0 -1
  638. package/dist/products/validators/joi-validators/create.productFeature.validator.d.ts +0 -14
  639. package/dist/products/validators/joi-validators/create.productFeature.validator.js +0 -140
  640. package/dist/products/validators/joi-validators/create.productFeature.validator.js.map +0 -1
  641. package/dist/products/validators/joi-validators/create.productFunction.validator.d.ts +0 -3
  642. package/dist/products/validators/joi-validators/create.productFunction.validator.js +0 -57
  643. package/dist/products/validators/joi-validators/create.productFunction.validator.js.map +0 -1
  644. package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +0 -3
  645. package/dist/products/validators/joi-validators/create.productGraph.validator.js +0 -89
  646. package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +0 -1
  647. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +0 -4
  648. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +0 -58
  649. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +0 -1
  650. package/dist/products/validators/joi-validators/create.productJob.validator.d.ts +0 -12
  651. package/dist/products/validators/joi-validators/create.productJob.validator.js +0 -60
  652. package/dist/products/validators/joi-validators/create.productJob.validator.js.map +0 -1
  653. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.d.ts +0 -3
  654. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +0 -52
  655. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +0 -1
  656. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.d.ts +0 -3
  657. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +0 -193
  658. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +0 -1
  659. package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +0 -3
  660. package/dist/products/validators/joi-validators/create.productModel.validator.js +0 -132
  661. package/dist/products/validators/joi-validators/create.productModel.validator.js.map +0 -1
  662. package/dist/products/validators/joi-validators/create.productNotification.validator.d.ts +0 -4
  663. package/dist/products/validators/joi-validators/create.productNotification.validator.js +0 -241
  664. package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +0 -1
  665. package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.d.ts +0 -3
  666. package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js +0 -57
  667. package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js.map +0 -1
  668. package/dist/products/validators/joi-validators/create.productNotifications.validator.d.ts +0 -0
  669. package/dist/products/validators/joi-validators/create.productNotifications.validator.js +0 -1
  670. package/dist/products/validators/joi-validators/create.productNotifications.validator.js.map +0 -1
  671. package/dist/products/validators/joi-validators/create.productQuota.validator.d.ts +0 -3
  672. package/dist/products/validators/joi-validators/create.productQuota.validator.js +0 -67
  673. package/dist/products/validators/joi-validators/create.productQuota.validator.js.map +0 -1
  674. package/dist/products/validators/joi-validators/create.productStorage.validator.d.ts +0 -3
  675. package/dist/products/validators/joi-validators/create.productStorage.validator.js +0 -158
  676. package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +0 -1
  677. package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +0 -3
  678. package/dist/products/validators/joi-validators/create.productVector.validator.js +0 -136
  679. package/dist/products/validators/joi-validators/create.productVector.validator.js.map +0 -1
  680. package/dist/products/validators/joi-validators/create.products.validator.d.ts +0 -3
  681. package/dist/products/validators/joi-validators/create.products.validator.js +0 -43
  682. package/dist/products/validators/joi-validators/create.products.validator.js.map +0 -1
  683. package/dist/products/validators/joi-validators/create.requestAction.validator.d.ts +0 -2
  684. package/dist/products/validators/joi-validators/create.requestAction.validator.js +0 -45
  685. package/dist/products/validators/joi-validators/create.requestAction.validator.js.map +0 -1
  686. package/dist/products/validators/joi-validators/create.userAuth.validator.d.ts +0 -3
  687. package/dist/products/validators/joi-validators/create.userAuth.validator.js +0 -48
  688. package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +0 -1
  689. package/dist/products/validators/joi-validators/register.productWebhooks.validator.d.ts +0 -3
  690. package/dist/products/validators/joi-validators/register.productWebhooks.validator.js +0 -48
  691. package/dist/products/validators/joi-validators/register.productWebhooks.validator.js.map +0 -1
  692. package/dist/products/validators/joi-validators/update.dataValue.validator.d.ts +0 -3
  693. package/dist/products/validators/joi-validators/update.dataValue.validator.js +0 -103
  694. package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +0 -1
  695. package/dist/products/validators/joi-validators/update.productApp.validator.d.ts +0 -3
  696. package/dist/products/validators/joi-validators/update.productApp.validator.js +0 -42
  697. package/dist/products/validators/joi-validators/update.productApp.validator.js.map +0 -1
  698. package/dist/products/validators/joi-validators/update.productCache.validator.d.ts +0 -3
  699. package/dist/products/validators/joi-validators/update.productCache.validator.js +0 -45
  700. package/dist/products/validators/joi-validators/update.productCache.validator.js.map +0 -1
  701. package/dist/products/validators/joi-validators/update.productDatabase.validator.d.ts +0 -3
  702. package/dist/products/validators/joi-validators/update.productDatabase.validator.js +0 -76
  703. package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +0 -1
  704. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +0 -3
  705. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +0 -79
  706. package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +0 -1
  707. package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.d.ts +0 -4
  708. package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js +0 -64
  709. package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js.map +0 -1
  710. package/dist/products/validators/joi-validators/update.productEnv.validator.d.ts +0 -3
  711. package/dist/products/validators/joi-validators/update.productEnv.validator.js +0 -46
  712. package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +0 -1
  713. package/dist/products/validators/joi-validators/update.productFallback.validator.d.ts +0 -3
  714. package/dist/products/validators/joi-validators/update.productFallback.validator.js +0 -60
  715. package/dist/products/validators/joi-validators/update.productFallback.validator.js.map +0 -1
  716. package/dist/products/validators/joi-validators/update.productFeature.validator.d.ts +0 -3
  717. package/dist/products/validators/joi-validators/update.productFeature.validator.js +0 -53
  718. package/dist/products/validators/joi-validators/update.productFeature.validator.js.map +0 -1
  719. package/dist/products/validators/joi-validators/update.productFunction.validator.d.ts +0 -3
  720. package/dist/products/validators/joi-validators/update.productFunction.validator.js +0 -41
  721. package/dist/products/validators/joi-validators/update.productFunction.validator.js.map +0 -1
  722. package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +0 -3
  723. package/dist/products/validators/joi-validators/update.productGraph.validator.js +0 -88
  724. package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +0 -1
  725. package/dist/products/validators/joi-validators/update.productJob.validator.d.ts +0 -3
  726. package/dist/products/validators/joi-validators/update.productJob.validator.js +0 -50
  727. package/dist/products/validators/joi-validators/update.productJob.validator.js.map +0 -1
  728. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.d.ts +0 -3
  729. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +0 -52
  730. package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +0 -1
  731. package/dist/products/validators/joi-validators/update.productNotification.validator.d.ts +0 -3
  732. package/dist/products/validators/joi-validators/update.productNotification.validator.js +0 -47
  733. package/dist/products/validators/joi-validators/update.productNotification.validator.js.map +0 -1
  734. package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.d.ts +0 -3
  735. package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js +0 -58
  736. package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js.map +0 -1
  737. package/dist/products/validators/joi-validators/update.productQuota.validator.d.ts +0 -3
  738. package/dist/products/validators/joi-validators/update.productQuota.validator.js +0 -64
  739. package/dist/products/validators/joi-validators/update.productQuota.validator.js.map +0 -1
  740. package/dist/products/validators/joi-validators/update.userAuth.validator.d.ts +0 -3
  741. package/dist/products/validators/joi-validators/update.userAuth.validator.js +0 -48
  742. package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +0 -1
  743. package/dist/resilience/fallback.service.d.ts +0 -141
  744. package/dist/resilience/fallback.service.js +0 -766
  745. package/dist/resilience/fallback.service.js.map +0 -1
  746. package/dist/resilience/healthcheck.service.d.ts +0 -163
  747. package/dist/resilience/healthcheck.service.js +0 -1012
  748. package/dist/resilience/healthcheck.service.js.map +0 -1
  749. package/dist/resilience/index.d.ts +0 -104
  750. package/dist/resilience/index.js +0 -140
  751. package/dist/resilience/index.js.map +0 -1
  752. package/dist/resilience/quota.service.d.ts +0 -83
  753. package/dist/resilience/quota.service.js +0 -518
  754. package/dist/resilience/quota.service.js.map +0 -1
  755. package/dist/resilience/resilience.service.d.ts +0 -98
  756. package/dist/resilience/resilience.service.js +0 -560
  757. package/dist/resilience/resilience.service.js.map +0 -1
  758. package/dist/resilience/types/index.d.ts +0 -513
  759. package/dist/resilience/types/index.js +0 -29
  760. package/dist/resilience/types/index.js.map +0 -1
  761. package/dist/secrets/index.d.ts +0 -10
  762. package/dist/secrets/index.js +0 -33
  763. package/dist/secrets/index.js.map +0 -1
  764. package/dist/secrets/secrets.resolver.d.ts +0 -52
  765. package/dist/secrets/secrets.resolver.js +0 -236
  766. package/dist/secrets/secrets.resolver.js.map +0 -1
  767. package/dist/secrets/secrets.service.d.ts +0 -93
  768. package/dist/secrets/secrets.service.js +0 -246
  769. package/dist/secrets/secrets.service.js.map +0 -1
  770. package/dist/secrets/secrets.types.d.ts +0 -188
  771. package/dist/secrets/secrets.types.js +0 -87
  772. package/dist/secrets/secrets.types.js.map +0 -1
  773. package/dist/sessions/index.d.ts +0 -50
  774. package/dist/sessions/index.js +0 -96
  775. package/dist/sessions/index.js.map +0 -1
  776. package/dist/sessions/sessions.helper.d.ts +0 -88
  777. package/dist/sessions/sessions.helper.js +0 -190
  778. package/dist/sessions/sessions.helper.js.map +0 -1
  779. package/dist/sessions/sessions.resolver.d.ts +0 -188
  780. package/dist/sessions/sessions.resolver.js +0 -603
  781. package/dist/sessions/sessions.resolver.js.map +0 -1
  782. package/dist/sessions/sessions.service.d.ts +0 -194
  783. package/dist/sessions/sessions.service.js +0 -988
  784. package/dist/sessions/sessions.service.js.map +0 -1
  785. package/dist/sessions/types/index.d.ts +0 -344
  786. package/dist/sessions/types/index.js +0 -6
  787. package/dist/sessions/types/index.js.map +0 -1
  788. package/dist/storage/index.d.ts +0 -66
  789. package/dist/storage/index.js +0 -99
  790. package/dist/storage/index.js.map +0 -1
  791. package/dist/storage/storage.service.d.ts +0 -177
  792. package/dist/storage/storage.service.js +0 -905
  793. package/dist/storage/storage.service.js.map +0 -1
  794. package/dist/storage/types/index.d.ts +0 -270
  795. package/dist/storage/types/index.js +0 -6
  796. package/dist/storage/types/index.js.map +0 -1
  797. package/dist/storage/utils/storage.util.d.ts +0 -62
  798. package/dist/storage/utils/storage.util.js +0 -593
  799. package/dist/storage/utils/storage.util.js.map +0 -1
  800. package/dist/types/actions.types.d.ts +0 -0
  801. package/dist/types/actions.types.js +0 -1
  802. package/dist/types/actions.types.js.map +0 -1
  803. package/dist/types/appBuilder.types.d.ts +0 -316
  804. package/dist/types/appBuilder.types.js +0 -3
  805. package/dist/types/appBuilder.types.js.map +0 -1
  806. package/dist/types/database.types.d.ts +0 -9
  807. package/dist/types/database.types.js +0 -3
  808. package/dist/types/database.types.js.map +0 -1
  809. package/dist/types/enums.d.ts +0 -231
  810. package/dist/types/enums.js +0 -261
  811. package/dist/types/enums.js.map +0 -1
  812. package/dist/types/index.d.ts +0 -12
  813. package/dist/types/index.js +0 -29
  814. package/dist/types/index.js.map +0 -1
  815. package/dist/types/index.types.d.ts +0 -30
  816. package/dist/types/index.types.js +0 -9
  817. package/dist/types/index.types.js.map +0 -1
  818. package/dist/types/inputs.types.d.ts +0 -114
  819. package/dist/types/inputs.types.js +0 -44
  820. package/dist/types/inputs.types.js.map +0 -1
  821. package/dist/types/logs.types.d.ts +0 -19
  822. package/dist/types/logs.types.js +0 -8
  823. package/dist/types/logs.types.js.map +0 -1
  824. package/dist/types/pricing.types.d.ts +0 -4
  825. package/dist/types/pricing.types.js +0 -3
  826. package/dist/types/pricing.types.js.map +0 -1
  827. package/dist/types/processor.types.d.ts +0 -602
  828. package/dist/types/processor.types.js +0 -19
  829. package/dist/types/processor.types.js.map +0 -1
  830. package/dist/types/productsBuilder.types.d.ts +0 -1566
  831. package/dist/types/productsBuilder.types.js +0 -303
  832. package/dist/types/productsBuilder.types.js.map +0 -1
  833. package/dist/types/request-tracker.interface.d.ts +0 -0
  834. package/dist/types/request-tracker.interface.js +0 -1
  835. package/dist/types/request-tracker.interface.js.map +0 -1
  836. package/dist/types/requests.types.d.ts +0 -8
  837. package/dist/types/requests.types.js +0 -3
  838. package/dist/types/requests.types.js.map +0 -1
  839. package/dist/types/workspaces.types.d.ts +0 -28
  840. package/dist/types/workspaces.types.js +0 -4
  841. package/dist/types/workspaces.types.js.map +0 -1
  842. package/dist/utils/constants.d.ts +0 -1
  843. package/dist/utils/constants.js +0 -5
  844. package/dist/utils/constants.js.map +0 -1
  845. package/dist/utils/index.d.ts +0 -2
  846. package/dist/utils/index.js +0 -109
  847. package/dist/utils/index.js.map +0 -1
  848. package/dist/vector/actions/action-manager.d.ts +0 -140
  849. package/dist/vector/actions/action-manager.js +0 -356
  850. package/dist/vector/actions/action-manager.js.map +0 -1
  851. package/dist/vector/adapters/base.adapter.d.ts +0 -169
  852. package/dist/vector/adapters/base.adapter.js +0 -218
  853. package/dist/vector/adapters/base.adapter.js.map +0 -1
  854. package/dist/vector/adapters/index.d.ts +0 -10
  855. package/dist/vector/adapters/index.js +0 -19
  856. package/dist/vector/adapters/index.js.map +0 -1
  857. package/dist/vector/adapters/memory.adapter.d.ts +0 -85
  858. package/dist/vector/adapters/memory.adapter.js +0 -505
  859. package/dist/vector/adapters/memory.adapter.js.map +0 -1
  860. package/dist/vector/adapters/pinecone.adapter.d.ts +0 -52
  861. package/dist/vector/adapters/pinecone.adapter.js +0 -433
  862. package/dist/vector/adapters/pinecone.adapter.js.map +0 -1
  863. package/dist/vector/adapters/qdrant.adapter.d.ts +0 -56
  864. package/dist/vector/adapters/qdrant.adapter.js +0 -442
  865. package/dist/vector/adapters/qdrant.adapter.js.map +0 -1
  866. package/dist/vector/adapters/weaviate.adapter.d.ts +0 -68
  867. package/dist/vector/adapters/weaviate.adapter.js +0 -661
  868. package/dist/vector/adapters/weaviate.adapter.js.map +0 -1
  869. package/dist/vector/index.d.ts +0 -36
  870. package/dist/vector/index.js +0 -70
  871. package/dist/vector/index.js.map +0 -1
  872. package/dist/vector/types/action.interface.d.ts +0 -195
  873. package/dist/vector/types/action.interface.js +0 -100
  874. package/dist/vector/types/action.interface.js.map +0 -1
  875. package/dist/vector/types/connection.interface.d.ts +0 -151
  876. package/dist/vector/types/connection.interface.js +0 -8
  877. package/dist/vector/types/connection.interface.js.map +0 -1
  878. package/dist/vector/types/embedding.interface.d.ts +0 -144
  879. package/dist/vector/types/embedding.interface.js +0 -8
  880. package/dist/vector/types/embedding.interface.js.map +0 -1
  881. package/dist/vector/types/enums.d.ts +0 -104
  882. package/dist/vector/types/enums.js +0 -113
  883. package/dist/vector/types/enums.js.map +0 -1
  884. package/dist/vector/types/index.d.ts +0 -11
  885. package/dist/vector/types/index.js +0 -23
  886. package/dist/vector/types/index.js.map +0 -1
  887. package/dist/vector/types/vector.interface.d.ts +0 -315
  888. package/dist/vector/types/vector.interface.js +0 -8
  889. package/dist/vector/types/vector.interface.js.map +0 -1
  890. package/dist/vector/utils/index.d.ts +0 -6
  891. package/dist/vector/utils/index.js +0 -11
  892. package/dist/vector/utils/index.js.map +0 -1
  893. package/dist/vector/utils/vector-error.d.ts +0 -69
  894. package/dist/vector/utils/vector-error.js +0 -116
  895. package/dist/vector/utils/vector-error.js.map +0 -1
  896. package/dist/vector/vector-database.service.d.ts +0 -484
  897. package/dist/vector/vector-database.service.js +0 -1002
  898. package/dist/vector/vector-database.service.js.map +0 -1
  899. package/dist/vector/vector.service.d.ts +0 -283
  900. package/dist/vector/vector.service.js +0 -544
  901. package/dist/vector/vector.service.js.map +0 -1
  902. package/dist/warehouse/executor/index.d.ts +0 -5
  903. package/dist/warehouse/executor/index.js +0 -12
  904. package/dist/warehouse/executor/index.js.map +0 -1
  905. package/dist/warehouse/executor/joins/index.d.ts +0 -5
  906. package/dist/warehouse/executor/joins/index.js +0 -11
  907. package/dist/warehouse/executor/joins/index.js.map +0 -1
  908. package/dist/warehouse/executor/joins/join-executor.d.ts +0 -101
  909. package/dist/warehouse/executor/joins/join-executor.js +0 -493
  910. package/dist/warehouse/executor/joins/join-executor.js.map +0 -1
  911. package/dist/warehouse/executor/joins/semantic-join.d.ts +0 -64
  912. package/dist/warehouse/executor/joins/semantic-join.js +0 -241
  913. package/dist/warehouse/executor/joins/semantic-join.js.map +0 -1
  914. package/dist/warehouse/executor/single-source-executor.d.ts +0 -155
  915. package/dist/warehouse/executor/single-source-executor.js +0 -573
  916. package/dist/warehouse/executor/single-source-executor.js.map +0 -1
  917. package/dist/warehouse/index.d.ts +0 -79
  918. package/dist/warehouse/index.js +0 -111
  919. package/dist/warehouse/index.js.map +0 -1
  920. package/dist/warehouse/parser/index.d.ts +0 -4
  921. package/dist/warehouse/parser/index.js +0 -10
  922. package/dist/warehouse/parser/index.js.map +0 -1
  923. package/dist/warehouse/parser/query-parser.d.ts +0 -181
  924. package/dist/warehouse/parser/query-parser.js +0 -415
  925. package/dist/warehouse/parser/query-parser.js.map +0 -1
  926. package/dist/warehouse/registry/data-source-registry.d.ts +0 -207
  927. package/dist/warehouse/registry/data-source-registry.js +0 -396
  928. package/dist/warehouse/registry/data-source-registry.js.map +0 -1
  929. package/dist/warehouse/registry/index.d.ts +0 -4
  930. package/dist/warehouse/registry/index.js +0 -9
  931. package/dist/warehouse/registry/index.js.map +0 -1
  932. package/dist/warehouse/transactions/index.d.ts +0 -4
  933. package/dist/warehouse/transactions/index.js +0 -9
  934. package/dist/warehouse/transactions/index.js.map +0 -1
  935. package/dist/warehouse/transactions/saga-orchestrator.d.ts +0 -92
  936. package/dist/warehouse/transactions/saga-orchestrator.js +0 -383
  937. package/dist/warehouse/transactions/saga-orchestrator.js.map +0 -1
  938. package/dist/warehouse/types/index.d.ts +0 -9
  939. package/dist/warehouse/types/index.js +0 -33
  940. package/dist/warehouse/types/index.js.map +0 -1
  941. package/dist/warehouse/types/join.interface.d.ts +0 -225
  942. package/dist/warehouse/types/join.interface.js +0 -87
  943. package/dist/warehouse/types/join.interface.js.map +0 -1
  944. package/dist/warehouse/types/query.interface.d.ts +0 -232
  945. package/dist/warehouse/types/query.interface.js +0 -9
  946. package/dist/warehouse/types/query.interface.js.map +0 -1
  947. package/dist/warehouse/types/transaction.interface.d.ts +0 -236
  948. package/dist/warehouse/types/transaction.interface.js +0 -74
  949. package/dist/warehouse/types/transaction.interface.js.map +0 -1
  950. package/dist/warehouse/types/where.interface.d.ts +0 -208
  951. package/dist/warehouse/types/where.interface.js +0 -89
  952. package/dist/warehouse/types/where.interface.js.map +0 -1
  953. package/dist/warehouse/warehouse.service.d.ts +0 -200
  954. package/dist/warehouse/warehouse.service.js +0 -470
  955. package/dist/warehouse/warehouse.service.js.map +0 -1
  956. package/dist/workflows/index.d.ts +0 -30
  957. package/dist/workflows/index.js +0 -64
  958. package/dist/workflows/index.js.map +0 -1
  959. package/dist/workflows/types/index.d.ts +0 -6
  960. package/dist/workflows/types/index.js +0 -23
  961. package/dist/workflows/types/index.js.map +0 -1
  962. package/dist/workflows/types/workflows.types.d.ts +0 -1095
  963. package/dist/workflows/types/workflows.types.js +0 -13
  964. package/dist/workflows/types/workflows.types.js.map +0 -1
  965. package/dist/workflows/workflow-builder.d.ts +0 -70
  966. package/dist/workflows/workflow-builder.js +0 -353
  967. package/dist/workflows/workflow-builder.js.map +0 -1
  968. package/dist/workflows/workflow-executor.d.ts +0 -289
  969. package/dist/workflows/workflow-executor.js +0 -2467
  970. package/dist/workflows/workflow-executor.js.map +0 -1
  971. package/dist/workflows/workflows.service.d.ts +0 -412
  972. package/dist/workflows/workflows.service.js +0 -2233
  973. package/dist/workflows/workflows.service.js.map +0 -1
@@ -1,1564 +0,0 @@
1
- "use strict";
2
- /**
3
- * DynamoDB Adapter
4
- *
5
- * Database adapter for AWS DynamoDB using the '@aws-sdk/client-dynamodb' and
6
- * '@aws-sdk/lib-dynamodb' libraries.
7
- * Implements all methods from BaseAdapter with DynamoDB-specific operations.
8
- *
9
- * Note: DynamoDB is a NoSQL key-value store with different concepts:
10
- * - Tables have a partition key (and optional sort key)
11
- * - No traditional transactions (uses TransactWriteItems/TransactGetItems)
12
- * - No savepoints
13
- * - Different query patterns than SQL databases
14
- */
15
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- var desc = Object.getOwnPropertyDescriptor(m, k);
18
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
- desc = { enumerable: true, get: function() { return m[k]; } };
20
- }
21
- Object.defineProperty(o, k2, desc);
22
- }) : (function(o, m, k, k2) {
23
- if (k2 === undefined) k2 = k;
24
- o[k2] = m[k];
25
- }));
26
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
- Object.defineProperty(o, "default", { enumerable: true, value: v });
28
- }) : function(o, v) {
29
- o["default"] = v;
30
- });
31
- var __importStar = (this && this.__importStar) || (function () {
32
- var ownKeys = function(o) {
33
- ownKeys = Object.getOwnPropertyNames || function (o) {
34
- var ar = [];
35
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
- return ar;
37
- };
38
- return ownKeys(o);
39
- };
40
- return function (mod) {
41
- if (mod && mod.__esModule) return mod;
42
- var result = {};
43
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
- __setModuleDefault(result, mod);
45
- return result;
46
- };
47
- })();
48
- Object.defineProperty(exports, "__esModule", { value: true });
49
- exports.DynamoDBAdapter = void 0;
50
- const base_adapter_1 = require("./base.adapter");
51
- const enums_1 = require("../types/enums");
52
- const database_error_1 = require("../utils/database-error");
53
- /**
54
- * DynamoDB database adapter
55
- * Provides DynamoDB-specific implementations for all database operations
56
- */
57
- class DynamoDBAdapter extends base_adapter_1.BaseAdapter {
58
- constructor() {
59
- super(...arguments);
60
- this.databaseType = enums_1.DatabaseType.DYNAMODB;
61
- this.dynamoClient = null;
62
- this.docClient = null;
63
- this.region = '';
64
- }
65
- // ==================== CONNECTION METHODS ====================
66
- async connect(options) {
67
- console.log(`[DynamoDBAdapter] connect() called`);
68
- console.log(`[DynamoDBAdapter] Options:`, JSON.stringify(Object.assign(Object.assign({}, options), { connectionUrl: '***REDACTED***' }), null, 2));
69
- try {
70
- console.log(`[DynamoDBAdapter] Importing AWS SDK libraries...`);
71
- // Dynamic import of AWS SDK
72
- const { DynamoDBClient } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
73
- const { DynamoDBDocumentClient } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
74
- console.log(`[DynamoDBAdapter] AWS SDK libraries imported successfully`);
75
- this.connectionUrl = options.connectionUrl;
76
- console.log(`[DynamoDBAdapter] Connection URL stored`);
77
- // Parse connection URL: dynamodb://region/access-key/secret-key
78
- // Or: dynamodb://region (uses default credentials)
79
- console.log(`[DynamoDBAdapter] Parsing connection URL...`);
80
- const url = new URL(options.connectionUrl);
81
- this.region = url.hostname || 'us-east-1';
82
- console.log(`[DynamoDBAdapter] Region: ${this.region}`);
83
- const clientConfig = {
84
- region: this.region,
85
- };
86
- // If credentials are provided in the URL
87
- if (url.pathname && url.pathname !== '/') {
88
- const parts = url.pathname.slice(1).split('/');
89
- if (parts.length >= 2) {
90
- clientConfig.credentials = {
91
- accessKeyId: parts[0],
92
- secretAccessKey: parts[1],
93
- };
94
- console.log(`[DynamoDBAdapter] Credentials found in URL`);
95
- }
96
- }
97
- else {
98
- console.log(`[DynamoDBAdapter] Using default credentials from environment`);
99
- }
100
- // Custom endpoint for local DynamoDB
101
- if (url.port) {
102
- clientConfig.endpoint = `http://${url.hostname}:${url.port}`;
103
- console.log(`[DynamoDBAdapter] Custom endpoint: ${clientConfig.endpoint}`);
104
- }
105
- console.log(`[DynamoDBAdapter] Creating DynamoDBClient...`);
106
- this.dynamoClient = new DynamoDBClient(clientConfig);
107
- console.log(`[DynamoDBAdapter] DynamoDBClient created`);
108
- console.log(`[DynamoDBAdapter] Creating DynamoDBDocumentClient...`);
109
- this.docClient = DynamoDBDocumentClient.from(this.dynamoClient, {
110
- marshallOptions: {
111
- removeUndefinedValues: true,
112
- convertEmptyValues: true,
113
- },
114
- });
115
- console.log(`[DynamoDBAdapter] DynamoDBDocumentClient created`);
116
- console.log(`[DynamoDBAdapter] Testing connection by listing tables...`);
117
- // Test connection by listing tables
118
- const { ListTablesCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
119
- await this.dynamoClient.send(new ListTablesCommand({ Limit: 1 }));
120
- console.log(`[DynamoDBAdapter] Connection test successful`);
121
- this.client = this.docClient;
122
- this.connected = true;
123
- console.log(`[DynamoDBAdapter] Connection marked as connected`);
124
- return {
125
- connected: true,
126
- version: `DynamoDB (${this.region})`,
127
- };
128
- }
129
- catch (error) {
130
- console.error(`[DynamoDBAdapter] Connection failed with error:`, error);
131
- console.error(`[DynamoDBAdapter] Error type:`, error.constructor.name);
132
- console.error(`[DynamoDBAdapter] Error message:`, error.message);
133
- console.error(`[DynamoDBAdapter] Error code:`, error.code);
134
- console.error(`[DynamoDBAdapter] Full error:`, JSON.stringify(error, null, 2));
135
- throw database_error_1.DatabaseError.connectionError(`Failed to connect to DynamoDB: ${error.message}`, error);
136
- }
137
- }
138
- async testConnection(options) {
139
- try {
140
- const { DynamoDBClient, ListTablesCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
141
- const url = new URL(options.connectionUrl);
142
- const region = url.hostname || 'us-east-1';
143
- const clientConfig = { region };
144
- if (url.pathname && url.pathname !== '/') {
145
- const parts = url.pathname.slice(1).split('/');
146
- if (parts.length >= 2) {
147
- clientConfig.credentials = {
148
- accessKeyId: parts[0],
149
- secretAccessKey: parts[1],
150
- };
151
- }
152
- }
153
- if (url.port) {
154
- clientConfig.endpoint = `http://${url.hostname}:${url.port}`;
155
- }
156
- const client = new DynamoDBClient(clientConfig);
157
- await client.send(new ListTablesCommand({ Limit: 1 }));
158
- client.destroy();
159
- return {
160
- connected: true,
161
- version: `DynamoDB (${region})`,
162
- };
163
- }
164
- catch (error) {
165
- return {
166
- connected: false,
167
- error: error.message,
168
- };
169
- }
170
- }
171
- async disconnect() {
172
- if (this.dynamoClient) {
173
- this.dynamoClient.destroy();
174
- this.dynamoClient = null;
175
- this.docClient = null;
176
- this.client = null;
177
- this.connected = false;
178
- }
179
- }
180
- // ==================== QUERY METHODS ====================
181
- async query(query) {
182
- var _a;
183
- this.ensureConnected();
184
- try {
185
- const { ScanCommand, QueryCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
186
- const tableName = query.options.table;
187
- const filter = query.options.where || {};
188
- // Determine if we can use Query (needs key conditions) or must use Scan
189
- const { keyCondition, filterCondition } = await this.extractKeyCondition(filter, tableName);
190
- let items = [];
191
- let count = 0;
192
- if (keyCondition) {
193
- // Use Query command for key-based lookups (much faster than Scan)
194
- const params = {
195
- TableName: tableName,
196
- KeyConditionExpression: keyCondition.expression,
197
- ExpressionAttributeNames: Object.assign({}, keyCondition.names),
198
- ExpressionAttributeValues: Object.assign({}, keyCondition.values),
199
- };
200
- // Add filter for non-key conditions
201
- if (filterCondition && filterCondition.expression) {
202
- params.FilterExpression = filterCondition.expression;
203
- Object.assign(params.ExpressionAttributeNames, filterCondition.names);
204
- Object.assign(params.ExpressionAttributeValues, filterCondition.values);
205
- }
206
- // Projection
207
- if (query.options.select) {
208
- params.ProjectionExpression = query.options.select
209
- .map((col, i) => {
210
- params.ExpressionAttributeNames[`#proj${i}`] = col;
211
- return `#proj${i}`;
212
- })
213
- .join(', ');
214
- }
215
- // Limit
216
- if (query.options.limit) {
217
- params.Limit = query.options.limit;
218
- }
219
- // Sort order (only works if there's a sort key)
220
- if (query.options.orderBy) {
221
- const orderByArray = Array.isArray(query.options.orderBy)
222
- ? query.options.orderBy
223
- : [query.options.orderBy];
224
- // DynamoDB only supports ASC/DESC on sort key
225
- if (((_a = orderByArray[0]) === null || _a === void 0 ? void 0 : _a.order) === 'DESC') {
226
- params.ScanIndexForward = false;
227
- }
228
- }
229
- const response = await this.docClient.send(new QueryCommand(params));
230
- items = response.Items || [];
231
- count = response.Count || 0;
232
- }
233
- else {
234
- // Use Scan command (less efficient but necessary for non-key queries)
235
- const params = {
236
- TableName: tableName,
237
- };
238
- // Build filter expression
239
- const filterExpression = this.buildFilterExpression(filter, {}, {});
240
- if (filterExpression.expression) {
241
- params.FilterExpression = filterExpression.expression;
242
- params.ExpressionAttributeNames = filterExpression.names;
243
- params.ExpressionAttributeValues = filterExpression.values;
244
- }
245
- // Projection
246
- if (query.options.select) {
247
- params.ExpressionAttributeNames = params.ExpressionAttributeNames || {};
248
- params.ProjectionExpression = query.options.select
249
- .map((col, i) => {
250
- params.ExpressionAttributeNames[`#proj${i}`] = col;
251
- return `#proj${i}`;
252
- })
253
- .join(', ');
254
- }
255
- // Limit
256
- if (query.options.limit) {
257
- params.Limit = query.options.limit;
258
- }
259
- const response = await this.docClient.send(new ScanCommand(params));
260
- items = response.Items || [];
261
- // Use Count (items after filtering) not ScannedCount (items before filtering)
262
- count = response.Count || items.length;
263
- }
264
- // Apply offset (DynamoDB doesn't have native offset)
265
- if (query.options.offset && query.options.offset > 0) {
266
- items = items.slice(query.options.offset);
267
- }
268
- return {
269
- data: items,
270
- count,
271
- };
272
- }
273
- catch (error) {
274
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
275
- }
276
- }
277
- async raw(options) {
278
- this.ensureConnected();
279
- try {
280
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
281
- // For DynamoDB, raw query is a PartiQL statement or direct command
282
- // Here we support simple scan with filter
283
- const params = Object.assign({ TableName: options.table || options.collection }, options.query);
284
- const response = await this.docClient.send(new ScanCommand(params));
285
- return {
286
- data: (response.Items || []),
287
- count: response.Count || 0,
288
- };
289
- }
290
- catch (error) {
291
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
292
- }
293
- }
294
- // ==================== WRITE METHODS ====================
295
- async insert(options) {
296
- var _a, _b;
297
- this.ensureConnected();
298
- try {
299
- const { PutCommand, BatchWriteCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
300
- const data = Array.isArray(options.data) ? options.data : [options.data];
301
- if (data.length === 0) {
302
- return { data: [], count: 0, insertedIds: [] };
303
- }
304
- const insertedIds = [];
305
- if (data.length === 1) {
306
- // Single item put
307
- await this.docClient.send(new PutCommand({
308
- TableName: options.table,
309
- Item: data[0],
310
- ConditionExpression: ((_a = options.onConflict) === null || _a === void 0 ? void 0 : _a.action) === 'ignore'
311
- ? 'attribute_not_exists(#pk)'
312
- : undefined,
313
- ExpressionAttributeNames: ((_b = options.onConflict) === null || _b === void 0 ? void 0 : _b.action) === 'ignore'
314
- ? { '#pk': options.onConflict.columns[0] }
315
- : undefined,
316
- }));
317
- insertedIds.push(data[0].id || data[0]._id);
318
- }
319
- else {
320
- // Batch write (max 25 items per batch)
321
- const batches = this.chunkArray(data, 25);
322
- for (const batch of batches) {
323
- await this.docClient.send(new BatchWriteCommand({
324
- RequestItems: {
325
- [options.table]: batch.map(item => ({
326
- PutRequest: { Item: item },
327
- })),
328
- },
329
- }));
330
- batch.forEach(item => insertedIds.push(item.id || item._id));
331
- }
332
- }
333
- return {
334
- data: options.returning ? data : [],
335
- count: data.length,
336
- insertedIds,
337
- };
338
- }
339
- catch (error) {
340
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
341
- }
342
- }
343
- async update(options) {
344
- this.ensureConnected();
345
- try {
346
- const { UpdateCommand, ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
347
- // First, find items to update
348
- const filter = options.where || {};
349
- const filterExpression = this.buildFilterExpression(filter, {}, {});
350
- const scanParams = {
351
- TableName: options.table,
352
- };
353
- if (filterExpression.expression) {
354
- scanParams.FilterExpression = filterExpression.expression;
355
- scanParams.ExpressionAttributeNames = filterExpression.names;
356
- scanParams.ExpressionAttributeValues = filterExpression.values;
357
- }
358
- const scanResponse = await this.docClient.send(new ScanCommand(scanParams));
359
- const itemsToUpdate = scanResponse.Items || [];
360
- // Build update expression
361
- const { expression, names, values } = this.buildUpdateExpression(options.data);
362
- let updatedCount = 0;
363
- const updatedItems = [];
364
- for (const item of itemsToUpdate) {
365
- // Get primary key from item
366
- const key = await this.getTableKey(options.table, item);
367
- const updateParams = {
368
- TableName: options.table,
369
- Key: key,
370
- UpdateExpression: expression,
371
- ExpressionAttributeNames: names,
372
- ExpressionAttributeValues: values,
373
- ReturnValues: options.returning ? 'ALL_NEW' : 'NONE',
374
- };
375
- const response = await this.docClient.send(new UpdateCommand(updateParams));
376
- updatedCount++;
377
- if (options.returning && response.Attributes) {
378
- updatedItems.push(response.Attributes);
379
- }
380
- }
381
- return {
382
- data: updatedItems,
383
- count: updatedCount,
384
- };
385
- }
386
- catch (error) {
387
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
388
- }
389
- }
390
- async delete(options) {
391
- this.ensureConnected();
392
- try {
393
- const { DeleteCommand, ScanCommand, BatchWriteCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
394
- // First, find items to delete
395
- const filter = options.where || {};
396
- const filterExpression = this.buildFilterExpression(filter, {}, {});
397
- const scanParams = {
398
- TableName: options.table,
399
- };
400
- if (filterExpression.expression) {
401
- scanParams.FilterExpression = filterExpression.expression;
402
- scanParams.ExpressionAttributeNames = filterExpression.names;
403
- scanParams.ExpressionAttributeValues = filterExpression.values;
404
- }
405
- const scanResponse = await this.docClient.send(new ScanCommand(scanParams));
406
- const itemsToDelete = scanResponse.Items || [];
407
- if (itemsToDelete.length === 0) {
408
- return { count: 0 };
409
- }
410
- // Delete items in batches of 25
411
- const batches = this.chunkArray(itemsToDelete, 25);
412
- for (const batch of batches) {
413
- const deleteRequests = await Promise.all(batch.map(async (item) => {
414
- const key = await this.getTableKey(options.table, item);
415
- return { DeleteRequest: { Key: key } };
416
- }));
417
- await this.docClient.send(new BatchWriteCommand({
418
- RequestItems: {
419
- [options.table]: deleteRequests,
420
- },
421
- }));
422
- }
423
- return {
424
- count: itemsToDelete.length,
425
- data: options.returning ? itemsToDelete : undefined,
426
- };
427
- }
428
- catch (error) {
429
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
430
- }
431
- }
432
- async upsert(options) {
433
- this.ensureConnected();
434
- try {
435
- const { PutCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
436
- // DynamoDB PutCommand is an upsert by default
437
- await this.docClient.send(new PutCommand({
438
- TableName: options.table,
439
- Item: options.data,
440
- ReturnValues: 'NONE',
441
- }));
442
- return {
443
- data: [options.data],
444
- count: 1,
445
- operation: 'inserted', // DynamoDB doesn't distinguish
446
- };
447
- }
448
- catch (error) {
449
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
450
- }
451
- }
452
- // ==================== AGGREGATION METHODS ====================
453
- async count(options) {
454
- this.ensureConnected();
455
- try {
456
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
457
- const params = {
458
- TableName: options.table,
459
- Select: 'COUNT',
460
- };
461
- if (options.where) {
462
- const filterExpression = this.buildFilterExpression(options.where, {}, {});
463
- if (filterExpression.expression) {
464
- params.FilterExpression = filterExpression.expression;
465
- params.ExpressionAttributeNames = filterExpression.names;
466
- params.ExpressionAttributeValues = filterExpression.values;
467
- }
468
- }
469
- const response = await this.docClient.send(new ScanCommand(params));
470
- return response.Count || 0;
471
- }
472
- catch (error) {
473
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
474
- }
475
- }
476
- async sum(options) {
477
- this.ensureConnected();
478
- try {
479
- // DynamoDB doesn't have native aggregations, need to scan and sum
480
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
481
- const params = {
482
- TableName: options.table,
483
- ProjectionExpression: `#col`,
484
- ExpressionAttributeNames: { '#col': options.column },
485
- };
486
- if (options.where) {
487
- const filterExpression = this.buildFilterExpression(options.where, params.ExpressionAttributeNames, {});
488
- if (filterExpression.expression) {
489
- params.FilterExpression = filterExpression.expression;
490
- Object.assign(params.ExpressionAttributeNames, filterExpression.names);
491
- params.ExpressionAttributeValues = filterExpression.values;
492
- }
493
- }
494
- const response = await this.docClient.send(new ScanCommand(params));
495
- const items = response.Items || [];
496
- return items.reduce((sum, item) => sum + (Number(item[options.column]) || 0), 0);
497
- }
498
- catch (error) {
499
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
500
- }
501
- }
502
- async avg(options) {
503
- this.ensureConnected();
504
- try {
505
- // DynamoDB doesn't have native aggregations, need to scan and calculate
506
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
507
- const params = {
508
- TableName: options.table,
509
- ProjectionExpression: `#col`,
510
- ExpressionAttributeNames: { '#col': options.column },
511
- };
512
- if (options.where) {
513
- const filterExpression = this.buildFilterExpression(options.where, params.ExpressionAttributeNames, {});
514
- if (filterExpression.expression) {
515
- params.FilterExpression = filterExpression.expression;
516
- Object.assign(params.ExpressionAttributeNames, filterExpression.names);
517
- params.ExpressionAttributeValues = filterExpression.values;
518
- }
519
- }
520
- const response = await this.docClient.send(new ScanCommand(params));
521
- const items = response.Items || [];
522
- if (items.length === 0)
523
- return 0;
524
- const sum = items.reduce((acc, item) => acc + (Number(item[options.column]) || 0), 0);
525
- return sum / items.length;
526
- }
527
- catch (error) {
528
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
529
- }
530
- }
531
- async min(options) {
532
- this.ensureConnected();
533
- try {
534
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
535
- const params = {
536
- TableName: options.table,
537
- ProjectionExpression: `#col`,
538
- ExpressionAttributeNames: { '#col': options.column },
539
- };
540
- if (options.where) {
541
- const filterExpression = this.buildFilterExpression(options.where, params.ExpressionAttributeNames, {});
542
- if (filterExpression.expression) {
543
- params.FilterExpression = filterExpression.expression;
544
- Object.assign(params.ExpressionAttributeNames, filterExpression.names);
545
- params.ExpressionAttributeValues = filterExpression.values;
546
- }
547
- }
548
- const response = await this.docClient.send(new ScanCommand(params));
549
- const items = response.Items || [];
550
- if (items.length === 0)
551
- return null;
552
- return items.reduce((min, item) => {
553
- const val = item[options.column];
554
- return min === null || val < min ? val : min;
555
- }, null);
556
- }
557
- catch (error) {
558
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
559
- }
560
- }
561
- async max(options) {
562
- this.ensureConnected();
563
- try {
564
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
565
- const params = {
566
- TableName: options.table,
567
- ProjectionExpression: `#col`,
568
- ExpressionAttributeNames: { '#col': options.column },
569
- };
570
- if (options.where) {
571
- const filterExpression = this.buildFilterExpression(options.where, params.ExpressionAttributeNames, {});
572
- if (filterExpression.expression) {
573
- params.FilterExpression = filterExpression.expression;
574
- Object.assign(params.ExpressionAttributeNames, filterExpression.names);
575
- params.ExpressionAttributeValues = filterExpression.values;
576
- }
577
- }
578
- const response = await this.docClient.send(new ScanCommand(params));
579
- const items = response.Items || [];
580
- if (items.length === 0)
581
- return null;
582
- return items.reduce((max, item) => {
583
- const val = item[options.column];
584
- return max === null || val > max ? val : max;
585
- }, null);
586
- }
587
- catch (error) {
588
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
589
- }
590
- }
591
- async aggregate(builtAggregation) {
592
- this.ensureConnected();
593
- try {
594
- // DynamoDB doesn't support native aggregations - scan and compute in memory
595
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
596
- const options = builtAggregation.options;
597
- const params = {
598
- TableName: options.table,
599
- };
600
- if (options.where) {
601
- const filterExpression = this.buildFilterExpression(options.where, {}, {});
602
- if (filterExpression.expression) {
603
- params.FilterExpression = filterExpression.expression;
604
- params.ExpressionAttributeNames = filterExpression.names;
605
- params.ExpressionAttributeValues = filterExpression.values;
606
- }
607
- }
608
- const response = await this.docClient.send(new ScanCommand(params));
609
- const items = response.Items || [];
610
- // Compute aggregations in memory
611
- const result = {};
612
- const operations = options.operations || {};
613
- for (const [alias, op] of Object.entries(operations)) {
614
- const operation = op;
615
- if (operation.$COUNT) {
616
- result[alias] = items.length;
617
- }
618
- else if (operation.$SUM) {
619
- result[alias] = items.reduce((sum, item) => sum + (Number(item[operation.$SUM]) || 0), 0);
620
- }
621
- else if (operation.$AVG) {
622
- const values = items.map((item) => Number(item[operation.$AVG]) || 0);
623
- result[alias] = values.length > 0 ? values.reduce((a, b) => a + b, 0) / values.length : 0;
624
- }
625
- else if (operation.$MIN) {
626
- const values = items.map((item) => item[operation.$MIN]).filter((v) => v != null);
627
- result[alias] = values.length > 0 ? Math.min(...values) : null;
628
- }
629
- else if (operation.$MAX) {
630
- const values = items.map((item) => item[operation.$MAX]).filter((v) => v != null);
631
- result[alias] = values.length > 0 ? Math.max(...values) : null;
632
- }
633
- }
634
- return result;
635
- }
636
- catch (error) {
637
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
638
- }
639
- }
640
- async groupBy(builtGroupBy) {
641
- this.ensureConnected();
642
- try {
643
- // DynamoDB doesn't support native GROUP BY - scan and group in memory
644
- const { ScanCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
645
- const options = builtGroupBy.options;
646
- const params = {
647
- TableName: options.table,
648
- };
649
- if (options.where) {
650
- const filterExpression = this.buildFilterExpression(options.where, {}, {});
651
- if (filterExpression.expression) {
652
- params.FilterExpression = filterExpression.expression;
653
- params.ExpressionAttributeNames = filterExpression.names;
654
- params.ExpressionAttributeValues = filterExpression.values;
655
- }
656
- }
657
- const response = await this.docClient.send(new ScanCommand(params));
658
- const items = response.Items || [];
659
- // Group items in memory
660
- const groups = new Map();
661
- const groupByColumns = options.groupBy || [];
662
- for (const item of items) {
663
- const groupKey = groupByColumns.map((col) => String(item[col])).join('|');
664
- if (!groups.has(groupKey)) {
665
- groups.set(groupKey, []);
666
- }
667
- groups.get(groupKey).push(item);
668
- }
669
- // Compute aggregations for each group
670
- const results = [];
671
- const operations = options.operations || {};
672
- for (const [groupKey, groupItems] of groups) {
673
- const group = {};
674
- const keyParts = groupKey.split('|');
675
- groupByColumns.forEach((col, i) => {
676
- group[col] = keyParts[i];
677
- });
678
- const aggregates = {};
679
- for (const [alias, op] of Object.entries(operations)) {
680
- const operation = op;
681
- if (operation.$COUNT) {
682
- aggregates[alias] = groupItems.length;
683
- }
684
- else if (operation.$SUM) {
685
- aggregates[alias] = groupItems.reduce((sum, item) => sum + (Number(item[operation.$SUM]) || 0), 0);
686
- }
687
- else if (operation.$AVG) {
688
- const values = groupItems.map(item => Number(item[operation.$AVG]) || 0);
689
- aggregates[alias] = values.length > 0 ? values.reduce((a, b) => a + b, 0) / values.length : 0;
690
- }
691
- else if (operation.$MIN) {
692
- const values = groupItems.map(item => item[operation.$MIN]).filter(v => v != null);
693
- aggregates[alias] = values.length > 0 ? Math.min(...values) : null;
694
- }
695
- else if (operation.$MAX) {
696
- const values = groupItems.map(item => item[operation.$MAX]).filter(v => v != null);
697
- aggregates[alias] = values.length > 0 ? Math.max(...values) : null;
698
- }
699
- }
700
- results.push({ group, aggregates: aggregates });
701
- }
702
- return results;
703
- }
704
- catch (error) {
705
- throw database_error_1.DatabaseError.fromDatabaseError(error, 'dynamodb');
706
- }
707
- }
708
- // ==================== TRANSACTION METHODS ====================
709
- async beginTransaction(isolationLevel, readOnly, timeout) {
710
- this.ensureConnected();
711
- // DynamoDB uses TransactWriteItems for transactions, not traditional BEGIN/COMMIT
712
- // We create a transaction context that collects operations
713
- const id = `dynamo_txn_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
714
- return {
715
- id,
716
- databaseType: 'dynamodb',
717
- isolationLevel: enums_1.IsolationLevel.SERIALIZABLE, // DynamoDB transactions are serializable
718
- readOnly: readOnly || false,
719
- timeout,
720
- startedAt: new Date(),
721
- client: {
722
- operations: [],
723
- conditionChecks: [],
724
- },
725
- savepoints: new Map(),
726
- status: 'active',
727
- };
728
- }
729
- async commitTransaction(context) {
730
- this.ensureConnected();
731
- try {
732
- const { TransactWriteCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/lib-dynamodb')));
733
- const operations = context.client.operations || [];
734
- if (operations.length === 0) {
735
- context.status = 'committed';
736
- return;
737
- }
738
- await this.docClient.send(new TransactWriteCommand({
739
- TransactItems: operations,
740
- }));
741
- context.status = 'committed';
742
- }
743
- catch (error) {
744
- context.status = 'error';
745
- throw database_error_1.DatabaseError.transactionError(`Failed to commit transaction: ${error.message}`, error);
746
- }
747
- }
748
- async rollbackTransaction(context) {
749
- // DynamoDB doesn't have explicit rollback - transaction is simply not committed
750
- context.client.operations = [];
751
- context.status = 'rolled_back';
752
- }
753
- async createSavepoint(context, name) {
754
- // DynamoDB does not support savepoints
755
- throw new database_error_1.DatabaseError('DynamoDB does not support savepoints.', enums_1.DatabaseErrorType.NOT_SUPPORTED);
756
- }
757
- async releaseSavepoint(context, savepoint) {
758
- throw new database_error_1.DatabaseError('DynamoDB does not support savepoints.', enums_1.DatabaseErrorType.NOT_SUPPORTED);
759
- }
760
- async rollbackToSavepoint(context, savepoint) {
761
- throw new database_error_1.DatabaseError('DynamoDB does not support savepoints.', enums_1.DatabaseErrorType.NOT_SUPPORTED);
762
- }
763
- supportsSavepoints() {
764
- return false;
765
- }
766
- // ==================== SCHEMA METHODS ====================
767
- async createTable(definition, options) {
768
- this.ensureConnected();
769
- try {
770
- const { CreateTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
771
- // Find primary key column
772
- const pkColumn = definition.columns.find(c => c.primaryKey);
773
- if (!pkColumn) {
774
- throw new Error('DynamoDB tables require a primary key column');
775
- }
776
- const keySchema = [
777
- { AttributeName: pkColumn.name, KeyType: 'HASH' },
778
- ];
779
- const attributeDefinitions = [
780
- { AttributeName: pkColumn.name, AttributeType: this.mapToDynamoType(pkColumn.type) },
781
- ];
782
- // Check for sort key (second column marked as primary key or sort key)
783
- const sortKeyColumn = definition.columns.find(c => c.name !== pkColumn.name && c.sortKey);
784
- if (sortKeyColumn) {
785
- keySchema.push({ AttributeName: sortKeyColumn.name, KeyType: 'RANGE' });
786
- attributeDefinitions.push({
787
- AttributeName: sortKeyColumn.name,
788
- AttributeType: this.mapToDynamoType(sortKeyColumn.type),
789
- });
790
- }
791
- const params = {
792
- TableName: definition.name,
793
- KeySchema: keySchema,
794
- AttributeDefinitions: attributeDefinitions,
795
- BillingMode: 'PAY_PER_REQUEST', // On-demand capacity
796
- };
797
- await this.dynamoClient.send(new CreateTableCommand(params));
798
- // Wait for table to be active
799
- await this.waitForTableActive(definition.name);
800
- // Create GSIs if defined
801
- if (definition.indexes) {
802
- for (const index of definition.indexes) {
803
- await this.createIndex(index);
804
- }
805
- }
806
- }
807
- catch (error) {
808
- if ((options === null || options === void 0 ? void 0 : options.ifNotExists) && error.name === 'ResourceInUseException') {
809
- return;
810
- }
811
- throw database_error_1.DatabaseError.schemaError(`Failed to create table: ${error.message}`, error);
812
- }
813
- }
814
- async alterTable(tableName, operations) {
815
- this.ensureConnected();
816
- // DynamoDB has very limited ALTER capabilities
817
- // Can only modify GSIs and some table settings
818
- try {
819
- for (const op of operations) {
820
- if (op.type === 'ADD' && op.constraint) {
821
- // Add GSI
822
- // This would require UpdateTableCommand with GlobalSecondaryIndexUpdates
823
- throw new database_error_1.DatabaseError('Adding indexes to DynamoDB requires table recreation or GSI updates. Use createIndex instead.', enums_1.DatabaseErrorType.NOT_SUPPORTED);
824
- }
825
- }
826
- }
827
- catch (error) {
828
- throw database_error_1.DatabaseError.schemaError(`Failed to alter table: ${error.message}`, error);
829
- }
830
- }
831
- async dropTable(tableName, ifExists, cascade) {
832
- this.ensureConnected();
833
- try {
834
- const { DeleteTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
835
- await this.dynamoClient.send(new DeleteTableCommand({
836
- TableName: tableName,
837
- }));
838
- }
839
- catch (error) {
840
- if (ifExists && error.name === 'ResourceNotFoundException') {
841
- return;
842
- }
843
- throw database_error_1.DatabaseError.schemaError(`Failed to drop table: ${error.message}`, error);
844
- }
845
- }
846
- async listTables() {
847
- this.ensureConnected();
848
- try {
849
- const { ListTablesCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
850
- const response = await this.dynamoClient.send(new ListTablesCommand({}));
851
- return response.TableNames || [];
852
- }
853
- catch (error) {
854
- throw database_error_1.DatabaseError.schemaError(`Failed to list tables: ${error.message}`, error);
855
- }
856
- }
857
- async listTablesWithInfo() {
858
- this.ensureConnected();
859
- try {
860
- const { ListTablesCommand, DescribeTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
861
- const response = await this.dynamoClient.send(new ListTablesCommand({}));
862
- const tableNames = response.TableNames || [];
863
- // Get table info including item count for each table
864
- const tablesWithInfo = await Promise.all(tableNames.map(async (tableName) => {
865
- var _a;
866
- try {
867
- const describeResponse = await this.dynamoClient.send(new DescribeTableCommand({ TableName: tableName }));
868
- return {
869
- name: tableName,
870
- estimatedRowCount: (_a = describeResponse.Table) === null || _a === void 0 ? void 0 : _a.ItemCount,
871
- };
872
- }
873
- catch (error) {
874
- // If we can't describe a table, return it without count
875
- return {
876
- name: tableName,
877
- estimatedRowCount: undefined,
878
- };
879
- }
880
- }));
881
- return tablesWithInfo;
882
- }
883
- catch (error) {
884
- throw database_error_1.DatabaseError.schemaError(`Failed to list tables with info: ${error.message}`, error);
885
- }
886
- }
887
- async tableExists(tableName) {
888
- this.ensureConnected();
889
- try {
890
- const { DescribeTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
891
- await this.dynamoClient.send(new DescribeTableCommand({
892
- TableName: tableName,
893
- }));
894
- return true;
895
- }
896
- catch (error) {
897
- if (error.name === 'ResourceNotFoundException') {
898
- return false;
899
- }
900
- throw database_error_1.DatabaseError.schemaError(`Failed to check table existence: ${error.message}`, error);
901
- }
902
- }
903
- async getTableSchema(tableName) {
904
- var _a;
905
- this.ensureConnected();
906
- try {
907
- const { DescribeTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
908
- const response = await this.dynamoClient.send(new DescribeTableCommand({
909
- TableName: tableName,
910
- }));
911
- const table = response.Table;
912
- // Map attribute definitions to columns
913
- const columns = (table.AttributeDefinitions || []).map((attr) => {
914
- var _a;
915
- return ({
916
- name: attr.AttributeName,
917
- type: this.mapFromDynamoType(attr.AttributeType),
918
- nullable: true,
919
- isPrimaryKey: ((_a = table.KeySchema) === null || _a === void 0 ? void 0 : _a.some((k) => k.AttributeName === attr.AttributeName && k.KeyType === 'HASH')) || false,
920
- isUnique: false,
921
- isAutoIncrement: false,
922
- });
923
- });
924
- // Get primary key
925
- const primaryKey = ((_a = table.KeySchema) === null || _a === void 0 ? void 0 : _a.filter((k) => k.KeyType === 'HASH').map((k) => k.AttributeName)) || [];
926
- // Get GSIs as indexes
927
- const indexes = (table.GlobalSecondaryIndexes || []).map((gsi) => {
928
- var _a;
929
- return ({
930
- name: gsi.IndexName,
931
- table: tableName,
932
- columns: ((_a = gsi.KeySchema) === null || _a === void 0 ? void 0 : _a.map((k) => k.AttributeName)) || [],
933
- unique: false,
934
- primaryKey: false,
935
- type: 'GSI',
936
- });
937
- });
938
- // Add LSIs
939
- (table.LocalSecondaryIndexes || []).forEach((lsi) => {
940
- var _a;
941
- indexes.push({
942
- name: lsi.IndexName,
943
- table: tableName,
944
- columns: ((_a = lsi.KeySchema) === null || _a === void 0 ? void 0 : _a.map((k) => k.AttributeName)) || [],
945
- unique: false,
946
- primaryKey: false,
947
- type: 'LSI',
948
- });
949
- });
950
- return {
951
- name: tableName,
952
- columns,
953
- indexes,
954
- constraints: [],
955
- primaryKey,
956
- estimatedRowCount: Number(table.ItemCount) || 0,
957
- };
958
- }
959
- catch (error) {
960
- throw database_error_1.DatabaseError.schemaError(`Failed to get table schema: ${error.message}`, error);
961
- }
962
- }
963
- async createIndex(index, ifNotExists, concurrent) {
964
- this.ensureConnected();
965
- // DynamoDB indexes (GSI) can only be created during table creation
966
- // or via UpdateTable (which is limited)
967
- throw new database_error_1.DatabaseError('DynamoDB Global Secondary Indexes must be created during table creation or via UpdateTable with specific parameters.', enums_1.DatabaseErrorType.NOT_SUPPORTED);
968
- }
969
- async dropIndex(tableName, indexName, ifExists, concurrent, cascade) {
970
- this.ensureConnected();
971
- try {
972
- const { UpdateTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
973
- await this.dynamoClient.send(new UpdateTableCommand({
974
- TableName: tableName,
975
- GlobalSecondaryIndexUpdates: [
976
- {
977
- Delete: {
978
- IndexName: indexName,
979
- },
980
- },
981
- ],
982
- }));
983
- }
984
- catch (error) {
985
- if (ifExists && error.name === 'ResourceNotFoundException') {
986
- return;
987
- }
988
- throw database_error_1.DatabaseError.schemaError(`Failed to drop index: ${error.message}`, error);
989
- }
990
- }
991
- async listIndexes(tableName, includeSystem) {
992
- this.ensureConnected();
993
- try {
994
- const schema = await this.getTableSchema(tableName);
995
- return schema.indexes;
996
- }
997
- catch (error) {
998
- throw database_error_1.DatabaseError.schemaError(`Failed to list indexes: ${error.message}`, error);
999
- }
1000
- }
1001
- async getIndexStatistics(tableName, indexName) {
1002
- this.ensureConnected();
1003
- try {
1004
- const { DescribeTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
1005
- const response = await this.dynamoClient.send(new DescribeTableCommand({
1006
- TableName: tableName,
1007
- }));
1008
- const results = [];
1009
- const table = response.Table;
1010
- // Add table itself as primary index
1011
- if (!indexName || indexName === 'PRIMARY') {
1012
- results.push({
1013
- indexName: 'PRIMARY',
1014
- tableName,
1015
- scans: 0,
1016
- tuplesRead: Number(table.ItemCount) || 0,
1017
- sizeBytes: Number(table.TableSizeBytes) || 0,
1018
- sizeFormatted: this.formatBytes(Number(table.TableSizeBytes) || 0),
1019
- });
1020
- }
1021
- // Add GSIs
1022
- for (const gsi of table.GlobalSecondaryIndexes || []) {
1023
- if (!indexName || indexName === gsi.IndexName) {
1024
- results.push({
1025
- indexName: gsi.IndexName,
1026
- tableName,
1027
- scans: 0,
1028
- tuplesRead: Number(gsi.ItemCount) || 0,
1029
- sizeBytes: Number(gsi.IndexSizeBytes) || 0,
1030
- sizeFormatted: this.formatBytes(Number(gsi.IndexSizeBytes) || 0),
1031
- });
1032
- }
1033
- }
1034
- return results;
1035
- }
1036
- catch (error) {
1037
- throw database_error_1.DatabaseError.schemaError(`Failed to get index statistics: ${error.message}`, error);
1038
- }
1039
- }
1040
- // ==================== UTILITY METHODS ====================
1041
- escapeIdentifier(identifier) {
1042
- return identifier;
1043
- }
1044
- escapeValue(value) {
1045
- return JSON.stringify(value);
1046
- }
1047
- /**
1048
- * Check if value is an update operator object
1049
- * Supports both lowercase (new) and uppercase (legacy) operators
1050
- */
1051
- isUpdateOperator(value) {
1052
- if (!value || typeof value !== 'object')
1053
- return false;
1054
- // Support both lowercase (Mongoose style) and uppercase (legacy) operators
1055
- const operators = [
1056
- '$inc', '$INC', '$dec', '$DEC', '$mul', '$MUL', '$min', '$MIN', '$max', '$MAX',
1057
- '$set', '$SET', '$unset', '$UNSET', '$push', '$PUSH', '$pull', '$PULL',
1058
- '$addToSet', '$ADDTOSET', '$currentDate', '$CURRENTDATE'
1059
- ];
1060
- return operators.some(op => op in value);
1061
- }
1062
- getParameterPlaceholder(index) {
1063
- return `:val${index}`;
1064
- }
1065
- getColumnTypeString(columnType, options) {
1066
- return this.mapToDynamoType(columnType);
1067
- }
1068
- getSupportedFeatures() {
1069
- return [
1070
- base_adapter_1.DatabaseFeature.TRANSACTIONS,
1071
- base_adapter_1.DatabaseFeature.TTL,
1072
- base_adapter_1.DatabaseFeature.GLOBAL_SECONDARY_INDEXES,
1073
- base_adapter_1.DatabaseFeature.LOCAL_SECONDARY_INDEXES,
1074
- base_adapter_1.DatabaseFeature.BATCH_OPERATIONS,
1075
- base_adapter_1.DatabaseFeature.ATOMIC_COUNTERS,
1076
- base_adapter_1.DatabaseFeature.CHANGE_STREAMS,
1077
- ];
1078
- }
1079
- parseError(error) {
1080
- const name = error.name || error.code;
1081
- let type = enums_1.DatabaseErrorType.UNKNOWN_ERROR;
1082
- switch (name) {
1083
- case 'ConditionalCheckFailedException':
1084
- type = enums_1.DatabaseErrorType.UNIQUE_VIOLATION;
1085
- break;
1086
- case 'ResourceNotFoundException':
1087
- type = enums_1.DatabaseErrorType.NOT_FOUND;
1088
- break;
1089
- case 'ResourceInUseException':
1090
- type = enums_1.DatabaseErrorType.SCHEMA_ERROR;
1091
- break;
1092
- case 'ValidationException':
1093
- type = enums_1.DatabaseErrorType.VALIDATION_ERROR;
1094
- break;
1095
- case 'ProvisionedThroughputExceededException':
1096
- case 'ThrottlingException':
1097
- type = enums_1.DatabaseErrorType.QUERY_ERROR;
1098
- break;
1099
- case 'AccessDeniedException':
1100
- type = enums_1.DatabaseErrorType.AUTHENTICATION_ERROR;
1101
- break;
1102
- }
1103
- return {
1104
- type,
1105
- message: error.message || 'Unknown database error',
1106
- code: name,
1107
- };
1108
- }
1109
- // ==================== PRIVATE HELPER METHODS ====================
1110
- ensureConnected() {
1111
- if (!this.connected || !this.docClient) {
1112
- throw new database_error_1.DatabaseError('Not connected to DynamoDB', enums_1.DatabaseErrorType.CONNECTION_ERROR);
1113
- }
1114
- }
1115
- buildFilterExpression(where, existingNames, existingValues) {
1116
- const conditions = [];
1117
- const names = Object.assign({}, existingNames);
1118
- const values = Object.assign({}, existingValues);
1119
- let valueIndex = Object.keys(existingValues).length;
1120
- for (const [key, value] of Object.entries(where)) {
1121
- // Normalize key to lowercase for logical operators (support both cases for backwards compatibility)
1122
- const normalizedKey = key.toLowerCase();
1123
- if (normalizedKey === '$and') {
1124
- const conditions_list = Array.isArray(value) ? value : Object.entries(value).map(([k, v]) => ({ [k]: v }));
1125
- const andConditions = [];
1126
- for (const cond of conditions_list) {
1127
- const result = this.buildFilterExpression(cond, names, values);
1128
- andConditions.push(result.expression);
1129
- Object.assign(names, result.names);
1130
- Object.assign(values, result.values);
1131
- }
1132
- conditions.push(`(${andConditions.join(' AND ')})`);
1133
- }
1134
- else if (normalizedKey === '$or') {
1135
- const conditions_list = Array.isArray(value) ? value : Object.entries(value).map(([k, v]) => ({ [k]: v }));
1136
- const orConditions = [];
1137
- for (const cond of conditions_list) {
1138
- const result = this.buildFilterExpression(cond, names, values);
1139
- orConditions.push(result.expression);
1140
- Object.assign(names, result.names);
1141
- Object.assign(values, result.values);
1142
- }
1143
- conditions.push(`(${orConditions.join(' OR ')})`);
1144
- }
1145
- else if (normalizedKey === '$not') {
1146
- const result = this.buildFilterExpression(value, names, values);
1147
- conditions.push(`NOT (${result.expression})`);
1148
- Object.assign(names, result.names);
1149
- Object.assign(values, result.values);
1150
- }
1151
- else if (normalizedKey === '$nor') {
1152
- const conditions_list = Array.isArray(value) ? value : [value];
1153
- const norConditions = [];
1154
- for (const cond of conditions_list) {
1155
- const result = this.buildFilterExpression(cond, names, values);
1156
- norConditions.push(result.expression);
1157
- Object.assign(names, result.names);
1158
- Object.assign(values, result.values);
1159
- }
1160
- conditions.push(`NOT (${norConditions.join(' OR ')})`);
1161
- }
1162
- else if (value !== null && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {
1163
- const nameKey = `#${key.replace(/[^a-zA-Z0-9]/g, '')}`;
1164
- names[nameKey] = key;
1165
- for (const [op, opValue] of Object.entries(value)) {
1166
- const valueKey = `:val${valueIndex++}`;
1167
- values[valueKey] = opValue;
1168
- // Normalize operator to lowercase (support both cases for backwards compatibility)
1169
- const normalizedOp = op.toLowerCase();
1170
- switch (normalizedOp) {
1171
- case '$eq':
1172
- conditions.push(`${nameKey} = ${valueKey}`);
1173
- break;
1174
- case '$ne':
1175
- conditions.push(`${nameKey} <> ${valueKey}`);
1176
- break;
1177
- case '$gt':
1178
- conditions.push(`${nameKey} > ${valueKey}`);
1179
- break;
1180
- case '$gte':
1181
- conditions.push(`${nameKey} >= ${valueKey}`);
1182
- break;
1183
- case '$lt':
1184
- conditions.push(`${nameKey} < ${valueKey}`);
1185
- break;
1186
- case '$lte':
1187
- conditions.push(`${nameKey} <= ${valueKey}`);
1188
- break;
1189
- case '$in':
1190
- // DynamoDB requires separate placeholders for each value in IN clause
1191
- if (Array.isArray(opValue)) {
1192
- const inPlaceholders = [];
1193
- for (const item of opValue) {
1194
- const itemKey = `:val${valueIndex++}`;
1195
- values[itemKey] = item;
1196
- inPlaceholders.push(itemKey);
1197
- }
1198
- // Remove the original valueKey since we're using individual placeholders
1199
- delete values[valueKey];
1200
- conditions.push(`${nameKey} IN (${inPlaceholders.join(', ')})`);
1201
- }
1202
- else {
1203
- // Single value - treat as equality
1204
- conditions.push(`${nameKey} = ${valueKey}`);
1205
- }
1206
- break;
1207
- case '$between':
1208
- const [min, max] = opValue;
1209
- const minKey = `:val${valueIndex++}`;
1210
- const maxKey = `:val${valueIndex++}`;
1211
- values[minKey] = min;
1212
- values[maxKey] = max;
1213
- conditions.push(`${nameKey} BETWEEN ${minKey} AND ${maxKey}`);
1214
- break;
1215
- case '$like':
1216
- conditions.push(`contains(${nameKey}, ${valueKey})`);
1217
- break;
1218
- case '$isnull':
1219
- case '$is_null':
1220
- if (opValue) {
1221
- conditions.push(`attribute_not_exists(${nameKey})`);
1222
- }
1223
- else {
1224
- conditions.push(`attribute_exists(${nameKey})`);
1225
- }
1226
- delete values[valueKey];
1227
- break;
1228
- case '$isnotnull':
1229
- case '$is_not_null':
1230
- if (opValue) {
1231
- conditions.push(`attribute_exists(${nameKey})`);
1232
- }
1233
- else {
1234
- conditions.push(`attribute_not_exists(${nameKey})`);
1235
- }
1236
- delete values[valueKey];
1237
- break;
1238
- case '$exists':
1239
- if (opValue) {
1240
- conditions.push(`attribute_exists(${nameKey})`);
1241
- }
1242
- else {
1243
- conditions.push(`attribute_not_exists(${nameKey})`);
1244
- }
1245
- delete values[valueKey];
1246
- break;
1247
- case '$contains':
1248
- conditions.push(`contains(${nameKey}, ${valueKey})`);
1249
- break;
1250
- case '$begins_with':
1251
- conditions.push(`begins_with(${nameKey}, ${valueKey})`);
1252
- break;
1253
- }
1254
- }
1255
- }
1256
- else {
1257
- const nameKey = `#${key.replace(/[^a-zA-Z0-9]/g, '')}`;
1258
- const valueKey = `:val${valueIndex++}`;
1259
- names[nameKey] = key;
1260
- values[valueKey] = value;
1261
- conditions.push(`${nameKey} = ${valueKey}`);
1262
- }
1263
- }
1264
- return {
1265
- expression: conditions.join(' AND '),
1266
- names,
1267
- values,
1268
- };
1269
- }
1270
- buildUpdateExpression(data) {
1271
- const setClauses = [];
1272
- const addClauses = [];
1273
- const names = {};
1274
- const values = {};
1275
- let valueIndex = 0;
1276
- for (const [key, value] of Object.entries(data)) {
1277
- const nameKey = `#${key.replace(/[^a-zA-Z0-9]/g, '')}`;
1278
- names[nameKey] = key;
1279
- if (value && typeof value === 'object' && this.isUpdateOperator(value)) {
1280
- const valueKey = `:val${valueIndex++}`;
1281
- if ('$INC' in value) {
1282
- values[valueKey] = value.$INC;
1283
- addClauses.push(`${nameKey} ${valueKey}`);
1284
- }
1285
- else if ('$DEC' in value) {
1286
- values[valueKey] = -value.$DEC;
1287
- addClauses.push(`${nameKey} ${valueKey}`);
1288
- }
1289
- else if ('$MUL' in value) {
1290
- // DynamoDB doesn't have native multiply - use SET with expression
1291
- const mulValueKey = `:mul${valueIndex++}`;
1292
- values[mulValueKey] = value.$MUL;
1293
- setClauses.push(`${nameKey} = ${nameKey} * ${mulValueKey}`);
1294
- }
1295
- else if ('$MIN' in value) {
1296
- // DynamoDB doesn't have native min - use if_not_exists or conditional
1297
- // For simplicity, just set the value (user should use conditional writes for atomic min)
1298
- values[valueKey] = value.$MIN;
1299
- setClauses.push(`${nameKey} = if_not_exists(${nameKey}, ${valueKey})`);
1300
- }
1301
- else if ('$MAX' in value) {
1302
- // DynamoDB doesn't have native max - similar to min
1303
- values[valueKey] = value.$MAX;
1304
- setClauses.push(`${nameKey} = if_not_exists(${nameKey}, ${valueKey})`);
1305
- }
1306
- else if ('$SET' in value) {
1307
- values[valueKey] = value.$SET;
1308
- setClauses.push(`${nameKey} = ${valueKey}`);
1309
- }
1310
- else if ('$UNSET' in value && value.$UNSET) {
1311
- // Use REMOVE clause for unsetting
1312
- // Note: REMOVE is handled separately
1313
- setClauses.push(`REMOVE ${nameKey}`);
1314
- }
1315
- else if ('$PUSH' in value) {
1316
- // DynamoDB list_append for arrays
1317
- values[valueKey] = [value.$PUSH];
1318
- setClauses.push(`${nameKey} = list_append(if_not_exists(${nameKey}, :emptyList), ${valueKey})`);
1319
- values[':emptyList'] = [];
1320
- }
1321
- else if ('$ADDTOSET' in value) {
1322
- // DynamoDB ADD for sets
1323
- values[valueKey] = new Set([value.$ADDTOSET]);
1324
- addClauses.push(`${nameKey} ${valueKey}`);
1325
- }
1326
- }
1327
- else {
1328
- const valueKey = `:val${valueIndex++}`;
1329
- values[valueKey] = value;
1330
- setClauses.push(`${nameKey} = ${valueKey}`);
1331
- }
1332
- }
1333
- let expression = '';
1334
- if (setClauses.length > 0) {
1335
- expression += `SET ${setClauses.join(', ')}`;
1336
- }
1337
- if (addClauses.length > 0) {
1338
- if (expression)
1339
- expression += ' ';
1340
- expression += `ADD ${addClauses.join(', ')}`;
1341
- }
1342
- return { expression, names, values };
1343
- }
1344
- /**
1345
- * Extract key condition from where clause if partition key is present.
1346
- * This enables using Query instead of Scan for better performance.
1347
- */
1348
- async extractKeyCondition(where, tableName) {
1349
- var _a, _b, _c;
1350
- if (!where || Object.keys(where).length === 0) {
1351
- return { keyCondition: null, filterCondition: null };
1352
- }
1353
- try {
1354
- const { DescribeTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
1355
- const response = await this.dynamoClient.send(new DescribeTableCommand({
1356
- TableName: tableName,
1357
- }));
1358
- const keySchema = ((_a = response.Table) === null || _a === void 0 ? void 0 : _a.KeySchema) || [];
1359
- if (keySchema.length === 0) {
1360
- return { keyCondition: null, filterCondition: null };
1361
- }
1362
- // Get partition key and sort key names
1363
- const partitionKeyName = (_b = keySchema.find((k) => k.KeyType === 'HASH')) === null || _b === void 0 ? void 0 : _b.AttributeName;
1364
- const sortKeyName = (_c = keySchema.find((k) => k.KeyType === 'RANGE')) === null || _c === void 0 ? void 0 : _c.AttributeName;
1365
- if (!partitionKeyName) {
1366
- return { keyCondition: null, filterCondition: null };
1367
- }
1368
- // Check if partition key is in the where clause
1369
- const partitionKeyValue = this.getWhereValue(where, partitionKeyName);
1370
- if (partitionKeyValue === undefined) {
1371
- // No partition key - must use Scan
1372
- return { keyCondition: null, filterCondition: null };
1373
- }
1374
- // Build key condition expression
1375
- const keyNames = {};
1376
- const keyValues = {};
1377
- const keyConditions = [];
1378
- // Add partition key condition (must be equality)
1379
- const pkNameKey = `#pk`;
1380
- const pkValueKey = `:pkval`;
1381
- keyNames[pkNameKey] = partitionKeyName;
1382
- keyValues[pkValueKey] = partitionKeyValue;
1383
- keyConditions.push(`${pkNameKey} = ${pkValueKey}`);
1384
- // Check for sort key condition (can be equality or range)
1385
- if (sortKeyName) {
1386
- const sortKeyOp = this.getWhereOperator(where, sortKeyName);
1387
- if (sortKeyOp) {
1388
- const skNameKey = `#sk`;
1389
- keyNames[skNameKey] = sortKeyName;
1390
- if (sortKeyOp.op === '$EQ' || sortKeyOp.op === 'equality') {
1391
- const skValueKey = `:skval`;
1392
- keyValues[skValueKey] = sortKeyOp.value;
1393
- keyConditions.push(`${skNameKey} = ${skValueKey}`);
1394
- }
1395
- else if (sortKeyOp.op === '$GT') {
1396
- const skValueKey = `:skval`;
1397
- keyValues[skValueKey] = sortKeyOp.value;
1398
- keyConditions.push(`${skNameKey} > ${skValueKey}`);
1399
- }
1400
- else if (sortKeyOp.op === '$GTE') {
1401
- const skValueKey = `:skval`;
1402
- keyValues[skValueKey] = sortKeyOp.value;
1403
- keyConditions.push(`${skNameKey} >= ${skValueKey}`);
1404
- }
1405
- else if (sortKeyOp.op === '$LT') {
1406
- const skValueKey = `:skval`;
1407
- keyValues[skValueKey] = sortKeyOp.value;
1408
- keyConditions.push(`${skNameKey} < ${skValueKey}`);
1409
- }
1410
- else if (sortKeyOp.op === '$LTE') {
1411
- const skValueKey = `:skval`;
1412
- keyValues[skValueKey] = sortKeyOp.value;
1413
- keyConditions.push(`${skNameKey} <= ${skValueKey}`);
1414
- }
1415
- else if (sortKeyOp.op === '$BETWEEN') {
1416
- const [min, max] = sortKeyOp.value;
1417
- keyValues[`:skmin`] = min;
1418
- keyValues[`:skmax`] = max;
1419
- keyConditions.push(`${skNameKey} BETWEEN :skmin AND :skmax`);
1420
- }
1421
- else if (sortKeyOp.op === '$BEGINS_WITH') {
1422
- const skValueKey = `:skval`;
1423
- keyValues[skValueKey] = sortKeyOp.value;
1424
- keyConditions.push(`begins_with(${skNameKey}, ${skValueKey})`);
1425
- }
1426
- }
1427
- }
1428
- // Build filter condition for remaining where clauses
1429
- const filterWhere = Object.assign({}, where);
1430
- delete filterWhere[partitionKeyName];
1431
- if (sortKeyName) {
1432
- delete filterWhere[sortKeyName];
1433
- }
1434
- let filterCondition = null;
1435
- if (Object.keys(filterWhere).length > 0) {
1436
- filterCondition = this.buildFilterExpression(filterWhere, {}, {});
1437
- }
1438
- return {
1439
- keyCondition: {
1440
- expression: keyConditions.join(' AND '),
1441
- names: keyNames,
1442
- values: keyValues,
1443
- },
1444
- filterCondition,
1445
- };
1446
- }
1447
- catch (error) {
1448
- // If we can't get table metadata, fall back to Scan
1449
- return { keyCondition: null, filterCondition: null };
1450
- }
1451
- }
1452
- /**
1453
- * Get simple value from where clause for a specific field
1454
- */
1455
- getWhereValue(where, fieldName) {
1456
- const value = where[fieldName];
1457
- if (value === undefined) {
1458
- return undefined;
1459
- }
1460
- // Simple equality check
1461
- if (typeof value !== 'object' || value === null) {
1462
- return value;
1463
- }
1464
- // Check for $EQ operator
1465
- if (value.$EQ !== undefined) {
1466
- return value.$EQ;
1467
- }
1468
- return undefined;
1469
- }
1470
- /**
1471
- * Get operator and value from where clause for a specific field
1472
- */
1473
- getWhereOperator(where, fieldName) {
1474
- const value = where[fieldName];
1475
- if (value === undefined) {
1476
- return null;
1477
- }
1478
- // Simple equality
1479
- if (typeof value !== 'object' || value === null) {
1480
- return { op: 'equality', value };
1481
- }
1482
- // Check for operators
1483
- for (const op of ['$EQ', '$GT', '$GTE', '$LT', '$LTE', '$BETWEEN', '$BEGINS_WITH']) {
1484
- if (value[op] !== undefined) {
1485
- return { op, value: value[op] };
1486
- }
1487
- }
1488
- return null;
1489
- }
1490
- async getTableKey(tableName, item) {
1491
- var _a;
1492
- const { DescribeTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
1493
- const response = await this.dynamoClient.send(new DescribeTableCommand({
1494
- TableName: tableName,
1495
- }));
1496
- const key = {};
1497
- const keySchema = ((_a = response.Table) === null || _a === void 0 ? void 0 : _a.KeySchema) || [];
1498
- for (const keyDef of keySchema) {
1499
- key[keyDef.AttributeName] = item[keyDef.AttributeName];
1500
- }
1501
- return key;
1502
- }
1503
- async waitForTableActive(tableName, maxWait = 60000) {
1504
- var _a;
1505
- const { DescribeTableCommand } = await Promise.resolve().then(() => __importStar(require('@aws-sdk/client-dynamodb')));
1506
- const startTime = Date.now();
1507
- while (Date.now() - startTime < maxWait) {
1508
- const response = await this.dynamoClient.send(new DescribeTableCommand({
1509
- TableName: tableName,
1510
- }));
1511
- if (((_a = response.Table) === null || _a === void 0 ? void 0 : _a.TableStatus) === 'ACTIVE') {
1512
- return;
1513
- }
1514
- await new Promise(resolve => setTimeout(resolve, 1000));
1515
- }
1516
- throw new Error(`Table ${tableName} did not become active within ${maxWait}ms`);
1517
- }
1518
- mapToDynamoType(columnType) {
1519
- const typeMap = {
1520
- [enums_1.ColumnType.INTEGER]: 'N',
1521
- [enums_1.ColumnType.BIGINT]: 'N',
1522
- [enums_1.ColumnType.FLOAT]: 'N',
1523
- [enums_1.ColumnType.DOUBLE]: 'N',
1524
- [enums_1.ColumnType.DECIMAL]: 'N',
1525
- [enums_1.ColumnType.STRING]: 'S',
1526
- [enums_1.ColumnType.TEXT]: 'S',
1527
- [enums_1.ColumnType.BOOLEAN]: 'BOOL',
1528
- [enums_1.ColumnType.BINARY]: 'B',
1529
- [enums_1.ColumnType.UUID]: 'S',
1530
- };
1531
- return typeMap[columnType] || 'S';
1532
- }
1533
- mapFromDynamoType(dynamoType) {
1534
- const typeMap = {
1535
- 'N': 'number',
1536
- 'S': 'string',
1537
- 'B': 'binary',
1538
- 'BOOL': 'boolean',
1539
- 'L': 'list',
1540
- 'M': 'map',
1541
- 'SS': 'stringSet',
1542
- 'NS': 'numberSet',
1543
- 'BS': 'binarySet',
1544
- };
1545
- return typeMap[dynamoType] || 'unknown';
1546
- }
1547
- chunkArray(array, size) {
1548
- const chunks = [];
1549
- for (let i = 0; i < array.length; i += size) {
1550
- chunks.push(array.slice(i, i + size));
1551
- }
1552
- return chunks;
1553
- }
1554
- formatBytes(bytes) {
1555
- if (bytes === 0)
1556
- return '0 B';
1557
- const k = 1024;
1558
- const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
1559
- const i = Math.floor(Math.log(bytes) / Math.log(k));
1560
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
1561
- }
1562
- }
1563
- exports.DynamoDBAdapter = DynamoDBAdapter;
1564
- //# sourceMappingURL=dynamodb.adapter.js.map