@agentuity/server 0.1.16 → 0.1.18

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 (93) hide show
  1. package/dist/api/api.d.ts +11 -6
  2. package/dist/api/api.d.ts.map +1 -1
  3. package/dist/api/api.js +19 -12
  4. package/dist/api/api.js.map +1 -1
  5. package/dist/api/index.d.ts +1 -0
  6. package/dist/api/index.d.ts.map +1 -1
  7. package/dist/api/index.js +1 -0
  8. package/dist/api/index.js.map +1 -1
  9. package/dist/api/org/env-delete.d.ts.map +1 -1
  10. package/dist/api/org/env-delete.js.map +1 -1
  11. package/dist/api/org/env-get.d.ts.map +1 -1
  12. package/dist/api/org/env-get.js.map +1 -1
  13. package/dist/api/org/env-update.d.ts.map +1 -1
  14. package/dist/api/org/env-update.js.map +1 -1
  15. package/dist/api/queue/analytics.d.ts +108 -0
  16. package/dist/api/queue/analytics.d.ts.map +1 -0
  17. package/dist/api/queue/analytics.js +245 -0
  18. package/dist/api/queue/analytics.js.map +1 -0
  19. package/dist/api/queue/destinations.d.ts +108 -0
  20. package/dist/api/queue/destinations.d.ts.map +1 -0
  21. package/dist/api/queue/destinations.js +238 -0
  22. package/dist/api/queue/destinations.js.map +1 -0
  23. package/dist/api/queue/dlq.d.ts +100 -0
  24. package/dist/api/queue/dlq.d.ts.map +1 -0
  25. package/dist/api/queue/dlq.js +204 -0
  26. package/dist/api/queue/dlq.js.map +1 -0
  27. package/dist/api/queue/index.d.ts +55 -0
  28. package/dist/api/queue/index.d.ts.map +1 -0
  29. package/dist/api/queue/index.js +86 -0
  30. package/dist/api/queue/index.js.map +1 -0
  31. package/dist/api/queue/messages.d.ts +332 -0
  32. package/dist/api/queue/messages.d.ts.map +1 -0
  33. package/dist/api/queue/messages.js +637 -0
  34. package/dist/api/queue/messages.js.map +1 -0
  35. package/dist/api/queue/queues.d.ts +153 -0
  36. package/dist/api/queue/queues.d.ts.map +1 -0
  37. package/dist/api/queue/queues.js +319 -0
  38. package/dist/api/queue/queues.js.map +1 -0
  39. package/dist/api/queue/sources.d.ts +132 -0
  40. package/dist/api/queue/sources.d.ts.map +1 -0
  41. package/dist/api/queue/sources.js +285 -0
  42. package/dist/api/queue/sources.js.map +1 -0
  43. package/dist/api/queue/types.d.ts +1129 -0
  44. package/dist/api/queue/types.d.ts.map +1 -0
  45. package/dist/api/queue/types.js +949 -0
  46. package/dist/api/queue/types.js.map +1 -0
  47. package/dist/api/queue/util.d.ts +262 -0
  48. package/dist/api/queue/util.d.ts.map +1 -0
  49. package/dist/api/queue/util.js +171 -0
  50. package/dist/api/queue/util.js.map +1 -0
  51. package/dist/api/queue/validation.d.ts +247 -0
  52. package/dist/api/queue/validation.d.ts.map +1 -0
  53. package/dist/api/queue/validation.js +513 -0
  54. package/dist/api/queue/validation.js.map +1 -0
  55. package/dist/api/sandbox/get.d.ts.map +1 -1
  56. package/dist/api/sandbox/get.js +5 -0
  57. package/dist/api/sandbox/get.js.map +1 -1
  58. package/dist/api/sandbox/index.d.ts +3 -3
  59. package/dist/api/sandbox/index.d.ts.map +1 -1
  60. package/dist/api/sandbox/index.js +1 -1
  61. package/dist/api/sandbox/index.js.map +1 -1
  62. package/dist/api/sandbox/run.d.ts.map +1 -1
  63. package/dist/api/sandbox/run.js +5 -2
  64. package/dist/api/sandbox/run.js.map +1 -1
  65. package/dist/api/sandbox/snapshot-build.d.ts +2 -0
  66. package/dist/api/sandbox/snapshot-build.d.ts.map +1 -1
  67. package/dist/api/sandbox/snapshot-build.js +4 -0
  68. package/dist/api/sandbox/snapshot-build.js.map +1 -1
  69. package/dist/api/sandbox/snapshot.d.ts +143 -1
  70. package/dist/api/sandbox/snapshot.d.ts.map +1 -1
  71. package/dist/api/sandbox/snapshot.js +183 -4
  72. package/dist/api/sandbox/snapshot.js.map +1 -1
  73. package/package.json +4 -4
  74. package/src/api/api.ts +62 -13
  75. package/src/api/index.ts +1 -0
  76. package/src/api/org/env-delete.ts +1 -4
  77. package/src/api/org/env-get.ts +1 -4
  78. package/src/api/org/env-update.ts +1 -4
  79. package/src/api/queue/analytics.ts +313 -0
  80. package/src/api/queue/destinations.ts +321 -0
  81. package/src/api/queue/dlq.ts +283 -0
  82. package/src/api/queue/index.ts +261 -0
  83. package/src/api/queue/messages.ts +875 -0
  84. package/src/api/queue/queues.ts +448 -0
  85. package/src/api/queue/sources.ts +384 -0
  86. package/src/api/queue/types.ts +1253 -0
  87. package/src/api/queue/util.ts +204 -0
  88. package/src/api/queue/validation.ts +560 -0
  89. package/src/api/sandbox/get.ts +5 -0
  90. package/src/api/sandbox/index.ts +13 -1
  91. package/src/api/sandbox/run.ts +5 -2
  92. package/src/api/sandbox/snapshot-build.ts +4 -0
  93. package/src/api/sandbox/snapshot.ts +223 -5
@@ -0,0 +1,153 @@
1
+ import { APIClient } from '../api';
2
+ import { type Queue, type CreateQueueRequest, type UpdateQueueRequest, type ListQueuesRequest, type QueueApiOptions } from './types';
3
+ /**
4
+ * Create a new message queue.
5
+ *
6
+ * Creates a queue with the specified type and settings. The queue name is optional
7
+ * and will be auto-generated if not provided.
8
+ *
9
+ * @param client - The API client instance
10
+ * @param params - Queue creation parameters
11
+ * @returns The created queue
12
+ * @throws {QueueValidationError} If validation fails
13
+ * @throws {QueueError} If the API request fails
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * // Create a worker queue with custom settings
18
+ * const queue = await createQueue(client, {
19
+ * name: 'order-processing',
20
+ * queue_type: 'worker',
21
+ * description: 'Processes customer orders',
22
+ * settings: {
23
+ * default_max_retries: 3,
24
+ * default_visibility_timeout_seconds: 60,
25
+ * },
26
+ * });
27
+ * console.log(`Created queue: ${queue.id}`);
28
+ * ```
29
+ */
30
+ export declare function createQueue(client: APIClient, params: CreateQueueRequest, options?: QueueApiOptions): Promise<Queue>;
31
+ /**
32
+ * Get a queue by name.
33
+ *
34
+ * Retrieves the queue details including settings and statistics.
35
+ *
36
+ * @param client - The API client instance
37
+ * @param name - The queue name
38
+ * @returns The queue details
39
+ * @throws {QueueValidationError} If the queue name is invalid
40
+ * @throws {QueueNotFoundError} If the queue does not exist
41
+ * @throws {QueueError} If the API request fails
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const queue = await getQueue(client, 'order-processing');
46
+ * console.log(`Queue has ${queue.stats?.message_count} messages`);
47
+ * ```
48
+ */
49
+ export declare function getQueue(client: APIClient, name: string, options?: QueueApiOptions): Promise<Queue>;
50
+ /**
51
+ * List all queues with optional pagination.
52
+ *
53
+ * @param client - The API client instance
54
+ * @param params - Optional pagination parameters
55
+ * @returns Object containing the list of queues and optional total count
56
+ * @throws {QueueValidationError} If pagination parameters are invalid
57
+ * @throws {QueueError} If the API request fails
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * // List first 10 queues
62
+ * const { queues, total } = await listQueues(client, { limit: 10 });
63
+ * console.log(`Found ${total} queues`);
64
+ *
65
+ * // Paginate through all queues
66
+ * const { queues: page2 } = await listQueues(client, { limit: 10, offset: 10 });
67
+ * ```
68
+ */
69
+ export declare function listQueues(client: APIClient, params?: ListQueuesRequest, options?: QueueApiOptions): Promise<{
70
+ queues: Queue[];
71
+ total?: number;
72
+ }>;
73
+ /**
74
+ * Update an existing queue.
75
+ *
76
+ * Updates the queue description and/or settings. Only provided fields are updated.
77
+ *
78
+ * @param client - The API client instance
79
+ * @param name - The queue name
80
+ * @param params - Update parameters
81
+ * @returns The updated queue
82
+ * @throws {QueueValidationError} If validation fails
83
+ * @throws {QueueNotFoundError} If the queue does not exist
84
+ * @throws {QueueError} If the API request fails
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * const queue = await updateQueue(client, 'order-processing', {
89
+ * description: 'Updated description',
90
+ * settings: { default_max_retries: 5 },
91
+ * });
92
+ * ```
93
+ */
94
+ export declare function updateQueue(client: APIClient, name: string, params: UpdateQueueRequest, options?: QueueApiOptions): Promise<Queue>;
95
+ /**
96
+ * Delete a queue.
97
+ *
98
+ * Permanently deletes a queue and all its messages. This action cannot be undone.
99
+ *
100
+ * @param client - The API client instance
101
+ * @param name - The queue name
102
+ * @throws {QueueValidationError} If the queue name is invalid
103
+ * @throws {QueueNotFoundError} If the queue does not exist
104
+ * @throws {QueueError} If the API request fails
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * await deleteQueue(client, 'order-processing');
109
+ * console.log('Queue deleted');
110
+ * ```
111
+ */
112
+ export declare function deleteQueue(client: APIClient, name: string, options?: QueueApiOptions): Promise<void>;
113
+ /**
114
+ * Pause a queue.
115
+ *
116
+ * Pauses message processing for the queue. Messages can still be published
117
+ * but will not be delivered to consumers until the queue is resumed.
118
+ *
119
+ * @param client - The API client instance
120
+ * @param name - The queue name
121
+ * @returns The updated queue with paused_at timestamp
122
+ * @throws {QueueValidationError} If the queue name is invalid
123
+ * @throws {QueueNotFoundError} If the queue does not exist
124
+ * @throws {QueueError} If the API request fails
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * const queue = await pauseQueue(client, 'order-processing');
129
+ * console.log(`Queue paused at: ${queue.paused_at}`);
130
+ * ```
131
+ */
132
+ export declare function pauseQueue(client: APIClient, name: string, options?: QueueApiOptions): Promise<Queue>;
133
+ /**
134
+ * Resume a paused queue.
135
+ *
136
+ * Resumes message processing for a paused queue. Consumers will start
137
+ * receiving messages again.
138
+ *
139
+ * @param client - The API client instance
140
+ * @param name - The queue name
141
+ * @returns The updated queue with paused_at cleared
142
+ * @throws {QueueValidationError} If the queue name is invalid
143
+ * @throws {QueueNotFoundError} If the queue does not exist
144
+ * @throws {QueueError} If the API request fails
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * const queue = await resumeQueue(client, 'order-processing');
149
+ * console.log(`Queue resumed, paused_at: ${queue.paused_at}`); // null
150
+ * ```
151
+ */
152
+ export declare function resumeQueue(client: APIClient, name: string, options?: QueueApiOptions): Promise<Queue>;
153
+ //# sourceMappingURL=queues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queues.d.ts","sourceRoot":"","sources":["../../../src/api/queue/queues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MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,eAAe,GACvB,OAAO,CAAC,KAAK,CAAC,CA2BhB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,WAAW,CAChC,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,eAAe,GACvB,OAAO,CAAC,KAAK,CAAC,CA2BhB"}
@@ -0,0 +1,319 @@
1
+ import { z } from 'zod';
2
+ import { APIResponseSchema, APIResponseSchemaNoData } from '../api';
3
+ import { QueueSchema, CreateQueueRequestSchema, UpdateQueueRequestSchema, } from './types';
4
+ import { QueueError, QueueNotFoundError, queueApiPath, queueApiPathWithQuery, buildQueueHeaders, } from './util';
5
+ import { validateQueueName, validateQueueType, validateDescription, validateTTL, validateVisibilityTimeout, validateMaxRetries, validateMaxInFlight, validateLimit, validateOffset, } from './validation';
6
+ const QueueResponseSchema = APIResponseSchema(z.object({ queue: QueueSchema }));
7
+ const QueuesListResponseSchema = APIResponseSchema(z.object({
8
+ queues: z.array(QueueSchema),
9
+ total: z.number().optional(),
10
+ }));
11
+ const DeleteQueueResponseSchema = APIResponseSchemaNoData();
12
+ /**
13
+ * Create a new message queue.
14
+ *
15
+ * Creates a queue with the specified type and settings. The queue name is optional
16
+ * and will be auto-generated if not provided.
17
+ *
18
+ * @param client - The API client instance
19
+ * @param params - Queue creation parameters
20
+ * @returns The created queue
21
+ * @throws {QueueValidationError} If validation fails
22
+ * @throws {QueueError} If the API request fails
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * // Create a worker queue with custom settings
27
+ * const queue = await createQueue(client, {
28
+ * name: 'order-processing',
29
+ * queue_type: 'worker',
30
+ * description: 'Processes customer orders',
31
+ * settings: {
32
+ * default_max_retries: 3,
33
+ * default_visibility_timeout_seconds: 60,
34
+ * },
35
+ * });
36
+ * console.log(`Created queue: ${queue.id}`);
37
+ * ```
38
+ */
39
+ export async function createQueue(client, params, options) {
40
+ // Validate before sending to API
41
+ validateQueueType(params.queue_type);
42
+ if (params.name) {
43
+ validateQueueName(params.name);
44
+ }
45
+ if (params.description) {
46
+ validateDescription(params.description);
47
+ }
48
+ // Validate settings if provided
49
+ if (params.settings) {
50
+ if (params.settings.default_ttl_seconds !== undefined) {
51
+ validateTTL(params.settings.default_ttl_seconds ?? undefined);
52
+ }
53
+ if (params.settings.default_visibility_timeout_seconds !== undefined) {
54
+ validateVisibilityTimeout(params.settings.default_visibility_timeout_seconds);
55
+ }
56
+ if (params.settings.default_max_retries !== undefined) {
57
+ validateMaxRetries(params.settings.default_max_retries);
58
+ }
59
+ if (params.settings.max_in_flight_per_client !== undefined) {
60
+ validateMaxInFlight(params.settings.max_in_flight_per_client);
61
+ }
62
+ }
63
+ const url = queueApiPath('create');
64
+ const resp = await client.post(url, params, QueueResponseSchema, CreateQueueRequestSchema, undefined, buildQueueHeaders(options?.orgId));
65
+ if (resp.success) {
66
+ return resp.data.queue;
67
+ }
68
+ throw new QueueError({
69
+ message: resp.message || 'Failed to create queue',
70
+ });
71
+ }
72
+ /**
73
+ * Get a queue by name.
74
+ *
75
+ * Retrieves the queue details including settings and statistics.
76
+ *
77
+ * @param client - The API client instance
78
+ * @param name - The queue name
79
+ * @returns The queue details
80
+ * @throws {QueueValidationError} If the queue name is invalid
81
+ * @throws {QueueNotFoundError} If the queue does not exist
82
+ * @throws {QueueError} If the API request fails
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const queue = await getQueue(client, 'order-processing');
87
+ * console.log(`Queue has ${queue.stats?.message_count} messages`);
88
+ * ```
89
+ */
90
+ export async function getQueue(client, name, options) {
91
+ validateQueueName(name);
92
+ const url = queueApiPath('get', name);
93
+ const resp = await client.get(url, QueueResponseSchema, undefined, buildQueueHeaders(options?.orgId));
94
+ if (resp.success) {
95
+ return resp.data.queue;
96
+ }
97
+ if (resp.message?.includes('not found')) {
98
+ throw new QueueNotFoundError({
99
+ queueName: name,
100
+ message: resp.message,
101
+ });
102
+ }
103
+ throw new QueueError({
104
+ queueName: name,
105
+ message: resp.message || 'Failed to get queue',
106
+ });
107
+ }
108
+ /**
109
+ * List all queues with optional pagination.
110
+ *
111
+ * @param client - The API client instance
112
+ * @param params - Optional pagination parameters
113
+ * @returns Object containing the list of queues and optional total count
114
+ * @throws {QueueValidationError} If pagination parameters are invalid
115
+ * @throws {QueueError} If the API request fails
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * // List first 10 queues
120
+ * const { queues, total } = await listQueues(client, { limit: 10 });
121
+ * console.log(`Found ${total} queues`);
122
+ *
123
+ * // Paginate through all queues
124
+ * const { queues: page2 } = await listQueues(client, { limit: 10, offset: 10 });
125
+ * ```
126
+ */
127
+ export async function listQueues(client, params, options) {
128
+ // Validate pagination params
129
+ if (params?.limit !== undefined) {
130
+ validateLimit(params.limit);
131
+ }
132
+ if (params?.offset !== undefined) {
133
+ validateOffset(params.offset);
134
+ }
135
+ const searchParams = new URLSearchParams();
136
+ if (params?.limit !== undefined) {
137
+ searchParams.set('limit', String(params.limit));
138
+ }
139
+ if (params?.offset !== undefined) {
140
+ searchParams.set('offset', String(params.offset));
141
+ }
142
+ const queryString = searchParams.toString();
143
+ const url = queueApiPathWithQuery('list', queryString || undefined);
144
+ const resp = await client.get(url, QueuesListResponseSchema, undefined, buildQueueHeaders(options?.orgId));
145
+ if (resp.success) {
146
+ return { queues: resp.data.queues, total: resp.data.total };
147
+ }
148
+ throw new QueueError({
149
+ message: resp.message || 'Failed to list queues',
150
+ });
151
+ }
152
+ /**
153
+ * Update an existing queue.
154
+ *
155
+ * Updates the queue description and/or settings. Only provided fields are updated.
156
+ *
157
+ * @param client - The API client instance
158
+ * @param name - The queue name
159
+ * @param params - Update parameters
160
+ * @returns The updated queue
161
+ * @throws {QueueValidationError} If validation fails
162
+ * @throws {QueueNotFoundError} If the queue does not exist
163
+ * @throws {QueueError} If the API request fails
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * const queue = await updateQueue(client, 'order-processing', {
168
+ * description: 'Updated description',
169
+ * settings: { default_max_retries: 5 },
170
+ * });
171
+ * ```
172
+ */
173
+ export async function updateQueue(client, name, params, options) {
174
+ // Validate before sending to API
175
+ validateQueueName(name);
176
+ if (params.description) {
177
+ validateDescription(params.description);
178
+ }
179
+ // Validate settings if provided
180
+ if (params.settings) {
181
+ if (params.settings.default_ttl_seconds !== undefined) {
182
+ validateTTL(params.settings.default_ttl_seconds ?? undefined);
183
+ }
184
+ if (params.settings.default_visibility_timeout_seconds !== undefined) {
185
+ validateVisibilityTimeout(params.settings.default_visibility_timeout_seconds);
186
+ }
187
+ if (params.settings.default_max_retries !== undefined) {
188
+ validateMaxRetries(params.settings.default_max_retries);
189
+ }
190
+ if (params.settings.max_in_flight_per_client !== undefined) {
191
+ validateMaxInFlight(params.settings.max_in_flight_per_client);
192
+ }
193
+ }
194
+ const url = queueApiPath('update', name);
195
+ const resp = await client.patch(url, params, QueueResponseSchema, UpdateQueueRequestSchema, undefined, buildQueueHeaders(options?.orgId));
196
+ if (resp.success) {
197
+ return resp.data.queue;
198
+ }
199
+ if (resp.message?.includes('not found')) {
200
+ throw new QueueNotFoundError({
201
+ queueName: name,
202
+ message: resp.message,
203
+ });
204
+ }
205
+ throw new QueueError({
206
+ queueName: name,
207
+ message: resp.message || 'Failed to update queue',
208
+ });
209
+ }
210
+ /**
211
+ * Delete a queue.
212
+ *
213
+ * Permanently deletes a queue and all its messages. This action cannot be undone.
214
+ *
215
+ * @param client - The API client instance
216
+ * @param name - The queue name
217
+ * @throws {QueueValidationError} If the queue name is invalid
218
+ * @throws {QueueNotFoundError} If the queue does not exist
219
+ * @throws {QueueError} If the API request fails
220
+ *
221
+ * @example
222
+ * ```typescript
223
+ * await deleteQueue(client, 'order-processing');
224
+ * console.log('Queue deleted');
225
+ * ```
226
+ */
227
+ export async function deleteQueue(client, name, options) {
228
+ validateQueueName(name);
229
+ const url = queueApiPath('delete', name);
230
+ const resp = await client.delete(url, DeleteQueueResponseSchema, undefined, buildQueueHeaders(options?.orgId));
231
+ if (resp.success) {
232
+ return;
233
+ }
234
+ if (resp.message?.includes('not found')) {
235
+ throw new QueueNotFoundError({
236
+ queueName: name,
237
+ message: resp.message,
238
+ });
239
+ }
240
+ throw new QueueError({
241
+ queueName: name,
242
+ message: resp.message || 'Failed to delete queue',
243
+ });
244
+ }
245
+ /**
246
+ * Pause a queue.
247
+ *
248
+ * Pauses message processing for the queue. Messages can still be published
249
+ * but will not be delivered to consumers until the queue is resumed.
250
+ *
251
+ * @param client - The API client instance
252
+ * @param name - The queue name
253
+ * @returns The updated queue with paused_at timestamp
254
+ * @throws {QueueValidationError} If the queue name is invalid
255
+ * @throws {QueueNotFoundError} If the queue does not exist
256
+ * @throws {QueueError} If the API request fails
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * const queue = await pauseQueue(client, 'order-processing');
261
+ * console.log(`Queue paused at: ${queue.paused_at}`);
262
+ * ```
263
+ */
264
+ export async function pauseQueue(client, name, options) {
265
+ validateQueueName(name);
266
+ const url = queueApiPath('pause', name);
267
+ const resp = await client.post(url, {}, QueueResponseSchema, z.object({}), undefined, buildQueueHeaders(options?.orgId));
268
+ if (resp.success) {
269
+ return resp.data.queue;
270
+ }
271
+ if (resp.message?.includes('not found')) {
272
+ throw new QueueNotFoundError({
273
+ queueName: name,
274
+ message: resp.message,
275
+ });
276
+ }
277
+ throw new QueueError({
278
+ queueName: name,
279
+ message: resp.message || 'Failed to pause queue',
280
+ });
281
+ }
282
+ /**
283
+ * Resume a paused queue.
284
+ *
285
+ * Resumes message processing for a paused queue. Consumers will start
286
+ * receiving messages again.
287
+ *
288
+ * @param client - The API client instance
289
+ * @param name - The queue name
290
+ * @returns The updated queue with paused_at cleared
291
+ * @throws {QueueValidationError} If the queue name is invalid
292
+ * @throws {QueueNotFoundError} If the queue does not exist
293
+ * @throws {QueueError} If the API request fails
294
+ *
295
+ * @example
296
+ * ```typescript
297
+ * const queue = await resumeQueue(client, 'order-processing');
298
+ * console.log(`Queue resumed, paused_at: ${queue.paused_at}`); // null
299
+ * ```
300
+ */
301
+ export async function resumeQueue(client, name, options) {
302
+ validateQueueName(name);
303
+ const url = queueApiPath('resume', name);
304
+ const resp = await client.post(url, {}, QueueResponseSchema, z.object({}), undefined, buildQueueHeaders(options?.orgId));
305
+ if (resp.success) {
306
+ return resp.data.queue;
307
+ }
308
+ if (resp.message?.includes('not found')) {
309
+ throw new QueueNotFoundError({
310
+ queueName: name,
311
+ message: resp.message,
312
+ });
313
+ }
314
+ throw new QueueError({
315
+ queueName: name,
316
+ message: resp.message || 'Failed to resume queue',
317
+ });
318
+ }
319
+ //# sourceMappingURL=queues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queues.js","sourceRoot":"","sources":["../../../src/api/queue/queues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAa,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAC/E,OAAO,EACN,WAAW,EAMX,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,cAAc,GACd,MAAM,cAAc,CAAC;AAEtB,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;AAChF,MAAM,wBAAwB,GAAG,iBAAiB,CACjD,CAAC,CAAC,MAAM,CAAC;IACR,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,E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,EAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,kBAAkB,CAAC;YAC5B,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,UAAU,CAAC;QACpB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,wBAAwB;KACjD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { APIClient } from '../api';
2
+ import { type Source, type CreateSourceRequest, type UpdateSourceRequest, type QueueApiOptions } from './types';
3
+ /**
4
+ * Create a source for a queue.
5
+ *
6
+ * Sources are public HTTP ingestion endpoints that allow external systems to
7
+ * publish messages to a queue. They support various authentication methods
8
+ * to secure access.
9
+ *
10
+ * @param client - The API client instance
11
+ * @param queueName - The name of the queue to add the source to
12
+ * @param params - Source configuration including name and optional auth settings
13
+ * @returns The created source with assigned ID and public URL
14
+ * @throws {QueueValidationError} If validation fails (invalid queue name or source name)
15
+ * @throws {QueueNotFoundError} If the queue does not exist
16
+ * @throws {SourceAlreadyExistsError} If a source with the same name already exists
17
+ * @throws {QueueError} If the API request fails
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const source = await createSource(client, 'order-events', {
22
+ * name: 'webhook-ingestion',
23
+ * description: 'Receives webhooks from external service',
24
+ * auth_type: 'header',
25
+ * auth_value: 'Bearer my-secret-token',
26
+ * });
27
+ * console.log(`Created source ${source.id} at ${source.url}`);
28
+ * ```
29
+ */
30
+ export declare function createSource(client: APIClient, queueName: string, params: CreateSourceRequest, options?: QueueApiOptions): Promise<Source>;
31
+ /**
32
+ * List all sources for a queue.
33
+ *
34
+ * Retrieves all HTTP ingestion endpoints configured for a queue. Each source
35
+ * provides a public URL for external systems to publish messages.
36
+ *
37
+ * @param client - The API client instance
38
+ * @param queueName - The name of the queue
39
+ * @returns Array of sources configured for the queue
40
+ * @throws {QueueValidationError} If validation fails (invalid queue name)
41
+ * @throws {QueueNotFoundError} If the queue does not exist
42
+ * @throws {QueueError} If the API request fails
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const sources = await listSources(client, 'order-events');
47
+ * for (const source of sources) {
48
+ * console.log(`Source ${source.id}: ${source.name} (${source.enabled ? 'enabled' : 'disabled'})`);
49
+ * console.log(` URL: ${source.url}`);
50
+ * console.log(` Success rate: ${source.success_count}/${source.request_count}`);
51
+ * }
52
+ * ```
53
+ */
54
+ export declare function listSources(client: APIClient, queueName: string, options?: QueueApiOptions): Promise<Source[]>;
55
+ /**
56
+ * Get a source by ID.
57
+ *
58
+ * Retrieves a specific source's details including its public URL and statistics.
59
+ *
60
+ * @param client - The API client instance
61
+ * @param queueName - The name of the queue
62
+ * @param sourceId - The source ID to retrieve (prefixed with qsrc_)
63
+ * @returns The source details
64
+ * @throws {QueueValidationError} If validation fails (invalid queue name or source ID)
65
+ * @throws {SourceNotFoundError} If the source does not exist
66
+ * @throws {QueueNotFoundError} If the queue does not exist
67
+ * @throws {QueueError} If the API request fails
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * const source = await getSource(client, 'order-events', 'qsrc_abc123');
72
+ * console.log(`Source: ${source.name}`);
73
+ * console.log(`URL: ${source.url}`);
74
+ * console.log(`Auth type: ${source.auth_type}`);
75
+ * console.log(`Last request: ${source.last_request_at}`);
76
+ * ```
77
+ */
78
+ export declare function getSource(client: APIClient, queueName: string, sourceId: string, options?: QueueApiOptions): Promise<Source>;
79
+ /**
80
+ * Update a source's configuration.
81
+ *
82
+ * Modifies an existing source's settings such as name, enabled status,
83
+ * or authentication configuration. Only the fields provided in params will be updated.
84
+ *
85
+ * @param client - The API client instance
86
+ * @param queueName - The name of the queue
87
+ * @param sourceId - The source ID to update (prefixed with qsrc_)
88
+ * @param params - Fields to update (partial update supported)
89
+ * @returns The updated source
90
+ * @throws {QueueValidationError} If validation fails (invalid queue name or source ID)
91
+ * @throws {SourceNotFoundError} If the source does not exist
92
+ * @throws {QueueNotFoundError} If the queue does not exist
93
+ * @throws {QueueError} If the API request fails
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * // Disable a source temporarily
98
+ * const updated = await updateSource(client, 'order-events', 'qsrc_abc123', {
99
+ * enabled: false,
100
+ * });
101
+ *
102
+ * // Update authentication
103
+ * const updated = await updateSource(client, 'order-events', 'qsrc_abc123', {
104
+ * auth_type: 'basic',
105
+ * auth_value: 'user:password',
106
+ * });
107
+ * ```
108
+ */
109
+ export declare function updateSource(client: APIClient, queueName: string, sourceId: string, params: UpdateSourceRequest, options?: QueueApiOptions): Promise<Source>;
110
+ /**
111
+ * Delete a source from a queue.
112
+ *
113
+ * Permanently removes an HTTP ingestion endpoint. The public URL will no longer
114
+ * accept requests. This action cannot be undone.
115
+ *
116
+ * @param client - The API client instance
117
+ * @param queueName - The name of the queue
118
+ * @param sourceId - The source ID to delete (prefixed with qsrc_)
119
+ * @returns void
120
+ * @throws {QueueValidationError} If validation fails (invalid queue name or source ID)
121
+ * @throws {SourceNotFoundError} If the source does not exist
122
+ * @throws {QueueNotFoundError} If the queue does not exist
123
+ * @throws {QueueError} If the API request fails
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * await deleteSource(client, 'order-events', 'qsrc_abc123');
128
+ * console.log('Source deleted');
129
+ * ```
130
+ */
131
+ export declare function deleteSource(client: APIClient, queueName: string, sourceId: string, options?: QueueApiOptions): Promise<void>;
132
+ //# sourceMappingURL=sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/api/queue/sources.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAwD,MAAM,QAAQ,CAAC;AACzF,OAAO,EAEN,KAAK,MAAM,EACX,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EAGpB,MAAM,SAAS,CAAC;AAmBjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,Y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