@trigger.dev/core 0.0.0-prerelease-20240603154820 → 0.0.0-prerelease-20240723165848
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.
- package/dist/api-Pl9fxB8v.d.mts +13879 -0
- package/dist/api-sNoooMbT.d.ts +13879 -0
- package/dist/{catalog-dRKTgwQ7.d.ts → catalog-H7yFiZ60.d.mts} +52 -52
- package/dist/{catalog-XTlJQaMn.d.mts → catalog-h79CG5Wy.d.ts} +52 -52
- package/dist/{manager-JkbddlcO.d.mts → common-CLW82lkt.d.mts} +280 -16
- package/dist/{manager-JkbddlcO.d.ts → common-CLW82lkt.d.ts} +280 -16
- package/dist/{eventFilterMatches-2kHImluE.d.mts → eventFilter-66NaBAMi.d.mts} +1 -3
- package/dist/{eventFilterMatches-2kHImluE.d.ts → eventFilter-66NaBAMi.d.ts} +1 -3
- package/dist/eventFilterMatches.d.mts +6 -0
- package/dist/eventFilterMatches.d.ts +6 -0
- package/dist/eventFilterMatches.js +165 -0
- package/dist/eventFilterMatches.js.map +1 -0
- package/dist/eventFilterMatches.mjs +163 -0
- package/dist/eventFilterMatches.mjs.map +1 -0
- package/dist/index.d.mts +14 -16716
- package/dist/index.d.ts +14 -16716
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/json-DBPEJQRe.d.mts +16 -0
- package/dist/json-DBPEJQRe.d.ts +16 -0
- package/dist/manager-KvCabW1a.d.mts +18 -0
- package/dist/manager-OBA35PzR.d.ts +18 -0
- package/dist/{messages-6_-q72KG.d.mts → messages-JvHJ83wv.d.mts} +2978 -291
- package/dist/{messages-6_-q72KG.d.ts → messages-JvHJ83wv.d.ts} +2978 -291
- package/dist/replacements.d.mts +22 -0
- package/dist/replacements.d.ts +22 -0
- package/dist/replacements.js +33 -0
- package/dist/replacements.js.map +1 -0
- package/dist/replacements.mjs +28 -0
- package/dist/replacements.mjs.map +1 -0
- package/dist/requestFilter-HNZQEpQb.d.ts +180 -0
- package/dist/requestFilter-b5W2_1oP.d.mts +180 -0
- package/dist/requestFilterMatches.d.mts +13 -0
- package/dist/requestFilterMatches.d.ts +13 -0
- package/dist/requestFilterMatches.js +238 -0
- package/dist/requestFilterMatches.js.map +1 -0
- package/dist/requestFilterMatches.mjs +235 -0
- package/dist/requestFilterMatches.mjs.map +1 -0
- package/dist/retry.d.mts +10 -0
- package/dist/retry.d.ts +10 -0
- package/dist/retry.js +100 -0
- package/dist/retry.js.map +1 -0
- package/dist/retry.mjs +97 -0
- package/dist/retry.mjs.map +1 -0
- package/dist/schemas/index.d.mts +2611 -0
- package/dist/schemas/index.d.ts +2611 -0
- package/dist/schemas/index.js +1630 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/index.mjs +1463 -0
- package/dist/schemas/index.mjs.map +1 -0
- package/dist/{schemas-r4ZP9S-F.d.mts → schemas-C9ssfehv.d.mts} +270 -33
- package/dist/{schemas-r4ZP9S-F.d.ts → schemas-C9ssfehv.d.ts} +270 -33
- package/dist/taskLogger-CzADe4je.d.ts +33 -0
- package/dist/taskLogger-r_AFTX45.d.mts +33 -0
- package/dist/tracer-N0p2Fuuv.d.mts +23 -0
- package/dist/tracer-N0p2Fuuv.d.ts +23 -0
- package/dist/types.d.mts +11 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/types.mjs +3 -0
- package/dist/types.mjs.map +1 -0
- package/dist/utils.d.mts +7 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +33 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +30 -0
- package/dist/utils.mjs.map +1 -0
- package/dist/v3/dev/index.d.mts +2 -1
- package/dist/v3/dev/index.d.ts +2 -1
- package/dist/v3/dev/index.js.map +1 -1
- package/dist/v3/dev/index.mjs.map +1 -1
- package/dist/v3/errors.d.mts +39 -0
- package/dist/v3/errors.d.ts +39 -0
- package/dist/v3/errors.js +204 -0
- package/dist/v3/errors.js.map +1 -0
- package/dist/v3/errors.mjs +195 -0
- package/dist/v3/errors.mjs.map +1 -0
- package/dist/v3/index.d.mts +172 -4737
- package/dist/v3/index.d.ts +172 -4737
- package/dist/v3/index.js +871 -620
- package/dist/v3/index.js.map +1 -1
- package/dist/v3/index.mjs +856 -620
- package/dist/v3/index.mjs.map +1 -1
- package/dist/v3/logger-api.d.mts +24 -0
- package/dist/v3/logger-api.d.ts +24 -0
- package/dist/v3/logger-api.js +118 -0
- package/dist/v3/logger-api.js.map +1 -0
- package/dist/v3/logger-api.mjs +116 -0
- package/dist/v3/logger-api.mjs.map +1 -0
- package/dist/v3/otel/index.js +36 -12
- package/dist/v3/otel/index.js.map +1 -1
- package/dist/v3/otel/index.mjs +36 -12
- package/dist/v3/otel/index.mjs.map +1 -1
- package/dist/v3/prod/index.d.mts +4 -3
- package/dist/v3/prod/index.d.ts +4 -3
- package/dist/v3/prod/index.js +7 -131
- package/dist/v3/prod/index.js.map +1 -1
- package/dist/v3/prod/index.mjs +7 -131
- package/dist/v3/prod/index.mjs.map +1 -1
- package/dist/v3/schemas/index.d.mts +4807 -0
- package/dist/v3/schemas/index.d.ts +4807 -0
- package/dist/v3/schemas/index.js +2065 -0
- package/dist/v3/schemas/index.js.map +1 -0
- package/dist/v3/schemas/index.mjs +1924 -0
- package/dist/v3/schemas/index.mjs.map +1 -0
- package/dist/v3/semanticInternalAttributes.d.mts +56 -0
- package/dist/v3/semanticInternalAttributes.d.ts +56 -0
- package/dist/v3/semanticInternalAttributes.js +61 -0
- package/dist/v3/semanticInternalAttributes.js.map +1 -0
- package/dist/v3/semanticInternalAttributes.mjs +59 -0
- package/dist/v3/semanticInternalAttributes.mjs.map +1 -0
- package/dist/v3/utils/durations.d.mts +15 -0
- package/dist/v3/utils/durations.d.ts +15 -0
- package/dist/v3/utils/durations.js +93 -0
- package/dist/v3/utils/durations.js.map +1 -0
- package/dist/v3/utils/durations.mjs +82 -0
- package/dist/v3/utils/durations.mjs.map +1 -0
- package/dist/v3/utils/flattenAttributes.d.mts +8 -0
- package/dist/v3/utils/flattenAttributes.d.ts +8 -0
- package/dist/v3/utils/flattenAttributes.js +131 -0
- package/dist/v3/utils/flattenAttributes.js.map +1 -0
- package/dist/v3/utils/flattenAttributes.mjs +126 -0
- package/dist/v3/utils/flattenAttributes.mjs.map +1 -0
- package/dist/v3/utils/ioSerialization.d.mts +21 -0
- package/dist/v3/utils/ioSerialization.d.ts +21 -0
- package/dist/v3/utils/ioSerialization.js +2403 -0
- package/dist/v3/utils/ioSerialization.js.map +1 -0
- package/dist/v3/utils/ioSerialization.mjs +2394 -0
- package/dist/v3/utils/ioSerialization.mjs.map +1 -0
- package/dist/v3/utils/omit.d.mts +3 -0
- package/dist/v3/utils/omit.d.ts +3 -0
- package/dist/v3/utils/omit.js +20 -0
- package/dist/v3/utils/omit.js.map +1 -0
- package/dist/v3/utils/omit.mjs +18 -0
- package/dist/v3/utils/omit.mjs.map +1 -0
- package/dist/v3/utils/retries.d.mts +46 -0
- package/dist/v3/utils/retries.d.ts +46 -0
- package/dist/v3/utils/retries.js +118 -0
- package/dist/v3/utils/retries.js.map +1 -0
- package/dist/v3/utils/retries.mjs +113 -0
- package/dist/v3/utils/retries.mjs.map +1 -0
- package/dist/v3/utils/timers.d.mts +6 -0
- package/dist/v3/utils/timers.d.ts +6 -0
- package/dist/v3/utils/timers.js +31 -0
- package/dist/v3/utils/timers.js.map +1 -0
- package/dist/v3/utils/timers.mjs +28 -0
- package/dist/v3/utils/timers.mjs.map +1 -0
- package/dist/v3/workers/index.d.mts +56 -8
- package/dist/v3/workers/index.d.ts +56 -8
- package/dist/v3/workers/index.js +755 -279
- package/dist/v3/workers/index.js.map +1 -1
- package/dist/v3/workers/index.mjs +753 -280
- package/dist/v3/workers/index.mjs.map +1 -1
- package/dist/v3/zodIpc.js.map +1 -1
- package/dist/v3/zodIpc.mjs.map +1 -1
- package/dist/v3/zodMessageHandler.d.mts +16 -3
- package/dist/v3/zodMessageHandler.d.ts +16 -3
- package/dist/v3/zodMessageHandler.js +77 -23
- package/dist/v3/zodMessageHandler.js.map +1 -1
- package/dist/v3/zodMessageHandler.mjs +77 -23
- package/dist/v3/zodMessageHandler.mjs.map +1 -1
- package/dist/v3/zodNamespace.js +59 -28
- package/dist/v3/zodNamespace.js.map +1 -1
- package/dist/v3/zodNamespace.mjs +60 -29
- package/dist/v3/zodNamespace.mjs.map +1 -1
- package/dist/v3/zodSocket.d.mts +8 -3
- package/dist/v3/zodSocket.d.ts +8 -3
- package/dist/v3/zodSocket.js +56 -25
- package/dist/v3/zodSocket.js.map +1 -1
- package/dist/v3/zodSocket.mjs +57 -26
- package/dist/v3/zodSocket.mjs.map +1 -1
- package/dist/v3/zodfetch.d.mts +15 -58
- package/dist/v3/zodfetch.d.ts +15 -58
- package/dist/v3/zodfetch.js +246 -156
- package/dist/v3/zodfetch.js.map +1 -1
- package/dist/v3/zodfetch.mjs +244 -149
- package/dist/v3/zodfetch.mjs.map +1 -1
- package/dist/versions.d.mts +11 -0
- package/dist/versions.d.ts +11 -0
- package/dist/versions.js +31 -0
- package/dist/versions.js.map +1 -0
- package/dist/versions.mjs +27 -0
- package/dist/versions.mjs.map +1 -0
- package/package.json +154 -10
package/dist/v3/zodfetch.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { R as RetryOptions } from '../schemas-
|
|
3
|
-
import {
|
|
2
|
+
import { R as RetryOptions } from '../schemas-C9ssfehv.mjs';
|
|
3
|
+
import { Attributes, Span } from '@opentelemetry/api';
|
|
4
|
+
import { T as TriggerTracer } from '../tracer-N0p2Fuuv.mjs';
|
|
5
|
+
import '@opentelemetry/api-logs';
|
|
4
6
|
|
|
5
7
|
interface CursorPageParams {
|
|
6
8
|
limit?: number;
|
|
@@ -82,7 +84,14 @@ declare const defaultRetryOptions: {
|
|
|
82
84
|
};
|
|
83
85
|
type ZodFetchOptions = {
|
|
84
86
|
retry?: RetryOptions;
|
|
87
|
+
tracer?: TriggerTracer;
|
|
88
|
+
name?: string;
|
|
89
|
+
attributes?: Attributes;
|
|
90
|
+
icon?: string;
|
|
91
|
+
onResponseBody?: (body: unknown, span: Span) => void;
|
|
85
92
|
};
|
|
93
|
+
type ApiRequestOptions = Pick<ZodFetchOptions, "retry">;
|
|
94
|
+
declare const isRequestOptions: (obj: unknown) => obj is ApiRequestOptions;
|
|
86
95
|
interface FetchCursorPageParams extends CursorPageParams {
|
|
87
96
|
query?: URLSearchParams;
|
|
88
97
|
}
|
|
@@ -92,65 +101,10 @@ interface FetchOffsetLimitPageParams extends OffsetLimitPageParams {
|
|
|
92
101
|
declare function zodfetch<TResponseBodySchema extends z.ZodTypeAny>(schema: TResponseBodySchema, url: string, requestInit?: RequestInit, options?: ZodFetchOptions): ApiPromise<z.output<TResponseBodySchema>>;
|
|
93
102
|
declare function zodfetchCursorPage<TItemSchema extends z.ZodTypeAny>(schema: TItemSchema, url: string, params: FetchCursorPageParams, requestInit?: RequestInit, options?: ZodFetchOptions): CursorPagePromise<TItemSchema>;
|
|
94
103
|
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
104
|
type ZodFetchResult<T> = {
|
|
97
105
|
data: T;
|
|
98
106
|
response: Response;
|
|
99
107
|
};
|
|
100
|
-
type ToFileInput = Uploadable | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
101
|
-
/**
|
|
102
|
-
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
103
|
-
* @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
|
|
104
|
-
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
105
|
-
* @param {Object=} options additional properties
|
|
106
|
-
* @param {string=} options.type the MIME type of the content
|
|
107
|
-
* @param {number=} options.lastModified the last modified timestamp
|
|
108
|
-
* @returns a {@link File} with the given properties
|
|
109
|
-
*/
|
|
110
|
-
declare function toFile(value: ToFileInput | PromiseLike<ToFileInput>, name?: string | null | undefined, options?: FilePropertyBag | undefined): Promise<FileLike>;
|
|
111
|
-
/**
|
|
112
|
-
* Intended to match web.Blob, node.Blob, node-fetch.Blob, etc.
|
|
113
|
-
*/
|
|
114
|
-
interface BlobLike {
|
|
115
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
116
|
-
readonly size: number;
|
|
117
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
118
|
-
readonly type: string;
|
|
119
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
120
|
-
text(): Promise<string>;
|
|
121
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
122
|
-
slice(start?: number, end?: number): BlobLike;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Intended to match web.File, node.File, node-fetch.File, etc.
|
|
126
|
-
*/
|
|
127
|
-
interface FileLike extends BlobLike {
|
|
128
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
129
|
-
readonly lastModified: number;
|
|
130
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
131
|
-
readonly name: string;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Intended to match web.Response, node.Response, node-fetch.Response, etc.
|
|
135
|
-
*/
|
|
136
|
-
interface ResponseLike {
|
|
137
|
-
url: string;
|
|
138
|
-
blob(): Promise<BlobLike>;
|
|
139
|
-
}
|
|
140
|
-
type Uploadable = FileLike | ResponseLike | Readable;
|
|
141
|
-
declare const isResponseLike: (value: any) => value is ResponseLike;
|
|
142
|
-
declare const isFileLike: (value: any) => value is FileLike;
|
|
143
|
-
/**
|
|
144
|
-
* The BlobLike type omits arrayBuffer() because @types/node-fetch@^2.6.4 lacks it; but this check
|
|
145
|
-
* adds the arrayBuffer() method type because it is available and used at runtime
|
|
146
|
-
*/
|
|
147
|
-
declare const isBlobLike: (value: any) => value is BlobLike & {
|
|
148
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
149
|
-
};
|
|
150
|
-
declare const isFsReadStream: (value: any) => value is Readable;
|
|
151
|
-
declare const isUploadable: (value: any) => value is Uploadable;
|
|
152
|
-
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
|
|
153
|
-
declare const isRecordLike: (value: any) => value is Record<string, string>;
|
|
154
108
|
/**
|
|
155
109
|
* A subclass of `Promise` providing additional helper methods
|
|
156
110
|
* for interacting with the SDK.
|
|
@@ -215,6 +169,8 @@ declare class OffsetLimitPagePromise<TItemSchema extends z.ZodTypeAny> extends A
|
|
|
215
169
|
*/
|
|
216
170
|
[Symbol.asyncIterator](): AsyncGenerator<Awaited<z.output<TItemSchema>>, void, unknown>;
|
|
217
171
|
}
|
|
172
|
+
declare function isEmptyObj(obj: Object | null | undefined): boolean;
|
|
173
|
+
declare function hasOwn(obj: Object, key: string): boolean;
|
|
218
174
|
|
|
219
175
|
type APIHeaders = Record<string, string | null | undefined>;
|
|
220
176
|
declare class ApiError extends Error {
|
|
@@ -255,8 +211,9 @@ declare class UnprocessableEntityError extends ApiError {
|
|
|
255
211
|
}
|
|
256
212
|
declare class RateLimitError extends ApiError {
|
|
257
213
|
readonly status: 429;
|
|
214
|
+
get millisecondsUntilReset(): number | undefined;
|
|
258
215
|
}
|
|
259
216
|
declare class InternalServerError extends ApiError {
|
|
260
217
|
}
|
|
261
218
|
|
|
262
|
-
export { type APIHeaders, ApiConnectionError, ApiError, ApiPromise,
|
|
219
|
+
export { type APIHeaders, ApiConnectionError, ApiError, ApiPromise, type ApiRequestOptions, AuthenticationError, BadRequestError, ConflictError, CursorPage, type CursorPageParams, CursorPagePromise, type CursorPageResponse, InternalServerError, NotFoundError, OffsetLimitPage, type OffsetLimitPageParams, OffsetLimitPagePromise, type OffsetLimitPageResponse, type Page, type PageResponse, PermissionDeniedError, RateLimitError, UnprocessableEntityError, type ZodFetchOptions, defaultRetryOptions, hasOwn, isEmptyObj, isRequestOptions, zodfetch, zodfetchCursorPage, zodfetchOffsetLimitPage };
|
package/dist/v3/zodfetch.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { R as RetryOptions } from '../schemas-
|
|
3
|
-
import {
|
|
2
|
+
import { R as RetryOptions } from '../schemas-C9ssfehv.js';
|
|
3
|
+
import { Attributes, Span } from '@opentelemetry/api';
|
|
4
|
+
import { T as TriggerTracer } from '../tracer-N0p2Fuuv.js';
|
|
5
|
+
import '@opentelemetry/api-logs';
|
|
4
6
|
|
|
5
7
|
interface CursorPageParams {
|
|
6
8
|
limit?: number;
|
|
@@ -82,7 +84,14 @@ declare const defaultRetryOptions: {
|
|
|
82
84
|
};
|
|
83
85
|
type ZodFetchOptions = {
|
|
84
86
|
retry?: RetryOptions;
|
|
87
|
+
tracer?: TriggerTracer;
|
|
88
|
+
name?: string;
|
|
89
|
+
attributes?: Attributes;
|
|
90
|
+
icon?: string;
|
|
91
|
+
onResponseBody?: (body: unknown, span: Span) => void;
|
|
85
92
|
};
|
|
93
|
+
type ApiRequestOptions = Pick<ZodFetchOptions, "retry">;
|
|
94
|
+
declare const isRequestOptions: (obj: unknown) => obj is ApiRequestOptions;
|
|
86
95
|
interface FetchCursorPageParams extends CursorPageParams {
|
|
87
96
|
query?: URLSearchParams;
|
|
88
97
|
}
|
|
@@ -92,65 +101,10 @@ interface FetchOffsetLimitPageParams extends OffsetLimitPageParams {
|
|
|
92
101
|
declare function zodfetch<TResponseBodySchema extends z.ZodTypeAny>(schema: TResponseBodySchema, url: string, requestInit?: RequestInit, options?: ZodFetchOptions): ApiPromise<z.output<TResponseBodySchema>>;
|
|
93
102
|
declare function zodfetchCursorPage<TItemSchema extends z.ZodTypeAny>(schema: TItemSchema, url: string, params: FetchCursorPageParams, requestInit?: RequestInit, options?: ZodFetchOptions): CursorPagePromise<TItemSchema>;
|
|
94
103
|
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
104
|
type ZodFetchResult<T> = {
|
|
97
105
|
data: T;
|
|
98
106
|
response: Response;
|
|
99
107
|
};
|
|
100
|
-
type ToFileInput = Uploadable | Exclude<BlobLikePart, string> | AsyncIterable<BlobLikePart>;
|
|
101
|
-
/**
|
|
102
|
-
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
103
|
-
* @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
|
|
104
|
-
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
105
|
-
* @param {Object=} options additional properties
|
|
106
|
-
* @param {string=} options.type the MIME type of the content
|
|
107
|
-
* @param {number=} options.lastModified the last modified timestamp
|
|
108
|
-
* @returns a {@link File} with the given properties
|
|
109
|
-
*/
|
|
110
|
-
declare function toFile(value: ToFileInput | PromiseLike<ToFileInput>, name?: string | null | undefined, options?: FilePropertyBag | undefined): Promise<FileLike>;
|
|
111
|
-
/**
|
|
112
|
-
* Intended to match web.Blob, node.Blob, node-fetch.Blob, etc.
|
|
113
|
-
*/
|
|
114
|
-
interface BlobLike {
|
|
115
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
116
|
-
readonly size: number;
|
|
117
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
118
|
-
readonly type: string;
|
|
119
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
120
|
-
text(): Promise<string>;
|
|
121
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
122
|
-
slice(start?: number, end?: number): BlobLike;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Intended to match web.File, node.File, node-fetch.File, etc.
|
|
126
|
-
*/
|
|
127
|
-
interface FileLike extends BlobLike {
|
|
128
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
129
|
-
readonly lastModified: number;
|
|
130
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
131
|
-
readonly name: string;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Intended to match web.Response, node.Response, node-fetch.Response, etc.
|
|
135
|
-
*/
|
|
136
|
-
interface ResponseLike {
|
|
137
|
-
url: string;
|
|
138
|
-
blob(): Promise<BlobLike>;
|
|
139
|
-
}
|
|
140
|
-
type Uploadable = FileLike | ResponseLike | Readable;
|
|
141
|
-
declare const isResponseLike: (value: any) => value is ResponseLike;
|
|
142
|
-
declare const isFileLike: (value: any) => value is FileLike;
|
|
143
|
-
/**
|
|
144
|
-
* The BlobLike type omits arrayBuffer() because @types/node-fetch@^2.6.4 lacks it; but this check
|
|
145
|
-
* adds the arrayBuffer() method type because it is available and used at runtime
|
|
146
|
-
*/
|
|
147
|
-
declare const isBlobLike: (value: any) => value is BlobLike & {
|
|
148
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
149
|
-
};
|
|
150
|
-
declare const isFsReadStream: (value: any) => value is Readable;
|
|
151
|
-
declare const isUploadable: (value: any) => value is Uploadable;
|
|
152
|
-
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
|
|
153
|
-
declare const isRecordLike: (value: any) => value is Record<string, string>;
|
|
154
108
|
/**
|
|
155
109
|
* A subclass of `Promise` providing additional helper methods
|
|
156
110
|
* for interacting with the SDK.
|
|
@@ -215,6 +169,8 @@ declare class OffsetLimitPagePromise<TItemSchema extends z.ZodTypeAny> extends A
|
|
|
215
169
|
*/
|
|
216
170
|
[Symbol.asyncIterator](): AsyncGenerator<Awaited<z.output<TItemSchema>>, void, unknown>;
|
|
217
171
|
}
|
|
172
|
+
declare function isEmptyObj(obj: Object | null | undefined): boolean;
|
|
173
|
+
declare function hasOwn(obj: Object, key: string): boolean;
|
|
218
174
|
|
|
219
175
|
type APIHeaders = Record<string, string | null | undefined>;
|
|
220
176
|
declare class ApiError extends Error {
|
|
@@ -255,8 +211,9 @@ declare class UnprocessableEntityError extends ApiError {
|
|
|
255
211
|
}
|
|
256
212
|
declare class RateLimitError extends ApiError {
|
|
257
213
|
readonly status: 429;
|
|
214
|
+
get millisecondsUntilReset(): number | undefined;
|
|
258
215
|
}
|
|
259
216
|
declare class InternalServerError extends ApiError {
|
|
260
217
|
}
|
|
261
218
|
|
|
262
|
-
export { type APIHeaders, ApiConnectionError, ApiError, ApiPromise,
|
|
219
|
+
export { type APIHeaders, ApiConnectionError, ApiError, ApiPromise, type ApiRequestOptions, AuthenticationError, BadRequestError, ConflictError, CursorPage, type CursorPageParams, CursorPagePromise, type CursorPageResponse, InternalServerError, NotFoundError, OffsetLimitPage, type OffsetLimitPageParams, OffsetLimitPagePromise, type OffsetLimitPageResponse, type Page, type PageResponse, PermissionDeniedError, RateLimitError, UnprocessableEntityError, type ZodFetchOptions, defaultRetryOptions, hasOwn, isEmptyObj, isRequestOptions, zodfetch, zodfetchCursorPage, zodfetchOffsetLimitPage };
|