@ductape/sdk 0.0.4-v9 → 0.0.4-v90

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 (998) hide show
  1. package/dist/agents/agent-context.d.ts +98 -0
  2. package/dist/agents/agent-context.js +588 -0
  3. package/dist/agents/agent-context.js.map +1 -0
  4. package/dist/agents/agent-executor.d.ts +180 -0
  5. package/dist/agents/agent-executor.js +715 -0
  6. package/dist/agents/agent-executor.js.map +1 -0
  7. package/dist/agents/agents.service.d.ts +310 -0
  8. package/dist/agents/agents.service.js +1249 -0
  9. package/dist/agents/agents.service.js.map +1 -0
  10. package/dist/agents/index.d.ts +55 -0
  11. package/dist/agents/index.js +110 -0
  12. package/dist/agents/index.js.map +1 -0
  13. package/dist/agents/memory-manager.d.ts +182 -0
  14. package/dist/agents/memory-manager.js +383 -0
  15. package/dist/agents/memory-manager.js.map +1 -0
  16. package/dist/agents/tool-registry.d.ts +141 -0
  17. package/dist/agents/tool-registry.js +355 -0
  18. package/dist/agents/tool-registry.js.map +1 -0
  19. package/dist/agents/types/agents.types.d.ts +1227 -0
  20. package/dist/agents/types/agents.types.js +12 -0
  21. package/dist/agents/types/agents.types.js.map +1 -0
  22. package/dist/agents/types/index.d.ts +6 -0
  23. package/dist/agents/types/index.js +23 -0
  24. package/dist/agents/types/index.js.map +1 -0
  25. package/dist/agents/vector-store-adapter.d.ts +108 -0
  26. package/dist/agents/vector-store-adapter.js +213 -0
  27. package/dist/agents/vector-store-adapter.js.map +1 -0
  28. package/dist/api/services/appApi.service.d.ts +51 -5
  29. package/dist/api/services/appApi.service.js +101 -3
  30. package/dist/api/services/appApi.service.js.map +1 -1
  31. package/dist/api/services/pricingApi.service.d.ts +10 -0
  32. package/dist/api/services/pricingApi.service.js +34 -0
  33. package/dist/api/services/pricingApi.service.js.map +1 -0
  34. package/dist/api/services/processorApi.service.d.ts +322 -0
  35. package/dist/api/services/processorApi.service.js +252 -0
  36. package/dist/api/services/processorApi.service.js.map +1 -1
  37. package/dist/api/services/productsApi.service.d.ts +105 -0
  38. package/dist/api/services/productsApi.service.js +139 -3
  39. package/dist/api/services/productsApi.service.js.map +1 -1
  40. package/dist/api/services/resilienceApi.service.d.ts +106 -0
  41. package/dist/api/services/resilienceApi.service.js +224 -0
  42. package/dist/api/services/resilienceApi.service.js.map +1 -0
  43. package/dist/api/services/secretsApi.service.d.ts +50 -0
  44. package/dist/api/services/secretsApi.service.js +124 -0
  45. package/dist/api/services/secretsApi.service.js.map +1 -0
  46. package/dist/api/services/workflowApi.service.d.ts +199 -0
  47. package/dist/api/services/workflowApi.service.js +183 -0
  48. package/dist/api/services/workflowApi.service.js.map +1 -0
  49. package/dist/api/services/workspaceApi.service.d.ts +8 -0
  50. package/dist/api/services/workspaceApi.service.js +20 -0
  51. package/dist/api/services/workspaceApi.service.js.map +1 -1
  52. package/dist/api/urls.d.ts +62 -0
  53. package/dist/api/urls.js +87 -17
  54. package/dist/api/urls.js.map +1 -1
  55. package/dist/api/utils/auth.utils.d.ts +1 -3
  56. package/dist/api/utils/auth.utils.js.map +1 -1
  57. package/dist/api/utils/cache.utils.d.ts +1 -1
  58. package/dist/api/utils/cache.utils.js +2 -2
  59. package/dist/api/utils/cache.utils.js.map +1 -1
  60. package/dist/api/utils/strings.utils.d.ts +2 -0
  61. package/dist/api/utils/strings.utils.js +14 -0
  62. package/dist/api/utils/strings.utils.js.map +1 -1
  63. package/dist/apps/services/app.service.d.ts +41 -33
  64. package/dist/apps/services/app.service.js +472 -184
  65. package/dist/apps/services/app.service.js.map +1 -1
  66. package/dist/apps/utils/auth-context-manager.d.ts +137 -0
  67. package/dist/apps/utils/auth-context-manager.js +248 -0
  68. package/dist/apps/utils/auth-context-manager.js.map +1 -0
  69. package/dist/apps/utils/credential-manager.d.ts +128 -0
  70. package/dist/apps/utils/credential-manager.js +199 -0
  71. package/dist/apps/utils/credential-manager.js.map +1 -0
  72. package/dist/apps/utils/index.d.ts +10 -0
  73. package/dist/apps/utils/index.js +54 -0
  74. package/dist/apps/utils/index.js.map +1 -0
  75. package/dist/apps/utils/input-helpers.d.ts +67 -0
  76. package/dist/apps/utils/input-helpers.js +185 -0
  77. package/dist/apps/utils/input-helpers.js.map +1 -0
  78. package/dist/apps/utils/input-resolver.d.ts +165 -0
  79. package/dist/apps/utils/input-resolver.js +477 -0
  80. package/dist/apps/utils/input-resolver.js.map +1 -0
  81. package/dist/apps/utils/oauth-manager.d.ts +196 -0
  82. package/dist/apps/utils/oauth-manager.js +429 -0
  83. package/dist/apps/utils/oauth-manager.js.map +1 -0
  84. package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +1 -2
  85. package/dist/apps/validators/joi-validators/create.appAction.validator.js +21 -2
  86. package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -1
  87. package/dist/apps/validators/joi-validators/update.appAction.validator.js +11 -1
  88. package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
  89. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +1 -1
  90. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +34 -1
  91. package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +1 -1
  92. package/dist/bin.d.ts +26 -0
  93. package/dist/bin.js +28 -0
  94. package/dist/bin.js.map +1 -0
  95. package/dist/brokers/brokers.service.d.ts +297 -0
  96. package/dist/brokers/brokers.service.js +797 -0
  97. package/dist/brokers/brokers.service.js.map +1 -0
  98. package/dist/brokers/index.d.ts +46 -0
  99. package/dist/brokers/index.js +83 -0
  100. package/dist/brokers/index.js.map +1 -0
  101. package/dist/brokers/types/index.d.ts +316 -0
  102. package/dist/brokers/types/index.js +8 -0
  103. package/dist/brokers/types/index.js.map +1 -0
  104. package/dist/brokers/utils/broker.util.d.ts +33 -0
  105. package/dist/brokers/utils/broker.util.js +125 -0
  106. package/dist/brokers/utils/broker.util.js.map +1 -0
  107. package/dist/brokers/utils/providers/aws-sqs.service.d.ts +16 -0
  108. package/dist/brokers/utils/providers/aws-sqs.service.js +71 -0
  109. package/dist/brokers/utils/providers/aws-sqs.service.js.map +1 -0
  110. package/dist/brokers/utils/providers/google-pubsub.service.d.ts +16 -0
  111. package/dist/brokers/utils/providers/google-pubsub.service.js +43 -0
  112. package/dist/brokers/utils/providers/google-pubsub.service.js.map +1 -0
  113. package/dist/brokers/utils/providers/index.d.ts +6 -0
  114. package/dist/brokers/utils/providers/index.js +16 -0
  115. package/dist/brokers/utils/providers/index.js.map +1 -0
  116. package/dist/brokers/utils/providers/kafka.service.d.ts +23 -0
  117. package/dist/brokers/utils/providers/kafka.service.js +131 -0
  118. package/dist/brokers/utils/providers/kafka.service.js.map +1 -0
  119. package/dist/brokers/utils/providers/nats.service.d.ts +18 -0
  120. package/dist/brokers/utils/providers/nats.service.js +63 -0
  121. package/dist/brokers/utils/providers/nats.service.js.map +1 -0
  122. package/dist/brokers/utils/providers/rabbitmq.service.d.ts +15 -0
  123. package/dist/brokers/utils/providers/rabbitmq.service.js +151 -0
  124. package/dist/brokers/utils/providers/rabbitmq.service.js.map +1 -0
  125. package/dist/brokers/utils/providers/redis.service.d.ts +18 -0
  126. package/dist/brokers/utils/providers/redis.service.js +93 -0
  127. package/dist/brokers/utils/providers/redis.service.js.map +1 -0
  128. package/dist/cache/cache.manager.d.ts +229 -0
  129. package/dist/cache/cache.manager.js +460 -0
  130. package/dist/cache/cache.manager.js.map +1 -0
  131. package/dist/cache/cache.service.d.ts +186 -0
  132. package/dist/cache/cache.service.js +437 -0
  133. package/dist/cache/cache.service.js.map +1 -0
  134. package/dist/cache/index.d.ts +52 -0
  135. package/dist/cache/index.js +79 -0
  136. package/dist/cache/index.js.map +1 -0
  137. package/dist/cache/types/index.d.ts +106 -0
  138. package/dist/cache/types/index.js +6 -0
  139. package/dist/cache/types/index.js.map +1 -0
  140. package/dist/clients/pricing.client.d.ts +3 -0
  141. package/dist/clients/pricing.client.js +33 -0
  142. package/dist/clients/pricing.client.js.map +1 -0
  143. package/dist/database/actions/action-manager.d.ts +170 -0
  144. package/dist/database/actions/action-manager.js +465 -0
  145. package/dist/database/actions/action-manager.js.map +1 -0
  146. package/dist/database/actions/index.d.ts +6 -0
  147. package/dist/database/actions/index.js +13 -0
  148. package/dist/database/actions/index.js.map +1 -0
  149. package/dist/database/adapters/adapter.factory.d.ts +62 -0
  150. package/dist/database/adapters/adapter.factory.js +97 -0
  151. package/dist/database/adapters/adapter.factory.js.map +1 -0
  152. package/dist/database/adapters/base.adapter.d.ts +423 -0
  153. package/dist/database/adapters/base.adapter.js +260 -0
  154. package/dist/database/adapters/base.adapter.js.map +1 -0
  155. package/dist/database/adapters/cassandra.adapter.d.ts +92 -0
  156. package/dist/database/adapters/cassandra.adapter.js +1091 -0
  157. package/dist/database/adapters/cassandra.adapter.js.map +1 -0
  158. package/dist/database/adapters/dynamodb.adapter.d.ts +110 -0
  159. package/dist/database/adapters/dynamodb.adapter.js +1564 -0
  160. package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
  161. package/dist/database/adapters/index.d.ts +11 -0
  162. package/dist/database/adapters/index.js +27 -0
  163. package/dist/database/adapters/index.js.map +1 -0
  164. package/dist/database/adapters/mariadb.adapter.d.ts +100 -0
  165. package/dist/database/adapters/mariadb.adapter.js +247 -0
  166. package/dist/database/adapters/mariadb.adapter.js.map +1 -0
  167. package/dist/database/adapters/mongodb.adapter.d.ts +121 -0
  168. package/dist/database/adapters/mongodb.adapter.js +1284 -0
  169. package/dist/database/adapters/mongodb.adapter.js.map +1 -0
  170. package/dist/database/adapters/mysql.adapter.d.ts +86 -0
  171. package/dist/database/adapters/mysql.adapter.js +1371 -0
  172. package/dist/database/adapters/mysql.adapter.js.map +1 -0
  173. package/dist/database/adapters/postgresql.adapter.d.ts +90 -0
  174. package/dist/database/adapters/postgresql.adapter.js +1487 -0
  175. package/dist/database/adapters/postgresql.adapter.js.map +1 -0
  176. package/dist/database/databases.service.d.ts +1408 -0
  177. package/dist/database/databases.service.js +2953 -0
  178. package/dist/database/databases.service.js.map +1 -0
  179. package/dist/database/index.d.ts +46 -0
  180. package/dist/database/index.js +109 -0
  181. package/dist/database/index.js.map +1 -0
  182. package/dist/database/migrations/index.d.ts +6 -0
  183. package/dist/database/migrations/index.js +12 -0
  184. package/dist/database/migrations/index.js.map +1 -0
  185. package/dist/database/migrations/migration-engine.d.ts +136 -0
  186. package/dist/database/migrations/migration-engine.js +1421 -0
  187. package/dist/database/migrations/migration-engine.js.map +1 -0
  188. package/dist/database/operators/aggregation-builder.d.ts +67 -0
  189. package/dist/database/operators/aggregation-builder.js +841 -0
  190. package/dist/database/operators/aggregation-builder.js.map +1 -0
  191. package/dist/database/operators/index.d.ts +7 -0
  192. package/dist/database/operators/index.js +15 -0
  193. package/dist/database/operators/index.js.map +1 -0
  194. package/dist/database/operators/query-builder.d.ts +69 -0
  195. package/dist/database/operators/query-builder.js +447 -0
  196. package/dist/database/operators/query-builder.js.map +1 -0
  197. package/dist/database/presave/decrypt.d.ts +25 -0
  198. package/dist/database/presave/decrypt.js +146 -0
  199. package/dist/database/presave/decrypt.js.map +1 -0
  200. package/dist/database/presave/index.d.ts +9 -0
  201. package/dist/database/presave/index.js +18 -0
  202. package/dist/database/presave/index.js.map +1 -0
  203. package/dist/database/presave/presave-processor.d.ts +148 -0
  204. package/dist/database/presave/presave-processor.js +702 -0
  205. package/dist/database/presave/presave-processor.js.map +1 -0
  206. package/dist/database/schema/index.d.ts +7 -0
  207. package/dist/database/schema/index.js +13 -0
  208. package/dist/database/schema/index.js.map +1 -0
  209. package/dist/database/schema/schema-manager.d.ts +258 -0
  210. package/dist/database/schema/schema-manager.js +638 -0
  211. package/dist/database/schema/schema-manager.js.map +1 -0
  212. package/dist/database/transactions/index.d.ts +6 -0
  213. package/dist/database/transactions/index.js +13 -0
  214. package/dist/database/transactions/index.js.map +1 -0
  215. package/dist/database/transactions/transaction-manager.d.ts +113 -0
  216. package/dist/database/transactions/transaction-manager.js +344 -0
  217. package/dist/database/transactions/transaction-manager.js.map +1 -0
  218. package/dist/database/triggers/index.d.ts +7 -0
  219. package/dist/database/triggers/index.js +14 -0
  220. package/dist/database/triggers/index.js.map +1 -0
  221. package/dist/database/triggers/trigger-processor.d.ts +239 -0
  222. package/dist/database/triggers/trigger-processor.js +1034 -0
  223. package/dist/database/triggers/trigger-processor.js.map +1 -0
  224. package/dist/database/types/action.interface.d.ts +148 -0
  225. package/dist/database/types/action.interface.js +6 -0
  226. package/dist/database/types/action.interface.js.map +1 -0
  227. package/dist/database/types/aggregation.interface.d.ts +185 -0
  228. package/dist/database/types/aggregation.interface.js +6 -0
  229. package/dist/database/types/aggregation.interface.js.map +1 -0
  230. package/dist/database/types/connection.interface.d.ts +137 -0
  231. package/dist/database/types/connection.interface.js +6 -0
  232. package/dist/database/types/connection.interface.js.map +1 -0
  233. package/dist/database/types/enums.d.ts +195 -0
  234. package/dist/database/types/enums.js +244 -0
  235. package/dist/database/types/enums.js.map +1 -0
  236. package/dist/database/types/index.d.ts +14 -0
  237. package/dist/database/types/index.js +31 -0
  238. package/dist/database/types/index.js.map +1 -0
  239. package/dist/database/types/migration.interface.d.ts +686 -0
  240. package/dist/database/types/migration.interface.js +9 -0
  241. package/dist/database/types/migration.interface.js.map +1 -0
  242. package/dist/database/types/presave.interface.d.ts +292 -0
  243. package/dist/database/types/presave.interface.js +60 -0
  244. package/dist/database/types/presave.interface.js.map +1 -0
  245. package/dist/database/types/query.interface.d.ts +205 -0
  246. package/dist/database/types/query.interface.js +6 -0
  247. package/dist/database/types/query.interface.js.map +1 -0
  248. package/dist/database/types/schema.interface.d.ts +412 -0
  249. package/dist/database/types/schema.interface.js +6 -0
  250. package/dist/database/types/schema.interface.js.map +1 -0
  251. package/dist/database/types/transaction.interface.d.ts +84 -0
  252. package/dist/database/types/transaction.interface.js +6 -0
  253. package/dist/database/types/transaction.interface.js.map +1 -0
  254. package/dist/database/types/trigger.interface.d.ts +612 -0
  255. package/dist/database/types/trigger.interface.js +121 -0
  256. package/dist/database/types/trigger.interface.js.map +1 -0
  257. package/dist/database/types/write.interface.d.ts +216 -0
  258. package/dist/database/types/write.interface.js +6 -0
  259. package/dist/database/types/write.interface.js.map +1 -0
  260. package/dist/database/utils/database-error.d.ts +96 -0
  261. package/dist/database/utils/database-error.js +221 -0
  262. package/dist/database/utils/database-error.js.map +1 -0
  263. package/dist/database/utils/index.d.ts +6 -0
  264. package/dist/database/utils/index.js +11 -0
  265. package/dist/database/utils/index.js.map +1 -0
  266. package/dist/graph/adapters/adapter.factory.d.ts +47 -0
  267. package/dist/graph/adapters/adapter.factory.js +77 -0
  268. package/dist/graph/adapters/adapter.factory.js.map +1 -0
  269. package/dist/graph/adapters/arangodb.adapter.d.ts +86 -0
  270. package/dist/graph/adapters/arangodb.adapter.js +1588 -0
  271. package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
  272. package/dist/graph/adapters/base.adapter.d.ts +264 -0
  273. package/dist/graph/adapters/base.adapter.js +156 -0
  274. package/dist/graph/adapters/base.adapter.js.map +1 -0
  275. package/dist/graph/adapters/index.d.ts +11 -0
  276. package/dist/graph/adapters/index.js +21 -0
  277. package/dist/graph/adapters/index.js.map +1 -0
  278. package/dist/graph/adapters/memgraph.adapter.d.ts +110 -0
  279. package/dist/graph/adapters/memgraph.adapter.js +1452 -0
  280. package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
  281. package/dist/graph/adapters/neo4j.adapter.d.ts +81 -0
  282. package/dist/graph/adapters/neo4j.adapter.js +1317 -0
  283. package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
  284. package/dist/graph/adapters/neptune.adapter.d.ts +82 -0
  285. package/dist/graph/adapters/neptune.adapter.js +1369 -0
  286. package/dist/graph/adapters/neptune.adapter.js.map +1 -0
  287. package/dist/graph/graphs.service.d.ts +568 -0
  288. package/dist/graph/graphs.service.js +1948 -0
  289. package/dist/graph/graphs.service.js.map +1 -0
  290. package/dist/graph/index.d.ts +57 -0
  291. package/dist/graph/index.js +77 -0
  292. package/dist/graph/index.js.map +1 -0
  293. package/dist/graph/transactions/index.d.ts +4 -0
  294. package/dist/graph/transactions/index.js +9 -0
  295. package/dist/graph/transactions/index.js.map +1 -0
  296. package/dist/graph/transactions/transaction-manager.d.ts +61 -0
  297. package/dist/graph/transactions/transaction-manager.js +126 -0
  298. package/dist/graph/transactions/transaction-manager.js.map +1 -0
  299. package/dist/graph/types/connection.interface.d.ts +149 -0
  300. package/dist/graph/types/connection.interface.js +9 -0
  301. package/dist/graph/types/connection.interface.js.map +1 -0
  302. package/dist/graph/types/enums.d.ts +101 -0
  303. package/dist/graph/types/enums.js +114 -0
  304. package/dist/graph/types/enums.js.map +1 -0
  305. package/dist/graph/types/index.d.ts +13 -0
  306. package/dist/graph/types/index.js +20 -0
  307. package/dist/graph/types/index.js.map +1 -0
  308. package/dist/graph/types/node.interface.d.ts +248 -0
  309. package/dist/graph/types/node.interface.js +9 -0
  310. package/dist/graph/types/node.interface.js.map +1 -0
  311. package/dist/graph/types/query.interface.d.ts +175 -0
  312. package/dist/graph/types/query.interface.js +9 -0
  313. package/dist/graph/types/query.interface.js.map +1 -0
  314. package/dist/graph/types/relationship.interface.d.ts +207 -0
  315. package/dist/graph/types/relationship.interface.js +9 -0
  316. package/dist/graph/types/relationship.interface.js.map +1 -0
  317. package/dist/graph/types/schema.interface.d.ts +295 -0
  318. package/dist/graph/types/schema.interface.js +9 -0
  319. package/dist/graph/types/schema.interface.js.map +1 -0
  320. package/dist/graph/types/transaction.interface.d.ts +55 -0
  321. package/dist/graph/types/transaction.interface.js +9 -0
  322. package/dist/graph/types/transaction.interface.js.map +1 -0
  323. package/dist/graph/types/traversal.interface.d.ts +181 -0
  324. package/dist/graph/types/traversal.interface.js +9 -0
  325. package/dist/graph/types/traversal.interface.js.map +1 -0
  326. package/dist/graph/utils/graph-error.d.ts +71 -0
  327. package/dist/graph/utils/graph-error.js +142 -0
  328. package/dist/graph/utils/graph-error.js.map +1 -0
  329. package/dist/graph/utils/index.d.ts +4 -0
  330. package/dist/graph/utils/index.js +9 -0
  331. package/dist/graph/utils/index.js.map +1 -0
  332. package/dist/imports/imports.service.d.ts +3 -3
  333. package/dist/imports/imports.service.js +8 -7
  334. package/dist/imports/imports.service.js.map +1 -1
  335. package/dist/imports/imports.types.d.ts +8 -0
  336. package/dist/imports/repos/openApi.repo.d.ts +1 -1
  337. package/dist/imports/repos/openApi.repo.js +414 -47
  338. package/dist/imports/repos/openApi.repo.js.map +1 -1
  339. package/dist/imports/repos/postmanV21.repo.d.ts +1 -1
  340. package/dist/imports/repos/postmanV21.repo.js +126 -83
  341. package/dist/imports/repos/postmanV21.repo.js.map +1 -1
  342. package/dist/index.d.ts +3654 -289
  343. package/dist/index.js +5066 -669
  344. package/dist/index.js.map +1 -1
  345. package/dist/init.interface.d.ts +407 -0
  346. package/dist/init.interface.js +3 -0
  347. package/dist/init.interface.js.map +1 -0
  348. package/dist/inputs/inputs.service.d.ts +1 -1
  349. package/dist/inputs/utils/inputs.utils.create.js +1 -1
  350. package/dist/inputs/utils/inputs.utils.create.js.map +1 -1
  351. package/dist/jobs/index.d.ts +38 -0
  352. package/dist/jobs/index.js +50 -0
  353. package/dist/jobs/index.js.map +1 -0
  354. package/dist/jobs/jobs.service.d.ts +154 -0
  355. package/dist/jobs/jobs.service.js +491 -0
  356. package/dist/jobs/jobs.service.js.map +1 -0
  357. package/dist/jobs/jobs.state.d.ts +113 -0
  358. package/dist/jobs/jobs.state.js +447 -0
  359. package/dist/jobs/jobs.state.js.map +1 -0
  360. package/dist/jobs/types.d.ts +449 -0
  361. package/dist/jobs/types.js +74 -0
  362. package/dist/jobs/types.js.map +1 -0
  363. package/dist/logs/logs.service.js +6 -2
  364. package/dist/logs/logs.service.js.map +1 -1
  365. package/dist/logs/logs.types.d.ts +19 -1
  366. package/dist/logs/logs.types.js +6 -0
  367. package/dist/logs/logs.types.js.map +1 -1
  368. package/dist/models/index.d.ts +6 -0
  369. package/dist/models/index.js +11 -0
  370. package/dist/models/index.js.map +1 -0
  371. package/dist/models/models.service.d.ts +137 -0
  372. package/dist/models/models.service.js +195 -0
  373. package/dist/models/models.service.js.map +1 -0
  374. package/dist/notifications/index.d.ts +13 -0
  375. package/dist/notifications/index.js +26 -0
  376. package/dist/notifications/index.js.map +1 -0
  377. package/dist/notifications/notifications.service.d.ts +265 -0
  378. package/dist/notifications/notifications.service.js +862 -0
  379. package/dist/notifications/notifications.service.js.map +1 -0
  380. package/dist/notifications/types/index.d.ts +4 -0
  381. package/dist/notifications/types/index.js +21 -0
  382. package/dist/notifications/types/index.js.map +1 -0
  383. package/dist/notifications/types/notifications.types.d.ts +402 -0
  384. package/dist/notifications/types/notifications.types.js +49 -0
  385. package/dist/notifications/types/notifications.types.js.map +1 -0
  386. package/dist/parsers/index.d.ts +3 -0
  387. package/dist/parsers/index.js +27 -0
  388. package/dist/parsers/index.js.map +1 -0
  389. package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
  390. package/dist/parsers/pipelines/postman.pipelines.js +103 -0
  391. package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
  392. package/dist/parsers/types/postman.types.d.ts +200 -0
  393. package/dist/parsers/types/postman.types.js +3 -0
  394. package/dist/parsers/types/postman.types.js.map +1 -0
  395. package/dist/parsers/utils/postman.utils.d.ts +12 -0
  396. package/dist/parsers/utils/postman.utils.js +116 -0
  397. package/dist/parsers/utils/postman.utils.js.map +1 -0
  398. package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
  399. package/dist/parsers/validators/postman-auth.validators.js +127 -0
  400. package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
  401. package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
  402. package/dist/parsers/validators/postman-request.validators.js +139 -0
  403. package/dist/parsers/validators/postman-request.validators.js.map +1 -0
  404. package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
  405. package/dist/parsers/validators/postman-response.validators.js +150 -0
  406. package/dist/parsers/validators/postman-response.validators.js.map +1 -0
  407. package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
  408. package/dist/parsers/validators/postman-variable.validators.js +163 -0
  409. package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
  410. package/dist/pricing/pricing.repo.js +1 -0
  411. package/dist/pricing/pricing.repo.js.map +1 -0
  412. package/dist/pricing/pricing.service.d.ts +24 -0
  413. package/dist/pricing/pricing.service.js +51 -0
  414. package/dist/pricing/pricing.service.js.map +1 -0
  415. package/dist/pricing/pricing.types.d.ts +76 -0
  416. package/dist/pricing/pricing.types.js +21 -0
  417. package/dist/pricing/pricing.types.js.map +1 -0
  418. package/dist/pricing/utils/string.utils.d.ts +1 -0
  419. package/dist/pricing/utils/string.utils.js +9 -0
  420. package/dist/pricing/utils/string.utils.js.map +1 -0
  421. package/dist/processor/services/processor.service.d.ts +117 -73
  422. package/dist/processor/services/processor.service.js +1557 -1276
  423. package/dist/processor/services/processor.service.js.map +1 -1
  424. package/dist/processor/services/request.service.d.ts +36 -0
  425. package/dist/processor/services/request.service.js +304 -0
  426. package/dist/processor/services/request.service.js.map +1 -0
  427. package/dist/processor/types/request.types.d.ts +14 -0
  428. package/dist/processor/types/request.types.js +3 -0
  429. package/dist/processor/types/request.types.js.map +1 -0
  430. package/dist/processor/utils/processor.utils.js +32 -20
  431. package/dist/processor/utils/processor.utils.js.map +1 -1
  432. package/dist/processor/utils/request.utils.d.ts +20 -0
  433. package/dist/processor/utils/request.utils.js +113 -0
  434. package/dist/processor/utils/request.utils.js.map +1 -0
  435. package/dist/products/services/products.service.d.ts +365 -75
  436. package/dist/products/services/products.service.js +2809 -414
  437. package/dist/products/services/products.service.js.map +1 -1
  438. package/dist/products/utils/string.utils.d.ts +1 -1
  439. package/dist/products/utils/string.utils.js +14 -2
  440. package/dist/products/utils/string.utils.js.map +1 -1
  441. package/dist/products/validators/index.d.ts +7 -1
  442. package/dist/products/validators/index.js +16 -1
  443. package/dist/products/validators/index.js.map +1 -1
  444. package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +3 -0
  445. package/dist/products/validators/joi-validators/create.productAgent.validator.js +266 -0
  446. package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +1 -0
  447. package/dist/products/validators/joi-validators/create.productDatabase.validator.js +5 -0
  448. package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -1
  449. package/dist/products/validators/joi-validators/create.productEnv.validator.js +1 -0
  450. package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -1
  451. package/dist/products/validators/joi-validators/create.productGraph.validator.js +89 -0
  452. package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
  453. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +4 -0
  454. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +58 -0
  455. package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +1 -0
  456. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +81 -25
  457. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
  458. package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +3 -0
  459. package/dist/products/validators/joi-validators/create.productModel.validator.js +132 -0
  460. package/dist/products/validators/joi-validators/create.productModel.validator.js.map +1 -0
  461. package/dist/products/validators/joi-validators/create.productNotification.validator.js +133 -45
  462. package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
  463. package/dist/products/validators/joi-validators/create.productStorage.validator.js +77 -18
  464. package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +1 -1
  465. package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +3 -0
  466. package/dist/products/validators/joi-validators/create.productVector.validator.js +135 -0
  467. package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -0
  468. package/dist/products/validators/joi-validators/update.dataValue.validator.js +1 -0
  469. package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -1
  470. package/dist/products/validators/joi-validators/update.productDatabase.validator.js +5 -0
  471. package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +1 -1
  472. package/dist/products/validators/joi-validators/update.productEnv.validator.js +3 -0
  473. package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -1
  474. package/dist/products/validators/joi-validators/update.productGraph.validator.js +88 -0
  475. package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
  476. package/dist/resilience/fallback.service.d.ts +140 -0
  477. package/dist/resilience/fallback.service.js +764 -0
  478. package/dist/resilience/fallback.service.js.map +1 -0
  479. package/dist/resilience/healthcheck.service.d.ts +159 -0
  480. package/dist/resilience/healthcheck.service.js +943 -0
  481. package/dist/resilience/healthcheck.service.js.map +1 -0
  482. package/dist/resilience/index.d.ts +104 -0
  483. package/dist/resilience/index.js +140 -0
  484. package/dist/resilience/index.js.map +1 -0
  485. package/dist/resilience/quota.service.d.ts +82 -0
  486. package/dist/resilience/quota.service.js +516 -0
  487. package/dist/resilience/quota.service.js.map +1 -0
  488. package/dist/resilience/resilience.service.d.ts +98 -0
  489. package/dist/resilience/resilience.service.js +560 -0
  490. package/dist/resilience/resilience.service.js.map +1 -0
  491. package/dist/resilience/types/index.d.ts +513 -0
  492. package/dist/resilience/types/index.js +29 -0
  493. package/dist/resilience/types/index.js.map +1 -0
  494. package/dist/secrets/index.d.ts +10 -0
  495. package/dist/secrets/index.js +33 -0
  496. package/dist/secrets/index.js.map +1 -0
  497. package/dist/secrets/secrets.resolver.d.ts +52 -0
  498. package/dist/secrets/secrets.resolver.js +233 -0
  499. package/dist/secrets/secrets.resolver.js.map +1 -0
  500. package/dist/secrets/secrets.service.d.ts +93 -0
  501. package/dist/secrets/secrets.service.js +258 -0
  502. package/dist/secrets/secrets.service.js.map +1 -0
  503. package/dist/secrets/secrets.types.d.ts +188 -0
  504. package/dist/secrets/secrets.types.js +87 -0
  505. package/dist/secrets/secrets.types.js.map +1 -0
  506. package/dist/sessions/index.d.ts +50 -0
  507. package/dist/sessions/index.js +93 -0
  508. package/dist/sessions/index.js.map +1 -0
  509. package/dist/sessions/sessions.helper.d.ts +68 -0
  510. package/dist/sessions/sessions.helper.js +116 -0
  511. package/dist/sessions/sessions.helper.js.map +1 -0
  512. package/dist/sessions/sessions.resolver.d.ts +157 -0
  513. package/dist/sessions/sessions.resolver.js +374 -0
  514. package/dist/sessions/sessions.resolver.js.map +1 -0
  515. package/dist/sessions/sessions.service.d.ts +178 -0
  516. package/dist/sessions/sessions.service.js +923 -0
  517. package/dist/sessions/sessions.service.js.map +1 -0
  518. package/dist/sessions/types/index.d.ts +298 -0
  519. package/dist/sessions/types/index.js +6 -0
  520. package/dist/sessions/types/index.js.map +1 -0
  521. package/dist/storage/index.d.ts +66 -0
  522. package/dist/storage/index.js +99 -0
  523. package/dist/storage/index.js.map +1 -0
  524. package/dist/storage/storage.service.d.ts +174 -0
  525. package/dist/storage/storage.service.js +757 -0
  526. package/dist/storage/storage.service.js.map +1 -0
  527. package/dist/storage/types/index.d.ts +267 -0
  528. package/dist/storage/types/index.js +6 -0
  529. package/dist/storage/types/index.js.map +1 -0
  530. package/dist/storage/utils/storage.util.d.ts +62 -0
  531. package/dist/storage/utils/storage.util.js +593 -0
  532. package/dist/storage/utils/storage.util.js.map +1 -0
  533. package/dist/test/index.d.ts +3 -0
  534. package/dist/test/index.js +11 -0
  535. package/dist/test/index.js.map +1 -0
  536. package/dist/test/test.appBuilder.d.ts +0 -1
  537. package/dist/test/test.appBuilder.js +0 -15
  538. package/dist/test/test.appBuilder.js.map +1 -1
  539. package/dist/test/test.broker.kafka.js +172 -0
  540. package/dist/test/test.broker.kafka.js.map +1 -0
  541. package/dist/test/test.broker.nats.js +193 -0
  542. package/dist/test/test.broker.nats.js.map +1 -0
  543. package/dist/test/test.broker.pubsub.js +171 -0
  544. package/dist/test/test.broker.pubsub.js.map +1 -0
  545. package/dist/test/test.broker.rabbitmq.js +164 -0
  546. package/dist/test/test.broker.rabbitmq.js.map +1 -0
  547. package/dist/test/test.broker.redis.js +168 -0
  548. package/dist/test/test.broker.redis.js.map +1 -0
  549. package/dist/test/test.broker.sqs.d.ts +1 -0
  550. package/dist/test/test.broker.sqs.js +158 -0
  551. package/dist/test/test.broker.sqs.js.map +1 -0
  552. package/dist/test/test.caches.d.ts +1 -0
  553. package/dist/test/test.caches.js +231 -0
  554. package/dist/test/test.caches.js.map +1 -0
  555. package/dist/test/test.database.d.ts +1 -0
  556. package/dist/test/test.database.dynamo.d.ts +1 -0
  557. package/dist/test/test.database.dynamo.js +265 -0
  558. package/dist/test/test.database.dynamo.js.map +1 -0
  559. package/dist/test/test.database.js +140 -0
  560. package/dist/test/test.database.js.map +1 -0
  561. package/dist/test/test.database.mongo.d.ts +1 -0
  562. package/dist/test/test.database.mongo.js +371 -0
  563. package/dist/test/test.database.mongo.js.map +1 -0
  564. package/dist/test/test.database.mysql.d.ts +1 -0
  565. package/dist/test/test.database.mysql.js +415 -0
  566. package/dist/test/test.database.mysql.js.map +1 -0
  567. package/dist/test/test.database.postgres.d.ts +1 -0
  568. package/dist/test/test.database.postgres.js +412 -0
  569. package/dist/test/test.database.postgres.js.map +1 -0
  570. package/dist/test/test.email.brevo.d.ts +1 -0
  571. package/dist/test/test.email.brevo.js +326 -0
  572. package/dist/test/test.email.brevo.js.map +1 -0
  573. package/dist/test/test.email.mailgun.d.ts +1 -0
  574. package/dist/test/test.email.mailgun.js +352 -0
  575. package/dist/test/test.email.mailgun.js.map +1 -0
  576. package/dist/test/test.email.postmark.d.ts +1 -0
  577. package/dist/test/test.email.postmark.js +316 -0
  578. package/dist/test/test.email.postmark.js.map +1 -0
  579. package/dist/test/test.email.sendgrid.d.ts +1 -0
  580. package/dist/test/test.email.sendgrid.js +365 -0
  581. package/dist/test/test.email.sendgrid.js.map +1 -0
  582. package/dist/test/test.email.smtp.d.ts +1 -0
  583. package/dist/test/test.email.smtp.js +323 -0
  584. package/dist/test/test.email.smtp.js.map +1 -0
  585. package/dist/test/test.graph.arangodb.d.ts +1 -0
  586. package/dist/test/test.graph.arangodb.js +358 -0
  587. package/dist/test/test.graph.arangodb.js.map +1 -0
  588. package/dist/test/test.graph.memgraph.d.ts +1 -0
  589. package/dist/test/test.graph.memgraph.js +320 -0
  590. package/dist/test/test.graph.memgraph.js.map +1 -0
  591. package/dist/test/test.graph.neo4j.d.ts +1 -0
  592. package/dist/test/test.graph.neo4j.js +218 -0
  593. package/dist/test/test.graph.neo4j.js.map +1 -0
  594. package/dist/test/test.graph.neptune.d.ts +1 -0
  595. package/dist/test/test.graph.neptune.js +331 -0
  596. package/dist/test/test.graph.neptune.js.map +1 -0
  597. package/dist/test/test.health.js +1 -0
  598. package/dist/test/test.health.js.map +1 -0
  599. package/dist/test/test.import.d.ts +0 -1
  600. package/dist/test/test.import.js +0 -1459
  601. package/dist/test/test.import.js.map +1 -1
  602. package/dist/test/test.import.openapi.d.ts +0 -1
  603. package/dist/test/test.import.openapi.js +0 -75
  604. package/dist/test/test.import.openapi.js.map +1 -1
  605. package/dist/test/test.imports.js +14 -55
  606. package/dist/test/test.imports.js.map +1 -1
  607. package/dist/test/test.logs.d.ts +0 -1
  608. package/dist/test/test.logs.js +0 -17
  609. package/dist/test/test.logs.js.map +1 -1
  610. package/dist/test/test.notifications.d.ts +1 -0
  611. package/dist/test/test.notifications.js +198 -0
  612. package/dist/test/test.notifications.js.map +1 -0
  613. package/dist/test/test.notifiers.js +1 -0
  614. package/dist/test/test.notifiers.js.map +1 -0
  615. package/dist/test/test.processor.d.ts +0 -1
  616. package/dist/test/test.processor.js +0 -122
  617. package/dist/test/test.processor.js.map +1 -1
  618. package/dist/test/test.productBuilder.d.ts +0 -1
  619. package/dist/test/test.productBuilder.js +0 -660
  620. package/dist/test/test.productBuilder.js.map +1 -1
  621. package/dist/test/test.products.js +1 -0
  622. package/dist/test/test.products.js.map +1 -0
  623. package/dist/test/test.push.expo.d.ts +1 -0
  624. package/dist/test/test.push.expo.js +442 -0
  625. package/dist/test/test.push.expo.js.map +1 -0
  626. package/dist/test/test.push.firebase.d.ts +1 -0
  627. package/dist/test/test.push.firebase.js +409 -0
  628. package/dist/test/test.push.firebase.js.map +1 -0
  629. package/dist/test/test.session.d.ts +1 -0
  630. package/dist/test/test.session.js +299 -0
  631. package/dist/test/test.session.js.map +1 -0
  632. package/dist/test/test.sms.nexmo.d.ts +1 -0
  633. package/dist/test/test.sms.nexmo.js +278 -0
  634. package/dist/test/test.sms.nexmo.js.map +1 -0
  635. package/dist/test/test.sms.twilio.d.ts +1 -0
  636. package/dist/test/test.sms.twilio.js +275 -0
  637. package/dist/test/test.sms.twilio.js.map +1 -0
  638. package/dist/test/test.storage.d.ts +1 -0
  639. package/dist/test/test.storage.js +202 -0
  640. package/dist/test/test.storage.js.map +1 -0
  641. package/dist/test/test.triggers.d.ts +1 -0
  642. package/dist/test/test.triggers.js +314 -0
  643. package/dist/test/test.triggers.js.map +1 -0
  644. package/dist/test/test.vector.pinecone.d.ts +1 -0
  645. package/dist/test/test.vector.pinecone.js +238 -0
  646. package/dist/test/test.vector.pinecone.js.map +1 -0
  647. package/dist/test/test.vector.qdrant.d.ts +1 -0
  648. package/dist/test/test.vector.qdrant.js +307 -0
  649. package/dist/test/test.vector.qdrant.js.map +1 -0
  650. package/dist/test/test.vector.weaviate.d.ts +1 -0
  651. package/dist/test/test.vector.weaviate.js +325 -0
  652. package/dist/test/test.vector.weaviate.js.map +1 -0
  653. package/dist/types/appBuilder.types.d.ts +9 -2
  654. package/dist/types/enums.d.ts +11 -1
  655. package/dist/types/enums.js +10 -0
  656. package/dist/types/enums.js.map +1 -1
  657. package/dist/types/index.types.d.ts +4 -7
  658. package/dist/types/index.types.js +0 -1
  659. package/dist/types/index.types.js.map +1 -1
  660. package/dist/types/inputs.types.js +1 -1
  661. package/dist/types/inputs.types.js.map +1 -1
  662. package/dist/types/pricing.types.d.ts +4 -0
  663. package/dist/types/pricing.types.js +3 -0
  664. package/dist/types/pricing.types.js.map +1 -0
  665. package/dist/types/processor.types.d.ts +214 -33
  666. package/dist/types/processor.types.js +9 -1
  667. package/dist/types/processor.types.js.map +1 -1
  668. package/dist/types/productsBuilder.types.d.ts +978 -23
  669. package/dist/types/productsBuilder.types.js +210 -3
  670. package/dist/types/productsBuilder.types.js.map +1 -1
  671. package/dist/types/request-tracker.interface.js +1 -0
  672. package/dist/types/request-tracker.interface.js.map +1 -0
  673. package/dist/types/requests.types.d.ts +2 -0
  674. package/dist/utils/constants.d.ts +1 -0
  675. package/dist/utils/constants.js +5 -0
  676. package/dist/utils/constants.js.map +1 -0
  677. package/dist/utils/index.d.ts +0 -2
  678. package/dist/utils/index.js +24 -52
  679. package/dist/utils/index.js.map +1 -1
  680. package/dist/vector/actions/action-manager.d.ts +140 -0
  681. package/dist/vector/actions/action-manager.js +356 -0
  682. package/dist/vector/actions/action-manager.js.map +1 -0
  683. package/dist/vector/adapters/base.adapter.d.ts +169 -0
  684. package/dist/vector/adapters/base.adapter.js +218 -0
  685. package/dist/vector/adapters/base.adapter.js.map +1 -0
  686. package/dist/vector/adapters/index.d.ts +10 -0
  687. package/dist/vector/adapters/index.js +19 -0
  688. package/dist/vector/adapters/index.js.map +1 -0
  689. package/dist/vector/adapters/memory.adapter.d.ts +85 -0
  690. package/dist/vector/adapters/memory.adapter.js +505 -0
  691. package/dist/vector/adapters/memory.adapter.js.map +1 -0
  692. package/dist/vector/adapters/pinecone.adapter.d.ts +52 -0
  693. package/dist/vector/adapters/pinecone.adapter.js +433 -0
  694. package/dist/vector/adapters/pinecone.adapter.js.map +1 -0
  695. package/dist/vector/adapters/qdrant.adapter.d.ts +56 -0
  696. package/dist/vector/adapters/qdrant.adapter.js +442 -0
  697. package/dist/vector/adapters/qdrant.adapter.js.map +1 -0
  698. package/dist/vector/adapters/weaviate.adapter.d.ts +68 -0
  699. package/dist/vector/adapters/weaviate.adapter.js +645 -0
  700. package/dist/vector/adapters/weaviate.adapter.js.map +1 -0
  701. package/dist/vector/index.d.ts +36 -0
  702. package/dist/vector/index.js +70 -0
  703. package/dist/vector/index.js.map +1 -0
  704. package/dist/vector/types/action.interface.d.ts +195 -0
  705. package/dist/vector/types/action.interface.js +100 -0
  706. package/dist/vector/types/action.interface.js.map +1 -0
  707. package/dist/vector/types/connection.interface.d.ts +151 -0
  708. package/dist/vector/types/connection.interface.js +8 -0
  709. package/dist/vector/types/connection.interface.js.map +1 -0
  710. package/dist/vector/types/embedding.interface.d.ts +144 -0
  711. package/dist/vector/types/embedding.interface.js +8 -0
  712. package/dist/vector/types/embedding.interface.js.map +1 -0
  713. package/dist/vector/types/enums.d.ts +104 -0
  714. package/dist/vector/types/enums.js +113 -0
  715. package/dist/vector/types/enums.js.map +1 -0
  716. package/dist/vector/types/index.d.ts +11 -0
  717. package/dist/vector/types/index.js +23 -0
  718. package/dist/vector/types/index.js.map +1 -0
  719. package/dist/vector/types/vector.interface.d.ts +315 -0
  720. package/dist/vector/types/vector.interface.js +8 -0
  721. package/dist/vector/types/vector.interface.js.map +1 -0
  722. package/dist/vector/utils/index.d.ts +6 -0
  723. package/dist/vector/utils/index.js +11 -0
  724. package/dist/vector/utils/index.js.map +1 -0
  725. package/dist/vector/utils/vector-error.d.ts +69 -0
  726. package/dist/vector/utils/vector-error.js +116 -0
  727. package/dist/vector/utils/vector-error.js.map +1 -0
  728. package/dist/vector/vector-database.service.d.ts +474 -0
  729. package/dist/vector/vector-database.service.js +850 -0
  730. package/dist/vector/vector-database.service.js.map +1 -0
  731. package/dist/vector/vector.service.d.ts +283 -0
  732. package/dist/vector/vector.service.js +544 -0
  733. package/dist/vector/vector.service.js.map +1 -0
  734. package/dist/warehouse/executor/index.d.ts +5 -0
  735. package/dist/warehouse/executor/index.js +12 -0
  736. package/dist/warehouse/executor/index.js.map +1 -0
  737. package/dist/warehouse/executor/joins/index.d.ts +5 -0
  738. package/dist/warehouse/executor/joins/index.js +11 -0
  739. package/dist/warehouse/executor/joins/index.js.map +1 -0
  740. package/dist/warehouse/executor/joins/join-executor.d.ts +101 -0
  741. package/dist/warehouse/executor/joins/join-executor.js +493 -0
  742. package/dist/warehouse/executor/joins/join-executor.js.map +1 -0
  743. package/dist/warehouse/executor/joins/semantic-join.d.ts +64 -0
  744. package/dist/warehouse/executor/joins/semantic-join.js +241 -0
  745. package/dist/warehouse/executor/joins/semantic-join.js.map +1 -0
  746. package/dist/warehouse/executor/single-source-executor.d.ts +155 -0
  747. package/dist/warehouse/executor/single-source-executor.js +573 -0
  748. package/dist/warehouse/executor/single-source-executor.js.map +1 -0
  749. package/dist/warehouse/index.d.ts +79 -0
  750. package/dist/warehouse/index.js +111 -0
  751. package/dist/warehouse/index.js.map +1 -0
  752. package/dist/warehouse/parser/index.d.ts +4 -0
  753. package/dist/warehouse/parser/index.js +10 -0
  754. package/dist/warehouse/parser/index.js.map +1 -0
  755. package/dist/warehouse/parser/query-parser.d.ts +181 -0
  756. package/dist/warehouse/parser/query-parser.js +415 -0
  757. package/dist/warehouse/parser/query-parser.js.map +1 -0
  758. package/dist/warehouse/registry/data-source-registry.d.ts +207 -0
  759. package/dist/warehouse/registry/data-source-registry.js +396 -0
  760. package/dist/warehouse/registry/data-source-registry.js.map +1 -0
  761. package/dist/warehouse/registry/index.d.ts +4 -0
  762. package/dist/warehouse/registry/index.js +9 -0
  763. package/dist/warehouse/registry/index.js.map +1 -0
  764. package/dist/warehouse/transactions/index.d.ts +4 -0
  765. package/dist/warehouse/transactions/index.js +9 -0
  766. package/dist/warehouse/transactions/index.js.map +1 -0
  767. package/dist/warehouse/transactions/saga-orchestrator.d.ts +92 -0
  768. package/dist/warehouse/transactions/saga-orchestrator.js +383 -0
  769. package/dist/warehouse/transactions/saga-orchestrator.js.map +1 -0
  770. package/dist/warehouse/types/index.d.ts +9 -0
  771. package/dist/warehouse/types/index.js +33 -0
  772. package/dist/warehouse/types/index.js.map +1 -0
  773. package/dist/warehouse/types/join.interface.d.ts +225 -0
  774. package/dist/warehouse/types/join.interface.js +87 -0
  775. package/dist/warehouse/types/join.interface.js.map +1 -0
  776. package/dist/warehouse/types/query.interface.d.ts +232 -0
  777. package/dist/warehouse/types/query.interface.js +9 -0
  778. package/dist/warehouse/types/query.interface.js.map +1 -0
  779. package/dist/warehouse/types/transaction.interface.d.ts +236 -0
  780. package/dist/warehouse/types/transaction.interface.js +74 -0
  781. package/dist/warehouse/types/transaction.interface.js.map +1 -0
  782. package/dist/warehouse/types/where.interface.d.ts +208 -0
  783. package/dist/warehouse/types/where.interface.js +89 -0
  784. package/dist/warehouse/types/where.interface.js.map +1 -0
  785. package/dist/warehouse/warehouse.service.d.ts +200 -0
  786. package/dist/warehouse/warehouse.service.js +470 -0
  787. package/dist/warehouse/warehouse.service.js.map +1 -0
  788. package/dist/workflows/index.d.ts +30 -0
  789. package/dist/workflows/index.js +64 -0
  790. package/dist/workflows/index.js.map +1 -0
  791. package/dist/workflows/types/index.d.ts +6 -0
  792. package/dist/workflows/types/index.js +23 -0
  793. package/dist/workflows/types/index.js.map +1 -0
  794. package/dist/workflows/types/workflows.types.d.ts +1037 -0
  795. package/dist/workflows/types/workflows.types.js +13 -0
  796. package/dist/workflows/types/workflows.types.js.map +1 -0
  797. package/dist/workflows/workflow-builder.d.ts +70 -0
  798. package/dist/workflows/workflow-builder.js +338 -0
  799. package/dist/workflows/workflow-builder.js.map +1 -0
  800. package/dist/workflows/workflow-executor.d.ts +208 -0
  801. package/dist/workflows/workflow-executor.js +1194 -0
  802. package/dist/workflows/workflow-executor.js.map +1 -0
  803. package/dist/workflows/workflows.service.d.ts +410 -0
  804. package/dist/workflows/workflows.service.js +1724 -0
  805. package/dist/workflows/workflows.service.js.map +1 -0
  806. package/package.json +65 -12
  807. package/dist/actions/actions.repo.js +0 -13
  808. package/dist/actions/actions.repo.js.map +0 -1
  809. package/dist/actions/actions.service.js +0 -24
  810. package/dist/actions/actions.service.js.map +0 -1
  811. package/dist/actions/utils/actions.util.read.js +0 -427
  812. package/dist/actions/utils/actions.util.read.js.map +0 -1
  813. package/dist/api/services/integrationsApi.service.d.ts +0 -18
  814. package/dist/api/services/integrationsApi.service.js +0 -80
  815. package/dist/api/services/integrationsApi.service.js.map +0 -1
  816. package/dist/appBuilder/services/app.service.d.ts +0 -111
  817. package/dist/appBuilder/services/app.service.js +0 -737
  818. package/dist/appBuilder/services/app.service.js.map +0 -1
  819. package/dist/appBuilder/services/appBuilder.service.d.ts +0 -111
  820. package/dist/appBuilder/services/appBuilder.service.js +0 -662
  821. package/dist/appBuilder/services/appBuilder.service.js.map +0 -1
  822. package/dist/appBuilder/utils/objects.utils.d.ts +0 -3
  823. package/dist/appBuilder/utils/objects.utils.js +0 -9
  824. package/dist/appBuilder/utils/objects.utils.js.map +0 -1
  825. package/dist/appBuilder/utils/string.utils.d.ts +0 -2
  826. package/dist/appBuilder/utils/string.utils.js +0 -57
  827. package/dist/appBuilder/utils/string.utils.js.map +0 -1
  828. package/dist/appBuilder/validators/index.d.ts +0 -19
  829. package/dist/appBuilder/validators/index.js +0 -40
  830. package/dist/appBuilder/validators/index.js.map +0 -1
  831. package/dist/appBuilder/validators/joi-validators/create.app.validator.js +0 -10
  832. package/dist/appBuilder/validators/joi-validators/create.app.validator.js.map +0 -1
  833. package/dist/appBuilder/validators/joi-validators/create.appAction.validator.d.ts +0 -4
  834. package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js +0 -20
  835. package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js.map +0 -1
  836. package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.d.ts +0 -7
  837. package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js +0 -44
  838. package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js.map +0 -1
  839. package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.d.ts +0 -3
  840. package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js +0 -31
  841. package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js.map +0 -1
  842. package/dist/appBuilder/validators/joi-validators/create.appBody.validators.d.ts +0 -4
  843. package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js +0 -11
  844. package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js.map +0 -1
  845. package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.d.ts +0 -4
  846. package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js +0 -12
  847. package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js.map +0 -1
  848. package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.d.ts +0 -4
  849. package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js +0 -17
  850. package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js.map +0 -1
  851. package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
  852. package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js +0 -30
  853. package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js.map +0 -1
  854. package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.d.ts +0 -4
  855. package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js +0 -14
  856. package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js.map +0 -1
  857. package/dist/appBuilder/validators/joi-validators/sample.validator.d.ts +0 -5
  858. package/dist/appBuilder/validators/joi-validators/sample.validator.js +0 -26
  859. package/dist/appBuilder/validators/joi-validators/sample.validator.js.map +0 -1
  860. package/dist/appBuilder/validators/joi-validators/update.app.validator.d.ts +0 -4
  861. package/dist/appBuilder/validators/joi-validators/update.app.validator.js +0 -34
  862. package/dist/appBuilder/validators/joi-validators/update.app.validator.js.map +0 -1
  863. package/dist/appBuilder/validators/joi-validators/update.appAction.validator.d.ts +0 -4
  864. package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js +0 -23
  865. package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js.map +0 -1
  866. package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.d.ts +0 -3
  867. package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js +0 -21
  868. package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js.map +0 -1
  869. package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.d.ts +0 -4
  870. package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js +0 -19
  871. package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js.map +0 -1
  872. package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.d.ts +0 -4
  873. package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js +0 -12
  874. package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js.map +0 -1
  875. package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.d.ts +0 -4
  876. package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js +0 -17
  877. package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js.map +0 -1
  878. package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
  879. package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js +0 -16
  880. package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js.map +0 -1
  881. package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.d.ts +0 -4
  882. package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js +0 -14
  883. package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js.map +0 -1
  884. package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js +0 -27
  885. package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js.map +0 -1
  886. package/dist/apps/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
  887. package/dist/apps/validators/joi-validators/create.appEvent.validator.js +0 -30
  888. package/dist/apps/validators/joi-validators/create.appEvent.validator.js.map +0 -1
  889. package/dist/apps/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
  890. package/dist/apps/validators/joi-validators/update.appEvent.validator.js +0 -16
  891. package/dist/apps/validators/joi-validators/update.appEvent.validator.js.map +0 -1
  892. package/dist/clients/integrations.client.d.ts +0 -2
  893. package/dist/clients/integrations.client.js +0 -26
  894. package/dist/clients/integrations.client.js.map +0 -1
  895. package/dist/integrationsBuilder/services/integration.service.d.ts +0 -138
  896. package/dist/integrationsBuilder/services/integration.service.js +0 -1148
  897. package/dist/integrationsBuilder/services/integration.service.js.map +0 -1
  898. package/dist/integrationsBuilder/services/integrationBuilder.service.d.ts +0 -130
  899. package/dist/integrationsBuilder/services/integrationBuilder.service.js +0 -1017
  900. package/dist/integrationsBuilder/services/integrationBuilder.service.js.map +0 -1
  901. package/dist/integrationsBuilder/utils/objects.utils.d.ts +0 -2
  902. package/dist/integrationsBuilder/utils/objects.utils.js +0 -48
  903. package/dist/integrationsBuilder/utils/objects.utils.js.map +0 -1
  904. package/dist/integrationsBuilder/utils/string.utils.d.ts +0 -1
  905. package/dist/integrationsBuilder/utils/string.utils.js +0 -9
  906. package/dist/integrationsBuilder/utils/string.utils.js.map +0 -1
  907. package/dist/integrationsBuilder/validators/index.d.ts +0 -18
  908. package/dist/integrationsBuilder/validators/index.js +0 -38
  909. package/dist/integrationsBuilder/validators/index.js.map +0 -1
  910. package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.d.ts +0 -3
  911. package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js +0 -10
  912. package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js.map +0 -1
  913. package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.d.ts +0 -4
  914. package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js +0 -26
  915. package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js.map +0 -1
  916. package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.d.ts +0 -3
  917. package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js +0 -8
  918. package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js.map +0 -1
  919. package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.d.ts +0 -3
  920. package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js +0 -8
  921. package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js.map +0 -1
  922. package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.d.ts +0 -3
  923. package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js +0 -10
  924. package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js.map +0 -1
  925. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.d.ts +0 -3
  926. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js +0 -60
  927. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js.map +0 -1
  928. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.d.ts +0 -3
  929. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js +0 -8
  930. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js.map +0 -1
  931. package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.d.ts +0 -3
  932. package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js +0 -8
  933. package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js.map +0 -1
  934. package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.d.ts +0 -3
  935. package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js +0 -8
  936. package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js.map +0 -1
  937. package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.d.ts +0 -3
  938. package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js +0 -9
  939. package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js.map +0 -1
  940. package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.d.ts +0 -3
  941. package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js +0 -8
  942. package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js.map +0 -1
  943. package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.d.ts +0 -3
  944. package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js +0 -8
  945. package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js.map +0 -1
  946. package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.d.ts +0 -3
  947. package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js +0 -8
  948. package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js.map +0 -1
  949. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.d.ts +0 -3
  950. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js +0 -8
  951. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js.map +0 -1
  952. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.d.ts +0 -3
  953. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js +0 -8
  954. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js.map +0 -1
  955. package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.d.ts +0 -3
  956. package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js +0 -8
  957. package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js.map +0 -1
  958. package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.d.ts +0 -3
  959. package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js +0 -8
  960. package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js.map +0 -1
  961. package/dist/postman.d.ts +0 -1
  962. package/dist/postman.js +0 -21674
  963. package/dist/postman.js.map +0 -1
  964. package/dist/processor/utils/mongo.util.js +0 -152
  965. package/dist/processor/utils/mongo.util.js.map +0 -1
  966. package/dist/processor/utils/postgres.util.d.ts +0 -14
  967. package/dist/processor/utils/postgres.util.js +0 -83
  968. package/dist/processor/utils/postgres.util.js.map +0 -1
  969. package/dist/products/validators/joi-validators/create.product.validator.d.ts +0 -3
  970. package/dist/products/validators/joi-validators/create.product.validator.js +0 -10
  971. package/dist/products/validators/joi-validators/create.product.validator.js.map +0 -1
  972. package/dist/test.appBuilder.js +0 -14
  973. package/dist/test.appBuilder.js.map +0 -1
  974. package/dist/test.import.js +0 -24
  975. package/dist/test.import.js.map +0 -1
  976. package/dist/test.imports.js +0 -28
  977. package/dist/test.imports.js.map +0 -1
  978. package/dist/test.integrationBuilder.js +0 -276
  979. package/dist/test.integrationBuilder.js.map +0 -1
  980. package/dist/test.processor.js +0 -23
  981. package/dist/test.processor.js.map +0 -1
  982. package/dist/test.utils.js +0 -25
  983. package/dist/test.utils.js.map +0 -1
  984. package/dist/types/integrationsBuilder.types.d.ts +0 -276
  985. package/dist/types/integrationsBuilder.types.js +0 -51
  986. package/dist/types/integrationsBuilder.types.js.map +0 -1
  987. /package/dist/{actions/actions.repo.d.ts → pricing/pricing.repo.d.ts} +0 -0
  988. /package/dist/{appBuilder/validators/joi-validators/create.app.validator.d.ts → products/validators/joi-validators/create.productGraph.validator.d.ts} +0 -0
  989. /package/dist/{appBuilder/validators/joi-validators/update.validation.entityData.validator.d.ts → products/validators/joi-validators/update.productGraph.validator.d.ts} +0 -0
  990. /package/dist/{test.appBuilder.d.ts → test/test.broker.kafka.d.ts} +0 -0
  991. /package/dist/{test.imports.d.ts → test/test.broker.nats.d.ts} +0 -0
  992. /package/dist/{test.integrationBuilder.d.ts → test/test.broker.pubsub.d.ts} +0 -0
  993. /package/dist/{test.processor.d.ts → test/test.broker.rabbitmq.d.ts} +0 -0
  994. /package/dist/{test.utils.d.ts → test/test.broker.redis.d.ts} +0 -0
  995. /package/dist/{actions/actions.service.d.ts → test/test.health.d.ts} +0 -0
  996. /package/dist/{actions/utils/actions.util.read.d.ts → test/test.notifiers.d.ts} +0 -0
  997. /package/dist/{processor/utils/mongo.util.d.ts → test/test.products.d.ts} +0 -0
  998. /package/dist/{test.import.d.ts → types/request-tracker.interface.d.ts} +0 -0
@@ -0,0 +1,1588 @@
1
+ "use strict";
2
+ /**
3
+ * ArangoDB Graph Database Adapter
4
+ *
5
+ * Implements the BaseGraphAdapter for ArangoDB.
6
+ * ArangoDB is a multi-model database that supports documents, graphs, and key-value.
7
+ * Uses AQL (ArangoDB Query Language) for graph operations.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
22
+ }) : function(o, v) {
23
+ o["default"] = v;
24
+ });
25
+ var __importStar = (this && this.__importStar) || (function () {
26
+ var ownKeys = function(o) {
27
+ ownKeys = Object.getOwnPropertyNames || function (o) {
28
+ var ar = [];
29
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
+ return ar;
31
+ };
32
+ return ownKeys(o);
33
+ };
34
+ return function (mod) {
35
+ if (mod && mod.__esModule) return mod;
36
+ var result = {};
37
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
+ __setModuleDefault(result, mod);
39
+ return result;
40
+ };
41
+ })();
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.ArangoDBAdapter = void 0;
44
+ const base_adapter_1 = require("./base.adapter");
45
+ const enums_1 = require("../types/enums");
46
+ const graph_error_1 = require("../utils/graph-error");
47
+ /**
48
+ * ArangoDB adapter using arangojs
49
+ */
50
+ class ArangoDBAdapter extends base_adapter_1.BaseGraphAdapter {
51
+ constructor() {
52
+ super(...arguments);
53
+ this.graphType = enums_1.GraphType.ARANGODB;
54
+ this.supportedFeatures = new Set([
55
+ enums_1.GraphFeature.TRANSACTIONS,
56
+ enums_1.GraphFeature.SCHEMA_INDEXES,
57
+ enums_1.GraphFeature.FULL_TEXT_SEARCH,
58
+ enums_1.GraphFeature.MULTI_TENANCY,
59
+ ]);
60
+ this.db = null;
61
+ this.graph = null;
62
+ this.graphName = '';
63
+ this.vertexCollections = [];
64
+ this.edgeCollections = [];
65
+ }
66
+ /**
67
+ * Connect to ArangoDB
68
+ */
69
+ async connect(options) {
70
+ var _a;
71
+ try {
72
+ // Store connection options for reconnection
73
+ this.connectionOptions = options;
74
+ // Dynamically import arangojs
75
+ const arangojs = await Promise.resolve().then(() => __importStar(require('arangojs')));
76
+ const { Database } = arangojs;
77
+ this.db = new Database({
78
+ url: options.connectionUrl,
79
+ databaseName: options.database || '_system',
80
+ });
81
+ // If graph name is provided, get the graph
82
+ if (options.graphName) {
83
+ this.graphName = options.graphName;
84
+ this.graph = this.db.graph(options.graphName);
85
+ // Get graph info
86
+ const graphInfo = await this.graph.get();
87
+ this.vertexCollections = graphInfo.orphanCollections || [];
88
+ this.edgeCollections = ((_a = graphInfo.edgeDefinitions) === null || _a === void 0 ? void 0 : _a.map((ed) => ed.collection)) || [];
89
+ // Add vertex collections from edge definitions
90
+ for (const ed of graphInfo.edgeDefinitions || []) {
91
+ this.vertexCollections.push(...ed.from, ...ed.to);
92
+ }
93
+ this.vertexCollections = [...new Set(this.vertexCollections)];
94
+ }
95
+ this.client = this.db;
96
+ this.connected = true;
97
+ return {
98
+ connected: true,
99
+ type: this.graphType,
100
+ version: await this.getVersion(),
101
+ };
102
+ }
103
+ catch (error) {
104
+ this.connected = false;
105
+ throw graph_error_1.GraphError.connectionError(`Failed to connect to ArangoDB: ${error.message}`);
106
+ }
107
+ }
108
+ async getVersion() {
109
+ try {
110
+ const info = await this.db.version();
111
+ return info.version;
112
+ }
113
+ catch (_a) {
114
+ return 'unknown';
115
+ }
116
+ }
117
+ /**
118
+ * Disconnect from ArangoDB
119
+ */
120
+ async disconnect() {
121
+ if (this.db) {
122
+ this.db = null;
123
+ this.graph = null;
124
+ this.client = null;
125
+ this.connected = false;
126
+ }
127
+ }
128
+ /**
129
+ * Test ArangoDB connection
130
+ */
131
+ async testConnection(options) {
132
+ try {
133
+ await this.connect(options);
134
+ const startTime = Date.now();
135
+ const version = await this.getVersion();
136
+ const latency = Date.now() - startTime;
137
+ await this.disconnect();
138
+ return {
139
+ connected: true,
140
+ type: this.graphType,
141
+ version,
142
+ latency,
143
+ features: ['aql', 'multi-model', 'transactions'],
144
+ };
145
+ }
146
+ catch (error) {
147
+ return {
148
+ connected: false,
149
+ type: this.graphType,
150
+ error: error.message,
151
+ };
152
+ }
153
+ }
154
+ // ==================== NODE OPERATIONS ====================
155
+ async createNode(options, transaction) {
156
+ this.ensureConnected();
157
+ return this.executeWithRetry(async () => {
158
+ try {
159
+ const collectionName = options.labels[0];
160
+ const collection = this.db.collection(collectionName);
161
+ const doc = Object.assign(Object.assign({}, options.properties), { _labels: options.labels });
162
+ const result = await collection.save(doc, { returnNew: true });
163
+ const node = {
164
+ id: result._key,
165
+ labels: options.labels,
166
+ properties: result.new,
167
+ elementId: result._id,
168
+ };
169
+ return { node, created: true };
170
+ }
171
+ catch (error) {
172
+ throw graph_error_1.GraphError.queryError(`Failed to create node: ${error.message}`);
173
+ }
174
+ });
175
+ }
176
+ async findNodes(options, transaction) {
177
+ this.ensureConnected();
178
+ return this.executeWithRetry(async () => {
179
+ var _a, _b, _c, _d, _e;
180
+ try {
181
+ let aql = 'FOR doc IN @@collection';
182
+ const bindVars = {};
183
+ const collectionName = ((_a = options.labels) === null || _a === void 0 ? void 0 : _a[0]) || this.vertexCollections[0];
184
+ bindVars['@collection'] = collectionName;
185
+ if (options.where) {
186
+ const { filterStr, filterVars } = this.buildArangoWhereClause(options.where, 'doc');
187
+ if (filterStr) {
188
+ aql += ` FILTER ${filterStr}`;
189
+ Object.assign(bindVars, filterVars);
190
+ }
191
+ }
192
+ if ((_b = options.orderBy) === null || _b === void 0 ? void 0 : _b.length) {
193
+ const sortParts = options.orderBy.map((o) => `doc.${o.property} ${o.direction || 'ASC'}`);
194
+ aql += ` SORT ${sortParts.join(', ')}`;
195
+ }
196
+ const skipValue = (_d = (_c = options.skip) !== null && _c !== void 0 ? _c : options.offset) !== null && _d !== void 0 ? _d : 0;
197
+ const limitValue = (_e = options.limit) !== null && _e !== void 0 ? _e : 100;
198
+ aql += ` LIMIT ${skipValue}, ${limitValue}`;
199
+ aql += ' RETURN doc';
200
+ const cursor = await this.db.query(aql, bindVars);
201
+ const docs = await cursor.all();
202
+ const nodes = docs.map((doc) => ({
203
+ id: doc._key,
204
+ labels: doc._labels || [collectionName],
205
+ properties: this.cleanArangoProps(doc),
206
+ elementId: doc._id,
207
+ }));
208
+ const countAql = `RETURN LENGTH(FOR doc IN @@collection ${options.where ? `FILTER ${this.buildArangoWhereClause(options.where, 'doc').filterStr}` : ''} RETURN 1)`;
209
+ const countCursor = await this.db.query(countAql, { '@collection': collectionName });
210
+ const [total] = await countCursor.all();
211
+ return { nodes, total };
212
+ }
213
+ catch (error) {
214
+ throw graph_error_1.GraphError.queryError(`Failed to find nodes: ${error.message}`);
215
+ }
216
+ });
217
+ }
218
+ async findNodeById(id, transaction) {
219
+ this.ensureConnected();
220
+ return this.executeWithRetry(async () => {
221
+ try {
222
+ const docId = String(id).includes('/') ? id : null;
223
+ if (!docId) {
224
+ for (const collName of this.vertexCollections) {
225
+ try {
226
+ const collection = this.db.collection(collName);
227
+ const doc = await collection.document(id);
228
+ return {
229
+ id: doc._key,
230
+ labels: doc._labels || [collName],
231
+ properties: this.cleanArangoProps(doc),
232
+ elementId: doc._id,
233
+ };
234
+ }
235
+ catch (_a) {
236
+ continue;
237
+ }
238
+ }
239
+ return null;
240
+ }
241
+ const [collName] = String(docId).split('/');
242
+ const collection = this.db.collection(collName);
243
+ const doc = await collection.document(docId);
244
+ return {
245
+ id: doc._key,
246
+ labels: doc._labels || [collName],
247
+ properties: this.cleanArangoProps(doc),
248
+ elementId: doc._id,
249
+ };
250
+ }
251
+ catch (error) {
252
+ if (error.code === 404) {
253
+ return null;
254
+ }
255
+ throw graph_error_1.GraphError.queryError(`Failed to find node by ID: ${error.message}`);
256
+ }
257
+ });
258
+ }
259
+ async updateNode(options, transaction) {
260
+ this.ensureConnected();
261
+ return this.executeWithRetry(async () => {
262
+ try {
263
+ const docId = String(options.id);
264
+ const [collName] = docId.includes('/') ? docId.split('/') : [this.vertexCollections[0]];
265
+ const collection = this.db.collection(collName);
266
+ const key = docId.includes('/') ? docId.split('/')[1] : docId;
267
+ let updateData = {};
268
+ if (options.properties) {
269
+ if ('$SET' in options.properties) {
270
+ updateData = Object.assign(Object.assign({}, updateData), options.properties.$SET);
271
+ }
272
+ if ('$UNSET' in options.properties) {
273
+ for (const prop of options.properties.$UNSET || []) {
274
+ updateData[prop] = null;
275
+ }
276
+ }
277
+ if ('$INCREMENT' in options.properties) {
278
+ for (const [prop, value] of Object.entries(options.properties.$INCREMENT || {})) {
279
+ const current = await collection.document(key);
280
+ updateData[prop] = (current[prop] || 0) + value;
281
+ }
282
+ }
283
+ if ('$APPEND' in options.properties) {
284
+ for (const [prop, value] of Object.entries(options.properties.$APPEND || {})) {
285
+ const current = await collection.document(key);
286
+ updateData[prop] = [...(current[prop] || []), value];
287
+ }
288
+ }
289
+ }
290
+ const result = await collection.update(key, updateData, { returnNew: true });
291
+ const node = {
292
+ id: result._key,
293
+ labels: result.new._labels || [collName],
294
+ properties: this.cleanArangoProps(result.new),
295
+ elementId: result._id,
296
+ };
297
+ return { node, updated: true };
298
+ }
299
+ catch (error) {
300
+ throw graph_error_1.GraphError.queryError(`Failed to update node: ${error.message}`);
301
+ }
302
+ });
303
+ }
304
+ async deleteNode(options, transaction) {
305
+ this.ensureConnected();
306
+ return this.executeWithRetry(async () => {
307
+ try {
308
+ const docId = String(options.id);
309
+ const [collName] = docId.includes('/') ? docId.split('/') : [this.vertexCollections[0]];
310
+ const collection = this.db.collection(collName);
311
+ const key = docId.includes('/') ? docId.split('/')[1] : docId;
312
+ if (options.detach) {
313
+ const fullId = docId.includes('/') ? docId : `${collName}/${key}`;
314
+ for (const edgeCollName of this.edgeCollections) {
315
+ await this.db.query(`FOR e IN @@collection FILTER e._from == @id OR e._to == @id REMOVE e IN @@collection`, { '@collection': edgeCollName, id: fullId });
316
+ }
317
+ }
318
+ await collection.remove(key);
319
+ return { deleted: true, id: options.id };
320
+ }
321
+ catch (error) {
322
+ throw graph_error_1.GraphError.queryError(`Failed to delete node: ${error.message}`);
323
+ }
324
+ });
325
+ }
326
+ async mergeNode(options, transaction) {
327
+ this.ensureConnected();
328
+ return this.executeWithRetry(async () => {
329
+ try {
330
+ const collectionName = options.labels[0];
331
+ const collection = this.db.collection(collectionName);
332
+ const { filterStr, filterVars } = this.buildArangoWhereClause(options.matchProperties, 'doc');
333
+ const findAql = `FOR doc IN @@collection FILTER ${filterStr} LIMIT 1 RETURN doc`;
334
+ const cursor = await this.db.query(findAql, Object.assign({ '@collection': collectionName }, filterVars));
335
+ const existing = await cursor.all();
336
+ if (existing.length > 0) {
337
+ const doc = existing[0];
338
+ const updateData = options.onMatch || {};
339
+ const result = await collection.update(doc._key, updateData, { returnNew: true });
340
+ return {
341
+ node: {
342
+ id: result._key,
343
+ labels: options.labels,
344
+ properties: this.cleanArangoProps(result.new),
345
+ elementId: result._id,
346
+ },
347
+ created: false,
348
+ merged: true,
349
+ };
350
+ }
351
+ else {
352
+ const createData = Object.assign(Object.assign(Object.assign({}, options.matchProperties), (options.onCreate || {})), { _labels: options.labels });
353
+ const result = await collection.save(createData, { returnNew: true });
354
+ return {
355
+ node: {
356
+ id: result._key,
357
+ labels: options.labels,
358
+ properties: this.cleanArangoProps(result.new),
359
+ elementId: result._id,
360
+ },
361
+ created: true,
362
+ merged: true,
363
+ };
364
+ }
365
+ }
366
+ catch (error) {
367
+ throw graph_error_1.GraphError.queryError(`Failed to merge node: ${error.message}`);
368
+ }
369
+ });
370
+ }
371
+ // ==================== LABEL MANAGEMENT ====================
372
+ async addLabels(options, _transaction) {
373
+ this.ensureConnected();
374
+ return this.executeWithRetry(async () => {
375
+ try {
376
+ // In ArangoDB, we store labels in a _labels array property
377
+ // First, find the document
378
+ const docId = String(options.id);
379
+ const isFullId = docId.includes('/');
380
+ let doc;
381
+ if (isFullId) {
382
+ const [collectionName, key] = docId.split('/');
383
+ const collection = this.db.collection(collectionName);
384
+ doc = await collection.document(key);
385
+ }
386
+ else {
387
+ // Search across vertex collections
388
+ for (const collectionName of this.vertexCollections) {
389
+ try {
390
+ const collection = this.db.collection(collectionName);
391
+ doc = await collection.document(docId);
392
+ break;
393
+ }
394
+ catch (_a) {
395
+ continue;
396
+ }
397
+ }
398
+ }
399
+ if (!doc) {
400
+ throw graph_error_1.GraphError.notFoundError(`Node with ID ${options.id} not found`);
401
+ }
402
+ const existingLabels = doc._labels || [];
403
+ const newLabels = [...new Set([...existingLabels, ...options.labels])];
404
+ const [collectionName] = doc._id.split('/');
405
+ const collection = this.db.collection(collectionName);
406
+ const result = await collection.update(doc._key, { _labels: newLabels }, { returnNew: true });
407
+ return {
408
+ node: {
409
+ id: result._key,
410
+ labels: newLabels,
411
+ properties: this.cleanArangoProps(result.new),
412
+ elementId: result._id,
413
+ },
414
+ addedLabels: options.labels,
415
+ };
416
+ }
417
+ catch (error) {
418
+ if (error instanceof graph_error_1.GraphError)
419
+ throw error;
420
+ throw graph_error_1.GraphError.queryError(`Failed to add labels: ${error.message}`);
421
+ }
422
+ });
423
+ }
424
+ async removeLabels(options, _transaction) {
425
+ this.ensureConnected();
426
+ return this.executeWithRetry(async () => {
427
+ try {
428
+ const docId = String(options.id);
429
+ const isFullId = docId.includes('/');
430
+ let doc;
431
+ if (isFullId) {
432
+ const [collectionName, key] = docId.split('/');
433
+ const collection = this.db.collection(collectionName);
434
+ doc = await collection.document(key);
435
+ }
436
+ else {
437
+ for (const collectionName of this.vertexCollections) {
438
+ try {
439
+ const collection = this.db.collection(collectionName);
440
+ doc = await collection.document(docId);
441
+ break;
442
+ }
443
+ catch (_a) {
444
+ continue;
445
+ }
446
+ }
447
+ }
448
+ if (!doc) {
449
+ throw graph_error_1.GraphError.notFoundError(`Node with ID ${options.id} not found`);
450
+ }
451
+ const existingLabels = doc._labels || [];
452
+ const newLabels = existingLabels.filter(l => !options.labels.includes(l));
453
+ const [collectionName] = doc._id.split('/');
454
+ const collection = this.db.collection(collectionName);
455
+ const result = await collection.update(doc._key, { _labels: newLabels }, { returnNew: true });
456
+ return {
457
+ node: {
458
+ id: result._key,
459
+ labels: newLabels,
460
+ properties: this.cleanArangoProps(result.new),
461
+ elementId: result._id,
462
+ },
463
+ removedLabels: options.labels,
464
+ };
465
+ }
466
+ catch (error) {
467
+ if (error instanceof graph_error_1.GraphError)
468
+ throw error;
469
+ throw graph_error_1.GraphError.queryError(`Failed to remove labels: ${error.message}`);
470
+ }
471
+ });
472
+ }
473
+ async setLabels(options, _transaction) {
474
+ this.ensureConnected();
475
+ return this.executeWithRetry(async () => {
476
+ try {
477
+ const docId = String(options.id);
478
+ const isFullId = docId.includes('/');
479
+ let doc;
480
+ if (isFullId) {
481
+ const [collectionName, key] = docId.split('/');
482
+ const collection = this.db.collection(collectionName);
483
+ doc = await collection.document(key);
484
+ }
485
+ else {
486
+ for (const collectionName of this.vertexCollections) {
487
+ try {
488
+ const collection = this.db.collection(collectionName);
489
+ doc = await collection.document(docId);
490
+ break;
491
+ }
492
+ catch (_a) {
493
+ continue;
494
+ }
495
+ }
496
+ }
497
+ if (!doc) {
498
+ throw graph_error_1.GraphError.notFoundError(`Node with ID ${options.id} not found`);
499
+ }
500
+ const previousLabels = doc._labels || [];
501
+ const [collectionName] = doc._id.split('/');
502
+ const collection = this.db.collection(collectionName);
503
+ const result = await collection.update(doc._key, { _labels: options.labels }, { returnNew: true });
504
+ return {
505
+ node: {
506
+ id: result._key,
507
+ labels: options.labels,
508
+ properties: this.cleanArangoProps(result.new),
509
+ elementId: result._id,
510
+ },
511
+ previousLabels,
512
+ newLabels: options.labels,
513
+ };
514
+ }
515
+ catch (error) {
516
+ if (error instanceof graph_error_1.GraphError)
517
+ throw error;
518
+ throw graph_error_1.GraphError.queryError(`Failed to set labels: ${error.message}`);
519
+ }
520
+ });
521
+ }
522
+ // ==================== RELATIONSHIP OPERATIONS ====================
523
+ async createRelationship(options, transaction) {
524
+ this.ensureConnected();
525
+ return this.executeWithRetry(async () => {
526
+ try {
527
+ const edgeCollectionName = options.type;
528
+ const edgeCollection = this.db.collection(edgeCollectionName);
529
+ const fromId = String(options.startNodeId).includes('/')
530
+ ? options.startNodeId
531
+ : await this.resolveNodeId(options.startNodeId);
532
+ const toId = String(options.endNodeId).includes('/')
533
+ ? options.endNodeId
534
+ : await this.resolveNodeId(options.endNodeId);
535
+ const edgeDoc = Object.assign({ _from: fromId, _to: toId }, options.properties);
536
+ const result = await edgeCollection.save(edgeDoc, { returnNew: true });
537
+ const relationship = {
538
+ id: result._key,
539
+ type: options.type,
540
+ startNodeId: fromId,
541
+ endNodeId: toId,
542
+ properties: this.cleanArangoProps(result.new),
543
+ elementId: result._id,
544
+ };
545
+ return { relationship, created: true };
546
+ }
547
+ catch (error) {
548
+ throw graph_error_1.GraphError.queryError(`Failed to create relationship: ${error.message}`);
549
+ }
550
+ });
551
+ }
552
+ async findRelationships(options, transaction) {
553
+ this.ensureConnected();
554
+ return this.executeWithRetry(async () => {
555
+ var _a, _b, _c, _d;
556
+ try {
557
+ const edgeCollectionName = ((_a = options.types) === null || _a === void 0 ? void 0 : _a[0]) || (Array.isArray(options.type) ? options.type[0] : options.type) || this.edgeCollections[0];
558
+ let aql = 'FOR edge IN @@collection';
559
+ const bindVars = { '@collection': edgeCollectionName };
560
+ if (options.where) {
561
+ const { filterStr, filterVars } = this.buildArangoWhereClause(options.where, 'edge');
562
+ if (filterStr) {
563
+ aql += ` FILTER ${filterStr}`;
564
+ Object.assign(bindVars, filterVars);
565
+ }
566
+ }
567
+ const skipValue = (_c = (_b = options.skip) !== null && _b !== void 0 ? _b : options.offset) !== null && _c !== void 0 ? _c : 0;
568
+ const limitValue = (_d = options.limit) !== null && _d !== void 0 ? _d : 100;
569
+ aql += ` LIMIT ${skipValue}, ${limitValue}`;
570
+ aql += ' RETURN edge';
571
+ const cursor = await this.db.query(aql, bindVars);
572
+ const edges = await cursor.all();
573
+ const relationships = edges.map((edge) => ({
574
+ id: edge._key,
575
+ type: edgeCollectionName,
576
+ startNodeId: edge._from,
577
+ endNodeId: edge._to,
578
+ properties: this.cleanArangoProps(edge),
579
+ elementId: edge._id,
580
+ }));
581
+ return { relationships, total: relationships.length };
582
+ }
583
+ catch (error) {
584
+ throw graph_error_1.GraphError.queryError(`Failed to find relationships: ${error.message}`);
585
+ }
586
+ });
587
+ }
588
+ async findRelationshipById(id, transaction) {
589
+ this.ensureConnected();
590
+ return this.executeWithRetry(async () => {
591
+ try {
592
+ const docId = String(id);
593
+ if (!docId.includes('/')) {
594
+ for (const collName of this.edgeCollections) {
595
+ try {
596
+ const collection = this.db.collection(collName);
597
+ const edge = await collection.document(id);
598
+ return {
599
+ id: edge._key,
600
+ type: collName,
601
+ startNodeId: edge._from,
602
+ endNodeId: edge._to,
603
+ properties: this.cleanArangoProps(edge),
604
+ elementId: edge._id,
605
+ };
606
+ }
607
+ catch (_a) {
608
+ continue;
609
+ }
610
+ }
611
+ return null;
612
+ }
613
+ const [collName] = docId.split('/');
614
+ const collection = this.db.collection(collName);
615
+ const edge = await collection.document(docId);
616
+ return {
617
+ id: edge._key,
618
+ type: collName,
619
+ startNodeId: edge._from,
620
+ endNodeId: edge._to,
621
+ properties: this.cleanArangoProps(edge),
622
+ elementId: edge._id,
623
+ };
624
+ }
625
+ catch (error) {
626
+ if (error.code === 404) {
627
+ return null;
628
+ }
629
+ throw graph_error_1.GraphError.queryError(`Failed to find relationship by ID: ${error.message}`);
630
+ }
631
+ });
632
+ }
633
+ async updateRelationship(options, transaction) {
634
+ this.ensureConnected();
635
+ return this.executeWithRetry(async () => {
636
+ try {
637
+ const docId = String(options.id);
638
+ const [collName] = docId.includes('/') ? docId.split('/') : [this.edgeCollections[0]];
639
+ const collection = this.db.collection(collName);
640
+ const key = docId.includes('/') ? docId.split('/')[1] : docId;
641
+ let updateData = {};
642
+ if (options.properties) {
643
+ if ('$SET' in options.properties) {
644
+ updateData = Object.assign(Object.assign({}, updateData), options.properties.$SET);
645
+ }
646
+ }
647
+ const result = await collection.update(key, updateData, { returnNew: true });
648
+ const relationship = {
649
+ id: result._key,
650
+ type: collName,
651
+ startNodeId: result.new._from,
652
+ endNodeId: result.new._to,
653
+ properties: this.cleanArangoProps(result.new),
654
+ elementId: result._id,
655
+ };
656
+ return { relationship, updated: true };
657
+ }
658
+ catch (error) {
659
+ throw graph_error_1.GraphError.queryError(`Failed to update relationship: ${error.message}`);
660
+ }
661
+ });
662
+ }
663
+ async deleteRelationship(options, transaction) {
664
+ this.ensureConnected();
665
+ return this.executeWithRetry(async () => {
666
+ try {
667
+ const docId = String(options.id);
668
+ const [collName] = docId.includes('/') ? docId.split('/') : [this.edgeCollections[0]];
669
+ const collection = this.db.collection(collName);
670
+ const key = docId.includes('/') ? docId.split('/')[1] : docId;
671
+ await collection.remove(key);
672
+ return { deleted: true, id: options.id };
673
+ }
674
+ catch (error) {
675
+ throw graph_error_1.GraphError.queryError(`Failed to delete relationship: ${error.message}`);
676
+ }
677
+ });
678
+ }
679
+ async mergeRelationship(options, transaction) {
680
+ this.ensureConnected();
681
+ return this.executeWithRetry(async () => {
682
+ try {
683
+ const edgeCollectionName = options.type;
684
+ const fromId = String(options.startNodeId).includes('/')
685
+ ? options.startNodeId
686
+ : await this.resolveNodeId(options.startNodeId);
687
+ const toId = String(options.endNodeId).includes('/')
688
+ ? options.endNodeId
689
+ : await this.resolveNodeId(options.endNodeId);
690
+ let filterStr = 'edge._from == @from AND edge._to == @to';
691
+ const bindVars = {
692
+ '@collection': edgeCollectionName,
693
+ from: fromId,
694
+ to: toId,
695
+ };
696
+ if (options.matchProperties) {
697
+ const { filterStr: matchFilter, filterVars } = this.buildArangoWhereClause(options.matchProperties, 'edge');
698
+ if (matchFilter) {
699
+ filterStr += ` AND ${matchFilter}`;
700
+ Object.assign(bindVars, filterVars);
701
+ }
702
+ }
703
+ const findAql = `FOR edge IN @@collection FILTER ${filterStr} LIMIT 1 RETURN edge`;
704
+ const cursor = await this.db.query(findAql, bindVars);
705
+ const existing = await cursor.all();
706
+ if (existing.length > 0) {
707
+ const edge = existing[0];
708
+ const collection = this.db.collection(edgeCollectionName);
709
+ const updateData = options.onMatch || {};
710
+ const result = await collection.update(edge._key, updateData, { returnNew: true });
711
+ return {
712
+ relationship: {
713
+ id: result._key,
714
+ type: options.type,
715
+ startNodeId: result.new._from,
716
+ endNodeId: result.new._to,
717
+ properties: this.cleanArangoProps(result.new),
718
+ elementId: result._id,
719
+ },
720
+ created: false,
721
+ merged: true,
722
+ };
723
+ }
724
+ else {
725
+ const createProps = Object.assign(Object.assign({}, options.matchProperties), (options.onCreate || {}));
726
+ const result = await this.createRelationship({
727
+ type: options.type,
728
+ startNodeId: options.startNodeId,
729
+ endNodeId: options.endNodeId,
730
+ properties: createProps,
731
+ });
732
+ return { relationship: result.relationship, created: true, merged: true };
733
+ }
734
+ }
735
+ catch (error) {
736
+ throw graph_error_1.GraphError.queryError(`Failed to merge relationship: ${error.message}`);
737
+ }
738
+ });
739
+ }
740
+ // ==================== TRAVERSAL OPERATIONS ====================
741
+ async traverse(options, transaction) {
742
+ this.ensureConnected();
743
+ return this.executeWithRetry(async () => {
744
+ var _a;
745
+ try {
746
+ const startId = String(options.startNodeId).includes('/')
747
+ ? options.startNodeId
748
+ : await this.resolveNodeId(options.startNodeId);
749
+ const direction = this.mapDirection(options.direction);
750
+ const maxDepth = options.maxDepth || 3;
751
+ const minDepth = 1;
752
+ const edgeCollections = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.length)
753
+ ? options.relationshipTypes.join(', ')
754
+ : this.edgeCollections.join(', ');
755
+ const aql = `
756
+ FOR v, e, p IN ${minDepth}..${maxDepth} ${direction} @startVertex
757
+ ${edgeCollections}
758
+ OPTIONS { bfs: true, uniqueVertices: 'global' }
759
+ RETURN { vertex: v, edge: e, path: p }
760
+ `;
761
+ const cursor = await this.db.query(aql, { startVertex: startId });
762
+ const results = await cursor.all();
763
+ const nodesMap = new Map();
764
+ const relationshipsMap = new Map();
765
+ for (const result of results) {
766
+ if (result.vertex) {
767
+ const v = result.vertex;
768
+ nodesMap.set(v._id, {
769
+ id: v._key,
770
+ labels: v._labels || [v._id.split('/')[0]],
771
+ properties: this.cleanArangoProps(v),
772
+ elementId: v._id,
773
+ });
774
+ }
775
+ if (result.edge) {
776
+ const e = result.edge;
777
+ relationshipsMap.set(e._id, {
778
+ id: e._key,
779
+ type: e._id.split('/')[0],
780
+ startNodeId: e._from,
781
+ endNodeId: e._to,
782
+ properties: this.cleanArangoProps(e),
783
+ elementId: e._id,
784
+ });
785
+ }
786
+ }
787
+ return {
788
+ nodes: Array.from(nodesMap.values()),
789
+ relationships: Array.from(relationshipsMap.values()),
790
+ paths: [],
791
+ };
792
+ }
793
+ catch (error) {
794
+ throw graph_error_1.GraphError.queryError(`Failed to traverse: ${error.message}`);
795
+ }
796
+ });
797
+ }
798
+ async shortestPath(options, transaction) {
799
+ this.ensureConnected();
800
+ return this.executeWithRetry(async () => {
801
+ var _a;
802
+ try {
803
+ const startId = String(options.startNodeId).includes('/')
804
+ ? options.startNodeId
805
+ : await this.resolveNodeId(options.startNodeId);
806
+ const endId = String(options.endNodeId).includes('/')
807
+ ? options.endNodeId
808
+ : await this.resolveNodeId(options.endNodeId);
809
+ const edgeCollections = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.length)
810
+ ? options.relationshipTypes.join(', ')
811
+ : this.edgeCollections.join(', ');
812
+ let aql;
813
+ if (options.weightProperty) {
814
+ aql = `
815
+ FOR v, e IN OUTBOUND SHORTEST_PATH @start TO @end
816
+ ${edgeCollections}
817
+ OPTIONS { weightAttribute: @weight }
818
+ RETURN { vertex: v, edge: e }
819
+ `;
820
+ }
821
+ else {
822
+ aql = `
823
+ FOR v, e IN OUTBOUND SHORTEST_PATH @start TO @end
824
+ ${edgeCollections}
825
+ RETURN { vertex: v, edge: e }
826
+ `;
827
+ }
828
+ const cursor = await this.db.query(aql, {
829
+ start: startId,
830
+ end: endId,
831
+ weight: options.weightProperty,
832
+ });
833
+ const results = await cursor.all();
834
+ if (results.length === 0) {
835
+ return { path: null, length: -1, found: false };
836
+ }
837
+ const nodes = [];
838
+ const relationships = [];
839
+ for (const result of results) {
840
+ if (result.vertex) {
841
+ nodes.push({
842
+ id: result.vertex._key,
843
+ labels: result.vertex._labels || [result.vertex._id.split('/')[0]],
844
+ properties: this.cleanArangoProps(result.vertex),
845
+ elementId: result.vertex._id,
846
+ });
847
+ }
848
+ if (result.edge) {
849
+ relationships.push({
850
+ id: result.edge._key,
851
+ type: result.edge._id.split('/')[0],
852
+ startNodeId: result.edge._from,
853
+ endNodeId: result.edge._to,
854
+ properties: this.cleanArangoProps(result.edge),
855
+ elementId: result.edge._id,
856
+ });
857
+ }
858
+ }
859
+ return {
860
+ path: {
861
+ nodes,
862
+ relationships,
863
+ length: relationships.length,
864
+ },
865
+ length: relationships.length,
866
+ found: true,
867
+ };
868
+ }
869
+ catch (error) {
870
+ throw graph_error_1.GraphError.queryError(`Failed to find shortest path: ${error.message}`);
871
+ }
872
+ });
873
+ }
874
+ async allPaths(options, transaction) {
875
+ this.ensureConnected();
876
+ return this.executeWithRetry(async () => {
877
+ var _a;
878
+ try {
879
+ const startId = String(options.startNodeId).includes('/')
880
+ ? options.startNodeId
881
+ : await this.resolveNodeId(options.startNodeId);
882
+ const endId = String(options.endNodeId).includes('/')
883
+ ? options.endNodeId
884
+ : await this.resolveNodeId(options.endNodeId);
885
+ const maxDepth = options.maxDepth || 5;
886
+ const maxPaths = options.maxPaths || options.limit || 10;
887
+ const edgeCollections = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.length)
888
+ ? options.relationshipTypes.join(', ')
889
+ : this.edgeCollections.join(', ');
890
+ const aql = `
891
+ FOR p IN 1..@maxDepth OUTBOUND @start
892
+ ${edgeCollections}
893
+ PRUNE p.vertices[-1]._id == @end
894
+ OPTIONS { bfs: false }
895
+ FILTER p.vertices[-1]._id == @end
896
+ LIMIT @maxPaths
897
+ RETURN p
898
+ `;
899
+ const cursor = await this.db.query(aql, {
900
+ start: startId,
901
+ end: endId,
902
+ maxDepth,
903
+ maxPaths,
904
+ });
905
+ const pathResults = await cursor.all();
906
+ const paths = pathResults.map((p) => {
907
+ const nodes = p.vertices.map((v) => ({
908
+ id: v._key,
909
+ labels: v._labels || [v._id.split('/')[0]],
910
+ properties: this.cleanArangoProps(v),
911
+ elementId: v._id,
912
+ }));
913
+ const relationships = p.edges.map((e) => ({
914
+ id: e._key,
915
+ type: e._id.split('/')[0],
916
+ startNodeId: e._from,
917
+ endNodeId: e._to,
918
+ properties: this.cleanArangoProps(e),
919
+ elementId: e._id,
920
+ }));
921
+ return { nodes, relationships, length: relationships.length };
922
+ });
923
+ return { paths, total: paths.length };
924
+ }
925
+ catch (error) {
926
+ throw graph_error_1.GraphError.queryError(`Failed to find all paths: ${error.message}`);
927
+ }
928
+ });
929
+ }
930
+ async getNeighborhood(options, transaction) {
931
+ this.ensureConnected();
932
+ return this.executeWithRetry(async () => {
933
+ var _a;
934
+ try {
935
+ const nodeId = String(options.nodeId).includes('/')
936
+ ? options.nodeId
937
+ : await this.resolveNodeId(options.nodeId);
938
+ const direction = this.mapDirection(options.direction);
939
+ const depth = options.depth || 1;
940
+ const edgeCollections = ((_a = options.relationshipTypes) === null || _a === void 0 ? void 0 : _a.length)
941
+ ? options.relationshipTypes.join(', ')
942
+ : this.edgeCollections.join(', ');
943
+ let aql = `
944
+ FOR v, e IN 1..@depth ${direction} @start
945
+ ${edgeCollections}
946
+ OPTIONS { uniqueVertices: 'global' }
947
+ `;
948
+ if (options.limit) {
949
+ aql += ` LIMIT @limit`;
950
+ }
951
+ aql += ` RETURN { vertex: v, edge: e }`;
952
+ const cursor = await this.db.query(aql, {
953
+ start: nodeId,
954
+ depth,
955
+ limit: options.limit,
956
+ });
957
+ const results = await cursor.all();
958
+ const nodesMap = new Map();
959
+ const relationshipsMap = new Map();
960
+ for (const result of results) {
961
+ if (result.vertex) {
962
+ nodesMap.set(result.vertex._id, {
963
+ id: result.vertex._key,
964
+ labels: result.vertex._labels || [result.vertex._id.split('/')[0]],
965
+ properties: this.cleanArangoProps(result.vertex),
966
+ elementId: result.vertex._id,
967
+ });
968
+ }
969
+ if (result.edge) {
970
+ relationshipsMap.set(result.edge._id, {
971
+ id: result.edge._key,
972
+ type: result.edge._id.split('/')[0],
973
+ startNodeId: result.edge._from,
974
+ endNodeId: result.edge._to,
975
+ properties: this.cleanArangoProps(result.edge),
976
+ elementId: result.edge._id,
977
+ });
978
+ }
979
+ }
980
+ return {
981
+ nodes: Array.from(nodesMap.values()),
982
+ relationships: Array.from(relationshipsMap.values()),
983
+ depth,
984
+ };
985
+ }
986
+ catch (error) {
987
+ throw graph_error_1.GraphError.queryError(`Failed to get neighborhood: ${error.message}`);
988
+ }
989
+ });
990
+ }
991
+ async findConnectedComponents(options, transaction) {
992
+ throw graph_error_1.GraphError.unsupportedOperationError('Connected components', 'ArangoDB (requires Pregel or SmartGraphs)');
993
+ }
994
+ // ==================== AGGREGATION ====================
995
+ async countNodes(labels, where, transaction) {
996
+ this.ensureConnected();
997
+ return this.executeWithRetry(async () => {
998
+ try {
999
+ const collectionName = (labels === null || labels === void 0 ? void 0 : labels[0]) || this.vertexCollections[0];
1000
+ let aql = 'RETURN LENGTH(FOR doc IN @@collection';
1001
+ const bindVars = { '@collection': collectionName };
1002
+ if (where) {
1003
+ const { filterStr, filterVars } = this.buildArangoWhereClause(where, 'doc');
1004
+ if (filterStr) {
1005
+ aql += ` FILTER ${filterStr}`;
1006
+ Object.assign(bindVars, filterVars);
1007
+ }
1008
+ }
1009
+ aql += ' RETURN 1)';
1010
+ const cursor = await this.db.query(aql, bindVars);
1011
+ const [count] = await cursor.all();
1012
+ return { count };
1013
+ }
1014
+ catch (error) {
1015
+ throw graph_error_1.GraphError.queryError(`Failed to count nodes: ${error.message}`);
1016
+ }
1017
+ });
1018
+ }
1019
+ async countRelationships(types, where, transaction) {
1020
+ this.ensureConnected();
1021
+ return this.executeWithRetry(async () => {
1022
+ try {
1023
+ const collectionName = (types === null || types === void 0 ? void 0 : types[0]) || this.edgeCollections[0];
1024
+ let aql = 'RETURN LENGTH(FOR edge IN @@collection';
1025
+ const bindVars = { '@collection': collectionName };
1026
+ if (where) {
1027
+ const { filterStr, filterVars } = this.buildArangoWhereClause(where, 'edge');
1028
+ if (filterStr) {
1029
+ aql += ` FILTER ${filterStr}`;
1030
+ Object.assign(bindVars, filterVars);
1031
+ }
1032
+ }
1033
+ aql += ' RETURN 1)';
1034
+ const cursor = await this.db.query(aql, bindVars);
1035
+ const [count] = await cursor.all();
1036
+ return { count };
1037
+ }
1038
+ catch (error) {
1039
+ throw graph_error_1.GraphError.queryError(`Failed to count relationships: ${error.message}`);
1040
+ }
1041
+ });
1042
+ }
1043
+ async getStatistics(transaction) {
1044
+ this.ensureConnected();
1045
+ return this.executeWithRetry(async () => {
1046
+ try {
1047
+ let nodeCount = 0;
1048
+ let relationshipCount = 0;
1049
+ const nodesByLabel = {};
1050
+ const relationshipsByType = {};
1051
+ for (const collName of this.vertexCollections) {
1052
+ const cursor = await this.db.query('RETURN LENGTH(FOR doc IN @@collection RETURN 1)', { '@collection': collName });
1053
+ const [count] = await cursor.all();
1054
+ nodesByLabel[collName] = count;
1055
+ nodeCount += count;
1056
+ }
1057
+ for (const collName of this.edgeCollections) {
1058
+ const cursor = await this.db.query('RETURN LENGTH(FOR edge IN @@collection RETURN 1)', { '@collection': collName });
1059
+ const [count] = await cursor.all();
1060
+ relationshipsByType[collName] = count;
1061
+ relationshipCount += count;
1062
+ }
1063
+ return {
1064
+ nodeCount,
1065
+ relationshipCount,
1066
+ nodesByLabel,
1067
+ relationshipsByType,
1068
+ };
1069
+ }
1070
+ catch (error) {
1071
+ throw graph_error_1.GraphError.queryError(`Failed to get statistics: ${error.message}`);
1072
+ }
1073
+ });
1074
+ }
1075
+ // ==================== SEARCH ====================
1076
+ async fullTextSearch(options, transaction) {
1077
+ this.ensureConnected();
1078
+ return this.executeWithRetry(async () => {
1079
+ try {
1080
+ const aql = `
1081
+ FOR doc IN ${options.indexName}
1082
+ SEARCH ANALYZER(doc.content IN TOKENS(@query, 'text_en'), 'text_en')
1083
+ SORT BM25(doc) DESC
1084
+ LIMIT @limit
1085
+ RETURN doc
1086
+ `;
1087
+ const cursor = await this.db.query(aql, {
1088
+ query: options.query,
1089
+ limit: options.limit || 10,
1090
+ });
1091
+ const results = await cursor.all();
1092
+ return {
1093
+ nodes: results.map((doc) => ({
1094
+ id: doc._key,
1095
+ labels: doc._labels || [doc._id.split('/')[0]],
1096
+ properties: this.cleanArangoProps(doc),
1097
+ elementId: doc._id,
1098
+ })),
1099
+ };
1100
+ }
1101
+ catch (error) {
1102
+ throw graph_error_1.GraphError.queryError(`Failed to perform full-text search: ${error.message}`);
1103
+ }
1104
+ });
1105
+ }
1106
+ async vectorSearch(options, transaction) {
1107
+ throw graph_error_1.GraphError.unsupportedOperationError('Vector search', 'ArangoDB');
1108
+ }
1109
+ // ==================== RAW QUERY ====================
1110
+ async query(options, transaction) {
1111
+ this.ensureConnected();
1112
+ return this.executeWithRetry(async () => {
1113
+ try {
1114
+ const cursor = await this.db.query(options.query, options.params || {});
1115
+ const records = await cursor.all();
1116
+ return {
1117
+ records: records,
1118
+ summary: {
1119
+ database: this.db.name,
1120
+ },
1121
+ };
1122
+ }
1123
+ catch (error) {
1124
+ throw graph_error_1.GraphError.queryError(`Failed to execute query: ${error.message}`);
1125
+ }
1126
+ });
1127
+ }
1128
+ // ==================== SCHEMA ====================
1129
+ async createNodeIndex(options) {
1130
+ this.ensureConnected();
1131
+ return this.executeWithRetry(async () => {
1132
+ var _a, _b;
1133
+ try {
1134
+ const collection = this.db.collection(options.label);
1135
+ const indexOptions = {
1136
+ type: this.mapIndexType(options.type),
1137
+ fields: options.properties,
1138
+ name: options.name,
1139
+ };
1140
+ if (((_a = options.options) === null || _a === void 0 ? void 0 : _a.sparse) !== undefined) {
1141
+ indexOptions.sparse = options.options.sparse;
1142
+ }
1143
+ if (((_b = options.options) === null || _b === void 0 ? void 0 : _b.unique) !== undefined) {
1144
+ indexOptions.unique = options.options.unique;
1145
+ }
1146
+ const result = await collection.ensureIndex(indexOptions);
1147
+ return {
1148
+ created: result.isNewlyCreated,
1149
+ name: result.name,
1150
+ };
1151
+ }
1152
+ catch (error) {
1153
+ throw graph_error_1.GraphError.queryError(`Failed to create index: ${error.message}`);
1154
+ }
1155
+ });
1156
+ }
1157
+ async createNodeConstraint(options) {
1158
+ this.ensureConnected();
1159
+ return this.executeWithRetry(async () => {
1160
+ try {
1161
+ const collection = this.db.collection(options.label);
1162
+ const fields = options.properties || (options.property ? [options.property] : []);
1163
+ const result = await collection.ensureIndex({
1164
+ type: 'persistent',
1165
+ fields,
1166
+ name: options.name,
1167
+ unique: true,
1168
+ });
1169
+ return {
1170
+ created: result.isNewlyCreated,
1171
+ name: result.name,
1172
+ };
1173
+ }
1174
+ catch (error) {
1175
+ throw graph_error_1.GraphError.queryError(`Failed to create constraint: ${error.message}`);
1176
+ }
1177
+ });
1178
+ }
1179
+ async createRelationshipIndex(options) {
1180
+ return this.createNodeIndex({
1181
+ label: options.type,
1182
+ properties: options.properties,
1183
+ name: options.name,
1184
+ type: options.type,
1185
+ });
1186
+ }
1187
+ async listIndexes() {
1188
+ this.ensureConnected();
1189
+ return this.executeWithRetry(async () => {
1190
+ try {
1191
+ const indexes = [];
1192
+ for (const collName of [...this.vertexCollections, ...this.edgeCollections]) {
1193
+ const collection = this.db.collection(collName);
1194
+ const collIndexes = await collection.indexes();
1195
+ for (const idx of collIndexes) {
1196
+ indexes.push({
1197
+ name: idx.name,
1198
+ labelOrType: collName,
1199
+ properties: idx.fields || [],
1200
+ type: idx.type,
1201
+ unique: idx.unique || false,
1202
+ });
1203
+ }
1204
+ }
1205
+ return { indexes };
1206
+ }
1207
+ catch (error) {
1208
+ throw graph_error_1.GraphError.queryError(`Failed to list indexes: ${error.message}`);
1209
+ }
1210
+ });
1211
+ }
1212
+ async listConstraints() {
1213
+ this.ensureConnected();
1214
+ return this.executeWithRetry(async () => {
1215
+ try {
1216
+ const constraints = [];
1217
+ for (const collName of this.vertexCollections) {
1218
+ const collection = this.db.collection(collName);
1219
+ const indexes = await collection.indexes();
1220
+ for (const idx of indexes) {
1221
+ if (idx.unique) {
1222
+ constraints.push({
1223
+ name: idx.name,
1224
+ label: collName,
1225
+ property: (idx.fields || [])[0] || '',
1226
+ type: 'UNIQUE',
1227
+ });
1228
+ }
1229
+ }
1230
+ }
1231
+ return { constraints };
1232
+ }
1233
+ catch (error) {
1234
+ throw graph_error_1.GraphError.queryError(`Failed to list constraints: ${error.message}`);
1235
+ }
1236
+ });
1237
+ }
1238
+ async dropIndex(name) {
1239
+ this.ensureConnected();
1240
+ return this.executeWithRetry(async () => {
1241
+ try {
1242
+ for (const collName of [...this.vertexCollections, ...this.edgeCollections]) {
1243
+ const collection = this.db.collection(collName);
1244
+ try {
1245
+ await collection.dropIndex(name);
1246
+ return { dropped: true };
1247
+ }
1248
+ catch (_a) {
1249
+ continue;
1250
+ }
1251
+ }
1252
+ return { dropped: false };
1253
+ }
1254
+ catch (error) {
1255
+ throw graph_error_1.GraphError.queryError(`Failed to drop index: ${error.message}`);
1256
+ }
1257
+ });
1258
+ }
1259
+ async dropConstraint(name) {
1260
+ const result = await this.dropIndex(name);
1261
+ return { dropped: result.dropped };
1262
+ }
1263
+ // ==================== SCHEMA INTROSPECTION ====================
1264
+ async listLabels() {
1265
+ this.ensureConnected();
1266
+ return this.executeWithRetry(async () => {
1267
+ const labels = [];
1268
+ // In ArangoDB, vertex collections act as "labels"
1269
+ for (const collectionName of this.vertexCollections) {
1270
+ try {
1271
+ const collection = this.db.collection(collectionName);
1272
+ // Get count
1273
+ const countResult = await collection.count();
1274
+ const count = countResult.count || 0;
1275
+ // Get properties from a sample of documents
1276
+ const cursor = await this.db.query(`
1277
+ FOR doc IN \`${collectionName}\`
1278
+ LIMIT 100
1279
+ RETURN ATTRIBUTES(doc, true)
1280
+ `);
1281
+ const attributeArrays = await cursor.all();
1282
+ // Flatten and dedupe property names
1283
+ const propertyNames = new Set();
1284
+ for (const attrs of attributeArrays) {
1285
+ for (const attr of attrs) {
1286
+ if (attr !== '_key' && attr !== '_id' && attr !== '_rev') {
1287
+ propertyNames.add(attr);
1288
+ }
1289
+ }
1290
+ }
1291
+ const properties = Array.from(propertyNames).map(name => ({
1292
+ name,
1293
+ type: 'unknown',
1294
+ }));
1295
+ labels.push({
1296
+ name: collectionName,
1297
+ count,
1298
+ properties,
1299
+ });
1300
+ }
1301
+ catch (error) {
1302
+ // Skip collections that don't exist or have errors
1303
+ continue;
1304
+ }
1305
+ }
1306
+ return { labels };
1307
+ });
1308
+ }
1309
+ async listRelationshipTypes() {
1310
+ this.ensureConnected();
1311
+ return this.executeWithRetry(async () => {
1312
+ const types = [];
1313
+ // In ArangoDB, edge collections act as "relationship types"
1314
+ for (const collectionName of this.edgeCollections) {
1315
+ try {
1316
+ const collection = this.db.collection(collectionName);
1317
+ // Get count
1318
+ const countResult = await collection.count();
1319
+ const count = countResult.count || 0;
1320
+ // Get source and target collection information
1321
+ const endpointsCursor = await this.db.query(`
1322
+ FOR edge IN \`${collectionName}\`
1323
+ LIMIT 100
1324
+ RETURN {
1325
+ fromCollection: PARSE_IDENTIFIER(edge._from).collection,
1326
+ toCollection: PARSE_IDENTIFIER(edge._to).collection
1327
+ }
1328
+ `);
1329
+ const endpoints = await endpointsCursor.all();
1330
+ const fromLabelsSet = new Set();
1331
+ const toLabelsSet = new Set();
1332
+ for (const ep of endpoints) {
1333
+ if (ep.fromCollection)
1334
+ fromLabelsSet.add(ep.fromCollection);
1335
+ if (ep.toCollection)
1336
+ toLabelsSet.add(ep.toCollection);
1337
+ }
1338
+ // Get properties from a sample of edges
1339
+ const propsCursor = await this.db.query(`
1340
+ FOR edge IN \`${collectionName}\`
1341
+ LIMIT 100
1342
+ RETURN ATTRIBUTES(edge, true)
1343
+ `);
1344
+ const attributeArrays = await propsCursor.all();
1345
+ const propertyNames = new Set();
1346
+ for (const attrs of attributeArrays) {
1347
+ for (const attr of attrs) {
1348
+ if (!['_key', '_id', '_rev', '_from', '_to'].includes(attr)) {
1349
+ propertyNames.add(attr);
1350
+ }
1351
+ }
1352
+ }
1353
+ const properties = Array.from(propertyNames).map(name => ({
1354
+ name,
1355
+ type: 'unknown',
1356
+ }));
1357
+ types.push({
1358
+ type: collectionName,
1359
+ count,
1360
+ fromLabels: Array.from(fromLabelsSet),
1361
+ toLabels: Array.from(toLabelsSet),
1362
+ properties: properties.length > 0 ? properties : undefined,
1363
+ });
1364
+ }
1365
+ catch (error) {
1366
+ // Skip collections that don't exist or have errors
1367
+ continue;
1368
+ }
1369
+ }
1370
+ return { types };
1371
+ });
1372
+ }
1373
+ // ==================== TRANSACTIONS ====================
1374
+ async beginTransaction() {
1375
+ this.ensureConnected();
1376
+ return this.executeWithRetry(async () => {
1377
+ try {
1378
+ const trx = await this.db.beginTransaction({
1379
+ write: [...this.vertexCollections, ...this.edgeCollections],
1380
+ read: [...this.vertexCollections, ...this.edgeCollections],
1381
+ });
1382
+ return {
1383
+ id: trx.id,
1384
+ status: enums_1.GraphTransactionStatus.ACTIVE,
1385
+ startTime: new Date(),
1386
+ nativeTransaction: trx,
1387
+ };
1388
+ }
1389
+ catch (error) {
1390
+ throw graph_error_1.GraphError.transactionError(`Failed to begin transaction: ${error.message}`);
1391
+ }
1392
+ });
1393
+ }
1394
+ async commitTransaction(transaction) {
1395
+ try {
1396
+ await transaction.nativeTransaction.commit();
1397
+ transaction.status = enums_1.GraphTransactionStatus.COMMITTED;
1398
+ }
1399
+ catch (error) {
1400
+ throw graph_error_1.GraphError.transactionError(`Failed to commit transaction: ${error.message}`);
1401
+ }
1402
+ }
1403
+ async rollbackTransaction(transaction) {
1404
+ try {
1405
+ await transaction.nativeTransaction.abort();
1406
+ transaction.status = enums_1.GraphTransactionStatus.ROLLED_BACK;
1407
+ }
1408
+ catch (error) {
1409
+ throw graph_error_1.GraphError.transactionError(`Failed to rollback transaction: ${error.message}`);
1410
+ }
1411
+ }
1412
+ // ==================== HELPERS ====================
1413
+ mapDirection(direction) {
1414
+ switch (direction) {
1415
+ case enums_1.TraversalDirection.OUTGOING:
1416
+ case 'OUTGOING':
1417
+ return 'OUTBOUND';
1418
+ case enums_1.TraversalDirection.INCOMING:
1419
+ case 'INCOMING':
1420
+ return 'INBOUND';
1421
+ case enums_1.TraversalDirection.BOTH:
1422
+ case 'BOTH':
1423
+ default:
1424
+ return 'ANY';
1425
+ }
1426
+ }
1427
+ mapIndexType(type) {
1428
+ switch (type) {
1429
+ case 'fulltext':
1430
+ return 'fulltext';
1431
+ case 'geo':
1432
+ case 'point':
1433
+ return 'geo';
1434
+ case 'ttl':
1435
+ return 'ttl';
1436
+ default:
1437
+ return 'persistent';
1438
+ }
1439
+ }
1440
+ buildWhereClause(where) {
1441
+ return this.buildArangoWhereClause(where, 'doc');
1442
+ }
1443
+ parseError(error) {
1444
+ if (error instanceof graph_error_1.GraphError) {
1445
+ return error;
1446
+ }
1447
+ return graph_error_1.GraphError.queryError(String(error));
1448
+ }
1449
+ buildArangoWhereClause(where, varName) {
1450
+ const conditions = [];
1451
+ const filterVars = {};
1452
+ let varCounter = 0;
1453
+ for (const [key, value] of Object.entries(where)) {
1454
+ // Normalize key to lowercase for comparison
1455
+ const normalizedKey = key.toLowerCase();
1456
+ if (normalizedKey === '$and') {
1457
+ if (Array.isArray(value)) {
1458
+ const subConditions = [];
1459
+ for (const item of value) {
1460
+ const { filterStr, filterVars: andVars } = this.buildArangoWhereClause(item, varName);
1461
+ if (filterStr) {
1462
+ subConditions.push(filterStr);
1463
+ Object.assign(filterVars, andVars);
1464
+ }
1465
+ }
1466
+ if (subConditions.length > 0) {
1467
+ conditions.push(`(${subConditions.join(' AND ')})`);
1468
+ }
1469
+ }
1470
+ else {
1471
+ const { filterStr, filterVars: andVars } = this.buildArangoWhereClause(value, varName);
1472
+ if (filterStr) {
1473
+ conditions.push(`(${filterStr})`);
1474
+ Object.assign(filterVars, andVars);
1475
+ }
1476
+ }
1477
+ }
1478
+ else if (normalizedKey === '$or') {
1479
+ if (Array.isArray(value)) {
1480
+ const subConditions = [];
1481
+ for (const item of value) {
1482
+ const { filterStr, filterVars: orVars } = this.buildArangoWhereClause(item, varName);
1483
+ if (filterStr) {
1484
+ subConditions.push(filterStr);
1485
+ Object.assign(filterVars, orVars);
1486
+ }
1487
+ }
1488
+ if (subConditions.length > 0) {
1489
+ conditions.push(`(${subConditions.join(' OR ')})`);
1490
+ }
1491
+ }
1492
+ else {
1493
+ const { filterStr, filterVars: orVars } = this.buildArangoWhereClause(value, varName);
1494
+ if (filterStr) {
1495
+ conditions.push(`(${filterStr.replace(/ AND /g, ' OR ')})`);
1496
+ Object.assign(filterVars, orVars);
1497
+ }
1498
+ }
1499
+ }
1500
+ else if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
1501
+ for (const [op, opValue] of Object.entries(value)) {
1502
+ const normalizedOp = op.toLowerCase();
1503
+ const varKey = `v${varCounter++}`;
1504
+ filterVars[varKey] = opValue;
1505
+ switch (normalizedOp) {
1506
+ case '$gt':
1507
+ conditions.push(`${varName}.${key} > @${varKey}`);
1508
+ break;
1509
+ case '$gte':
1510
+ conditions.push(`${varName}.${key} >= @${varKey}`);
1511
+ break;
1512
+ case '$lt':
1513
+ conditions.push(`${varName}.${key} < @${varKey}`);
1514
+ break;
1515
+ case '$lte':
1516
+ conditions.push(`${varName}.${key} <= @${varKey}`);
1517
+ break;
1518
+ case '$ne':
1519
+ conditions.push(`${varName}.${key} != @${varKey}`);
1520
+ break;
1521
+ case '$in':
1522
+ conditions.push(`${varName}.${key} IN @${varKey}`);
1523
+ break;
1524
+ case '$nin':
1525
+ case '$not_in':
1526
+ conditions.push(`${varName}.${key} NOT IN @${varKey}`);
1527
+ break;
1528
+ case '$contains':
1529
+ conditions.push(`CONTAINS(${varName}.${key}, @${varKey})`);
1530
+ break;
1531
+ case '$startswith':
1532
+ case '$starts_with':
1533
+ conditions.push(`STARTS_WITH(${varName}.${key}, @${varKey})`);
1534
+ break;
1535
+ case '$endswith':
1536
+ case '$ends_with':
1537
+ conditions.push(`LIKE(${varName}.${key}, CONCAT('%', @${varKey}))`);
1538
+ break;
1539
+ case '$exists':
1540
+ if (opValue) {
1541
+ conditions.push(`${varName}.${key} != null`);
1542
+ }
1543
+ else {
1544
+ conditions.push(`${varName}.${key} == null`);
1545
+ }
1546
+ break;
1547
+ case '$regex':
1548
+ conditions.push(`REGEX_TEST(${varName}.${key}, @${varKey})`);
1549
+ break;
1550
+ }
1551
+ }
1552
+ }
1553
+ else {
1554
+ const varKey = `v${varCounter++}`;
1555
+ filterVars[varKey] = value;
1556
+ conditions.push(`${varName}.${key} == @${varKey}`);
1557
+ }
1558
+ }
1559
+ return {
1560
+ filterStr: conditions.join(' AND '),
1561
+ filterVars,
1562
+ };
1563
+ }
1564
+ cleanArangoProps(doc) {
1565
+ const result = {};
1566
+ for (const [key, value] of Object.entries(doc)) {
1567
+ if (!key.startsWith('_')) {
1568
+ result[key] = value;
1569
+ }
1570
+ }
1571
+ return result;
1572
+ }
1573
+ async resolveNodeId(id) {
1574
+ for (const collName of this.vertexCollections) {
1575
+ try {
1576
+ const collection = this.db.collection(collName);
1577
+ await collection.document(id);
1578
+ return `${collName}/${id}`;
1579
+ }
1580
+ catch (_a) {
1581
+ continue;
1582
+ }
1583
+ }
1584
+ throw graph_error_1.GraphError.notFoundError(`Node with ID ${id} not found`);
1585
+ }
1586
+ }
1587
+ exports.ArangoDBAdapter = ArangoDBAdapter;
1588
+ //# sourceMappingURL=arangodb.adapter.js.map