@distilled.cloud/cloudflare 0.12.3 → 0.12.4

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 (41) hide show
  1. package/lib/services/accounts.d.ts +52 -52
  2. package/lib/services/accounts.d.ts.map +1 -1
  3. package/lib/services/accounts.js +1533 -569
  4. package/lib/services/accounts.js.map +1 -1
  5. package/lib/services/d1.d.ts +7 -1
  6. package/lib/services/d1.d.ts.map +1 -1
  7. package/lib/services/d1.js +4 -1
  8. package/lib/services/d1.js.map +1 -1
  9. package/lib/services/pipelines.d.ts +35 -5
  10. package/lib/services/pipelines.d.ts.map +1 -1
  11. package/lib/services/pipelines.js +25 -6
  12. package/lib/services/pipelines.js.map +1 -1
  13. package/lib/services/queues.d.ts +14 -14
  14. package/lib/services/queues.d.ts.map +1 -1
  15. package/lib/services/queues.js +1192 -413
  16. package/lib/services/queues.js.map +1 -1
  17. package/lib/services/r2.d.ts +32 -32
  18. package/lib/services/r2.d.ts.map +1 -1
  19. package/lib/services/r2.js +873 -391
  20. package/lib/services/r2.js.map +1 -1
  21. package/lib/services/user.d.ts +36 -5
  22. package/lib/services/user.d.ts.map +1 -1
  23. package/lib/services/user.js +32 -5
  24. package/lib/services/user.js.map +1 -1
  25. package/lib/services/workers.d.ts +7 -1
  26. package/lib/services/workers.d.ts.map +1 -1
  27. package/lib/services/workers.js +4 -1
  28. package/lib/services/workers.js.map +1 -1
  29. package/lib/services/workflows.d.ts +8 -2
  30. package/lib/services/workflows.d.ts.map +1 -1
  31. package/lib/services/workflows.js +5 -2
  32. package/lib/services/workflows.js.map +1 -1
  33. package/package.json +2 -2
  34. package/src/services/accounts.ts +3546 -1036
  35. package/src/services/d1.ts +9 -2
  36. package/src/services/pipelines.ts +56 -11
  37. package/src/services/queues.ts +2978 -829
  38. package/src/services/r2.ts +2232 -848
  39. package/src/services/user.ts +66 -10
  40. package/src/services/workers.ts +11 -2
  41. package/src/services/workflows.ts +10 -2
@@ -10,9 +10,7 @@ import type * as HttpClient from "effect/unstable/http/HttpClient";
10
10
  import * as API from "../client/api.ts";
11
11
  import * as T from "../traits.ts";
12
12
  import type { Credentials } from "../credentials.ts";
13
- import {
14
- type DefaultErrors,
15
- } from "../errors.ts";
13
+ import { type DefaultErrors } from "../errors.ts";
16
14
 
17
15
  // =============================================================================
18
16
  // Errors
@@ -22,67 +20,72 @@ export class ConsumerAlreadyExists extends Schema.TaggedErrorClass<ConsumerAlrea
22
20
  "ConsumerAlreadyExists",
23
21
  { code: Schema.Number, message: Schema.String },
24
22
  ) {}
25
- T.applyErrorMatchers(ConsumerAlreadyExists, [{"code":11004}]);
23
+ T.applyErrorMatchers(ConsumerAlreadyExists, [{ code: 11004 }]);
26
24
 
27
25
  export class ConsumerNotFound extends Schema.TaggedErrorClass<ConsumerNotFound>()(
28
26
  "ConsumerNotFound",
29
27
  { code: Schema.Number, message: Schema.String },
30
28
  ) {}
31
- T.applyErrorMatchers(ConsumerNotFound, [{"code":10105},{"code":11006}]);
29
+ T.applyErrorMatchers(ConsumerNotFound, [{ code: 10105 }, { code: 11006 }]);
32
30
 
33
31
  export class InvalidMessageBody extends Schema.TaggedErrorClass<InvalidMessageBody>()(
34
32
  "InvalidMessageBody",
35
33
  { code: Schema.Number, message: Schema.String },
36
34
  ) {}
37
- T.applyErrorMatchers(InvalidMessageBody, [{"code":10207},{"code":10013}]);
35
+ T.applyErrorMatchers(InvalidMessageBody, [{ code: 10207 }, { code: 10013 }]);
38
36
 
39
37
  export class InvalidQueueId extends Schema.TaggedErrorClass<InvalidQueueId>()(
40
38
  "InvalidQueueId",
41
39
  { code: Schema.Number, message: Schema.String },
42
40
  ) {}
43
- T.applyErrorMatchers(InvalidQueueId, [{"code":10107}]);
41
+ T.applyErrorMatchers(InvalidQueueId, [{ code: 10107 }]);
44
42
 
45
43
  export class InvalidQueueName extends Schema.TaggedErrorClass<InvalidQueueName>()(
46
44
  "InvalidQueueName",
47
45
  { code: Schema.Number, message: Schema.String },
48
46
  ) {}
49
- T.applyErrorMatchers(InvalidQueueName, [{"code":11003}]);
47
+ T.applyErrorMatchers(InvalidQueueName, [{ code: 11003 }]);
50
48
 
51
49
  export class InvalidRequestBody extends Schema.TaggedErrorClass<InvalidRequestBody>()(
52
50
  "InvalidRequestBody",
53
51
  { code: Schema.Number, message: Schema.String },
54
52
  ) {}
55
- T.applyErrorMatchers(InvalidRequestBody, [{"code":10026}]);
53
+ T.applyErrorMatchers(InvalidRequestBody, [{ code: 10026 }]);
56
54
 
57
55
  export class InvalidRoute extends Schema.TaggedErrorClass<InvalidRoute>()(
58
56
  "InvalidRoute",
59
57
  { code: Schema.Number, message: Schema.String },
60
58
  ) {}
61
- T.applyErrorMatchers(InvalidRoute, [{"code":7003}]);
59
+ T.applyErrorMatchers(InvalidRoute, [{ code: 7003 }]);
62
60
 
63
61
  export class QueueAlreadyExists extends Schema.TaggedErrorClass<QueueAlreadyExists>()(
64
62
  "QueueAlreadyExists",
65
63
  { code: Schema.Number, message: Schema.String },
66
64
  ) {}
67
- T.applyErrorMatchers(QueueAlreadyExists, [{"code":11009}]);
65
+ T.applyErrorMatchers(QueueAlreadyExists, [{ code: 11009 }]);
68
66
 
69
67
  export class QueueNotFound extends Schema.TaggedErrorClass<QueueNotFound>()(
70
68
  "QueueNotFound",
71
69
  { code: Schema.Number, message: Schema.String },
72
70
  ) {}
73
- T.applyErrorMatchers(QueueNotFound, [{"code":11000},{"code":0,"message":{"includes":"Queue does not exist"}}]);
71
+ T.applyErrorMatchers(QueueNotFound, [
72
+ { code: 11000 },
73
+ { code: 0, message: { includes: "Queue does not exist" } },
74
+ ]);
74
75
 
75
76
  export class UnrecognizedEventType extends Schema.TaggedErrorClass<UnrecognizedEventType>()(
76
77
  "UnrecognizedEventType",
77
78
  { code: Schema.Number, message: Schema.String },
78
79
  ) {}
79
- T.applyErrorMatchers(UnrecognizedEventType, [{"code":0,"message":{"includes":"Unrecognized event types"}}]);
80
+ T.applyErrorMatchers(UnrecognizedEventType, [
81
+ { code: 0, message: { includes: "Unrecognized event types" } },
82
+ ]);
80
83
 
81
84
  export class WorkerNotFound extends Schema.TaggedErrorClass<WorkerNotFound>()(
82
85
  "WorkerNotFound",
83
86
  { code: Schema.Number, message: Schema.String },
84
87
  ) {}
85
- T.applyErrorMatchers(WorkerNotFound, [{"code":10007}]);
88
+ T.applyErrorMatchers(WorkerNotFound, [{ code: 10007 }]);
86
89
 
87
90
  // =============================================================================
88
91
  // Consumer
@@ -98,37 +101,136 @@ export interface GetConsumerRequest {
98
101
  export const GetConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
99
102
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
100
103
  consumerId: Schema.String.pipe(T.HttpPath("consumerId")),
101
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
102
- })
103
- .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}" })) as unknown as Schema.Schema<GetConsumerRequest>;
104
-
105
- export type GetConsumerResponse = { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null };
106
-
107
- export const GetConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.Struct({
108
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
109
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
110
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
111
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
112
- settings: Schema.optional(Schema.Union([Schema.Struct({
113
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
114
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
115
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
116
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
117
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
118
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
119
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
120
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
121
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
122
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
123
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
124
- settings: Schema.optional(Schema.Union([Schema.Struct({
125
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
126
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
127
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
128
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
129
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
130
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
131
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetConsumerResponse>;
104
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
105
+ }).pipe(
106
+ T.Http({
107
+ method: "GET",
108
+ path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
109
+ }),
110
+ ) as unknown as Schema.Schema<GetConsumerRequest>;
111
+
112
+ export type GetConsumerResponse =
113
+ | {
114
+ consumerId?: string | null;
115
+ createdOn?: string | null;
116
+ queueId?: string | null;
117
+ script?: string | null;
118
+ settings?: {
119
+ batchSize?: number | null;
120
+ maxConcurrency?: number | null;
121
+ maxRetries?: number | null;
122
+ maxWaitTimeMs?: number | null;
123
+ retryDelay?: number | null;
124
+ } | null;
125
+ type?: "worker" | null;
126
+ }
127
+ | {
128
+ consumerId?: string | null;
129
+ createdOn?: string | null;
130
+ queueId?: string | null;
131
+ settings?: {
132
+ batchSize?: number | null;
133
+ maxRetries?: number | null;
134
+ retryDelay?: number | null;
135
+ visibilityTimeoutMs?: number | null;
136
+ } | null;
137
+ type?: "http_pull" | null;
138
+ };
139
+
140
+ export const GetConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
141
+ Schema.Struct({
142
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
143
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
144
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
145
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
146
+ settings: Schema.optional(
147
+ Schema.Union([
148
+ Schema.Struct({
149
+ batchSize: Schema.optional(
150
+ Schema.Union([Schema.Number, Schema.Null]),
151
+ ),
152
+ maxConcurrency: Schema.optional(
153
+ Schema.Union([Schema.Number, Schema.Null]),
154
+ ),
155
+ maxRetries: Schema.optional(
156
+ Schema.Union([Schema.Number, Schema.Null]),
157
+ ),
158
+ maxWaitTimeMs: Schema.optional(
159
+ Schema.Union([Schema.Number, Schema.Null]),
160
+ ),
161
+ retryDelay: Schema.optional(
162
+ Schema.Union([Schema.Number, Schema.Null]),
163
+ ),
164
+ }).pipe(
165
+ Schema.encodeKeys({
166
+ batchSize: "batch_size",
167
+ maxConcurrency: "max_concurrency",
168
+ maxRetries: "max_retries",
169
+ maxWaitTimeMs: "max_wait_time_ms",
170
+ retryDelay: "retry_delay",
171
+ }),
172
+ ),
173
+ Schema.Null,
174
+ ]),
175
+ ),
176
+ type: Schema.optional(
177
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
178
+ ),
179
+ }).pipe(
180
+ Schema.encodeKeys({
181
+ consumerId: "consumer_id",
182
+ createdOn: "created_on",
183
+ queueId: "queue_id",
184
+ script: "script",
185
+ settings: "settings",
186
+ type: "type",
187
+ }),
188
+ ),
189
+ Schema.Struct({
190
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
191
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
192
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
193
+ settings: Schema.optional(
194
+ Schema.Union([
195
+ Schema.Struct({
196
+ batchSize: Schema.optional(
197
+ Schema.Union([Schema.Number, Schema.Null]),
198
+ ),
199
+ maxRetries: Schema.optional(
200
+ Schema.Union([Schema.Number, Schema.Null]),
201
+ ),
202
+ retryDelay: Schema.optional(
203
+ Schema.Union([Schema.Number, Schema.Null]),
204
+ ),
205
+ visibilityTimeoutMs: Schema.optional(
206
+ Schema.Union([Schema.Number, Schema.Null]),
207
+ ),
208
+ }).pipe(
209
+ Schema.encodeKeys({
210
+ batchSize: "batch_size",
211
+ maxRetries: "max_retries",
212
+ retryDelay: "retry_delay",
213
+ visibilityTimeoutMs: "visibility_timeout_ms",
214
+ }),
215
+ ),
216
+ Schema.Null,
217
+ ]),
218
+ ),
219
+ type: Schema.optional(
220
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
221
+ ),
222
+ }).pipe(
223
+ Schema.encodeKeys({
224
+ consumerId: "consumer_id",
225
+ createdOn: "created_on",
226
+ queueId: "queue_id",
227
+ settings: "settings",
228
+ type: "type",
229
+ }),
230
+ ),
231
+ ]).pipe(
232
+ T.ResponsePath("result"),
233
+ ) as unknown as Schema.Schema<GetConsumerResponse>;
132
234
 
133
235
  export type GetConsumerError =
134
236
  | DefaultErrors
@@ -156,40 +258,140 @@ export interface ListConsumersRequest {
156
258
 
157
259
  export const ListConsumersRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
158
260
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
159
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
160
- })
161
- .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}/consumers" })) as unknown as Schema.Schema<ListConsumersRequest>;
261
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
262
+ }).pipe(
263
+ T.Http({
264
+ method: "GET",
265
+ path: "/accounts/{account_id}/queues/{queueId}/consumers",
266
+ }),
267
+ ) as unknown as Schema.Schema<ListConsumersRequest>;
162
268
 
163
269
  export interface ListConsumersResponse {
164
- result: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[];
270
+ result: (
271
+ | {
272
+ consumerId?: string | null;
273
+ createdOn?: string | null;
274
+ queueId?: string | null;
275
+ script?: string | null;
276
+ settings?: {
277
+ batchSize?: number | null;
278
+ maxConcurrency?: number | null;
279
+ maxRetries?: number | null;
280
+ maxWaitTimeMs?: number | null;
281
+ retryDelay?: number | null;
282
+ } | null;
283
+ type?: "worker" | null;
284
+ }
285
+ | {
286
+ consumerId?: string | null;
287
+ createdOn?: string | null;
288
+ queueId?: string | null;
289
+ settings?: {
290
+ batchSize?: number | null;
291
+ maxRetries?: number | null;
292
+ retryDelay?: number | null;
293
+ visibilityTimeoutMs?: number | null;
294
+ } | null;
295
+ type?: "http_pull" | null;
296
+ }
297
+ )[];
165
298
  }
166
299
 
167
300
  export const ListConsumersResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
168
- result: Schema.Array(Schema.Union([Schema.Struct({
169
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
170
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
171
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
172
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
173
- settings: Schema.optional(Schema.Union([Schema.Struct({
174
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
175
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
176
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
177
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
178
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
179
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
180
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
181
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
182
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
183
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
184
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
185
- settings: Schema.optional(Schema.Union([Schema.Struct({
186
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
187
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
188
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
189
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
190
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
191
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
192
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]))
301
+ result: Schema.Array(
302
+ Schema.Union([
303
+ Schema.Struct({
304
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
305
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
306
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
307
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
308
+ settings: Schema.optional(
309
+ Schema.Union([
310
+ Schema.Struct({
311
+ batchSize: Schema.optional(
312
+ Schema.Union([Schema.Number, Schema.Null]),
313
+ ),
314
+ maxConcurrency: Schema.optional(
315
+ Schema.Union([Schema.Number, Schema.Null]),
316
+ ),
317
+ maxRetries: Schema.optional(
318
+ Schema.Union([Schema.Number, Schema.Null]),
319
+ ),
320
+ maxWaitTimeMs: Schema.optional(
321
+ Schema.Union([Schema.Number, Schema.Null]),
322
+ ),
323
+ retryDelay: Schema.optional(
324
+ Schema.Union([Schema.Number, Schema.Null]),
325
+ ),
326
+ }).pipe(
327
+ Schema.encodeKeys({
328
+ batchSize: "batch_size",
329
+ maxConcurrency: "max_concurrency",
330
+ maxRetries: "max_retries",
331
+ maxWaitTimeMs: "max_wait_time_ms",
332
+ retryDelay: "retry_delay",
333
+ }),
334
+ ),
335
+ Schema.Null,
336
+ ]),
337
+ ),
338
+ type: Schema.optional(
339
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
340
+ ),
341
+ }).pipe(
342
+ Schema.encodeKeys({
343
+ consumerId: "consumer_id",
344
+ createdOn: "created_on",
345
+ queueId: "queue_id",
346
+ script: "script",
347
+ settings: "settings",
348
+ type: "type",
349
+ }),
350
+ ),
351
+ Schema.Struct({
352
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
353
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
354
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
355
+ settings: Schema.optional(
356
+ Schema.Union([
357
+ Schema.Struct({
358
+ batchSize: Schema.optional(
359
+ Schema.Union([Schema.Number, Schema.Null]),
360
+ ),
361
+ maxRetries: Schema.optional(
362
+ Schema.Union([Schema.Number, Schema.Null]),
363
+ ),
364
+ retryDelay: Schema.optional(
365
+ Schema.Union([Schema.Number, Schema.Null]),
366
+ ),
367
+ visibilityTimeoutMs: Schema.optional(
368
+ Schema.Union([Schema.Number, Schema.Null]),
369
+ ),
370
+ }).pipe(
371
+ Schema.encodeKeys({
372
+ batchSize: "batch_size",
373
+ maxRetries: "max_retries",
374
+ retryDelay: "retry_delay",
375
+ visibilityTimeoutMs: "visibility_timeout_ms",
376
+ }),
377
+ ),
378
+ Schema.Null,
379
+ ]),
380
+ ),
381
+ type: Schema.optional(
382
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
383
+ ),
384
+ }).pipe(
385
+ Schema.encodeKeys({
386
+ consumerId: "consumer_id",
387
+ createdOn: "created_on",
388
+ queueId: "queue_id",
389
+ settings: "settings",
390
+ type: "type",
391
+ }),
392
+ ),
393
+ ]),
394
+ ),
193
395
  }) as unknown as Schema.Schema<ListConsumersResponse>;
194
396
 
195
397
  export type ListConsumersError =
@@ -222,7 +424,13 @@ export interface CreateConsumerRequest {
222
424
  /** Body param: Name of a Worker */
223
425
  scriptName?: string;
224
426
  /** Body param: */
225
- settings?: { batchSize?: number; maxConcurrency?: number; maxRetries?: number; maxWaitTimeMs?: number; retryDelay?: number };
427
+ settings?: {
428
+ batchSize?: number;
429
+ maxConcurrency?: number;
430
+ maxRetries?: number;
431
+ maxWaitTimeMs?: number;
432
+ retryDelay?: number;
433
+ };
226
434
  /** Body param: */
227
435
  type: "worker" | "http_pull";
228
436
  }
@@ -232,44 +440,159 @@ export const CreateConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
232
440
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
233
441
  deadLetterQueue: Schema.optional(Schema.String),
234
442
  scriptName: Schema.optional(Schema.String),
235
- settings: Schema.optional(Schema.Struct({
236
- batchSize: Schema.optional(Schema.Number),
237
- maxConcurrency: Schema.optional(Schema.Number),
238
- maxRetries: Schema.optional(Schema.Number),
239
- maxWaitTimeMs: Schema.optional(Schema.Number),
240
- retryDelay: Schema.optional(Schema.Number)
241
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" }))),
242
- type: Schema.Literals(["worker", "http_pull"])
243
- })
244
- .pipe(Schema.encodeKeys({ deadLetterQueue: "dead_letter_queue", scriptName: "script_name", settings: "settings", type: "type" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/consumers" })) as unknown as Schema.Schema<CreateConsumerRequest>;
245
-
246
- export type CreateConsumerResponse = { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null };
247
-
248
- export const CreateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.Struct({
249
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
250
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
251
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
252
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
253
- settings: Schema.optional(Schema.Union([Schema.Struct({
254
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
255
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
256
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
257
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
258
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
259
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
260
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
261
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
262
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
263
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
264
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
265
- settings: Schema.optional(Schema.Union([Schema.Struct({
266
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
267
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
268
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
269
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
270
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
271
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
272
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<CreateConsumerResponse>;
443
+ settings: Schema.optional(
444
+ Schema.Struct({
445
+ batchSize: Schema.optional(Schema.Number),
446
+ maxConcurrency: Schema.optional(Schema.Number),
447
+ maxRetries: Schema.optional(Schema.Number),
448
+ maxWaitTimeMs: Schema.optional(Schema.Number),
449
+ retryDelay: Schema.optional(Schema.Number),
450
+ }).pipe(
451
+ Schema.encodeKeys({
452
+ batchSize: "batch_size",
453
+ maxConcurrency: "max_concurrency",
454
+ maxRetries: "max_retries",
455
+ maxWaitTimeMs: "max_wait_time_ms",
456
+ retryDelay: "retry_delay",
457
+ }),
458
+ ),
459
+ ),
460
+ type: Schema.Literals(["worker", "http_pull"]),
461
+ }).pipe(
462
+ Schema.encodeKeys({
463
+ deadLetterQueue: "dead_letter_queue",
464
+ scriptName: "script_name",
465
+ settings: "settings",
466
+ type: "type",
467
+ }),
468
+ T.Http({
469
+ method: "POST",
470
+ path: "/accounts/{account_id}/queues/{queueId}/consumers",
471
+ }),
472
+ ) as unknown as Schema.Schema<CreateConsumerRequest>;
473
+
474
+ export type CreateConsumerResponse =
475
+ | {
476
+ consumerId?: string | null;
477
+ createdOn?: string | null;
478
+ queueId?: string | null;
479
+ script?: string | null;
480
+ settings?: {
481
+ batchSize?: number | null;
482
+ maxConcurrency?: number | null;
483
+ maxRetries?: number | null;
484
+ maxWaitTimeMs?: number | null;
485
+ retryDelay?: number | null;
486
+ } | null;
487
+ type?: "worker" | null;
488
+ }
489
+ | {
490
+ consumerId?: string | null;
491
+ createdOn?: string | null;
492
+ queueId?: string | null;
493
+ settings?: {
494
+ batchSize?: number | null;
495
+ maxRetries?: number | null;
496
+ retryDelay?: number | null;
497
+ visibilityTimeoutMs?: number | null;
498
+ } | null;
499
+ type?: "http_pull" | null;
500
+ };
501
+
502
+ export const CreateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
503
+ Schema.Struct({
504
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
505
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
506
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
507
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
508
+ settings: Schema.optional(
509
+ Schema.Union([
510
+ Schema.Struct({
511
+ batchSize: Schema.optional(
512
+ Schema.Union([Schema.Number, Schema.Null]),
513
+ ),
514
+ maxConcurrency: Schema.optional(
515
+ Schema.Union([Schema.Number, Schema.Null]),
516
+ ),
517
+ maxRetries: Schema.optional(
518
+ Schema.Union([Schema.Number, Schema.Null]),
519
+ ),
520
+ maxWaitTimeMs: Schema.optional(
521
+ Schema.Union([Schema.Number, Schema.Null]),
522
+ ),
523
+ retryDelay: Schema.optional(
524
+ Schema.Union([Schema.Number, Schema.Null]),
525
+ ),
526
+ }).pipe(
527
+ Schema.encodeKeys({
528
+ batchSize: "batch_size",
529
+ maxConcurrency: "max_concurrency",
530
+ maxRetries: "max_retries",
531
+ maxWaitTimeMs: "max_wait_time_ms",
532
+ retryDelay: "retry_delay",
533
+ }),
534
+ ),
535
+ Schema.Null,
536
+ ]),
537
+ ),
538
+ type: Schema.optional(
539
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
540
+ ),
541
+ }).pipe(
542
+ Schema.encodeKeys({
543
+ consumerId: "consumer_id",
544
+ createdOn: "created_on",
545
+ queueId: "queue_id",
546
+ script: "script",
547
+ settings: "settings",
548
+ type: "type",
549
+ }),
550
+ ),
551
+ Schema.Struct({
552
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
553
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
554
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
555
+ settings: Schema.optional(
556
+ Schema.Union([
557
+ Schema.Struct({
558
+ batchSize: Schema.optional(
559
+ Schema.Union([Schema.Number, Schema.Null]),
560
+ ),
561
+ maxRetries: Schema.optional(
562
+ Schema.Union([Schema.Number, Schema.Null]),
563
+ ),
564
+ retryDelay: Schema.optional(
565
+ Schema.Union([Schema.Number, Schema.Null]),
566
+ ),
567
+ visibilityTimeoutMs: Schema.optional(
568
+ Schema.Union([Schema.Number, Schema.Null]),
569
+ ),
570
+ }).pipe(
571
+ Schema.encodeKeys({
572
+ batchSize: "batch_size",
573
+ maxRetries: "max_retries",
574
+ retryDelay: "retry_delay",
575
+ visibilityTimeoutMs: "visibility_timeout_ms",
576
+ }),
577
+ ),
578
+ Schema.Null,
579
+ ]),
580
+ ),
581
+ type: Schema.optional(
582
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
583
+ ),
584
+ }).pipe(
585
+ Schema.encodeKeys({
586
+ consumerId: "consumer_id",
587
+ createdOn: "created_on",
588
+ queueId: "queue_id",
589
+ settings: "settings",
590
+ type: "type",
591
+ }),
592
+ ),
593
+ ]).pipe(
594
+ T.ResponsePath("result"),
595
+ ) as unknown as Schema.Schema<CreateConsumerResponse>;
273
596
 
274
597
  export type CreateConsumerError =
275
598
  | DefaultErrors
@@ -287,7 +610,13 @@ export const createConsumer: API.OperationMethod<
287
610
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
288
611
  input: CreateConsumerRequest,
289
612
  output: CreateConsumerResponse,
290
- errors: [InvalidRequestBody, QueueNotFound, ConsumerAlreadyExists, WorkerNotFound, InvalidRoute],
613
+ errors: [
614
+ InvalidRequestBody,
615
+ QueueNotFound,
616
+ ConsumerAlreadyExists,
617
+ WorkerNotFound,
618
+ InvalidRoute,
619
+ ],
291
620
  }));
292
621
 
293
622
  export interface UpdateConsumerRequest {
@@ -300,7 +629,13 @@ export interface UpdateConsumerRequest {
300
629
  /** Body param: Name of a Worker */
301
630
  scriptName?: string;
302
631
  /** Body param: */
303
- settings?: { batchSize?: number; maxConcurrency?: number; maxRetries?: number; maxWaitTimeMs?: number; retryDelay?: number };
632
+ settings?: {
633
+ batchSize?: number;
634
+ maxConcurrency?: number;
635
+ maxRetries?: number;
636
+ maxWaitTimeMs?: number;
637
+ retryDelay?: number;
638
+ };
304
639
  /** Body param: */
305
640
  type?: "worker";
306
641
  }
@@ -311,44 +646,159 @@ export const UpdateConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
311
646
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
312
647
  deadLetterQueue: Schema.optional(Schema.String),
313
648
  scriptName: Schema.optional(Schema.String),
314
- settings: Schema.optional(Schema.Struct({
315
- batchSize: Schema.optional(Schema.Number),
316
- maxConcurrency: Schema.optional(Schema.Number),
317
- maxRetries: Schema.optional(Schema.Number),
318
- maxWaitTimeMs: Schema.optional(Schema.Number),
319
- retryDelay: Schema.optional(Schema.Number)
320
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" }))),
321
- type: Schema.optional(Schema.Literal("worker"))
322
- })
323
- .pipe(Schema.encodeKeys({ deadLetterQueue: "dead_letter_queue", scriptName: "script_name", settings: "settings", type: "type" }), T.Http({ method: "PUT", path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}" })) as unknown as Schema.Schema<UpdateConsumerRequest>;
324
-
325
- export type UpdateConsumerResponse = { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null };
326
-
327
- export const UpdateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.Struct({
328
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
329
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
330
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
331
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
332
- settings: Schema.optional(Schema.Union([Schema.Struct({
333
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
334
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
335
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
336
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
337
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
338
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
339
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
340
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
341
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
342
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
343
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
344
- settings: Schema.optional(Schema.Union([Schema.Struct({
345
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
346
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
347
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
348
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
349
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
350
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
351
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))]).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<UpdateConsumerResponse>;
649
+ settings: Schema.optional(
650
+ Schema.Struct({
651
+ batchSize: Schema.optional(Schema.Number),
652
+ maxConcurrency: Schema.optional(Schema.Number),
653
+ maxRetries: Schema.optional(Schema.Number),
654
+ maxWaitTimeMs: Schema.optional(Schema.Number),
655
+ retryDelay: Schema.optional(Schema.Number),
656
+ }).pipe(
657
+ Schema.encodeKeys({
658
+ batchSize: "batch_size",
659
+ maxConcurrency: "max_concurrency",
660
+ maxRetries: "max_retries",
661
+ maxWaitTimeMs: "max_wait_time_ms",
662
+ retryDelay: "retry_delay",
663
+ }),
664
+ ),
665
+ ),
666
+ type: Schema.optional(Schema.Literal("worker")),
667
+ }).pipe(
668
+ Schema.encodeKeys({
669
+ deadLetterQueue: "dead_letter_queue",
670
+ scriptName: "script_name",
671
+ settings: "settings",
672
+ type: "type",
673
+ }),
674
+ T.Http({
675
+ method: "PUT",
676
+ path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
677
+ }),
678
+ ) as unknown as Schema.Schema<UpdateConsumerRequest>;
679
+
680
+ export type UpdateConsumerResponse =
681
+ | {
682
+ consumerId?: string | null;
683
+ createdOn?: string | null;
684
+ queueId?: string | null;
685
+ script?: string | null;
686
+ settings?: {
687
+ batchSize?: number | null;
688
+ maxConcurrency?: number | null;
689
+ maxRetries?: number | null;
690
+ maxWaitTimeMs?: number | null;
691
+ retryDelay?: number | null;
692
+ } | null;
693
+ type?: "worker" | null;
694
+ }
695
+ | {
696
+ consumerId?: string | null;
697
+ createdOn?: string | null;
698
+ queueId?: string | null;
699
+ settings?: {
700
+ batchSize?: number | null;
701
+ maxRetries?: number | null;
702
+ retryDelay?: number | null;
703
+ visibilityTimeoutMs?: number | null;
704
+ } | null;
705
+ type?: "http_pull" | null;
706
+ };
707
+
708
+ export const UpdateConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
709
+ Schema.Struct({
710
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
711
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
712
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
713
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
714
+ settings: Schema.optional(
715
+ Schema.Union([
716
+ Schema.Struct({
717
+ batchSize: Schema.optional(
718
+ Schema.Union([Schema.Number, Schema.Null]),
719
+ ),
720
+ maxConcurrency: Schema.optional(
721
+ Schema.Union([Schema.Number, Schema.Null]),
722
+ ),
723
+ maxRetries: Schema.optional(
724
+ Schema.Union([Schema.Number, Schema.Null]),
725
+ ),
726
+ maxWaitTimeMs: Schema.optional(
727
+ Schema.Union([Schema.Number, Schema.Null]),
728
+ ),
729
+ retryDelay: Schema.optional(
730
+ Schema.Union([Schema.Number, Schema.Null]),
731
+ ),
732
+ }).pipe(
733
+ Schema.encodeKeys({
734
+ batchSize: "batch_size",
735
+ maxConcurrency: "max_concurrency",
736
+ maxRetries: "max_retries",
737
+ maxWaitTimeMs: "max_wait_time_ms",
738
+ retryDelay: "retry_delay",
739
+ }),
740
+ ),
741
+ Schema.Null,
742
+ ]),
743
+ ),
744
+ type: Schema.optional(
745
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
746
+ ),
747
+ }).pipe(
748
+ Schema.encodeKeys({
749
+ consumerId: "consumer_id",
750
+ createdOn: "created_on",
751
+ queueId: "queue_id",
752
+ script: "script",
753
+ settings: "settings",
754
+ type: "type",
755
+ }),
756
+ ),
757
+ Schema.Struct({
758
+ consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
759
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
760
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
761
+ settings: Schema.optional(
762
+ Schema.Union([
763
+ Schema.Struct({
764
+ batchSize: Schema.optional(
765
+ Schema.Union([Schema.Number, Schema.Null]),
766
+ ),
767
+ maxRetries: Schema.optional(
768
+ Schema.Union([Schema.Number, Schema.Null]),
769
+ ),
770
+ retryDelay: Schema.optional(
771
+ Schema.Union([Schema.Number, Schema.Null]),
772
+ ),
773
+ visibilityTimeoutMs: Schema.optional(
774
+ Schema.Union([Schema.Number, Schema.Null]),
775
+ ),
776
+ }).pipe(
777
+ Schema.encodeKeys({
778
+ batchSize: "batch_size",
779
+ maxRetries: "max_retries",
780
+ retryDelay: "retry_delay",
781
+ visibilityTimeoutMs: "visibility_timeout_ms",
782
+ }),
783
+ ),
784
+ Schema.Null,
785
+ ]),
786
+ ),
787
+ type: Schema.optional(
788
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
789
+ ),
790
+ }).pipe(
791
+ Schema.encodeKeys({
792
+ consumerId: "consumer_id",
793
+ createdOn: "created_on",
794
+ queueId: "queue_id",
795
+ settings: "settings",
796
+ type: "type",
797
+ }),
798
+ ),
799
+ ]).pipe(
800
+ T.ResponsePath("result"),
801
+ ) as unknown as Schema.Schema<UpdateConsumerResponse>;
352
802
 
353
803
  export type UpdateConsumerError =
354
804
  | DefaultErrors
@@ -366,7 +816,13 @@ export const updateConsumer: API.OperationMethod<
366
816
  > = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
367
817
  input: UpdateConsumerRequest,
368
818
  output: UpdateConsumerResponse,
369
- errors: [InvalidRequestBody, QueueNotFound, ConsumerNotFound, WorkerNotFound, InvalidRoute],
819
+ errors: [
820
+ InvalidRequestBody,
821
+ QueueNotFound,
822
+ ConsumerNotFound,
823
+ WorkerNotFound,
824
+ InvalidRoute,
825
+ ],
370
826
  }));
371
827
 
372
828
  export interface DeleteConsumerRequest {
@@ -379,29 +835,67 @@ export interface DeleteConsumerRequest {
379
835
  export const DeleteConsumerRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
380
836
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
381
837
  consumerId: Schema.String.pipe(T.HttpPath("consumerId")),
382
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
383
- })
384
- .pipe(T.Http({ method: "DELETE", path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}" })) as unknown as Schema.Schema<DeleteConsumerRequest>;
838
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
839
+ }).pipe(
840
+ T.Http({
841
+ method: "DELETE",
842
+ path: "/accounts/{account_id}/queues/{queueId}/consumers/{consumerId}",
843
+ }),
844
+ ) as unknown as Schema.Schema<DeleteConsumerRequest>;
385
845
 
386
846
  export interface DeleteConsumerResponse {
387
- errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
847
+ errors?:
848
+ | {
849
+ code: number;
850
+ message: string;
851
+ documentationUrl?: string | null;
852
+ source?: { pointer?: string | null } | null;
853
+ }[]
854
+ | null;
388
855
  messages?: string[] | null;
389
856
  /** Indicates if the API call was successful or not. */
390
857
  success?: true | null;
391
858
  }
392
859
 
393
- export const DeleteConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
394
- errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
395
- code: Schema.Number,
396
- message: Schema.String,
397
- documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
398
- source: Schema.optional(Schema.Union([Schema.Struct({
399
- pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
400
- }), Schema.Null]))
401
- }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
402
- messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
403
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
404
- }) as unknown as Schema.Schema<DeleteConsumerResponse>;
860
+ export const DeleteConsumerResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
861
+ {
862
+ errors: Schema.optional(
863
+ Schema.Union([
864
+ Schema.Array(
865
+ Schema.Struct({
866
+ code: Schema.Number,
867
+ message: Schema.String,
868
+ documentationUrl: Schema.optional(
869
+ Schema.Union([Schema.String, Schema.Null]),
870
+ ),
871
+ source: Schema.optional(
872
+ Schema.Union([
873
+ Schema.Struct({
874
+ pointer: Schema.optional(
875
+ Schema.Union([Schema.String, Schema.Null]),
876
+ ),
877
+ }),
878
+ Schema.Null,
879
+ ]),
880
+ ),
881
+ }).pipe(
882
+ Schema.encodeKeys({
883
+ code: "code",
884
+ message: "message",
885
+ documentationUrl: "documentation_url",
886
+ source: "source",
887
+ }),
888
+ ),
889
+ ),
890
+ Schema.Null,
891
+ ]),
892
+ ),
893
+ messages: Schema.optional(
894
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
895
+ ),
896
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
897
+ },
898
+ ) as unknown as Schema.Schema<DeleteConsumerResponse>;
405
899
 
406
900
  export type DeleteConsumerError =
407
901
  | DefaultErrors
@@ -421,7 +915,6 @@ export const deleteConsumer: API.OperationMethod<
421
915
  errors: [InvalidRequestBody, QueueNotFound, ConsumerNotFound, InvalidRoute],
422
916
  }));
423
917
 
424
-
425
918
  // =============================================================================
426
919
  // Message
427
920
  // =============================================================================
@@ -433,44 +926,105 @@ export interface BulkPushMessagesRequest {
433
926
  /** Body param: The number of seconds to wait for attempting to deliver this batch to consumers */
434
927
  delaySeconds?: number;
435
928
  /** Body param: */
436
- messages?: ({ body?: string; contentType?: "text"; delaySeconds?: number } | { body?: unknown; contentType?: "json"; delaySeconds?: number })[];
929
+ messages?: (
930
+ | { body?: string; contentType?: "text"; delaySeconds?: number }
931
+ | { body?: unknown; contentType?: "json"; delaySeconds?: number }
932
+ )[];
437
933
  }
438
934
 
439
- export const BulkPushMessagesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
440
- queueId: Schema.String.pipe(T.HttpPath("queueId")),
441
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
442
- delaySeconds: Schema.optional(Schema.Number),
443
- messages: Schema.optional(Schema.Array(Schema.Union([Schema.Struct({
444
- body: Schema.optional(Schema.String),
445
- contentType: Schema.optional(Schema.Literal("text")),
446
- delaySeconds: Schema.optional(Schema.Number)
447
- }).pipe(Schema.encodeKeys({ body: "body", contentType: "content_type", delaySeconds: "delay_seconds" })), Schema.Struct({
448
- body: Schema.optional(Schema.Unknown),
449
- contentType: Schema.optional(Schema.Literal("json")),
450
- delaySeconds: Schema.optional(Schema.Number)
451
- }).pipe(Schema.encodeKeys({ body: "body", contentType: "content_type", delaySeconds: "delay_seconds" }))])))
452
- })
453
- .pipe(Schema.encodeKeys({ delaySeconds: "delay_seconds", messages: "messages" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages/batch" })) as unknown as Schema.Schema<BulkPushMessagesRequest>;
935
+ export const BulkPushMessagesRequest =
936
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
937
+ queueId: Schema.String.pipe(T.HttpPath("queueId")),
938
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
939
+ delaySeconds: Schema.optional(Schema.Number),
940
+ messages: Schema.optional(
941
+ Schema.Array(
942
+ Schema.Union([
943
+ Schema.Struct({
944
+ body: Schema.optional(Schema.String),
945
+ contentType: Schema.optional(Schema.Literal("text")),
946
+ delaySeconds: Schema.optional(Schema.Number),
947
+ }).pipe(
948
+ Schema.encodeKeys({
949
+ body: "body",
950
+ contentType: "content_type",
951
+ delaySeconds: "delay_seconds",
952
+ }),
953
+ ),
954
+ Schema.Struct({
955
+ body: Schema.optional(Schema.Unknown),
956
+ contentType: Schema.optional(Schema.Literal("json")),
957
+ delaySeconds: Schema.optional(Schema.Number),
958
+ }).pipe(
959
+ Schema.encodeKeys({
960
+ body: "body",
961
+ contentType: "content_type",
962
+ delaySeconds: "delay_seconds",
963
+ }),
964
+ ),
965
+ ]),
966
+ ),
967
+ ),
968
+ }).pipe(
969
+ Schema.encodeKeys({ delaySeconds: "delay_seconds", messages: "messages" }),
970
+ T.Http({
971
+ method: "POST",
972
+ path: "/accounts/{account_id}/queues/{queueId}/messages/batch",
973
+ }),
974
+ ) as unknown as Schema.Schema<BulkPushMessagesRequest>;
454
975
 
455
976
  export interface BulkPushMessagesResponse {
456
- errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
977
+ errors?:
978
+ | {
979
+ code: number;
980
+ message: string;
981
+ documentationUrl?: string | null;
982
+ source?: { pointer?: string | null } | null;
983
+ }[]
984
+ | null;
457
985
  messages?: string[] | null;
458
986
  /** Indicates if the API call was successful or not. */
459
987
  success?: true | null;
460
988
  }
461
989
 
462
- export const BulkPushMessagesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
463
- errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
464
- code: Schema.Number,
465
- message: Schema.String,
466
- documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
467
- source: Schema.optional(Schema.Union([Schema.Struct({
468
- pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
469
- }), Schema.Null]))
470
- }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
471
- messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
472
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
473
- }) as unknown as Schema.Schema<BulkPushMessagesResponse>;
990
+ export const BulkPushMessagesResponse =
991
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
992
+ errors: Schema.optional(
993
+ Schema.Union([
994
+ Schema.Array(
995
+ Schema.Struct({
996
+ code: Schema.Number,
997
+ message: Schema.String,
998
+ documentationUrl: Schema.optional(
999
+ Schema.Union([Schema.String, Schema.Null]),
1000
+ ),
1001
+ source: Schema.optional(
1002
+ Schema.Union([
1003
+ Schema.Struct({
1004
+ pointer: Schema.optional(
1005
+ Schema.Union([Schema.String, Schema.Null]),
1006
+ ),
1007
+ }),
1008
+ Schema.Null,
1009
+ ]),
1010
+ ),
1011
+ }).pipe(
1012
+ Schema.encodeKeys({
1013
+ code: "code",
1014
+ message: "message",
1015
+ documentationUrl: "documentation_url",
1016
+ source: "source",
1017
+ }),
1018
+ ),
1019
+ ),
1020
+ Schema.Null,
1021
+ ]),
1022
+ ),
1023
+ messages: Schema.optional(
1024
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1025
+ ),
1026
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
1027
+ }) as unknown as Schema.Schema<BulkPushMessagesResponse>;
474
1028
 
475
1029
  export type BulkPushMessagesError =
476
1030
  | DefaultErrors
@@ -503,27 +1057,75 @@ export const PullMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
503
1057
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
504
1058
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
505
1059
  batchSize: Schema.optional(Schema.Number),
506
- visibilityTimeoutMs: Schema.optional(Schema.Number)
507
- })
508
- .pipe(Schema.encodeKeys({ batchSize: "batch_size", visibilityTimeoutMs: "visibility_timeout_ms" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages/pull" })) as unknown as Schema.Schema<PullMessageRequest>;
1060
+ visibilityTimeoutMs: Schema.optional(Schema.Number),
1061
+ }).pipe(
1062
+ Schema.encodeKeys({
1063
+ batchSize: "batch_size",
1064
+ visibilityTimeoutMs: "visibility_timeout_ms",
1065
+ }),
1066
+ T.Http({
1067
+ method: "POST",
1068
+ path: "/accounts/{account_id}/queues/{queueId}/messages/pull",
1069
+ }),
1070
+ ) as unknown as Schema.Schema<PullMessageRequest>;
509
1071
 
510
1072
  export interface PullMessageResponse {
511
1073
  /** The number of unacknowledged messages in the queue */
512
1074
  messageBacklogCount?: number | null;
513
- messages?: ({ id?: string | null; attempts?: number | null; body?: string | null; leaseId?: string | null; metadata?: unknown | null; timestampMs?: number | null })[] | null;
1075
+ messages?:
1076
+ | {
1077
+ id?: string | null;
1078
+ attempts?: number | null;
1079
+ body?: string | null;
1080
+ leaseId?: string | null;
1081
+ metadata?: unknown | null;
1082
+ timestampMs?: number | null;
1083
+ }[]
1084
+ | null;
514
1085
  }
515
1086
 
516
1087
  export const PullMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
517
- messageBacklogCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
518
- messages: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
519
- id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
520
- attempts: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
521
- body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
522
- leaseId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
523
- metadata: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
524
- timestampMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
525
- }).pipe(Schema.encodeKeys({ id: "id", attempts: "attempts", body: "body", leaseId: "lease_id", metadata: "metadata", timestampMs: "timestamp_ms" }))), Schema.Null]))
526
- }).pipe(Schema.encodeKeys({ messageBacklogCount: "message_backlog_count", messages: "messages" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<PullMessageResponse>;
1088
+ messageBacklogCount: Schema.optional(
1089
+ Schema.Union([Schema.Number, Schema.Null]),
1090
+ ),
1091
+ messages: Schema.optional(
1092
+ Schema.Union([
1093
+ Schema.Array(
1094
+ Schema.Struct({
1095
+ id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1096
+ attempts: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1097
+ body: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1098
+ leaseId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1099
+ metadata: Schema.optional(
1100
+ Schema.Union([Schema.Unknown, Schema.Null]),
1101
+ ),
1102
+ timestampMs: Schema.optional(
1103
+ Schema.Union([Schema.Number, Schema.Null]),
1104
+ ),
1105
+ }).pipe(
1106
+ Schema.encodeKeys({
1107
+ id: "id",
1108
+ attempts: "attempts",
1109
+ body: "body",
1110
+ leaseId: "lease_id",
1111
+ metadata: "metadata",
1112
+ timestampMs: "timestamp_ms",
1113
+ }),
1114
+ ),
1115
+ ),
1116
+ Schema.Null,
1117
+ ]),
1118
+ ),
1119
+ })
1120
+ .pipe(
1121
+ Schema.encodeKeys({
1122
+ messageBacklogCount: "message_backlog_count",
1123
+ messages: "messages",
1124
+ }),
1125
+ )
1126
+ .pipe(
1127
+ T.ResponsePath("result"),
1128
+ ) as unknown as Schema.Schema<PullMessageResponse>;
527
1129
 
528
1130
  export type PullMessageError =
529
1131
  | DefaultErrors
@@ -560,28 +1162,69 @@ export const PushMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
560
1162
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
561
1163
  body: Schema.optional(Schema.String),
562
1164
  contentType: Schema.optional(Schema.Literal("text")),
563
- delaySeconds: Schema.optional(Schema.Number)
564
- })
565
- .pipe(Schema.encodeKeys({ body: "body", contentType: "content_type", delaySeconds: "delay_seconds" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages" })) as unknown as Schema.Schema<PushMessageRequest>;
1165
+ delaySeconds: Schema.optional(Schema.Number),
1166
+ }).pipe(
1167
+ Schema.encodeKeys({
1168
+ body: "body",
1169
+ contentType: "content_type",
1170
+ delaySeconds: "delay_seconds",
1171
+ }),
1172
+ T.Http({
1173
+ method: "POST",
1174
+ path: "/accounts/{account_id}/queues/{queueId}/messages",
1175
+ }),
1176
+ ) as unknown as Schema.Schema<PushMessageRequest>;
566
1177
 
567
1178
  export interface PushMessageResponse {
568
- errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
1179
+ errors?:
1180
+ | {
1181
+ code: number;
1182
+ message: string;
1183
+ documentationUrl?: string | null;
1184
+ source?: { pointer?: string | null } | null;
1185
+ }[]
1186
+ | null;
569
1187
  messages?: string[] | null;
570
1188
  /** Indicates if the API call was successful or not. */
571
1189
  success?: true | null;
572
1190
  }
573
1191
 
574
1192
  export const PushMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
575
- errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
576
- code: Schema.Number,
577
- message: Schema.String,
578
- documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
579
- source: Schema.optional(Schema.Union([Schema.Struct({
580
- pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
581
- }), Schema.Null]))
582
- }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
583
- messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
584
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
1193
+ errors: Schema.optional(
1194
+ Schema.Union([
1195
+ Schema.Array(
1196
+ Schema.Struct({
1197
+ code: Schema.Number,
1198
+ message: Schema.String,
1199
+ documentationUrl: Schema.optional(
1200
+ Schema.Union([Schema.String, Schema.Null]),
1201
+ ),
1202
+ source: Schema.optional(
1203
+ Schema.Union([
1204
+ Schema.Struct({
1205
+ pointer: Schema.optional(
1206
+ Schema.Union([Schema.String, Schema.Null]),
1207
+ ),
1208
+ }),
1209
+ Schema.Null,
1210
+ ]),
1211
+ ),
1212
+ }).pipe(
1213
+ Schema.encodeKeys({
1214
+ code: "code",
1215
+ message: "message",
1216
+ documentationUrl: "documentation_url",
1217
+ source: "source",
1218
+ }),
1219
+ ),
1220
+ ),
1221
+ Schema.Null,
1222
+ ]),
1223
+ ),
1224
+ messages: Schema.optional(
1225
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1226
+ ),
1227
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
585
1228
  }) as unknown as Schema.Schema<PushMessageResponse>;
586
1229
 
587
1230
  export type PushMessageError =
@@ -614,15 +1257,32 @@ export interface AckMessageRequest {
614
1257
  export const AckMessageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
615
1258
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
616
1259
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
617
- acks: Schema.optional(Schema.Array(Schema.Struct({
618
- leaseId: Schema.optional(Schema.String)
619
- }).pipe(Schema.encodeKeys({ leaseId: "lease_id" })))),
620
- retries: Schema.optional(Schema.Array(Schema.Struct({
621
- delaySeconds: Schema.optional(Schema.Number),
622
- leaseId: Schema.optional(Schema.String)
623
- }).pipe(Schema.encodeKeys({ delaySeconds: "delay_seconds", leaseId: "lease_id" }))))
624
- })
625
- .pipe(T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/messages/ack" })) as unknown as Schema.Schema<AckMessageRequest>;
1260
+ acks: Schema.optional(
1261
+ Schema.Array(
1262
+ Schema.Struct({
1263
+ leaseId: Schema.optional(Schema.String),
1264
+ }).pipe(Schema.encodeKeys({ leaseId: "lease_id" })),
1265
+ ),
1266
+ ),
1267
+ retries: Schema.optional(
1268
+ Schema.Array(
1269
+ Schema.Struct({
1270
+ delaySeconds: Schema.optional(Schema.Number),
1271
+ leaseId: Schema.optional(Schema.String),
1272
+ }).pipe(
1273
+ Schema.encodeKeys({
1274
+ delaySeconds: "delay_seconds",
1275
+ leaseId: "lease_id",
1276
+ }),
1277
+ ),
1278
+ ),
1279
+ ),
1280
+ }).pipe(
1281
+ T.Http({
1282
+ method: "POST",
1283
+ path: "/accounts/{account_id}/queues/{queueId}/messages/ack",
1284
+ }),
1285
+ ) as unknown as Schema.Schema<AckMessageRequest>;
626
1286
 
627
1287
  export interface AckMessageResponse {
628
1288
  /** The number of messages that were succesfully acknowledged. */
@@ -635,8 +1295,12 @@ export interface AckMessageResponse {
635
1295
  export const AckMessageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
636
1296
  ackCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
637
1297
  retryCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
638
- warnings: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null]))
639
- }).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<AckMessageResponse>;
1298
+ warnings: Schema.optional(
1299
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
1300
+ ),
1301
+ }).pipe(
1302
+ T.ResponsePath("result"),
1303
+ ) as unknown as Schema.Schema<AckMessageResponse>;
640
1304
 
641
1305
  export type AckMessageError =
642
1306
  | DefaultErrors
@@ -656,7 +1320,6 @@ export const ackMessage: API.OperationMethod<
656
1320
  errors: [InvalidRequestBody, InvalidQueueId, QueueNotFound, InvalidRoute],
657
1321
  }));
658
1322
 
659
-
660
1323
  // =============================================================================
661
1324
  // Purge
662
1325
  // =============================================================================
@@ -672,72 +1335,255 @@ export interface StartPurgeRequest {
672
1335
  export const StartPurgeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
673
1336
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
674
1337
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
675
- deleteMessagesPermanently: Schema.optional(Schema.Boolean)
676
- })
677
- .pipe(Schema.encodeKeys({ deleteMessagesPermanently: "delete_messages_permanently" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues/{queueId}/purge" })) as unknown as Schema.Schema<StartPurgeRequest>;
1338
+ deleteMessagesPermanently: Schema.optional(Schema.Boolean),
1339
+ }).pipe(
1340
+ Schema.encodeKeys({
1341
+ deleteMessagesPermanently: "delete_messages_permanently",
1342
+ }),
1343
+ T.Http({
1344
+ method: "POST",
1345
+ path: "/accounts/{account_id}/queues/{queueId}/purge",
1346
+ }),
1347
+ ) as unknown as Schema.Schema<StartPurgeRequest>;
678
1348
 
679
1349
  export interface StartPurgeResponse {
680
- consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
1350
+ consumers?:
1351
+ | (
1352
+ | {
1353
+ consumerId?: string | null;
1354
+ createdOn?: string | null;
1355
+ queueId?: string | null;
1356
+ script?: string | null;
1357
+ settings?: {
1358
+ batchSize?: number | null;
1359
+ maxConcurrency?: number | null;
1360
+ maxRetries?: number | null;
1361
+ maxWaitTimeMs?: number | null;
1362
+ retryDelay?: number | null;
1363
+ } | null;
1364
+ type?: "worker" | null;
1365
+ }
1366
+ | {
1367
+ consumerId?: string | null;
1368
+ createdOn?: string | null;
1369
+ queueId?: string | null;
1370
+ settings?: {
1371
+ batchSize?: number | null;
1372
+ maxRetries?: number | null;
1373
+ retryDelay?: number | null;
1374
+ visibilityTimeoutMs?: number | null;
1375
+ } | null;
1376
+ type?: "http_pull" | null;
1377
+ }
1378
+ )[]
1379
+ | null;
681
1380
  consumersTotalCount?: number | null;
682
1381
  createdOn?: string | null;
683
1382
  modifiedOn?: string | null;
684
- producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
1383
+ producers?:
1384
+ | (
1385
+ | { script?: string | null; type?: "worker" | null }
1386
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1387
+ )[]
1388
+ | null;
685
1389
  producersTotalCount?: number | null;
686
1390
  queueId?: string | null;
687
1391
  queueName?: string | null;
688
- settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
1392
+ settings?: {
1393
+ deliveryDelay?: number | null;
1394
+ deliveryPaused?: boolean | null;
1395
+ messageRetentionPeriod?: number | null;
1396
+ } | null;
689
1397
  }
690
1398
 
691
1399
  export const StartPurgeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
692
- consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
693
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
694
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
695
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
696
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
697
- settings: Schema.optional(Schema.Union([Schema.Struct({
698
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
699
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
700
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
701
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
702
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
703
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
704
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
705
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
706
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
707
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
708
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
709
- settings: Schema.optional(Schema.Union([Schema.Struct({
710
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
711
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
712
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
713
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
714
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
715
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
716
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
717
- consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1400
+ consumers: Schema.optional(
1401
+ Schema.Union([
1402
+ Schema.Array(
1403
+ Schema.Union([
1404
+ Schema.Struct({
1405
+ consumerId: Schema.optional(
1406
+ Schema.Union([Schema.String, Schema.Null]),
1407
+ ),
1408
+ createdOn: Schema.optional(
1409
+ Schema.Union([Schema.String, Schema.Null]),
1410
+ ),
1411
+ queueId: Schema.optional(
1412
+ Schema.Union([Schema.String, Schema.Null]),
1413
+ ),
1414
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1415
+ settings: Schema.optional(
1416
+ Schema.Union([
1417
+ Schema.Struct({
1418
+ batchSize: Schema.optional(
1419
+ Schema.Union([Schema.Number, Schema.Null]),
1420
+ ),
1421
+ maxConcurrency: Schema.optional(
1422
+ Schema.Union([Schema.Number, Schema.Null]),
1423
+ ),
1424
+ maxRetries: Schema.optional(
1425
+ Schema.Union([Schema.Number, Schema.Null]),
1426
+ ),
1427
+ maxWaitTimeMs: Schema.optional(
1428
+ Schema.Union([Schema.Number, Schema.Null]),
1429
+ ),
1430
+ retryDelay: Schema.optional(
1431
+ Schema.Union([Schema.Number, Schema.Null]),
1432
+ ),
1433
+ }).pipe(
1434
+ Schema.encodeKeys({
1435
+ batchSize: "batch_size",
1436
+ maxConcurrency: "max_concurrency",
1437
+ maxRetries: "max_retries",
1438
+ maxWaitTimeMs: "max_wait_time_ms",
1439
+ retryDelay: "retry_delay",
1440
+ }),
1441
+ ),
1442
+ Schema.Null,
1443
+ ]),
1444
+ ),
1445
+ type: Schema.optional(
1446
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1447
+ ),
1448
+ }).pipe(
1449
+ Schema.encodeKeys({
1450
+ consumerId: "consumer_id",
1451
+ createdOn: "created_on",
1452
+ queueId: "queue_id",
1453
+ script: "script",
1454
+ settings: "settings",
1455
+ type: "type",
1456
+ }),
1457
+ ),
1458
+ Schema.Struct({
1459
+ consumerId: Schema.optional(
1460
+ Schema.Union([Schema.String, Schema.Null]),
1461
+ ),
1462
+ createdOn: Schema.optional(
1463
+ Schema.Union([Schema.String, Schema.Null]),
1464
+ ),
1465
+ queueId: Schema.optional(
1466
+ Schema.Union([Schema.String, Schema.Null]),
1467
+ ),
1468
+ settings: Schema.optional(
1469
+ Schema.Union([
1470
+ Schema.Struct({
1471
+ batchSize: Schema.optional(
1472
+ Schema.Union([Schema.Number, Schema.Null]),
1473
+ ),
1474
+ maxRetries: Schema.optional(
1475
+ Schema.Union([Schema.Number, Schema.Null]),
1476
+ ),
1477
+ retryDelay: Schema.optional(
1478
+ Schema.Union([Schema.Number, Schema.Null]),
1479
+ ),
1480
+ visibilityTimeoutMs: Schema.optional(
1481
+ Schema.Union([Schema.Number, Schema.Null]),
1482
+ ),
1483
+ }).pipe(
1484
+ Schema.encodeKeys({
1485
+ batchSize: "batch_size",
1486
+ maxRetries: "max_retries",
1487
+ retryDelay: "retry_delay",
1488
+ visibilityTimeoutMs: "visibility_timeout_ms",
1489
+ }),
1490
+ ),
1491
+ Schema.Null,
1492
+ ]),
1493
+ ),
1494
+ type: Schema.optional(
1495
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
1496
+ ),
1497
+ }).pipe(
1498
+ Schema.encodeKeys({
1499
+ consumerId: "consumer_id",
1500
+ createdOn: "created_on",
1501
+ queueId: "queue_id",
1502
+ settings: "settings",
1503
+ type: "type",
1504
+ }),
1505
+ ),
1506
+ ]),
1507
+ ),
1508
+ Schema.Null,
1509
+ ]),
1510
+ ),
1511
+ consumersTotalCount: Schema.optional(
1512
+ Schema.Union([Schema.Number, Schema.Null]),
1513
+ ),
718
1514
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
719
1515
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
720
- producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
721
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
722
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
723
- }), Schema.Struct({
724
- bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
725
- type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
726
- }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
727
- producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1516
+ producers: Schema.optional(
1517
+ Schema.Union([
1518
+ Schema.Array(
1519
+ Schema.Union([
1520
+ Schema.Struct({
1521
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1522
+ type: Schema.optional(
1523
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1524
+ ),
1525
+ }),
1526
+ Schema.Struct({
1527
+ bucketName: Schema.optional(
1528
+ Schema.Union([Schema.String, Schema.Null]),
1529
+ ),
1530
+ type: Schema.optional(
1531
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1532
+ ),
1533
+ }).pipe(
1534
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1535
+ ),
1536
+ ]),
1537
+ ),
1538
+ Schema.Null,
1539
+ ]),
1540
+ ),
1541
+ producersTotalCount: Schema.optional(
1542
+ Schema.Union([Schema.Number, Schema.Null]),
1543
+ ),
728
1544
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
729
1545
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
730
- settings: Schema.optional(Schema.Union([Schema.Struct({
731
- deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
732
- deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
733
- messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
734
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
735
- }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<StartPurgeResponse>;
736
-
737
- export type StartPurgeError =
738
- | DefaultErrors
739
- | InvalidQueueId
740
- | InvalidRoute;
1546
+ settings: Schema.optional(
1547
+ Schema.Union([
1548
+ Schema.Struct({
1549
+ deliveryDelay: Schema.optional(
1550
+ Schema.Union([Schema.Number, Schema.Null]),
1551
+ ),
1552
+ deliveryPaused: Schema.optional(
1553
+ Schema.Union([Schema.Boolean, Schema.Null]),
1554
+ ),
1555
+ messageRetentionPeriod: Schema.optional(
1556
+ Schema.Union([Schema.Number, Schema.Null]),
1557
+ ),
1558
+ }).pipe(
1559
+ Schema.encodeKeys({
1560
+ deliveryDelay: "delivery_delay",
1561
+ deliveryPaused: "delivery_paused",
1562
+ messageRetentionPeriod: "message_retention_period",
1563
+ }),
1564
+ ),
1565
+ Schema.Null,
1566
+ ]),
1567
+ ),
1568
+ })
1569
+ .pipe(
1570
+ Schema.encodeKeys({
1571
+ consumers: "consumers",
1572
+ consumersTotalCount: "consumers_total_count",
1573
+ createdOn: "created_on",
1574
+ modifiedOn: "modified_on",
1575
+ producers: "producers",
1576
+ producersTotalCount: "producers_total_count",
1577
+ queueId: "queue_id",
1578
+ queueName: "queue_name",
1579
+ settings: "settings",
1580
+ }),
1581
+ )
1582
+ .pipe(
1583
+ T.ResponsePath("result"),
1584
+ ) as unknown as Schema.Schema<StartPurgeResponse>;
1585
+
1586
+ export type StartPurgeError = DefaultErrors | InvalidQueueId | InvalidRoute;
741
1587
 
742
1588
  export const startPurge: API.OperationMethod<
743
1589
  StartPurgeRequest,
@@ -758,9 +1604,13 @@ export interface StatusPurgeRequest {
758
1604
 
759
1605
  export const StatusPurgeRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
760
1606
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
761
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
762
- })
763
- .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}/purge" })) as unknown as Schema.Schema<StatusPurgeRequest>;
1607
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1608
+ }).pipe(
1609
+ T.Http({
1610
+ method: "GET",
1611
+ path: "/accounts/{account_id}/queues/{queueId}/purge",
1612
+ }),
1613
+ ) as unknown as Schema.Schema<StatusPurgeRequest>;
764
1614
 
765
1615
  export interface StatusPurgeResponse {
766
1616
  /** Indicates if the last purge operation completed successfully. */
@@ -771,13 +1621,14 @@ export interface StatusPurgeResponse {
771
1621
 
772
1622
  export const StatusPurgeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
773
1623
  completed: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
774
- startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
775
- }).pipe(Schema.encodeKeys({ completed: "completed", startedAt: "started_at" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<StatusPurgeResponse>;
1624
+ startedAt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1625
+ })
1626
+ .pipe(Schema.encodeKeys({ completed: "completed", startedAt: "started_at" }))
1627
+ .pipe(
1628
+ T.ResponsePath("result"),
1629
+ ) as unknown as Schema.Schema<StatusPurgeResponse>;
776
1630
 
777
- export type StatusPurgeError =
778
- | DefaultErrors
779
- | InvalidQueueId
780
- | InvalidRoute;
1631
+ export type StatusPurgeError = DefaultErrors | InvalidQueueId | InvalidRoute;
781
1632
 
782
1633
  export const statusPurge: API.OperationMethod<
783
1634
  StatusPurgeRequest,
@@ -790,7 +1641,6 @@ export const statusPurge: API.OperationMethod<
790
1641
  errors: [InvalidQueueId, InvalidRoute],
791
1642
  }));
792
1643
 
793
-
794
1644
  // =============================================================================
795
1645
  // Queue
796
1646
  // =============================================================================
@@ -803,72 +1653,247 @@ export interface GetQueueRequest {
803
1653
 
804
1654
  export const GetQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
805
1655
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
806
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
807
- })
808
- .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<GetQueueRequest>;
1656
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1657
+ }).pipe(
1658
+ T.Http({ method: "GET", path: "/accounts/{account_id}/queues/{queueId}" }),
1659
+ ) as unknown as Schema.Schema<GetQueueRequest>;
809
1660
 
810
1661
  export interface GetQueueResponse {
811
- consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
1662
+ consumers?:
1663
+ | (
1664
+ | {
1665
+ consumerId?: string | null;
1666
+ createdOn?: string | null;
1667
+ queueId?: string | null;
1668
+ script?: string | null;
1669
+ settings?: {
1670
+ batchSize?: number | null;
1671
+ maxConcurrency?: number | null;
1672
+ maxRetries?: number | null;
1673
+ maxWaitTimeMs?: number | null;
1674
+ retryDelay?: number | null;
1675
+ } | null;
1676
+ type?: "worker" | null;
1677
+ }
1678
+ | {
1679
+ consumerId?: string | null;
1680
+ createdOn?: string | null;
1681
+ queueId?: string | null;
1682
+ settings?: {
1683
+ batchSize?: number | null;
1684
+ maxRetries?: number | null;
1685
+ retryDelay?: number | null;
1686
+ visibilityTimeoutMs?: number | null;
1687
+ } | null;
1688
+ type?: "http_pull" | null;
1689
+ }
1690
+ )[]
1691
+ | null;
812
1692
  consumersTotalCount?: number | null;
813
1693
  createdOn?: string | null;
814
1694
  modifiedOn?: string | null;
815
- producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
1695
+ producers?:
1696
+ | (
1697
+ | { script?: string | null; type?: "worker" | null }
1698
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1699
+ )[]
1700
+ | null;
816
1701
  producersTotalCount?: number | null;
817
1702
  queueId?: string | null;
818
1703
  queueName?: string | null;
819
- settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
1704
+ settings?: {
1705
+ deliveryDelay?: number | null;
1706
+ deliveryPaused?: boolean | null;
1707
+ messageRetentionPeriod?: number | null;
1708
+ } | null;
820
1709
  }
821
1710
 
822
1711
  export const GetQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
823
- consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
824
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
825
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
826
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
827
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
828
- settings: Schema.optional(Schema.Union([Schema.Struct({
829
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
830
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
831
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
832
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
833
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
834
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
835
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
836
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
837
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
838
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
839
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
840
- settings: Schema.optional(Schema.Union([Schema.Struct({
841
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
842
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
843
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
844
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
845
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
846
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
847
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
848
- consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1712
+ consumers: Schema.optional(
1713
+ Schema.Union([
1714
+ Schema.Array(
1715
+ Schema.Union([
1716
+ Schema.Struct({
1717
+ consumerId: Schema.optional(
1718
+ Schema.Union([Schema.String, Schema.Null]),
1719
+ ),
1720
+ createdOn: Schema.optional(
1721
+ Schema.Union([Schema.String, Schema.Null]),
1722
+ ),
1723
+ queueId: Schema.optional(
1724
+ Schema.Union([Schema.String, Schema.Null]),
1725
+ ),
1726
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1727
+ settings: Schema.optional(
1728
+ Schema.Union([
1729
+ Schema.Struct({
1730
+ batchSize: Schema.optional(
1731
+ Schema.Union([Schema.Number, Schema.Null]),
1732
+ ),
1733
+ maxConcurrency: Schema.optional(
1734
+ Schema.Union([Schema.Number, Schema.Null]),
1735
+ ),
1736
+ maxRetries: Schema.optional(
1737
+ Schema.Union([Schema.Number, Schema.Null]),
1738
+ ),
1739
+ maxWaitTimeMs: Schema.optional(
1740
+ Schema.Union([Schema.Number, Schema.Null]),
1741
+ ),
1742
+ retryDelay: Schema.optional(
1743
+ Schema.Union([Schema.Number, Schema.Null]),
1744
+ ),
1745
+ }).pipe(
1746
+ Schema.encodeKeys({
1747
+ batchSize: "batch_size",
1748
+ maxConcurrency: "max_concurrency",
1749
+ maxRetries: "max_retries",
1750
+ maxWaitTimeMs: "max_wait_time_ms",
1751
+ retryDelay: "retry_delay",
1752
+ }),
1753
+ ),
1754
+ Schema.Null,
1755
+ ]),
1756
+ ),
1757
+ type: Schema.optional(
1758
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1759
+ ),
1760
+ }).pipe(
1761
+ Schema.encodeKeys({
1762
+ consumerId: "consumer_id",
1763
+ createdOn: "created_on",
1764
+ queueId: "queue_id",
1765
+ script: "script",
1766
+ settings: "settings",
1767
+ type: "type",
1768
+ }),
1769
+ ),
1770
+ Schema.Struct({
1771
+ consumerId: Schema.optional(
1772
+ Schema.Union([Schema.String, Schema.Null]),
1773
+ ),
1774
+ createdOn: Schema.optional(
1775
+ Schema.Union([Schema.String, Schema.Null]),
1776
+ ),
1777
+ queueId: Schema.optional(
1778
+ Schema.Union([Schema.String, Schema.Null]),
1779
+ ),
1780
+ settings: Schema.optional(
1781
+ Schema.Union([
1782
+ Schema.Struct({
1783
+ batchSize: Schema.optional(
1784
+ Schema.Union([Schema.Number, Schema.Null]),
1785
+ ),
1786
+ maxRetries: Schema.optional(
1787
+ Schema.Union([Schema.Number, Schema.Null]),
1788
+ ),
1789
+ retryDelay: Schema.optional(
1790
+ Schema.Union([Schema.Number, Schema.Null]),
1791
+ ),
1792
+ visibilityTimeoutMs: Schema.optional(
1793
+ Schema.Union([Schema.Number, Schema.Null]),
1794
+ ),
1795
+ }).pipe(
1796
+ Schema.encodeKeys({
1797
+ batchSize: "batch_size",
1798
+ maxRetries: "max_retries",
1799
+ retryDelay: "retry_delay",
1800
+ visibilityTimeoutMs: "visibility_timeout_ms",
1801
+ }),
1802
+ ),
1803
+ Schema.Null,
1804
+ ]),
1805
+ ),
1806
+ type: Schema.optional(
1807
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
1808
+ ),
1809
+ }).pipe(
1810
+ Schema.encodeKeys({
1811
+ consumerId: "consumer_id",
1812
+ createdOn: "created_on",
1813
+ queueId: "queue_id",
1814
+ settings: "settings",
1815
+ type: "type",
1816
+ }),
1817
+ ),
1818
+ ]),
1819
+ ),
1820
+ Schema.Null,
1821
+ ]),
1822
+ ),
1823
+ consumersTotalCount: Schema.optional(
1824
+ Schema.Union([Schema.Number, Schema.Null]),
1825
+ ),
849
1826
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
850
1827
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
851
- producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
852
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
853
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
854
- }), Schema.Struct({
855
- bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
856
- type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
857
- }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
858
- producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1828
+ producers: Schema.optional(
1829
+ Schema.Union([
1830
+ Schema.Array(
1831
+ Schema.Union([
1832
+ Schema.Struct({
1833
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1834
+ type: Schema.optional(
1835
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
1836
+ ),
1837
+ }),
1838
+ Schema.Struct({
1839
+ bucketName: Schema.optional(
1840
+ Schema.Union([Schema.String, Schema.Null]),
1841
+ ),
1842
+ type: Schema.optional(
1843
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
1844
+ ),
1845
+ }).pipe(
1846
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
1847
+ ),
1848
+ ]),
1849
+ ),
1850
+ Schema.Null,
1851
+ ]),
1852
+ ),
1853
+ producersTotalCount: Schema.optional(
1854
+ Schema.Union([Schema.Number, Schema.Null]),
1855
+ ),
859
1856
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
860
1857
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
861
- settings: Schema.optional(Schema.Union([Schema.Struct({
862
- deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
863
- deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
864
- messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
865
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
866
- }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetQueueResponse>;
867
-
868
- export type GetQueueError =
869
- | DefaultErrors
870
- | QueueNotFound
871
- | InvalidRoute;
1858
+ settings: Schema.optional(
1859
+ Schema.Union([
1860
+ Schema.Struct({
1861
+ deliveryDelay: Schema.optional(
1862
+ Schema.Union([Schema.Number, Schema.Null]),
1863
+ ),
1864
+ deliveryPaused: Schema.optional(
1865
+ Schema.Union([Schema.Boolean, Schema.Null]),
1866
+ ),
1867
+ messageRetentionPeriod: Schema.optional(
1868
+ Schema.Union([Schema.Number, Schema.Null]),
1869
+ ),
1870
+ }).pipe(
1871
+ Schema.encodeKeys({
1872
+ deliveryDelay: "delivery_delay",
1873
+ deliveryPaused: "delivery_paused",
1874
+ messageRetentionPeriod: "message_retention_period",
1875
+ }),
1876
+ ),
1877
+ Schema.Null,
1878
+ ]),
1879
+ ),
1880
+ })
1881
+ .pipe(
1882
+ Schema.encodeKeys({
1883
+ consumers: "consumers",
1884
+ consumersTotalCount: "consumers_total_count",
1885
+ createdOn: "created_on",
1886
+ modifiedOn: "modified_on",
1887
+ producers: "producers",
1888
+ producersTotalCount: "producers_total_count",
1889
+ queueId: "queue_id",
1890
+ queueName: "queue_name",
1891
+ settings: "settings",
1892
+ }),
1893
+ )
1894
+ .pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetQueueResponse>;
1895
+
1896
+ export type GetQueueError = DefaultErrors | QueueNotFound | InvalidRoute;
872
1897
 
873
1898
  export const getQueue: API.OperationMethod<
874
1899
  GetQueueRequest,
@@ -887,65 +1912,255 @@ export interface ListQueuesRequest {
887
1912
  }
888
1913
 
889
1914
  export const ListQueuesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
890
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
891
- })
892
- .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/queues" })) as unknown as Schema.Schema<ListQueuesRequest>;
1915
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
1916
+ }).pipe(
1917
+ T.Http({ method: "GET", path: "/accounts/{account_id}/queues" }),
1918
+ ) as unknown as Schema.Schema<ListQueuesRequest>;
893
1919
 
894
1920
  export interface ListQueuesResponse {
895
- result: ({ consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null; consumersTotalCount?: number | null; createdOn?: string | null; modifiedOn?: string | null; producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null; producersTotalCount?: number | null; queueId?: string | null; queueName?: string | null; settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null })[];
1921
+ result: {
1922
+ consumers?:
1923
+ | (
1924
+ | {
1925
+ consumerId?: string | null;
1926
+ createdOn?: string | null;
1927
+ queueId?: string | null;
1928
+ script?: string | null;
1929
+ settings?: {
1930
+ batchSize?: number | null;
1931
+ maxConcurrency?: number | null;
1932
+ maxRetries?: number | null;
1933
+ maxWaitTimeMs?: number | null;
1934
+ retryDelay?: number | null;
1935
+ } | null;
1936
+ type?: "worker" | null;
1937
+ }
1938
+ | {
1939
+ consumerId?: string | null;
1940
+ createdOn?: string | null;
1941
+ queueId?: string | null;
1942
+ settings?: {
1943
+ batchSize?: number | null;
1944
+ maxRetries?: number | null;
1945
+ retryDelay?: number | null;
1946
+ visibilityTimeoutMs?: number | null;
1947
+ } | null;
1948
+ type?: "http_pull" | null;
1949
+ }
1950
+ )[]
1951
+ | null;
1952
+ consumersTotalCount?: number | null;
1953
+ createdOn?: string | null;
1954
+ modifiedOn?: string | null;
1955
+ producers?:
1956
+ | (
1957
+ | { script?: string | null; type?: "worker" | null }
1958
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
1959
+ )[]
1960
+ | null;
1961
+ producersTotalCount?: number | null;
1962
+ queueId?: string | null;
1963
+ queueName?: string | null;
1964
+ settings?: {
1965
+ deliveryDelay?: number | null;
1966
+ deliveryPaused?: boolean | null;
1967
+ messageRetentionPeriod?: number | null;
1968
+ } | null;
1969
+ }[];
896
1970
  }
897
1971
 
898
1972
  export const ListQueuesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
899
- result: Schema.Array(Schema.Struct({
900
- consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
901
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
902
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
903
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
904
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
905
- settings: Schema.optional(Schema.Union([Schema.Struct({
906
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
907
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
908
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
909
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
910
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
911
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
912
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
913
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
914
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
915
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
916
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
917
- settings: Schema.optional(Schema.Union([Schema.Struct({
918
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
919
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
920
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
921
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
922
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
923
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
924
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
925
- consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
926
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
927
- modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
928
- producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
929
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
930
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
931
- }), Schema.Struct({
932
- bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
933
- type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
934
- }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
935
- producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
936
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
937
- queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
938
- settings: Schema.optional(Schema.Union([Schema.Struct({
939
- deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
940
- deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
941
- messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
942
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
943
- }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })))
1973
+ result: Schema.Array(
1974
+ Schema.Struct({
1975
+ consumers: Schema.optional(
1976
+ Schema.Union([
1977
+ Schema.Array(
1978
+ Schema.Union([
1979
+ Schema.Struct({
1980
+ consumerId: Schema.optional(
1981
+ Schema.Union([Schema.String, Schema.Null]),
1982
+ ),
1983
+ createdOn: Schema.optional(
1984
+ Schema.Union([Schema.String, Schema.Null]),
1985
+ ),
1986
+ queueId: Schema.optional(
1987
+ Schema.Union([Schema.String, Schema.Null]),
1988
+ ),
1989
+ script: Schema.optional(
1990
+ Schema.Union([Schema.String, Schema.Null]),
1991
+ ),
1992
+ settings: Schema.optional(
1993
+ Schema.Union([
1994
+ Schema.Struct({
1995
+ batchSize: Schema.optional(
1996
+ Schema.Union([Schema.Number, Schema.Null]),
1997
+ ),
1998
+ maxConcurrency: Schema.optional(
1999
+ Schema.Union([Schema.Number, Schema.Null]),
2000
+ ),
2001
+ maxRetries: Schema.optional(
2002
+ Schema.Union([Schema.Number, Schema.Null]),
2003
+ ),
2004
+ maxWaitTimeMs: Schema.optional(
2005
+ Schema.Union([Schema.Number, Schema.Null]),
2006
+ ),
2007
+ retryDelay: Schema.optional(
2008
+ Schema.Union([Schema.Number, Schema.Null]),
2009
+ ),
2010
+ }).pipe(
2011
+ Schema.encodeKeys({
2012
+ batchSize: "batch_size",
2013
+ maxConcurrency: "max_concurrency",
2014
+ maxRetries: "max_retries",
2015
+ maxWaitTimeMs: "max_wait_time_ms",
2016
+ retryDelay: "retry_delay",
2017
+ }),
2018
+ ),
2019
+ Schema.Null,
2020
+ ]),
2021
+ ),
2022
+ type: Schema.optional(
2023
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2024
+ ),
2025
+ }).pipe(
2026
+ Schema.encodeKeys({
2027
+ consumerId: "consumer_id",
2028
+ createdOn: "created_on",
2029
+ queueId: "queue_id",
2030
+ script: "script",
2031
+ settings: "settings",
2032
+ type: "type",
2033
+ }),
2034
+ ),
2035
+ Schema.Struct({
2036
+ consumerId: Schema.optional(
2037
+ Schema.Union([Schema.String, Schema.Null]),
2038
+ ),
2039
+ createdOn: Schema.optional(
2040
+ Schema.Union([Schema.String, Schema.Null]),
2041
+ ),
2042
+ queueId: Schema.optional(
2043
+ Schema.Union([Schema.String, Schema.Null]),
2044
+ ),
2045
+ settings: Schema.optional(
2046
+ Schema.Union([
2047
+ Schema.Struct({
2048
+ batchSize: Schema.optional(
2049
+ Schema.Union([Schema.Number, Schema.Null]),
2050
+ ),
2051
+ maxRetries: Schema.optional(
2052
+ Schema.Union([Schema.Number, Schema.Null]),
2053
+ ),
2054
+ retryDelay: Schema.optional(
2055
+ Schema.Union([Schema.Number, Schema.Null]),
2056
+ ),
2057
+ visibilityTimeoutMs: Schema.optional(
2058
+ Schema.Union([Schema.Number, Schema.Null]),
2059
+ ),
2060
+ }).pipe(
2061
+ Schema.encodeKeys({
2062
+ batchSize: "batch_size",
2063
+ maxRetries: "max_retries",
2064
+ retryDelay: "retry_delay",
2065
+ visibilityTimeoutMs: "visibility_timeout_ms",
2066
+ }),
2067
+ ),
2068
+ Schema.Null,
2069
+ ]),
2070
+ ),
2071
+ type: Schema.optional(
2072
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2073
+ ),
2074
+ }).pipe(
2075
+ Schema.encodeKeys({
2076
+ consumerId: "consumer_id",
2077
+ createdOn: "created_on",
2078
+ queueId: "queue_id",
2079
+ settings: "settings",
2080
+ type: "type",
2081
+ }),
2082
+ ),
2083
+ ]),
2084
+ ),
2085
+ Schema.Null,
2086
+ ]),
2087
+ ),
2088
+ consumersTotalCount: Schema.optional(
2089
+ Schema.Union([Schema.Number, Schema.Null]),
2090
+ ),
2091
+ createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2092
+ modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2093
+ producers: Schema.optional(
2094
+ Schema.Union([
2095
+ Schema.Array(
2096
+ Schema.Union([
2097
+ Schema.Struct({
2098
+ script: Schema.optional(
2099
+ Schema.Union([Schema.String, Schema.Null]),
2100
+ ),
2101
+ type: Schema.optional(
2102
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2103
+ ),
2104
+ }),
2105
+ Schema.Struct({
2106
+ bucketName: Schema.optional(
2107
+ Schema.Union([Schema.String, Schema.Null]),
2108
+ ),
2109
+ type: Schema.optional(
2110
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2111
+ ),
2112
+ }).pipe(
2113
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2114
+ ),
2115
+ ]),
2116
+ ),
2117
+ Schema.Null,
2118
+ ]),
2119
+ ),
2120
+ producersTotalCount: Schema.optional(
2121
+ Schema.Union([Schema.Number, Schema.Null]),
2122
+ ),
2123
+ queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2124
+ queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2125
+ settings: Schema.optional(
2126
+ Schema.Union([
2127
+ Schema.Struct({
2128
+ deliveryDelay: Schema.optional(
2129
+ Schema.Union([Schema.Number, Schema.Null]),
2130
+ ),
2131
+ deliveryPaused: Schema.optional(
2132
+ Schema.Union([Schema.Boolean, Schema.Null]),
2133
+ ),
2134
+ messageRetentionPeriod: Schema.optional(
2135
+ Schema.Union([Schema.Number, Schema.Null]),
2136
+ ),
2137
+ }).pipe(
2138
+ Schema.encodeKeys({
2139
+ deliveryDelay: "delivery_delay",
2140
+ deliveryPaused: "delivery_paused",
2141
+ messageRetentionPeriod: "message_retention_period",
2142
+ }),
2143
+ ),
2144
+ Schema.Null,
2145
+ ]),
2146
+ ),
2147
+ }).pipe(
2148
+ Schema.encodeKeys({
2149
+ consumers: "consumers",
2150
+ consumersTotalCount: "consumers_total_count",
2151
+ createdOn: "created_on",
2152
+ modifiedOn: "modified_on",
2153
+ producers: "producers",
2154
+ producersTotalCount: "producers_total_count",
2155
+ queueId: "queue_id",
2156
+ queueName: "queue_name",
2157
+ settings: "settings",
2158
+ }),
2159
+ ),
2160
+ ),
944
2161
  }) as unknown as Schema.Schema<ListQueuesResponse>;
945
2162
 
946
- export type ListQueuesError =
947
- | DefaultErrors
948
- | InvalidRoute;
2163
+ export type ListQueuesError = DefaultErrors | InvalidRoute;
949
2164
 
950
2165
  export const listQueues: API.PaginatedOperationMethod<
951
2166
  ListQueuesRequest,
@@ -971,67 +2186,248 @@ export interface CreateQueueRequest {
971
2186
 
972
2187
  export const CreateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
973
2188
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
974
- queueName: Schema.String
975
- })
976
- .pipe(Schema.encodeKeys({ queueName: "queue_name" }), T.Http({ method: "POST", path: "/accounts/{account_id}/queues" })) as unknown as Schema.Schema<CreateQueueRequest>;
2189
+ queueName: Schema.String,
2190
+ }).pipe(
2191
+ Schema.encodeKeys({ queueName: "queue_name" }),
2192
+ T.Http({ method: "POST", path: "/accounts/{account_id}/queues" }),
2193
+ ) as unknown as Schema.Schema<CreateQueueRequest>;
977
2194
 
978
2195
  export interface CreateQueueResponse {
979
- consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
2196
+ consumers?:
2197
+ | (
2198
+ | {
2199
+ consumerId?: string | null;
2200
+ createdOn?: string | null;
2201
+ queueId?: string | null;
2202
+ script?: string | null;
2203
+ settings?: {
2204
+ batchSize?: number | null;
2205
+ maxConcurrency?: number | null;
2206
+ maxRetries?: number | null;
2207
+ maxWaitTimeMs?: number | null;
2208
+ retryDelay?: number | null;
2209
+ } | null;
2210
+ type?: "worker" | null;
2211
+ }
2212
+ | {
2213
+ consumerId?: string | null;
2214
+ createdOn?: string | null;
2215
+ queueId?: string | null;
2216
+ settings?: {
2217
+ batchSize?: number | null;
2218
+ maxRetries?: number | null;
2219
+ retryDelay?: number | null;
2220
+ visibilityTimeoutMs?: number | null;
2221
+ } | null;
2222
+ type?: "http_pull" | null;
2223
+ }
2224
+ )[]
2225
+ | null;
980
2226
  consumersTotalCount?: number | null;
981
2227
  createdOn?: string | null;
982
2228
  modifiedOn?: string | null;
983
- producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
2229
+ producers?:
2230
+ | (
2231
+ | { script?: string | null; type?: "worker" | null }
2232
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
2233
+ )[]
2234
+ | null;
984
2235
  producersTotalCount?: number | null;
985
2236
  queueId?: string | null;
986
2237
  queueName?: string | null;
987
- settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
2238
+ settings?: {
2239
+ deliveryDelay?: number | null;
2240
+ deliveryPaused?: boolean | null;
2241
+ messageRetentionPeriod?: number | null;
2242
+ } | null;
988
2243
  }
989
2244
 
990
2245
  export const CreateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
991
- consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
992
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
993
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
994
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
995
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
996
- settings: Schema.optional(Schema.Union([Schema.Struct({
997
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
998
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
999
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1000
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1001
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1002
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
1003
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1004
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
1005
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1006
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1007
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1008
- settings: Schema.optional(Schema.Union([Schema.Struct({
1009
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1010
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1011
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1012
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1013
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
1014
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
1015
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
1016
- consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2246
+ consumers: Schema.optional(
2247
+ Schema.Union([
2248
+ Schema.Array(
2249
+ Schema.Union([
2250
+ Schema.Struct({
2251
+ consumerId: Schema.optional(
2252
+ Schema.Union([Schema.String, Schema.Null]),
2253
+ ),
2254
+ createdOn: Schema.optional(
2255
+ Schema.Union([Schema.String, Schema.Null]),
2256
+ ),
2257
+ queueId: Schema.optional(
2258
+ Schema.Union([Schema.String, Schema.Null]),
2259
+ ),
2260
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2261
+ settings: Schema.optional(
2262
+ Schema.Union([
2263
+ Schema.Struct({
2264
+ batchSize: Schema.optional(
2265
+ Schema.Union([Schema.Number, Schema.Null]),
2266
+ ),
2267
+ maxConcurrency: Schema.optional(
2268
+ Schema.Union([Schema.Number, Schema.Null]),
2269
+ ),
2270
+ maxRetries: Schema.optional(
2271
+ Schema.Union([Schema.Number, Schema.Null]),
2272
+ ),
2273
+ maxWaitTimeMs: Schema.optional(
2274
+ Schema.Union([Schema.Number, Schema.Null]),
2275
+ ),
2276
+ retryDelay: Schema.optional(
2277
+ Schema.Union([Schema.Number, Schema.Null]),
2278
+ ),
2279
+ }).pipe(
2280
+ Schema.encodeKeys({
2281
+ batchSize: "batch_size",
2282
+ maxConcurrency: "max_concurrency",
2283
+ maxRetries: "max_retries",
2284
+ maxWaitTimeMs: "max_wait_time_ms",
2285
+ retryDelay: "retry_delay",
2286
+ }),
2287
+ ),
2288
+ Schema.Null,
2289
+ ]),
2290
+ ),
2291
+ type: Schema.optional(
2292
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2293
+ ),
2294
+ }).pipe(
2295
+ Schema.encodeKeys({
2296
+ consumerId: "consumer_id",
2297
+ createdOn: "created_on",
2298
+ queueId: "queue_id",
2299
+ script: "script",
2300
+ settings: "settings",
2301
+ type: "type",
2302
+ }),
2303
+ ),
2304
+ Schema.Struct({
2305
+ consumerId: Schema.optional(
2306
+ Schema.Union([Schema.String, Schema.Null]),
2307
+ ),
2308
+ createdOn: Schema.optional(
2309
+ Schema.Union([Schema.String, Schema.Null]),
2310
+ ),
2311
+ queueId: Schema.optional(
2312
+ Schema.Union([Schema.String, Schema.Null]),
2313
+ ),
2314
+ settings: Schema.optional(
2315
+ Schema.Union([
2316
+ Schema.Struct({
2317
+ batchSize: Schema.optional(
2318
+ Schema.Union([Schema.Number, Schema.Null]),
2319
+ ),
2320
+ maxRetries: Schema.optional(
2321
+ Schema.Union([Schema.Number, Schema.Null]),
2322
+ ),
2323
+ retryDelay: Schema.optional(
2324
+ Schema.Union([Schema.Number, Schema.Null]),
2325
+ ),
2326
+ visibilityTimeoutMs: Schema.optional(
2327
+ Schema.Union([Schema.Number, Schema.Null]),
2328
+ ),
2329
+ }).pipe(
2330
+ Schema.encodeKeys({
2331
+ batchSize: "batch_size",
2332
+ maxRetries: "max_retries",
2333
+ retryDelay: "retry_delay",
2334
+ visibilityTimeoutMs: "visibility_timeout_ms",
2335
+ }),
2336
+ ),
2337
+ Schema.Null,
2338
+ ]),
2339
+ ),
2340
+ type: Schema.optional(
2341
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2342
+ ),
2343
+ }).pipe(
2344
+ Schema.encodeKeys({
2345
+ consumerId: "consumer_id",
2346
+ createdOn: "created_on",
2347
+ queueId: "queue_id",
2348
+ settings: "settings",
2349
+ type: "type",
2350
+ }),
2351
+ ),
2352
+ ]),
2353
+ ),
2354
+ Schema.Null,
2355
+ ]),
2356
+ ),
2357
+ consumersTotalCount: Schema.optional(
2358
+ Schema.Union([Schema.Number, Schema.Null]),
2359
+ ),
1017
2360
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1018
2361
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1019
- producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1020
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1021
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1022
- }), Schema.Struct({
1023
- bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1024
- type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
1025
- }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
1026
- producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2362
+ producers: Schema.optional(
2363
+ Schema.Union([
2364
+ Schema.Array(
2365
+ Schema.Union([
2366
+ Schema.Struct({
2367
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2368
+ type: Schema.optional(
2369
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2370
+ ),
2371
+ }),
2372
+ Schema.Struct({
2373
+ bucketName: Schema.optional(
2374
+ Schema.Union([Schema.String, Schema.Null]),
2375
+ ),
2376
+ type: Schema.optional(
2377
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2378
+ ),
2379
+ }).pipe(
2380
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2381
+ ),
2382
+ ]),
2383
+ ),
2384
+ Schema.Null,
2385
+ ]),
2386
+ ),
2387
+ producersTotalCount: Schema.optional(
2388
+ Schema.Union([Schema.Number, Schema.Null]),
2389
+ ),
1027
2390
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1028
2391
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1029
- settings: Schema.optional(Schema.Union([Schema.Struct({
1030
- deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1031
- deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1032
- messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1033
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
1034
- }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<CreateQueueResponse>;
2392
+ settings: Schema.optional(
2393
+ Schema.Union([
2394
+ Schema.Struct({
2395
+ deliveryDelay: Schema.optional(
2396
+ Schema.Union([Schema.Number, Schema.Null]),
2397
+ ),
2398
+ deliveryPaused: Schema.optional(
2399
+ Schema.Union([Schema.Boolean, Schema.Null]),
2400
+ ),
2401
+ messageRetentionPeriod: Schema.optional(
2402
+ Schema.Union([Schema.Number, Schema.Null]),
2403
+ ),
2404
+ }).pipe(
2405
+ Schema.encodeKeys({
2406
+ deliveryDelay: "delivery_delay",
2407
+ deliveryPaused: "delivery_paused",
2408
+ messageRetentionPeriod: "message_retention_period",
2409
+ }),
2410
+ ),
2411
+ Schema.Null,
2412
+ ]),
2413
+ ),
2414
+ })
2415
+ .pipe(
2416
+ Schema.encodeKeys({
2417
+ consumers: "consumers",
2418
+ consumersTotalCount: "consumers_total_count",
2419
+ createdOn: "created_on",
2420
+ modifiedOn: "modified_on",
2421
+ producers: "producers",
2422
+ producersTotalCount: "producers_total_count",
2423
+ queueId: "queue_id",
2424
+ queueName: "queue_name",
2425
+ settings: "settings",
2426
+ }),
2427
+ )
2428
+ .pipe(
2429
+ T.ResponsePath("result"),
2430
+ ) as unknown as Schema.Schema<CreateQueueResponse>;
1035
2431
 
1036
2432
  export type CreateQueueError =
1037
2433
  | DefaultErrors
@@ -1057,78 +2453,271 @@ export interface UpdateQueueRequest {
1057
2453
  /** Body param: */
1058
2454
  queueName?: string;
1059
2455
  /** Body param: */
1060
- settings?: { deliveryDelay?: number; deliveryPaused?: boolean; messageRetentionPeriod?: number };
2456
+ settings?: {
2457
+ deliveryDelay?: number;
2458
+ deliveryPaused?: boolean;
2459
+ messageRetentionPeriod?: number;
2460
+ };
1061
2461
  }
1062
2462
 
1063
2463
  export const UpdateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1064
2464
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1065
2465
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
1066
2466
  queueName: Schema.optional(Schema.String),
1067
- settings: Schema.optional(Schema.Struct({
1068
- deliveryDelay: Schema.optional(Schema.Number),
1069
- deliveryPaused: Schema.optional(Schema.Boolean),
1070
- messageRetentionPeriod: Schema.optional(Schema.Number)
1071
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })))
1072
- })
1073
- .pipe(Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }), T.Http({ method: "PUT", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<UpdateQueueRequest>;
2467
+ settings: Schema.optional(
2468
+ Schema.Struct({
2469
+ deliveryDelay: Schema.optional(Schema.Number),
2470
+ deliveryPaused: Schema.optional(Schema.Boolean),
2471
+ messageRetentionPeriod: Schema.optional(Schema.Number),
2472
+ }).pipe(
2473
+ Schema.encodeKeys({
2474
+ deliveryDelay: "delivery_delay",
2475
+ deliveryPaused: "delivery_paused",
2476
+ messageRetentionPeriod: "message_retention_period",
2477
+ }),
2478
+ ),
2479
+ ),
2480
+ }).pipe(
2481
+ Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }),
2482
+ T.Http({ method: "PUT", path: "/accounts/{account_id}/queues/{queueId}" }),
2483
+ ) as unknown as Schema.Schema<UpdateQueueRequest>;
1074
2484
 
1075
2485
  export interface UpdateQueueResponse {
1076
- consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
2486
+ consumers?:
2487
+ | (
2488
+ | {
2489
+ consumerId?: string | null;
2490
+ createdOn?: string | null;
2491
+ queueId?: string | null;
2492
+ script?: string | null;
2493
+ settings?: {
2494
+ batchSize?: number | null;
2495
+ maxConcurrency?: number | null;
2496
+ maxRetries?: number | null;
2497
+ maxWaitTimeMs?: number | null;
2498
+ retryDelay?: number | null;
2499
+ } | null;
2500
+ type?: "worker" | null;
2501
+ }
2502
+ | {
2503
+ consumerId?: string | null;
2504
+ createdOn?: string | null;
2505
+ queueId?: string | null;
2506
+ settings?: {
2507
+ batchSize?: number | null;
2508
+ maxRetries?: number | null;
2509
+ retryDelay?: number | null;
2510
+ visibilityTimeoutMs?: number | null;
2511
+ } | null;
2512
+ type?: "http_pull" | null;
2513
+ }
2514
+ )[]
2515
+ | null;
1077
2516
  consumersTotalCount?: number | null;
1078
2517
  createdOn?: string | null;
1079
2518
  modifiedOn?: string | null;
1080
- producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
2519
+ producers?:
2520
+ | (
2521
+ | { script?: string | null; type?: "worker" | null }
2522
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
2523
+ )[]
2524
+ | null;
1081
2525
  producersTotalCount?: number | null;
1082
2526
  queueId?: string | null;
1083
2527
  queueName?: string | null;
1084
- settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
2528
+ settings?: {
2529
+ deliveryDelay?: number | null;
2530
+ deliveryPaused?: boolean | null;
2531
+ messageRetentionPeriod?: number | null;
2532
+ } | null;
1085
2533
  }
1086
2534
 
1087
2535
  export const UpdateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1088
- consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1089
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1090
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1091
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1092
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1093
- settings: Schema.optional(Schema.Union([Schema.Struct({
1094
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1095
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1096
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1097
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1098
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1099
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
1100
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1101
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
1102
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1103
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1104
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1105
- settings: Schema.optional(Schema.Union([Schema.Struct({
1106
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1107
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1108
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1109
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1110
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
1111
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
1112
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
1113
- consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2536
+ consumers: Schema.optional(
2537
+ Schema.Union([
2538
+ Schema.Array(
2539
+ Schema.Union([
2540
+ Schema.Struct({
2541
+ consumerId: Schema.optional(
2542
+ Schema.Union([Schema.String, Schema.Null]),
2543
+ ),
2544
+ createdOn: Schema.optional(
2545
+ Schema.Union([Schema.String, Schema.Null]),
2546
+ ),
2547
+ queueId: Schema.optional(
2548
+ Schema.Union([Schema.String, Schema.Null]),
2549
+ ),
2550
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2551
+ settings: Schema.optional(
2552
+ Schema.Union([
2553
+ Schema.Struct({
2554
+ batchSize: Schema.optional(
2555
+ Schema.Union([Schema.Number, Schema.Null]),
2556
+ ),
2557
+ maxConcurrency: Schema.optional(
2558
+ Schema.Union([Schema.Number, Schema.Null]),
2559
+ ),
2560
+ maxRetries: Schema.optional(
2561
+ Schema.Union([Schema.Number, Schema.Null]),
2562
+ ),
2563
+ maxWaitTimeMs: Schema.optional(
2564
+ Schema.Union([Schema.Number, Schema.Null]),
2565
+ ),
2566
+ retryDelay: Schema.optional(
2567
+ Schema.Union([Schema.Number, Schema.Null]),
2568
+ ),
2569
+ }).pipe(
2570
+ Schema.encodeKeys({
2571
+ batchSize: "batch_size",
2572
+ maxConcurrency: "max_concurrency",
2573
+ maxRetries: "max_retries",
2574
+ maxWaitTimeMs: "max_wait_time_ms",
2575
+ retryDelay: "retry_delay",
2576
+ }),
2577
+ ),
2578
+ Schema.Null,
2579
+ ]),
2580
+ ),
2581
+ type: Schema.optional(
2582
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2583
+ ),
2584
+ }).pipe(
2585
+ Schema.encodeKeys({
2586
+ consumerId: "consumer_id",
2587
+ createdOn: "created_on",
2588
+ queueId: "queue_id",
2589
+ script: "script",
2590
+ settings: "settings",
2591
+ type: "type",
2592
+ }),
2593
+ ),
2594
+ Schema.Struct({
2595
+ consumerId: Schema.optional(
2596
+ Schema.Union([Schema.String, Schema.Null]),
2597
+ ),
2598
+ createdOn: Schema.optional(
2599
+ Schema.Union([Schema.String, Schema.Null]),
2600
+ ),
2601
+ queueId: Schema.optional(
2602
+ Schema.Union([Schema.String, Schema.Null]),
2603
+ ),
2604
+ settings: Schema.optional(
2605
+ Schema.Union([
2606
+ Schema.Struct({
2607
+ batchSize: Schema.optional(
2608
+ Schema.Union([Schema.Number, Schema.Null]),
2609
+ ),
2610
+ maxRetries: Schema.optional(
2611
+ Schema.Union([Schema.Number, Schema.Null]),
2612
+ ),
2613
+ retryDelay: Schema.optional(
2614
+ Schema.Union([Schema.Number, Schema.Null]),
2615
+ ),
2616
+ visibilityTimeoutMs: Schema.optional(
2617
+ Schema.Union([Schema.Number, Schema.Null]),
2618
+ ),
2619
+ }).pipe(
2620
+ Schema.encodeKeys({
2621
+ batchSize: "batch_size",
2622
+ maxRetries: "max_retries",
2623
+ retryDelay: "retry_delay",
2624
+ visibilityTimeoutMs: "visibility_timeout_ms",
2625
+ }),
2626
+ ),
2627
+ Schema.Null,
2628
+ ]),
2629
+ ),
2630
+ type: Schema.optional(
2631
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2632
+ ),
2633
+ }).pipe(
2634
+ Schema.encodeKeys({
2635
+ consumerId: "consumer_id",
2636
+ createdOn: "created_on",
2637
+ queueId: "queue_id",
2638
+ settings: "settings",
2639
+ type: "type",
2640
+ }),
2641
+ ),
2642
+ ]),
2643
+ ),
2644
+ Schema.Null,
2645
+ ]),
2646
+ ),
2647
+ consumersTotalCount: Schema.optional(
2648
+ Schema.Union([Schema.Number, Schema.Null]),
2649
+ ),
1114
2650
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1115
2651
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1116
- producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1117
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1118
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1119
- }), Schema.Struct({
1120
- bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1121
- type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
1122
- }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
1123
- producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2652
+ producers: Schema.optional(
2653
+ Schema.Union([
2654
+ Schema.Array(
2655
+ Schema.Union([
2656
+ Schema.Struct({
2657
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2658
+ type: Schema.optional(
2659
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2660
+ ),
2661
+ }),
2662
+ Schema.Struct({
2663
+ bucketName: Schema.optional(
2664
+ Schema.Union([Schema.String, Schema.Null]),
2665
+ ),
2666
+ type: Schema.optional(
2667
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2668
+ ),
2669
+ }).pipe(
2670
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2671
+ ),
2672
+ ]),
2673
+ ),
2674
+ Schema.Null,
2675
+ ]),
2676
+ ),
2677
+ producersTotalCount: Schema.optional(
2678
+ Schema.Union([Schema.Number, Schema.Null]),
2679
+ ),
1124
2680
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1125
2681
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1126
- settings: Schema.optional(Schema.Union([Schema.Struct({
1127
- deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1128
- deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1129
- messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1130
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
1131
- }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<UpdateQueueResponse>;
2682
+ settings: Schema.optional(
2683
+ Schema.Union([
2684
+ Schema.Struct({
2685
+ deliveryDelay: Schema.optional(
2686
+ Schema.Union([Schema.Number, Schema.Null]),
2687
+ ),
2688
+ deliveryPaused: Schema.optional(
2689
+ Schema.Union([Schema.Boolean, Schema.Null]),
2690
+ ),
2691
+ messageRetentionPeriod: Schema.optional(
2692
+ Schema.Union([Schema.Number, Schema.Null]),
2693
+ ),
2694
+ }).pipe(
2695
+ Schema.encodeKeys({
2696
+ deliveryDelay: "delivery_delay",
2697
+ deliveryPaused: "delivery_paused",
2698
+ messageRetentionPeriod: "message_retention_period",
2699
+ }),
2700
+ ),
2701
+ Schema.Null,
2702
+ ]),
2703
+ ),
2704
+ })
2705
+ .pipe(
2706
+ Schema.encodeKeys({
2707
+ consumers: "consumers",
2708
+ consumersTotalCount: "consumers_total_count",
2709
+ createdOn: "created_on",
2710
+ modifiedOn: "modified_on",
2711
+ producers: "producers",
2712
+ producersTotalCount: "producers_total_count",
2713
+ queueId: "queue_id",
2714
+ queueName: "queue_name",
2715
+ settings: "settings",
2716
+ }),
2717
+ )
2718
+ .pipe(
2719
+ T.ResponsePath("result"),
2720
+ ) as unknown as Schema.Schema<UpdateQueueResponse>;
1132
2721
 
1133
2722
  export type UpdateQueueError =
1134
2723
  | DefaultErrors
@@ -1154,83 +2743,273 @@ export interface PatchQueueRequest {
1154
2743
  /** Body param: */
1155
2744
  queueName?: string;
1156
2745
  /** Body param: */
1157
- settings?: { deliveryDelay?: number; deliveryPaused?: boolean; messageRetentionPeriod?: number };
2746
+ settings?: {
2747
+ deliveryDelay?: number;
2748
+ deliveryPaused?: boolean;
2749
+ messageRetentionPeriod?: number;
2750
+ };
1158
2751
  }
1159
2752
 
1160
2753
  export const PatchQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1161
2754
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1162
2755
  accountId: Schema.String.pipe(T.HttpPath("account_id")),
1163
2756
  queueName: Schema.optional(Schema.String),
1164
- settings: Schema.optional(Schema.Struct({
1165
- deliveryDelay: Schema.optional(Schema.Number),
1166
- deliveryPaused: Schema.optional(Schema.Boolean),
1167
- messageRetentionPeriod: Schema.optional(Schema.Number)
1168
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })))
1169
- })
1170
- .pipe(Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }), T.Http({ method: "PATCH", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<PatchQueueRequest>;
2757
+ settings: Schema.optional(
2758
+ Schema.Struct({
2759
+ deliveryDelay: Schema.optional(Schema.Number),
2760
+ deliveryPaused: Schema.optional(Schema.Boolean),
2761
+ messageRetentionPeriod: Schema.optional(Schema.Number),
2762
+ }).pipe(
2763
+ Schema.encodeKeys({
2764
+ deliveryDelay: "delivery_delay",
2765
+ deliveryPaused: "delivery_paused",
2766
+ messageRetentionPeriod: "message_retention_period",
2767
+ }),
2768
+ ),
2769
+ ),
2770
+ }).pipe(
2771
+ Schema.encodeKeys({ queueName: "queue_name", settings: "settings" }),
2772
+ T.Http({ method: "PATCH", path: "/accounts/{account_id}/queues/{queueId}" }),
2773
+ ) as unknown as Schema.Schema<PatchQueueRequest>;
1171
2774
 
1172
2775
  export interface PatchQueueResponse {
1173
- consumers?: ({ consumerId?: string | null; createdOn?: string | null; queueId?: string | null; script?: string | null; settings?: { batchSize?: number | null; maxConcurrency?: number | null; maxRetries?: number | null; maxWaitTimeMs?: number | null; retryDelay?: number | null } | null; type?: "worker" | null } | { consumerId?: string | null; createdOn?: string | null; queueId?: string | null; settings?: { batchSize?: number | null; maxRetries?: number | null; retryDelay?: number | null; visibilityTimeoutMs?: number | null } | null; type?: "http_pull" | null })[] | null;
2776
+ consumers?:
2777
+ | (
2778
+ | {
2779
+ consumerId?: string | null;
2780
+ createdOn?: string | null;
2781
+ queueId?: string | null;
2782
+ script?: string | null;
2783
+ settings?: {
2784
+ batchSize?: number | null;
2785
+ maxConcurrency?: number | null;
2786
+ maxRetries?: number | null;
2787
+ maxWaitTimeMs?: number | null;
2788
+ retryDelay?: number | null;
2789
+ } | null;
2790
+ type?: "worker" | null;
2791
+ }
2792
+ | {
2793
+ consumerId?: string | null;
2794
+ createdOn?: string | null;
2795
+ queueId?: string | null;
2796
+ settings?: {
2797
+ batchSize?: number | null;
2798
+ maxRetries?: number | null;
2799
+ retryDelay?: number | null;
2800
+ visibilityTimeoutMs?: number | null;
2801
+ } | null;
2802
+ type?: "http_pull" | null;
2803
+ }
2804
+ )[]
2805
+ | null;
1174
2806
  consumersTotalCount?: number | null;
1175
2807
  createdOn?: string | null;
1176
2808
  modifiedOn?: string | null;
1177
- producers?: ({ script?: string | null; type?: "worker" | null } | { bucketName?: string | null; type?: "r2_bucket" | null })[] | null;
2809
+ producers?:
2810
+ | (
2811
+ | { script?: string | null; type?: "worker" | null }
2812
+ | { bucketName?: string | null; type?: "r2_bucket" | null }
2813
+ )[]
2814
+ | null;
1178
2815
  producersTotalCount?: number | null;
1179
2816
  queueId?: string | null;
1180
2817
  queueName?: string | null;
1181
- settings?: { deliveryDelay?: number | null; deliveryPaused?: boolean | null; messageRetentionPeriod?: number | null } | null;
2818
+ settings?: {
2819
+ deliveryDelay?: number | null;
2820
+ deliveryPaused?: boolean | null;
2821
+ messageRetentionPeriod?: number | null;
2822
+ } | null;
1182
2823
  }
1183
2824
 
1184
2825
  export const PatchQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1185
- consumers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1186
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1187
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1188
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1189
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1190
- settings: Schema.optional(Schema.Union([Schema.Struct({
1191
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1192
- maxConcurrency: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1193
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1194
- maxWaitTimeMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1195
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1196
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxConcurrency: "max_concurrency", maxRetries: "max_retries", maxWaitTimeMs: "max_wait_time_ms", retryDelay: "retry_delay" })), Schema.Null])),
1197
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1198
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", script: "script", settings: "settings", type: "type" })), Schema.Struct({
1199
- consumerId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1200
- createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1201
- queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1202
- settings: Schema.optional(Schema.Union([Schema.Struct({
1203
- batchSize: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1204
- maxRetries: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1205
- retryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1206
- visibilityTimeoutMs: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1207
- }).pipe(Schema.encodeKeys({ batchSize: "batch_size", maxRetries: "max_retries", retryDelay: "retry_delay", visibilityTimeoutMs: "visibility_timeout_ms" })), Schema.Null])),
1208
- type: Schema.optional(Schema.Union([Schema.Literal("http_pull"), Schema.Null]))
1209
- }).pipe(Schema.encodeKeys({ consumerId: "consumer_id", createdOn: "created_on", queueId: "queue_id", settings: "settings", type: "type" }))])), Schema.Null])),
1210
- consumersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2826
+ consumers: Schema.optional(
2827
+ Schema.Union([
2828
+ Schema.Array(
2829
+ Schema.Union([
2830
+ Schema.Struct({
2831
+ consumerId: Schema.optional(
2832
+ Schema.Union([Schema.String, Schema.Null]),
2833
+ ),
2834
+ createdOn: Schema.optional(
2835
+ Schema.Union([Schema.String, Schema.Null]),
2836
+ ),
2837
+ queueId: Schema.optional(
2838
+ Schema.Union([Schema.String, Schema.Null]),
2839
+ ),
2840
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2841
+ settings: Schema.optional(
2842
+ Schema.Union([
2843
+ Schema.Struct({
2844
+ batchSize: Schema.optional(
2845
+ Schema.Union([Schema.Number, Schema.Null]),
2846
+ ),
2847
+ maxConcurrency: Schema.optional(
2848
+ Schema.Union([Schema.Number, Schema.Null]),
2849
+ ),
2850
+ maxRetries: Schema.optional(
2851
+ Schema.Union([Schema.Number, Schema.Null]),
2852
+ ),
2853
+ maxWaitTimeMs: Schema.optional(
2854
+ Schema.Union([Schema.Number, Schema.Null]),
2855
+ ),
2856
+ retryDelay: Schema.optional(
2857
+ Schema.Union([Schema.Number, Schema.Null]),
2858
+ ),
2859
+ }).pipe(
2860
+ Schema.encodeKeys({
2861
+ batchSize: "batch_size",
2862
+ maxConcurrency: "max_concurrency",
2863
+ maxRetries: "max_retries",
2864
+ maxWaitTimeMs: "max_wait_time_ms",
2865
+ retryDelay: "retry_delay",
2866
+ }),
2867
+ ),
2868
+ Schema.Null,
2869
+ ]),
2870
+ ),
2871
+ type: Schema.optional(
2872
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2873
+ ),
2874
+ }).pipe(
2875
+ Schema.encodeKeys({
2876
+ consumerId: "consumer_id",
2877
+ createdOn: "created_on",
2878
+ queueId: "queue_id",
2879
+ script: "script",
2880
+ settings: "settings",
2881
+ type: "type",
2882
+ }),
2883
+ ),
2884
+ Schema.Struct({
2885
+ consumerId: Schema.optional(
2886
+ Schema.Union([Schema.String, Schema.Null]),
2887
+ ),
2888
+ createdOn: Schema.optional(
2889
+ Schema.Union([Schema.String, Schema.Null]),
2890
+ ),
2891
+ queueId: Schema.optional(
2892
+ Schema.Union([Schema.String, Schema.Null]),
2893
+ ),
2894
+ settings: Schema.optional(
2895
+ Schema.Union([
2896
+ Schema.Struct({
2897
+ batchSize: Schema.optional(
2898
+ Schema.Union([Schema.Number, Schema.Null]),
2899
+ ),
2900
+ maxRetries: Schema.optional(
2901
+ Schema.Union([Schema.Number, Schema.Null]),
2902
+ ),
2903
+ retryDelay: Schema.optional(
2904
+ Schema.Union([Schema.Number, Schema.Null]),
2905
+ ),
2906
+ visibilityTimeoutMs: Schema.optional(
2907
+ Schema.Union([Schema.Number, Schema.Null]),
2908
+ ),
2909
+ }).pipe(
2910
+ Schema.encodeKeys({
2911
+ batchSize: "batch_size",
2912
+ maxRetries: "max_retries",
2913
+ retryDelay: "retry_delay",
2914
+ visibilityTimeoutMs: "visibility_timeout_ms",
2915
+ }),
2916
+ ),
2917
+ Schema.Null,
2918
+ ]),
2919
+ ),
2920
+ type: Schema.optional(
2921
+ Schema.Union([Schema.Literal("http_pull"), Schema.Null]),
2922
+ ),
2923
+ }).pipe(
2924
+ Schema.encodeKeys({
2925
+ consumerId: "consumer_id",
2926
+ createdOn: "created_on",
2927
+ queueId: "queue_id",
2928
+ settings: "settings",
2929
+ type: "type",
2930
+ }),
2931
+ ),
2932
+ ]),
2933
+ ),
2934
+ Schema.Null,
2935
+ ]),
2936
+ ),
2937
+ consumersTotalCount: Schema.optional(
2938
+ Schema.Union([Schema.Number, Schema.Null]),
2939
+ ),
1211
2940
  createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1212
2941
  modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1213
- producers: Schema.optional(Schema.Union([Schema.Array(Schema.Union([Schema.Struct({
1214
- script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1215
- type: Schema.optional(Schema.Union([Schema.Literal("worker"), Schema.Null]))
1216
- }), Schema.Struct({
1217
- bucketName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1218
- type: Schema.optional(Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]))
1219
- }).pipe(Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }))])), Schema.Null])),
1220
- producersTotalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
2942
+ producers: Schema.optional(
2943
+ Schema.Union([
2944
+ Schema.Array(
2945
+ Schema.Union([
2946
+ Schema.Struct({
2947
+ script: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
2948
+ type: Schema.optional(
2949
+ Schema.Union([Schema.Literal("worker"), Schema.Null]),
2950
+ ),
2951
+ }),
2952
+ Schema.Struct({
2953
+ bucketName: Schema.optional(
2954
+ Schema.Union([Schema.String, Schema.Null]),
2955
+ ),
2956
+ type: Schema.optional(
2957
+ Schema.Union([Schema.Literal("r2_bucket"), Schema.Null]),
2958
+ ),
2959
+ }).pipe(
2960
+ Schema.encodeKeys({ bucketName: "bucket_name", type: "type" }),
2961
+ ),
2962
+ ]),
2963
+ ),
2964
+ Schema.Null,
2965
+ ]),
2966
+ ),
2967
+ producersTotalCount: Schema.optional(
2968
+ Schema.Union([Schema.Number, Schema.Null]),
2969
+ ),
1221
2970
  queueId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1222
2971
  queueName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1223
- settings: Schema.optional(Schema.Union([Schema.Struct({
1224
- deliveryDelay: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1225
- deliveryPaused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
1226
- messageRetentionPeriod: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1227
- }).pipe(Schema.encodeKeys({ deliveryDelay: "delivery_delay", deliveryPaused: "delivery_paused", messageRetentionPeriod: "message_retention_period" })), Schema.Null]))
1228
- }).pipe(Schema.encodeKeys({ consumers: "consumers", consumersTotalCount: "consumers_total_count", createdOn: "created_on", modifiedOn: "modified_on", producers: "producers", producersTotalCount: "producers_total_count", queueId: "queue_id", queueName: "queue_name", settings: "settings" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<PatchQueueResponse>;
1229
-
1230
- export type PatchQueueError =
1231
- | DefaultErrors
1232
- | QueueNotFound
1233
- | InvalidRoute;
2972
+ settings: Schema.optional(
2973
+ Schema.Union([
2974
+ Schema.Struct({
2975
+ deliveryDelay: Schema.optional(
2976
+ Schema.Union([Schema.Number, Schema.Null]),
2977
+ ),
2978
+ deliveryPaused: Schema.optional(
2979
+ Schema.Union([Schema.Boolean, Schema.Null]),
2980
+ ),
2981
+ messageRetentionPeriod: Schema.optional(
2982
+ Schema.Union([Schema.Number, Schema.Null]),
2983
+ ),
2984
+ }).pipe(
2985
+ Schema.encodeKeys({
2986
+ deliveryDelay: "delivery_delay",
2987
+ deliveryPaused: "delivery_paused",
2988
+ messageRetentionPeriod: "message_retention_period",
2989
+ }),
2990
+ ),
2991
+ Schema.Null,
2992
+ ]),
2993
+ ),
2994
+ })
2995
+ .pipe(
2996
+ Schema.encodeKeys({
2997
+ consumers: "consumers",
2998
+ consumersTotalCount: "consumers_total_count",
2999
+ createdOn: "created_on",
3000
+ modifiedOn: "modified_on",
3001
+ producers: "producers",
3002
+ producersTotalCount: "producers_total_count",
3003
+ queueId: "queue_id",
3004
+ queueName: "queue_name",
3005
+ settings: "settings",
3006
+ }),
3007
+ )
3008
+ .pipe(
3009
+ T.ResponsePath("result"),
3010
+ ) as unknown as Schema.Schema<PatchQueueResponse>;
3011
+
3012
+ export type PatchQueueError = DefaultErrors | QueueNotFound | InvalidRoute;
1234
3013
 
1235
3014
  export const patchQueue: API.OperationMethod<
1236
3015
  PatchQueueRequest,
@@ -1251,34 +3030,64 @@ export interface DeleteQueueRequest {
1251
3030
 
1252
3031
  export const DeleteQueueRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1253
3032
  queueId: Schema.String.pipe(T.HttpPath("queueId")),
1254
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
1255
- })
1256
- .pipe(T.Http({ method: "DELETE", path: "/accounts/{account_id}/queues/{queueId}" })) as unknown as Schema.Schema<DeleteQueueRequest>;
3033
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3034
+ }).pipe(
3035
+ T.Http({ method: "DELETE", path: "/accounts/{account_id}/queues/{queueId}" }),
3036
+ ) as unknown as Schema.Schema<DeleteQueueRequest>;
1257
3037
 
1258
3038
  export interface DeleteQueueResponse {
1259
- errors?: ({ code: number; message: string; documentationUrl?: string | null; source?: { pointer?: string | null } | null })[] | null;
3039
+ errors?:
3040
+ | {
3041
+ code: number;
3042
+ message: string;
3043
+ documentationUrl?: string | null;
3044
+ source?: { pointer?: string | null } | null;
3045
+ }[]
3046
+ | null;
1260
3047
  messages?: string[] | null;
1261
3048
  /** Indicates if the API call was successful or not. */
1262
3049
  success?: true | null;
1263
3050
  }
1264
3051
 
1265
3052
  export const DeleteQueueResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1266
- errors: Schema.optional(Schema.Union([Schema.Array(Schema.Struct({
1267
- code: Schema.Number,
1268
- message: Schema.String,
1269
- documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1270
- source: Schema.optional(Schema.Union([Schema.Struct({
1271
- pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1272
- }), Schema.Null]))
1273
- }).pipe(Schema.encodeKeys({ code: "code", message: "message", documentationUrl: "documentation_url", source: "source" }))), Schema.Null])),
1274
- messages: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
1275
- success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null]))
3053
+ errors: Schema.optional(
3054
+ Schema.Union([
3055
+ Schema.Array(
3056
+ Schema.Struct({
3057
+ code: Schema.Number,
3058
+ message: Schema.String,
3059
+ documentationUrl: Schema.optional(
3060
+ Schema.Union([Schema.String, Schema.Null]),
3061
+ ),
3062
+ source: Schema.optional(
3063
+ Schema.Union([
3064
+ Schema.Struct({
3065
+ pointer: Schema.optional(
3066
+ Schema.Union([Schema.String, Schema.Null]),
3067
+ ),
3068
+ }),
3069
+ Schema.Null,
3070
+ ]),
3071
+ ),
3072
+ }).pipe(
3073
+ Schema.encodeKeys({
3074
+ code: "code",
3075
+ message: "message",
3076
+ documentationUrl: "documentation_url",
3077
+ source: "source",
3078
+ }),
3079
+ ),
3080
+ ),
3081
+ Schema.Null,
3082
+ ]),
3083
+ ),
3084
+ messages: Schema.optional(
3085
+ Schema.Union([Schema.Array(Schema.String), Schema.Null]),
3086
+ ),
3087
+ success: Schema.optional(Schema.Union([Schema.Literal(true), Schema.Null])),
1276
3088
  }) as unknown as Schema.Schema<DeleteQueueResponse>;
1277
3089
 
1278
- export type DeleteQueueError =
1279
- | DefaultErrors
1280
- | QueueNotFound
1281
- | InvalidRoute;
3090
+ export type DeleteQueueError = DefaultErrors | QueueNotFound | InvalidRoute;
1282
3091
 
1283
3092
  export const deleteQueue: API.OperationMethod<
1284
3093
  DeleteQueueRequest,
@@ -1291,7 +3100,6 @@ export const deleteQueue: API.OperationMethod<
1291
3100
  errors: [QueueNotFound, InvalidRoute],
1292
3101
  }));
1293
3102
 
1294
-
1295
3103
  // =============================================================================
1296
3104
  // Subscription
1297
3105
  // =============================================================================
@@ -1302,11 +3110,17 @@ export interface GetSubscriptionRequest {
1302
3110
  accountId: string;
1303
3111
  }
1304
3112
 
1305
- export const GetSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1306
- subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
1307
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
1308
- })
1309
- .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}" })) as unknown as Schema.Schema<GetSubscriptionRequest>;
3113
+ export const GetSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
3114
+ {
3115
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
3116
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3117
+ },
3118
+ ).pipe(
3119
+ T.Http({
3120
+ method: "GET",
3121
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
3122
+ }),
3123
+ ) as unknown as Schema.Schema<GetSubscriptionRequest>;
1310
3124
 
1311
3125
  export interface GetSubscriptionResponse {
1312
3126
  /** Unique identifier for the subscription */
@@ -1324,45 +3138,96 @@ export interface GetSubscriptionResponse {
1324
3138
  /** Name of the subscription */
1325
3139
  name: string;
1326
3140
  /** Source configuration for the subscription */
1327
- source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3141
+ source:
3142
+ | { type?: "images" | null }
3143
+ | { type?: "kv" | null }
3144
+ | { type?: "r2" | null }
3145
+ | { type?: "superSlurper" | null }
3146
+ | { type?: "vectorize" | null }
3147
+ | { modelName?: string | null; type?: "workersAi.model" | null }
3148
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3149
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
1328
3150
  }
1329
3151
 
1330
- export const GetSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1331
- id: Schema.String,
1332
- createdAt: Schema.String,
1333
- destination: Schema.Struct({
1334
- queueId: Schema.String,
1335
- type: Schema.Literal("queues.queue")
1336
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1337
- enabled: Schema.Boolean,
1338
- events: Schema.Array(Schema.String),
1339
- modifiedAt: Schema.String,
1340
- name: Schema.String,
1341
- source: Schema.Union([Schema.Struct({
1342
- type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1343
- }), Schema.Struct({
1344
- type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1345
- }), Schema.Struct({
1346
- type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1347
- }), Schema.Struct({
1348
- type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1349
- }), Schema.Struct({
1350
- type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1351
- }), Schema.Struct({
1352
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1353
- type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1354
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1355
- type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1356
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1357
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1358
- type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1359
- workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1360
- }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1361
- }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<GetSubscriptionResponse>;
1362
-
1363
- export type GetSubscriptionError =
1364
- | DefaultErrors
1365
- | UnrecognizedEventType;
3152
+ export const GetSubscriptionResponse =
3153
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3154
+ id: Schema.String,
3155
+ createdAt: Schema.String,
3156
+ destination: Schema.Struct({
3157
+ queueId: Schema.String,
3158
+ type: Schema.Literal("queues.queue"),
3159
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3160
+ enabled: Schema.Boolean,
3161
+ events: Schema.Array(Schema.String),
3162
+ modifiedAt: Schema.String,
3163
+ name: Schema.String,
3164
+ source: Schema.Union([
3165
+ Schema.Struct({
3166
+ type: Schema.optional(
3167
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
3168
+ ),
3169
+ }),
3170
+ Schema.Struct({
3171
+ type: Schema.optional(
3172
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
3173
+ ),
3174
+ }),
3175
+ Schema.Struct({
3176
+ type: Schema.optional(
3177
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
3178
+ ),
3179
+ }),
3180
+ Schema.Struct({
3181
+ type: Schema.optional(
3182
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3183
+ ),
3184
+ }),
3185
+ Schema.Struct({
3186
+ type: Schema.optional(
3187
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3188
+ ),
3189
+ }),
3190
+ Schema.Struct({
3191
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3192
+ type: Schema.optional(
3193
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3194
+ ),
3195
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3196
+ Schema.Struct({
3197
+ type: Schema.optional(
3198
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3199
+ ),
3200
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3201
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3202
+ Schema.Struct({
3203
+ type: Schema.optional(
3204
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3205
+ ),
3206
+ workflowName: Schema.optional(
3207
+ Schema.Union([Schema.String, Schema.Null]),
3208
+ ),
3209
+ }).pipe(
3210
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3211
+ ),
3212
+ ]),
3213
+ })
3214
+ .pipe(
3215
+ Schema.encodeKeys({
3216
+ id: "id",
3217
+ createdAt: "created_at",
3218
+ destination: "destination",
3219
+ enabled: "enabled",
3220
+ events: "events",
3221
+ modifiedAt: "modified_at",
3222
+ name: "name",
3223
+ source: "source",
3224
+ }),
3225
+ )
3226
+ .pipe(
3227
+ T.ResponsePath("result"),
3228
+ ) as unknown as Schema.Schema<GetSubscriptionResponse>;
3229
+
3230
+ export type GetSubscriptionError = DefaultErrors | UnrecognizedEventType;
1366
3231
 
1367
3232
  export const getSubscription: API.OperationMethod<
1368
3233
  GetSubscriptionRequest,
@@ -1384,61 +3249,152 @@ export interface ListSubscriptionsRequest {
1384
3249
  order?: "created_at" | "name" | "enabled" | "source";
1385
3250
  }
1386
3251
 
1387
- export const ListSubscriptionsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1388
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
1389
- direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
1390
- order: Schema.optional(Schema.Literals(["created_at", "name", "enabled", "source"])).pipe(T.HttpQuery("order"))
1391
- })
1392
- .pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/event_subscriptions/subscriptions" })) as unknown as Schema.Schema<ListSubscriptionsRequest>;
3252
+ export const ListSubscriptionsRequest =
3253
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3254
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3255
+ direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
3256
+ T.HttpQuery("direction"),
3257
+ ),
3258
+ order: Schema.optional(
3259
+ Schema.Literals(["created_at", "name", "enabled", "source"]),
3260
+ ).pipe(T.HttpQuery("order")),
3261
+ }).pipe(
3262
+ T.Http({
3263
+ method: "GET",
3264
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions",
3265
+ }),
3266
+ ) as unknown as Schema.Schema<ListSubscriptionsRequest>;
1393
3267
 
1394
3268
  export interface ListSubscriptionsResponse {
1395
- result: ({ id: string; createdAt: string; destination: { queueId: string; type: "queues.queue" }; enabled: boolean; events: string[]; modifiedAt: string; name: string; source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null } })[];
1396
- resultInfo: { count?: number | null; page?: number | null; perPage?: number | null; totalCount?: number | null };
3269
+ result: {
3270
+ id: string;
3271
+ createdAt: string;
3272
+ destination: { queueId: string; type: "queues.queue" };
3273
+ enabled: boolean;
3274
+ events: string[];
3275
+ modifiedAt: string;
3276
+ name: string;
3277
+ source:
3278
+ | { type?: "images" | null }
3279
+ | { type?: "kv" | null }
3280
+ | { type?: "r2" | null }
3281
+ | { type?: "superSlurper" | null }
3282
+ | { type?: "vectorize" | null }
3283
+ | { modelName?: string | null; type?: "workersAi.model" | null }
3284
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3285
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
3286
+ }[];
3287
+ resultInfo: {
3288
+ count?: number | null;
3289
+ page?: number | null;
3290
+ perPage?: number | null;
3291
+ totalCount?: number | null;
3292
+ };
1397
3293
  }
1398
3294
 
1399
- export const ListSubscriptionsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1400
- result: Schema.Array(Schema.Struct({
1401
- id: Schema.String,
1402
- createdAt: Schema.String,
1403
- destination: Schema.Struct({
1404
- queueId: Schema.String,
1405
- type: Schema.Literal("queues.queue")
1406
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1407
- enabled: Schema.Boolean,
1408
- events: Schema.Array(Schema.String),
1409
- modifiedAt: Schema.String,
1410
- name: Schema.String,
1411
- source: Schema.Union([Schema.Struct({
1412
- type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1413
- }), Schema.Struct({
1414
- type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1415
- }), Schema.Struct({
1416
- type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1417
- }), Schema.Struct({
1418
- type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1419
- }), Schema.Struct({
1420
- type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1421
- }), Schema.Struct({
1422
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1423
- type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1424
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1425
- type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1426
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1427
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1428
- type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1429
- workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1430
- }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1431
- }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" }))),
1432
- resultInfo: Schema.Struct({
1433
- count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1434
- page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1435
- perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
1436
- totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null]))
1437
- }).pipe(Schema.encodeKeys({ count: "count", page: "page", perPage: "per_page", totalCount: "total_count" }))
1438
- }).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" })) as unknown as Schema.Schema<ListSubscriptionsResponse>;
1439
-
1440
- export type ListSubscriptionsError =
1441
- | DefaultErrors;
3295
+ export const ListSubscriptionsResponse =
3296
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3297
+ result: Schema.Array(
3298
+ Schema.Struct({
3299
+ id: Schema.String,
3300
+ createdAt: Schema.String,
3301
+ destination: Schema.Struct({
3302
+ queueId: Schema.String,
3303
+ type: Schema.Literal("queues.queue"),
3304
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3305
+ enabled: Schema.Boolean,
3306
+ events: Schema.Array(Schema.String),
3307
+ modifiedAt: Schema.String,
3308
+ name: Schema.String,
3309
+ source: Schema.Union([
3310
+ Schema.Struct({
3311
+ type: Schema.optional(
3312
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
3313
+ ),
3314
+ }),
3315
+ Schema.Struct({
3316
+ type: Schema.optional(
3317
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
3318
+ ),
3319
+ }),
3320
+ Schema.Struct({
3321
+ type: Schema.optional(
3322
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
3323
+ ),
3324
+ }),
3325
+ Schema.Struct({
3326
+ type: Schema.optional(
3327
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3328
+ ),
3329
+ }),
3330
+ Schema.Struct({
3331
+ type: Schema.optional(
3332
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3333
+ ),
3334
+ }),
3335
+ Schema.Struct({
3336
+ modelName: Schema.optional(
3337
+ Schema.Union([Schema.String, Schema.Null]),
3338
+ ),
3339
+ type: Schema.optional(
3340
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3341
+ ),
3342
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3343
+ Schema.Struct({
3344
+ type: Schema.optional(
3345
+ Schema.Union([
3346
+ Schema.Literal("workersBuilds.worker"),
3347
+ Schema.Null,
3348
+ ]),
3349
+ ),
3350
+ workerName: Schema.optional(
3351
+ Schema.Union([Schema.String, Schema.Null]),
3352
+ ),
3353
+ }).pipe(
3354
+ Schema.encodeKeys({ type: "type", workerName: "worker_name" }),
3355
+ ),
3356
+ Schema.Struct({
3357
+ type: Schema.optional(
3358
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3359
+ ),
3360
+ workflowName: Schema.optional(
3361
+ Schema.Union([Schema.String, Schema.Null]),
3362
+ ),
3363
+ }).pipe(
3364
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3365
+ ),
3366
+ ]),
3367
+ }).pipe(
3368
+ Schema.encodeKeys({
3369
+ id: "id",
3370
+ createdAt: "created_at",
3371
+ destination: "destination",
3372
+ enabled: "enabled",
3373
+ events: "events",
3374
+ modifiedAt: "modified_at",
3375
+ name: "name",
3376
+ source: "source",
3377
+ }),
3378
+ ),
3379
+ ),
3380
+ resultInfo: Schema.Struct({
3381
+ count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3382
+ page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3383
+ perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3384
+ totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
3385
+ }).pipe(
3386
+ Schema.encodeKeys({
3387
+ count: "count",
3388
+ page: "page",
3389
+ perPage: "per_page",
3390
+ totalCount: "total_count",
3391
+ }),
3392
+ ),
3393
+ }).pipe(
3394
+ Schema.encodeKeys({ result: "result", resultInfo: "result_info" }),
3395
+ ) as unknown as Schema.Schema<ListSubscriptionsResponse>;
3396
+
3397
+ export type ListSubscriptionsError = DefaultErrors;
1442
3398
 
1443
3399
  export const listSubscriptions: API.PaginatedOperationMethod<
1444
3400
  ListSubscriptionsRequest,
@@ -1470,40 +3426,68 @@ export interface CreateSubscriptionRequest {
1470
3426
  /** Body param: Name of the subscription */
1471
3427
  name?: string;
1472
3428
  /** Body param: Source configuration for the subscription */
1473
- source?: { type?: "images" } | { type?: "kv" } | { type?: "r2" } | { type?: "superSlurper" } | { type?: "vectorize" } | { modelName?: string; type?: "workersAi.model" } | { type?: "workersBuilds.worker"; workerName?: string } | { type?: "workflows.workflow"; workflowName?: string };
3429
+ source?:
3430
+ | { type?: "images" }
3431
+ | { type?: "kv" }
3432
+ | { type?: "r2" }
3433
+ | { type?: "superSlurper" }
3434
+ | { type?: "vectorize" }
3435
+ | { modelName?: string; type?: "workersAi.model" }
3436
+ | { type?: "workersBuilds.worker"; workerName?: string }
3437
+ | { type?: "workflows.workflow"; workflowName?: string };
1474
3438
  }
1475
3439
 
1476
- export const CreateSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1477
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
1478
- destination: Schema.optional(Schema.Struct({
1479
- queueId: Schema.String,
1480
- type: Schema.Literal("queues.queue")
1481
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" }))),
1482
- enabled: Schema.optional(Schema.Boolean),
1483
- events: Schema.optional(Schema.Array(Schema.String)),
1484
- name: Schema.optional(Schema.String),
1485
- source: Schema.optional(Schema.Union([Schema.Struct({
1486
- type: Schema.optional(Schema.Literal("images"))
1487
- }), Schema.Struct({
1488
- type: Schema.optional(Schema.Literal("kv"))
1489
- }), Schema.Struct({
1490
- type: Schema.optional(Schema.Literal("r2"))
1491
- }), Schema.Struct({
1492
- type: Schema.optional(Schema.Literal("superSlurper"))
1493
- }), Schema.Struct({
1494
- type: Schema.optional(Schema.Literal("vectorize"))
1495
- }), Schema.Struct({
1496
- modelName: Schema.optional(Schema.String),
1497
- type: Schema.optional(Schema.Literal("workersAi.model"))
1498
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1499
- type: Schema.optional(Schema.Literal("workersBuilds.worker")),
1500
- workerName: Schema.optional(Schema.String)
1501
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1502
- type: Schema.optional(Schema.Literal("workflows.workflow")),
1503
- workflowName: Schema.optional(Schema.String)
1504
- }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))]))
1505
- })
1506
- .pipe(T.Http({ method: "POST", path: "/accounts/{account_id}/event_subscriptions/subscriptions" })) as unknown as Schema.Schema<CreateSubscriptionRequest>;
3440
+ export const CreateSubscriptionRequest =
3441
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3442
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3443
+ destination: Schema.optional(
3444
+ Schema.Struct({
3445
+ queueId: Schema.String,
3446
+ type: Schema.Literal("queues.queue"),
3447
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3448
+ ),
3449
+ enabled: Schema.optional(Schema.Boolean),
3450
+ events: Schema.optional(Schema.Array(Schema.String)),
3451
+ name: Schema.optional(Schema.String),
3452
+ source: Schema.optional(
3453
+ Schema.Union([
3454
+ Schema.Struct({
3455
+ type: Schema.optional(Schema.Literal("images")),
3456
+ }),
3457
+ Schema.Struct({
3458
+ type: Schema.optional(Schema.Literal("kv")),
3459
+ }),
3460
+ Schema.Struct({
3461
+ type: Schema.optional(Schema.Literal("r2")),
3462
+ }),
3463
+ Schema.Struct({
3464
+ type: Schema.optional(Schema.Literal("superSlurper")),
3465
+ }),
3466
+ Schema.Struct({
3467
+ type: Schema.optional(Schema.Literal("vectorize")),
3468
+ }),
3469
+ Schema.Struct({
3470
+ modelName: Schema.optional(Schema.String),
3471
+ type: Schema.optional(Schema.Literal("workersAi.model")),
3472
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3473
+ Schema.Struct({
3474
+ type: Schema.optional(Schema.Literal("workersBuilds.worker")),
3475
+ workerName: Schema.optional(Schema.String),
3476
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3477
+ Schema.Struct({
3478
+ type: Schema.optional(Schema.Literal("workflows.workflow")),
3479
+ workflowName: Schema.optional(Schema.String),
3480
+ }).pipe(
3481
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3482
+ ),
3483
+ ]),
3484
+ ),
3485
+ }).pipe(
3486
+ T.Http({
3487
+ method: "POST",
3488
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions",
3489
+ }),
3490
+ ) as unknown as Schema.Schema<CreateSubscriptionRequest>;
1507
3491
 
1508
3492
  export interface CreateSubscriptionResponse {
1509
3493
  /** Unique identifier for the subscription */
@@ -1521,45 +3505,96 @@ export interface CreateSubscriptionResponse {
1521
3505
  /** Name of the subscription */
1522
3506
  name: string;
1523
3507
  /** Source configuration for the subscription */
1524
- source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3508
+ source:
3509
+ | { type?: "images" | null }
3510
+ | { type?: "kv" | null }
3511
+ | { type?: "r2" | null }
3512
+ | { type?: "superSlurper" | null }
3513
+ | { type?: "vectorize" | null }
3514
+ | { modelName?: string | null; type?: "workersAi.model" | null }
3515
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3516
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
1525
3517
  }
1526
3518
 
1527
- export const CreateSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1528
- id: Schema.String,
1529
- createdAt: Schema.String,
1530
- destination: Schema.Struct({
1531
- queueId: Schema.String,
1532
- type: Schema.Literal("queues.queue")
1533
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1534
- enabled: Schema.Boolean,
1535
- events: Schema.Array(Schema.String),
1536
- modifiedAt: Schema.String,
1537
- name: Schema.String,
1538
- source: Schema.Union([Schema.Struct({
1539
- type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1540
- }), Schema.Struct({
1541
- type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1542
- }), Schema.Struct({
1543
- type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1544
- }), Schema.Struct({
1545
- type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1546
- }), Schema.Struct({
1547
- type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1548
- }), Schema.Struct({
1549
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1550
- type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1551
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1552
- type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1553
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1554
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1555
- type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1556
- workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1557
- }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1558
- }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<CreateSubscriptionResponse>;
1559
-
1560
- export type CreateSubscriptionError =
1561
- | DefaultErrors
1562
- | UnrecognizedEventType;
3519
+ export const CreateSubscriptionResponse =
3520
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3521
+ id: Schema.String,
3522
+ createdAt: Schema.String,
3523
+ destination: Schema.Struct({
3524
+ queueId: Schema.String,
3525
+ type: Schema.Literal("queues.queue"),
3526
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3527
+ enabled: Schema.Boolean,
3528
+ events: Schema.Array(Schema.String),
3529
+ modifiedAt: Schema.String,
3530
+ name: Schema.String,
3531
+ source: Schema.Union([
3532
+ Schema.Struct({
3533
+ type: Schema.optional(
3534
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
3535
+ ),
3536
+ }),
3537
+ Schema.Struct({
3538
+ type: Schema.optional(
3539
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
3540
+ ),
3541
+ }),
3542
+ Schema.Struct({
3543
+ type: Schema.optional(
3544
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
3545
+ ),
3546
+ }),
3547
+ Schema.Struct({
3548
+ type: Schema.optional(
3549
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3550
+ ),
3551
+ }),
3552
+ Schema.Struct({
3553
+ type: Schema.optional(
3554
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3555
+ ),
3556
+ }),
3557
+ Schema.Struct({
3558
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3559
+ type: Schema.optional(
3560
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3561
+ ),
3562
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3563
+ Schema.Struct({
3564
+ type: Schema.optional(
3565
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3566
+ ),
3567
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3568
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3569
+ Schema.Struct({
3570
+ type: Schema.optional(
3571
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3572
+ ),
3573
+ workflowName: Schema.optional(
3574
+ Schema.Union([Schema.String, Schema.Null]),
3575
+ ),
3576
+ }).pipe(
3577
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3578
+ ),
3579
+ ]),
3580
+ })
3581
+ .pipe(
3582
+ Schema.encodeKeys({
3583
+ id: "id",
3584
+ createdAt: "created_at",
3585
+ destination: "destination",
3586
+ enabled: "enabled",
3587
+ events: "events",
3588
+ modifiedAt: "modified_at",
3589
+ name: "name",
3590
+ source: "source",
3591
+ }),
3592
+ )
3593
+ .pipe(
3594
+ T.ResponsePath("result"),
3595
+ ) as unknown as Schema.Schema<CreateSubscriptionResponse>;
3596
+
3597
+ export type CreateSubscriptionError = DefaultErrors | UnrecognizedEventType;
1563
3598
 
1564
3599
  export const createSubscription: API.OperationMethod<
1565
3600
  CreateSubscriptionRequest,
@@ -1586,18 +3621,25 @@ export interface PatchSubscriptionRequest {
1586
3621
  name?: string;
1587
3622
  }
1588
3623
 
1589
- export const PatchSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1590
- subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
1591
- accountId: Schema.String.pipe(T.HttpPath("account_id")),
1592
- destination: Schema.optional(Schema.Struct({
1593
- queueId: Schema.String,
1594
- type: Schema.Literal("queues.queue")
1595
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" }))),
1596
- enabled: Schema.optional(Schema.Boolean),
1597
- events: Schema.optional(Schema.Array(Schema.String)),
1598
- name: Schema.optional(Schema.String)
1599
- })
1600
- .pipe(T.Http({ method: "PATCH", path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}" })) as unknown as Schema.Schema<PatchSubscriptionRequest>;
3624
+ export const PatchSubscriptionRequest =
3625
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3626
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
3627
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3628
+ destination: Schema.optional(
3629
+ Schema.Struct({
3630
+ queueId: Schema.String,
3631
+ type: Schema.Literal("queues.queue"),
3632
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3633
+ ),
3634
+ enabled: Schema.optional(Schema.Boolean),
3635
+ events: Schema.optional(Schema.Array(Schema.String)),
3636
+ name: Schema.optional(Schema.String),
3637
+ }).pipe(
3638
+ T.Http({
3639
+ method: "PATCH",
3640
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
3641
+ }),
3642
+ ) as unknown as Schema.Schema<PatchSubscriptionRequest>;
1601
3643
 
1602
3644
  export interface PatchSubscriptionResponse {
1603
3645
  /** Unique identifier for the subscription */
@@ -1615,45 +3657,96 @@ export interface PatchSubscriptionResponse {
1615
3657
  /** Name of the subscription */
1616
3658
  name: string;
1617
3659
  /** Source configuration for the subscription */
1618
- source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3660
+ source:
3661
+ | { type?: "images" | null }
3662
+ | { type?: "kv" | null }
3663
+ | { type?: "r2" | null }
3664
+ | { type?: "superSlurper" | null }
3665
+ | { type?: "vectorize" | null }
3666
+ | { modelName?: string | null; type?: "workersAi.model" | null }
3667
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3668
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
1619
3669
  }
1620
3670
 
1621
- export const PatchSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1622
- id: Schema.String,
1623
- createdAt: Schema.String,
1624
- destination: Schema.Struct({
1625
- queueId: Schema.String,
1626
- type: Schema.Literal("queues.queue")
1627
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1628
- enabled: Schema.Boolean,
1629
- events: Schema.Array(Schema.String),
1630
- modifiedAt: Schema.String,
1631
- name: Schema.String,
1632
- source: Schema.Union([Schema.Struct({
1633
- type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1634
- }), Schema.Struct({
1635
- type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1636
- }), Schema.Struct({
1637
- type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1638
- }), Schema.Struct({
1639
- type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1640
- }), Schema.Struct({
1641
- type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1642
- }), Schema.Struct({
1643
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1644
- type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1645
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1646
- type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1647
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1648
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1649
- type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1650
- workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1651
- }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1652
- }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<PatchSubscriptionResponse>;
1653
-
1654
- export type PatchSubscriptionError =
1655
- | DefaultErrors
1656
- | UnrecognizedEventType;
3671
+ export const PatchSubscriptionResponse =
3672
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3673
+ id: Schema.String,
3674
+ createdAt: Schema.String,
3675
+ destination: Schema.Struct({
3676
+ queueId: Schema.String,
3677
+ type: Schema.Literal("queues.queue"),
3678
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3679
+ enabled: Schema.Boolean,
3680
+ events: Schema.Array(Schema.String),
3681
+ modifiedAt: Schema.String,
3682
+ name: Schema.String,
3683
+ source: Schema.Union([
3684
+ Schema.Struct({
3685
+ type: Schema.optional(
3686
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
3687
+ ),
3688
+ }),
3689
+ Schema.Struct({
3690
+ type: Schema.optional(
3691
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
3692
+ ),
3693
+ }),
3694
+ Schema.Struct({
3695
+ type: Schema.optional(
3696
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
3697
+ ),
3698
+ }),
3699
+ Schema.Struct({
3700
+ type: Schema.optional(
3701
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3702
+ ),
3703
+ }),
3704
+ Schema.Struct({
3705
+ type: Schema.optional(
3706
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3707
+ ),
3708
+ }),
3709
+ Schema.Struct({
3710
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3711
+ type: Schema.optional(
3712
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3713
+ ),
3714
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3715
+ Schema.Struct({
3716
+ type: Schema.optional(
3717
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3718
+ ),
3719
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3720
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3721
+ Schema.Struct({
3722
+ type: Schema.optional(
3723
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3724
+ ),
3725
+ workflowName: Schema.optional(
3726
+ Schema.Union([Schema.String, Schema.Null]),
3727
+ ),
3728
+ }).pipe(
3729
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3730
+ ),
3731
+ ]),
3732
+ })
3733
+ .pipe(
3734
+ Schema.encodeKeys({
3735
+ id: "id",
3736
+ createdAt: "created_at",
3737
+ destination: "destination",
3738
+ enabled: "enabled",
3739
+ events: "events",
3740
+ modifiedAt: "modified_at",
3741
+ name: "name",
3742
+ source: "source",
3743
+ }),
3744
+ )
3745
+ .pipe(
3746
+ T.ResponsePath("result"),
3747
+ ) as unknown as Schema.Schema<PatchSubscriptionResponse>;
3748
+
3749
+ export type PatchSubscriptionError = DefaultErrors | UnrecognizedEventType;
1657
3750
 
1658
3751
  export const patchSubscription: API.OperationMethod<
1659
3752
  PatchSubscriptionRequest,
@@ -1672,11 +3765,16 @@ export interface DeleteSubscriptionRequest {
1672
3765
  accountId: string;
1673
3766
  }
1674
3767
 
1675
- export const DeleteSubscriptionRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1676
- subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
1677
- accountId: Schema.String.pipe(T.HttpPath("account_id"))
1678
- })
1679
- .pipe(T.Http({ method: "DELETE", path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}" })) as unknown as Schema.Schema<DeleteSubscriptionRequest>;
3768
+ export const DeleteSubscriptionRequest =
3769
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3770
+ subscriptionId: Schema.String.pipe(T.HttpPath("subscriptionId")),
3771
+ accountId: Schema.String.pipe(T.HttpPath("account_id")),
3772
+ }).pipe(
3773
+ T.Http({
3774
+ method: "DELETE",
3775
+ path: "/accounts/{account_id}/event_subscriptions/subscriptions/{subscriptionId}",
3776
+ }),
3777
+ ) as unknown as Schema.Schema<DeleteSubscriptionRequest>;
1680
3778
 
1681
3779
  export interface DeleteSubscriptionResponse {
1682
3780
  /** Unique identifier for the subscription */
@@ -1694,45 +3792,96 @@ export interface DeleteSubscriptionResponse {
1694
3792
  /** Name of the subscription */
1695
3793
  name: string;
1696
3794
  /** Source configuration for the subscription */
1697
- source: { type?: "images" | null } | { type?: "kv" | null } | { type?: "r2" | null } | { type?: "superSlurper" | null } | { type?: "vectorize" | null } | { modelName?: string | null; type?: "workersAi.model" | null } | { type?: "workersBuilds.worker" | null; workerName?: string | null } | { type?: "workflows.workflow" | null; workflowName?: string | null };
3795
+ source:
3796
+ | { type?: "images" | null }
3797
+ | { type?: "kv" | null }
3798
+ | { type?: "r2" | null }
3799
+ | { type?: "superSlurper" | null }
3800
+ | { type?: "vectorize" | null }
3801
+ | { modelName?: string | null; type?: "workersAi.model" | null }
3802
+ | { type?: "workersBuilds.worker" | null; workerName?: string | null }
3803
+ | { type?: "workflows.workflow" | null; workflowName?: string | null };
1698
3804
  }
1699
3805
 
1700
- export const DeleteSubscriptionResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
1701
- id: Schema.String,
1702
- createdAt: Schema.String,
1703
- destination: Schema.Struct({
1704
- queueId: Schema.String,
1705
- type: Schema.Literal("queues.queue")
1706
- }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
1707
- enabled: Schema.Boolean,
1708
- events: Schema.Array(Schema.String),
1709
- modifiedAt: Schema.String,
1710
- name: Schema.String,
1711
- source: Schema.Union([Schema.Struct({
1712
- type: Schema.optional(Schema.Union([Schema.Literal("images"), Schema.Null]))
1713
- }), Schema.Struct({
1714
- type: Schema.optional(Schema.Union([Schema.Literal("kv"), Schema.Null]))
1715
- }), Schema.Struct({
1716
- type: Schema.optional(Schema.Union([Schema.Literal("r2"), Schema.Null]))
1717
- }), Schema.Struct({
1718
- type: Schema.optional(Schema.Union([Schema.Literal("superSlurper"), Schema.Null]))
1719
- }), Schema.Struct({
1720
- type: Schema.optional(Schema.Union([Schema.Literal("vectorize"), Schema.Null]))
1721
- }), Schema.Struct({
1722
- modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
1723
- type: Schema.optional(Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]))
1724
- }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })), Schema.Struct({
1725
- type: Schema.optional(Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null])),
1726
- workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1727
- }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })), Schema.Struct({
1728
- type: Schema.optional(Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null])),
1729
- workflowName: Schema.optional(Schema.Union([Schema.String, Schema.Null]))
1730
- }).pipe(Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }))])
1731
- }).pipe(Schema.encodeKeys({ id: "id", createdAt: "created_at", destination: "destination", enabled: "enabled", events: "events", modifiedAt: "modified_at", name: "name", source: "source" })).pipe(T.ResponsePath("result")) as unknown as Schema.Schema<DeleteSubscriptionResponse>;
1732
-
1733
- export type DeleteSubscriptionError =
1734
- | DefaultErrors
1735
- | UnrecognizedEventType;
3806
+ export const DeleteSubscriptionResponse =
3807
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
3808
+ id: Schema.String,
3809
+ createdAt: Schema.String,
3810
+ destination: Schema.Struct({
3811
+ queueId: Schema.String,
3812
+ type: Schema.Literal("queues.queue"),
3813
+ }).pipe(Schema.encodeKeys({ queueId: "queue_id", type: "type" })),
3814
+ enabled: Schema.Boolean,
3815
+ events: Schema.Array(Schema.String),
3816
+ modifiedAt: Schema.String,
3817
+ name: Schema.String,
3818
+ source: Schema.Union([
3819
+ Schema.Struct({
3820
+ type: Schema.optional(
3821
+ Schema.Union([Schema.Literal("images"), Schema.Null]),
3822
+ ),
3823
+ }),
3824
+ Schema.Struct({
3825
+ type: Schema.optional(
3826
+ Schema.Union([Schema.Literal("kv"), Schema.Null]),
3827
+ ),
3828
+ }),
3829
+ Schema.Struct({
3830
+ type: Schema.optional(
3831
+ Schema.Union([Schema.Literal("r2"), Schema.Null]),
3832
+ ),
3833
+ }),
3834
+ Schema.Struct({
3835
+ type: Schema.optional(
3836
+ Schema.Union([Schema.Literal("superSlurper"), Schema.Null]),
3837
+ ),
3838
+ }),
3839
+ Schema.Struct({
3840
+ type: Schema.optional(
3841
+ Schema.Union([Schema.Literal("vectorize"), Schema.Null]),
3842
+ ),
3843
+ }),
3844
+ Schema.Struct({
3845
+ modelName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3846
+ type: Schema.optional(
3847
+ Schema.Union([Schema.Literal("workersAi.model"), Schema.Null]),
3848
+ ),
3849
+ }).pipe(Schema.encodeKeys({ modelName: "model_name", type: "type" })),
3850
+ Schema.Struct({
3851
+ type: Schema.optional(
3852
+ Schema.Union([Schema.Literal("workersBuilds.worker"), Schema.Null]),
3853
+ ),
3854
+ workerName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
3855
+ }).pipe(Schema.encodeKeys({ type: "type", workerName: "worker_name" })),
3856
+ Schema.Struct({
3857
+ type: Schema.optional(
3858
+ Schema.Union([Schema.Literal("workflows.workflow"), Schema.Null]),
3859
+ ),
3860
+ workflowName: Schema.optional(
3861
+ Schema.Union([Schema.String, Schema.Null]),
3862
+ ),
3863
+ }).pipe(
3864
+ Schema.encodeKeys({ type: "type", workflowName: "workflow_name" }),
3865
+ ),
3866
+ ]),
3867
+ })
3868
+ .pipe(
3869
+ Schema.encodeKeys({
3870
+ id: "id",
3871
+ createdAt: "created_at",
3872
+ destination: "destination",
3873
+ enabled: "enabled",
3874
+ events: "events",
3875
+ modifiedAt: "modified_at",
3876
+ name: "name",
3877
+ source: "source",
3878
+ }),
3879
+ )
3880
+ .pipe(
3881
+ T.ResponsePath("result"),
3882
+ ) as unknown as Schema.Schema<DeleteSubscriptionResponse>;
3883
+
3884
+ export type DeleteSubscriptionError = DefaultErrors | UnrecognizedEventType;
1736
3885
 
1737
3886
  export const deleteSubscription: API.OperationMethod<
1738
3887
  DeleteSubscriptionRequest,