@typeship-ax/cli 0.22.0 → 0.24.0
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/AGENTS.md +13 -9
- package/README.md +14 -27
- package/api.json +8898 -9026
- package/api.md +370 -328
- package/dist/arguments.d.ts +54 -0
- package/dist/arguments.d.ts.map +1 -0
- package/dist/arguments.js +265 -0
- package/dist/cli-agent.d.ts +73 -9
- package/dist/cli-agent.d.ts.map +1 -1
- package/dist/cli-agent.js +331 -44
- package/dist/cli.js +802 -291
- package/dist/core/http.d.ts +162 -19
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +381 -48
- package/dist/core/pagination.d.ts +42 -6
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +111 -17
- package/dist/credential-storage.d.ts +10 -3
- package/dist/credential-storage.d.ts.map +1 -1
- package/dist/credential-storage.js +15 -6
- package/dist/dates.d.ts +1 -1
- package/dist/dates.js +1 -1
- package/dist/errors.d.ts +20 -84
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +20 -108
- package/dist/fields.d.ts +36 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +187 -0
- package/dist/index.d.ts +28 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -25
- package/dist/named-credentials.d.ts +19 -0
- package/dist/named-credentials.d.ts.map +1 -1
- package/dist/named-credentials.js +81 -1
- package/dist/oauth-login.d.ts +8 -2
- package/dist/oauth-login.d.ts.map +1 -1
- package/dist/oauth-login.js +31 -19
- package/dist/oauth-request.d.ts +7 -1
- package/dist/oauth-request.d.ts.map +1 -1
- package/dist/oauth-request.js +26 -4
- package/dist/oauth-session.d.ts +13 -1
- package/dist/oauth-session.d.ts.map +1 -1
- package/dist/oauth-session.js +34 -18
- package/dist/ops.d.ts +58 -5
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +110 -41
- package/dist/polling-login.d.ts +8 -2
- package/dist/polling-login.d.ts.map +1 -1
- package/dist/polling-login.js +25 -11
- package/dist/resources/api-keys.d.ts +10 -7
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +10 -31
- package/dist/resources/deliveries.d.ts +89 -5
- package/dist/resources/deliveries.d.ts.map +1 -1
- package/dist/resources/deliveries.js +96 -19
- package/dist/resources/drafts.d.ts +16 -16
- package/dist/resources/drafts.d.ts.map +1 -1
- package/dist/resources/drafts.js +12 -65
- package/dist/resources/files.d.ts +4 -4
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +3 -12
- package/dist/resources/generations.d.ts +16 -16
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +23 -47
- package/dist/resources/organization.d.ts +4 -4
- package/dist/resources/organization.d.ts.map +1 -1
- package/dist/resources/organization.js +3 -10
- package/dist/resources/{generate.d.ts → packages.d.ts} +16 -16
- package/dist/resources/packages.d.ts.map +1 -0
- package/dist/resources/{generate.js → packages.js} +13 -29
- package/dist/resources/projects.d.ts +50 -50
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +60 -116
- package/dist/resources/releases.d.ts +22 -17
- package/dist/resources/releases.d.ts.map +1 -1
- package/dist/resources/releases.js +19 -40
- package/dist/resources/spec-revisions.d.ts +16 -7
- package/dist/resources/spec-revisions.d.ts.map +1 -1
- package/dist/resources/spec-revisions.js +7 -29
- package/dist/resources/specs.d.ts +7 -7
- package/dist/resources/specs.d.ts.map +1 -1
- package/dist/resources/specs.js +6 -34
- package/dist/resources/targets.d.ts +49 -49
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +59 -115
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +83 -81
- package/dist/search.d.ts +54 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +421 -0
- package/dist/table.d.ts +28 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +167 -0
- package/dist/type-docs.d.ts +61 -0
- package/dist/type-docs.d.ts.map +1 -0
- package/dist/type-docs.js +174 -0
- package/dist/types.d.ts +499 -339
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -18
- package/package.json +5 -2
- package/src/arguments.ts +254 -0
- package/src/cli-agent.ts +351 -46
- package/src/cli.ts +753 -266
- package/src/core/http.ts +457 -58
- package/src/core/pagination.ts +129 -18
- package/src/credential-storage.ts +16 -6
- package/src/dates.ts +1 -1
- package/src/errors.ts +46 -115
- package/src/fields.ts +167 -0
- package/src/index.ts +45 -28
- package/src/named-credentials.ts +66 -1
- package/src/oauth-login.ts +36 -21
- package/src/oauth-request.ts +32 -6
- package/src/oauth-session.ts +37 -19
- package/src/ops.ts +146 -45
- package/src/polling-login.ts +24 -11
- package/src/resources/api-keys.ts +34 -48
- package/src/resources/deliveries.ts +213 -32
- package/src/resources/drafts.ts +62 -109
- package/src/resources/files.ts +19 -20
- package/src/resources/generations.ts +61 -79
- package/src/resources/organization.ts +11 -16
- package/src/resources/{generate.ts → packages.ts} +43 -51
- package/src/resources/projects.ts +145 -200
- package/src/resources/releases.ts +50 -67
- package/src/resources/spec-revisions.ts +40 -49
- package/src/resources/specs.ts +39 -59
- package/src/resources/targets.ts +144 -194
- package/src/schemas.ts +83 -81
- package/src/search.ts +434 -0
- package/src/table.ts +167 -0
- package/src/type-docs.ts +205 -0
- package/src/types.ts +538 -357
- package/dist/console-login-check.d.ts +0 -21
- package/dist/console-login-check.d.ts.map +0 -1
- package/dist/console-login-check.js +0 -107
- package/dist/console-login-contract.d.ts +0 -45
- package/dist/console-login-contract.d.ts.map +0 -1
- package/dist/console-login-contract.js +0 -40
- package/dist/resources/generate.d.ts.map +0 -1
- package/dist/resources/publications.d.ts +0 -47
- package/dist/resources/publications.d.ts.map +0 -1
- package/dist/resources/publications.js +0 -70
- package/src/console-login-check.ts +0 -88
- package/src/console-login-contract.ts +0 -65
- package/src/resources/publications.ts +0 -140
package/dist/core/http.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Runtime core. Generated by
|
|
2
|
+
* Runtime core. Generated by Typeship — https://typeship.dev
|
|
3
3
|
* Zero dependencies: built on the platform fetch API (Node 20+, browsers, edge).
|
|
4
4
|
*/
|
|
5
5
|
export interface RequestOptions {
|
|
@@ -11,6 +11,14 @@ export interface RequestOptions {
|
|
|
11
11
|
timeoutMs?: number;
|
|
12
12
|
/** Retry attempts after the first try. Overrides the client default. */
|
|
13
13
|
maxRetries?: number;
|
|
14
|
+
/** For a list that pages by URL (a Link header or a next-page URL field):
|
|
15
|
+
* start from this page URL, as a previous page's nextPageParams() gave it.
|
|
16
|
+
* It must be on the API's origin. */
|
|
17
|
+
pageUrl?: string;
|
|
18
|
+
/** Receives this call's response metadata (status, headers, ETag,
|
|
19
|
+
* rate-limit state) once a response arrives, whether the call succeeded
|
|
20
|
+
* or failed. A 304 Not Modified raises `NotModifiedError`. */
|
|
21
|
+
onResponse?: (response: ResponseMeta) => void;
|
|
14
22
|
}
|
|
15
23
|
export interface ResponseMeta {
|
|
16
24
|
status: number;
|
|
@@ -22,12 +30,42 @@ export interface ResponseMeta {
|
|
|
22
30
|
/** Request identifier from the JSON response body, or from headers for
|
|
23
31
|
* raw and bodyless responses. */
|
|
24
32
|
requestId?: string;
|
|
33
|
+
/** The `ETag` header, for a later conditional request (`If-None-Match`). */
|
|
34
|
+
etag?: string;
|
|
35
|
+
/** The `Last-Modified` header, for a later `If-Modified-Since`. */
|
|
36
|
+
lastModified?: string;
|
|
37
|
+
/** True for a 304 Not Modified: the resource matched the conditional
|
|
38
|
+
* request, and the call raised `NotModifiedError`. */
|
|
39
|
+
notModified?: boolean;
|
|
40
|
+
/** Set when the API said the call was rate limited. */
|
|
41
|
+
rateLimit?: RateLimitInfo;
|
|
25
42
|
}
|
|
43
|
+
/** When a rate-limited call can be retried. Both fields are absent when the
|
|
44
|
+
* API did not say. */
|
|
45
|
+
export interface RateLimitInfo {
|
|
46
|
+
/** The instant the limit resets (from `Retry-After` or `x-ratelimit-reset`). */
|
|
47
|
+
retryAt?: Date;
|
|
48
|
+
/** Milliseconds from when the response arrived until `retryAt`. */
|
|
49
|
+
retryAfterMs?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Whether a response is a rate limit, and when to retry. A 429 always is. A
|
|
53
|
+
* 403 is when it says the quota is spent (`x-ratelimit-remaining: 0`) or asks
|
|
54
|
+
* the caller to wait (`Retry-After`), which is how GitHub signals its primary
|
|
55
|
+
* and secondary limits. Undefined for every other response.
|
|
56
|
+
*/
|
|
57
|
+
export declare function rateLimitInfo(status: number, headers: Headers, now?: number): RateLimitInfo | undefined;
|
|
26
58
|
/**
|
|
27
59
|
* A static credential or a callback resolved before every attempt. Use a
|
|
28
60
|
* callback for tokens that expire (OAuth access tokens, STS, Vault).
|
|
29
61
|
*/
|
|
30
|
-
export type AuthValue = string | (() => string | Promise<string>);
|
|
62
|
+
export type AuthValue = string | ((context: CredentialContext) => string | Promise<string>);
|
|
63
|
+
/** Passed to credential callbacks. `rejected` is true once, on the attempt
|
|
64
|
+
* after the API answered 401 to the value this callback last returned:
|
|
65
|
+
* refresh or replace the token instead of returning it again. */
|
|
66
|
+
export interface CredentialContext {
|
|
67
|
+
rejected: boolean;
|
|
68
|
+
}
|
|
31
69
|
/** Passed to onRequest/onResponse hooks. Mutations to headers and url in
|
|
32
70
|
* onRequest apply to the outgoing request. */
|
|
33
71
|
export interface RequestContext {
|
|
@@ -64,14 +102,78 @@ export declare class SdkError extends Error {
|
|
|
64
102
|
readonly body: unknown;
|
|
65
103
|
constructor(message: string, code: string, status?: number | null, body?: unknown, requestId?: string);
|
|
66
104
|
}
|
|
67
|
-
/** Base class for every HTTP error response.
|
|
105
|
+
/** Base class for every HTTP error response. The message leads with the
|
|
106
|
+
* status and the API's own message ("HTTP 404: No such customer"), then the
|
|
107
|
+
* next step. `code` is the API's error code when the body names one. */
|
|
68
108
|
export declare class ApiError<S extends number = number, B = unknown> extends SdkError {
|
|
69
109
|
readonly status: S;
|
|
70
110
|
readonly body: B;
|
|
71
111
|
readonly response: ResponseMeta;
|
|
72
|
-
|
|
112
|
+
/** Set when the API said this call was rate limited (a 429, or a 403
|
|
113
|
+
* whose headers say the quota is spent): when to retry. */
|
|
114
|
+
readonly rateLimit?: RateLimitInfo;
|
|
115
|
+
/** `summary` leads the message ("HTTP 404"); the API's message follows it. */
|
|
116
|
+
constructor(summary: string, status: S, body: B, response: ResponseMeta, own?: {
|
|
117
|
+
message: string;
|
|
118
|
+
code: string;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/** HTTP 400: the API rejected the request as malformed. Raised for every
|
|
122
|
+
* 400, documented or not; `body` is typed where the operation declares it. */
|
|
123
|
+
export declare class BadRequestError<B = unknown> extends ApiError<400, B> {
|
|
124
|
+
constructor(body: B, response: ResponseMeta);
|
|
125
|
+
}
|
|
126
|
+
/** HTTP 401: the credential is missing, invalid or expired. */
|
|
127
|
+
export declare class UnauthorizedError<B = unknown> extends ApiError<401, B> {
|
|
128
|
+
constructor(body: B, response: ResponseMeta);
|
|
129
|
+
}
|
|
130
|
+
/** HTTP 403: the credential lacks access. A 403 that signals a rate limit
|
|
131
|
+
* raises RateLimitError instead. */
|
|
132
|
+
export declare class ForbiddenError<B = unknown> extends ApiError<403, B> {
|
|
133
|
+
constructor(body: B, response: ResponseMeta);
|
|
134
|
+
}
|
|
135
|
+
/** HTTP 404: the resource or path does not exist. */
|
|
136
|
+
export declare class NotFoundError<B = unknown> extends ApiError<404, B> {
|
|
137
|
+
constructor(body: B, response: ResponseMeta);
|
|
138
|
+
}
|
|
139
|
+
/** HTTP 409: the request conflicts with the resource's current state. */
|
|
140
|
+
export declare class ConflictError<B = unknown> extends ApiError<409, B> {
|
|
141
|
+
constructor(body: B, response: ResponseMeta);
|
|
142
|
+
}
|
|
143
|
+
/** HTTP 422: the request was well formed but failed validation. */
|
|
144
|
+
export declare class UnprocessableEntityError<B = unknown> extends ApiError<422, B> {
|
|
145
|
+
constructor(body: B, response: ResponseMeta);
|
|
146
|
+
}
|
|
147
|
+
/** The API rate limited the call: every 429, and a 403 whose headers say
|
|
148
|
+
* the quota is spent. `rateLimit.retryAt` says when to try again. */
|
|
149
|
+
export declare class RateLimitError<B = unknown> extends ApiError<number, B> {
|
|
150
|
+
constructor(body: B, response: ResponseMeta);
|
|
151
|
+
}
|
|
152
|
+
/** Any 5xx: the API failed to handle a valid request. */
|
|
153
|
+
export declare class ServerError<B = unknown> extends ApiError<number, B> {
|
|
154
|
+
constructor(body: B, response: ResponseMeta);
|
|
73
155
|
}
|
|
74
|
-
/**
|
|
156
|
+
/** HTTP 304: a conditional request (`If-None-Match`, `If-Modified-Since`)
|
|
157
|
+
* matched, so the resource has not changed and the response has no body.
|
|
158
|
+
* Raised only when the caller sent a conditional header. `etag` and
|
|
159
|
+
* `lastModified` are the validators to send next time. */
|
|
160
|
+
export declare class NotModifiedError extends ApiError<304, undefined> {
|
|
161
|
+
/** The response's `ETag` header. */
|
|
162
|
+
readonly etag?: string;
|
|
163
|
+
/** The response's `Last-Modified` header. */
|
|
164
|
+
readonly lastModified?: string;
|
|
165
|
+
constructor(response: ResponseMeta);
|
|
166
|
+
}
|
|
167
|
+
/** A 2xx response whose payload reported a failure: a declared envelope
|
|
168
|
+
* flag set to false (`{"ok": false}`, `{"success": false}`), or a GraphQL
|
|
169
|
+
* result that is one of the schema's error types. */
|
|
170
|
+
export declare class PayloadError extends ApiError<number, unknown> {
|
|
171
|
+
/** The GraphQL error type the result resolved to, for GraphQL operations. */
|
|
172
|
+
readonly typename?: string;
|
|
173
|
+
constructor(body: unknown, response: ResponseMeta, typename?: string);
|
|
174
|
+
}
|
|
175
|
+
/** A status with no family class (a 402, 405 or 410, say) that the
|
|
176
|
+
* operation did not document. */
|
|
75
177
|
export declare class UnexpectedApiError extends ApiError<number, unknown> {
|
|
76
178
|
constructor(status: number, body: unknown, response: ResponseMeta);
|
|
77
179
|
}
|
|
@@ -100,21 +202,37 @@ export declare class ValidationError extends SdkError {
|
|
|
100
202
|
* are ignored: validation can miss drift but never false-alarms.
|
|
101
203
|
*/
|
|
102
204
|
export declare function validateAgainstSchema(value: unknown, schema: unknown, path: string, out: Violation[], defs?: Record<string, unknown>): void;
|
|
103
|
-
/**
|
|
205
|
+
/** Why a request failed in transit, as TransportError's `code`: the
|
|
206
|
+
* caller's AbortSignal fired ("aborted"), the per-attempt timeout elapsed
|
|
207
|
+
* ("timeout"), or the connection or body read failed ("transport_error"). */
|
|
208
|
+
export type TransportFailure = "aborted" | "timeout" | "transport_error";
|
|
209
|
+
/** The request failed before a complete HTTP response arrived (network failure, timeout, abort, or truncated body); `code` says which. */
|
|
104
210
|
export declare class TransportError extends SdkError {
|
|
105
211
|
readonly cause?: unknown;
|
|
106
212
|
readonly response?: ResponseMeta;
|
|
107
|
-
|
|
213
|
+
readonly code: TransportFailure;
|
|
214
|
+
constructor(message: string, cause?: unknown, response?: ResponseMeta, failure?: TransportFailure);
|
|
108
215
|
}
|
|
109
216
|
type ErrorCtor = new (body: any, response: ResponseMeta) => ApiError<number, unknown>;
|
|
110
217
|
export interface CoreRequest {
|
|
111
218
|
security?: Record<string, string[]>[];
|
|
112
219
|
method: string;
|
|
113
220
|
path: string;
|
|
221
|
+
/** A full URL on the API's origin (a next-page link), sent instead of
|
|
222
|
+
* path and query. */
|
|
223
|
+
url?: string;
|
|
114
224
|
query?: Record<string, unknown>;
|
|
115
225
|
headers?: Record<string, string | undefined>;
|
|
116
226
|
body?: unknown;
|
|
117
227
|
bodyKind?: "json" | "form" | "multipart" | "text" | "binary";
|
|
228
|
+
/** Per-field wire encoding (the media type's `encoding`): a multipart
|
|
229
|
+
* part's Content-Type, or the delimiter of an unexploded form array. */
|
|
230
|
+
bodyEncoding?: Record<string, {
|
|
231
|
+
contentType?: string;
|
|
232
|
+
delimiter?: string;
|
|
233
|
+
}>;
|
|
234
|
+
/** Multipart fields that must hold a Blob or File (or an array of them). */
|
|
235
|
+
fileFields?: string[];
|
|
118
236
|
/** Status matcher -> generated error class ("404", "4XX", "default"). */
|
|
119
237
|
errors?: Record<string, ErrorCtor>;
|
|
120
238
|
/** Idempotent requests are retried automatically. */
|
|
@@ -124,12 +242,15 @@ export interface CoreRequest {
|
|
|
124
242
|
idempotencyKey?: string;
|
|
125
243
|
/** Key into the schemas table for optional runtime validation. */
|
|
126
244
|
schemaKey?: string;
|
|
127
|
-
/**
|
|
245
|
+
/** The success body's envelope flag (`ok`, `success`): `false` there is a
|
|
246
|
+
* failure reported inside a 2xx response, raised as a PayloadError. */
|
|
247
|
+
failureFlag?: string;
|
|
248
|
+
/** Operation-level retry policy from the API definition, merged over the
|
|
128
249
|
* client-level policy; per-call options.maxRetries still wins. */
|
|
129
250
|
retry?: RetryPolicy;
|
|
130
251
|
options?: RequestOptions;
|
|
131
252
|
}
|
|
132
|
-
/** Tunable retry behavior (
|
|
253
|
+
/** Tunable retry behavior (defaults preserved when unset). */
|
|
133
254
|
export interface RetryPolicy {
|
|
134
255
|
maxRetries?: number;
|
|
135
256
|
/** Replaces the default retryable set (408, 429, 500, 502, 503, 504). */
|
|
@@ -176,16 +297,18 @@ export interface CoreConfig {
|
|
|
176
297
|
responses: boolean;
|
|
177
298
|
mode: "throw" | "warn";
|
|
178
299
|
};
|
|
179
|
-
/**
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
schemaDefs?: Record<string, unknown>;
|
|
186
|
-
/** Root-level retry policy (x-typeship-retries at the document root). */
|
|
300
|
+
/** Loads the per-operation schema table, keyed "resource.method", and the
|
|
301
|
+
* shared component definitions it references (see schemas.ts). Called on
|
|
302
|
+
* the first validated request, so the table stays out of the startup path
|
|
303
|
+
* and, in a bundler that splits dynamic imports, out of the main bundle. */
|
|
304
|
+
loadSchemas?: () => Promise<SchemaTables>;
|
|
305
|
+
/** API-wide retry policy from the API definition. */
|
|
187
306
|
retry?: RetryPolicy;
|
|
188
|
-
/**
|
|
307
|
+
/** The longest server-requested wait (Retry-After, x-ratelimit-reset) a
|
|
308
|
+
* retry honors. A longer wait fails the call at once with the reset time
|
|
309
|
+
* instead of sleeping. Default 60000ms. */
|
|
310
|
+
maxRetryWaitMs?: number;
|
|
311
|
+
/** Client-level values for global parameters, by wire name. */
|
|
189
312
|
globals?: Record<string, unknown>;
|
|
190
313
|
/** Header names the spec's API-key schemes use. fetch drops the standard
|
|
191
314
|
* credential headers on a cross-origin redirect but knows nothing of these,
|
|
@@ -206,17 +329,29 @@ export interface DebugEvent {
|
|
|
206
329
|
/** transport failure message, when the request failed before a complete response */
|
|
207
330
|
error?: string;
|
|
208
331
|
}
|
|
332
|
+
/** The validation tables schemas.ts exports. */
|
|
333
|
+
export interface SchemaTables {
|
|
334
|
+
SCHEMAS: Record<string, {
|
|
335
|
+
req?: unknown;
|
|
336
|
+
res?: unknown;
|
|
337
|
+
}>;
|
|
338
|
+
DEFS: Record<string, unknown>;
|
|
339
|
+
}
|
|
209
340
|
export declare class HttpCore {
|
|
210
341
|
readonly config: CoreConfig;
|
|
342
|
+
private schemaTables?;
|
|
211
343
|
/** Lowercased header names dropped on a cross-origin hop. */
|
|
212
344
|
private readonly sensitiveHeaders;
|
|
213
345
|
/** Whether this runtime follows redirects itself instead of letting the
|
|
214
346
|
* platform do it — see followRedirects(). */
|
|
215
347
|
private readonly manualRedirects;
|
|
216
348
|
constructor(config: CoreConfig);
|
|
217
|
-
/** The client-level value for
|
|
349
|
+
/** The client-level value for a global parameter. */
|
|
218
350
|
globalValue(name: string): unknown;
|
|
219
351
|
request<T, E>(req: CoreRequest): Promise<ApiResult<T, E>>;
|
|
352
|
+
/** Drop cached tokens behind the credential this request selected. True
|
|
353
|
+
* when a callback or cached token can resolve to a new value. */
|
|
354
|
+
private refreshCredentials;
|
|
220
355
|
/** SDK-facing call: resolve to the payload or throw its typed error. */
|
|
221
356
|
requestData<T, E>(req: CoreRequest): Promise<T>;
|
|
222
357
|
private send;
|
|
@@ -240,6 +375,14 @@ export declare class HttpCore {
|
|
|
240
375
|
export declare function formatDebugEvent(name: string, event: DebugEvent): string;
|
|
241
376
|
/** Wrap a bearer credential (static or callback) as an Authorization value. */
|
|
242
377
|
export declare function bearerAuth(token: AuthValue): AuthValue;
|
|
378
|
+
/** The media type a local file is uploaded as, from its extension. A
|
|
379
|
+
* Worker module (.mjs) must arrive as application/javascript+module. */
|
|
380
|
+
export declare function mediaTypeForPath(path: string): string;
|
|
381
|
+
/**
|
|
382
|
+
* Join a query array into one delimited value (`ids=1,2`) for parameters
|
|
383
|
+
* whose spec says `explode: false`. Other values pass through unchanged.
|
|
384
|
+
*/
|
|
385
|
+
export declare function delimited(value: unknown, separator: string): unknown;
|
|
243
386
|
export declare function toBase64(input: string): string;
|
|
244
387
|
export {};
|
|
245
388
|
//# sourceMappingURL=http.d.ts.map
|
package/dist/core/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/core/http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/core/http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,yEAAyE;IACzE,SAAS,CAAC,EAAE,M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