@trigger.dev/core 3.0.0-beta.35 → 3.0.0-beta.36

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 (37) hide show
  1. package/dist/{catalog-BUwiuDbt.d.mts → catalog-XTlJQaMn.d.mts} +3 -3
  2. package/dist/{catalog-eKgqBHUA.d.ts → catalog-dRKTgwQ7.d.ts} +3 -3
  3. package/dist/{manager-uPyMRN8k.d.mts → manager-JkbddlcO.d.mts} +19 -19
  4. package/dist/{manager-uPyMRN8k.d.ts → manager-JkbddlcO.d.ts} +19 -19
  5. package/dist/{messages-l9PdIyKF.d.mts → messages-6_-q72KG.d.mts} +119 -119
  6. package/dist/{messages-l9PdIyKF.d.ts → messages-6_-q72KG.d.ts} +119 -119
  7. package/dist/{schemas-b8tRw8dX.d.mts → schemas-r4ZP9S-F.d.mts} +2 -2
  8. package/dist/{schemas-b8tRw8dX.d.ts → schemas-r4ZP9S-F.d.ts} +2 -2
  9. package/dist/v3/dev/index.d.mts +1 -1
  10. package/dist/v3/dev/index.d.ts +1 -1
  11. package/dist/v3/index.d.mts +579 -122
  12. package/dist/v3/index.d.ts +579 -122
  13. package/dist/v3/index.js +739 -319
  14. package/dist/v3/index.js.map +1 -1
  15. package/dist/v3/index.mjs +730 -318
  16. package/dist/v3/index.mjs.map +1 -1
  17. package/dist/v3/otel/index.js +1 -1
  18. package/dist/v3/otel/index.js.map +1 -1
  19. package/dist/v3/otel/index.mjs +1 -1
  20. package/dist/v3/otel/index.mjs.map +1 -1
  21. package/dist/v3/prod/index.d.mts +2 -2
  22. package/dist/v3/prod/index.d.ts +2 -2
  23. package/dist/v3/workers/index.d.mts +6 -6
  24. package/dist/v3/workers/index.d.ts +6 -6
  25. package/dist/v3/workers/index.js +463 -51
  26. package/dist/v3/workers/index.js.map +1 -1
  27. package/dist/v3/workers/index.mjs +463 -51
  28. package/dist/v3/workers/index.mjs.map +1 -1
  29. package/dist/v3/zodMessageHandler.d.mts +1 -1
  30. package/dist/v3/zodMessageHandler.d.ts +1 -1
  31. package/dist/v3/zodfetch.d.mts +194 -10
  32. package/dist/v3/zodfetch.d.ts +194 -10
  33. package/dist/v3/zodfetch.js +336 -38
  34. package/dist/v3/zodfetch.js.map +1 -1
  35. package/dist/v3/zodfetch.mjs +320 -37
  36. package/dist/v3/zodfetch.mjs.map +1 -1
  37. package/package.json +1 -1
@@ -29,8 +29,8 @@ declare const ZodMessageSchema: z.ZodObject<{
29
29
  type: z.ZodString;
30
30
  payload: z.ZodUnknown;
31
31
  }, "strip", z.ZodTypeAny, {
32
- type: string;
33
32
  version: "v1";
33
+ type: string;
34
34
  payload?: unknown;
35
35
  }, {
36
36
  type: string;
@@ -29,8 +29,8 @@ declare const ZodMessageSchema: z.ZodObject<{
29
29
  type: z.ZodString;
30
30
  payload: z.ZodUnknown;
31
31
  }, "strip", z.ZodTypeAny, {
32
- type: string;
33
32
  version: "v1";
33
+ type: string;
34
34
  payload?: unknown;
35
35
  }, {
36
36
  type: string;
@@ -1,7 +1,78 @@
1
1
  import { z } from 'zod';
2
- import { R as RetryOptions } from '../schemas-b8tRw8dX.mjs';
2
+ import { R as RetryOptions } from '../schemas-r4ZP9S-F.mjs';
3
3
  import { Readable } from 'node:stream';
4
4
 
5
+ interface CursorPageParams {
6
+ limit?: number;
7
+ after?: string;
8
+ before?: string;
9
+ }
10
+ interface OffsetLimitPageParams {
11
+ limit?: number;
12
+ page?: number;
13
+ }
14
+ interface PageResponse<Item> {
15
+ data: Array<Item>;
16
+ }
17
+ interface CursorPageResponse<Item> extends PageResponse<Item> {
18
+ pagination: {
19
+ next?: string;
20
+ previous?: string;
21
+ };
22
+ }
23
+ interface OffsetLimitPageResponse<Item> extends PageResponse<Item> {
24
+ pagination: {
25
+ currentPage: number;
26
+ totalPages: number;
27
+ count: number;
28
+ };
29
+ }
30
+ interface Page<Item> {
31
+ getPaginatedItems(): Item[];
32
+ hasNextPage(): boolean;
33
+ hasPreviousPage(): boolean;
34
+ }
35
+ declare class CursorPage<Item> implements CursorPageResponse<Item>, Page<Item>, AsyncIterable<Item> {
36
+ private pageFetcher;
37
+ data: Array<Item>;
38
+ pagination: {
39
+ next?: string;
40
+ previous?: string;
41
+ };
42
+ constructor(data: Array<Item>, pagination: {
43
+ next?: string;
44
+ previous?: string;
45
+ }, pageFetcher: (params: Omit<CursorPageParams, "limit">) => Promise<CursorPage<Item>>);
46
+ getPaginatedItems(): Item[];
47
+ hasNextPage(): boolean;
48
+ hasPreviousPage(): boolean;
49
+ getNextPage(): Promise<CursorPage<Item>>;
50
+ getPreviousPage(): Promise<CursorPage<Item>>;
51
+ iterPages(): AsyncGenerator<CursorPage<Item>, void, unknown>;
52
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
53
+ }
54
+ declare class OffsetLimitPage<Item> implements OffsetLimitPageResponse<Item>, Page<Item>, AsyncIterable<Item> {
55
+ private pageFetcher;
56
+ data: Array<Item>;
57
+ pagination: {
58
+ currentPage: number;
59
+ totalPages: number;
60
+ count: number;
61
+ };
62
+ constructor(data: Array<Item>, pagination: {
63
+ currentPage: number;
64
+ totalPages: number;
65
+ count: number;
66
+ }, pageFetcher: (params: Omit<OffsetLimitPageParams, "limit">) => Promise<OffsetLimitPage<Item>>);
67
+ getPaginatedItems(): Item[];
68
+ hasNextPage(): boolean;
69
+ hasPreviousPage(): boolean;
70
+ getNextPage(): Promise<OffsetLimitPage<Item>>;
71
+ getPreviousPage(): Promise<OffsetLimitPage<Item>>;
72
+ iterPages(): AsyncGenerator<OffsetLimitPage<Item>, void, unknown>;
73
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
74
+ }
75
+
5
76
  declare const defaultRetryOptions: {
6
77
  maxAttempts: number;
7
78
  factor: number;
@@ -12,14 +83,20 @@ declare const defaultRetryOptions: {
12
83
  type ZodFetchOptions = {
13
84
  retry?: RetryOptions;
14
85
  };
15
- declare function zodfetch<TResponseBodySchema extends z.ZodTypeAny>(schema: TResponseBodySchema, url: string, requestInit?: RequestInit, options?: ZodFetchOptions): Promise<z.output<TResponseBodySchema>>;
16
- declare class MultipartBody {
17
- body: any;
18
- constructor(body: any);
19
- get [Symbol.toStringTag](): string;
20
- }
21
- declare function zodupload<TResponseBodySchema extends z.ZodTypeAny, TBody = Record<string, unknown>>(schema: TResponseBodySchema, url: string, body: TBody, requestInit?: RequestInit, options?: ZodFetchOptions): Promise<z.output<TResponseBodySchema>>;
22
- declare const createForm: <T = Record<string, unknown>>(body: T | undefined) => Promise<FormData>;
86
+ interface FetchCursorPageParams extends CursorPageParams {
87
+ query?: URLSearchParams;
88
+ }
89
+ interface FetchOffsetLimitPageParams extends OffsetLimitPageParams {
90
+ query?: URLSearchParams;
91
+ }
92
+ declare function zodfetch<TResponseBodySchema extends z.ZodTypeAny>(schema: TResponseBodySchema, url: string, requestInit?: RequestInit, options?: ZodFetchOptions): ApiPromise<z.output<TResponseBodySchema>>;
93
+ declare function zodfetchCursorPage<TItemSchema extends z.ZodTypeAny>(schema: TItemSchema, url: string, params: FetchCursorPageParams, requestInit?: RequestInit, options?: ZodFetchOptions): CursorPagePromise<TItemSchema>;
94
+ declare function zodfetchOffsetLimitPage<TItemSchema extends z.ZodTypeAny>(schema: TItemSchema, url: string, params: FetchOffsetLimitPageParams, requestInit?: RequestInit, options?: ZodFetchOptions): OffsetLimitPagePromise<TItemSchema>;
95
+ declare function zodupload<TResponseBodySchema extends z.ZodTypeAny, TBody = Record<string, unknown>>(schema: TResponseBodySchema, url: string, body: TBody, requestInit?: RequestInit, options?: ZodFetchOptions): ApiPromise<z.output<TResponseBodySchema>>;
96
+ type ZodFetchResult<T> = {
97
+ data: T;
98
+ response: Response;
99
+ };
23
100
  type ToFileInput = Uploadable | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
24
101
  /**
25
102
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
@@ -74,5 +151,112 @@ declare const isFsReadStream: (value: any) => value is Readable;
74
151
  declare const isUploadable: (value: any) => value is Uploadable;
75
152
  type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
76
153
  declare const isRecordLike: (value: any) => value is Record<string, string>;
154
+ /**
155
+ * A subclass of `Promise` providing additional helper methods
156
+ * for interacting with the SDK.
157
+ */
158
+ declare class ApiPromise<T> extends Promise<T> {
159
+ private responsePromise;
160
+ constructor(responsePromise: Promise<ZodFetchResult<T>>);
161
+ /**
162
+ * Gets the raw `Response` instance instead of parsing the response
163
+ * data.
164
+ *
165
+ * If you want to parse the response body but still get the `Response`
166
+ * instance, you can use {@link withResponse()}.
167
+ */
168
+ asResponse(): Promise<Response>;
169
+ /**
170
+ * Gets the parsed response data and the raw `Response` instance.
171
+ *
172
+ * If you just want to get the raw `Response` instance without parsing it,
173
+ * you can use {@link asResponse()}.
174
+ */
175
+ withResponse(): Promise<{
176
+ data: T;
177
+ response: Response;
178
+ }>;
179
+ private parse;
180
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
181
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
182
+ finally(onfinally?: (() => void) | undefined | null): Promise<T>;
183
+ }
184
+ declare class CursorPagePromise<TItemSchema extends z.ZodTypeAny> extends ApiPromise<CursorPage<z.output<TItemSchema>>> implements AsyncIterable<z.output<TItemSchema>> {
185
+ #private;
186
+ private schema;
187
+ private url;
188
+ private params;
189
+ private requestInit?;
190
+ private options?;
191
+ constructor(result: Promise<ZodFetchResult<CursorPageResponse<z.output<TItemSchema>>>>, schema: TItemSchema, url: string, params: FetchCursorPageParams, requestInit?: RequestInit | undefined, options?: ZodFetchOptions | undefined);
192
+ /**
193
+ * Allow auto-paginating iteration on an unawaited list call, eg:
194
+ *
195
+ * for await (const item of client.items.list()) {
196
+ * console.log(item)
197
+ * }
198
+ */
199
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<z.output<TItemSchema>>, void, unknown>;
200
+ }
201
+ declare class OffsetLimitPagePromise<TItemSchema extends z.ZodTypeAny> extends ApiPromise<OffsetLimitPage<z.output<TItemSchema>>> implements AsyncIterable<z.output<TItemSchema>> {
202
+ #private;
203
+ private schema;
204
+ private url;
205
+ private params;
206
+ private requestInit?;
207
+ private options?;
208
+ constructor(result: Promise<ZodFetchResult<OffsetLimitPageResponse<z.output<TItemSchema>>>>, schema: TItemSchema, url: string, params: FetchOffsetLimitPageParams, requestInit?: RequestInit | undefined, options?: ZodFetchOptions | undefined);
209
+ /**
210
+ * Allow auto-paginating iteration on an unawaited list call, eg:
211
+ *
212
+ * for await (const item of client.items.list()) {
213
+ * console.log(item)
214
+ * }
215
+ */
216
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<z.output<TItemSchema>>, void, unknown>;
217
+ }
218
+
219
+ type APIHeaders = Record<string, string | null | undefined>;
220
+ declare class ApiError extends Error {
221
+ readonly status: number | undefined;
222
+ readonly headers: APIHeaders | undefined;
223
+ readonly error: Object | undefined;
224
+ readonly code: string | null | undefined;
225
+ readonly param: string | null | undefined;
226
+ readonly type: string | undefined;
227
+ constructor(status: number | undefined, error: Object | undefined, message: string | undefined, headers: APIHeaders | undefined);
228
+ private static makeMessage;
229
+ static generate(status: number | undefined, errorResponse: Object | undefined, message: string | undefined, headers: APIHeaders | undefined): ApiError;
230
+ }
231
+ declare class ApiConnectionError extends ApiError {
232
+ readonly status: undefined;
233
+ constructor({ message, cause }: {
234
+ message?: string;
235
+ cause?: Error | undefined;
236
+ });
237
+ }
238
+ declare class BadRequestError extends ApiError {
239
+ readonly status: 400;
240
+ }
241
+ declare class AuthenticationError extends ApiError {
242
+ readonly status: 401;
243
+ }
244
+ declare class PermissionDeniedError extends ApiError {
245
+ readonly status: 403;
246
+ }
247
+ declare class NotFoundError extends ApiError {
248
+ readonly status: 404;
249
+ }
250
+ declare class ConflictError extends ApiError {
251
+ readonly status: 409;
252
+ }
253
+ declare class UnprocessableEntityError extends ApiError {
254
+ readonly status: 422;
255
+ }
256
+ declare class RateLimitError extends ApiError {
257
+ readonly status: 429;
258
+ }
259
+ declare class InternalServerError extends ApiError {
260
+ }
77
261
 
78
- export { type BlobLike, type BlobLikePart, type FileLike, MultipartBody, type ResponseLike, type ToFileInput, type Uploadable, type ZodFetchOptions, createForm, defaultRetryOptions, isBlobLike, isFileLike, isFsReadStream, isRecordLike, isResponseLike, isUploadable, toFile, zodfetch, zodupload };
262
+ export { type APIHeaders, ApiConnectionError, ApiError, ApiPromise, AuthenticationError, BadRequestError, type BlobLike, type BlobLikePart, ConflictError, CursorPage, type CursorPageParams, CursorPagePromise, type CursorPageResponse, type FileLike, InternalServerError, NotFoundError, OffsetLimitPage, type OffsetLimitPageParams, OffsetLimitPagePromise, type OffsetLimitPageResponse, type Page, type PageResponse, PermissionDeniedError, RateLimitError, type ResponseLike, type ToFileInput, UnprocessableEntityError, type Uploadable, type ZodFetchOptions, defaultRetryOptions, isBlobLike, isFileLike, isFsReadStream, isRecordLike, isResponseLike, isUploadable, toFile, zodfetch, zodfetchCursorPage, zodfetchOffsetLimitPage, zodupload };
@@ -1,7 +1,78 @@
1
1
  import { z } from 'zod';
2
- import { R as RetryOptions } from '../schemas-b8tRw8dX.js';
2
+ import { R as RetryOptions } from '../schemas-r4ZP9S-F.js';
3
3
  import { Readable } from 'node:stream';
4
4
 
5
+ interface CursorPageParams {
6
+ limit?: number;
7
+ after?: string;
8
+ before?: string;
9
+ }
10
+ interface OffsetLimitPageParams {
11
+ limit?: number;
12
+ page?: number;
13
+ }
14
+ interface PageResponse<Item> {
15
+ data: Array<Item>;
16
+ }
17
+ interface CursorPageResponse<Item> extends PageResponse<Item> {
18
+ pagination: {
19
+ next?: string;
20
+ previous?: string;
21
+ };
22
+ }
23
+ interface OffsetLimitPageResponse<Item> extends PageResponse<Item> {
24
+ pagination: {
25
+ currentPage: number;
26
+ totalPages: number;
27
+ count: number;
28
+ };
29
+ }
30
+ interface Page<Item> {
31
+ getPaginatedItems(): Item[];
32
+ hasNextPage(): boolean;
33
+ hasPreviousPage(): boolean;
34
+ }
35
+ declare class CursorPage<Item> implements CursorPageResponse<Item>, Page<Item>, AsyncIterable<Item> {
36
+ private pageFetcher;
37
+ data: Array<Item>;
38
+ pagination: {
39
+ next?: string;
40
+ previous?: string;
41
+ };
42
+ constructor(data: Array<Item>, pagination: {
43
+ next?: string;
44
+ previous?: string;
45
+ }, pageFetcher: (params: Omit<CursorPageParams, "limit">) => Promise<CursorPage<Item>>);
46
+ getPaginatedItems(): Item[];
47
+ hasNextPage(): boolean;
48
+ hasPreviousPage(): boolean;
49
+ getNextPage(): Promise<CursorPage<Item>>;
50
+ getPreviousPage(): Promise<CursorPage<Item>>;
51
+ iterPages(): AsyncGenerator<CursorPage<Item>, void, unknown>;
52
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
53
+ }
54
+ declare class OffsetLimitPage<Item> implements OffsetLimitPageResponse<Item>, Page<Item>, AsyncIterable<Item> {
55
+ private pageFetcher;
56
+ data: Array<Item>;
57
+ pagination: {
58
+ currentPage: number;
59
+ totalPages: number;
60
+ count: number;
61
+ };
62
+ constructor(data: Array<Item>, pagination: {
63
+ currentPage: number;
64
+ totalPages: number;
65
+ count: number;
66
+ }, pageFetcher: (params: Omit<OffsetLimitPageParams, "limit">) => Promise<OffsetLimitPage<Item>>);
67
+ getPaginatedItems(): Item[];
68
+ hasNextPage(): boolean;
69
+ hasPreviousPage(): boolean;
70
+ getNextPage(): Promise<OffsetLimitPage<Item>>;
71
+ getPreviousPage(): Promise<OffsetLimitPage<Item>>;
72
+ iterPages(): AsyncGenerator<OffsetLimitPage<Item>, void, unknown>;
73
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
74
+ }
75
+
5
76
  declare const defaultRetryOptions: {
6
77
  maxAttempts: number;
7
78
  factor: number;
@@ -12,14 +83,20 @@ declare const defaultRetryOptions: {
12
83
  type ZodFetchOptions = {
13
84
  retry?: RetryOptions;
14
85
  };
15
- declare function zodfetch<TResponseBodySchema extends z.ZodTypeAny>(schema: TResponseBodySchema, url: string, requestInit?: RequestInit, options?: ZodFetchOptions): Promise<z.output<TResponseBodySchema>>;
16
- declare class MultipartBody {
17
- body: any;
18
- constructor(body: any);
19
- get [Symbol.toStringTag](): string;
20
- }
21
- declare function zodupload<TResponseBodySchema extends z.ZodTypeAny, TBody = Record<string, unknown>>(schema: TResponseBodySchema, url: string, body: TBody, requestInit?: RequestInit, options?: ZodFetchOptions): Promise<z.output<TResponseBodySchema>>;
22
- declare const createForm: <T = Record<string, unknown>>(body: T | undefined) => Promise<FormData>;
86
+ interface FetchCursorPageParams extends CursorPageParams {
87
+ query?: URLSearchParams;
88
+ }
89
+ interface FetchOffsetLimitPageParams extends OffsetLimitPageParams {
90
+ query?: URLSearchParams;
91
+ }
92
+ declare function zodfetch<TResponseBodySchema extends z.ZodTypeAny>(schema: TResponseBodySchema, url: string, requestInit?: RequestInit, options?: ZodFetchOptions): ApiPromise<z.output<TResponseBodySchema>>;
93
+ declare function zodfetchCursorPage<TItemSchema extends z.ZodTypeAny>(schema: TItemSchema, url: string, params: FetchCursorPageParams, requestInit?: RequestInit, options?: ZodFetchOptions): CursorPagePromise<TItemSchema>;
94
+ declare function zodfetchOffsetLimitPage<TItemSchema extends z.ZodTypeAny>(schema: TItemSchema, url: string, params: FetchOffsetLimitPageParams, requestInit?: RequestInit, options?: ZodFetchOptions): OffsetLimitPagePromise<TItemSchema>;
95
+ declare function zodupload<TResponseBodySchema extends z.ZodTypeAny, TBody = Record<string, unknown>>(schema: TResponseBodySchema, url: string, body: TBody, requestInit?: RequestInit, options?: ZodFetchOptions): ApiPromise<z.output<TResponseBodySchema>>;
96
+ type ZodFetchResult<T> = {
97
+ data: T;
98
+ response: Response;
99
+ };
23
100
  type ToFileInput = Uploadable | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
24
101
  /**
25
102
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
@@ -74,5 +151,112 @@ declare const isFsReadStream: (value: any) => value is Readable;
74
151
  declare const isUploadable: (value: any) => value is Uploadable;
75
152
  type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
76
153
  declare const isRecordLike: (value: any) => value is Record<string, string>;
154
+ /**
155
+ * A subclass of `Promise` providing additional helper methods
156
+ * for interacting with the SDK.
157
+ */
158
+ declare class ApiPromise<T> extends Promise<T> {
159
+ private responsePromise;
160
+ constructor(responsePromise: Promise<ZodFetchResult<T>>);
161
+ /**
162
+ * Gets the raw `Response` instance instead of parsing the response
163
+ * data.
164
+ *
165
+ * If you want to parse the response body but still get the `Response`
166
+ * instance, you can use {@link withResponse()}.
167
+ */
168
+ asResponse(): Promise<Response>;
169
+ /**
170
+ * Gets the parsed response data and the raw `Response` instance.
171
+ *
172
+ * If you just want to get the raw `Response` instance without parsing it,
173
+ * you can use {@link asResponse()}.
174
+ */
175
+ withResponse(): Promise<{
176
+ data: T;
177
+ response: Response;
178
+ }>;
179
+ private parse;
180
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
181
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
182
+ finally(onfinally?: (() => void) | undefined | null): Promise<T>;
183
+ }
184
+ declare class CursorPagePromise<TItemSchema extends z.ZodTypeAny> extends ApiPromise<CursorPage<z.output<TItemSchema>>> implements AsyncIterable<z.output<TItemSchema>> {
185
+ #private;
186
+ private schema;
187
+ private url;
188
+ private params;
189
+ private requestInit?;
190
+ private options?;
191
+ constructor(result: Promise<ZodFetchResult<CursorPageResponse<z.output<TItemSchema>>>>, schema: TItemSchema, url: string, params: FetchCursorPageParams, requestInit?: RequestInit | undefined, options?: ZodFetchOptions | undefined);
192
+ /**
193
+ * Allow auto-paginating iteration on an unawaited list call, eg:
194
+ *
195
+ * for await (const item of client.items.list()) {
196
+ * console.log(item)
197
+ * }
198
+ */
199
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<z.output<TItemSchema>>, void, unknown>;
200
+ }
201
+ declare class OffsetLimitPagePromise<TItemSchema extends z.ZodTypeAny> extends ApiPromise<OffsetLimitPage<z.output<TItemSchema>>> implements AsyncIterable<z.output<TItemSchema>> {
202
+ #private;
203
+ private schema;
204
+ private url;
205
+ private params;
206
+ private requestInit?;
207
+ private options?;
208
+ constructor(result: Promise<ZodFetchResult<OffsetLimitPageResponse<z.output<TItemSchema>>>>, schema: TItemSchema, url: string, params: FetchOffsetLimitPageParams, requestInit?: RequestInit | undefined, options?: ZodFetchOptions | undefined);
209
+ /**
210
+ * Allow auto-paginating iteration on an unawaited list call, eg:
211
+ *
212
+ * for await (const item of client.items.list()) {
213
+ * console.log(item)
214
+ * }
215
+ */
216
+ [Symbol.asyncIterator](): AsyncGenerator<Awaited<z.output<TItemSchema>>, void, unknown>;
217
+ }
218
+
219
+ type APIHeaders = Record<string, string | null | undefined>;
220
+ declare class ApiError extends Error {
221
+ readonly status: number | undefined;
222
+ readonly headers: APIHeaders | undefined;
223
+ readonly error: Object | undefined;
224
+ readonly code: string | null | undefined;
225
+ readonly param: string | null | undefined;
226
+ readonly type: string | undefined;
227
+ constructor(status: number | undefined, error: Object | undefined, message: string | undefined, headers: APIHeaders | undefined);
228
+ private static makeMessage;
229
+ static generate(status: number | undefined, errorResponse: Object | undefined, message: string | undefined, headers: APIHeaders | undefined): ApiError;
230
+ }
231
+ declare class ApiConnectionError extends ApiError {
232
+ readonly status: undefined;
233
+ constructor({ message, cause }: {
234
+ message?: string;
235
+ cause?: Error | undefined;
236
+ });
237
+ }
238
+ declare class BadRequestError extends ApiError {
239
+ readonly status: 400;
240
+ }
241
+ declare class AuthenticationError extends ApiError {
242
+ readonly status: 401;
243
+ }
244
+ declare class PermissionDeniedError extends ApiError {
245
+ readonly status: 403;
246
+ }
247
+ declare class NotFoundError extends ApiError {
248
+ readonly status: 404;
249
+ }
250
+ declare class ConflictError extends ApiError {
251
+ readonly status: 409;
252
+ }
253
+ declare class UnprocessableEntityError extends ApiError {
254
+ readonly status: 422;
255
+ }
256
+ declare class RateLimitError extends ApiError {
257
+ readonly status: 429;
258
+ }
259
+ declare class InternalServerError extends ApiError {
260
+ }
77
261
 
78
- export { type BlobLike, type BlobLikePart, type FileLike, MultipartBody, type ResponseLike, type ToFileInput, type Uploadable, type ZodFetchOptions, createForm, defaultRetryOptions, isBlobLike, isFileLike, isFsReadStream, isRecordLike, isResponseLike, isUploadable, toFile, zodfetch, zodupload };
262
+ export { type APIHeaders, ApiConnectionError, ApiError, ApiPromise, AuthenticationError, BadRequestError, type BlobLike, type BlobLikePart, ConflictError, CursorPage, type CursorPageParams, CursorPagePromise, type CursorPageResponse, type FileLike, InternalServerError, NotFoundError, OffsetLimitPage, type OffsetLimitPageParams, OffsetLimitPagePromise, type OffsetLimitPageResponse, type Page, type PageResponse, PermissionDeniedError, RateLimitError, type ResponseLike, type ToFileInput, UnprocessableEntityError, type Uploadable, type ZodFetchOptions, defaultRetryOptions, isBlobLike, isFileLike, isFsReadStream, isRecordLike, isResponseLike, isUploadable, toFile, zodfetch, zodfetchCursorPage, zodfetchOffsetLimitPage, zodupload };