@ductape/sdk 0.0.4 → 0.0.5

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