@ductape/sdk 0.0.4-v99 → 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 (295) hide show
  1. package/dist/agents/agent-context.d.ts +3 -1
  2. package/dist/agents/agent-context.js +19 -3
  3. package/dist/agents/agent-context.js.map +1 -1
  4. package/dist/agents/agents.service.js +9 -5
  5. package/dist/agents/agents.service.js.map +1 -1
  6. package/dist/agents/types/agents.types.d.ts +14 -1
  7. package/dist/agents/types/agents.types.js.map +1 -1
  8. package/dist/api/services/appApi.service.js +15 -6
  9. package/dist/api/services/appApi.service.js.map +1 -1
  10. package/dist/api/services/logsApi.service.d.ts +51 -0
  11. package/dist/api/services/logsApi.service.js +19 -2
  12. package/dist/api/services/logsApi.service.js.map +1 -1
  13. package/dist/api/services/processorApi.service.d.ts +568 -2
  14. package/dist/api/services/processorApi.service.js +412 -21
  15. package/dist/api/services/processorApi.service.js.map +1 -1
  16. package/dist/api/services/productsApi.service.d.ts +20 -0
  17. package/dist/api/services/productsApi.service.js +44 -15
  18. package/dist/api/services/productsApi.service.js.map +1 -1
  19. package/dist/api/services/secretsApi.service.js +0 -11
  20. package/dist/api/services/secretsApi.service.js.map +1 -1
  21. package/dist/api/services/webhooksApi.service.js +13 -6
  22. package/dist/api/services/webhooksApi.service.js.map +1 -1
  23. package/dist/api/services/workflowApi.service.js +30 -12
  24. package/dist/api/services/workflowApi.service.js.map +1 -1
  25. package/dist/api/urls.d.ts +26 -0
  26. package/dist/api/urls.js +30 -3
  27. package/dist/api/urls.js.map +1 -1
  28. package/dist/apps/validators/joi-validators/update.appAction.validator.js +12 -1
  29. package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
  30. package/dist/brokers/brokers.service.d.ts +140 -2
  31. package/dist/brokers/brokers.service.js +444 -36
  32. package/dist/brokers/brokers.service.js.map +1 -1
  33. package/dist/brokers/types/index.d.ts +251 -0
  34. package/dist/brokers/utils/providers/rabbitmq.service.d.ts +14 -4
  35. package/dist/brokers/utils/providers/rabbitmq.service.js +22 -35
  36. package/dist/brokers/utils/providers/rabbitmq.service.js.map +1 -1
  37. package/dist/cache/cache.manager.d.ts +84 -5
  38. package/dist/cache/cache.manager.js +478 -38
  39. package/dist/cache/cache.manager.js.map +1 -1
  40. package/dist/cache/cache.service.d.ts +5 -0
  41. package/dist/cache/cache.service.js +163 -6
  42. package/dist/cache/cache.service.js.map +1 -1
  43. package/dist/cache/index.d.ts +1 -1
  44. package/dist/cache/index.js +3 -1
  45. package/dist/cache/index.js.map +1 -1
  46. package/dist/cache/types/index.d.ts +4 -0
  47. package/dist/database/databases.service.d.ts +70 -2
  48. package/dist/database/databases.service.js +150 -35
  49. package/dist/database/databases.service.js.map +1 -1
  50. package/dist/database/types/dashboard.interface.d.ts +74 -0
  51. package/dist/database/types/dashboard.interface.js +7 -0
  52. package/dist/database/types/dashboard.interface.js.map +1 -0
  53. package/dist/database/types/index.d.ts +1 -0
  54. package/dist/graph/graphs.service.d.ts +50 -12
  55. package/dist/graph/graphs.service.js +689 -203
  56. package/dist/graph/graphs.service.js.map +1 -1
  57. package/dist/graph/types/connection.interface.d.ts +2 -2
  58. package/dist/index.d.ts +286 -4
  59. package/dist/index.js +370 -21
  60. package/dist/index.js.map +1 -1
  61. package/dist/logs/logs.types.d.ts +16 -3
  62. package/dist/logs/logs.types.js +11 -0
  63. package/dist/logs/logs.types.js.map +1 -1
  64. package/dist/notifications/notifications.service.d.ts +3 -0
  65. package/dist/notifications/notifications.service.js +57 -14
  66. package/dist/notifications/notifications.service.js.map +1 -1
  67. package/dist/notifications/types/notifications.types.d.ts +50 -0
  68. package/dist/processor/services/processor.service.d.ts +132 -8
  69. package/dist/processor/services/processor.service.js +1174 -267
  70. package/dist/processor/services/processor.service.js.map +1 -1
  71. package/dist/processor/utils/processor.utils.d.ts +5 -0
  72. package/dist/processor/utils/processor.utils.js +65 -12
  73. package/dist/processor/utils/processor.utils.js.map +1 -1
  74. package/dist/processor/utils/storage.util.js +11 -2
  75. package/dist/processor/utils/storage.util.js.map +1 -1
  76. package/dist/products/services/products.service.d.ts +19 -2
  77. package/dist/products/services/products.service.js +388 -54
  78. package/dist/products/services/products.service.js.map +1 -1
  79. package/dist/products/validators/joi-validators/create.productFeature.validator.js +1 -1
  80. package/dist/products/validators/joi-validators/create.productJob.validator.js +2 -2
  81. package/dist/products/validators/joi-validators/create.productJob.validator.js.map +1 -1
  82. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +1 -0
  83. package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +1 -1
  84. package/dist/products/validators/joi-validators/create.productNotification.validator.js +23 -12
  85. package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +1 -1
  86. package/dist/resilience/fallback.service.d.ts +1 -0
  87. package/dist/resilience/fallback.service.js +2 -0
  88. package/dist/resilience/fallback.service.js.map +1 -1
  89. package/dist/resilience/quota.service.d.ts +1 -0
  90. package/dist/resilience/quota.service.js +2 -0
  91. package/dist/resilience/quota.service.js.map +1 -1
  92. package/dist/secrets/secrets.resolver.js +4 -1
  93. package/dist/secrets/secrets.resolver.js.map +1 -1
  94. package/dist/secrets/secrets.service.js +0 -12
  95. package/dist/secrets/secrets.service.js.map +1 -1
  96. package/dist/secrets/secrets.types.d.ts +3 -3
  97. package/dist/secrets/secrets.types.js +5 -5
  98. package/dist/secrets/secrets.types.js.map +1 -1
  99. package/dist/sessions/index.d.ts +1 -1
  100. package/dist/sessions/index.js +4 -1
  101. package/dist/sessions/index.js.map +1 -1
  102. package/dist/sessions/sessions.helper.d.ts +23 -3
  103. package/dist/sessions/sessions.helper.js +20 -3
  104. package/dist/sessions/sessions.helper.js.map +1 -1
  105. package/dist/sessions/sessions.resolver.d.ts +31 -0
  106. package/dist/sessions/sessions.resolver.js +230 -1
  107. package/dist/sessions/sessions.resolver.js.map +1 -1
  108. package/dist/sessions/sessions.service.d.ts +18 -2
  109. package/dist/sessions/sessions.service.js +121 -57
  110. package/dist/sessions/sessions.service.js.map +1 -1
  111. package/dist/sessions/types/index.d.ts +65 -21
  112. package/dist/storage/storage.service.d.ts +3 -0
  113. package/dist/storage/storage.service.js +179 -39
  114. package/dist/storage/storage.service.js.map +1 -1
  115. package/dist/types/index.types.d.ts +2 -0
  116. package/dist/types/inputs.types.d.ts +1 -0
  117. package/dist/types/inputs.types.js +3 -2
  118. package/dist/types/inputs.types.js.map +1 -1
  119. package/dist/types/processor.types.d.ts +72 -6
  120. package/dist/types/processor.types.js.map +1 -1
  121. package/dist/types/productsBuilder.types.d.ts +10 -0
  122. package/dist/types/productsBuilder.types.js +4 -0
  123. package/dist/types/productsBuilder.types.js.map +1 -1
  124. package/dist/vector/adapters/weaviate.adapter.js +22 -6
  125. package/dist/vector/adapters/weaviate.adapter.js.map +1 -1
  126. package/dist/vector/vector-database.service.d.ts +4 -2
  127. package/dist/vector/vector-database.service.js +71 -29
  128. package/dist/vector/vector-database.service.js.map +1 -1
  129. package/dist/workflows/types/workflows.types.d.ts +61 -3
  130. package/dist/workflows/types/workflows.types.js.map +1 -1
  131. package/dist/workflows/workflow-builder.js +17 -2
  132. package/dist/workflows/workflow-builder.js.map +1 -1
  133. package/dist/workflows/workflow-executor.d.ts +97 -18
  134. package/dist/workflows/workflow-executor.js +1449 -244
  135. package/dist/workflows/workflow-executor.js.map +1 -1
  136. package/dist/workflows/workflows.service.d.ts +2 -0
  137. package/dist/workflows/workflows.service.js +538 -74
  138. package/dist/workflows/workflows.service.js.map +1 -1
  139. package/package.json +11 -1
  140. package/dist/processor/services/fallback.service.d.ts +0 -5
  141. package/dist/processor/services/fallback.service.js +0 -43
  142. package/dist/processor/services/fallback.service.js.map +0 -1
  143. package/dist/processor/services/messagebrokers/aws-sqs.service.d.ts +0 -15
  144. package/dist/processor/services/messagebrokers/aws-sqs.service.js +0 -77
  145. package/dist/processor/services/messagebrokers/aws-sqs.service.js.map +0 -1
  146. package/dist/processor/services/messagebrokers/google-pubsub.service.d.ts +0 -16
  147. package/dist/processor/services/messagebrokers/google-pubsub.service.js +0 -34
  148. package/dist/processor/services/messagebrokers/google-pubsub.service.js.map +0 -1
  149. package/dist/processor/services/messagebrokers/index.d.ts +0 -3
  150. package/dist/processor/services/messagebrokers/index.js +0 -26
  151. package/dist/processor/services/messagebrokers/index.js.map +0 -1
  152. package/dist/processor/services/messagebrokers/kafka.service.d.ts +0 -14
  153. package/dist/processor/services/messagebrokers/kafka.service.js +0 -45
  154. package/dist/processor/services/messagebrokers/kafka.service.js.map +0 -1
  155. package/dist/processor/services/messagebrokers/messagebrokers.type.d.ts +0 -6
  156. package/dist/processor/services/messagebrokers/messagebrokers.type.js +0 -3
  157. package/dist/processor/services/messagebrokers/messagebrokers.type.js.map +0 -1
  158. package/dist/processor/services/messagebrokers/rabbitmq.service.d.ts +0 -14
  159. package/dist/processor/services/messagebrokers/rabbitmq.service.js +0 -67
  160. package/dist/processor/services/messagebrokers/rabbitmq.service.js.map +0 -1
  161. package/dist/processor/services/messagebrokers/redis.service.d.ts +0 -18
  162. package/dist/processor/services/messagebrokers/redis.service.js +0 -82
  163. package/dist/processor/services/messagebrokers/redis.service.js.map +0 -1
  164. package/dist/processor/services/quota.service.d.ts +0 -15
  165. package/dist/processor/services/quota.service.js +0 -63
  166. package/dist/processor/services/quota.service.js.map +0 -1
  167. package/dist/test/index.d.ts +0 -3
  168. package/dist/test/index.js +0 -11
  169. package/dist/test/index.js.map +0 -1
  170. package/dist/test/test.appBuilder.d.ts +0 -0
  171. package/dist/test/test.appBuilder.js +0 -1
  172. package/dist/test/test.appBuilder.js.map +0 -1
  173. package/dist/test/test.broker.kafka.d.ts +0 -1
  174. package/dist/test/test.broker.kafka.js +0 -172
  175. package/dist/test/test.broker.kafka.js.map +0 -1
  176. package/dist/test/test.broker.nats.d.ts +0 -1
  177. package/dist/test/test.broker.nats.js +0 -193
  178. package/dist/test/test.broker.nats.js.map +0 -1
  179. package/dist/test/test.broker.pubsub.d.ts +0 -1
  180. package/dist/test/test.broker.pubsub.js +0 -171
  181. package/dist/test/test.broker.pubsub.js.map +0 -1
  182. package/dist/test/test.broker.rabbitmq.d.ts +0 -1
  183. package/dist/test/test.broker.rabbitmq.js +0 -164
  184. package/dist/test/test.broker.rabbitmq.js.map +0 -1
  185. package/dist/test/test.broker.redis.d.ts +0 -1
  186. package/dist/test/test.broker.redis.js +0 -168
  187. package/dist/test/test.broker.redis.js.map +0 -1
  188. package/dist/test/test.broker.sqs.d.ts +0 -1
  189. package/dist/test/test.broker.sqs.js +0 -158
  190. package/dist/test/test.broker.sqs.js.map +0 -1
  191. package/dist/test/test.caches.d.ts +0 -1
  192. package/dist/test/test.caches.js +0 -231
  193. package/dist/test/test.caches.js.map +0 -1
  194. package/dist/test/test.database.d.ts +0 -1
  195. package/dist/test/test.database.dynamo.d.ts +0 -1
  196. package/dist/test/test.database.dynamo.js +0 -265
  197. package/dist/test/test.database.dynamo.js.map +0 -1
  198. package/dist/test/test.database.js +0 -140
  199. package/dist/test/test.database.js.map +0 -1
  200. package/dist/test/test.database.mongo.d.ts +0 -1
  201. package/dist/test/test.database.mongo.js +0 -371
  202. package/dist/test/test.database.mongo.js.map +0 -1
  203. package/dist/test/test.database.mysql.d.ts +0 -1
  204. package/dist/test/test.database.mysql.js +0 -415
  205. package/dist/test/test.database.mysql.js.map +0 -1
  206. package/dist/test/test.database.postgres.d.ts +0 -1
  207. package/dist/test/test.database.postgres.js +0 -412
  208. package/dist/test/test.database.postgres.js.map +0 -1
  209. package/dist/test/test.email.brevo.d.ts +0 -1
  210. package/dist/test/test.email.brevo.js +0 -326
  211. package/dist/test/test.email.brevo.js.map +0 -1
  212. package/dist/test/test.email.mailgun.d.ts +0 -1
  213. package/dist/test/test.email.mailgun.js +0 -352
  214. package/dist/test/test.email.mailgun.js.map +0 -1
  215. package/dist/test/test.email.postmark.d.ts +0 -1
  216. package/dist/test/test.email.postmark.js +0 -316
  217. package/dist/test/test.email.postmark.js.map +0 -1
  218. package/dist/test/test.email.sendgrid.d.ts +0 -1
  219. package/dist/test/test.email.sendgrid.js +0 -365
  220. package/dist/test/test.email.sendgrid.js.map +0 -1
  221. package/dist/test/test.email.smtp.d.ts +0 -1
  222. package/dist/test/test.email.smtp.js +0 -323
  223. package/dist/test/test.email.smtp.js.map +0 -1
  224. package/dist/test/test.graph.arangodb.d.ts +0 -1
  225. package/dist/test/test.graph.arangodb.js +0 -358
  226. package/dist/test/test.graph.arangodb.js.map +0 -1
  227. package/dist/test/test.graph.memgraph.d.ts +0 -1
  228. package/dist/test/test.graph.memgraph.js +0 -320
  229. package/dist/test/test.graph.memgraph.js.map +0 -1
  230. package/dist/test/test.graph.neo4j.d.ts +0 -1
  231. package/dist/test/test.graph.neo4j.js +0 -218
  232. package/dist/test/test.graph.neo4j.js.map +0 -1
  233. package/dist/test/test.graph.neptune.d.ts +0 -1
  234. package/dist/test/test.graph.neptune.js +0 -331
  235. package/dist/test/test.graph.neptune.js.map +0 -1
  236. package/dist/test/test.health.d.ts +0 -0
  237. package/dist/test/test.health.js +0 -1
  238. package/dist/test/test.health.js.map +0 -1
  239. package/dist/test/test.import.d.ts +0 -0
  240. package/dist/test/test.import.js +0 -1
  241. package/dist/test/test.import.js.map +0 -1
  242. package/dist/test/test.import.openapi.d.ts +0 -0
  243. package/dist/test/test.import.openapi.js +0 -1
  244. package/dist/test/test.import.openapi.js.map +0 -1
  245. package/dist/test/test.imports.d.ts +0 -1
  246. package/dist/test/test.imports.js +0 -21
  247. package/dist/test/test.imports.js.map +0 -1
  248. package/dist/test/test.logs.d.ts +0 -0
  249. package/dist/test/test.logs.js +0 -1
  250. package/dist/test/test.logs.js.map +0 -1
  251. package/dist/test/test.notifications.d.ts +0 -1
  252. package/dist/test/test.notifications.js +0 -198
  253. package/dist/test/test.notifications.js.map +0 -1
  254. package/dist/test/test.notifiers.d.ts +0 -0
  255. package/dist/test/test.notifiers.js +0 -1
  256. package/dist/test/test.notifiers.js.map +0 -1
  257. package/dist/test/test.processor.d.ts +0 -0
  258. package/dist/test/test.processor.js +0 -1
  259. package/dist/test/test.processor.js.map +0 -1
  260. package/dist/test/test.productBuilder.d.ts +0 -0
  261. package/dist/test/test.productBuilder.js +0 -1
  262. package/dist/test/test.productBuilder.js.map +0 -1
  263. package/dist/test/test.products.d.ts +0 -0
  264. package/dist/test/test.products.js +0 -1
  265. package/dist/test/test.products.js.map +0 -1
  266. package/dist/test/test.push.expo.d.ts +0 -1
  267. package/dist/test/test.push.expo.js +0 -442
  268. package/dist/test/test.push.expo.js.map +0 -1
  269. package/dist/test/test.push.firebase.d.ts +0 -1
  270. package/dist/test/test.push.firebase.js +0 -409
  271. package/dist/test/test.push.firebase.js.map +0 -1
  272. package/dist/test/test.session.d.ts +0 -1
  273. package/dist/test/test.session.js +0 -299
  274. package/dist/test/test.session.js.map +0 -1
  275. package/dist/test/test.sms.nexmo.d.ts +0 -1
  276. package/dist/test/test.sms.nexmo.js +0 -278
  277. package/dist/test/test.sms.nexmo.js.map +0 -1
  278. package/dist/test/test.sms.twilio.d.ts +0 -1
  279. package/dist/test/test.sms.twilio.js +0 -275
  280. package/dist/test/test.sms.twilio.js.map +0 -1
  281. package/dist/test/test.storage.d.ts +0 -1
  282. package/dist/test/test.storage.js +0 -202
  283. package/dist/test/test.storage.js.map +0 -1
  284. package/dist/test/test.triggers.d.ts +0 -1
  285. package/dist/test/test.triggers.js +0 -314
  286. package/dist/test/test.triggers.js.map +0 -1
  287. package/dist/test/test.vector.pinecone.d.ts +0 -1
  288. package/dist/test/test.vector.pinecone.js +0 -238
  289. package/dist/test/test.vector.pinecone.js.map +0 -1
  290. package/dist/test/test.vector.qdrant.d.ts +0 -1
  291. package/dist/test/test.vector.qdrant.js +0 -307
  292. package/dist/test/test.vector.qdrant.js.map +0 -1
  293. package/dist/test/test.vector.weaviate.d.ts +0 -1
  294. package/dist/test/test.vector.weaviate.js +0 -325
  295. package/dist/test/test.vector.weaviate.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -238,7 +238,7 @@ export { uploadBlobToCloud, downloadBlobFromCloud, deleteBlobFromCloud, listBlob
238
238
  export type { IStorageServiceConfig, IUploadOptions, IDownloadOptions, IDeleteOptions, IListFilesOptions, ISignedUrlOptions, IStorageResult, IDownloadResult, IDeleteResult as IStorageDeleteResult, IListFilesResult, ISignedUrlResult, IStorageDispatchOptions, IStorageDispatchResult, IStorageProviderConfig, IStorageFileInfo, } from './storage';
239
239
  export { SessionsService, SessionError } from './sessions';
240
240
  export type { ISessionServiceConfig, ICreateSessionOptions, IRefreshSessionOptions, IVerifySessionOptions, IRevokeSessionOptions, IListSessionsOptions, IDefineSessionOptions, ISessionResult, IVerifyResult, IListSessionsResult, ISessionInfo, ISessionSchema, ISessionSchemaField, ISessionContext, IDefinedSession, } from './sessions';
241
- export { CacheService, CacheError } from './cache';
241
+ export { CacheService, CacheError, cacheLogger, CacheLogger } from './cache';
242
242
  export type { ICacheServiceConfig, ICacheValue, IFetchCacheValuesOptions, IFetchCacheValuesResult, IFetchCacheDashboardOptions, ICacheDashboardMetrics, IClearCacheValueOptions, IClearCacheValuesOptions, IClearCacheValuesResult, ISetCacheValueOptions, IGetCacheValueOptions, IDeleteCacheValueOptions, IDeleteCacheValuesOptions, IDeleteCacheValuesResult, } from './cache';
243
243
  export { BrokersService, BrokerError } from './brokers';
244
244
  export { RabbitMQService, KafkaService, SQSService, RedisService, GooglePubSubService, loadBrokerService, parseEventString, isValidSqsUrl, getSqsQueueUrl, } from './brokers';
@@ -285,6 +285,7 @@ export default class Ductape implements IDuctape {
285
285
  private _quotaService;
286
286
  private _fallbackService;
287
287
  private _healthcheckService;
288
+ private _brokersService;
288
289
  private loggerService;
289
290
  private importService;
290
291
  private environment;
@@ -297,6 +298,11 @@ export default class Ductape implements IDuctape {
297
298
  healthCheckWorker: any;
298
299
  healthCheckUpdaterWorker: any;
299
300
  private loadRedis;
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;
300
306
  constructor({ accessKey, env_type, redis_url }: IDuctapeInit);
301
307
  private loadBullMQ;
302
308
  /**
@@ -494,7 +500,7 @@ export default class Ductape implements IDuctape {
494
500
  * @param {IFetchUsersPayload} data - The user fetch payload.
495
501
  * @returns {Promise<any[]>} The users for the session.
496
502
  */
497
- users: (product: string, data: IFetchUsersPayload) => Promise<import("./types").IFileURLPayload[]>;
503
+ users: (data: IFetchUsersPayload) => Promise<import("./types").IFileURLPayload[]>;
498
504
  /**
499
505
  * Deletes a product session by tag.
500
506
  * @param {string} product - The product tag.
@@ -560,6 +566,39 @@ export default class Ductape implements IDuctape {
560
566
  page?: number;
561
567
  limit?: number;
562
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>;
563
602
  };
564
603
  /**
565
604
  * Quota-related operations for managing product quotas with weighted distribution.
@@ -942,6 +981,7 @@ export default class Ductape implements IDuctape {
942
981
  listFiles: (data: {
943
982
  product: string;
944
983
  env: string;
984
+ cache?: string;
945
985
  storage: string;
946
986
  prefix?: string;
947
987
  limit?: number;
@@ -1002,7 +1042,10 @@ export default class Ductape implements IDuctape {
1002
1042
  * });
1003
1043
  * @deprecated Use upload() instead for direct cloud storage operations
1004
1044
  */
1005
- save: (data: IStorageProcessorInput) => Promise<any>;
1045
+ save: (data: IStorageProcessorInput) => Promise<{
1046
+ process_id: string;
1047
+ output: any;
1048
+ }>;
1006
1049
  /**
1007
1050
  * Uploads a file to cloud storage.
1008
1051
  * @param {Object} data - The upload options.
@@ -1215,12 +1258,23 @@ export default class Ductape implements IDuctape {
1215
1258
  * event: 'broker-tag:topic-tag',
1216
1259
  * message: { orderId: '123', status: 'pending' }
1217
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
+ * });
1218
1270
  */
1219
1271
  produce: (data: {
1220
1272
  product: string;
1221
1273
  env: string;
1222
1274
  event: string;
1223
1275
  message: Record<string, unknown>;
1276
+ session?: string;
1277
+ cache?: string;
1224
1278
  }) => Promise<import("./brokers").IPublishResult>;
1225
1279
  /**
1226
1280
  * consume to a message broker topic.
@@ -1266,6 +1320,107 @@ export default class Ductape implements IDuctape {
1266
1320
  * });
1267
1321
  */
1268
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;
1350
+ }>;
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;
1367
+ }>;
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;
1384
+ }>;
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;
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>;
1423
+ };
1269
1424
  };
1270
1425
  /**
1271
1426
  * Notification-related operations for managing product notifications.
@@ -1337,6 +1492,86 @@ export default class Ductape implements IDuctape {
1337
1492
  */
1338
1493
  update: (product: string, tag: string, data: Partial<IProductNotificationTemplate>) => Promise<void>;
1339
1494
  };
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<{
1509
+ process_id: string;
1510
+ output: {
1511
+ sent: boolean;
1512
+ };
1513
+ }>;
1514
+ };
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
+ }>;
1534
+ };
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<{
1549
+ process_id: string;
1550
+ output: {
1551
+ sent: boolean;
1552
+ };
1553
+ }>;
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<{
1569
+ process_id: string;
1570
+ output: {
1571
+ sent: boolean;
1572
+ };
1573
+ }>;
1574
+ };
1340
1575
  /**
1341
1576
  * Sends a notification immediately using the notification processor.
1342
1577
  * @param {INotificationProcessorInput} data - The notification processor input.
@@ -1351,6 +1586,9 @@ export default class Ductape implements IDuctape {
1351
1586
  */
1352
1587
  send: (data: INotificationProcessorInput) => Promise<{
1353
1588
  process_id: string;
1589
+ output: {
1590
+ sent: boolean;
1591
+ };
1354
1592
  }>;
1355
1593
  /**
1356
1594
  * Dispatches a notification to be sent as a scheduled job.
@@ -1378,6 +1616,48 @@ export default class Ductape implements IDuctape {
1378
1616
  * });
1379
1617
  */
1380
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,
1640
+ * });
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
+ }>;
1381
1661
  };
1382
1662
  /**
1383
1663
  * Database operations service.
@@ -2244,6 +2524,7 @@ export default class Ductape implements IDuctape {
2244
2524
  values: number[];
2245
2525
  metadata?: Record<string, unknown>;
2246
2526
  namespace?: string;
2527
+ session?: string;
2247
2528
  }) => Promise<import("./vector").IUpsertVectorsResult>;
2248
2529
  /**
2249
2530
  * Fetch a single vector by ID.
@@ -3115,6 +3396,7 @@ export default class Ductape implements IDuctape {
3115
3396
  env?: string;
3116
3397
  page?: number;
3117
3398
  limit?: number;
3399
+ expiryFilter?: "all" | "expiring" | "permanent" | "expired";
3118
3400
  }) => Promise<import("./cache").IFetchCacheValuesResult>;
3119
3401
  /**
3120
3402
  * Fetch cache dashboard metrics.
@@ -3689,7 +3971,7 @@ export default class Ductape implements IDuctape {
3689
3971
  */
3690
3972
  private createNewStorageService;
3691
3973
  /**
3692
- * Create a new BrokersService instance with authenticated config
3974
+ * Get or create a BrokersService instance with authenticated config (cached)
3693
3975
  * @returns BrokersService instance
3694
3976
  */
3695
3977
  private createNewBrokersService;