@ductape/sdk 0.0.4-v12 → 0.0.4-v120

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 (928) 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 +1254 -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/logsApi.service.d.ts +51 -0
  32. package/dist/api/services/logsApi.service.js +14 -0
  33. package/dist/api/services/logsApi.service.js.map +1 -1
  34. package/dist/api/services/pricingApi.service.d.ts +10 -0
  35. package/dist/api/services/pricingApi.service.js +34 -0
  36. package/dist/api/services/pricingApi.service.js.map +1 -0
  37. package/dist/api/services/processorApi.service.d.ts +745 -0
  38. package/dist/api/services/processorApi.service.js +536 -2
  39. package/dist/api/services/processorApi.service.js.map +1 -1
  40. package/dist/api/services/productsApi.service.d.ts +103 -0
  41. package/dist/api/services/productsApi.service.js +133 -7
  42. package/dist/api/services/productsApi.service.js.map +1 -1
  43. package/dist/api/services/resilienceApi.service.d.ts +106 -0
  44. package/dist/api/services/resilienceApi.service.js +224 -0
  45. package/dist/api/services/resilienceApi.service.js.map +1 -0
  46. package/dist/api/services/secretsApi.service.d.ts +50 -0
  47. package/dist/api/services/secretsApi.service.js +113 -0
  48. package/dist/api/services/secretsApi.service.js.map +1 -0
  49. package/dist/api/services/workflowApi.service.d.ts +199 -0
  50. package/dist/api/services/workflowApi.service.js +183 -0
  51. package/dist/api/services/workflowApi.service.js.map +1 -0
  52. package/dist/api/services/workspaceApi.service.d.ts +8 -0
  53. package/dist/api/services/workspaceApi.service.js +20 -0
  54. package/dist/api/services/workspaceApi.service.js.map +1 -1
  55. package/dist/api/urls.d.ts +80 -0
  56. package/dist/api/urls.js +106 -17
  57. package/dist/api/urls.js.map +1 -1
  58. package/dist/api/utils/auth.utils.d.ts +1 -3
  59. package/dist/api/utils/auth.utils.js.map +1 -1
  60. package/dist/api/utils/cache.utils.d.ts +1 -1
  61. package/dist/api/utils/cache.utils.js +2 -2
  62. package/dist/api/utils/cache.utils.js.map +1 -1
  63. package/dist/api/utils/strings.utils.d.ts +2 -0
  64. package/dist/api/utils/strings.utils.js +14 -0
  65. package/dist/api/utils/strings.utils.js.map +1 -1
  66. package/dist/apps/services/app.service.d.ts +42 -33
  67. package/dist/apps/services/app.service.js +574 -223
  68. package/dist/apps/services/app.service.js.map +1 -1
  69. package/dist/apps/utils/auth-context-manager.d.ts +137 -0
  70. package/dist/apps/utils/auth-context-manager.js +248 -0
  71. package/dist/apps/utils/auth-context-manager.js.map +1 -0
  72. package/dist/apps/utils/credential-manager.d.ts +128 -0
  73. package/dist/apps/utils/credential-manager.js +199 -0
  74. package/dist/apps/utils/credential-manager.js.map +1 -0
  75. package/dist/apps/utils/index.d.ts +10 -0
  76. package/dist/apps/utils/index.js +54 -0
  77. package/dist/apps/utils/index.js.map +1 -0
  78. package/dist/apps/utils/input-helpers.d.ts +67 -0
  79. package/dist/apps/utils/input-helpers.js +185 -0
  80. package/dist/apps/utils/input-helpers.js.map +1 -0
  81. package/dist/apps/utils/input-resolver.d.ts +165 -0
  82. package/dist/apps/utils/input-resolver.js +477 -0
  83. package/dist/apps/utils/input-resolver.js.map +1 -0
  84. package/dist/apps/utils/oauth-manager.d.ts +196 -0
  85. package/dist/apps/utils/oauth-manager.js +429 -0
  86. package/dist/apps/utils/oauth-manager.js.map +1 -0
  87. package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +1 -2
  88. package/dist/apps/validators/joi-validators/create.appAction.validator.js +22 -2
  89. package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +1 -1
  90. package/dist/apps/validators/joi-validators/update.app.validator.js +2 -0
  91. package/dist/apps/validators/joi-validators/update.app.validator.js.map +1 -1
  92. package/dist/apps/validators/joi-validators/update.appAction.validator.js +23 -2
  93. package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
  94. package/dist/bin.d.ts +26 -0
  95. package/dist/bin.js +28 -0
  96. package/dist/bin.js.map +1 -0
  97. package/dist/brokers/brokers.service.d.ts +418 -0
  98. package/dist/brokers/brokers.service.js +1156 -0
  99. package/dist/brokers/brokers.service.js.map +1 -0
  100. package/dist/brokers/index.d.ts +46 -0
  101. package/dist/brokers/index.js +83 -0
  102. package/dist/brokers/index.js.map +1 -0
  103. package/dist/brokers/types/index.d.ts +565 -0
  104. package/dist/brokers/types/index.js +8 -0
  105. package/dist/brokers/types/index.js.map +1 -0
  106. package/dist/brokers/utils/broker.util.d.ts +33 -0
  107. package/dist/brokers/utils/broker.util.js +125 -0
  108. package/dist/brokers/utils/broker.util.js.map +1 -0
  109. package/dist/{processor/services/messagebrokers → brokers/utils/providers}/aws-sqs.service.d.ts +3 -2
  110. package/dist/brokers/utils/providers/aws-sqs.service.js +71 -0
  111. package/dist/brokers/utils/providers/aws-sqs.service.js.map +1 -0
  112. package/dist/{processor/services/messagebrokers → brokers/utils/providers}/google-pubsub.service.d.ts +2 -2
  113. package/dist/{processor/services/messagebrokers → brokers/utils/providers}/google-pubsub.service.js +16 -7
  114. package/dist/brokers/utils/providers/google-pubsub.service.js.map +1 -0
  115. package/dist/brokers/utils/providers/index.d.ts +6 -0
  116. package/dist/brokers/utils/providers/index.js +16 -0
  117. package/dist/brokers/utils/providers/index.js.map +1 -0
  118. package/dist/brokers/utils/providers/kafka.service.d.ts +23 -0
  119. package/dist/brokers/utils/providers/kafka.service.js +131 -0
  120. package/dist/brokers/utils/providers/kafka.service.js.map +1 -0
  121. package/dist/brokers/utils/providers/nats.service.d.ts +18 -0
  122. package/dist/brokers/utils/providers/nats.service.js +63 -0
  123. package/dist/brokers/utils/providers/nats.service.js.map +1 -0
  124. package/dist/{processor/services/messagebrokers → brokers/utils/providers}/rabbitmq.service.d.ts +4 -3
  125. package/dist/brokers/utils/providers/rabbitmq.service.js +118 -0
  126. package/dist/brokers/utils/providers/rabbitmq.service.js.map +1 -0
  127. package/dist/{processor/services/messagebrokers → brokers/utils/providers}/redis.service.d.ts +3 -3
  128. package/dist/{processor/services/messagebrokers → brokers/utils/providers}/redis.service.js +25 -14
  129. package/dist/brokers/utils/providers/redis.service.js.map +1 -0
  130. package/dist/cache/cache.manager.d.ts +308 -0
  131. package/dist/cache/cache.manager.js +900 -0
  132. package/dist/cache/cache.manager.js.map +1 -0
  133. package/dist/cache/cache.service.d.ts +191 -0
  134. package/dist/cache/cache.service.js +594 -0
  135. package/dist/cache/cache.service.js.map +1 -0
  136. package/dist/cache/index.d.ts +52 -0
  137. package/dist/cache/index.js +81 -0
  138. package/dist/cache/index.js.map +1 -0
  139. package/dist/cache/types/index.d.ts +110 -0
  140. package/dist/cache/types/index.js +6 -0
  141. package/dist/cache/types/index.js.map +1 -0
  142. package/dist/clients/pricing.client.d.ts +3 -0
  143. package/dist/clients/pricing.client.js +33 -0
  144. package/dist/clients/pricing.client.js.map +1 -0
  145. package/dist/database/actions/action-manager.d.ts +170 -0
  146. package/dist/database/actions/action-manager.js +465 -0
  147. package/dist/database/actions/action-manager.js.map +1 -0
  148. package/dist/database/actions/index.d.ts +6 -0
  149. package/dist/database/actions/index.js +13 -0
  150. package/dist/database/actions/index.js.map +1 -0
  151. package/dist/database/adapters/adapter.factory.d.ts +62 -0
  152. package/dist/database/adapters/adapter.factory.js +97 -0
  153. package/dist/database/adapters/adapter.factory.js.map +1 -0
  154. package/dist/database/adapters/base.adapter.d.ts +423 -0
  155. package/dist/database/adapters/base.adapter.js +260 -0
  156. package/dist/database/adapters/base.adapter.js.map +1 -0
  157. package/dist/database/adapters/cassandra.adapter.d.ts +92 -0
  158. package/dist/database/adapters/cassandra.adapter.js +1091 -0
  159. package/dist/database/adapters/cassandra.adapter.js.map +1 -0
  160. package/dist/database/adapters/dynamodb.adapter.d.ts +110 -0
  161. package/dist/database/adapters/dynamodb.adapter.js +1564 -0
  162. package/dist/database/adapters/dynamodb.adapter.js.map +1 -0
  163. package/dist/database/adapters/index.d.ts +11 -0
  164. package/dist/database/adapters/index.js +27 -0
  165. package/dist/database/adapters/index.js.map +1 -0
  166. package/dist/database/adapters/mariadb.adapter.d.ts +100 -0
  167. package/dist/database/adapters/mariadb.adapter.js +247 -0
  168. package/dist/database/adapters/mariadb.adapter.js.map +1 -0
  169. package/dist/database/adapters/mongodb.adapter.d.ts +121 -0
  170. package/dist/database/adapters/mongodb.adapter.js +1284 -0
  171. package/dist/database/adapters/mongodb.adapter.js.map +1 -0
  172. package/dist/database/adapters/mysql.adapter.d.ts +86 -0
  173. package/dist/database/adapters/mysql.adapter.js +1371 -0
  174. package/dist/database/adapters/mysql.adapter.js.map +1 -0
  175. package/dist/database/adapters/postgresql.adapter.d.ts +90 -0
  176. package/dist/database/adapters/postgresql.adapter.js +1487 -0
  177. package/dist/database/adapters/postgresql.adapter.js.map +1 -0
  178. package/dist/database/databases.service.d.ts +1476 -0
  179. package/dist/database/databases.service.js +3068 -0
  180. package/dist/database/databases.service.js.map +1 -0
  181. package/dist/database/index.d.ts +46 -0
  182. package/dist/database/index.js +109 -0
  183. package/dist/database/index.js.map +1 -0
  184. package/dist/database/migrations/index.d.ts +6 -0
  185. package/dist/database/migrations/index.js +12 -0
  186. package/dist/database/migrations/index.js.map +1 -0
  187. package/dist/database/migrations/migration-engine.d.ts +136 -0
  188. package/dist/database/migrations/migration-engine.js +1421 -0
  189. package/dist/database/migrations/migration-engine.js.map +1 -0
  190. package/dist/database/operators/aggregation-builder.d.ts +67 -0
  191. package/dist/database/operators/aggregation-builder.js +841 -0
  192. package/dist/database/operators/aggregation-builder.js.map +1 -0
  193. package/dist/database/operators/index.d.ts +7 -0
  194. package/dist/database/operators/index.js +15 -0
  195. package/dist/database/operators/index.js.map +1 -0
  196. package/dist/database/operators/query-builder.d.ts +69 -0
  197. package/dist/database/operators/query-builder.js +447 -0
  198. package/dist/database/operators/query-builder.js.map +1 -0
  199. package/dist/database/presave/decrypt.d.ts +25 -0
  200. package/dist/database/presave/decrypt.js +146 -0
  201. package/dist/database/presave/decrypt.js.map +1 -0
  202. package/dist/database/presave/index.d.ts +9 -0
  203. package/dist/database/presave/index.js +18 -0
  204. package/dist/database/presave/index.js.map +1 -0
  205. package/dist/database/presave/presave-processor.d.ts +148 -0
  206. package/dist/database/presave/presave-processor.js +702 -0
  207. package/dist/database/presave/presave-processor.js.map +1 -0
  208. package/dist/database/schema/index.d.ts +7 -0
  209. package/dist/database/schema/index.js +13 -0
  210. package/dist/database/schema/index.js.map +1 -0
  211. package/dist/database/schema/schema-manager.d.ts +258 -0
  212. package/dist/database/schema/schema-manager.js +638 -0
  213. package/dist/database/schema/schema-manager.js.map +1 -0
  214. package/dist/database/transactions/index.d.ts +6 -0
  215. package/dist/database/transactions/index.js +13 -0
  216. package/dist/database/transactions/index.js.map +1 -0
  217. package/dist/database/transactions/transaction-manager.d.ts +113 -0
  218. package/dist/database/transactions/transaction-manager.js +344 -0
  219. package/dist/database/transactions/transaction-manager.js.map +1 -0
  220. package/dist/database/triggers/index.d.ts +7 -0
  221. package/dist/database/triggers/index.js +14 -0
  222. package/dist/database/triggers/index.js.map +1 -0
  223. package/dist/database/triggers/trigger-processor.d.ts +239 -0
  224. package/dist/database/triggers/trigger-processor.js +1034 -0
  225. package/dist/database/triggers/trigger-processor.js.map +1 -0
  226. package/dist/database/types/action.interface.d.ts +148 -0
  227. package/dist/database/types/action.interface.js +6 -0
  228. package/dist/database/types/action.interface.js.map +1 -0
  229. package/dist/database/types/aggregation.interface.d.ts +185 -0
  230. package/dist/database/types/aggregation.interface.js +6 -0
  231. package/dist/database/types/aggregation.interface.js.map +1 -0
  232. package/dist/database/types/connection.interface.d.ts +137 -0
  233. package/dist/database/types/connection.interface.js +6 -0
  234. package/dist/database/types/connection.interface.js.map +1 -0
  235. package/dist/database/types/dashboard.interface.d.ts +74 -0
  236. package/dist/database/types/dashboard.interface.js +7 -0
  237. package/dist/database/types/dashboard.interface.js.map +1 -0
  238. package/dist/database/types/enums.d.ts +195 -0
  239. package/dist/database/types/enums.js +244 -0
  240. package/dist/database/types/enums.js.map +1 -0
  241. package/dist/database/types/index.d.ts +15 -0
  242. package/dist/database/types/index.js +31 -0
  243. package/dist/database/types/index.js.map +1 -0
  244. package/dist/database/types/migration.interface.d.ts +686 -0
  245. package/dist/database/types/migration.interface.js +9 -0
  246. package/dist/database/types/migration.interface.js.map +1 -0
  247. package/dist/database/types/presave.interface.d.ts +292 -0
  248. package/dist/database/types/presave.interface.js +60 -0
  249. package/dist/database/types/presave.interface.js.map +1 -0
  250. package/dist/database/types/query.interface.d.ts +205 -0
  251. package/dist/database/types/query.interface.js +6 -0
  252. package/dist/database/types/query.interface.js.map +1 -0
  253. package/dist/database/types/schema.interface.d.ts +412 -0
  254. package/dist/database/types/schema.interface.js +6 -0
  255. package/dist/database/types/schema.interface.js.map +1 -0
  256. package/dist/database/types/transaction.interface.d.ts +84 -0
  257. package/dist/database/types/transaction.interface.js +6 -0
  258. package/dist/database/types/transaction.interface.js.map +1 -0
  259. package/dist/database/types/trigger.interface.d.ts +612 -0
  260. package/dist/database/types/trigger.interface.js +121 -0
  261. package/dist/database/types/trigger.interface.js.map +1 -0
  262. package/dist/database/types/write.interface.d.ts +216 -0
  263. package/dist/database/types/write.interface.js +6 -0
  264. package/dist/database/types/write.interface.js.map +1 -0
  265. package/dist/database/utils/database-error.d.ts +96 -0
  266. package/dist/database/utils/database-error.js +221 -0
  267. package/dist/database/utils/database-error.js.map +1 -0
  268. package/dist/database/utils/index.d.ts +6 -0
  269. package/dist/database/utils/index.js +11 -0
  270. package/dist/database/utils/index.js.map +1 -0
  271. package/dist/graph/adapters/adapter.factory.d.ts +47 -0
  272. package/dist/graph/adapters/adapter.factory.js +77 -0
  273. package/dist/graph/adapters/adapter.factory.js.map +1 -0
  274. package/dist/graph/adapters/arangodb.adapter.d.ts +86 -0
  275. package/dist/graph/adapters/arangodb.adapter.js +1588 -0
  276. package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
  277. package/dist/graph/adapters/base.adapter.d.ts +264 -0
  278. package/dist/graph/adapters/base.adapter.js +156 -0
  279. package/dist/graph/adapters/base.adapter.js.map +1 -0
  280. package/dist/graph/adapters/index.d.ts +11 -0
  281. package/dist/graph/adapters/index.js +21 -0
  282. package/dist/graph/adapters/index.js.map +1 -0
  283. package/dist/graph/adapters/memgraph.adapter.d.ts +110 -0
  284. package/dist/graph/adapters/memgraph.adapter.js +1452 -0
  285. package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
  286. package/dist/graph/adapters/neo4j.adapter.d.ts +81 -0
  287. package/dist/graph/adapters/neo4j.adapter.js +1317 -0
  288. package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
  289. package/dist/graph/adapters/neptune.adapter.d.ts +82 -0
  290. package/dist/graph/adapters/neptune.adapter.js +1369 -0
  291. package/dist/graph/adapters/neptune.adapter.js.map +1 -0
  292. package/dist/graph/graphs.service.d.ts +606 -0
  293. package/dist/graph/graphs.service.js +2434 -0
  294. package/dist/graph/graphs.service.js.map +1 -0
  295. package/dist/graph/index.d.ts +57 -0
  296. package/dist/graph/index.js +77 -0
  297. package/dist/graph/index.js.map +1 -0
  298. package/dist/graph/transactions/index.d.ts +4 -0
  299. package/dist/graph/transactions/index.js +9 -0
  300. package/dist/graph/transactions/index.js.map +1 -0
  301. package/dist/graph/transactions/transaction-manager.d.ts +61 -0
  302. package/dist/graph/transactions/transaction-manager.js +126 -0
  303. package/dist/graph/transactions/transaction-manager.js.map +1 -0
  304. package/dist/graph/types/connection.interface.d.ts +149 -0
  305. package/dist/graph/types/connection.interface.js +9 -0
  306. package/dist/graph/types/connection.interface.js.map +1 -0
  307. package/dist/graph/types/enums.d.ts +101 -0
  308. package/dist/graph/types/enums.js +114 -0
  309. package/dist/graph/types/enums.js.map +1 -0
  310. package/dist/graph/types/index.d.ts +13 -0
  311. package/dist/graph/types/index.js +20 -0
  312. package/dist/graph/types/index.js.map +1 -0
  313. package/dist/graph/types/node.interface.d.ts +248 -0
  314. package/dist/graph/types/node.interface.js +9 -0
  315. package/dist/graph/types/node.interface.js.map +1 -0
  316. package/dist/graph/types/query.interface.d.ts +175 -0
  317. package/dist/graph/types/query.interface.js +9 -0
  318. package/dist/graph/types/query.interface.js.map +1 -0
  319. package/dist/graph/types/relationship.interface.d.ts +207 -0
  320. package/dist/graph/types/relationship.interface.js +9 -0
  321. package/dist/graph/types/relationship.interface.js.map +1 -0
  322. package/dist/graph/types/schema.interface.d.ts +295 -0
  323. package/dist/graph/types/schema.interface.js +9 -0
  324. package/dist/graph/types/schema.interface.js.map +1 -0
  325. package/dist/graph/types/transaction.interface.d.ts +55 -0
  326. package/dist/graph/types/transaction.interface.js +9 -0
  327. package/dist/graph/types/transaction.interface.js.map +1 -0
  328. package/dist/graph/types/traversal.interface.d.ts +181 -0
  329. package/dist/graph/types/traversal.interface.js +9 -0
  330. package/dist/graph/types/traversal.interface.js.map +1 -0
  331. package/dist/graph/utils/graph-error.d.ts +71 -0
  332. package/dist/graph/utils/graph-error.js +142 -0
  333. package/dist/graph/utils/graph-error.js.map +1 -0
  334. package/dist/graph/utils/index.d.ts +4 -0
  335. package/dist/graph/utils/index.js +9 -0
  336. package/dist/graph/utils/index.js.map +1 -0
  337. package/dist/imports/imports.service.d.ts +3 -3
  338. package/dist/imports/imports.service.js +8 -7
  339. package/dist/imports/imports.service.js.map +1 -1
  340. package/dist/imports/imports.types.d.ts +8 -0
  341. package/dist/imports/repos/openApi.repo.d.ts +1 -1
  342. package/dist/imports/repos/openApi.repo.js +414 -47
  343. package/dist/imports/repos/openApi.repo.js.map +1 -1
  344. package/dist/imports/repos/postmanV21.repo.d.ts +1 -1
  345. package/dist/imports/repos/postmanV21.repo.js +126 -83
  346. package/dist/imports/repos/postmanV21.repo.js.map +1 -1
  347. package/dist/index.d.ts +3366 -743
  348. package/dist/index.js +4885 -1107
  349. package/dist/index.js.map +1 -1
  350. package/dist/init.interface.d.ts +407 -0
  351. package/dist/{processor/services/messagebrokers/messagebrokers.type.js → init.interface.js} +1 -1
  352. package/dist/init.interface.js.map +1 -0
  353. package/dist/inputs/inputs.service.d.ts +1 -1
  354. package/dist/inputs/utils/inputs.utils.create.js +1 -1
  355. package/dist/inputs/utils/inputs.utils.create.js.map +1 -1
  356. package/dist/jobs/index.d.ts +38 -0
  357. package/dist/jobs/index.js +50 -0
  358. package/dist/jobs/index.js.map +1 -0
  359. package/dist/jobs/jobs.service.d.ts +154 -0
  360. package/dist/jobs/jobs.service.js +491 -0
  361. package/dist/jobs/jobs.service.js.map +1 -0
  362. package/dist/jobs/jobs.state.d.ts +113 -0
  363. package/dist/jobs/jobs.state.js +447 -0
  364. package/dist/jobs/jobs.state.js.map +1 -0
  365. package/dist/jobs/types.d.ts +449 -0
  366. package/dist/jobs/types.js +74 -0
  367. package/dist/jobs/types.js.map +1 -0
  368. package/dist/logs/logs.service.js +6 -2
  369. package/dist/logs/logs.service.js.map +1 -1
  370. package/dist/logs/logs.types.d.ts +24 -1
  371. package/dist/logs/logs.types.js +9 -0
  372. package/dist/logs/logs.types.js.map +1 -1
  373. package/dist/models/index.d.ts +6 -0
  374. package/dist/models/index.js +11 -0
  375. package/dist/models/index.js.map +1 -0
  376. package/dist/models/models.service.d.ts +137 -0
  377. package/dist/models/models.service.js +195 -0
  378. package/dist/models/models.service.js.map +1 -0
  379. package/dist/notifications/index.d.ts +13 -0
  380. package/dist/notifications/index.js +26 -0
  381. package/dist/notifications/index.js.map +1 -0
  382. package/dist/notifications/notifications.service.d.ts +268 -0
  383. package/dist/notifications/notifications.service.js +905 -0
  384. package/dist/notifications/notifications.service.js.map +1 -0
  385. package/dist/notifications/types/index.d.ts +4 -0
  386. package/dist/notifications/types/index.js +21 -0
  387. package/dist/notifications/types/index.js.map +1 -0
  388. package/dist/notifications/types/notifications.types.d.ts +404 -0
  389. package/dist/notifications/types/notifications.types.js +49 -0
  390. package/dist/notifications/types/notifications.types.js.map +1 -0
  391. package/dist/parsers/index.d.ts +3 -0
  392. package/dist/parsers/index.js +27 -0
  393. package/dist/parsers/index.js.map +1 -0
  394. package/dist/parsers/pipelines/postman.pipelines.d.ts +15 -0
  395. package/dist/parsers/pipelines/postman.pipelines.js +103 -0
  396. package/dist/parsers/pipelines/postman.pipelines.js.map +1 -0
  397. package/dist/parsers/types/postman.types.d.ts +200 -0
  398. package/dist/parsers/types/postman.types.js +3 -0
  399. package/dist/parsers/types/postman.types.js.map +1 -0
  400. package/dist/parsers/utils/postman.utils.d.ts +12 -0
  401. package/dist/parsers/utils/postman.utils.js +116 -0
  402. package/dist/parsers/utils/postman.utils.js.map +1 -0
  403. package/dist/parsers/validators/postman-auth.validators.d.ts +10 -0
  404. package/dist/parsers/validators/postman-auth.validators.js +127 -0
  405. package/dist/parsers/validators/postman-auth.validators.js.map +1 -0
  406. package/dist/parsers/validators/postman-request.validators.d.ts +13 -0
  407. package/dist/parsers/validators/postman-request.validators.js +139 -0
  408. package/dist/parsers/validators/postman-request.validators.js.map +1 -0
  409. package/dist/parsers/validators/postman-response.validators.d.ts +13 -0
  410. package/dist/parsers/validators/postman-response.validators.js +150 -0
  411. package/dist/parsers/validators/postman-response.validators.js.map +1 -0
  412. package/dist/parsers/validators/postman-variable.validators.d.ts +14 -0
  413. package/dist/parsers/validators/postman-variable.validators.js +163 -0
  414. package/dist/parsers/validators/postman-variable.validators.js.map +1 -0
  415. package/dist/pricing/pricing.repo.js +1 -0
  416. package/dist/pricing/pricing.repo.js.map +1 -0
  417. package/dist/pricing/pricing.service.d.ts +24 -0
  418. package/dist/pricing/pricing.service.js +51 -0
  419. package/dist/pricing/pricing.service.js.map +1 -0
  420. package/dist/pricing/pricing.types.d.ts +76 -0
  421. package/dist/pricing/pricing.types.js +21 -0
  422. package/dist/pricing/pricing.types.js.map +1 -0
  423. package/dist/pricing/utils/string.utils.d.ts +1 -0
  424. package/dist/pricing/utils/string.utils.js +9 -0
  425. package/dist/pricing/utils/string.utils.js.map +1 -0
  426. package/dist/processor/services/processor.service.d.ts +101 -72
  427. package/dist/processor/services/processor.service.js +1573 -1343
  428. package/dist/processor/services/processor.service.js.map +1 -1
  429. package/dist/processor/services/request.service.d.ts +36 -0
  430. package/dist/processor/services/request.service.js +304 -0
  431. package/dist/processor/services/request.service.js.map +1 -0
  432. package/dist/processor/types/request.types.d.ts +14 -0
  433. package/dist/processor/types/request.types.js +3 -0
  434. package/dist/processor/types/request.types.js.map +1 -0
  435. package/dist/processor/utils/processor.utils.js +32 -20
  436. package/dist/processor/utils/processor.utils.js.map +1 -1
  437. package/dist/processor/utils/request.utils.d.ts +20 -0
  438. package/dist/processor/utils/request.utils.js +113 -0
  439. package/dist/processor/utils/request.utils.js.map +1 -0
  440. package/dist/products/services/products.service.d.ts +358 -79
  441. package/dist/products/services/products.service.js +2918 -434
  442. package/dist/products/services/products.service.js.map +1 -1
  443. package/dist/products/utils/string.utils.d.ts +1 -1
  444. package/dist/products/utils/string.utils.js +14 -2
  445. package/dist/products/utils/string.utils.js.map +1 -1
  446. package/dist/products/validators/index.d.ts +6 -1
  447. package/dist/products/validators/index.js +14 -1
  448. package/dist/products/validators/index.js.map +1 -1
  449. package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +3 -0
  450. package/dist/products/validators/joi-validators/create.productAgent.validator.js +266 -0
  451. package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +1 -0
  452. package/dist/products/validators/joi-validators/create.productApp.validator.js +2 -2
  453. package/dist/products/validators/joi-validators/create.productApp.validator.js.map +1 -1
  454. package/dist/products/validators/joi-validators/create.productDatabase.validator.js +5 -0
  455. package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +1 -1
  456. package/dist/products/validators/joi-validators/create.productEnv.validator.js +1 -0
  457. package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +1 -1
  458. package/dist/products/validators/joi-validators/create.productGraph.validator.js +89 -0
  459. package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
  460. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +1 -0
  461. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -1
  462. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +81 -25
  463. package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +1 -1
  464. package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +3 -0
  465. package/dist/products/validators/joi-validators/create.productModel.validator.js +132 -0
  466. package/dist/products/validators/joi-validators/create.productModel.validator.js.map +1 -0
  467. package/dist/products/validators/joi-validators/create.productNotification.validator.js +150 -51
  468. package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
  469. package/dist/products/validators/joi-validators/create.productStorage.validator.js +77 -18
  470. package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +1 -1
  471. package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +3 -0
  472. package/dist/products/validators/joi-validators/create.productVector.validator.js +136 -0
  473. package/dist/products/validators/joi-validators/create.productVector.validator.js.map +1 -0
  474. package/dist/products/validators/joi-validators/update.dataValue.validator.js +1 -0
  475. package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -1
  476. package/dist/products/validators/joi-validators/update.productDatabase.validator.js +5 -0
  477. package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +1 -1
  478. package/dist/products/validators/joi-validators/update.productEnv.validator.js +3 -0
  479. package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +1 -1
  480. package/dist/products/validators/joi-validators/update.productGraph.validator.js +88 -0
  481. package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
  482. package/dist/resilience/fallback.service.d.ts +140 -0
  483. package/dist/resilience/fallback.service.js +764 -0
  484. package/dist/resilience/fallback.service.js.map +1 -0
  485. package/dist/resilience/healthcheck.service.d.ts +159 -0
  486. package/dist/resilience/healthcheck.service.js +943 -0
  487. package/dist/resilience/healthcheck.service.js.map +1 -0
  488. package/dist/resilience/index.d.ts +104 -0
  489. package/dist/resilience/index.js +140 -0
  490. package/dist/resilience/index.js.map +1 -0
  491. package/dist/resilience/quota.service.d.ts +82 -0
  492. package/dist/resilience/quota.service.js +516 -0
  493. package/dist/resilience/quota.service.js.map +1 -0
  494. package/dist/resilience/resilience.service.d.ts +98 -0
  495. package/dist/resilience/resilience.service.js +560 -0
  496. package/dist/resilience/resilience.service.js.map +1 -0
  497. package/dist/resilience/types/index.d.ts +513 -0
  498. package/dist/resilience/types/index.js +29 -0
  499. package/dist/resilience/types/index.js.map +1 -0
  500. package/dist/secrets/index.d.ts +10 -0
  501. package/dist/secrets/index.js +33 -0
  502. package/dist/secrets/index.js.map +1 -0
  503. package/dist/secrets/secrets.resolver.d.ts +52 -0
  504. package/dist/secrets/secrets.resolver.js +236 -0
  505. package/dist/secrets/secrets.resolver.js.map +1 -0
  506. package/dist/secrets/secrets.service.d.ts +93 -0
  507. package/dist/secrets/secrets.service.js +246 -0
  508. package/dist/secrets/secrets.service.js.map +1 -0
  509. package/dist/secrets/secrets.types.d.ts +188 -0
  510. package/dist/secrets/secrets.types.js +87 -0
  511. package/dist/secrets/secrets.types.js.map +1 -0
  512. package/dist/sessions/index.d.ts +50 -0
  513. package/dist/sessions/index.js +96 -0
  514. package/dist/sessions/index.js.map +1 -0
  515. package/dist/sessions/sessions.helper.d.ts +88 -0
  516. package/dist/sessions/sessions.helper.js +133 -0
  517. package/dist/sessions/sessions.helper.js.map +1 -0
  518. package/dist/sessions/sessions.resolver.d.ts +188 -0
  519. package/dist/sessions/sessions.resolver.js +603 -0
  520. package/dist/sessions/sessions.resolver.js.map +1 -0
  521. package/dist/sessions/sessions.service.d.ts +194 -0
  522. package/dist/sessions/sessions.service.js +987 -0
  523. package/dist/sessions/sessions.service.js.map +1 -0
  524. package/dist/sessions/types/index.d.ts +342 -0
  525. package/dist/sessions/types/index.js +6 -0
  526. package/dist/sessions/types/index.js.map +1 -0
  527. package/dist/storage/index.d.ts +66 -0
  528. package/dist/storage/index.js +99 -0
  529. package/dist/storage/index.js.map +1 -0
  530. package/dist/storage/storage.service.d.ts +177 -0
  531. package/dist/storage/storage.service.js +897 -0
  532. package/dist/storage/storage.service.js.map +1 -0
  533. package/dist/storage/types/index.d.ts +267 -0
  534. package/dist/storage/types/index.js +6 -0
  535. package/dist/storage/types/index.js.map +1 -0
  536. package/dist/storage/utils/storage.util.d.ts +62 -0
  537. package/dist/storage/utils/storage.util.js +593 -0
  538. package/dist/storage/utils/storage.util.js.map +1 -0
  539. package/dist/types/appBuilder.types.d.ts +12 -3
  540. package/dist/types/enums.d.ts +10 -1
  541. package/dist/types/enums.js +9 -0
  542. package/dist/types/enums.js.map +1 -1
  543. package/dist/types/index.types.d.ts +4 -7
  544. package/dist/types/index.types.js +0 -1
  545. package/dist/types/index.types.js.map +1 -1
  546. package/dist/types/inputs.types.js +1 -1
  547. package/dist/types/inputs.types.js.map +1 -1
  548. package/dist/types/pricing.types.d.ts +4 -0
  549. package/dist/types/pricing.types.js +3 -0
  550. package/dist/types/pricing.types.js.map +1 -0
  551. package/dist/types/processor.types.d.ts +265 -38
  552. package/dist/types/processor.types.js +9 -1
  553. package/dist/types/processor.types.js.map +1 -1
  554. package/dist/types/productsBuilder.types.d.ts +954 -29
  555. package/dist/types/productsBuilder.types.js +210 -3
  556. package/dist/types/productsBuilder.types.js.map +1 -1
  557. package/dist/types/request-tracker.interface.js +1 -0
  558. package/dist/types/request-tracker.interface.js.map +1 -0
  559. package/dist/types/requests.types.d.ts +2 -0
  560. package/dist/utils/constants.d.ts +1 -0
  561. package/dist/utils/constants.js +5 -0
  562. package/dist/utils/constants.js.map +1 -0
  563. package/dist/utils/index.d.ts +0 -2
  564. package/dist/utils/index.js +24 -52
  565. package/dist/utils/index.js.map +1 -1
  566. package/dist/vector/actions/action-manager.d.ts +140 -0
  567. package/dist/vector/actions/action-manager.js +356 -0
  568. package/dist/vector/actions/action-manager.js.map +1 -0
  569. package/dist/vector/adapters/base.adapter.d.ts +169 -0
  570. package/dist/vector/adapters/base.adapter.js +218 -0
  571. package/dist/vector/adapters/base.adapter.js.map +1 -0
  572. package/dist/vector/adapters/index.d.ts +10 -0
  573. package/dist/vector/adapters/index.js +19 -0
  574. package/dist/vector/adapters/index.js.map +1 -0
  575. package/dist/vector/adapters/memory.adapter.d.ts +85 -0
  576. package/dist/vector/adapters/memory.adapter.js +505 -0
  577. package/dist/vector/adapters/memory.adapter.js.map +1 -0
  578. package/dist/vector/adapters/pinecone.adapter.d.ts +52 -0
  579. package/dist/vector/adapters/pinecone.adapter.js +433 -0
  580. package/dist/vector/adapters/pinecone.adapter.js.map +1 -0
  581. package/dist/vector/adapters/qdrant.adapter.d.ts +56 -0
  582. package/dist/vector/adapters/qdrant.adapter.js +442 -0
  583. package/dist/vector/adapters/qdrant.adapter.js.map +1 -0
  584. package/dist/vector/adapters/weaviate.adapter.d.ts +68 -0
  585. package/dist/vector/adapters/weaviate.adapter.js +661 -0
  586. package/dist/vector/adapters/weaviate.adapter.js.map +1 -0
  587. package/dist/vector/index.d.ts +36 -0
  588. package/dist/vector/index.js +70 -0
  589. package/dist/vector/index.js.map +1 -0
  590. package/dist/vector/types/action.interface.d.ts +195 -0
  591. package/dist/vector/types/action.interface.js +100 -0
  592. package/dist/vector/types/action.interface.js.map +1 -0
  593. package/dist/vector/types/connection.interface.d.ts +151 -0
  594. package/dist/vector/types/connection.interface.js +8 -0
  595. package/dist/vector/types/connection.interface.js.map +1 -0
  596. package/dist/vector/types/embedding.interface.d.ts +144 -0
  597. package/dist/vector/types/embedding.interface.js +8 -0
  598. package/dist/vector/types/embedding.interface.js.map +1 -0
  599. package/dist/vector/types/enums.d.ts +104 -0
  600. package/dist/vector/types/enums.js +113 -0
  601. package/dist/vector/types/enums.js.map +1 -0
  602. package/dist/vector/types/index.d.ts +11 -0
  603. package/dist/vector/types/index.js +23 -0
  604. package/dist/vector/types/index.js.map +1 -0
  605. package/dist/vector/types/vector.interface.d.ts +315 -0
  606. package/dist/vector/types/vector.interface.js +8 -0
  607. package/dist/vector/types/vector.interface.js.map +1 -0
  608. package/dist/vector/utils/index.d.ts +6 -0
  609. package/dist/vector/utils/index.js +11 -0
  610. package/dist/vector/utils/index.js.map +1 -0
  611. package/dist/vector/utils/vector-error.d.ts +69 -0
  612. package/dist/vector/utils/vector-error.js +116 -0
  613. package/dist/vector/utils/vector-error.js.map +1 -0
  614. package/dist/vector/vector-database.service.d.ts +476 -0
  615. package/dist/vector/vector-database.service.js +892 -0
  616. package/dist/vector/vector-database.service.js.map +1 -0
  617. package/dist/vector/vector.service.d.ts +283 -0
  618. package/dist/vector/vector.service.js +544 -0
  619. package/dist/vector/vector.service.js.map +1 -0
  620. package/dist/warehouse/executor/index.d.ts +5 -0
  621. package/dist/warehouse/executor/index.js +12 -0
  622. package/dist/warehouse/executor/index.js.map +1 -0
  623. package/dist/warehouse/executor/joins/index.d.ts +5 -0
  624. package/dist/warehouse/executor/joins/index.js +11 -0
  625. package/dist/warehouse/executor/joins/index.js.map +1 -0
  626. package/dist/warehouse/executor/joins/join-executor.d.ts +101 -0
  627. package/dist/warehouse/executor/joins/join-executor.js +493 -0
  628. package/dist/warehouse/executor/joins/join-executor.js.map +1 -0
  629. package/dist/warehouse/executor/joins/semantic-join.d.ts +64 -0
  630. package/dist/warehouse/executor/joins/semantic-join.js +241 -0
  631. package/dist/warehouse/executor/joins/semantic-join.js.map +1 -0
  632. package/dist/warehouse/executor/single-source-executor.d.ts +155 -0
  633. package/dist/warehouse/executor/single-source-executor.js +573 -0
  634. package/dist/warehouse/executor/single-source-executor.js.map +1 -0
  635. package/dist/warehouse/index.d.ts +79 -0
  636. package/dist/warehouse/index.js +111 -0
  637. package/dist/warehouse/index.js.map +1 -0
  638. package/dist/warehouse/parser/index.d.ts +4 -0
  639. package/dist/warehouse/parser/index.js +10 -0
  640. package/dist/warehouse/parser/index.js.map +1 -0
  641. package/dist/warehouse/parser/query-parser.d.ts +181 -0
  642. package/dist/warehouse/parser/query-parser.js +415 -0
  643. package/dist/warehouse/parser/query-parser.js.map +1 -0
  644. package/dist/warehouse/registry/data-source-registry.d.ts +207 -0
  645. package/dist/warehouse/registry/data-source-registry.js +396 -0
  646. package/dist/warehouse/registry/data-source-registry.js.map +1 -0
  647. package/dist/warehouse/registry/index.d.ts +4 -0
  648. package/dist/warehouse/registry/index.js +9 -0
  649. package/dist/warehouse/registry/index.js.map +1 -0
  650. package/dist/warehouse/transactions/index.d.ts +4 -0
  651. package/dist/warehouse/transactions/index.js +9 -0
  652. package/dist/warehouse/transactions/index.js.map +1 -0
  653. package/dist/warehouse/transactions/saga-orchestrator.d.ts +92 -0
  654. package/dist/warehouse/transactions/saga-orchestrator.js +383 -0
  655. package/dist/warehouse/transactions/saga-orchestrator.js.map +1 -0
  656. package/dist/warehouse/types/index.d.ts +9 -0
  657. package/dist/warehouse/types/index.js +33 -0
  658. package/dist/warehouse/types/index.js.map +1 -0
  659. package/dist/warehouse/types/join.interface.d.ts +225 -0
  660. package/dist/warehouse/types/join.interface.js +87 -0
  661. package/dist/warehouse/types/join.interface.js.map +1 -0
  662. package/dist/warehouse/types/query.interface.d.ts +232 -0
  663. package/dist/warehouse/types/query.interface.js +9 -0
  664. package/dist/warehouse/types/query.interface.js.map +1 -0
  665. package/dist/warehouse/types/transaction.interface.d.ts +236 -0
  666. package/dist/warehouse/types/transaction.interface.js +74 -0
  667. package/dist/warehouse/types/transaction.interface.js.map +1 -0
  668. package/dist/warehouse/types/where.interface.d.ts +208 -0
  669. package/dist/warehouse/types/where.interface.js +89 -0
  670. package/dist/warehouse/types/where.interface.js.map +1 -0
  671. package/dist/warehouse/warehouse.service.d.ts +200 -0
  672. package/dist/warehouse/warehouse.service.js +470 -0
  673. package/dist/warehouse/warehouse.service.js.map +1 -0
  674. package/dist/workflows/index.d.ts +30 -0
  675. package/dist/workflows/index.js +64 -0
  676. package/dist/workflows/index.js.map +1 -0
  677. package/dist/workflows/types/index.d.ts +6 -0
  678. package/dist/workflows/types/index.js +23 -0
  679. package/dist/workflows/types/index.js.map +1 -0
  680. package/dist/workflows/types/workflows.types.d.ts +1037 -0
  681. package/dist/workflows/types/workflows.types.js +13 -0
  682. package/dist/workflows/types/workflows.types.js.map +1 -0
  683. package/dist/workflows/workflow-builder.d.ts +70 -0
  684. package/dist/workflows/workflow-builder.js +338 -0
  685. package/dist/workflows/workflow-builder.js.map +1 -0
  686. package/dist/workflows/workflow-executor.d.ts +208 -0
  687. package/dist/workflows/workflow-executor.js +1194 -0
  688. package/dist/workflows/workflow-executor.js.map +1 -0
  689. package/dist/workflows/workflows.service.d.ts +412 -0
  690. package/dist/workflows/workflows.service.js +1746 -0
  691. package/dist/workflows/workflows.service.js.map +1 -0
  692. package/package.json +75 -13
  693. package/dist/actions/actions.repo.js +0 -13
  694. package/dist/actions/actions.repo.js.map +0 -1
  695. package/dist/actions/actions.service.js +0 -24
  696. package/dist/actions/actions.service.js.map +0 -1
  697. package/dist/actions/utils/actions.util.read.d.ts +0 -0
  698. package/dist/actions/utils/actions.util.read.js +0 -427
  699. package/dist/actions/utils/actions.util.read.js.map +0 -1
  700. package/dist/api/services/integrationsApi.service.d.ts +0 -18
  701. package/dist/api/services/integrationsApi.service.js +0 -80
  702. package/dist/api/services/integrationsApi.service.js.map +0 -1
  703. package/dist/appBuilder/services/app.service.d.ts +0 -111
  704. package/dist/appBuilder/services/app.service.js +0 -737
  705. package/dist/appBuilder/services/app.service.js.map +0 -1
  706. package/dist/appBuilder/services/appBuilder.service.d.ts +0 -111
  707. package/dist/appBuilder/services/appBuilder.service.js +0 -662
  708. package/dist/appBuilder/services/appBuilder.service.js.map +0 -1
  709. package/dist/appBuilder/utils/objects.utils.d.ts +0 -3
  710. package/dist/appBuilder/utils/objects.utils.js +0 -9
  711. package/dist/appBuilder/utils/objects.utils.js.map +0 -1
  712. package/dist/appBuilder/utils/string.utils.d.ts +0 -2
  713. package/dist/appBuilder/utils/string.utils.js +0 -57
  714. package/dist/appBuilder/utils/string.utils.js.map +0 -1
  715. package/dist/appBuilder/validators/index.d.ts +0 -19
  716. package/dist/appBuilder/validators/index.js +0 -40
  717. package/dist/appBuilder/validators/index.js.map +0 -1
  718. package/dist/appBuilder/validators/joi-validators/create.app.validator.js +0 -10
  719. package/dist/appBuilder/validators/joi-validators/create.app.validator.js.map +0 -1
  720. package/dist/appBuilder/validators/joi-validators/create.appAction.validator.d.ts +0 -4
  721. package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js +0 -20
  722. package/dist/appBuilder/validators/joi-validators/create.appAction.validator.js.map +0 -1
  723. package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.d.ts +0 -7
  724. package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js +0 -44
  725. package/dist/appBuilder/validators/joi-validators/create.appActionResponse.validator.js.map +0 -1
  726. package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.d.ts +0 -3
  727. package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js +0 -31
  728. package/dist/appBuilder/validators/joi-validators/create.appAuth.validator.js.map +0 -1
  729. package/dist/appBuilder/validators/joi-validators/create.appBody.validators.d.ts +0 -4
  730. package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js +0 -11
  731. package/dist/appBuilder/validators/joi-validators/create.appBody.validators.js.map +0 -1
  732. package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.d.ts +0 -4
  733. package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js +0 -12
  734. package/dist/appBuilder/validators/joi-validators/create.appConstants.validator.js.map +0 -1
  735. package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.d.ts +0 -4
  736. package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js +0 -17
  737. package/dist/appBuilder/validators/joi-validators/create.appEnv.validator.js.map +0 -1
  738. package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
  739. package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js +0 -30
  740. package/dist/appBuilder/validators/joi-validators/create.appEvent.validator.js.map +0 -1
  741. package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.d.ts +0 -4
  742. package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js +0 -14
  743. package/dist/appBuilder/validators/joi-validators/create.appVariable.validator.js.map +0 -1
  744. package/dist/appBuilder/validators/joi-validators/sample.validator.d.ts +0 -5
  745. package/dist/appBuilder/validators/joi-validators/sample.validator.js +0 -26
  746. package/dist/appBuilder/validators/joi-validators/sample.validator.js.map +0 -1
  747. package/dist/appBuilder/validators/joi-validators/update.app.validator.d.ts +0 -4
  748. package/dist/appBuilder/validators/joi-validators/update.app.validator.js +0 -34
  749. package/dist/appBuilder/validators/joi-validators/update.app.validator.js.map +0 -1
  750. package/dist/appBuilder/validators/joi-validators/update.appAction.validator.d.ts +0 -4
  751. package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js +0 -23
  752. package/dist/appBuilder/validators/joi-validators/update.appAction.validator.js.map +0 -1
  753. package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.d.ts +0 -3
  754. package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js +0 -21
  755. package/dist/appBuilder/validators/joi-validators/update.appActionResponse.validator.js.map +0 -1
  756. package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.d.ts +0 -4
  757. package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js +0 -19
  758. package/dist/appBuilder/validators/joi-validators/update.appAuth.validator.js.map +0 -1
  759. package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.d.ts +0 -4
  760. package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js +0 -12
  761. package/dist/appBuilder/validators/joi-validators/update.appConstants.validator.js.map +0 -1
  762. package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.d.ts +0 -4
  763. package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js +0 -17
  764. package/dist/appBuilder/validators/joi-validators/update.appEnv.validator.js.map +0 -1
  765. package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
  766. package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js +0 -16
  767. package/dist/appBuilder/validators/joi-validators/update.appEvent.validator.js.map +0 -1
  768. package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.d.ts +0 -4
  769. package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js +0 -14
  770. package/dist/appBuilder/validators/joi-validators/update.appVariables.validator.js.map +0 -1
  771. package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js +0 -27
  772. package/dist/appBuilder/validators/joi-validators/update.validation.entityData.validator.js.map +0 -1
  773. package/dist/apps/validators/joi-validators/create.appEvent.validator.d.ts +0 -5
  774. package/dist/apps/validators/joi-validators/create.appEvent.validator.js +0 -30
  775. package/dist/apps/validators/joi-validators/create.appEvent.validator.js.map +0 -1
  776. package/dist/apps/validators/joi-validators/update.appEvent.validator.d.ts +0 -4
  777. package/dist/apps/validators/joi-validators/update.appEvent.validator.js +0 -16
  778. package/dist/apps/validators/joi-validators/update.appEvent.validator.js.map +0 -1
  779. package/dist/clients/integrations.client.d.ts +0 -2
  780. package/dist/clients/integrations.client.js +0 -26
  781. package/dist/clients/integrations.client.js.map +0 -1
  782. package/dist/integrationsBuilder/services/integration.service.d.ts +0 -138
  783. package/dist/integrationsBuilder/services/integration.service.js +0 -1148
  784. package/dist/integrationsBuilder/services/integration.service.js.map +0 -1
  785. package/dist/integrationsBuilder/services/integrationBuilder.service.d.ts +0 -130
  786. package/dist/integrationsBuilder/services/integrationBuilder.service.js +0 -1017
  787. package/dist/integrationsBuilder/services/integrationBuilder.service.js.map +0 -1
  788. package/dist/integrationsBuilder/utils/objects.utils.d.ts +0 -2
  789. package/dist/integrationsBuilder/utils/objects.utils.js +0 -48
  790. package/dist/integrationsBuilder/utils/objects.utils.js.map +0 -1
  791. package/dist/integrationsBuilder/utils/string.utils.d.ts +0 -1
  792. package/dist/integrationsBuilder/utils/string.utils.js +0 -9
  793. package/dist/integrationsBuilder/utils/string.utils.js.map +0 -1
  794. package/dist/integrationsBuilder/validators/index.d.ts +0 -18
  795. package/dist/integrationsBuilder/validators/index.js +0 -38
  796. package/dist/integrationsBuilder/validators/index.js.map +0 -1
  797. package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.d.ts +0 -3
  798. package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js +0 -10
  799. package/dist/integrationsBuilder/validators/joi-validators/create.integration.validator.js.map +0 -1
  800. package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.d.ts +0 -4
  801. package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js +0 -26
  802. package/dist/integrationsBuilder/validators/joi-validators/create.integrationApp.validator.js.map +0 -1
  803. package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.d.ts +0 -3
  804. package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js +0 -8
  805. package/dist/integrationsBuilder/validators/joi-validators/create.integrationCache.validator.js.map +0 -1
  806. package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.d.ts +0 -3
  807. package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js +0 -8
  808. package/dist/integrationsBuilder/validators/joi-validators/create.integrationDatabase.validator.js.map +0 -1
  809. package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.d.ts +0 -3
  810. package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js +0 -10
  811. package/dist/integrationsBuilder/validators/joi-validators/create.integrationEnv.validator.js.map +0 -1
  812. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.d.ts +0 -3
  813. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js +0 -60
  814. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFeature.validator.js.map +0 -1
  815. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.d.ts +0 -3
  816. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js +0 -8
  817. package/dist/integrationsBuilder/validators/joi-validators/create.integrationFunction.validator.js.map +0 -1
  818. package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.d.ts +0 -3
  819. package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js +0 -8
  820. package/dist/integrationsBuilder/validators/joi-validators/create.integrationJob.validator.js.map +0 -1
  821. package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.d.ts +0 -3
  822. package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js +0 -8
  823. package/dist/integrationsBuilder/validators/joi-validators/create.integrationNotification.validator.js.map +0 -1
  824. package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.d.ts +0 -3
  825. package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js +0 -9
  826. package/dist/integrationsBuilder/validators/joi-validators/update.integrationApp.validator.js.map +0 -1
  827. package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.d.ts +0 -3
  828. package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js +0 -8
  829. package/dist/integrationsBuilder/validators/joi-validators/update.integrationCache.validator.js.map +0 -1
  830. package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.d.ts +0 -3
  831. package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js +0 -8
  832. package/dist/integrationsBuilder/validators/joi-validators/update.integrationDatabase.validator.js.map +0 -1
  833. package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.d.ts +0 -3
  834. package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js +0 -8
  835. package/dist/integrationsBuilder/validators/joi-validators/update.integrationEnv.validator.js.map +0 -1
  836. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.d.ts +0 -3
  837. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js +0 -8
  838. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFeature.validator.js.map +0 -1
  839. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.d.ts +0 -3
  840. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js +0 -8
  841. package/dist/integrationsBuilder/validators/joi-validators/update.integrationFunction.validator copy.js.map +0 -1
  842. package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.d.ts +0 -3
  843. package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js +0 -8
  844. package/dist/integrationsBuilder/validators/joi-validators/update.integrationJob.validator.js.map +0 -1
  845. package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.d.ts +0 -3
  846. package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js +0 -8
  847. package/dist/integrationsBuilder/validators/joi-validators/update.integrationNotification.validator.js.map +0 -1
  848. package/dist/postman.d.ts +0 -1
  849. package/dist/postman.js +0 -21674
  850. package/dist/postman.js.map +0 -1
  851. package/dist/processor/services/fallback.service.d.ts +0 -5
  852. package/dist/processor/services/fallback.service.js +0 -43
  853. package/dist/processor/services/fallback.service.js.map +0 -1
  854. package/dist/processor/services/messagebrokers/aws-sqs.service.js +0 -77
  855. package/dist/processor/services/messagebrokers/aws-sqs.service.js.map +0 -1
  856. package/dist/processor/services/messagebrokers/google-pubsub.service.js.map +0 -1
  857. package/dist/processor/services/messagebrokers/index.d.ts +0 -3
  858. package/dist/processor/services/messagebrokers/index.js +0 -26
  859. package/dist/processor/services/messagebrokers/index.js.map +0 -1
  860. package/dist/processor/services/messagebrokers/kafka.service.d.ts +0 -14
  861. package/dist/processor/services/messagebrokers/kafka.service.js +0 -45
  862. package/dist/processor/services/messagebrokers/kafka.service.js.map +0 -1
  863. package/dist/processor/services/messagebrokers/messagebrokers.type.d.ts +0 -6
  864. package/dist/processor/services/messagebrokers/messagebrokers.type.js.map +0 -1
  865. package/dist/processor/services/messagebrokers/rabbitmq.service.js +0 -67
  866. package/dist/processor/services/messagebrokers/rabbitmq.service.js.map +0 -1
  867. package/dist/processor/services/messagebrokers/redis.service.js.map +0 -1
  868. package/dist/processor/services/quota.service.d.ts +0 -15
  869. package/dist/processor/services/quota.service.js +0 -63
  870. package/dist/processor/services/quota.service.js.map +0 -1
  871. package/dist/processor/utils/mongo.util.d.ts +0 -0
  872. package/dist/processor/utils/mongo.util.js +0 -152
  873. package/dist/processor/utils/mongo.util.js.map +0 -1
  874. package/dist/processor/utils/postgres.util.d.ts +0 -14
  875. package/dist/processor/utils/postgres.util.js +0 -83
  876. package/dist/processor/utils/postgres.util.js.map +0 -1
  877. package/dist/products/validators/joi-validators/create.product.validator.d.ts +0 -3
  878. package/dist/products/validators/joi-validators/create.product.validator.js +0 -10
  879. package/dist/products/validators/joi-validators/create.product.validator.js.map +0 -1
  880. package/dist/test/test.appBuilder.d.ts +0 -1
  881. package/dist/test/test.appBuilder.js +0 -16
  882. package/dist/test/test.appBuilder.js.map +0 -1
  883. package/dist/test/test.health.d.ts +0 -1
  884. package/dist/test/test.health.js +0 -49
  885. package/dist/test/test.health.js.map +0 -1
  886. package/dist/test/test.import.d.ts +0 -1
  887. package/dist/test/test.import.js +0 -1460
  888. package/dist/test/test.import.js.map +0 -1
  889. package/dist/test/test.import.openapi.d.ts +0 -1
  890. package/dist/test/test.import.openapi.js +0 -76
  891. package/dist/test/test.import.openapi.js.map +0 -1
  892. package/dist/test/test.imports.d.ts +0 -1
  893. package/dist/test/test.imports.js +0 -62
  894. package/dist/test/test.imports.js.map +0 -1
  895. package/dist/test/test.logs.d.ts +0 -1
  896. package/dist/test/test.logs.js +0 -18
  897. package/dist/test/test.logs.js.map +0 -1
  898. package/dist/test/test.processor.d.ts +0 -1
  899. package/dist/test/test.processor.js +0 -123
  900. package/dist/test/test.processor.js.map +0 -1
  901. package/dist/test/test.productBuilder.d.ts +0 -1
  902. package/dist/test/test.productBuilder.js +0 -661
  903. package/dist/test/test.productBuilder.js.map +0 -1
  904. package/dist/test.appBuilder.d.ts +0 -1
  905. package/dist/test.appBuilder.js +0 -14
  906. package/dist/test.appBuilder.js.map +0 -1
  907. package/dist/test.import.d.ts +0 -0
  908. package/dist/test.import.js +0 -24
  909. package/dist/test.import.js.map +0 -1
  910. package/dist/test.imports.d.ts +0 -1
  911. package/dist/test.imports.js +0 -28
  912. package/dist/test.imports.js.map +0 -1
  913. package/dist/test.integrationBuilder.d.ts +0 -1
  914. package/dist/test.integrationBuilder.js +0 -276
  915. package/dist/test.integrationBuilder.js.map +0 -1
  916. package/dist/test.processor.d.ts +0 -1
  917. package/dist/test.processor.js +0 -23
  918. package/dist/test.processor.js.map +0 -1
  919. package/dist/test.utils.d.ts +0 -1
  920. package/dist/test.utils.js +0 -25
  921. package/dist/test.utils.js.map +0 -1
  922. package/dist/types/integrationsBuilder.types.d.ts +0 -276
  923. package/dist/types/integrationsBuilder.types.js +0 -51
  924. package/dist/types/integrationsBuilder.types.js.map +0 -1
  925. /package/dist/{actions/actions.repo.d.ts → pricing/pricing.repo.d.ts} +0 -0
  926. /package/dist/{appBuilder/validators/joi-validators/create.app.validator.d.ts → products/validators/joi-validators/create.productGraph.validator.d.ts} +0 -0
  927. /package/dist/{appBuilder/validators/joi-validators/update.validation.entityData.validator.d.ts → products/validators/joi-validators/update.productGraph.validator.d.ts} +0 -0
  928. /package/dist/{actions/actions.service.d.ts → types/request-tracker.interface.d.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,6 +1,20 @@
1
- import { ImportDocsTypes, IApp, IAppConstants, IAppEnv, IAppVariables, IAppWebhook, IAppWebhookEvent, ICreateAppBuilder, IProduct, IProductApp, IProductCache, IProductDatabase, IProductDatabaseAction, IProductEnv, IProductFeature, IProductJobs, IProductStorage, IProcessorInput, IActionProcessorInput, IDBActionProcessorInput, IProductMessageBroker, IProductNotification, INotificationProcessorInput, IProductNotificationTemplate, IStorageProcessorInput, IParsedSample, IRegisterWebhook, IGenerateWebhookLink, IAppAuth, IMessageBrokerPublishInput, IMessageBrokerSubscribeInput, IProductMessageBrokerTopic, IAppAction, IProductDatabaseMigration, LogQueryParams, IProductQuota, FetchRemoteCachePayload, IFileReadResult, IProductSession, ISessionInput, IActionUpdate, IProductFallback, IFetchFilesPayload, ISessionPayload, ISessionRefreshPayload, IFetchUsersPayload, IProductAppHealth } from './types';
1
+ import { ImportDocsTypes, IApp, IAppConstants, IAppEnv, IAppVariables, IAppWebhook, IAppWebhookEvent, ICreateAppBuilder, IProduct, IProductApp, IProductCache, IProductDatabase, IProductEnv, IProductJobs, IProductStorage, IActionProcessorInput, IProductMessageBroker, IProductNotification, INotificationProcessorInput, IProductNotificationTemplate, IStorageProcessorInput, IParsedSample, IRegisterWebhook, IGenerateWebhookLink, IAppAuth, IProductMessageBrokerTopic, IAppAction, LogQueryParams, IProductQuota, FetchRemoteCachePayload, IFileReadResult, IProductSession, IActionUpdate, IProductFallback, IFetchUsersPayload, IActionDispatchInput, INotificationDispatchInput, IStorageDispatchInput, IPublishDispatchInput, IDispatchResult, IDispatchSchedule } from './types';
2
2
  import { IDuctapeInit } from './types/index.types';
3
3
  import { PublicStates } from './types/enums';
4
+ import { DatabaseService, IActionCreateOptions, IActionUpdateOptions, ISimpleSchemaDefinition, ISimpleCreateOptions, ISimpleDropOptions, ISimpleFieldDefinition, SimpleFieldType, ISimpleIndexOptions, ISchemaOperationResult, IIndexFieldDefinition, ITableSchema, ITableInfo, IIndexInfo } from './database';
5
+ import { IConstraintDefinition as IMigrationConstraintDefinition } from './database/types/migration.interface';
6
+ import { IDBActionDispatchInput } from './types/processor.types';
7
+ import { IGraphConfig } from './graph';
8
+ import { WorkflowService } from './workflows';
9
+ import { IHealthcheckDefineOptions, IDefinedHealthcheck, IQuotaDefineOptions, IDefinedQuota, IFallbackDefineOptions, IDefinedFallback } from './resilience';
10
+ import { AgentsService } from './agents';
11
+ import { ModelService } from './models';
12
+ import { ICreateVectorDbOptions, VectorDatabaseService } from './vector';
13
+ import { IShareCredentialsConfig } from './apps/utils/credential-manager';
14
+ import { IOAuthConfig } from './apps/utils/oauth-manager';
15
+ import { JobsService, JobStatus, IJobListOptions, ICancelOptions, IRetryOptions, IRescheduleOptions, IJobWebhookConfig } from './jobs';
16
+ import { SecretsService, ICreateSecretInput, IUpdateSecretInput, ISecretMetadata, ISecret, IResolveSecretsOptions } from './secrets';
17
+ import { IWarehouseQuery, IDataSource } from './warehouse';
4
18
  /**
5
19
  * @typedef {Object} IProduct
6
20
  * @property {string} tag - Unique product tag.
@@ -207,12 +221,45 @@ import { PublicStates } from './types/enums';
207
221
  * @property {any} input - Health check input data.
208
222
  * @see ts/src/types/productsBuilder.types.ts
209
223
  */
224
+ export { GraphService } from './graph';
225
+ export { GraphType, TraversalDirection, NodeIndexType, NodeConstraintType, GraphIsolationLevel, GraphTransactionStatus, GraphErrorType, GraphFeature, GraphSortOrder, } from './graph';
226
+ export type { IGraphEnvConfig, IGraphConfig, IGraphConnectionConfig, IGraphConnectionOptions, IGraphConnectionResult, IGraphConnectionContext, IGraphServiceConfig, IGraphTestConnectionResult, IGraphFilterOperator, IGraphWhereClause, IRawQueryOptions, IRawQueryResult, ICountNodesOptions, ICountNodesResult, ICountRelationshipsOptions, ICountRelationshipsResult, IGraphStatistics, IFullTextSearchOptions, IFullTextSearchResult, IVectorSearchOptions, IVectorSearchResult, NodeProperties, INode, ICreateNodeOptions, ICreateNodeResult, IFindNodesOptions, IGraphOrderBy, IFindNodesResult, IUpdateNodeOptions, INodePropertyUpdate, IUpdateNodeResult, IDeleteNodeOptions, IDeleteNodeResult, IMergeNodeOptions, IMergeNodeResult, INodeFilter, RelationshipProperties, IRelationship, ICreateRelationshipOptions, ICreateRelationshipResult, IFindRelationshipsOptions, IFindRelationshipsResult, IUpdateRelationshipOptions, IRelationshipPropertyUpdate, IUpdateRelationshipResult, IDeleteRelationshipOptions, IDeleteRelationshipResult, IMergeRelationshipOptions, IMergeRelationshipResult, IRelationshipFilter, ICreateRelationshipIndexOptions, IPath, ITraverseOptions, ITraverseResult, IShortestPathOptions, IShortestPathResult, IAllPathsOptions, IAllPathsResult, INeighborhoodOptions, INeighborhoodResult, IConnectedComponentsOptions, IConnectedComponent, IConnectedComponentsResult, IGraphTransaction, IGraphTransactionOptions, TransactionCallback, IGraphTransactionResult, ICreateNodeIndexOptions, ICreateNodeConstraintOptions, IGraphIndex, IGraphConstraint, IListIndexesResult, IListConstraintsResult, ICreateIndexResult, ICreateConstraintResult, IDropIndexResult, IDropConstraintResult, GraphPropertyType, IGraphLabelProperty, IGraphLabel, IListLabelsResult, IGraphRelationshipType, IListRelationshipTypesResult, GraphActionParameterType, IGraphActionParameter, IGraphAction, ICreateGraphActionOptions, IUpdateGraphActionOptions, IExecuteGraphActionOptions, IExecuteGraphActionResult, IListGraphActionsResult, } from './graph';
227
+ export { GraphError } from './graph';
228
+ export { BaseGraphAdapter, Neo4jAdapter, NeptuneAdapter, ArangoDBAdapter, MemgraphAdapter, GraphAdapterFactory, } from './graph';
229
+ export type { IAdapterConnectionOptions } from './graph';
230
+ export { WorkflowService, WorkflowError, workflowService } from './workflows';
231
+ export { WorkflowBuilder, createWorkflow } from './workflows';
232
+ export type { IWorkflowServiceConfig, IWorkflowConfig, IWorkflowContext, IWorkflowContextMeta, IDefineWorkflowOptions, IExecuteWorkflowOptions, IWorkflowExecutionResult, IWorkflowDispatchInput, IWorkflowDispatchResult, IWorkflowSchedule, ISendSignalOptions, IQueryWorkflowOptions, IWorkflowActionContext, IWorkflowDatabaseContext, IWorkflowGraphContext, IWorkflowNotificationContext, IWorkflowStorageContext, IWorkflowPublishContext, IWorkflowFeatureContext, IWorkflowQuotaContext, IWorkflowFallbackContext, IWorkflowHealthcheckContext, WorkflowHandler, IStepBuilder, IRollbackBuilder, IWorkflowBuilder, } from './workflows';
233
+ export { AgentsService, AgentError, agentsService } from './agents';
234
+ export { AgentExecutor, AgentContext, ToolRegistry, MemoryManager, createLLMProvider, AnthropicProvider, OpenAIProvider, VectorServiceAdapter, createVectorStoreAdapter, createPineconeAdapter, createQdrantAdapter, createWeaviateAdapter, createMemoryAdapter, } from './agents';
235
+ export type { IAgentServiceConfig, IDefineAgentOptions, IDefinedAgent, IRunAgentOptions, IAgentExecutionResult, IDispatchAgentOptions, IDispatchAgentResult, ISendAgentSignalOptions, IAgentStatusOptions, IAgentState, IListAgentExecutionsOptions, IAgentExecutionListResult, IAgentTool, IAgentToolSchema, IToolParam, IToolCallResult, ILLMConfig, LLMProvider, IAgentMemoryConfig, IAgentTerminationConfig, IAgentStreamEvent, IAgentToolContext, IConversationMessage, ITokenUsage, AgentStatus, IHumanInLoopConfig, IApprovalRequest, IApprovalResponse, IMultiAgentWorkflow, MultiAgentMode, } from './agents';
236
+ export { StorageService, StorageError } from './storage';
237
+ export { uploadBlobToCloud, downloadBlobFromCloud, deleteBlobFromCloud, listBlobsInCloud, generateSignedUrl, } from './storage';
238
+ export type { IStorageServiceConfig, IUploadOptions, IDownloadOptions, IDeleteOptions, IListFilesOptions, ISignedUrlOptions, IStorageResult, IDownloadResult, IDeleteResult as IStorageDeleteResult, IListFilesResult, ISignedUrlResult, IStorageDispatchOptions, IStorageDispatchResult, IStorageProviderConfig, IStorageFileInfo, } from './storage';
239
+ export { SessionsService, SessionError } from './sessions';
240
+ export type { ISessionServiceConfig, ICreateSessionOptions, IRefreshSessionOptions, IVerifySessionOptions, IRevokeSessionOptions, IListSessionsOptions, IDefineSessionOptions, ISessionResult, IVerifyResult, IListSessionsResult, ISessionInfo, ISessionSchema, ISessionSchemaField, ISessionContext, IDefinedSession, } from './sessions';
241
+ export { CacheService, CacheError, cacheLogger, CacheLogger } from './cache';
242
+ export type { ICacheServiceConfig, ICacheValue, IFetchCacheValuesOptions, IFetchCacheValuesResult, IFetchCacheDashboardOptions, ICacheDashboardMetrics, IClearCacheValueOptions, IClearCacheValuesOptions, IClearCacheValuesResult, ISetCacheValueOptions, IGetCacheValueOptions, IDeleteCacheValueOptions, IDeleteCacheValuesOptions, IDeleteCacheValuesResult, } from './cache';
243
+ export { BrokersService, BrokerError } from './brokers';
244
+ export { RabbitMQService, KafkaService, SQSService, RedisService, GooglePubSubService, loadBrokerService, parseEventString, isValidSqsUrl, getSqsQueueUrl, } from './brokers';
245
+ export type { IBrokerServiceConfig, IPublishOptions, ISubscribeOptions, IPublishResult, ISubscribeResult, IMessageBrokerService, BrokerConfig, IBrokerBootstrapData, IBrokerDispatchOptions, } from './brokers';
246
+ export { NotificationsService, notificationsService } from './notifications';
247
+ export { NotificationChannelType, PushNotificationProvider, SmsProvider } from './notifications';
248
+ export type { IFirebaseCredential, IPushNotificationHandler, IPushNotificationInput, IPushOptions, IEmailHandler, IEmailInput, IEmailOptions, ISmsHandler, ISmsInput, ISmsOptions, ICallbackHandler, ICallbackInput, ICallbackOptions, INotificationTemplate, INotificationEnvConfig, INotificationDefinition, INotificationsServiceConfig, INotificationResult, IMultiChannelNotificationResult, INotificationOptions, } from './notifications';
249
+ export { VectorDatabaseService, VectorError, } from './vector';
250
+ export type { IVectorDatabaseServiceConfig, ICreateVectorDbOptions, IVectorDbEnvConfig, IUpdateVectorDbOptions, IFetchVectorOptions, IDeleteVectorConfigOptions, IProductVectorQueryOptions, IProductVectorUpsertOptions, IProductVectorFetchOptions, IProductVectorDeleteOptions, } from './vector';
251
+ export { BaseVectorAdapter, PineconeAdapter, QdrantAdapter, WeaviateAdapter, MemoryAdapter } from './vector';
252
+ export { VectorDBType, DistanceMetric, VectorIndexType, VectorErrorType, VectorFeature } from './vector';
253
+ export type { IAdapterConnectionOptions as IVectorAdapterConnectionOptions, IVectorEnvConfig, IVectorConfig, IVectorConnectionConfig, IVectorConnectionOptions, IVectorConnectionResult, IVectorConnectionContext, IVectorServiceConfig, IVectorTestConnectionResult, VectorMetadata, IVector, ISparseVector, IUpsertVectorsOptions, IUpsertVectorsResult, IMetadataFilter, MetadataFilterOperator, IMetadataFilterGroup, IQueryVectorsOptions, IQueryMatch, IQueryVectorsResult, IFetchVectorsOptions, IFetchVectorsResult, IUpdateVectorOptions, IUpdateVectorResult, IDeleteVectorsOptions, IDeleteVectorsResult, IListVectorsOptions, IListVectorsResult, INamespaceInfo, IListNamespacesResult, IVectorIndexInfo, ICreateIndexOptions as IVectorCreateIndexOptions, ICreateIndexResult as IVectorCreateIndexResult, IDeleteIndexOptions as IVectorDeleteIndexOptions, IDeleteIndexResult as IVectorDeleteIndexResult, IVectorIndexStats, EmbeddingProvider, IEmbeddingModelConfig, IEmbedOptions, IEmbeddingResult, IBatchEmbeddingResult, IEmbeddingProvider, IOpenAIEmbeddingConfig, ICohereEmbeddingConfig, IVoyageEmbeddingConfig, IJinaEmbeddingConfig, IHuggingFaceEmbeddingConfig, ILocalEmbeddingConfig, } from './vector';
254
+ export { SecretsService } from './secrets';
255
+ export { SECRET_PATTERN, SECRET_PATTERN_GLOBAL, SecretNotFoundError, SecretScopeError, SecretEnvironmentError, SecretExpiredError, SecretRevokedError, SecretResolutionError, isSecretReference, containsSecretReferences, extractSecretKeys, findAllSecretReferences, mightContainSecrets, } from './secrets';
256
+ export type { SecretTokenType, ICreateSecretInput, IUpdateSecretInput, ISecretMetadata, ISecret, ISecretCheck, IResolveSecretsOptions, ISecretResolutionResult, ISecretsServiceConfig, ISecretsService, } from './secrets';
210
257
  export interface IDuctape {
211
258
  }
212
259
  export default class Ductape implements IDuctape {
213
260
  private user_id;
214
261
  private workspace_id;
215
- private private_key;
262
+ private accessKey;
216
263
  private public_key;
217
264
  private session;
218
265
  private token;
@@ -222,12 +269,25 @@ export default class Ductape implements IDuctape {
222
269
  private appApi;
223
270
  private productsApi;
224
271
  private workspaceApi;
225
- private productBuilder;
272
+ private productBuilders;
273
+ private appBuilders;
274
+ private _databaseService;
275
+ private _graphService;
276
+ private _workflowService;
277
+ private _agentsService;
278
+ private _modelService;
279
+ private _vectorService;
280
+ private _warehouseService;
281
+ private _cacheService;
282
+ private _jobsService;
283
+ private _secretsService;
284
+ private _privateKey;
285
+ private _quotaService;
286
+ private _fallbackService;
287
+ private _healthcheckService;
288
+ private _brokersService;
226
289
  private loggerService;
227
- private appBuilder;
228
290
  private importService;
229
- private productInit;
230
- private appInit;
231
291
  private environment;
232
292
  private redis_url;
233
293
  private redisClient?;
@@ -238,7 +298,12 @@ export default class Ductape implements IDuctape {
238
298
  healthCheckWorker: any;
239
299
  healthCheckUpdaterWorker: any;
240
300
  private loadRedis;
241
- constructor({ workspace_id, private_key, user_id, env_type, redis_url }: IDuctapeInit);
301
+ /**
302
+ * Connect to Redis for caching purposes (lazy initialization)
303
+ * This is separate from monitor() which sets up job queues
304
+ */
305
+ private connectCacheRedis;
306
+ constructor({ accessKey, env_type, redis_url }: IDuctapeInit);
242
307
  private loadBullMQ;
243
308
  /**
244
309
  * Connects to Redis and initializes job and health check queues and workers.
@@ -255,6 +320,8 @@ export default class Ductape implements IDuctape {
255
320
  * If interval is not provided, defaults to 60s.
256
321
  */
257
322
  private scheduleHealthcheckJob;
323
+ setUserId(user_id: string): void;
324
+ setWorkspaceId(workspace_id: string): void;
258
325
  /**
259
326
  * Sets the authentication token for API requests.
260
327
  * @param {string} token - The authentication token.
@@ -265,12 +332,12 @@ export default class Ductape implements IDuctape {
265
332
  * @param {string} public_key - The public key.
266
333
  */
267
334
  setPublicKey(public_key: string): void;
268
- private initProduct;
269
- private initApp;
270
- private checkProductInit;
271
- private checkAppInit;
335
+ private getProductBuilder;
336
+ private getAppBuilder;
337
+ private initProductBuilder;
338
+ private initAppBuilder;
272
339
  /**
273
- * Product-related operations for managing products, sessions, apps, quotas, and fallbacks.
340
+ * Product-related operations for managing products.
274
341
  */
275
342
  product: {
276
343
  /**
@@ -293,81 +360,93 @@ export default class Ductape implements IDuctape {
293
360
  */
294
361
  update: (tag: string, data: Partial<IProduct>) => Promise<void>;
295
362
  /**
296
- * Initializes a product by tag.
297
- * @param {string} productTag - The product tag.
363
+ * Initializes a product by tag (pre-loads builder into cache).
364
+ * @param {string} product - The product tag.
298
365
  * @returns {Promise<void>} Resolves when initialization is complete. Throws on error.
299
366
  */
300
- init: (productTag: string) => Promise<void>;
301
- sessions: {
302
- /**
303
- * Creates a new product session.
304
- * @param {IProductSession} payload - The session payload.
305
- * @returns {Promise<void>} Resolves when the session is created. Throws on error.
306
- */
307
- create: (payload: IProductSession) => Promise<void>;
367
+ init: (product: string) => Promise<void>;
368
+ /**
369
+ * Updates data validation for a product.
370
+ * @param {string} product - The product tag.
371
+ * @param {string} tag - The validation tag.
372
+ * @param {Partial<IParsedSample>} update - The update data.
373
+ * @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
374
+ */
375
+ updateValidation: (product: string, tag: string, update: Partial<IParsedSample>) => Promise<boolean>;
376
+ environments: {
308
377
  /**
309
- * Updates a product session by tag.
310
- * @param {string} tag - The session tag.
311
- * @param {Partial<IProductSession>} payload - The session data to update.
312
- * @returns {Promise<void>} Resolves when the session is updated. Throws on error.
378
+ * Creates an environment for a product.
379
+ * @param {string} product - The product tag.
380
+ * @param {IProductEnv} data - The environment data.
381
+ * @returns {Promise<void>} Resolves when the environment is created. Throws on error.
313
382
  */
314
- update: (tag: string, payload: Partial<IProductSession>) => Promise<void>;
383
+ create: (product: string, data: IProductEnv) => Promise<void>;
315
384
  /**
316
- * Fetches all product sessions.
317
- * @returns {IProductSession[]} The list of sessions.
385
+ * Fetches all environments for a product.
386
+ * @param {string} product - The product tag.
387
+ * @returns {IAppEnv[]} The list of environments.
318
388
  */
319
- fetchAll: () => IProductSession[];
389
+ list: (product: string) => Promise<IProductEnv[]>;
320
390
  /**
321
- * Fetches a product session by tag.
322
- * @param {string} tag - The session tag.
323
- * @returns {IProductSession|null} The fetched session, or null if not found.
391
+ * Fetches an environment by slug.
392
+ * @param {string} product - The product tag.
393
+ * @param {string} slug - The environment slug.
394
+ * @returns {IAppEnv|null} The fetched environment, or null if not found.
324
395
  */
325
- fetch: (tag: string) => IProductSession;
396
+ fetch: (product: string, slug: string) => Promise<IProductEnv>;
326
397
  /**
327
- * Fetches users for a session.
328
- * @param {IFetchUsersPayload} data - The user fetch payload.
329
- * @returns {Promise<any[]>} The users for the session.
398
+ * Updates an environment by slug.
399
+ * @param {string} product - The product tag.
400
+ * @param {string} slug - The environment slug.
401
+ * @param {Partial<IProductEnv>} data - The environment data to update.
402
+ * @returns {Promise<void>} Resolves when the environment is updated. Throws on error.
330
403
  */
331
- users: (data: IFetchUsersPayload) => Promise<import("./types").IFileURLPayload[]>;
404
+ update: (product: string, slug: string, data: Partial<IProductEnv>) => Promise<void>;
332
405
  };
333
406
  apps: {
334
407
  /**
335
408
  * Connects an app to a product by app tag.
409
+ * @param {string} product - The product tag.
336
410
  * @param {string} appTag - The app tag.
337
411
  * @returns {Promise<IAppAccess>} The result of the connection.
338
412
  */
339
- connect: (appTag: string) => Promise<import("./types").IAppAccess>;
413
+ connect: (product: string, appTag: string) => Promise<import("./types").IAppAccess>;
340
414
  /**
341
415
  * Adds an app to a product.
416
+ * @param {string} product - The product tag.
342
417
  * @param {IProductApp} app - The app data.
343
418
  * @returns {Promise<void>} Resolves when the app is added. Throws on error.
344
419
  */
345
- add: (app: IProductApp) => Promise<void>;
420
+ add: (product: string, app: IProductApp) => Promise<void>;
346
421
  /**
347
422
  * Fetches all apps for a product.
423
+ * @param {string} product - The product tag.
348
424
  * @returns {IProductApp[]} The list of apps.
349
425
  */
350
- fetchAll: () => Promise<IProductApp[]>;
426
+ list: (product: string) => Promise<IProductApp[]>;
351
427
  /**
352
428
  * Fetches an app by tag.
429
+ * @param {string} product - The product tag.
353
430
  * @param {string} tag - The app tag.
354
431
  * @returns {IProductApp|null} The fetched app, or null if not found.
355
432
  */
356
- fetch: (tag: string) => Promise<IProductApp>;
433
+ fetch: (product: string, tag: string) => Promise<IProductApp>;
357
434
  /**
358
435
  * Updates an app by access tag.
436
+ * @param {string} product - The product tag.
359
437
  * @param {string} accessTag - The app access tag.
360
438
  * @param {Partial<IProductApp>} data - The app data to update.
361
439
  * @returns {Promise<void>} Resolves when the app is updated. Throws on error.
362
440
  */
363
- update: (accessTag: string, data: Partial<IProductApp>) => Promise<void>;
441
+ update: (product: string, accessTag: string, data: Partial<IProductApp>) => Promise<void>;
364
442
  webhooks: {
365
443
  /**
366
444
  * Fetches all webhooks for an app by access tag.
445
+ * @param {string} product - The product tag.
367
446
  * @param {string} accessTag - The app access tag.
368
447
  * @returns {Promise<IAppWebhook[]>} The list of webhooks.
369
448
  */
370
- fetchAll: (accessTag: string) => Promise<IAppWebhook[]>;
449
+ list: (product: string, accessTag: string) => Promise<IAppWebhook[]>;
371
450
  /**
372
451
  * Enables a webhook for an app.
373
452
  * @param {IRegisterWebhook} data - The webhook registration data.
@@ -381,420 +460,2901 @@ export default class Ductape implements IDuctape {
381
460
  */
382
461
  generateLink: (data: IGenerateWebhookLink) => Promise<string>;
383
462
  };
384
- health: {
385
- /**
386
- * Creates a health check for an app.
387
- * @param {Partial<IProductAppHealth>} data - The health check data.
388
- * @returns {Promise<void>} Resolves when the health check is created. Throws on error.
389
- */
390
- create: (data: Partial<IProductAppHealth>) => Promise<void>;
391
- /**
392
- * Updates a health check by tag.
393
- * @param {string} tag - The health check tag.
394
- * @param {Partial<IProductAppHealth>} data - The health check data to update.
395
- * @returns {Promise<void>} Resolves when the health check is updated. Throws on error.
396
- */
397
- update: (tag: string, data: Partial<IProductAppHealth>) => Promise<void>;
398
- /**
399
- * Fetches a health check by access tag and tag.
400
- * @param {string} access_tag - The app access tag.
401
- * @param {string} tag - The health check tag.
402
- * @returns {Promise<IProductAppHealth|null>} The fetched health check, or null if not found.
403
- */
404
- fetch: (access_tag: string, tag: string) => Promise<IProductAppHealth>;
405
- /**
406
- * Fetches all health checks for an app by access tag.
407
- * @param {string} access_tag - The app access tag.
408
- * @returns {Promise<IProductAppHealth[]>} The list of health checks.
409
- */
410
- fetchAll: (access_tag: string) => Promise<IProductAppHealth[]>;
411
- };
412
463
  };
464
+ };
465
+ /**
466
+ * Session-related operations for managing product sessions.
467
+ */
468
+ sessions: {
469
+ /**
470
+ * Creates a new product session.
471
+ * @param {string} product - The product tag.
472
+ * @param {IProductSession} payload - The session payload.
473
+ * @returns {Promise<void>} Resolves when the session is created. Throws on error.
474
+ */
475
+ create: (product: string, payload: IProductSession) => Promise<void>;
476
+ /**
477
+ * Updates a product session by tag.
478
+ * @param {string} product - The product tag.
479
+ * @param {string} tag - The session tag.
480
+ * @param {Partial<IProductSession>} payload - The session data to update.
481
+ * @returns {Promise<void>} Resolves when the session is updated. Throws on error.
482
+ */
483
+ update: (product: string, tag: string, payload: Partial<IProductSession>) => Promise<void>;
484
+ /**
485
+ * Fetches all product sessions.
486
+ * @param {string} product - The product tag.
487
+ * @returns {IProductSession[]} The list of sessions.
488
+ */
489
+ list: (product: string) => Promise<IProductSession[]>;
490
+ /**
491
+ * Fetches a product session by tag.
492
+ * @param {string} product - The product tag.
493
+ * @param {string} tag - The session tag.
494
+ * @returns {IProductSession|null} The fetched session, or null if not found.
495
+ */
496
+ fetch: (product: string, tag: string) => Promise<IProductSession>;
497
+ /**
498
+ * Fetches users for a session.
499
+ * @param {string} product - The product tag.
500
+ * @param {IFetchUsersPayload} data - The user fetch payload.
501
+ * @returns {Promise<any[]>} The users for the session.
502
+ */
503
+ users: (data: IFetchUsersPayload) => Promise<import("./types").IFileURLPayload[]>;
504
+ /**
505
+ * Deletes a product session by tag.
506
+ * @param {string} product - The product tag.
507
+ * @param {string} tag - The session tag.
508
+ * @returns {Promise<void>} Resolves when the session is deleted. Throws on error.
509
+ */
510
+ delete: (product: string, tag: string) => Promise<void>;
511
+ /**
512
+ * Starts a new session and generates session tokens.
513
+ * @param data - The session input data.
514
+ * @returns The generated session tokens.
515
+ */
516
+ start: (data: {
517
+ product: string;
518
+ env: string;
519
+ tag: string;
520
+ data: Record<string, unknown>;
521
+ }) => Promise<import("./sessions").ISessionResult>;
522
+ /**
523
+ * Verifies a session token.
524
+ * @param data - The session verification payload.
525
+ * @returns The verification result with session data.
526
+ */
527
+ verify: (data: {
528
+ product: string;
529
+ env: string;
530
+ tag: string;
531
+ token: string;
532
+ }) => Promise<import("./sessions").IVerifyResult>;
533
+ /**
534
+ * Refreshes a session using the refresh token.
535
+ * @param data - The session refresh payload.
536
+ * @returns The new session tokens.
537
+ */
538
+ refresh: (data: {
539
+ product: string;
540
+ env: string;
541
+ tag: string;
542
+ refreshToken: string;
543
+ }) => Promise<import("./sessions").ISessionResult>;
544
+ /**
545
+ * Revokes a session.
546
+ * @param data - The session revocation payload.
547
+ * @returns The revocation result.
548
+ */
549
+ revoke: (data: {
550
+ product: string;
551
+ env: string;
552
+ tag: string;
553
+ sessionId?: string;
554
+ identifier?: string;
555
+ }) => Promise<void>;
556
+ /**
557
+ * Lists active sessions with pagination.
558
+ * @param data - The list sessions payload.
559
+ * @returns The list of sessions with pagination info.
560
+ */
561
+ listActive: (data: {
562
+ product: string;
563
+ env: string;
564
+ tag: string;
565
+ identifier?: string;
566
+ page?: number;
567
+ limit?: number;
568
+ }) => Promise<import("./sessions").IListSessionsResult>;
569
+ /**
570
+ * Fetches paginated session users.
571
+ * @param data - The fetch users payload.
572
+ * @returns The paginated list of session users.
573
+ */
574
+ fetchUsers: (data: {
575
+ product: string;
576
+ session: string;
577
+ env?: string;
578
+ page?: number;
579
+ limit?: number;
580
+ }) => Promise<import("./sessions").IFetchSessionUsersResult>;
581
+ /**
582
+ * Fetches detailed information for a specific session user.
583
+ * @param data - The fetch user details payload.
584
+ * @returns The user details with their sessions.
585
+ */
586
+ fetchUserDetails: (data: {
587
+ product: string;
588
+ session: string;
589
+ identifier: string;
590
+ env?: string;
591
+ }) => Promise<import("./sessions").ISessionUserDetails>;
592
+ /**
593
+ * Fetches session dashboard metrics.
594
+ * @param data - The fetch dashboard payload.
595
+ * @returns The dashboard metrics for the session.
596
+ */
597
+ fetchDashboard: (data: {
598
+ product: string;
599
+ session: string;
600
+ env?: string;
601
+ }) => Promise<import("./sessions").ISessionDashboardMetrics>;
602
+ };
603
+ /**
604
+ * Quota-related operations for managing product quotas with weighted distribution.
605
+ */
606
+ quota: {
607
+ /**
608
+ * Defines a quota using code-first API.
609
+ * @param {IQuotaDefineOptions} options - The quota definition options.
610
+ * @param {string} [options.product] - The product tag (if provided, registers immediately).
611
+ * @param {string} options.tag - The quota tag.
612
+ * @param {string} [options.name] - The quota name.
613
+ * @param {string} [options.description] - The quota description.
614
+ * @param {Object} [options.input] - The input schema definition.
615
+ * @param {Function} options.handler - The handler function to configure the quota.
616
+ * @returns {Promise<IDefinedQuota>} The defined quota.
617
+ */
618
+ define: (options: IQuotaDefineOptions) => Promise<IDefinedQuota>;
413
619
  /**
414
620
  * Creates a quota for a product.
415
- * @param {Partial<IProductQuota>} data - The quota data.
416
- * @returns {Promise<void>} Resolves when the quota is created. Throws on error.
621
+ * @param {string} product - The product tag.
622
+ * @param {any} data - The quota data (schema or defined quota).
623
+ * @returns {Promise<any>} The created quota schema.
417
624
  */
418
- quota: {
419
- create: (data: Partial<IProductQuota>) => Promise<void>;
420
- /**
421
- * Fetches a quota by tag.
422
- * @param {string} tag - The quota tag.
423
- * @returns {IProductQuota|null} The fetched quota, or null if not found.
424
- */
425
- fetch: (tag: string) => IProductQuota;
426
- /**
427
- * Fetches all quotas for a product.
428
- * @returns {IProductQuota[]} The list of quotas.
429
- */
430
- fetchAll: () => IProductQuota[];
431
- /**
432
- * Updates a quota by tag.
433
- * @param {string} tag - The quota tag.
434
- * @param {Partial<IProductQuota>} data - The quota data to update.
435
- * @returns {Promise<void>} Resolves when the quota is updated. Throws on error.
436
- */
437
- update: (tag: string, data: Partial<IProductQuota>) => Promise<void>;
438
- };
625
+ create: (product: string, data: any) => Promise<IProductQuota>;
626
+ /**
627
+ * Fetches a quota by tag.
628
+ * @param {string} product - The product tag.
629
+ * @param {string} tag - The quota tag.
630
+ * @returns {Promise<any>} The fetched quota.
631
+ */
632
+ fetch: (product: string, tag: string) => Promise<IProductQuota>;
633
+ /**
634
+ * Fetches all quotas for a product.
635
+ * @param {string} product - The product tag.
636
+ * @returns {Promise<any[]>} The list of quotas.
637
+ */
638
+ list: (product: string) => Promise<IProductQuota[]>;
639
+ /**
640
+ * Updates a quota by tag.
641
+ * @param {string} product - The product tag.
642
+ * @param {string} tag - The quota tag.
643
+ * @param {any} data - The quota data to update.
644
+ * @returns {Promise<any>} The updated quota schema.
645
+ */
646
+ update: (product: string, tag: string, data: any) => Promise<void>;
647
+ /**
648
+ * Deletes a quota by tag.
649
+ * @param {string} product - The product tag.
650
+ * @param {string} tag - The quota tag.
651
+ * @returns {Promise<void>} Resolves when the quota is deleted.
652
+ */
653
+ delete: (product: string, tag: string) => Promise<void>;
654
+ /**
655
+ * Runs a quota with weighted distribution.
656
+ * @param {Object} data - The quota run input.
657
+ * @param {string} data.product - The product tag.
658
+ * @param {string} data.env - The environment slug.
659
+ * @param {string} data.tag - The quota tag.
660
+ * @param {Record<string, unknown>} data.input - The input data for the quota.
661
+ * @returns {Promise<any>} The result of the quota execution.
662
+ */
663
+ run: (data: {
664
+ product: string;
665
+ env: string;
666
+ tag: string;
667
+ input: Record<string, unknown>;
668
+ }) => Promise<import("./resilience/quota.service").IQuotaRunResult<unknown>>;
669
+ /**
670
+ * Dispatches a quota for deferred execution.
671
+ * @param {Object} data - The quota dispatch input.
672
+ * @param {string} data.product - The product tag.
673
+ * @param {string} data.env - The environment slug.
674
+ * @param {string} data.tag - The quota tag.
675
+ * @param {Record<string, unknown>} data.input - The input data for the quota.
676
+ * @param {IDispatchSchedule} [data.schedule] - Optional schedule for deferred execution.
677
+ * @returns {Promise<{ jobId: string }>} The dispatch result with job ID.
678
+ */
679
+ dispatch: (data: {
680
+ product: string;
681
+ env: string;
682
+ tag: string;
683
+ input: Record<string, unknown>;
684
+ schedule?: IDispatchSchedule;
685
+ }) => Promise<{
686
+ jobId: string;
687
+ }>;
688
+ };
689
+ /**
690
+ * Fallback-related operations for managing product fallbacks with sequential failover.
691
+ */
692
+ fallback: {
693
+ /**
694
+ * Defines a fallback using code-first API.
695
+ * @param {IFallbackDefineOptions} options - The fallback definition options.
696
+ * @param {string} [options.product] - The product tag (if provided, registers immediately).
697
+ * @param {string} options.tag - The fallback tag.
698
+ * @param {string} [options.name] - The fallback name.
699
+ * @param {string} [options.description] - The fallback description.
700
+ * @param {Object} [options.input] - The input schema definition.
701
+ * @param {Function} options.handler - The handler function to configure the fallback.
702
+ * @returns {Promise<IDefinedFallback>} The defined fallback.
703
+ */
704
+ define: (options: IFallbackDefineOptions) => Promise<IDefinedFallback>;
439
705
  /**
440
706
  * Creates a fallback for a product.
441
- * @param {Partial<IProductFallback>} data - The fallback data.
442
- * @returns {Promise<void>} Resolves when the fallback is created. Throws on error.
707
+ * @param {string} product - The product tag.
708
+ * @param {any} data - The fallback data (schema or defined fallback).
709
+ * @returns {Promise<any>} The created fallback schema.
443
710
  */
444
- fallback: {
445
- create: (data: Partial<IProductFallback>) => Promise<void>;
446
- /**
447
- * Fetches a fallback by tag.
448
- * @param {string} tag - The fallback tag.
449
- * @returns {IProductFallback|null} The fetched fallback, or null if not found.
711
+ create: (product: string, data: any) => Promise<IProductFallback>;
712
+ /**
713
+ * Fetches a fallback by tag.
714
+ * @param {string} product - The product tag.
715
+ * @param {string} tag - The fallback tag.
716
+ * @returns {Promise<any>} The fetched fallback.
717
+ */
718
+ fetch: (product: string, tag: string) => Promise<IProductFallback>;
719
+ /**
720
+ * Fetches all fallbacks for a product.
721
+ * @param {string} product - The product tag.
722
+ * @returns {Promise<any[]>} The list of fallbacks.
723
+ */
724
+ list: (product: string) => Promise<IProductFallback[]>;
725
+ /**
726
+ * Updates a fallback by tag.
727
+ * @param {string} product - The product tag.
728
+ * @param {string} tag - The fallback tag.
729
+ * @param {any} data - The fallback data to update.
730
+ * @returns {Promise<any>} The updated fallback schema.
731
+ */
732
+ update: (product: string, tag: string, data: any) => Promise<void>;
733
+ /**
734
+ * Deletes a fallback by tag.
735
+ * @param {string} product - The product tag.
736
+ * @param {string} tag - The fallback tag.
737
+ * @returns {Promise<void>} Resolves when the fallback is deleted.
738
+ */
739
+ delete: (product: string, tag: string) => Promise<void>;
740
+ /**
741
+ * Runs a fallback with sequential failover.
742
+ * @param {Object} data - The fallback run input.
743
+ * @param {string} data.product - The product tag.
744
+ * @param {string} data.env - The environment slug.
745
+ * @param {string} data.tag - The fallback tag.
746
+ * @param {Record<string, unknown>} data.input - The input data for the fallback.
747
+ * @returns {Promise<any>} The result of the fallback execution.
748
+ */
749
+ run: (data: {
750
+ product: string;
751
+ env: string;
752
+ tag: string;
753
+ input: Record<string, unknown>;
754
+ }) => Promise<import("./resilience/fallback.service").IFallbackRunResult<unknown>>;
755
+ /**
756
+ * Dispatches a fallback for deferred execution.
757
+ * @param {Object} data - The fallback dispatch input.
758
+ * @param {string} data.product - The product tag.
759
+ * @param {string} data.env - The environment slug.
760
+ * @param {string} data.tag - The fallback tag.
761
+ * @param {Record<string, unknown>} data.input - The input data for the fallback.
762
+ * @param {IDispatchSchedule} [data.schedule] - Optional schedule for deferred execution.
763
+ * @returns {Promise<{ jobId: string }>} The dispatch result with job ID.
764
+ */
765
+ dispatch: (data: {
766
+ product: string;
767
+ env: string;
768
+ tag: string;
769
+ input: Record<string, unknown>;
770
+ schedule?: IDispatchSchedule;
771
+ }) => Promise<{
772
+ jobId: string;
773
+ }>;
774
+ };
775
+ /**
776
+ * Healthcheck-related operations for managing product healthchecks.
777
+ */
778
+ health: {
779
+ /**
780
+ * Defines a healthcheck using code-first API.
781
+ * @param {IHealthcheckDefineOptions} options - The healthcheck definition options.
782
+ * @param {string} [options.product] - The product tag (if provided, registers immediately).
783
+ * @param {string} options.tag - The healthcheck tag.
784
+ * @param {string} [options.name] - The healthcheck name.
785
+ * @param {string} [options.description] - The healthcheck description.
786
+ * @param {Function} options.handler - The handler function to configure the healthcheck.
787
+ * @returns {Promise<IDefinedHealthcheck>} The defined healthcheck.
788
+ */
789
+ define: (options: IHealthcheckDefineOptions) => Promise<IDefinedHealthcheck>;
790
+ /**
791
+ * Creates a healthcheck for a product.
792
+ * @param {string} product - The product tag.
793
+ * @param {Object} data - The healthcheck data (schema or defined healthcheck).
794
+ * @returns {Promise<IHealthcheckSchema>} The created healthcheck schema.
795
+ */
796
+ create: (product: string, data: any) => Promise<import("./resilience").IHealthcheckSchema>;
797
+ /**
798
+ * Fetches a healthcheck by tag.
799
+ * @param {string} product - The product tag.
800
+ * @param {string} tag - The healthcheck tag.
801
+ * @returns {Promise<IHealthcheckSchema>} The fetched healthcheck.
802
+ */
803
+ fetch: (product: string, tag: string) => Promise<import("./resilience").IHealthcheckSchema>;
804
+ /**
805
+ * Fetches all healthchecks for a product.
806
+ * @param {string} product - The product tag.
807
+ * @returns {Promise<IHealthcheckSchema[]>} The list of healthchecks.
808
+ */
809
+ list: (product: string) => Promise<import("./resilience").IHealthcheckSchema[]>;
810
+ /**
811
+ * Updates a healthcheck by tag.
812
+ * @param {string} product - The product tag.
813
+ * @param {string} tag - The healthcheck tag.
814
+ * @param {Object} data - The healthcheck data to update.
815
+ * @returns {Promise<IHealthcheckSchema>} The updated healthcheck schema.
816
+ */
817
+ update: (product: string, tag: string, data: any) => Promise<import("./resilience").IHealthcheckSchema>;
818
+ /**
819
+ * Deletes a healthcheck by tag.
820
+ * @param {string} product - The product tag.
821
+ * @param {string} tag - The healthcheck tag.
822
+ * @returns {Promise<void>} Resolves when the healthcheck is deleted.
823
+ */
824
+ delete: (product: string, tag: string) => Promise<void>;
825
+ /**
826
+ * Gets the current status of a healthcheck.
827
+ * @param {Object} options - The status check options.
828
+ * @param {string} options.product - The product tag.
829
+ * @param {string} options.env - The environment slug.
830
+ * @param {string} options.tag - The healthcheck tag.
831
+ * @returns {Promise<IHealthcheckStatus>} The healthcheck status.
832
+ */
833
+ status: (options: {
834
+ product: string;
835
+ env: string;
836
+ tag: string;
837
+ }) => Promise<import("./resilience").IHealthcheckStatus>;
838
+ /**
839
+ * Manually triggers a healthcheck run.
840
+ * @param {Object} options - The run options.
841
+ * @param {string} options.product - The product tag.
842
+ * @param {string} options.env - The environment slug.
843
+ * @param {string} options.tag - The healthcheck tag.
844
+ * @returns {Promise<IHealthcheckRunResult>} The result of the healthcheck run.
845
+ */
846
+ run: (options: {
847
+ product: string;
848
+ env: string;
849
+ tag: string;
850
+ }) => Promise<import("./resilience").IHealthcheckRunResult>;
851
+ /**
852
+ * Checks the health of a service (alias for status).
853
+ * @param {Object} options - The check options.
854
+ * @param {string} options.product - The product tag.
855
+ * @param {string} options.env - The environment slug.
856
+ * @param {string} options.tag - The healthcheck tag.
857
+ * @returns {Promise<IHealthcheckStatus>} The healthcheck status.
858
+ */
859
+ check: (options: {
860
+ product: string;
861
+ env: string;
862
+ tag: string;
863
+ }) => Promise<import("./resilience").IHealthcheckStatus>;
864
+ };
865
+ /**
866
+ * Storage-related operations for managing product storages.
867
+ */
868
+ storage: {
869
+ /**
870
+ * Creates a storage for a product.
871
+ * @param {string} product - The product tag.
872
+ * @param {IProductStorage} data - The storage data.
873
+ * @returns {Promise<void>} Resolves when the storage is created. Throws on error.
874
+ */
875
+ create: (data: IProductStorage & {
876
+ product: string;
877
+ }) => Promise<void>;
878
+ /**
879
+ * Creates a storage for a product (alternative method).
880
+ const builder = await this.getProductBuilder(product);
881
+ return builder.createStorage(data);
882
+ },
883
+ /**
884
+ * Fetches all storages for a product.
885
+ * @param {string} product - The product tag.
886
+ * @returns {IProductStorage[]} The list of storages.
887
+ */
888
+ list: (product: string) => Promise<IProductStorage[]>;
889
+ /**
890
+ * Fetches a storage by tag.
891
+ * @param {string} product - The product tag.
892
+ * @param {string} tag - The storage tag.
893
+ * @returns {IProductStorage|null} The fetched storage, or null if not found.
894
+ */
895
+ fetch: (product: string, tag: string) => Promise<IProductStorage>;
896
+ /**
897
+ * Updates a storage by tag.
898
+ * @param {string} product - The product tag.
899
+ * @param {string} tag - The storage tag.
900
+ * @param {Partial<IProductStorage>} data - The storage data to update.
901
+ * @returns {Promise<void>} Resolves when the storage is updated. Throws on error.
902
+ */
903
+ update: (product: string, tag: string, data: Partial<IProductStorage>) => Promise<void>;
904
+ /**
905
+ * Fetches storage files for a product.
906
+ * @param {string} product - The product tag.
907
+ * @param {IFetchFilesPayload} data - The fetch files payload.
908
+ * @returns {Promise<void>} Resolves when the storage files are fetched. Throws on error.
909
+ */
910
+ /**
911
+ * Deletes a storage by tag.
912
+ * @param {string} product - The product tag.
913
+ * @param {string} tag - The storage tag.
914
+ * @returns {Promise<void>} Resolves when the storage is deleted. Throws on error.
915
+ */
916
+ delete: (product: string, tag: string) => Promise<void>;
917
+ /**
918
+ * Tests connection to a storage provider.
919
+ * Validates storage configuration and attempts to list objects (with limit 1)
920
+ * to verify connectivity and credentials.
921
+ * @param data - The test connection options.
922
+ * @returns The connection test result.
923
+ * @example
924
+ * const result = await ductape.storage.testConnection({
925
+ * product: 'my-product',
926
+ * env: 'production',
927
+ * storage: 's3-bucket'
928
+ * });
929
+ * console.log(result.connected); // true or false
930
+ * console.log(result.latency); // connection latency in ms
931
+ */
932
+ testConnection: (data: {
933
+ product: string;
934
+ env: string;
935
+ storage: string;
936
+ }) => Promise<{
937
+ connected: boolean;
938
+ latency?: number;
939
+ error?: string;
940
+ }>;
941
+ /**
942
+ * Uploads a file to cloud storage (top-level convenience method).
943
+ * @param data - The upload options.
944
+ * @returns The upload result with file URL.
945
+ */
946
+ upload: (data: {
947
+ product: string;
948
+ env: string;
949
+ storage: string;
950
+ fileName: string;
951
+ buffer: string | Buffer;
952
+ mimeType?: string;
953
+ }) => Promise<import("./storage").IStorageResult>;
954
+ /**
955
+ * Downloads a file from cloud storage (top-level convenience method).
956
+ * @param data - The download options.
957
+ * @returns The download result with file data.
958
+ */
959
+ download: (data: {
960
+ product: string;
961
+ env: string;
962
+ storage: string;
963
+ fileName: string;
964
+ }) => Promise<import("./storage").IDownloadResult>;
965
+ /**
966
+ * Removes a file from cloud storage (top-level convenience method).
967
+ * @param data - The delete options.
968
+ * @returns The delete result.
969
+ */
970
+ remove: (data: {
971
+ product: string;
972
+ env: string;
973
+ storage: string;
974
+ fileName: string;
975
+ }) => Promise<import("./storage").IDeleteResult>;
976
+ /**
977
+ * Lists files in cloud storage with pagination (top-level convenience method).
978
+ * @param data - The list options.
979
+ * @returns The list result with files and pagination info.
980
+ */
981
+ listFiles: (data: {
982
+ product: string;
983
+ env: string;
984
+ cache?: string;
985
+ storage: string;
986
+ prefix?: string;
987
+ limit?: number;
988
+ continuationToken?: string;
989
+ }) => Promise<import("./storage").IListFilesResult>;
990
+ /**
991
+ * Generates a signed URL for temporary file access (top-level convenience method).
992
+ * @param data - The signed URL options.
993
+ * @returns The signed URL result.
994
+ */
995
+ getSignedUrl: (data: {
996
+ product: string;
997
+ env: string;
998
+ storage: string;
999
+ fileName: string;
1000
+ expiresIn?: number;
1001
+ action?: "read" | "write";
1002
+ }) => Promise<import("./storage").ISignedUrlResult>;
1003
+ /**
1004
+ * Gets storage statistics (file counts and sizes by type).
1005
+ * Efficiently counts all files without downloading content.
1006
+ * @param data - The stats options.
1007
+ * @returns The stats result with total counts and breakdown by type.
1008
+ * @example
1009
+ * const stats = await ductape.storage.stats({
1010
+ * product: 'my-product',
1011
+ * env: 'production',
1012
+ * storage: 's3-bucket'
1013
+ * });
1014
+ * console.log(stats.totalFiles); // 1234
1015
+ * console.log(stats.byType.image.count); // 567
1016
+ */
1017
+ stats: (data: {
1018
+ product: string;
1019
+ env: string;
1020
+ storage: string;
1021
+ prefix?: string;
1022
+ session?: string;
1023
+ cache?: string;
1024
+ }) => Promise<import("./storage").IStorageStatsResult>;
1025
+ files: {
1026
+ /**
1027
+ * Reads a file from local storage.
1028
+ * @param {string} path - The file path.
1029
+ * @returns {Promise<IFileReadResult>} The file read result.
450
1030
  */
451
- fetch: (tag: string) => IProductFallback;
1031
+ read: (path: string) => Promise<IFileReadResult>;
452
1032
  /**
453
- * Fetches all fallbacks for a product.
454
- * @returns {IProductFallback[]} The list of fallbacks.
1033
+ * Saves data to storage using the storage processor.
1034
+ * @param {IStorageProcessorInput} data - The storage processor input.
1035
+ * @returns {Promise<any>} The result of the storage processing.
1036
+ * @example
1037
+ * await ductape.storage.save({
1038
+ * product: 'my-product',
1039
+ * env: 'production',
1040
+ * event: 'upload-file',
1041
+ * input: { buffer: fileData, fileName: 'report.pdf', mimeType: 'application/pdf' }
1042
+ * });
1043
+ * @deprecated Use upload() instead for direct cloud storage operations
455
1044
  */
456
- fetchAll: () => IProductFallback[];
1045
+ save: (data: IStorageProcessorInput) => Promise<any>;
457
1046
  /**
458
- * Updates a fallback by tag.
459
- * @param {string} tag - The fallback tag.
460
- * @param {Partial<IProductFallback>} data - The fallback data to update.
461
- * @returns {Promise<void>} Resolves when the fallback is updated. Throws on error.
462
- */
463
- update: (tag: string, data: Partial<IProductFallback>) => Promise<void>;
1047
+ * Uploads a file to cloud storage.
1048
+ * @param {Object} data - The upload options.
1049
+ * @returns {Promise<IStorageResult>} The upload result with file URL.
1050
+ * @example
1051
+ * await ductape.storage.upload({
1052
+ * product: 'my-product',
1053
+ * env: 'production',
1054
+ * storage: 's3-bucket',
1055
+ * fileName: 'documents/report.pdf',
1056
+ * buffer: fileBuffer,
1057
+ * mimeType: 'application/pdf'
1058
+ * });
1059
+ */
1060
+ upload: (data: {
1061
+ product: string;
1062
+ env: string;
1063
+ storage: string;
1064
+ fileName: string;
1065
+ buffer: string | Buffer;
1066
+ mimeType?: string;
1067
+ }) => Promise<import("./storage").IStorageResult>;
1068
+ /**
1069
+ * Downloads a file from cloud storage.
1070
+ * @param data - The download options.
1071
+ * @returns The download result with file data.
1072
+ * @example
1073
+ * const result = await ductape.storage.download({
1074
+ * product: 'my-product',
1075
+ * env: 'production',
1076
+ * storage: 's3-bucket',
1077
+ * fileName: 'documents/report.pdf'
1078
+ * });
1079
+ */
1080
+ download: (data: {
1081
+ product: string;
1082
+ env: string;
1083
+ storage: string;
1084
+ fileName: string;
1085
+ }) => Promise<import("./storage").IDownloadResult>;
1086
+ /**
1087
+ * Removes a file from cloud storage.
1088
+ * @param data - The delete options.
1089
+ * @returns The delete result.
1090
+ * @example
1091
+ * await ductape.storage.delete({
1092
+ * product: 'my-product',
1093
+ * env: 'production',
1094
+ * storage: 's3-bucket',
1095
+ * fileName: 'documents/report.pdf'
1096
+ * });
1097
+ */
1098
+ delete: (data: {
1099
+ product: string;
1100
+ env: string;
1101
+ storage: string;
1102
+ fileName: string;
1103
+ }) => Promise<import("./storage").IDeleteResult>;
1104
+ /**
1105
+ * Lists files in cloud storage with pagination.
1106
+ * @param data - The list options.
1107
+ * @returns The list result with files and pagination info.
1108
+ * @example
1109
+ * const result = await ductape.storage.list({
1110
+ * product: 'my-product',
1111
+ * env: 'production',
1112
+ * storage: 's3-bucket',
1113
+ * prefix: 'documents/',
1114
+ * limit: 100
1115
+ * });
1116
+ */
1117
+ list: (data: {
1118
+ product: string;
1119
+ env: string;
1120
+ storage: string;
1121
+ prefix?: string;
1122
+ limit?: number;
1123
+ continuationToken?: string;
1124
+ }) => Promise<import("./storage").IListFilesResult>;
1125
+ /**
1126
+ * Generates a signed URL for temporary file access.
1127
+ * @param data - The signed URL options.
1128
+ * @returns The signed URL result.
1129
+ * @example
1130
+ * const result = await ductape.storage.getSignedUrl({
1131
+ * product: 'my-product',
1132
+ * env: 'production',
1133
+ * storage: 's3-bucket',
1134
+ * fileName: 'documents/report.pdf',
1135
+ * expiresIn: 3600,
1136
+ * action: 'read'
1137
+ * });
1138
+ */
1139
+ getSignedUrl: (data: {
1140
+ product: string;
1141
+ env: string;
1142
+ storage: string;
1143
+ fileName: string;
1144
+ expiresIn?: number;
1145
+ action?: "read" | "write";
1146
+ }) => Promise<import("./storage").ISignedUrlResult>;
464
1147
  };
465
1148
  /**
466
- * Updates data validation for a product.
467
- * @param {string} tag - The product tag.
468
- * @param {Partial<IParsedSample>} update - The update data.
469
- * @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
1149
+ * Dispatches a storage operation to run as a scheduled job.
1150
+ * @param {IStorageDispatchInput} data - The storage dispatch input.
1151
+ * @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
1152
+ * @example
1153
+ * // Schedule a file backup in 6 hours
1154
+ * await ductape.storage.dispatch({
1155
+ * product: 'my-product',
1156
+ * env: 'production',
1157
+ * storage: 's3-storage',
1158
+ * event: 'backup-files',
1159
+ * input: { buffer: fileData, fileName: 'backup.zip', mimeType: 'application/zip' },
1160
+ * schedule: { start_at: Date.now() + 21600000 }
1161
+ * });
1162
+ *
1163
+ * // Run daily backups
1164
+ * await ductape.storage.dispatch({
1165
+ * product: 'my-product',
1166
+ * env: 'production',
1167
+ * storage: 's3-storage',
1168
+ * event: 'daily-backup',
1169
+ * input: { buffer: fileData, fileName: 'daily.zip', mimeType: 'application/zip' },
1170
+ * schedule: { cron: '0 2 * * *' } // Daily at 2 AM
1171
+ * });
470
1172
  */
471
- updateValidation: (tag: string, update: Partial<IParsedSample>) => Promise<boolean>;
472
- environments: {
1173
+ dispatch: (data: IStorageDispatchInput) => Promise<IDispatchResult>;
1174
+ };
1175
+ /**
1176
+ * Events-related operations for managing product events (message brokers).
1177
+ */
1178
+ messaging: {
1179
+ /**
1180
+ * Creates a message broker for a product.
1181
+ * @param {string} product - The product tag.
1182
+ * @param {Partial<IProductMessageBroker>} data - The message broker data.
1183
+ * @returns {Promise<void>} Resolves when the message broker is created. Throws on error.
1184
+ */
1185
+ create: (data: Partial<IProductMessageBroker> & {
1186
+ product: string;
1187
+ }) => Promise<void>;
1188
+ /**
1189
+ * Fetches all message brokers for a product.
1190
+ * @param {string} product - The product tag.
1191
+ * @returns {IProductMessageBroker[]} The list of message brokers.
1192
+ */
1193
+ list: (product: string) => Promise<IProductMessageBroker[]>;
1194
+ /**
1195
+ * Fetches a message broker by tag.
1196
+ * @param {string} product - The product tag.
1197
+ * @param {string} tag - The message broker tag.
1198
+ * @returns {IProductMessageBroker|null} The fetched message broker, or null if not found.
1199
+ */
1200
+ fetch: (product: string, tag: string) => Promise<IProductMessageBroker>;
1201
+ /**
1202
+ * Updates a message broker by tag.
1203
+ * @param {string} product - The product tag.
1204
+ * @param {string} tag - The message broker tag.
1205
+ * @param {Partial<IProductMessageBroker>} data - The message broker data to update.
1206
+ * @returns {Promise<void>} Resolves when the message broker is updated. Throws on error.
1207
+ */
1208
+ update: (product: string, tag: string, data: Partial<IProductMessageBroker>) => Promise<void>;
1209
+ /**
1210
+ * Deletes a message broker by tag.
1211
+ * @param {string} product - The product tag.
1212
+ * @param {string} tag - The message broker tag.
1213
+ * @returns {Promise<void>} Resolves when the message broker is deleted. Throws on error.
1214
+ */
1215
+ delete: (product: string, tag: string) => Promise<void>;
1216
+ topics: {
473
1217
  /**
474
- * Creates an environment for a product.
475
- * @param {IProductEnv} data - The environment data.
476
- * @returns {Promise<void>} Resolves when the environment is created. Throws on error.
1218
+ * Creates a message broker topic for a product.
1219
+ * @param {string} product - The product tag.
1220
+ * @param {IProductMessageBrokerTopic} data - The message broker topic data.
1221
+ * @returns {Promise<void>} Resolves when the message broker topic is created. Throws on error.
477
1222
  */
478
- create: (data: IProductEnv) => Promise<void>;
1223
+ create: (product: string, data: IProductMessageBrokerTopic) => Promise<void>;
479
1224
  /**
480
- * Fetches all environments for a product.
481
- * @returns {IAppEnv[]} The list of environments.
1225
+ * Fetches all message broker topics for a message broker by tag.
1226
+ * @param {string} product - The product tag.
1227
+ * @param {string} messageBrokerTag - The message broker tag.
1228
+ * @returns {IProductMessageBrokerTopic[]} The list of message broker topics.
482
1229
  */
483
- fetchAll: () => IProductEnv[];
1230
+ list: (product: string, messageBrokerTag: string) => Promise<IProductMessageBrokerTopic[]>;
484
1231
  /**
485
- * Fetches an environment by slug.
486
- * @param {string} slug - The environment slug.
487
- * @returns {IAppEnv|null} The fetched environment, or null if not found.
1232
+ * Fetches a message broker topic by tag.
1233
+ * @param {string} product - The product tag.
1234
+ * @param {string} tag - The message broker topic tag.
1235
+ * @returns {IProductMessageBrokerTopic|null} The fetched message broker topic, or null if not found.
488
1236
  */
489
- fetch: (slug: string) => IProductEnv;
1237
+ fetch: (product: string, tag: string) => Promise<IProductMessageBrokerTopic>;
490
1238
  /**
491
- * Updates an environment by slug.
492
- * @param {string} slug - The environment slug.
493
- * @param {Partial<IProductEnv>} data - The environment data to update.
494
- * @returns {Promise<void>} Resolves when the environment is updated. Throws on error.
1239
+ * Updates a message broker topic by tag.
1240
+ * @param {string} product - The product tag.
1241
+ * @param {string} tag - The message broker topic tag.
1242
+ * @param {Partial<IProductMessageBrokerTopic>} data - The message broker topic data to update.
1243
+ * @returns {Promise<void>} Resolves when the message broker topic is updated. Throws on error.
495
1244
  */
496
- update: (slug: string, data: Partial<IProductEnv>) => Promise<void>;
1245
+ update: (product: string, tag: string, data: Partial<IProductMessageBrokerTopic>) => Promise<void>;
497
1246
  };
498
- storage: {
499
- /**
500
- * Creates a storage for a product.
501
- * @param {IProductStorage} data - The storage data.
502
- * @returns {Promise<void>} Resolves when the storage is created. Throws on error.
503
- */
504
- create: (data: IProductStorage) => Promise<void>;
505
- /**
506
- * Fetches all storages for a product.
507
- * @returns {IProductStorage[]} The list of storages.
508
- */
509
- fetchAll: () => IProductStorage[];
510
- /**
511
- * Fetches a storage by tag.
512
- * @param {string} tag - The storage tag.
513
- * @returns {IProductStorage|null} The fetched storage, or null if not found.
514
- */
515
- fetch: (tag: string) => IProductStorage;
516
- /**
517
- * Updates a storage by tag.
518
- * @param {string} tag - The storage tag.
519
- * @param {Partial<IProductStorage>} data - The storage data to update.
520
- * @returns {Promise<void>} Resolves when the storage is updated. Throws on error.
521
- */
522
- update: (tag: string, data: Partial<IProductStorage>) => Promise<void>;
1247
+ /**
1248
+ * Publishes a message using the BrokersService.
1249
+ * @param data - The publish input.
1250
+ * @returns The result of the publish operation.
1251
+ * @example
1252
+ * await ductape.events.publish({
1253
+ * product: 'my-product',
1254
+ * env: 'production',
1255
+ * event: 'broker-tag:topic-tag',
1256
+ * message: { orderId: '123', status: 'pending' }
1257
+ * });
1258
+ * @example
1259
+ * // With session token for user-context publishing
1260
+ * await ductape.events.produce({
1261
+ * product: 'my-product',
1262
+ * env: 'production',
1263
+ * event: 'broker-tag:topic-tag',
1264
+ * message: { orderId: '123', status: 'pending' },
1265
+ * session: 'session-token-from-sessions.start()'
1266
+ * });
1267
+ */
1268
+ produce: (data: {
1269
+ product: string;
1270
+ env: string;
1271
+ event: string;
1272
+ message: Record<string, unknown>;
1273
+ session?: string;
1274
+ cache?: string;
1275
+ }) => Promise<import("./brokers").IPublishResult>;
1276
+ /**
1277
+ * consume to a message broker topic.
1278
+ * @param data - The subscribe input.
1279
+ * @returns The result of the subscribe operation.
1280
+ * @example
1281
+ * await ductape.events.consume({
1282
+ * product: 'my-product',
1283
+ * env: 'production',
1284
+ * event: 'broker-tag:topic-tag',
1285
+ * callback: async (message) => console.log(message)
1286
+ * });
1287
+ */
1288
+ consume: (data: {
1289
+ product: string;
1290
+ env: string;
1291
+ event: string;
1292
+ callback: (message: object) => Promise<void>;
1293
+ }) => Promise<import("./brokers").ISubscribeResult>;
1294
+ /**
1295
+ * Dispatches a publish operation to run as a scheduled job.
1296
+ * @param {IPublishDispatchInput} data - The publish dispatch input.
1297
+ * @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
1298
+ * @example
1299
+ * // Schedule a message to be published in 15 minutes
1300
+ * await ductape.events.dispatch({
1301
+ * product: 'my-product',
1302
+ * env: 'production',
1303
+ * broker: 'kafka-broker',
1304
+ * event: 'order-created',
1305
+ * input: { message: { orderId: '123', status: 'pending' } },
1306
+ * schedule: { start_at: Date.now() + 900000 }
1307
+ * });
1308
+ *
1309
+ * // Publish messages at regular intervals
1310
+ * await ductape.events.dispatch({
1311
+ * product: 'my-product',
1312
+ * env: 'production',
1313
+ * broker: 'redis-broker',
1314
+ * event: 'heartbeat',
1315
+ * input: { message: { ping: true } },
1316
+ * schedule: { every: 60000 } // Every minute
1317
+ * });
1318
+ */
1319
+ dispatch: (data: IPublishDispatchInput) => Promise<IDispatchResult>;
1320
+ /**
1321
+ * Messages namespace for broker message tracking and queries.
1322
+ * All query methods decrypt message content before returning.
1323
+ */
1324
+ messages: {
1325
+ /**
1326
+ * Query broker messages with filtering and pagination.
1327
+ * Messages are decrypted before returning.
1328
+ */
1329
+ query: (options: {
1330
+ product: string;
1331
+ env: string;
1332
+ brokerTag: string;
1333
+ topicTag?: string;
1334
+ producerTag?: string;
1335
+ consumerTag?: string;
1336
+ status?: string;
1337
+ startDate?: string;
1338
+ endDate?: string;
1339
+ page?: number;
1340
+ limit?: number;
1341
+ }) => Promise<{
1342
+ messages: any[];
1343
+ total: number;
1344
+ page: number;
1345
+ limit: number;
1346
+ hasMore: boolean;
1347
+ }>;
523
1348
  /**
524
- * Fetches storage files for a product.
525
- * @param {IFetchFilesPayload} data - The fetch files payload.
526
- * @returns {Promise<void>} Resolves when the storage files are fetched. Throws on error.
527
- */
528
- files: (data: IFetchFilesPayload) => Promise<import("./types").IFileURLPayload[]>;
529
- };
530
- messageBrokers: {
1349
+ * Get broker producers with pagination.
1350
+ */
1351
+ getProducers: (options: {
1352
+ product: string;
1353
+ env: string;
1354
+ brokerTag: string;
1355
+ topicTag?: string;
1356
+ page?: number;
1357
+ limit?: number;
1358
+ }) => Promise<{
1359
+ producers: any[];
1360
+ total: number;
1361
+ page: number;
1362
+ limit: number;
1363
+ hasMore: boolean;
1364
+ }>;
531
1365
  /**
532
- * Creates a message broker for a product.
533
- * @param {Partial<IProductMessageBroker>} data - The message broker data.
534
- * @returns {Promise<void>} Resolves when the message broker is created. Throws on error.
535
- */
536
- create: (data: Partial<IProductMessageBroker>) => Promise<void>;
1366
+ * Get broker consumers with pagination.
1367
+ */
1368
+ getConsumers: (options: {
1369
+ product: string;
1370
+ env: string;
1371
+ brokerTag: string;
1372
+ topicTag?: string;
1373
+ page?: number;
1374
+ limit?: number;
1375
+ }) => Promise<{
1376
+ consumers: any[];
1377
+ total: number;
1378
+ page: number;
1379
+ limit: number;
1380
+ hasMore: boolean;
1381
+ }>;
537
1382
  /**
538
- * Fetches all message brokers for a product.
539
- * @returns {IProductMessageBroker[]} The list of message brokers.
540
- */
541
- fetchAll: () => IProductMessageBroker[];
1383
+ * Get broker dead letters with pagination.
1384
+ * Messages are decrypted before returning.
1385
+ */
1386
+ getDeadLetters: (options: {
1387
+ product: string;
1388
+ env: string;
1389
+ brokerTag: string;
1390
+ topicTag?: string;
1391
+ consumerTag?: string;
1392
+ startDate?: string;
1393
+ endDate?: string;
1394
+ page?: number;
1395
+ limit?: number;
1396
+ }) => Promise<{
1397
+ deadLetters: any[];
1398
+ total: number;
1399
+ page: number;
1400
+ limit: number;
1401
+ hasMore: boolean;
1402
+ }>;
542
1403
  /**
543
- * Fetches a message broker by tag.
544
- * @param {string} tag - The message broker tag.
545
- * @returns {IProductMessageBroker|null} The fetched message broker, or null if not found.
1404
+ * Get comprehensive broker message statistics.
546
1405
  */
547
- fetch: (tag: string) => IProductMessageBroker;
1406
+ getStats: (options: {
1407
+ product: string;
1408
+ env: string;
1409
+ brokerTag: string;
1410
+ }) => Promise<any>;
548
1411
  /**
549
- * Updates a message broker by tag.
550
- * @param {string} tag - The message broker tag.
551
- * @param {Partial<IProductMessageBroker>} data - The message broker data to update.
552
- * @returns {Promise<void>} Resolves when the message broker is updated. Throws on error.
1412
+ * Get broker dashboard overview data.
1413
+ * Recent messages are decrypted before returning.
553
1414
  */
554
- update: (tag: string, data: Partial<IProductMessageBroker>) => Promise<void>;
555
- topics: {
556
- /**
557
- * Creates a message broker topic for a product.
558
- * @param {IProductMessageBrokerTopic} data - The message broker topic data.
559
- * @returns {Promise<void>} Resolves when the message broker topic is created. Throws on error.
560
- */
561
- create: (data: IProductMessageBrokerTopic) => Promise<void>;
562
- /**
563
- * Fetches all message broker topics for a message broker by tag.
564
- * @param {string} messageBrokerTag - The message broker tag.
565
- * @returns {IProductMessageBrokerTopic[]} The list of message broker topics.
566
- */
567
- fetchAll: (messageBrokerTag: string) => IProductMessageBrokerTopic[];
568
- /**
569
- * Fetches a message broker topic by tag.
570
- * @param {string} tag - The message broker topic tag.
571
- * @returns {IProductMessageBrokerTopic|null} The fetched message broker topic, or null if not found.
572
- */
573
- fetch: (tag: string) => IProductMessageBrokerTopic;
574
- /**
575
- * Updates a message broker topic by tag.
576
- * @param {string} tag - The message broker topic tag.
577
- * @param {Partial<IProductMessageBrokerTopic>} data - The message broker topic data to update.
578
- * @returns {Promise<void>} Resolves when the message broker topic is updated. Throws on error.
579
- */
580
- update: (tag: string, data: Partial<IProductMessageBrokerTopic>) => Promise<void>;
581
- };
1415
+ getDashboard: (options: {
1416
+ product: string;
1417
+ env: string;
1418
+ brokerTag: string;
1419
+ }) => Promise<any>;
582
1420
  };
583
- notifications: {
1421
+ };
1422
+ /**
1423
+ * Notification-related operations for managing product notifications.
1424
+ */
1425
+ notifications: {
1426
+ /**
1427
+ * Creates a notification for a product.
1428
+ * @param {string} product - The product tag.
1429
+ * @param {IProductNotification} data - The notification data.
1430
+ * @returns {Promise<void>} Resolves when the notification is created. Throws on error.
1431
+ */
1432
+ create: (product: string, data: IProductNotification) => Promise<void>;
1433
+ /**
1434
+ * Fetches all notifications for a product.
1435
+ * @param {string} product - The product tag.
1436
+ * @returns {IProductNotification[]} The list of notifications.
1437
+ */
1438
+ list: (product: string) => Promise<IProductNotification[]>;
1439
+ /**
1440
+ * Fetches a notification by tag.
1441
+ * @param {string} product - The product tag.
1442
+ * @param {string} tag - The notification tag.
1443
+ * @returns {IProductNotification|null} The fetched notification, or null if not found.
1444
+ */
1445
+ fetch: (product: string, tag: string) => Promise<IProductNotification>;
1446
+ /**
1447
+ * Updates a notification by tag.
1448
+ * @param {string} product - The product tag.
1449
+ * @param {string} tag - The notification tag.
1450
+ * @param {Partial<IProductNotification>} data - The notification data to update.
1451
+ * @returns {Promise<void>} Resolves when the notification is updated. Throws on error.
1452
+ */
1453
+ update: (product: string, tag: string, data: Partial<IProductNotification>) => Promise<void>;
1454
+ /**
1455
+ * Deletes a notification by tag.
1456
+ * @param {string} product - The product tag.
1457
+ * @param {string} tag - The notification tag.
1458
+ * @returns {Promise<void>} Resolves when the notification is deleted. Throws on error.
1459
+ */
1460
+ delete: (product: string, tag: string) => Promise<void>;
1461
+ messages: {
584
1462
  /**
585
- * Creates a notification for a product.
586
- * @param {IProductNotification} data - The notification data.
587
- * @returns {Promise<void>} Resolves when the notification is created. Throws on error.
1463
+ * Creates a notification message for a product.
1464
+ * @param {string} product - The product tag.
1465
+ * @param {IProductNotificationTemplate} data - The notification message data.
1466
+ * @returns {Promise<void>} Resolves when the notification message is created. Throws on error.
588
1467
  */
589
- create: (data: IProductNotification) => Promise<void>;
1468
+ create: (product: string, data: IProductNotificationTemplate) => Promise<void>;
590
1469
  /**
591
- * Fetches all notifications for a product.
592
- * @returns {IProductNotification[]} The list of notifications.
1470
+ * Fetches all notification messages for a notification by tag.
1471
+ * @param {string} product - The product tag.
1472
+ * @param {string} notificationTag - The notification tag.
1473
+ * @returns {IProductNotificationTemplate[]} The list of notification messages.
593
1474
  */
594
- fetchAll: () => IProductNotification[];
1475
+ list: (product: string, notificationTag: string) => Promise<IProductNotificationTemplate[]>;
595
1476
  /**
596
- * Fetches a notification by tag.
597
- * @param {string} tag - The notification tag.
598
- * @returns {IProductNotification|null} The fetched notification, or null if not found.
1477
+ * Fetches a notification message by tag.
1478
+ * @param {string} product - The product tag.
1479
+ * @param {string} tag - The notification message tag.
1480
+ * @returns {IProductNotificationTemplate|null} The fetched notification message, or null if not found.
599
1481
  */
600
- fetch: (tag: string) => IProductNotification;
1482
+ fetch: (product: string, tag: string) => Promise<IProductNotificationTemplate>;
601
1483
  /**
602
- * Updates a notification by tag.
603
- * @param {string} tag - The notification tag.
604
- * @param {Partial<IProductNotification>} data - The notification data to update.
605
- * @returns {Promise<void>} Resolves when the notification is updated. Throws on error.
1484
+ * Updates a notification message by tag.
1485
+ * @param {string} product - The product tag.
1486
+ * @param {string} tag - The notification message tag.
1487
+ * @param {Partial<IProductNotificationTemplate>} data - The notification message data to update.
1488
+ * @returns {Promise<void>} Resolves when the notification message is updated. Throws on error.
606
1489
  */
607
- update: (tag: string, data: Partial<IProductNotification>) => Promise<void>;
608
- messages: {
609
- /**
610
- * Creates a notification message for a product.
611
- * @param {IProductNotificationTemplate} data - The notification message data.
612
- * @returns {Promise<void>} Resolves when the notification message is created. Throws on error.
613
- */
614
- create: (data: IProductNotificationTemplate) => Promise<void>;
615
- /**
616
- * Fetches all notification messages for a notification by tag.
617
- * @param {string} notificationTag - The notification tag.
618
- * @returns {IProductNotificationTemplate[]} The list of notification messages.
619
- */
620
- fetchAll: (notificationTag: string) => IProductNotificationTemplate[];
621
- /**
622
- * Fetches a notification message by tag.
623
- * @param {string} tag - The notification message tag.
624
- * @returns {IProductNotificationTemplate|null} The fetched notification message, or null if not found.
625
- */
626
- fetch: (tag: string) => IProductNotificationTemplate;
627
- /**
628
- * Updates a notification message by tag.
629
- * @param {string} tag - The notification message tag.
630
- * @param {Partial<IProductNotificationTemplate>} data - The notification message data to update.
631
- * @returns {Promise<void>} Resolves when the notification message is updated. Throws on error.
632
- */
633
- update: (tag: string, data: Partial<IProductNotificationTemplate>) => Promise<void>;
634
- };
1490
+ update: (product: string, tag: string, data: Partial<IProductNotificationTemplate>) => Promise<void>;
635
1491
  };
636
- databases: {
637
- /**
638
- * Creates a database for a product.
639
- * @param {IProductDatabase} data - The database data.
640
- * @returns {Promise<void>} Resolves when the database is created. Throws on error.
641
- */
642
- create: (data: IProductDatabase) => Promise<void>;
643
- /**
644
- * Fetches all databases for a product.
645
- * @returns {IProductDatabase[]} The list of databases.
646
- */
647
- fetchAll: () => IProductDatabase[];
648
- /**
649
- * Fetches a database by tag.
650
- * @param {string} tag - The database tag.
651
- * @returns {IProductDatabase|null} The fetched database, or null if not found.
652
- */
653
- fetch: (tag: string) => IProductDatabase;
1492
+ /**
1493
+ * Sends a notification immediately using the notification processor.
1494
+ * @param {INotificationProcessorInput} data - The notification processor input.
1495
+ * @returns {Promise<any>} The result of the notification processing.
1496
+ * @example
1497
+ * await ductape.notifications.send({
1498
+ * product: 'my-product',
1499
+ * env: 'production',
1500
+ * event: 'welcome-email',
1501
+ * input: { email: { recipients: ['user@example.com'], subject: { name: 'John' } } }
1502
+ * });
1503
+ */
1504
+ send: (data: INotificationProcessorInput) => Promise<{
1505
+ process_id: string;
1506
+ }>;
1507
+ /**
1508
+ * Dispatches a notification to be sent as a scheduled job.
1509
+ * @param {INotificationDispatchInput} data - The notification dispatch input.
1510
+ * @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
1511
+ * @example
1512
+ * // Schedule a notification to be sent in 1 hour
1513
+ * await ductape.notifications.dispatch({
1514
+ * product: 'my-product',
1515
+ * env: 'production',
1516
+ * notification: 'user-notifications',
1517
+ * event: 'welcome-email',
1518
+ * input: { email: { to: 'user@example.com' } },
1519
+ * schedule: { start_at: Date.now() + 3600000 }
1520
+ * });
1521
+ *
1522
+ * // Send recurring notifications
1523
+ * await ductape.notifications.dispatch({
1524
+ * product: 'my-product',
1525
+ * env: 'production',
1526
+ * notification: 'digest',
1527
+ * event: 'weekly-digest',
1528
+ * input: { email: { to: 'user@example.com' } },
1529
+ * schedule: { cron: '0 9 * * 1' } // Weekly on Monday at 9 AM
1530
+ * });
1531
+ */
1532
+ dispatch: (data: INotificationDispatchInput) => Promise<IDispatchResult>;
1533
+ };
1534
+ /**
1535
+ * Database operations service.
1536
+ * Provides a unified API for database CRUD operations, schema management, queries, and migrations.
1537
+ *
1538
+ * @example
1539
+ * // Register a new database
1540
+ * await ductape.databases.create({
1541
+ * product: 'my-product',
1542
+ * name: 'User Database',
1543
+ * tag: 'users-db',
1544
+ * type: DatabaseType.POSTGRESQL,
1545
+ * envs: [{ slug: 'dev', connection_url: 'postgresql://localhost/mydb' }],
1546
+ * });
1547
+ *
1548
+ * // Connect to database
1549
+ * await ductape.databases.connect({ env: 'dev', product: 'my-product', database: 'users-db' });
1550
+ */
1551
+ databases: {
1552
+ /**
1553
+ * Create/register a new database configuration
1554
+ */
1555
+ create: (config: Parameters<DatabaseService["create"]>[0]) => Promise<void>;
1556
+ /**
1557
+ * Register a database for a product (alias for create with product)
1558
+ */
1559
+ register: (product: string, data: IProductDatabase) => Promise<void>;
1560
+ /**
1561
+ * Fetch all databases for a product
1562
+ */
1563
+ list: (product: string) => Promise<IProductDatabase[]>;
1564
+ /**
1565
+ * Fetch a specific database
1566
+ */
1567
+ fetch: (product: string, database: string) => Promise<IProductDatabase>;
1568
+ /**
1569
+ * Update a database configuration
1570
+ */
1571
+ updateDatabase: (product: string, database: string, data: Partial<IProductDatabase>) => Promise<void>;
1572
+ /**
1573
+ * Update local database configuration
1574
+ */
1575
+ updateLocalConfig: (tag: string, updates: Parameters<DatabaseService["updateLocalConfig"]>[1]) => Promise<void>;
1576
+ /**
1577
+ * Connect to a database
1578
+ */
1579
+ connect: (config: Parameters<DatabaseService["connect"]>[0]) => Promise<import("./database").DatabaseConnection>;
1580
+ /**
1581
+ * Test database connection
1582
+ */
1583
+ testConnection: (config: Parameters<DatabaseService["testConnection"]>[0]) => Promise<import("./database").IConnectionResult>;
1584
+ /**
1585
+ * Disconnect from the current database
1586
+ */
1587
+ disconnect: () => Promise<void>;
1588
+ /**
1589
+ * Close all database connections
1590
+ */
1591
+ closeAll: () => Promise<void>;
1592
+ /**
1593
+ * Get current connection context
1594
+ */
1595
+ getCurrentContext: () => Promise<import("./database").IConnectionContext>;
1596
+ /**
1597
+ * Get a connection-scoped interface for a specific database/environment
1598
+ */
1599
+ connection: (database: string, env: string) => Promise<import("./database").DatabaseConnection>;
1600
+ /**
1601
+ * Query records from a table
1602
+ */
1603
+ query: <T = any>(options: Parameters<DatabaseService["query"]>[0]) => Promise<import("./database").IQueryResult<T>>;
1604
+ /**
1605
+ * Insert records into a table
1606
+ */
1607
+ insert: <T = any>(options: Parameters<DatabaseService["insert"]>[0]) => Promise<import("./database").IInsertResult<T>>;
1608
+ /**
1609
+ * Update records in a table
1610
+ */
1611
+ update: <T = any>(options: Parameters<DatabaseService["update"]>[0]) => Promise<import("./database").IUpdateResult<T>>;
1612
+ /**
1613
+ * Delete records from a table
1614
+ */
1615
+ delete: (options: Parameters<DatabaseService["delete"]>[0]) => Promise<import("./database").IDeleteResult>;
1616
+ /**
1617
+ * Insert or update a record based on conflict keys
1618
+ */
1619
+ upsert: <T = any>(options: Parameters<DatabaseService["upsert"]>[0]) => Promise<import("./database").IUpsertResult<T>>;
1620
+ /**
1621
+ * Count records
1622
+ */
1623
+ count: (options: Parameters<DatabaseService["count"]>[0]) => Promise<number>;
1624
+ /**
1625
+ * Sum values of a column
1626
+ */
1627
+ sum: (options: Parameters<DatabaseService["sum"]>[0]) => Promise<number>;
1628
+ /**
1629
+ * Calculate average of a column
1630
+ */
1631
+ avg: (options: Parameters<DatabaseService["avg"]>[0]) => Promise<number>;
1632
+ /**
1633
+ * Get minimum value of a column
1634
+ */
1635
+ min: (options: Parameters<DatabaseService["min"]>[0]) => Promise<any>;
1636
+ /**
1637
+ * Get maximum value of a column
1638
+ */
1639
+ max: (options: Parameters<DatabaseService["max"]>[0]) => Promise<any>;
1640
+ /**
1641
+ * Perform multiple aggregations in one query
1642
+ */
1643
+ aggregate: (options: Parameters<DatabaseService["aggregate"]>[0]) => Promise<import("./database").IAggregateResult>;
1644
+ /**
1645
+ * Begin a database transaction
1646
+ */
1647
+ beginTransaction: (options: Parameters<DatabaseService["beginTransaction"]>[0]) => Promise<import("./database").ITransaction>;
1648
+ /**
1649
+ * Schema operations sub-object - provides a simplified Mongoose-style API for schema management.
1650
+ * These operations work on the currently connected database context.
1651
+ */
1652
+ schema: {
654
1653
  /**
655
- * Updates a database by tag.
656
- * @param {string} tag - The database tag.
657
- * @param {Partial<IProductDatabase>} data - The database data to update.
658
- * @returns {Promise<void>} Resolves when the database is updated. Throws on error.
1654
+ * Create a collection/table with Mongoose-style schema definition
1655
+ * @example
1656
+ * await ductape.databases.schema.create('users', {
1657
+ * name: 'string',
1658
+ * email: { type: 'string', unique: true },
1659
+ * age: 'number',
1660
+ * createdAt: 'date',
1661
+ * });
659
1662
  */
660
- update: (tag: string, data: Partial<IProductDatabase>) => Promise<void>;
661
- actions: {
662
- /**
663
- * Creates a database action for a product.
664
- * @param {IProductDatabaseAction} data - The database action data.
665
- * @returns {Promise<void>} Resolves when the database action is created. Throws on error.
666
- */
667
- create: (data: IProductDatabaseAction) => Promise<void>;
668
- /**
669
- * Fetches all database actions for a product.
670
- * @param {string} databaseTag - The database tag.
671
- * @returns {IProductDatabaseAction[]} The list of database actions.
672
- */
673
- fetchAll: (databaseTag: string) => IProductDatabaseAction[];
674
- /**
675
- * Fetches a database action by tag.
676
- * @param {string} tag - The database action tag.
677
- * @returns {IProductDatabaseAction|null} The fetched database action, or null if not found.
678
- */
679
- fetch: (tag: string) => IProductDatabaseAction;
680
- /**
681
- * Updates a database action by tag.
682
- * @param {string} tag - The database action tag.
683
- * @param {Partial<IProductDatabaseAction>} data - The database action data to update.
684
- * @returns {Promise<void>} Resolves when the database action is updated. Throws on error.
685
- */
686
- update: (tag: string, data: Partial<IProductDatabaseAction>) => Promise<void>;
687
- };
688
- migrations: {
689
- /**
690
- * Creates a database migration for a product.
691
- * @param {IProductDatabaseMigration} data - The database migration data.
692
- * @returns {void} Resolves when the database migration is created. Throws on error.
693
- */
694
- create: (data: IProductDatabaseMigration) => Promise<void>;
695
- /**
696
- * Fetches all database migrations for a product.
697
- * @param {string} databaseTag - The database tag.
698
- * @returns {IProductDatabaseMigration[]} The list of database migrations.
699
- */
700
- fetchAll: (databaseTag: string) => IProductDatabaseMigration[];
701
- /**
702
- * Fetches a database migration by tag.
703
- * @param {string} tag - The database migration tag.
704
- * @returns {IProductDatabaseMigration|null} The fetched database migration, or null if not found.
705
- */
706
- fetch: (tag: string) => IProductDatabaseMigration;
707
- /**
708
- * Updates a database migration by tag.
709
- * @param {string} tag - The database migration tag.
710
- * @param {Partial<IProductDatabaseMigration>} data - The database migration data to update.
711
- * @returns {void} Resolves when the database migration is updated. Throws on error.
712
- */
713
- update: (tag: string, data: Partial<IProductDatabaseMigration>) => Promise<void>;
714
- };
715
- };
716
- jobs: {
1663
+ create: (name: string, definition: ISimpleSchemaDefinition, options?: ISimpleCreateOptions) => Promise<ISchemaOperationResult>;
1664
+ /**
1665
+ * Drop a collection/table
1666
+ */
1667
+ drop: (name: string, options?: ISimpleDropOptions) => Promise<ISchemaOperationResult>;
1668
+ /**
1669
+ * Add a field to a collection
1670
+ */
1671
+ addField: (collection: string, fieldName: string, definition: SimpleFieldType | ISimpleFieldDefinition) => Promise<ISchemaOperationResult>;
717
1672
  /**
718
- * Creates a job for a product.
719
- * @param {Partial<IProductJobs>} data - The job data.
720
- * @returns {Promise<void>} Resolves when the job is created. Throws on error.
1673
+ * Drop a field from a collection
721
1674
  */
722
- create: (data: Partial<IProductJobs>) => Promise<void>;
1675
+ dropField: (collection: string, fieldName: string) => Promise<ISchemaOperationResult>;
723
1676
  /**
724
- * Fetches all jobs for a product.
725
- * @returns {IProductJobs[]} The list of jobs.
1677
+ * Rename a field in a collection
726
1678
  */
727
- fetchAll: () => IProductJobs[];
1679
+ renameField: (collection: string, oldName: string, newName: string) => Promise<ISchemaOperationResult>;
728
1680
  /**
729
- * Fetches a job by tag.
730
- * @param {string} tag - The job tag.
731
- * @returns {IProductJobs|null} The fetched job, or null if not found.
1681
+ * Modify a field's definition
732
1682
  */
733
- fetch: (tag: string) => IProductJobs;
1683
+ modifyField: (collection: string, fieldName: string, changes: Partial<ISimpleFieldDefinition>) => Promise<ISchemaOperationResult>;
734
1684
  /**
735
- * Updates a job by tag.
736
- * @param {string} tag - The job tag.
737
- * @param {Partial<IProductJobs>} data - The job data to update.
738
- * @returns {Promise<void>} Resolves when the job is updated. Throws on error.
1685
+ * Create an index on a collection
739
1686
  */
740
- update: (tag: string, data: Partial<IProductJobs>) => Promise<void>;
1687
+ createIndex: (collection: string, fields: string[] | IIndexFieldDefinition[], options?: ISimpleIndexOptions) => Promise<ISchemaOperationResult>;
1688
+ /**
1689
+ * Drop an index from a collection
1690
+ */
1691
+ dropIndex: (collection: string, indexName: string) => Promise<ISchemaOperationResult>;
1692
+ /**
1693
+ * Add a constraint (SQL databases only)
1694
+ */
1695
+ addConstraint: (collection: string, constraint: IMigrationConstraintDefinition) => Promise<ISchemaOperationResult>;
1696
+ /**
1697
+ * Drop a constraint (SQL databases only)
1698
+ */
1699
+ dropConstraint: (collection: string, constraintName: string) => Promise<ISchemaOperationResult>;
1700
+ /**
1701
+ * Rename a collection/table
1702
+ */
1703
+ rename: (oldName: string, newName: string) => Promise<ISchemaOperationResult>;
1704
+ /**
1705
+ * Check if a collection/table exists
1706
+ */
1707
+ exists: (name: string) => Promise<boolean>;
1708
+ /**
1709
+ * List all collections/tables
1710
+ */
1711
+ list: (schemaName?: string) => Promise<string[]>;
1712
+ /**
1713
+ * Get detailed schema information for a collection
1714
+ */
1715
+ describe: (name: string) => Promise<ITableSchema>;
1716
+ /**
1717
+ * List indexes on a collection
1718
+ */
1719
+ indexes: (collection: string) => Promise<IIndexInfo[]>;
741
1720
  };
742
- caches: {
1721
+ /**
1722
+ * Migration CRUD sub-object
1723
+ */
1724
+ migration: {
1725
+ create: (options: {
1726
+ product: string;
1727
+ database: string;
1728
+ data: {
1729
+ name: string;
1730
+ tag: string;
1731
+ description?: string;
1732
+ value: {
1733
+ up: string[];
1734
+ down: string[];
1735
+ };
1736
+ };
1737
+ }) => Promise<void>;
1738
+ update: (options: {
1739
+ product: string;
1740
+ tag: string;
1741
+ data: {
1742
+ name?: string;
1743
+ description?: string;
1744
+ value?: {
1745
+ up: string[];
1746
+ down: string[];
1747
+ };
1748
+ };
1749
+ }) => Promise<void>;
1750
+ fetch: (options: {
1751
+ product: string;
1752
+ tag: string;
1753
+ }) => Promise<any>;
1754
+ list: (options: {
1755
+ product: string;
1756
+ database: string;
1757
+ }) => Promise<any[]>;
1758
+ delete: (options: {
1759
+ product: string;
1760
+ tag: string;
1761
+ }) => Promise<void>;
743
1762
  /**
744
- * Creates a cache for a product.
745
- * @param {IProductCache} data - The cache data.
746
- * @returns {Promise<void>} Resolves when the cache is created. Throws on error.
1763
+ * Run a migration
747
1764
  */
748
- create: (data: IProductCache) => Promise<void>;
1765
+ run: (migrations: Parameters<DatabaseService["runMigration"]>[0], options?: Parameters<DatabaseService["runMigration"]>[1]) => Promise<Map<string, import("./database").IMigrationResult>>;
749
1766
  /**
750
- * Fetches all caches for a product.
751
- * @returns {IProductCache[]} The list of caches.
1767
+ * Rollback migrations
752
1768
  */
753
- fetchAll: () => IProductCache[];
1769
+ rollback: (migrations: Parameters<DatabaseService["rollbackMigration"]>[0], count?: number) => Promise<Map<string, import("./database").IMigrationResult>>;
754
1770
  /**
755
- * Fetches a cache by tag.
756
- * @param {string} tag - The cache tag.
757
- * @returns {IProductCache|null} The fetched cache, or null if not found.
1771
+ * Get migration history
758
1772
  */
759
- fetch: (tag: string) => IProductCache;
1773
+ history: () => Promise<import("./database").IMigrationHistory[]>;
760
1774
  /**
761
- * Updates a cache by tag.
762
- * @param {string} tag - The cache tag.
763
- * @param {Partial<IProductCache>} data - The cache data to update.
764
- * @returns {Promise<void>} Resolves when the cache is updated. Throws on error.
1775
+ * Get migration status
765
1776
  */
766
- update: (tag: string, data: Partial<IProductCache>) => Promise<void>;
767
- values: (data: FetchRemoteCachePayload) => Promise<import("./types").IRemoteCache[]>;
1777
+ status: (migrations: Parameters<DatabaseService["getMigrationStatus"]>[0]) => Promise<import("./database").IMigrationStatusResult>;
768
1778
  };
769
- features: {
1779
+ /**
1780
+ * Action CRUD sub-object
1781
+ */
1782
+ action: {
1783
+ create: (options: IActionCreateOptions) => Promise<void>;
1784
+ update: (options: IActionUpdateOptions) => Promise<void>;
1785
+ fetch: (tag: string) => Promise<import("./database").IActionDefinition>;
1786
+ list: (databaseTag: string) => Promise<import("./database").IActionDefinition[]>;
1787
+ delete: (tag: string) => Promise<void>;
1788
+ dispatch: (data: IDBActionDispatchInput) => Promise<IDispatchResult>;
1789
+ };
1790
+ /**
1791
+ * List all tables in the database
1792
+ */
1793
+ listTables: (connectionConfig?: Parameters<DatabaseService["listTables"]>[0]) => Promise<string[]>;
1794
+ /**
1795
+ * List all tables with basic information including row counts
1796
+ */
1797
+ listTablesWithInfo: (connectionConfig?: Parameters<DatabaseService["listTablesWithInfo"]>[0]) => Promise<ITableInfo[]>;
1798
+ /**
1799
+ * Create a new table
1800
+ */
1801
+ createTable: (connectionConfigOrTableDef: Parameters<DatabaseService["createTable"]>[0], tableDefOrOptions?: Parameters<DatabaseService["createTable"]>[1], options?: Parameters<DatabaseService["createTable"]>[2]) => Promise<void>;
1802
+ /**
1803
+ * Drop a table
1804
+ */
1805
+ dropTable: (connectionConfigOrTableName: Parameters<DatabaseService["dropTable"]>[0], tableName?: Parameters<DatabaseService["dropTable"]>[1]) => Promise<void>;
1806
+ /**
1807
+ * Alter a table
1808
+ */
1809
+ alterTable: (connectionConfigOrTableName: Parameters<DatabaseService["alterTable"]>[0], tableNameOrAlterations?: Parameters<DatabaseService["alterTable"]>[1], alterations?: Parameters<DatabaseService["alterTable"]>[2]) => Promise<void>;
1810
+ /**
1811
+ * List all indexes
1812
+ */
1813
+ listIndexes: (options: Parameters<DatabaseService["listIndexes"]>[0]) => Promise<IIndexInfo[]>;
1814
+ /**
1815
+ * Create an index
1816
+ */
1817
+ createIndex: (options: Parameters<DatabaseService["createIndex"]>[0]) => Promise<void>;
1818
+ /**
1819
+ * Drop an index
1820
+ */
1821
+ dropIndex: (options: Parameters<DatabaseService["dropIndex"]>[0]) => Promise<void>;
1822
+ /**
1823
+ * Dispatch a database operation as a scheduled job
1824
+ */
1825
+ dispatch: (data: Parameters<DatabaseService["dispatch"]>[0]) => Promise<IDispatchResult>;
1826
+ /**
1827
+ * Get the adapter for the current connection
1828
+ */
1829
+ getAdapter: (options?: Parameters<DatabaseService["getAdapter"]>[0]) => Promise<import("./database").BaseAdapter>;
1830
+ /**
1831
+ * Get the underlying DatabaseService instance (for advanced usage)
1832
+ */
1833
+ getService: () => Promise<DatabaseService>;
1834
+ };
1835
+ /**
1836
+ * Graph database operations service.
1837
+ * Provides a unified API for graph database operations including nodes, relationships,
1838
+ * traversals, and transactions.
1839
+ *
1840
+ * @example
1841
+ * // Register a new graph database
1842
+ * await ductape.graph.create({
1843
+ * name: 'Social Graph',
1844
+ * tag: 'social-graph',
1845
+ * type: 'neo4j',
1846
+ * envs: [{ slug: 'dev', connection_url: 'bolt://localhost:7687' }],
1847
+ * });
1848
+ */
1849
+ graph: {
1850
+ /**
1851
+ * Creates a graph configuration for a product.
1852
+ * @param {any} graphConfig - The graph configuration.
1853
+ * @param {string} [productTag] - The product tag.
1854
+ * @returns {Promise<void>} Resolves when the graph is created.
1855
+ */
1856
+ create: (graphConfig: IGraphConfig & {
1857
+ product: string;
1858
+ }) => Promise<void>;
1859
+ /**
1860
+ * Fetches a graph configuration by tag.
1861
+ * @param {string} [productTag] - The product tag.
1862
+ * @param {string} graphTag - The graph tag.
1863
+ * @returns {Promise<any>} The fetched graph configuration.
1864
+ */
1865
+ fetch: (productTag: string, graphTag: string) => Promise<IGraphConfig>;
1866
+ /**
1867
+ * Fetches all graph configurations for a product.
1868
+ * @param {string} [productTag] - The product tag.
1869
+ * @returns {Promise<any[]>} The list of graph configurations.
1870
+ */
1871
+ list: (productTag?: string) => Promise<IGraphConfig[]>;
1872
+ /**
1873
+ * Updates a graph configuration by tag.
1874
+ * @param {string} [productTag] - The product tag.
1875
+ * @param {string} graphTag - The graph tag.
1876
+ * @param {any} updates - The updates to apply.
1877
+ * @returns {Promise<void>} Resolves when the graph is updated.
1878
+ */
1879
+ update: (productTag: string, graphTag: string, updates: Partial<IGraphConfig>) => Promise<void>;
1880
+ /**
1881
+ * Deletes a graph configuration by tag.
1882
+ * @param {string} graphTag - The graph tag.
1883
+ * @param {string} [productTag] - The product tag.
1884
+ * @returns {Promise<void>} Resolves when the graph is deleted.
1885
+ */
1886
+ delete: (graphTag: string, productTag?: string) => Promise<void>;
1887
+ /**
1888
+ * Connects to a graph database.
1889
+ * @param {any} config - The connection configuration.
1890
+ * @returns {Promise<any>} The connection result.
1891
+ */
1892
+ connect: (config: any) => Promise<import("./graph").IGraphConnectionResult>;
1893
+ /**
1894
+ * Disconnects from the current graph database.
1895
+ * @returns {Promise<void>} Resolves when disconnected.
1896
+ */
1897
+ disconnect: () => Promise<void>;
1898
+ /**
1899
+ * Closes all graph database connections.
1900
+ * @returns {Promise<void>} Resolves when all connections are closed.
1901
+ */
1902
+ closeAll: () => Promise<void>;
1903
+ /**
1904
+ * Tests a connection to a graph database without persisting.
1905
+ * @param {any} config - The connection configuration.
1906
+ * @returns {Promise<any>} The test connection result.
1907
+ */
1908
+ testConnection: (config: any) => Promise<import("./graph").IGraphTestConnectionResult>;
1909
+ /**
1910
+ * Creates a node in the graph.
1911
+ * @param {any} options - The node creation options.
1912
+ * @param {any} [transaction] - Optional transaction.
1913
+ * @returns {Promise<any>} The created node result.
1914
+ */
1915
+ createNode: (options: any, transaction?: any) => Promise<import("./graph").ICreateNodeResult<any>>;
1916
+ /**
1917
+ * Finds nodes by criteria.
1918
+ * @param {any} options - The find options.
1919
+ * @param {any} [transaction] - Optional transaction.
1920
+ * @returns {Promise<any>} The found nodes result.
1921
+ */
1922
+ findNodes: (options: any, transaction?: any) => Promise<import("./graph").IFindNodesResult<any>>;
1923
+ /**
1924
+ * Finds a node by ID.
1925
+ * @param {string | number} id - The node ID.
1926
+ * @param {any} [transaction] - Optional transaction.
1927
+ * @returns {Promise<any>} The found node or null.
1928
+ */
1929
+ findNodeById: (id: string | number, transaction?: any) => Promise<import("./graph").INode<any>>;
1930
+ /**
1931
+ * Updates a node.
1932
+ * @param {any} options - The update options.
1933
+ * @param {any} [transaction] - Optional transaction.
1934
+ * @returns {Promise<any>} The updated node result.
1935
+ */
1936
+ updateNode: (options: any, transaction?: any) => Promise<import("./graph").IUpdateNodeResult<any>>;
1937
+ /**
1938
+ * Deletes a node.
1939
+ * @param {any} options - The delete options.
1940
+ * @param {any} [transaction] - Optional transaction.
1941
+ * @returns {Promise<any>} The delete result.
1942
+ */
1943
+ deleteNode: (options: any, transaction?: any) => Promise<import("./graph").IDeleteNodeResult>;
1944
+ /**
1945
+ * Merges a node (create or update).
1946
+ * @param {any} options - The merge options.
1947
+ * @param {any} [transaction] - Optional transaction.
1948
+ * @returns {Promise<any>} The merge result.
1949
+ */
1950
+ mergeNode: (options: any, transaction?: any) => Promise<import("./graph").IMergeNodeResult<any>>;
1951
+ /**
1952
+ * Adds labels to an existing node.
1953
+ * @param {any} options - The add labels options (id, labels).
1954
+ * @param {any} [transaction] - Optional transaction.
1955
+ * @returns {Promise<any>} The result with added labels.
1956
+ */
1957
+ addLabels: (options: any, transaction?: any) => Promise<import("./graph").IAddLabelsResult<any>>;
1958
+ /**
1959
+ * Removes labels from an existing node.
1960
+ * @param {any} options - The remove labels options (id, labels).
1961
+ * @param {any} [transaction] - Optional transaction.
1962
+ * @returns {Promise<any>} The result with removed labels.
1963
+ */
1964
+ removeLabels: (options: any, transaction?: any) => Promise<import("./graph").IRemoveLabelsResult<any>>;
1965
+ /**
1966
+ * Sets labels on a node (replaces all existing labels).
1967
+ * @param {any} options - The set labels options (id, labels).
1968
+ * @param {any} [transaction] - Optional transaction.
1969
+ * @returns {Promise<any>} The result with previous and new labels.
1970
+ */
1971
+ setLabels: (options: any, transaction?: any) => Promise<import("./graph").ISetLabelsResult<any>>;
1972
+ /**
1973
+ * Creates a relationship between nodes.
1974
+ * @param {any} options - The relationship creation options.
1975
+ * @param {any} [transaction] - Optional transaction.
1976
+ * @returns {Promise<any>} The created relationship result.
1977
+ */
1978
+ createRelationship: (options: any, transaction?: any) => Promise<import("./graph").ICreateRelationshipResult<any>>;
1979
+ /**
1980
+ * Finds relationships by criteria.
1981
+ * @param {any} options - The find options.
1982
+ * @param {any} [transaction] - Optional transaction.
1983
+ * @returns {Promise<any>} The found relationships result.
1984
+ */
1985
+ findRelationships: (options: any, transaction?: any) => Promise<import("./graph").IFindRelationshipsResult<any>>;
1986
+ /**
1987
+ * Finds a relationship by ID.
1988
+ * @param {string | number} id - The relationship ID.
1989
+ * @param {any} [transaction] - Optional transaction.
1990
+ * @returns {Promise<any>} The found relationship or null.
1991
+ */
1992
+ findRelationshipById: (id: string | number, transaction?: any) => Promise<import("./graph").IRelationship<any>>;
1993
+ /**
1994
+ * Updates a relationship.
1995
+ * @param {any} options - The update options.
1996
+ * @param {any} [transaction] - Optional transaction.
1997
+ * @returns {Promise<any>} The updated relationship result.
1998
+ */
1999
+ updateRelationship: (options: any, transaction?: any) => Promise<import("./graph").IUpdateRelationshipResult<any>>;
2000
+ /**
2001
+ * Deletes a relationship.
2002
+ * @param {any} options - The delete options.
2003
+ * @param {any} [transaction] - Optional transaction.
2004
+ * @returns {Promise<any>} The delete result.
2005
+ */
2006
+ deleteRelationship: (options: any, transaction?: any) => Promise<import("./graph").IDeleteRelationshipResult>;
2007
+ /**
2008
+ * Merges a relationship (create or update).
2009
+ * @param {any} options - The merge options.
2010
+ * @param {any} [transaction] - Optional transaction.
2011
+ * @returns {Promise<any>} The merge result.
2012
+ */
2013
+ mergeRelationship: (options: any, transaction?: any) => Promise<import("./graph").IMergeRelationshipResult<any>>;
2014
+ /**
2015
+ * Traverses the graph from a starting node.
2016
+ * @param {any} options - The traversal options.
2017
+ * @param {any} [transaction] - Optional transaction.
2018
+ * @returns {Promise<any>} The traversal result.
2019
+ */
2020
+ traverse: (options: any, transaction?: any) => Promise<import("./graph").ITraverseResult<any, any>>;
2021
+ /**
2022
+ * Finds the shortest path between two nodes.
2023
+ * @param {any} options - The shortest path options.
2024
+ * @param {any} [transaction] - Optional transaction.
2025
+ * @returns {Promise<any>} The shortest path result.
2026
+ */
2027
+ shortestPath: (options: any, transaction?: any) => Promise<import("./graph").IShortestPathResult<any, any>>;
2028
+ /**
2029
+ * Finds all paths between two nodes.
2030
+ * @param {any} options - The all paths options.
2031
+ * @param {any} [transaction] - Optional transaction.
2032
+ * @returns {Promise<any>} The all paths result.
2033
+ */
2034
+ allPaths: (options: any, transaction?: any) => Promise<import("./graph").IAllPathsResult<any, any>>;
2035
+ /**
2036
+ * Gets the neighborhood of a node.
2037
+ * @param {any} options - The neighborhood options.
2038
+ * @param {any} [transaction] - Optional transaction.
2039
+ * @returns {Promise<any>} The neighborhood result.
2040
+ */
2041
+ getNeighborhood: (options: any, transaction?: any) => Promise<import("./graph").INeighborhoodResult<any, any>>;
2042
+ /**
2043
+ * Finds connected components in the graph.
2044
+ * @param {any} options - The connected components options.
2045
+ * @param {any} [transaction] - Optional transaction.
2046
+ * @returns {Promise<any>} The connected components result.
2047
+ */
2048
+ findConnectedComponents: (options: any, transaction?: any) => Promise<import("./graph").IConnectedComponentsResult<any>>;
2049
+ /**
2050
+ * Executes a raw Cypher query against the graph database.
2051
+ * @param {string} query - The Cypher query string.
2052
+ * @param {Record<string, any>} [params] - Query parameters.
2053
+ * @param {any} [transaction] - Optional transaction.
2054
+ * @returns {Promise<any>} The query result.
2055
+ */
2056
+ query: (query: string, params?: Record<string, any>, transaction?: any) => Promise<import("./graph").IRawQueryResult<any>>;
2057
+ /**
2058
+ * Gets graph statistics.
2059
+ * @param {any} [transaction] - Optional transaction.
2060
+ * @returns {Promise<any>} The graph statistics.
2061
+ */
2062
+ getStatistics: (transaction?: any) => Promise<import("./graph").IGraphStatistics>;
2063
+ /**
2064
+ * Counts nodes matching criteria.
2065
+ * @param {string[]} [labels] - Node labels to filter by.
2066
+ * @param {any} [where] - Where clause for filtering.
2067
+ * @param {any} [transaction] - Optional transaction.
2068
+ * @returns {Promise<any>} The count result.
2069
+ */
2070
+ countNodes: (labels?: string[], where?: any, transaction?: any) => Promise<import("./graph").ICountNodesResult>;
2071
+ /**
2072
+ * Counts relationships matching criteria.
2073
+ * @param {string[]} [types] - Relationship types to filter by.
2074
+ * @param {any} [where] - Where clause for filtering.
2075
+ * @param {any} [transaction] - Optional transaction.
2076
+ * @returns {Promise<any>} The count result.
2077
+ */
2078
+ countRelationships: (types?: string[], where?: any, transaction?: any) => Promise<import("./graph").ICountRelationshipsResult>;
2079
+ /**
2080
+ * Performs full-text search.
2081
+ * @param {any} options - The search options.
2082
+ * @param {any} [transaction] - Optional transaction.
2083
+ * @returns {Promise<any>} The search result.
2084
+ */
2085
+ fullTextSearch: (options: any, transaction?: any) => Promise<import("./graph").IFullTextSearchResult<any>>;
2086
+ /**
2087
+ * Performs vector similarity search.
2088
+ * @param {any} options - The search options.
2089
+ * @param {any} [transaction] - Optional transaction.
2090
+ * @returns {Promise<any>} The search result.
2091
+ */
2092
+ vectorSearch: (options: any, transaction?: any) => Promise<import("./graph").IVectorSearchResult<any>>;
2093
+ /**
2094
+ * Creates a node index.
2095
+ * @param {any} options - The index creation options.
2096
+ * @returns {Promise<any>} The index creation result.
2097
+ */
2098
+ createNodeIndex: (options: any) => Promise<import("./graph").ICreateIndexResult>;
2099
+ /**
2100
+ * Creates a node constraint.
2101
+ * @param {any} options - The constraint creation options.
2102
+ * @returns {Promise<any>} The constraint creation result.
2103
+ */
2104
+ createNodeConstraint: (options: any) => Promise<import("./graph").ICreateConstraintResult>;
2105
+ /**
2106
+ * Creates a relationship index.
2107
+ * @param {any} options - The index creation options.
2108
+ * @returns {Promise<any>} The index creation result.
2109
+ */
2110
+ createRelationshipIndex: (options: any) => Promise<import("./graph").ICreateIndexResult>;
2111
+ /**
2112
+ * Lists all indexes.
2113
+ * @returns {Promise<any>} The list of indexes.
2114
+ */
2115
+ listIndexes: () => Promise<import("./graph").IListIndexesResult>;
2116
+ /**
2117
+ * Lists all constraints.
2118
+ * @returns {Promise<any>} The list of constraints.
2119
+ */
2120
+ listConstraints: () => Promise<import("./graph").IListConstraintsResult>;
2121
+ /**
2122
+ * Drops an index by name.
2123
+ * @param {string} name - The index name.
2124
+ * @returns {Promise<any>} The drop result.
2125
+ */
2126
+ dropIndex: (name: string) => Promise<import("./graph").IDropIndexResult>;
2127
+ /**
2128
+ * Drops a constraint by name.
2129
+ * @param {string} name - The constraint name.
2130
+ * @returns {Promise<any>} The drop result.
2131
+ */
2132
+ dropConstraint: (name: string) => Promise<import("./graph").IDropConstraintResult>;
2133
+ /**
2134
+ * Lists all node labels.
2135
+ * @returns {Promise<any>} The list of labels.
2136
+ */
2137
+ listLabels: () => Promise<import("./graph").IListLabelsResult>;
2138
+ /**
2139
+ * Lists all relationship types.
2140
+ * @returns {Promise<any>} The list of relationship types.
2141
+ */
2142
+ listRelationshipTypes: () => Promise<import("./graph").IListRelationshipTypesResult>;
2143
+ /**
2144
+ * Creates a graph action.
2145
+ * @param {any} options - The action creation options.
2146
+ * @param {string} [productTag] - The product tag.
2147
+ * @returns {Promise<any>} The created action.
2148
+ */
2149
+ createAction: (options: any, productTag?: string) => Promise<import("./graph").IGraphAction>;
2150
+ /**
2151
+ * Lists graph actions.
2152
+ * @param {string} [graphTag] - The graph tag.
2153
+ * @param {string} [productTag] - The product tag.
2154
+ * @returns {Promise<any>} The list of actions.
2155
+ */
2156
+ listActions: (graphTag?: string, productTag?: string) => Promise<import("./graph").IListGraphActionsResult>;
2157
+ /**
2158
+ * Gets a graph action by tag.
2159
+ * @param {string} actionTag - The action tag.
2160
+ * @param {string} [graphTag] - The graph tag.
2161
+ * @param {string} [productTag] - The product tag.
2162
+ * @returns {Promise<any>} The action or null.
2163
+ */
2164
+ getAction: (actionTag: string, graphTag?: string, productTag?: string) => Promise<import("./graph").IGraphAction>;
2165
+ /**
2166
+ * Updates a graph action.
2167
+ * @param {string} actionTag - The action tag.
2168
+ * @param {any} updates - The updates to apply.
2169
+ * @param {string} [graphTag] - The graph tag.
2170
+ * @param {string} [productTag] - The product tag.
2171
+ * @returns {Promise<any>} The updated action.
2172
+ */
2173
+ updateAction: (actionTag: string, updates: any, graphTag?: string, productTag?: string) => Promise<import("./graph").IGraphAction>;
2174
+ /**
2175
+ * Deletes a graph action.
2176
+ * @param {string} actionTag - The action tag.
2177
+ * @param {string} [graphTag] - The graph tag.
2178
+ * @param {string} [productTag] - The product tag.
2179
+ * @returns {Promise<void>} Resolves when the action is deleted.
2180
+ */
2181
+ deleteAction: (actionTag: string, graphTag?: string, productTag?: string) => Promise<void>;
2182
+ /**
2183
+ * Begins a new transaction.
2184
+ * @param {any} [options] - Transaction options.
2185
+ * @returns {Promise<any>} The transaction object.
2186
+ */
2187
+ beginTransaction: (options?: any) => Promise<import("./graph").IGraphTransaction>;
2188
+ /**
2189
+ * Commits a transaction.
2190
+ * @param {any} transaction - The transaction to commit.
2191
+ * @returns {Promise<void>} Resolves when committed.
2192
+ */
2193
+ commitTransaction: (transaction: any) => Promise<void>;
2194
+ /**
2195
+ * Rolls back a transaction.
2196
+ * @param {any} transaction - The transaction to rollback.
2197
+ * @returns {Promise<void>} Resolves when rolled back.
2198
+ */
2199
+ rollbackTransaction: (transaction: any) => Promise<void>;
2200
+ /**
2201
+ * Executes operations within a transaction with automatic commit/rollback.
2202
+ * @param {Function} callback - The callback function receiving the transaction.
2203
+ * @param {any} [options] - Transaction options.
2204
+ * @returns {Promise<T>} The result of the callback.
2205
+ * @example
2206
+ * const result = await ductape.graph.executeTransaction(async (tx) => {
2207
+ * const node1 = await ductape.graph.createNode({ labels: ['User'], properties: { name: 'Alice' } }, tx);
2208
+ * const node2 = await ductape.graph.createNode({ labels: ['User'], properties: { name: 'Bob' } }, tx);
2209
+ * return { node1, node2 };
2210
+ * });
2211
+ */
2212
+ executeTransaction: <T>(callback: (transaction: any) => Promise<T>, options?: any) => Promise<T>;
2213
+ /**
2214
+ * Dispatches a graph operation for deferred execution.
2215
+ * @param {any} data - The dispatch input.
2216
+ * @returns {Promise<any>} The dispatch result.
2217
+ */
2218
+ dispatch: (data: any) => Promise<IDispatchResult>;
2219
+ };
2220
+ /**
2221
+ * Workflow service for building and executing durable workflows.
2222
+ *
2223
+ * @example
2224
+ * // Create a workflow from JSON schema
2225
+ * await ductape.workflows.create('my-product', {
2226
+ * tag: 'order-fulfillment',
2227
+ * name: 'Order Fulfillment',
2228
+ * steps: [...],
2229
+ * });
2230
+ */
2231
+ workflows: {
2232
+ /**
2233
+ * Get the underlying WorkflowService instance
2234
+ */
2235
+ getService: () => Promise<WorkflowService>;
2236
+ };
2237
+ /**
2238
+ * Agents service for building and executing AI-driven agentic workflows.
2239
+ *
2240
+ * @example
2241
+ * // Define an agent
2242
+ * await ductape.agents.define({
2243
+ * tag: 'customer-support',
2244
+ * name: 'Customer Support Agent',
2245
+ * model: { provider: 'anthropic', model: 'claude-sonnet-4-20250514' },
2246
+ * });
2247
+ */
2248
+ agents: {
2249
+ /**
2250
+ * Get the underlying AgentsService instance
2251
+ */
2252
+ getService: () => Promise<AgentsService>;
2253
+ };
2254
+ /**
2255
+ * LLM Model operations for managing model configurations.
2256
+ *
2257
+ * @example
2258
+ * // Create a model configuration
2259
+ * await ductape.models.create({
2260
+ * product: 'my-product',
2261
+ * tag: 'claude-sonnet',
2262
+ * name: 'Claude Sonnet',
2263
+ * provider: 'anthropic',
2264
+ * });
2265
+ */
2266
+ models: {
2267
+ /**
2268
+ * Get the underlying ModelService instance
2269
+ */
2270
+ getService: () => Promise<ModelService>;
2271
+ };
2272
+ /**
2273
+ * Vector database operations service.
2274
+ *
2275
+ * @example
2276
+ * // Create a vector database configuration
2277
+ * await ductape.vector.create({
2278
+ * product: 'my-product',
2279
+ * tag: 'embeddings',
2280
+ * name: 'Document Embeddings',
2281
+ * });
2282
+ */
2283
+ vector: {
2284
+ /**
2285
+ * Get the underlying VectorDatabaseService instance for advanced operations.
2286
+ * @returns {Promise<VectorDatabaseService>} The vector database service instance.
2287
+ */
2288
+ getService: () => Promise<VectorDatabaseService>;
2289
+ /**
2290
+ * Creates a vector database configuration for a product.
2291
+ * @param {ICreateVectorDbOptions} options - The vector configuration options.
2292
+ * @returns {Promise<void>} Resolves when the vector config is created.
2293
+ */
2294
+ create: (options: ICreateVectorDbOptions) => Promise<void>;
2295
+ /**
2296
+ * Fetches a vector database configuration by tag.
2297
+ * @param {IFetchVectorOptions} options - The fetch options.
2298
+ * @returns {Promise<IProductVector | null>} The fetched vector configuration.
2299
+ */
2300
+ fetch: (options: import("./vector/vector-database.service").IFetchVectorOptions) => Promise<import("./types").IProductVector>;
2301
+ /**
2302
+ * Fetches all vector database configurations for a product.
2303
+ * @param {object} options - The fetch options containing product tag.
2304
+ * @returns {Promise<IProductVector[]>} The list of vector configurations.
2305
+ */
2306
+ list: (options: {
2307
+ product: string;
2308
+ }) => Promise<import("./types").IProductVector[]>;
2309
+ /**
2310
+ * Updates a vector database configuration.
2311
+ * @param {IUpdateVectorDbOptions} options - The update options.
2312
+ * @returns {Promise<void>} Resolves when the vector config is updated.
2313
+ */
2314
+ update: (options: import("./vector/vector-database.service").IUpdateVectorDbOptions) => Promise<void>;
2315
+ /**
2316
+ * Deletes a vector database configuration.
2317
+ * @param {IDeleteVectorConfigOptions} options - The delete options.
2318
+ * @returns {Promise<void>} Resolves when the vector config is deleted.
2319
+ */
2320
+ delete: (options: import("./vector/vector-database.service").IDeleteVectorConfigOptions) => Promise<void>;
2321
+ /**
2322
+ * Connects to a vector database.
2323
+ * @param {object} options - Connection options with product, env, and vector.
2324
+ * @returns {Promise<VectorService>} The connected vector service.
2325
+ */
2326
+ connect: (options: {
2327
+ product: string;
2328
+ env: string;
2329
+ vector: string;
2330
+ }) => Promise<import("./vector").VectorService>;
2331
+ /**
2332
+ * Disconnects from a specific vector database.
2333
+ * @param {object} options - Disconnect options with product, env, and vector.
2334
+ * @returns {Promise<void>} Resolves when disconnected.
2335
+ */
2336
+ disconnect: (options: {
2337
+ product: string;
2338
+ env: string;
2339
+ vector: string;
2340
+ }) => Promise<void>;
2341
+ /**
2342
+ * Disconnects all cached vector database connections.
2343
+ * @returns {Promise<void>} Resolves when all connections are closed.
2344
+ */
2345
+ disconnectAll: () => Promise<void>;
2346
+ /**
2347
+ * Query vectors by similarity.
2348
+ * @param {IProductVectorQueryOptions} options - The query options.
2349
+ * @returns {Promise<IQueryVectorsResult>} The query results.
2350
+ */
2351
+ query: (options: import("./vector/vector-database.service").IProductVectorQueryOptions) => Promise<import("./vector").IQueryVectorsResult>;
2352
+ /**
2353
+ * Upsert vectors (insert or update).
2354
+ * @param {IProductVectorUpsertOptions} options - The upsert options.
2355
+ * @returns {Promise<IUpsertVectorsResult>} The upsert result.
2356
+ */
2357
+ upsert: (options: import("./vector/vector-database.service").IProductVectorUpsertOptions) => Promise<import("./vector").IUpsertVectorsResult>;
2358
+ /**
2359
+ * Fetch vectors by IDs.
2360
+ * @param {IProductVectorFetchOptions} options - The fetch options.
2361
+ * @returns {Promise<IFetchVectorsResult>} The fetched vectors.
2362
+ */
2363
+ fetchVectors: (options: import("./vector/vector-database.service").IProductVectorFetchOptions) => Promise<import("./vector").IFetchVectorsResult>;
2364
+ /**
2365
+ * Delete vectors by IDs.
2366
+ * @param {IProductVectorDeleteOptions} options - The delete options.
2367
+ * @returns {Promise<IDeleteVectorsResult>} The delete result.
2368
+ */
2369
+ deleteVectors: (options: import("./vector/vector-database.service").IProductVectorDeleteOptions) => Promise<import("./vector").IDeleteVectorsResult>;
2370
+ /**
2371
+ * Find similar vectors to a given vector.
2372
+ * @param {object} options - Find similar options with product, env, tag, vector, and topK.
2373
+ * @returns {Promise<IQueryVectorsResult>} The similar vectors.
2374
+ */
2375
+ findSimilar: (options: {
2376
+ product: string;
2377
+ env: string;
2378
+ vector: string;
2379
+ values: number[];
2380
+ topK?: number;
2381
+ filter?: any;
2382
+ namespace?: string;
2383
+ includeValues?: boolean;
2384
+ includeMetadata?: boolean;
2385
+ }) => Promise<import("./vector").IQueryVectorsResult>;
2386
+ /**
2387
+ * Upsert a single vector.
2388
+ * @param {object} options - Single vector upsert options.
2389
+ * @returns {Promise<IUpsertVectorsResult>} The upsert result.
2390
+ */
2391
+ upsertOne: (options: {
2392
+ product: string;
2393
+ env: string;
2394
+ tag: string;
2395
+ id: string;
2396
+ values: number[];
2397
+ metadata?: Record<string, unknown>;
2398
+ namespace?: string;
2399
+ session?: string;
2400
+ }) => Promise<import("./vector").IUpsertVectorsResult>;
2401
+ /**
2402
+ * Fetch a single vector by ID.
2403
+ * @param {object} options - Single vector fetch options.
2404
+ * @returns {Promise<IVector | null>} The fetched vector or null.
2405
+ */
2406
+ fetchOne: (options: {
2407
+ product: string;
2408
+ env: string;
2409
+ vector: string;
2410
+ id: string;
2411
+ namespace?: string;
2412
+ }) => Promise<import("./vector").IVector>;
2413
+ /**
2414
+ * Update a single vector.
2415
+ * @param {object} options - Update options.
2416
+ * @returns {Promise<IUpdateVectorResult>} The update result.
2417
+ */
2418
+ updateVector: (options: {
2419
+ product: string;
2420
+ env: string;
2421
+ vector: string;
2422
+ id: string;
2423
+ values?: number[];
2424
+ setMetadata?: Record<string, unknown>;
2425
+ mergeMetadata?: Record<string, unknown>;
2426
+ namespace?: string;
2427
+ }) => Promise<import("./vector").IUpdateVectorResult>;
2428
+ /**
2429
+ * Update vector metadata.
2430
+ * @param {object} options - Update metadata options.
2431
+ * @returns {Promise<IUpdateVectorResult>} The update result.
2432
+ */
2433
+ updateMetadata: (options: {
2434
+ product: string;
2435
+ env: string;
2436
+ vector: string;
2437
+ id: string;
2438
+ metadata: Record<string, unknown>;
2439
+ merge?: boolean;
2440
+ namespace?: string;
2441
+ }) => Promise<import("./vector").IUpdateVectorResult>;
2442
+ /**
2443
+ * Delete vectors by IDs (convenience method).
2444
+ * @param {object} options - Delete by IDs options.
2445
+ * @returns {Promise<IDeleteVectorsResult>} The delete result.
2446
+ */
2447
+ deleteByIds: (options: {
2448
+ product: string;
2449
+ env: string;
2450
+ vector: string;
2451
+ ids: string[];
2452
+ namespace?: string;
2453
+ }) => Promise<import("./vector").IDeleteVectorsResult>;
2454
+ /**
2455
+ * Delete all vectors in a namespace.
2456
+ * @param {object} options - Delete all options.
2457
+ * @returns {Promise<IDeleteVectorsResult>} The delete result.
2458
+ */
2459
+ deleteAll: (options: {
2460
+ product: string;
2461
+ env: string;
2462
+ vector: string;
2463
+ namespace?: string;
2464
+ }) => Promise<import("./vector").IDeleteVectorsResult>;
2465
+ /**
2466
+ * List vector IDs.
2467
+ * @param {object} options - List options.
2468
+ * @returns {Promise<IListVectorsResult>} The list result.
2469
+ */
2470
+ listVectors: (options: {
2471
+ product: string;
2472
+ env: string;
2473
+ vector: string;
2474
+ namespace?: string;
2475
+ prefix?: string;
2476
+ limit?: number;
2477
+ cursor?: string;
2478
+ }) => Promise<import("./vector").IListVectorsResult>;
2479
+ /**
2480
+ * List all vector IDs (paginated).
2481
+ * @param {object} options - List all options.
2482
+ * @returns {Promise<string[]>} All vector IDs.
2483
+ */
2484
+ listAllVectors: (options: {
2485
+ product: string;
2486
+ env: string;
2487
+ vector: string;
2488
+ namespace?: string;
2489
+ prefix?: string;
2490
+ }) => Promise<string[]>;
2491
+ /**
2492
+ * List available namespaces.
2493
+ * @param {object} options - Namespace list options.
2494
+ * @returns {Promise<IListNamespacesResult>} The namespaces.
2495
+ */
2496
+ listNamespaces: (options: {
2497
+ product: string;
2498
+ env: string;
2499
+ vector: string;
2500
+ }) => Promise<import("./vector").IListNamespacesResult>;
2501
+ /**
2502
+ * Delete a namespace.
2503
+ * @param {object} options - Namespace delete options.
2504
+ * @returns {Promise<void>} Resolves when deleted.
2505
+ */
2506
+ deleteNamespace: (options: {
2507
+ product: string;
2508
+ env: string;
2509
+ vector: string;
2510
+ namespace: string;
2511
+ }) => Promise<void>;
2512
+ /**
2513
+ * Describe the current index.
2514
+ * @param {object} options - Index describe options.
2515
+ * @returns {Promise<IVectorIndexInfo>} The index info.
2516
+ */
2517
+ describeIndex: (options: {
2518
+ product: string;
2519
+ env: string;
2520
+ vector: string;
2521
+ }) => Promise<import("./vector").IVectorIndexInfo>;
2522
+ /**
2523
+ * Get index statistics.
2524
+ * @param {object} options - Stats options.
2525
+ * @returns {Promise<IVectorIndexStats>} The index stats.
2526
+ */
2527
+ getStats: (options: {
2528
+ product: string;
2529
+ env: string;
2530
+ vector: string;
2531
+ }) => Promise<import("./vector").IVectorIndexStats>;
2532
+ /**
2533
+ * Create a new index.
2534
+ * @param {object} options - Create index options.
2535
+ * @returns {Promise<ICreateIndexResult>} The create result.
2536
+ */
2537
+ createIndex: (options: {
2538
+ product: string;
2539
+ env: string;
2540
+ vector: string;
2541
+ name: string;
2542
+ dimensions: number;
2543
+ metric?: import("./vector").DistanceMetric;
2544
+ replicas?: number;
2545
+ shards?: number;
2546
+ }) => Promise<import("./vector").ICreateIndexResult>;
2547
+ /**
2548
+ * Delete an index.
2549
+ * @param {object} options - Delete index options.
2550
+ * @returns {Promise<IDeleteIndexResult>} The delete result.
2551
+ */
2552
+ deleteIndex: (options: {
2553
+ product: string;
2554
+ env: string;
2555
+ vector: string;
2556
+ name: string;
2557
+ }) => Promise<import("./vector").IDeleteIndexResult>;
2558
+ /**
2559
+ * List all indexes.
2560
+ * @param {object} options - List indexes options.
2561
+ * @returns {Promise<IVectorIndexInfo[]>} The list of indexes.
2562
+ */
2563
+ listIndexes: (options: {
2564
+ product: string;
2565
+ env: string;
2566
+ vector: string;
2567
+ }) => Promise<import("./vector").IVectorIndexInfo[]>;
2568
+ /**
2569
+ * Count vectors in the index.
2570
+ * @param {object} options - Count options.
2571
+ * @returns {Promise<number>} The vector count.
2572
+ */
2573
+ count: (options: {
2574
+ product: string;
2575
+ env: string;
2576
+ vector: string;
2577
+ namespace?: string;
2578
+ }) => Promise<number>;
2579
+ /**
2580
+ * Check if a vector exists.
2581
+ * @param {object} options - Exists check options.
2582
+ * @returns {Promise<boolean>} True if exists.
2583
+ */
2584
+ exists: (options: {
2585
+ product: string;
2586
+ env: string;
2587
+ vector: string;
2588
+ id: string;
2589
+ namespace?: string;
2590
+ }) => Promise<boolean>;
2591
+ /**
2592
+ * Test connection to a vector database.
2593
+ * @param {object} options - Test connection options.
2594
+ * @returns {Promise<boolean>} True if connection is healthy.
2595
+ */
2596
+ testConnection: (options: {
2597
+ product: string;
2598
+ env: string;
2599
+ vector: string;
2600
+ }) => Promise<boolean>;
2601
+ /**
2602
+ * Check if a feature is supported.
2603
+ * @param {object} options - Feature check options.
2604
+ * @returns {Promise<boolean>} True if supported.
2605
+ */
2606
+ supportsFeature: (options: {
2607
+ product: string;
2608
+ env: string;
2609
+ vector: string;
2610
+ feature: import("./vector").VectorFeature;
2611
+ }) => Promise<boolean>;
2612
+ /**
2613
+ * Get all supported features.
2614
+ * @param {object} options - Get features options.
2615
+ * @returns {Promise<VectorFeature[]>} The supported features.
2616
+ */
2617
+ getSupportedFeatures: (options: {
2618
+ product: string;
2619
+ env: string;
2620
+ vector: string;
2621
+ }) => Promise<import("./vector").VectorFeature[]>;
2622
+ /**
2623
+ * Vector actions for managing reusable query templates.
2624
+ */
2625
+ actions: {
2626
+ /**
2627
+ * Create a new vector action
2628
+ */
2629
+ create: (options: {
2630
+ product: string;
2631
+ vector: string;
2632
+ name: string;
2633
+ actionTag: string;
2634
+ operation: string;
2635
+ description?: string;
2636
+ template: Record<string, any>;
2637
+ parameters?: Array<{
2638
+ name: string;
2639
+ path: string;
2640
+ type: "string" | "number" | "boolean" | "array" | "object";
2641
+ required?: boolean;
2642
+ defaultValue?: any;
2643
+ description?: string;
2644
+ }>;
2645
+ }) => Promise<import("./types").IProductVectorAction>;
2646
+ /**
2647
+ * Update an existing vector action
2648
+ */
2649
+ update: (options: {
2650
+ product: string;
2651
+ vector: string;
2652
+ actionTag: string;
2653
+ name?: string;
2654
+ description?: string;
2655
+ template?: Record<string, any>;
2656
+ parameters?: Array<{
2657
+ name: string;
2658
+ path: string;
2659
+ type: "string" | "number" | "boolean" | "array" | "object";
2660
+ required?: boolean;
2661
+ defaultValue?: any;
2662
+ description?: string;
2663
+ }>;
2664
+ }) => Promise<import("./types").IProductVectorAction>;
770
2665
  /**
771
- * Creates a feature for a product.
772
- * @param {Partial<IProductFeature>} data - The feature data.
773
- * @returns {Promise<void>} Resolves when the feature is created. Throws on error.
2666
+ * Fetch a specific vector action
774
2667
  */
775
- create: (data: Partial<IProductFeature>) => Promise<void>;
2668
+ fetch: (options: {
2669
+ product: string;
2670
+ vector: string;
2671
+ actionTag: string;
2672
+ }) => Promise<import("./vector").IVectorActionDefinition>;
776
2673
  /**
777
- * Fetches all features for a product.
778
- * @returns {IProductFeature[]} The list of features.
2674
+ * Fetch all vector actions for a vector database
779
2675
  */
780
- fetchAll: () => IProductFeature[];
2676
+ fetchAll: (options: {
2677
+ product: string;
2678
+ vector: string;
2679
+ }) => Promise<import("./vector").IVectorActionDefinition[]>;
781
2680
  /**
782
- * Fetches a feature by tag.
783
- * @param {string} tag - The feature tag.
784
- * @returns {IProductFeature|null} The fetched feature, or null if not found.
2681
+ * Delete a vector action
785
2682
  */
786
- fetch: (tag: string) => IProductFeature;
2683
+ delete: (options: {
2684
+ product: string;
2685
+ vector: string;
2686
+ actionTag: string;
2687
+ }) => Promise<void>;
787
2688
  /**
788
- * Updates a feature by tag.
789
- * @param {string} tag - The feature tag.
790
- * @param {Partial<IProductCache>} data - The feature data to update.
791
- * @returns {Promise<void>} Resolves when the feature is updated. Throws on error.
2689
+ * Execute a vector action (resolve template placeholders)
792
2690
  */
793
- update: (tag: string, data: Partial<IProductCache>) => Promise<void>;
2691
+ execute: (options: {
2692
+ product: string;
2693
+ env: string;
2694
+ vector: string;
2695
+ action: string;
2696
+ input: Record<string, any>;
2697
+ }) => Promise<import("./vector").IVectorActionTemplate>;
794
2698
  };
795
2699
  };
796
2700
  /**
797
- * App-related operations for managing apps, variables, constants, actions, auths, webhooks, environments, and validation.
2701
+ * Warehouse interface for unified cross-database queries.
2702
+ *
2703
+ * Provides a single JSON interface for querying and writing data across
2704
+ * databases, graphs, and vector stores with cross-database joins and
2705
+ * distributed transactions. All product databases, graphs, and vectors
2706
+ * are automatically available for use.
2707
+ *
2708
+ * @example
2709
+ * // Cross-database query with join
2710
+ * const result = await ductape.warehouse.query({
2711
+ * operation: 'select',
2712
+ * from: { type: 'database', tag: 'users-postgres', entity: 'users', alias: 'u' },
2713
+ * fields: ['u.name', 'u.email', 'friends.name as friend_name'],
2714
+ * join: [{
2715
+ * type: 'left',
2716
+ * source: { type: 'graph', tag: 'social-neo4j', entity: 'Person', alias: 'friends' },
2717
+ * graph: { relationship: 'FRIENDS_WITH', direction: 'both' },
2718
+ * on: { left: 'u.id', right: 'friends.userId' }
2719
+ * }],
2720
+ * where: { 'u.status': { $eq: 'active' } },
2721
+ * limit: 100
2722
+ * });
2723
+ */
2724
+ warehouse: {
2725
+ /**
2726
+ * Execute a warehouse query
2727
+ * @param {object} options - Query options including product, env, and the query
2728
+ * @returns {Promise<IWarehouseResult>} Query result
2729
+ * @example
2730
+ * const result = await ductape.warehouse.query({
2731
+ * product: 'my-app',
2732
+ * env: 'production',
2733
+ * query: {
2734
+ * operation: 'select',
2735
+ * from: { type: 'database', tag: 'users', entity: 'users', alias: 'u' },
2736
+ * fields: ['u.id', 'u.name'],
2737
+ * where: { 'u.status': { $eq: 'active' } }
2738
+ * }
2739
+ * });
2740
+ */
2741
+ query: <T = Record<string, any>>(options: {
2742
+ product: string;
2743
+ env: string;
2744
+ query: IWarehouseQuery;
2745
+ }) => Promise<import("./warehouse").IWarehouseResult<T>>;
2746
+ /**
2747
+ * Select from a single source
2748
+ * @param {object} options - Select options including product, env, source, and query options
2749
+ * @returns {Promise<T[]>} Selected records
2750
+ * @example
2751
+ * const users = await ductape.warehouse.select({
2752
+ * product: 'my-app',
2753
+ * env: 'production',
2754
+ * source: { type: 'database', tag: 'users', entity: 'users', alias: 'u' },
2755
+ * fields: ['id', 'name'],
2756
+ * where: { status: { $eq: 'active' } }
2757
+ * });
2758
+ */
2759
+ select: <T = Record<string, any>>(options: {
2760
+ product: string;
2761
+ env: string;
2762
+ source: IDataSource;
2763
+ fields?: string[];
2764
+ where?: Record<string, any>;
2765
+ orderBy?: {
2766
+ field: string;
2767
+ order: "ASC" | "DESC";
2768
+ }[];
2769
+ limit?: number;
2770
+ offset?: number;
2771
+ }) => Promise<T[]>;
2772
+ /**
2773
+ * Insert into a source
2774
+ * @param {object} options - Insert options including product, env, source, and data
2775
+ * @returns {Promise<IWarehouseResult>} Insert result
2776
+ * @example
2777
+ * await ductape.warehouse.insert({
2778
+ * product: 'my-app',
2779
+ * env: 'production',
2780
+ * source: { type: 'database', tag: 'users', entity: 'users' },
2781
+ * data: { name: 'John', email: 'john@example.com' }
2782
+ * });
2783
+ */
2784
+ insert: <T = Record<string, any>>(options: {
2785
+ product: string;
2786
+ env: string;
2787
+ source: IDataSource;
2788
+ data: Record<string, any> | Record<string, any>[];
2789
+ returning?: boolean;
2790
+ }) => Promise<import("./warehouse").IWarehouseResult<T>>;
2791
+ /**
2792
+ * Update in a source
2793
+ * @param {object} options - Update options including product, env, source, data, and where
2794
+ * @returns {Promise<IWarehouseResult>} Update result
2795
+ * @example
2796
+ * await ductape.warehouse.update({
2797
+ * product: 'my-app',
2798
+ * env: 'production',
2799
+ * source: { type: 'database', tag: 'users', entity: 'users' },
2800
+ * data: { status: 'inactive' },
2801
+ * where: { id: { $eq: 123 } }
2802
+ * });
2803
+ */
2804
+ update: <T = Record<string, any>>(options: {
2805
+ product: string;
2806
+ env: string;
2807
+ source: IDataSource;
2808
+ data: Record<string, any>;
2809
+ where: Record<string, any>;
2810
+ returning?: boolean;
2811
+ }) => Promise<import("./warehouse").IWarehouseResult<T>>;
2812
+ /**
2813
+ * Delete from a source
2814
+ * @param {object} options - Delete options including product, env, source, and where
2815
+ * @returns {Promise<IWarehouseResult>} Delete result
2816
+ * @example
2817
+ * await ductape.warehouse.delete({
2818
+ * product: 'my-app',
2819
+ * env: 'production',
2820
+ * source: { type: 'database', tag: 'users', entity: 'users' },
2821
+ * where: { status: { $eq: 'deleted' } }
2822
+ * });
2823
+ */
2824
+ delete: <T = Record<string, any>>(options: {
2825
+ product: string;
2826
+ env: string;
2827
+ source: IDataSource;
2828
+ where: Record<string, any>;
2829
+ returning?: boolean;
2830
+ }) => Promise<import("./warehouse").IWarehouseResult<T>>;
2831
+ /**
2832
+ * Upsert into a source
2833
+ * @param {object} options - Upsert options including product, env, source, and data
2834
+ * @returns {Promise<IWarehouseResult>} Upsert result
2835
+ * @example
2836
+ * await ductape.warehouse.upsert({
2837
+ * product: 'my-app',
2838
+ * env: 'production',
2839
+ * source: { type: 'database', tag: 'users', entity: 'users' },
2840
+ * data: { id: 123, name: 'John', email: 'john@example.com' }
2841
+ * });
2842
+ */
2843
+ upsert: <T = Record<string, any>>(options: {
2844
+ product: string;
2845
+ env: string;
2846
+ source: IDataSource;
2847
+ data: Record<string, any>;
2848
+ returning?: boolean;
2849
+ }) => Promise<import("./warehouse").IWarehouseResult<T>>;
2850
+ /**
2851
+ * Execute multiple operations in a saga transaction
2852
+ * @param {object} options - Transaction options including product, env, and operations
2853
+ * @returns {Promise<ISagaResult>} Transaction result
2854
+ * @example
2855
+ * const result = await ductape.warehouse.transaction({
2856
+ * product: 'my-app',
2857
+ * env: 'production',
2858
+ * operations: [
2859
+ * {
2860
+ * operation: 'insert',
2861
+ * from: { type: 'database', tag: 'orders', entity: 'orders' },
2862
+ * data: { userId: 'u1', total: 99.99 }
2863
+ * },
2864
+ * {
2865
+ * operation: 'insert',
2866
+ * from: { type: 'graph', tag: 'activity', entity: 'Event' },
2867
+ * data: { type: 'ORDER_PLACED', userId: 'u1' }
2868
+ * }
2869
+ * ]
2870
+ * });
2871
+ */
2872
+ transaction: (options: {
2873
+ product: string;
2874
+ env: string;
2875
+ operations: Omit<IWarehouseQuery, "transaction">[];
2876
+ timeout?: number;
2877
+ retryOnFailure?: boolean;
2878
+ maxRetries?: number;
2879
+ }) => Promise<import("./warehouse").ISagaResult>;
2880
+ };
2881
+ /**
2882
+ * Job-related operations for managing product jobs.
2883
+ */
2884
+ jobs: {
2885
+ /**
2886
+ * Creates a job for a product.
2887
+ * @param {string} product - The product tag.
2888
+ * @param {Partial<IProductJobs>} data - The job data.
2889
+ * @returns {Promise<void>} Resolves when the job is created. Throws on error.
2890
+ */
2891
+ create: (product: string, data: Partial<IProductJobs>) => Promise<void>;
2892
+ /**
2893
+ * Fetches all jobs for a product.
2894
+ * @param {string} product - The product tag.
2895
+ * @returns {IProductJobs[]} The list of jobs.
2896
+ */
2897
+ list: (product: string) => Promise<IProductJobs[]>;
2898
+ /**
2899
+ * Fetches a job by tag.
2900
+ * @param {string} product - The product tag.
2901
+ * @param {string} tag - The job tag.
2902
+ * @returns {IProductJobs|null} The fetched job, or null if not found.
2903
+ */
2904
+ fetch: (product: string, tag: string) => Promise<IProductJobs>;
2905
+ /**
2906
+ * Updates a job by tag.
2907
+ * @param {string} product - The product tag.
2908
+ * @param {string} tag - The job tag.
2909
+ * @param {Partial<IProductJobs>} data - The job data to update.
2910
+ * @returns {Promise<void>} Resolves when the job is updated. Throws on error.
2911
+ */
2912
+ update: (product: string, tag: string, data: Partial<IProductJobs>) => Promise<void>;
2913
+ /**
2914
+ * Deletes a job by tag.
2915
+ * @param {string} product - The product tag.
2916
+ * @param {string} tag - The job tag.
2917
+ * @returns {Promise<void>} Resolves when the job is deleted. Throws on error.
2918
+ */
2919
+ delete: (product: string, tag: string) => Promise<void>;
2920
+ /**
2921
+ * Get a scheduled/running job by ID
2922
+ * @param jobId - The job ID
2923
+ * @returns The job details or null if not found
2924
+ * @example
2925
+ * const job = await ductape.jobs.get('job_abc123');
2926
+ * console.log(job.status); // 'scheduled', 'running', 'completed', etc.
2927
+ */
2928
+ get: (jobId: string) => Promise<import("./jobs").IJob>;
2929
+ /**
2930
+ * List jobs with filtering options
2931
+ * @param options - Filter options
2932
+ * @returns Paginated list of jobs
2933
+ * @example
2934
+ * const { jobs, total } = await ductape.jobs.listJobs({
2935
+ * product: 'my-product',
2936
+ * status: JobStatus.SCHEDULED,
2937
+ * limit: 20,
2938
+ * });
2939
+ */
2940
+ listJobs: (options?: IJobListOptions) => Promise<import("./jobs").IJobListResult>;
2941
+ /**
2942
+ * Cancel a scheduled or running job
2943
+ * @param jobId - The job ID
2944
+ * @param options - Cancel options
2945
+ * @returns The cancelled job or null
2946
+ * @example
2947
+ * await ductape.jobs.cancel('job_abc123', { reason: 'User requested' });
2948
+ */
2949
+ cancel: (jobId: string, options?: ICancelOptions) => Promise<import("./jobs").IJob>;
2950
+ /**
2951
+ * Cancel multiple jobs matching a filter
2952
+ * @param filter - Filter to match jobs
2953
+ * @returns Count of cancelled jobs
2954
+ */
2955
+ cancelMany: (filter: {
2956
+ product?: string;
2957
+ status?: JobStatus;
2958
+ }) => Promise<{
2959
+ count: number;
2960
+ }>;
2961
+ /**
2962
+ * Pause a recurring job
2963
+ * @param jobId - The job ID
2964
+ * @returns The paused job or null
2965
+ * @example
2966
+ * await ductape.jobs.pause('job_abc123');
2967
+ */
2968
+ pause: (jobId: string) => Promise<import("./jobs").IJob>;
2969
+ /**
2970
+ * Pause multiple jobs matching a filter
2971
+ * @param filter - Filter to match jobs
2972
+ * @returns Count of paused jobs
2973
+ */
2974
+ pauseMany: (filter: {
2975
+ product?: string;
2976
+ recurring?: boolean;
2977
+ }) => Promise<{
2978
+ count: number;
2979
+ }>;
2980
+ /**
2981
+ * Resume a paused job
2982
+ * @param jobId - The job ID
2983
+ * @returns The resumed job or null
2984
+ * @example
2985
+ * await ductape.jobs.resume('job_abc123');
2986
+ */
2987
+ resume: (jobId: string) => Promise<import("./jobs").IJob>;
2988
+ /**
2989
+ * Resume multiple jobs matching a filter
2990
+ * @param filter - Filter to match jobs
2991
+ * @returns Count of resumed jobs
2992
+ */
2993
+ resumeMany: (filter: {
2994
+ product?: string;
2995
+ status?: JobStatus;
2996
+ }) => Promise<{
2997
+ count: number;
2998
+ }>;
2999
+ /**
3000
+ * Retry a failed job
3001
+ * @param jobId - The job ID
3002
+ * @param options - Retry options
3003
+ * @returns The retried job or null
3004
+ * @example
3005
+ * await ductape.jobs.retry('job_abc123', { delay: 5000 });
3006
+ */
3007
+ retry: (jobId: string, options?: IRetryOptions) => Promise<import("./jobs").IJob>;
3008
+ /**
3009
+ * Retry multiple failed jobs matching a filter
3010
+ * @param filter - Filter to match jobs
3011
+ * @returns Count of retried jobs
3012
+ */
3013
+ retryMany: (filter: {
3014
+ status?: JobStatus;
3015
+ from?: number | string;
3016
+ }) => Promise<{
3017
+ count: number;
3018
+ }>;
3019
+ /**
3020
+ * Reschedule a job for a different time
3021
+ * @param jobId - The job ID
3022
+ * @param options - Reschedule options
3023
+ * @returns The rescheduled job or null
3024
+ * @example
3025
+ * await ductape.jobs.reschedule('job_abc123', {
3026
+ * start_at: Date.now() + 3600000, // 1 hour from now
3027
+ * });
3028
+ */
3029
+ reschedule: (jobId: string, options: IRescheduleOptions) => Promise<import("./jobs").IJob>;
3030
+ /**
3031
+ * Get job execution history
3032
+ * @param jobId - The job ID
3033
+ * @param options - Options (limit)
3034
+ * @returns Execution history
3035
+ * @example
3036
+ * const history = await ductape.jobs.getHistory('job_abc123');
3037
+ * console.log(history.executions); // Array of past executions
3038
+ */
3039
+ getHistory: (jobId: string, options?: {
3040
+ limit?: number;
3041
+ }) => Promise<import("./jobs").IJobHistory>;
3042
+ /**
3043
+ * Get job statistics
3044
+ * @param options - Filter options
3045
+ * @returns Job statistics
3046
+ * @example
3047
+ * const stats = await ductape.jobs.getStats({ product: 'my-product' });
3048
+ * console.log(stats.total, stats.completed, stats.failed);
3049
+ */
3050
+ getStats: (options?: {
3051
+ product?: string;
3052
+ env?: string;
3053
+ from?: number;
3054
+ to?: number;
3055
+ }) => Promise<import("./jobs").IJobStats>;
3056
+ /**
3057
+ * Set a webhook for job events
3058
+ * @param config - Webhook configuration
3059
+ * @returns Promise<void>
3060
+ * @example
3061
+ * await ductape.jobs.setWebhook({
3062
+ * url: 'https://api.example.com/webhooks/jobs',
3063
+ * events: ['completed', 'failed'],
3064
+ * secret: 'webhook-secret',
3065
+ * });
3066
+ */
3067
+ setWebhook: (config: IJobWebhookConfig) => Promise<void>;
3068
+ /**
3069
+ * Get the underlying JobsService instance (for advanced usage)
3070
+ */
3071
+ getService: () => Promise<JobsService>;
3072
+ };
3073
+ /**
3074
+ * Secrets management for workspace secrets.
3075
+ *
3076
+ * Secrets allow you to store sensitive values (API keys, passwords, etc.) securely
3077
+ * and reference them in configurations using the $Secret{key} syntax.
3078
+ *
3079
+ * @example
3080
+ * // Create a secret
3081
+ * await ductape.secrets.create({
3082
+ * key: 'STRIPE_API_KEY',
3083
+ * value: 'sk_live_51ABC123...',
3084
+ * description: 'Production Stripe API key',
3085
+ * scope: ['payment_app'],
3086
+ * envs: ['prd'],
3087
+ * });
3088
+ *
3089
+ * // Use secret in database config
3090
+ * await ductape.databases.create({
3091
+ * tag: 'main-db',
3092
+ * name: 'Main Database',
3093
+ * type: 'mongodb',
3094
+ * envs: [{
3095
+ * slug: 'prd',
3096
+ * connection_url: '$Secret{MONGODB_CONNECTION_URL}'
3097
+ * }]
3098
+ * });
3099
+ */
3100
+ secrets: {
3101
+ /**
3102
+ * Create a new secret in the workspace
3103
+ * @param input - Secret creation input
3104
+ * @returns The created secret metadata (without value)
3105
+ * @example
3106
+ * const secret = await ductape.secrets.create({
3107
+ * key: 'STRIPE_API_KEY',
3108
+ * value: 'sk_live_51ABC123...',
3109
+ * description: 'Production Stripe API key',
3110
+ * token_type: 'api',
3111
+ * scope: ['payment_app'],
3112
+ * envs: ['prd'],
3113
+ * expires_at: Math.floor(Date.now() / 1000) + (365 * 24 * 60 * 60)
3114
+ * });
3115
+ */
3116
+ create: (input: ICreateSecretInput) => Promise<ISecretMetadata>;
3117
+ /**
3118
+ * Fetch all secrets in the workspace (metadata only, no values)
3119
+ * @returns Array of secret metadata
3120
+ * @example
3121
+ * const secrets = await ductape.secrets.fetchAll();
3122
+ * secrets.forEach(s => console.log(s.key, s.description));
3123
+ */
3124
+ list: () => Promise<ISecretMetadata[]>;
3125
+ /**
3126
+ * Fetch a single secret with its decrypted value
3127
+ * @param key - The secret key
3128
+ * @returns The full secret including decrypted value
3129
+ * @example
3130
+ * const secret = await ductape.secrets.fetch('STRIPE_API_KEY');
3131
+ * console.log(secret.value); // sk_live_51ABC123...
3132
+ */
3133
+ fetch: (key: string) => Promise<ISecret>;
3134
+ /**
3135
+ * Update an existing secret
3136
+ * @param key - The secret key to update
3137
+ * @param input - Update data
3138
+ * @returns Updated secret metadata
3139
+ * @example
3140
+ * await ductape.secrets.update('STRIPE_API_KEY', {
3141
+ * value: 'sk_live_NEW_KEY...',
3142
+ * description: 'Rotated Stripe API key'
3143
+ * });
3144
+ */
3145
+ update: (key: string, input: IUpdateSecretInput) => Promise<ISecretMetadata>;
3146
+ /**
3147
+ * Delete a secret permanently
3148
+ * @param key - The secret key to delete
3149
+ * @returns true if deleted successfully
3150
+ * @example
3151
+ * await ductape.secrets.delete('OLD_API_KEY');
3152
+ */
3153
+ delete: (key: string) => Promise<boolean>;
3154
+ /**
3155
+ * Revoke a secret (disable without deleting)
3156
+ * @param key - The secret key to revoke
3157
+ * @returns true if revoked successfully
3158
+ * @example
3159
+ * await ductape.secrets.revoke('COMPROMISED_KEY');
3160
+ */
3161
+ revoke: (key: string) => Promise<boolean>;
3162
+ /**
3163
+ * Check if a secret exists
3164
+ * @param key - The secret key to check
3165
+ * @returns true if the secret exists
3166
+ * @example
3167
+ * if (await ductape.secrets.exists('MY_SECRET')) {
3168
+ * console.log('Secret exists');
3169
+ * }
3170
+ */
3171
+ exists: (key: string) => Promise<boolean>;
3172
+ /**
3173
+ * Resolve all $Secret{key} references in a value
3174
+ * Works with strings, objects, and arrays
3175
+ * @param value - The value containing secret references
3176
+ * @param options - Resolution options (app, env for scope/env validation)
3177
+ * @returns Resolved value with secrets replaced
3178
+ * @example
3179
+ * const config = {
3180
+ * apiKey: '$Secret{API_KEY}',
3181
+ * dbUrl: '$Secret{DB_URL}'
3182
+ * };
3183
+ * const resolved = await ductape.secrets.resolve(config, { env: 'prd' });
3184
+ */
3185
+ resolve: <T>(value: T, options?: IResolveSecretsOptions) => Promise<import("./secrets").ISecretResolutionResult<T>>;
3186
+ /**
3187
+ * Validate that all $Secret{key} references in a value exist
3188
+ * @param value - The value containing secret references
3189
+ * @returns Validation result with existing and missing keys
3190
+ * @example
3191
+ * const result = await ductape.secrets.validate({
3192
+ * url: '$Secret{API_URL}',
3193
+ * key: '$Secret{MISSING_KEY}'
3194
+ * });
3195
+ * if (!result.valid) {
3196
+ * console.error('Missing secrets:', result.missingKeys);
3197
+ * }
3198
+ */
3199
+ validate: (value: unknown) => Promise<{
3200
+ valid: boolean;
3201
+ missingKeys: string[];
3202
+ existingKeys: string[];
3203
+ }>;
3204
+ /**
3205
+ * Get the underlying SecretsService instance (for advanced usage)
3206
+ */
3207
+ getService: () => Promise<SecretsService>;
3208
+ };
3209
+ /**
3210
+ * Cache-related operations for managing product caches.
3211
+ */
3212
+ caches: {
3213
+ /**
3214
+ * Creates a cache for a product.
3215
+ * @param {string} product - The product tag.
3216
+ * @param {IProductCache} data - The cache data.
3217
+ * @returns {Promise<void>} Resolves when the cache is created. Throws on error.
3218
+ */
3219
+ create: (data: IProductCache & {
3220
+ product: string;
3221
+ }) => Promise<void>;
3222
+ /**
3223
+ * Fetches all caches for a product.
3224
+ * @param {string} product - The product tag.
3225
+ * @returns {IProductCache[]} The list of caches.
3226
+ */
3227
+ list: (product: string) => Promise<IProductCache[]>;
3228
+ /**
3229
+ * Fetches a cache by tag.
3230
+ * @param {string} product - The product tag.
3231
+ * @param {string} tag - The cache tag.
3232
+ * @returns {IProductCache|null} The fetched cache, or null if not found.
3233
+ */
3234
+ fetch: (product: string, tag: string) => Promise<IProductCache>;
3235
+ /**
3236
+ * Updates a cache by tag.
3237
+ * @param {string} product - The product tag.
3238
+ * @param {string} tag - The cache tag.
3239
+ * @param {Partial<IProductCache>} data - The cache data to update.
3240
+ * @returns {Promise<void>} Resolves when the cache is updated. Throws on error.
3241
+ */
3242
+ update: (product: string, tag: string, data: Partial<IProductCache>) => Promise<void>;
3243
+ /**
3244
+ * Deletes a cache by tag.
3245
+ * @param {string} product - The product tag.
3246
+ * @param {string} tag - The cache tag.
3247
+ * @returns {Promise<void>} Resolves when the cache is deleted. Throws on error.
3248
+ */
3249
+ delete: (product: string, tag: string) => Promise<void>;
3250
+ values: (data: FetchRemoteCachePayload) => Promise<import("./types").IRemoteCache[]>;
3251
+ /**
3252
+ * Fetch paginated cache values with filtering options.
3253
+ * @param options - Options for fetching cache values
3254
+ * @returns Paginated cache values result
3255
+ * @example
3256
+ * ```ts
3257
+ * const result = await ductape.caches.fetchValues({
3258
+ * product: 'my-product',
3259
+ * cache: 'user-cache',
3260
+ * page: 1,
3261
+ * limit: 20,
3262
+ * });
3263
+ * ```
3264
+ */
3265
+ fetchValues: (options: {
3266
+ product: string;
3267
+ cache: string;
3268
+ env?: string;
3269
+ page?: number;
3270
+ limit?: number;
3271
+ expiryFilter?: "all" | "expiring" | "permanent" | "expired";
3272
+ }) => Promise<import("./cache").IFetchCacheValuesResult>;
3273
+ /**
3274
+ * Fetch cache dashboard metrics.
3275
+ * @param options - Options for fetching dashboard
3276
+ * @returns Cache dashboard metrics
3277
+ * @example
3278
+ * ```ts
3279
+ * const dashboard = await ductape.caches.fetchDashboard({
3280
+ * product: 'my-product',
3281
+ * cache: 'user-cache',
3282
+ * });
3283
+ * ```
3284
+ */
3285
+ fetchDashboard: (options: {
3286
+ product: string;
3287
+ cache: string;
3288
+ env?: string;
3289
+ }) => Promise<import("./cache").ICacheDashboardMetrics>;
3290
+ /**
3291
+ * Get a cache value by key.
3292
+ * @param options - Options containing the key
3293
+ * @returns The cache value or null if not found
3294
+ * @example
3295
+ * ```ts
3296
+ * const value = await ductape.caches.get({ key: 'user:123' });
3297
+ * ```
3298
+ */
3299
+ get: (options: {
3300
+ key: string;
3301
+ }) => Promise<import("./cache").ICacheValue>;
3302
+ /**
3303
+ * Set a cache value.
3304
+ * @param options - Options for setting the cache value
3305
+ * @returns Boolean indicating success
3306
+ * @example
3307
+ * ```ts
3308
+ * await ductape.caches.set({
3309
+ * product: 'my-product',
3310
+ * cache: 'user-cache',
3311
+ * key: 'user:123',
3312
+ * value: JSON.stringify({ name: 'John' }),
3313
+ * });
3314
+ * ```
3315
+ */
3316
+ set: (options: {
3317
+ product: string;
3318
+ cache: string;
3319
+ key: string;
3320
+ value: string;
3321
+ componentTag?: string;
3322
+ componentType?: string;
3323
+ expiry?: Date;
3324
+ }) => Promise<boolean>;
3325
+ /**
3326
+ * Clear a cache value by key.
3327
+ * @param options - Options containing the key
3328
+ * @returns Boolean indicating success
3329
+ * @example
3330
+ * ```ts
3331
+ * await ductape.caches.clear({ key: 'user:123' });
3332
+ * ```
3333
+ */
3334
+ clear: (options: {
3335
+ key: string;
3336
+ }) => Promise<boolean>;
3337
+ /**
3338
+ * Clear all cache values for a product/cache combination.
3339
+ * @param options - Options for clearing cache values
3340
+ * @returns Object with cleared count
3341
+ * @example
3342
+ * ```ts
3343
+ * const result = await ductape.caches.clearAll({
3344
+ * product: 'my-product',
3345
+ * cache: 'user-cache',
3346
+ * });
3347
+ * console.log('Cleared:', result.cleared);
3348
+ * ```
3349
+ */
3350
+ clearAll: (options: {
3351
+ product: string;
3352
+ cache: string;
3353
+ env?: string;
3354
+ }) => Promise<import("./cache").IClearCacheValuesResult>;
3355
+ };
3356
+ /**
3357
+ * App-related operations for managing apps.
798
3358
  */
799
3359
  app: {
800
3360
  /**
@@ -819,397 +3379,382 @@ export default class Ductape implements IDuctape {
819
3379
  */
820
3380
  update: (tag: string, data: Partial<IApp>) => Promise<void>;
821
3381
  /**
822
- * Initializes an app by tag.
3382
+ * Initializes an app by tag (pre-loads builder into cache).
823
3383
  * @param {string} appTag - The app tag.
824
3384
  * @returns {Promise<void>} Resolves when initialization is complete. Throws on error.
825
3385
  */
826
3386
  init: (appTag: string) => Promise<void>;
827
- variables: {
828
- /**
829
- * Creates a variable for an app.
830
- * @param {IAppVariables} data - The variable data.
831
- * @returns {Promise<void>} Resolves when the variable is created. Throws on error.
832
- */
833
- create: (data: IAppVariables) => Promise<void>;
834
- /**
835
- * Fetches all variables for an app.
836
- * @returns {IAppVariables[]} The list of variables.
837
- */
838
- fetchAll: () => IAppVariables[];
839
- /**
840
- * Fetches a variable by tag.
841
- * @param {string} tag - The variable tag.
842
- * @returns {IAppVariables|null} The fetched variable, or null if not found.
843
- */
844
- fetch: (tag: string) => IAppVariables;
845
- /**
846
- * Updates a variable by tag.
847
- * @param {string} tag - The variable tag.
848
- * @param {Partial<IAppVariables>} data - The variable data to update.
849
- * @returns {Promise<void>} Resolves when the variable is updated. Throws on error.
850
- */
851
- update: (tag: string, data: Partial<IAppVariables>) => Promise<void>;
852
- };
853
- constants: {
854
- /**
855
- * Creates a constant for an app.
856
- * @param {IAppConstants} data - The constant data.
857
- * @returns {Promise<void>} Resolves when the constant is created. Throws on error.
858
- */
859
- create: (data: IAppConstants) => Promise<void>;
860
- /**
861
- * Fetches all constants for an app.
862
- * @returns {IAppConstants[]} The list of constants.
863
- */
864
- fetchAll: () => IAppConstants[];
865
- /**
866
- * Fetches a constant by tag.
867
- * @param {string} tag - The constant tag.
868
- * @returns {IAppConstants|null} The fetched constant, or null if not found.
869
- */
870
- fetch: (tag: string) => IAppConstants;
871
- /**
872
- * Updates a constant by tag.
873
- * @param {string} tag - The constant tag.
874
- * @param {Partial<IAppVariables>} data - The constant data to update.
875
- * @returns {Promise<void>} Resolves when the constant is updated. Throws on error.
876
- */
877
- update: (tag: string, data: Partial<IAppVariables>) => Promise<void>;
878
- };
879
- actions: {
880
- /**
881
- * Imports actions for an app from a file.
882
- * @param {Object} params - The import parameters.
883
- * @param {Buffer} params.file - The file buffer.
884
- * @param {ImportDocsTypes} params.type - The import type.
885
- * @param {string} params.version - The version.
886
- * @param {string} [params.appTag] - The app tag (optional).
887
- * @param {boolean} [params.updateIfExists] - Whether to update if actions exist (optional).
888
- * @returns {Promise<void>} Resolves when the import is complete. Throws on error.
889
- */
890
- import: ({ file, type, version, appTag, updateIfExists, }: {
891
- file: Buffer;
892
- type: ImportDocsTypes;
893
- version: string;
894
- appTag?: string;
895
- updateIfExists?: boolean;
896
- }) => Promise<void>;
897
- /**
898
- * Updates an action by tag.
899
- * @param {string} tag - The action tag.
900
- * @param {Partial<IActionUpdate>} data - The action data to update.
901
- * @returns {Promise<void>} Resolves when the action is updated. Throws on error.
902
- */
903
- update: (tag: string, data: Partial<IActionUpdate>) => Promise<void>;
904
- /**
905
- * Fetches all actions for an app.
906
- * @returns {IAppAction[]} The list of actions.
907
- */
908
- fetchAll: () => IAppAction[];
909
- /**
910
- * Fetches an action by tag.
911
- * @param {string} tag - The action tag.
912
- * @returns {IAppAction|null} The fetched action, or null if not found.
913
- */
914
- fetch: (tag: string) => IAppAction;
915
- };
916
- auths: {
917
- /**
918
- * Creates an auth for an app.
919
- * @param {IAppAuth} data - The auth data.
920
- * @returns {Promise<void>} Resolves when the auth is created. Throws on error.
921
- */
922
- create: (data: IAppAuth) => Promise<void>;
923
- /**
924
- * Fetches all auths for an app.
925
- * @returns {IAppAuth[]} The list of auths.
926
- */
927
- fetchAll: () => IAppAuth[];
928
- /**
929
- * Fetches an auth by tag.
930
- * @param {string} tag - The auth tag.
931
- * @returns {IAppAuth|null} The fetched auth, or null if not found.
932
- */
933
- fetch: (tag: string) => IAppAuth;
934
- /**
935
- * Updates an auth by tag.
936
- * @param {string} tag - The auth tag.
937
- * @param {Partial<IAppAuth>} data - The auth data to update.
938
- * @returns {Promise<void>} Resolves when the auth is updated. Throws on error.
939
- */
940
- update: (tag: string, data: Partial<IAppAuth>) => Promise<void>;
941
- };
942
- webhooks: {
943
- /**
944
- * Creates a webhook for an app.
945
- * @param {Partial<IAppWebhook>} data - The webhook data.
946
- * @returns {Promise<void>} Resolves when the webhook is created. Throws on error.
947
- */
948
- create: (data: Partial<IAppWebhook>) => Promise<void>;
949
- /**
950
- * Fetches all webhooks for an app.
951
- * @returns {IAppWebhook[]} The list of webhooks.
952
- */
953
- fetchAll: () => IAppWebhook[];
954
- /**
955
- * Fetches a webhook by tag.
956
- * @param {string} tag - The webhook tag.
957
- * @returns {IAppWebhook|null} The fetched webhook, or null if not found.
958
- */
959
- fetch: (tag: string) => IAppWebhook;
960
- /**
961
- * Updates a webhook by tag.
962
- * @param {string} tag - The webhook tag.
963
- * @param {Partial<IAppWebhook>} data - The webhook data to update.
964
- * @returns {Promise<void>} Resolves when the webhook is updated. Throws on error.
965
- */
966
- update: (tag: string, data: Partial<IAppWebhook>) => Promise<void>;
967
- events: {
968
- /**
969
- * Creates a webhook event for an app.
970
- * @param {IAppWebhookEvent} data - The webhook event data.
971
- * @returns {Promise<void>} Resolves when the webhook event is created. Throws on error.
972
- */
973
- create: (data: IAppWebhookEvent) => Promise<void>;
974
- /**
975
- * Fetches all webhook events for a webhook by tag.
976
- * @param {string} webhookTag - The webhook tag.
977
- * @returns {IAppWebhookEvent[]} The list of webhook events.
978
- */
979
- fetchAll: (webhookTag: string) => IAppWebhookEvent[];
980
- /**
981
- * Fetches a webhook event by tag.
982
- * @param {string} tag - The webhook event tag.
983
- * @returns {IAppWebhookEvent|null} The fetched webhook event, or null if not found.
984
- */
985
- fetch: (tag: string) => IAppWebhookEvent;
986
- /**
987
- * Updates a webhook event by tag.
988
- * @param {string} tag - The webhook event tag.
989
- * @param {Partial<IAppWebhookEvent>} data - The webhook event data to update.
990
- * @returns {Promise<void>} Resolves when the webhook event is updated. Throws on error.
991
- */
992
- update: (tag: string, data: Partial<IAppWebhookEvent>) => Promise<void>;
993
- };
994
- };
3387
+ /**
3388
+ * Updates data validation for an app.
3389
+ * @param {string} appTag - The app tag.
3390
+ * @param {string} selector - The selector for the data validation.
3391
+ * @param {Partial<IParsedSample>} update - The update data.
3392
+ * @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
3393
+ */
3394
+ validation: (appTag: string, selector: string, update: Partial<IParsedSample>) => Promise<void>;
995
3395
  environments: {
996
3396
  /**
997
3397
  * Creates an environment for an app.
3398
+ * @param {string} appTag - The app tag.
998
3399
  * @param {IAppEnv} data - The environment data.
999
3400
  * @returns {Promise<void>} Resolves when the environment is created. Throws on error.
1000
3401
  */
1001
- create: (data: IAppEnv) => Promise<void>;
3402
+ create: (appTag: string, data: IAppEnv) => Promise<void>;
1002
3403
  /**
1003
3404
  * Fetches all environments for an app.
3405
+ * @param {string} appTag - The app tag.
1004
3406
  * @returns {IAppEnv[]} The list of environments.
1005
3407
  */
1006
- fetchAll: () => IAppEnv[];
3408
+ list: (appTag: string) => Promise<IAppEnv[]>;
1007
3409
  /**
1008
3410
  * Fetches an environment by slug.
3411
+ * @param {string} appTag - The app tag.
1009
3412
  * @param {string} slug - The environment slug.
1010
3413
  * @returns {IAppEnv|null} The fetched environment, or null if not found.
1011
3414
  */
1012
- fetch: (slug: string) => IAppEnv;
3415
+ fetch: (appTag: string, slug: string) => Promise<IAppEnv>;
1013
3416
  /**
1014
3417
  * Updates an environment by slug.
3418
+ * @param {string} appTag - The app tag.
1015
3419
  * @param {string} slug - The environment slug.
1016
3420
  * @param {Partial<IAppEnv>} data - The environment data to update.
1017
3421
  * @returns {Promise<void>} Resolves when the environment is updated. Throws on error.
1018
3422
  */
1019
- update: (slug: string, data: Partial<IAppEnv>) => Promise<void>;
3423
+ update: (appTag: string, slug: string, data: Partial<IAppEnv>) => Promise<void>;
1020
3424
  };
3425
+ };
3426
+ /**
3427
+ * Variable-related operations for managing app variables.
3428
+ */
3429
+ variables: {
1021
3430
  /**
1022
- * Updates data validation for an app.
1023
- * @param {string} selector - The selector for the data validation.
1024
- * @param {Partial<IParsedSample>} update - The update data.
1025
- * @returns {Promise<void>} Resolves when the validation is updated. Throws on error.
3431
+ * Creates a variable for an app.
3432
+ * @param {string} appTag - The app tag.
3433
+ * @param {IAppVariables} data - The variable data.
3434
+ * @returns {Promise<void>} Resolves when the variable is created. Throws on error.
3435
+ */
3436
+ create: (appTag: string, data: IAppVariables) => Promise<void>;
3437
+ /**
3438
+ * Fetches all variables for an app.
3439
+ * @param {string} appTag - The app tag.
3440
+ * @returns {IAppVariables[]} The list of variables.
3441
+ */
3442
+ list: (appTag: string) => Promise<IAppVariables[]>;
3443
+ /**
3444
+ * Fetches a variable by tag.
3445
+ * @param {string} appTag - The app tag.
3446
+ * @param {string} tag - The variable tag.
3447
+ * @returns {IAppVariables|null} The fetched variable, or null if not found.
1026
3448
  */
1027
- validation: (selector: string, update: Partial<IParsedSample>) => Promise<void>;
3449
+ fetch: (appTag: string, tag: string) => Promise<IAppVariables>;
3450
+ /**
3451
+ * Updates a variable by tag.
3452
+ * @param {string} appTag - The app tag.
3453
+ * @param {string} tag - The variable tag.
3454
+ * @param {Partial<IAppVariables>} data - The variable data to update.
3455
+ * @returns {Promise<void>} Resolves when the variable is updated. Throws on error.
3456
+ */
3457
+ update: (appTag: string, tag: string, data: Partial<IAppVariables>) => Promise<void>;
1028
3458
  };
1029
3459
  /**
1030
- * Processor-related operations for running jobs, actions, database actions, sessions, features, quotas, fallbacks, notifications, storage, and message broker.
3460
+ * Constant-related operations for managing app constants.
1031
3461
  */
1032
- processor: {
1033
- job: {
1034
- /**
1035
- * Schedules a job for a product.
1036
- * @param {IProduct} data - The product data.
1037
- * @returns {Promise<any>} The result of the job scheduling.
1038
- */
1039
- schedule: (data: IProduct) => Promise<void>;
1040
- };
1041
- action: {
1042
- /**
1043
- * Runs an action processor.
1044
- * @param {IActionProcessorInput} data - The action processor input.
1045
- * @returns {Promise<any>} The result of the action processing.
1046
- */
1047
- run: (data: IActionProcessorInput) => Promise<any>;
1048
- };
1049
- db: {
1050
- /**
1051
- * Executes a database action processor.
1052
- * @param {IDBActionProcessorInput} data - The database action processor input.
1053
- * @returns {Promise<any>} The result of the database action processing.
1054
- */
1055
- execute: (data: IDBActionProcessorInput) => Promise<any>;
1056
- migration: {
1057
- /**
1058
- * Runs a database migration.
1059
- * @param {Object} params - The migration parameters.
1060
- * @param {string} params.migration - The migration name.
1061
- * @param {string} params.env - The environment.
1062
- * @param {string} params.product - The product name.
1063
- * @returns {Promise<any>} The result of the migration.
1064
- */
1065
- run: ({ migration, env, product }: {
1066
- migration: string;
1067
- env: string;
1068
- product: string;
1069
- }) => Promise<{
1070
- process_id: string;
1071
- }>;
1072
- /**
1073
- * Rolls back a database migration.
1074
- * @param {Object} params - The migration parameters.
1075
- * @param {string} params.migration - The migration name.
1076
- * @param {string} params.env - The environment.
1077
- * @param {string} params.product - The product name.
1078
- * @returns {Promise<any>} The result of the rollback.
1079
- */
1080
- rollback: ({ migration, env, product }: {
1081
- migration: string;
1082
- env: string;
1083
- product: string;
1084
- }) => Promise<{
1085
- process_id: string;
1086
- }>;
1087
- };
1088
- };
1089
- sessions: {
1090
- /**
1091
- * Starts a new session.
1092
- * @param {ISessionInput} data - The session input data.
1093
- * @returns {Promise<any>} The result of the session generation.
1094
- */
1095
- start: (data: ISessionInput) => Promise<import("./types").ISessionOutput>;
1096
- /**
1097
- * Decrypts a session.
1098
- * @param {ISessionPayload} data - The session payload.
1099
- * @returns {Promise<any>} The decrypted session.
1100
- */
1101
- decrypt: (data: ISessionPayload) => Promise<any>;
1102
- /**
1103
- * Refreshes a session.
1104
- * @param {ISessionRefreshPayload} data - The session refresh payload.
1105
- * @returns {Promise<any>} The refreshed session.
1106
- */
1107
- refresh: (data: ISessionRefreshPayload) => Promise<import("./types").ISessionOutput>;
1108
- };
1109
- feature: {
1110
- /**
1111
- * Runs a feature processor.
1112
- * @param {IProcessorInput} data - The feature processor input.
1113
- * @returns {Promise<any>} The result of the feature processing.
1114
- */
1115
- run: (data: IProcessorInput) => Promise<{
1116
- process_id: string;
1117
- }>;
1118
- /**
1119
- * Generates output for a process by ID.
1120
- * @param {string} process_id - The process ID.
1121
- * @returns {Promise<any>} The generated output.
1122
- */
1123
- output: (process_id: string) => Promise<{
1124
- process_id: string;
1125
- status: import("./types").LogEventStatus;
1126
- data: Record<string, unknown>;
1127
- errors?: undefined;
1128
- } | {
1129
- process_id: string;
1130
- status: import("./types").LogEventStatus;
1131
- errors: string[];
1132
- data?: undefined;
1133
- } | {
1134
- process_id: string;
1135
- status: import("./types").LogEventStatus;
1136
- data?: undefined;
1137
- errors?: undefined;
1138
- }>;
1139
- /**
1140
- * Replays a process by ID.
1141
- * @param {string} process_id - The process ID.
1142
- * @returns {Promise<any>} The result of the replay.
1143
- */
1144
- replay: (process_id: string) => Promise<{
1145
- process_id: string;
1146
- }>;
1147
- /**
1148
- * Resumes a process by ID.
1149
- * @param {string} process_id - The process ID.
1150
- * @returns {Promise<any>} The result of the resume.
1151
- */
1152
- resume: (process_id: string) => Promise<{
1153
- process_id: string;
1154
- }>;
1155
- };
1156
- quota: {
1157
- /**
1158
- * Runs a quota processor.
1159
- * @param {IProcessorInput} data - The quota processor input.
1160
- * @returns {Promise<any>} The result of the quota processing.
1161
- */
1162
- run: (data: IProcessorInput) => Promise<any>;
1163
- };
1164
- fallback: {
1165
- /**
1166
- * Runs a fallback processor.
1167
- * @param {IProcessorInput} data - The fallback processor input.
1168
- * @returns {Promise<any>} The result of the fallback processing.
1169
- */
1170
- run: (data: IProcessorInput) => Promise<any>;
1171
- };
1172
- notification: {
1173
- /**
1174
- * Sends a notification using the notification processor.
1175
- * @param {INotificationProcessorInput} data - The notification processor input.
1176
- * @returns {Promise<any>} The result of the notification processing.
1177
- */
1178
- send: (data: INotificationProcessorInput) => Promise<{
1179
- process_id: string;
1180
- }>;
1181
- };
1182
- storage: {
3462
+ constants: {
3463
+ /**
3464
+ * Creates a constant for an app.
3465
+ * @param {string} appTag - The app tag.
3466
+ * @param {IAppConstants} data - The constant data.
3467
+ * @returns {Promise<void>} Resolves when the constant is created. Throws on error.
3468
+ */
3469
+ create: (appTag: string, data: IAppConstants) => Promise<void>;
3470
+ /**
3471
+ * Fetches all constants for an app.
3472
+ * @param {string} appTag - The app tag.
3473
+ * @returns {IAppConstants[]} The list of constants.
3474
+ */
3475
+ list: (appTag: string) => Promise<IAppConstants[]>;
3476
+ /**
3477
+ * Fetches a constant by tag.
3478
+ * @param {string} appTag - The app tag.
3479
+ * @param {string} tag - The constant tag.
3480
+ * @returns {IAppConstants|null} The fetched constant, or null if not found.
3481
+ */
3482
+ fetch: (appTag: string, tag: string) => Promise<IAppConstants>;
3483
+ /**
3484
+ * Updates a constant by tag.
3485
+ * @param {string} appTag - The app tag.
3486
+ * @param {string} tag - The constant tag.
3487
+ * @param {Partial<IAppVariables>} data - The constant data to update.
3488
+ * @returns {Promise<void>} Resolves when the constant is updated. Throws on error.
3489
+ */
3490
+ update: (appTag: string, tag: string, data: Partial<IAppVariables>) => Promise<void>;
3491
+ };
3492
+ /**
3493
+ * Action-related operations for managing app actions.
3494
+ */
3495
+ actions: {
3496
+ /**
3497
+ * Imports actions for an app from a file.
3498
+ * @param {Object} params - The import parameters.
3499
+ * @param {Buffer} params.file - The file buffer.
3500
+ * @param {ImportDocsTypes} params.type - The import type.
3501
+ * @param {string} params.version - The version.
3502
+ * @param {string} [params.appTag] - The app tag (optional).
3503
+ * @param {boolean} [params.updateIfExists] - Whether to update if actions exist (optional).
3504
+ * @returns {Promise<void>} Resolves when the import is complete. Throws on error.
3505
+ */
3506
+ import: ({ file, type, version, appTag, updateIfExists, isAdminImport, }: {
3507
+ file: Buffer;
3508
+ type: ImportDocsTypes;
3509
+ version: string;
3510
+ appTag?: string;
3511
+ updateIfExists?: boolean;
3512
+ isAdminImport?: boolean;
3513
+ }) => Promise<void>;
3514
+ /**
3515
+ * Updates an action by tag.
3516
+ * @param {string} appTag - The app tag.
3517
+ * @param {string} tag - The action tag.
3518
+ * @param {Partial<IActionUpdate>} data - The action data to update.
3519
+ * @returns {Promise<void>} Resolves when the action is updated. Throws on error.
3520
+ */
3521
+ update: (appTag: string, tag: string, data: Partial<IActionUpdate>) => Promise<void>;
3522
+ /**
3523
+ * Creates an action.
3524
+ * @param {string} appTag - The app tag.
3525
+ * @param {Partial<IActionUpdate> & { tag: string; name: string; resource: string; method: string; folder_id?: string }} data - The action data.
3526
+ * @returns {Promise<void>} Resolves when the action is created. Throws on error.
3527
+ */
3528
+ create: (appTag: string, data: Partial<IActionUpdate> & {
3529
+ tag: string;
3530
+ name: string;
3531
+ resource: string;
3532
+ method: string;
3533
+ folder_id?: string;
3534
+ }) => Promise<void>;
3535
+ /**
3536
+ * Fetches all actions for an app.
3537
+ * @param {string} appTag - The app tag.
3538
+ * @returns {IAppAction[]} The list of actions.
3539
+ */
3540
+ list: (appTag: string) => Promise<IAppAction[]>;
3541
+ /**
3542
+ * Fetches an action by tag.
3543
+ * @param {string} appTag - The app tag.
3544
+ * @param {string} tag - The action tag.
3545
+ * @returns {IAppAction|null} The fetched action, or null if not found.
3546
+ */
3547
+ fetch: (appTag: string, tag: string) => Promise<IAppAction>;
3548
+ /**
3549
+ * Runs an action processor immediately.
3550
+ * @param {IActionProcessorInput} data - The action processor input.
3551
+ * @returns {Promise<any>} The result of the action processing.
3552
+ * @example
3553
+ * await ductape.actions.run({
3554
+ * product: 'my-product',
3555
+ * env: 'production',
3556
+ * app: 'stripe',
3557
+ * action: 'charge',
3558
+ * input: { amount: 1000, currency: 'usd' }
3559
+ * });
3560
+ */
3561
+ run: (data: IActionProcessorInput) => Promise<any>;
3562
+ /**
3563
+ * Dispatches an action to run as a scheduled job.
3564
+ * @param {IActionDispatchInput} data - The action dispatch input with scheduling options.
3565
+ * @returns {Promise<IDispatchResult>} The dispatch result with job ID and status.
3566
+ * @example
3567
+ * // Run once at a specific time
3568
+ * await ductape.actions.dispatch({
3569
+ * product: 'my-product',
3570
+ * env: 'production',
3571
+ * app: 'stripe',
3572
+ * event: 'charge',
3573
+ * input: { amount: 1000 },
3574
+ * schedule: { start_at: Date.now() + 3600000 } // 1 hour from now
3575
+ * });
3576
+ *
3577
+ * // Run on a cron schedule
3578
+ * await ductape.actions.dispatch({
3579
+ * product: 'my-product',
3580
+ * env: 'production',
3581
+ * app: 'analytics',
3582
+ * event: 'daily-report',
3583
+ * input: {},
3584
+ * schedule: { cron: '0 9 * * *', tz: 'America/New_York' } // 9 AM daily
3585
+ * });
3586
+ */
3587
+ dispatch: (data: IActionDispatchInput) => Promise<IDispatchResult>;
3588
+ /**
3589
+ * Set shared configuration (credentials) for a product/app/env combination.
3590
+ * Credentials are automatically merged into action inputs before resolution.
3591
+ * @param {IShareCredentialsConfig} config - The credential configuration.
3592
+ * @example
3593
+ * // Define app configuration and set credentials
3594
+ * const stripeConfig = { product: 'my-product', app: 'stripe', env: 'prd' };
3595
+ *
3596
+ * ductape.actions.config({
3597
+ * ...stripeConfig,
3598
+ * credentials: {
3599
+ * 'headers:Authorization': '$Secret{StripeApiKey}',
3600
+ * }
3601
+ * });
3602
+ *
3603
+ * // Now all stripe actions automatically include the Authorization header
3604
+ * await ductape.actions.run({
3605
+ * ...stripeConfig,
3606
+ * action: 'create-charge',
3607
+ * input: { amount: 1000, currency: 'usd' }
3608
+ * });
3609
+ */
3610
+ config: (config: IShareCredentialsConfig) => void;
3611
+ /**
3612
+ * Set up OAuth configuration with automatic token refresh for a product/app/env combination.
3613
+ * Tokens are stored securely using $Secret{} and automatically refreshed when expired.
3614
+ * @param {IOAuthConfig} config - The OAuth configuration.
3615
+ * @example
3616
+ * // Set up OAuth with automatic refresh using ductape.actions.run
3617
+ * await ductape.actions.oauth({
3618
+ * product: 'my-product',
3619
+ * app: 'salesforce',
3620
+ * env: 'prd',
3621
+ * tokens: {
3622
+ * accessToken: initialAccessToken,
3623
+ * refreshToken: initialRefreshToken,
3624
+ * },
3625
+ * expiresAt: tokenExpiry,
3626
+ * credentials: (tokens) => ({
3627
+ * 'headers:Authorization': `Bearer ${tokens.accessToken}`
3628
+ * }),
3629
+ * onExpiry: async (currentTokens) => {
3630
+ * // Use ductape.actions.run to call your refresh token action
3631
+ * const response = await ductape.actions.run({
3632
+ * product: 'my-product',
3633
+ * app: 'salesforce',
3634
+ * env: 'prd',
3635
+ * action: 'refresh-token',
3636
+ * input: {
3637
+ * 'body:grant_type': 'refresh_token',
3638
+ * 'body:refresh_token': currentTokens.refreshToken,
3639
+ * }
3640
+ * });
3641
+ * return {
3642
+ * tokens: {
3643
+ * accessToken: response.access_token,
3644
+ * refreshToken: response.refresh_token || currentTokens.refreshToken
3645
+ * },
3646
+ * expiresIn: response.expires_in
3647
+ * };
3648
+ * }
3649
+ * });
3650
+ *
3651
+ * // Now all salesforce actions automatically include OAuth tokens
3652
+ * // and refresh automatically when expired
3653
+ * await ductape.actions.run({
3654
+ * product: 'my-product',
3655
+ * app: 'salesforce',
3656
+ * env: 'prd',
3657
+ * action: 'get-contacts',
3658
+ * input: { limit: 10 }
3659
+ * });
3660
+ */
3661
+ oauth: (config: IOAuthConfig) => Promise<void>;
3662
+ };
3663
+ /**
3664
+ * Auth-related operations for managing app auths.
3665
+ */
3666
+ auths: {
3667
+ /**
3668
+ * Creates an auth for an app.
3669
+ * @param {string} appTag - The app tag.
3670
+ * @param {IAppAuth} data - The auth data.
3671
+ * @returns {Promise<void>} Resolves when the auth is created. Throws on error.
3672
+ */
3673
+ create: (appTag: string, data: IAppAuth) => Promise<void>;
3674
+ /**
3675
+ * Fetches all auths for an app.
3676
+ * @param {string} appTag - The app tag.
3677
+ * @returns {IAppAuth[]} The list of auths.
3678
+ */
3679
+ list: (appTag: string) => Promise<IAppAuth[]>;
3680
+ /**
3681
+ * Fetches an auth by tag.
3682
+ * @param {string} appTag - The app tag.
3683
+ * @param {string} tag - The auth tag.
3684
+ * @returns {IAppAuth|null} The fetched auth, or null if not found.
3685
+ */
3686
+ fetch: (appTag: string, tag: string) => Promise<IAppAuth>;
3687
+ /**
3688
+ * Updates an auth by tag.
3689
+ * @param {string} appTag - The app tag.
3690
+ * @param {string} tag - The auth tag.
3691
+ * @param {Partial<IAppAuth>} data - The auth data to update.
3692
+ * @returns {Promise<void>} Resolves when the auth is updated. Throws on error.
3693
+ */
3694
+ update: (appTag: string, tag: string, data: Partial<IAppAuth>) => Promise<void>;
3695
+ };
3696
+ /**
3697
+ * Webhook-related operations for managing app webhooks.
3698
+ */
3699
+ webhooks: {
3700
+ /**
3701
+ * Creates a webhook for an app.
3702
+ * @param {string} appTag - The app tag.
3703
+ * @param {Partial<IAppWebhook>} data - The webhook data.
3704
+ * @returns {Promise<void>} Resolves when the webhook is created. Throws on error.
3705
+ */
3706
+ create: (appTag: string, data: Partial<IAppWebhook>) => Promise<void>;
3707
+ /**
3708
+ * Fetches all webhooks for an app.
3709
+ * @param {string} appTag - The app tag.
3710
+ * @returns {IAppWebhook[]} The list of webhooks.
3711
+ */
3712
+ list: (appTag: string) => Promise<IAppWebhook[]>;
3713
+ /**
3714
+ * Fetches a webhook by tag.
3715
+ * @param {string} appTag - The app tag.
3716
+ * @param {string} tag - The webhook tag.
3717
+ * @returns {IAppWebhook|null} The fetched webhook, or null if not found.
3718
+ */
3719
+ fetch: (appTag: string, tag: string) => Promise<IAppWebhook>;
3720
+ /**
3721
+ * Updates a webhook by tag.
3722
+ * @param {string} appTag - The app tag.
3723
+ * @param {string} tag - The webhook tag.
3724
+ * @param {Partial<IAppWebhook>} data - The webhook data to update.
3725
+ * @returns {Promise<void>} Resolves when the webhook is updated. Throws on error.
3726
+ */
3727
+ update: (appTag: string, tag: string, data: Partial<IAppWebhook>) => Promise<void>;
3728
+ events: {
1183
3729
  /**
1184
- * Reads a file from storage.
1185
- * @param {string} path - The file path.
1186
- * @returns {Promise<IFileReadResult>} The file read result.
3730
+ * Creates a webhook event for an app.
3731
+ * @param {string} appTag - The app tag.
3732
+ * @param {IAppWebhookEvent} data - The webhook event data.
3733
+ * @returns {Promise<void>} Resolves when the webhook event is created. Throws on error.
1187
3734
  */
1188
- readFile: (path: string) => Promise<IFileReadResult>;
3735
+ create: (appTag: string, data: IAppWebhookEvent) => Promise<void>;
1189
3736
  /**
1190
- * Saves data to storage using the storage processor.
1191
- * @param {IStorageProcessorInput} data - The storage processor input.
1192
- * @returns {Promise<any>} The result of the storage processing.
3737
+ * Fetches all webhook events for a webhook by tag.
3738
+ * @param {string} appTag - The app tag.
3739
+ * @param {string} webhookTag - The webhook tag.
3740
+ * @returns {IAppWebhookEvent[]} The list of webhook events.
1193
3741
  */
1194
- save: (data: IStorageProcessorInput) => Promise<any>;
1195
- };
1196
- messageBroker: {
3742
+ list: (appTag: string, webhookTag: string) => Promise<IAppWebhookEvent[]>;
1197
3743
  /**
1198
- * Publishes a message using the message broker processor.
1199
- * @param {IMessageBrokerPublishInput} data - The publish input.
1200
- * @returns {Promise<any>} The result of the publish operation.
3744
+ * Fetches a webhook event by tag.
3745
+ * @param {string} appTag - The app tag.
3746
+ * @param {string} tag - The webhook event tag.
3747
+ * @returns {IAppWebhookEvent|null} The fetched webhook event, or null if not found.
1201
3748
  */
1202
- publish: (data: IMessageBrokerPublishInput) => Promise<void | {
1203
- process_id: string;
1204
- }>;
3749
+ fetch: (appTag: string, tag: string) => Promise<IAppWebhookEvent>;
1205
3750
  /**
1206
- * Subscribes to a message broker topic.
1207
- * @param {IMessageBrokerSubscribeInput} data - The subscribe input.
1208
- * @returns {Promise<any>} The result of the subscribe operation.
3751
+ * Updates a webhook event by tag.
3752
+ * @param {string} appTag - The app tag.
3753
+ * @param {string} tag - The webhook event tag.
3754
+ * @param {Partial<IAppWebhookEvent>} data - The webhook event data to update.
3755
+ * @returns {Promise<void>} Resolves when the webhook event is updated. Throws on error.
1209
3756
  */
1210
- subcribe: (data: IMessageBrokerSubscribeInput) => Promise<void | {
1211
- process_id: string;
1212
- }>;
3757
+ update: (appTag: string, tag: string, data: Partial<IAppWebhookEvent>) => Promise<void>;
1213
3758
  };
1214
3759
  };
1215
3760
  /**
@@ -1218,12 +3763,12 @@ export default class Ductape implements IDuctape {
1218
3763
  logs: {
1219
3764
  /**
1220
3765
  * Initializes the logger service for a product or app.
1221
- * @param {string} [productTag] - The product tag (optional).
1222
- * @param {string} [appTag] - The app tag (optional).
3766
+ * @param {string} [product] - The product tag (optional).
3767
+ * @param {string} [app] - The app tag (optional).
1223
3768
  * @throws {Error} If neither productTag nor appTag is provided.
1224
3769
  * @returns {Promise<void>} Resolves when logger is initialized.
1225
3770
  */
1226
- init: (productTag?: string, appTag?: string) => Promise<void>;
3771
+ init: (product?: string, app?: string) => Promise<void>;
1227
3772
  add: () => Promise<void>;
1228
3773
  /**
1229
3774
  * Fetches logs based on provided query parameters.
@@ -1239,6 +3784,84 @@ export default class Ductape implements IDuctape {
1239
3784
  private createNewProcessor;
1240
3785
  private createNewImporter;
1241
3786
  private createNewAppBuilder;
3787
+ /**
3788
+ * Create a new DatabaseService instance with authenticated config
3789
+ * @returns DatabaseService instance
3790
+ */
3791
+ private createNewDatabaseService;
3792
+ /**
3793
+ * Create a new GraphService instance with authenticated config
3794
+ * @returns GraphService instance
3795
+ */
3796
+ private createNewGraphService;
3797
+ /**
3798
+ * Create a new WorkflowService instance with authenticated config
3799
+ * @returns WorkflowService instance
3800
+ */
3801
+ private createNewWorkflowService;
3802
+ /**
3803
+ * Create a new AgentsService instance with authenticated config
3804
+ * @returns AgentsService instance
3805
+ */
3806
+ private createNewAgentsService;
3807
+ /**
3808
+ * Create a new ModelService instance with authenticated config
3809
+ * @returns ModelService instance
3810
+ */
3811
+ private createNewModelService;
3812
+ /**
3813
+ * Create a new VectorDatabaseService instance with authenticated config
3814
+ * @returns VectorDatabaseService instance
3815
+ */
3816
+ private createNewVectorService;
3817
+ /**
3818
+ * Create a new WarehouseService instance with authenticated config
3819
+ * @param product - Product tag
3820
+ * @param env - Environment
3821
+ * @returns WarehouseService instance
3822
+ */
3823
+ private createNewWarehouseService;
3824
+ /**
3825
+ * Create a new CacheService instance with authenticated config
3826
+ * @returns CacheService instance
3827
+ */
3828
+ private createNewCacheService;
3829
+ /**
3830
+ * Create a new JobsService instance with authenticated config
3831
+ * @returns JobsService instance
3832
+ */
3833
+ private createNewJobsService;
3834
+ private createNewSecretsService;
3835
+ /**
3836
+ * Create a new SessionsService instance with authenticated config
3837
+ * @returns SessionsService instance
3838
+ */
3839
+ private createNewSessionsService;
3840
+ /**
3841
+ * Create a new StorageService instance with authenticated config
3842
+ * @returns StorageService instance
3843
+ */
3844
+ private createNewStorageService;
3845
+ /**
3846
+ * Get or create a BrokersService instance with authenticated config (cached)
3847
+ * @returns BrokersService instance
3848
+ */
3849
+ private createNewBrokersService;
3850
+ /**
3851
+ * Create a new QuotaService instance with authenticated config
3852
+ * @returns QuotaService instance (cached)
3853
+ */
3854
+ private createNewQuotaService;
3855
+ /**
3856
+ * Create a new FallbackService instance with authenticated config
3857
+ * @returns FallbackService instance (cached)
3858
+ */
3859
+ private createNewFallbackService;
3860
+ /**
3861
+ * Create a new HealthcheckService instance with authenticated config
3862
+ * @returns HealthcheckService instance (cached)
3863
+ */
3864
+ private createNewHealthcheckService;
1242
3865
  private fetchSession;
1243
3866
  private validateWorkspace;
1244
3867
  private createNewAppBuilderSession;
@@ -1248,5 +3871,5 @@ export default class Ductape implements IDuctape {
1248
3871
  /**
1249
3872
  * Fetches the latest healthcheck status for a product/env from Redis cache via processor service.
1250
3873
  */
1251
- getHealthcheckStatus(productTag: string, envSlug: string): Promise<any>;
3874
+ getHealthcheckStatus(product: string, envSlug: string): Promise<any>;
1252
3875
  }