@distilled.cloud/cloudflare 0.16.2 → 0.16.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.
- package/lib/client/api.d.ts.map +1 -1
- package/lib/client/api.js +26 -8
- package/lib/client/api.js.map +1 -1
- package/lib/retry.d.ts +23 -4
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +26 -7
- package/lib/retry.js.map +1 -1
- package/lib/services/abuse-reports.d.ts +4 -0
- package/lib/services/abuse-reports.d.ts.map +1 -1
- package/lib/services/abuse-reports.js +4 -0
- package/lib/services/abuse-reports.js.map +1 -1
- package/lib/services/accounts.d.ts +7 -0
- package/lib/services/accounts.d.ts.map +1 -1
- package/lib/services/accounts.js +7 -0
- package/lib/services/accounts.js.map +1 -1
- package/lib/services/ai-gateway.d.ts +24 -14
- package/lib/services/ai-gateway.d.ts.map +1 -1
- package/lib/services/ai-gateway.js +32 -44
- package/lib/services/ai-gateway.js.map +1 -1
- package/lib/services/ai.d.ts +2 -0
- package/lib/services/ai.d.ts.map +1 -1
- package/lib/services/ai.js +27 -25
- package/lib/services/ai.js.map +1 -1
- package/lib/services/aisearch.d.ts +8 -0
- package/lib/services/aisearch.d.ts.map +1 -1
- package/lib/services/aisearch.js +8 -0
- package/lib/services/aisearch.js.map +1 -1
- package/lib/services/alerting.d.ts +2 -0
- package/lib/services/alerting.d.ts.map +1 -1
- package/lib/services/alerting.js +2 -0
- package/lib/services/alerting.js.map +1 -1
- package/lib/services/api-gateway.d.ts +10 -0
- package/lib/services/api-gateway.d.ts.map +1 -1
- package/lib/services/api-gateway.js +94 -84
- package/lib/services/api-gateway.js.map +1 -1
- package/lib/services/audit-logs.d.ts +2 -0
- package/lib/services/audit-logs.d.ts.map +1 -1
- package/lib/services/audit-logs.js +2 -0
- package/lib/services/audit-logs.js.map +1 -1
- package/lib/services/client-certificates.d.ts +2 -0
- package/lib/services/client-certificates.d.ts.map +1 -1
- package/lib/services/client-certificates.js +2 -0
- package/lib/services/client-certificates.js.map +1 -1
- package/lib/services/connectivity.d.ts +2 -0
- package/lib/services/connectivity.d.ts.map +1 -1
- package/lib/services/connectivity.js +14 -12
- package/lib/services/connectivity.js.map +1 -1
- package/lib/services/custom-certificates.d.ts +2 -0
- package/lib/services/custom-certificates.d.ts.map +1 -1
- package/lib/services/custom-certificates.js +2 -0
- package/lib/services/custom-certificates.js.map +1 -1
- package/lib/services/custom-hostnames.d.ts +2 -0
- package/lib/services/custom-hostnames.d.ts.map +1 -1
- package/lib/services/custom-hostnames.js +2 -0
- package/lib/services/custom-hostnames.js.map +1 -1
- package/lib/services/d1.d.ts +2 -0
- package/lib/services/d1.d.ts.map +1 -1
- package/lib/services/d1.js +2 -0
- package/lib/services/d1.js.map +1 -1
- package/lib/services/dns-firewall.d.ts +2 -0
- package/lib/services/dns-firewall.d.ts.map +1 -1
- package/lib/services/dns-firewall.js +2 -0
- package/lib/services/dns-firewall.js.map +1 -1
- package/lib/services/dns.d.ts +6405 -714
- package/lib/services/dns.d.ts.map +1 -1
- package/lib/services/dns.js +12738 -1055
- package/lib/services/dns.js.map +1 -1
- package/lib/services/durable-objects.d.ts +3 -0
- package/lib/services/durable-objects.d.ts.map +1 -1
- package/lib/services/durable-objects.js +3 -0
- package/lib/services/durable-objects.js.map +1 -1
- package/lib/services/email-routing.d.ts +4 -0
- package/lib/services/email-routing.d.ts.map +1 -1
- package/lib/services/email-routing.js +4 -0
- package/lib/services/email-routing.js.map +1 -1
- package/lib/services/email-security.d.ts +14 -0
- package/lib/services/email-security.d.ts.map +1 -1
- package/lib/services/email-security.js +14 -0
- package/lib/services/email-security.js.map +1 -1
- package/lib/services/filters.d.ts +2 -0
- package/lib/services/filters.d.ts.map +1 -1
- package/lib/services/filters.js +2 -0
- package/lib/services/filters.js.map +1 -1
- package/lib/services/firewall.d.ts +14 -0
- package/lib/services/firewall.d.ts.map +1 -1
- package/lib/services/firewall.js +90 -76
- package/lib/services/firewall.js.map +1 -1
- package/lib/services/healthchecks.d.ts +2 -0
- package/lib/services/healthchecks.d.ts.map +1 -1
- package/lib/services/healthchecks.js +2 -0
- package/lib/services/healthchecks.js.map +1 -1
- package/lib/services/hyperdrive.js +26 -26
- package/lib/services/hyperdrive.js.map +1 -1
- package/lib/services/iam.d.ts +6 -0
- package/lib/services/iam.d.ts.map +1 -1
- package/lib/services/iam.js +6 -0
- package/lib/services/iam.js.map +1 -1
- package/lib/services/images.d.ts +2 -0
- package/lib/services/images.d.ts.map +1 -1
- package/lib/services/images.js +2 -0
- package/lib/services/images.js.map +1 -1
- package/lib/services/intel.d.ts +4 -0
- package/lib/services/intel.d.ts.map +1 -1
- package/lib/services/intel.js +4 -0
- package/lib/services/intel.js.map +1 -1
- package/lib/services/kv.d.ts +3 -0
- package/lib/services/kv.d.ts.map +1 -1
- package/lib/services/kv.js +3 -0
- package/lib/services/kv.js.map +1 -1
- package/lib/services/load-balancers.d.ts +2 -0
- package/lib/services/load-balancers.d.ts.map +1 -1
- package/lib/services/load-balancers.js +2 -0
- package/lib/services/load-balancers.js.map +1 -1
- package/lib/services/magic-cloud-networking.d.ts +2 -0
- package/lib/services/magic-cloud-networking.d.ts.map +1 -1
- package/lib/services/magic-cloud-networking.js +9 -7
- package/lib/services/magic-cloud-networking.js.map +1 -1
- package/lib/services/magic-transit.js +8 -8
- package/lib/services/magic-transit.js.map +1 -1
- package/lib/services/origin-ca-certificates.d.ts +2 -0
- package/lib/services/origin-ca-certificates.d.ts.map +1 -1
- package/lib/services/origin-ca-certificates.js +6 -4
- package/lib/services/origin-ca-certificates.js.map +1 -1
- package/lib/services/origin-tls-client-auth.d.ts +57 -2
- package/lib/services/origin-tls-client-auth.d.ts.map +1 -1
- package/lib/services/origin-tls-client-auth.js +172 -4
- package/lib/services/origin-tls-client-auth.js.map +1 -1
- package/lib/services/pages.d.ts +4 -0
- package/lib/services/pages.d.ts.map +1 -1
- package/lib/services/pages.js +4 -0
- package/lib/services/pages.js.map +1 -1
- package/lib/services/pipelines.d.ts +6 -0
- package/lib/services/pipelines.d.ts.map +1 -1
- package/lib/services/pipelines.js +107 -101
- package/lib/services/pipelines.js.map +1 -1
- package/lib/services/queues.d.ts +2 -0
- package/lib/services/queues.d.ts.map +1 -1
- package/lib/services/queues.js +2 -0
- package/lib/services/queues.js.map +1 -1
- package/lib/services/radar.js +32 -32
- package/lib/services/radar.js.map +1 -1
- package/lib/services/rate-limits.d.ts +2 -0
- package/lib/services/rate-limits.d.ts.map +1 -1
- package/lib/services/rate-limits.js +2 -0
- package/lib/services/rate-limits.js.map +1 -1
- package/lib/services/realtime-kit.js +5 -5
- package/lib/services/realtime-kit.js.map +1 -1
- package/lib/services/resource-sharing.d.ts +6 -0
- package/lib/services/resource-sharing.d.ts.map +1 -1
- package/lib/services/resource-sharing.js +6 -0
- package/lib/services/resource-sharing.js.map +1 -1
- package/lib/services/rules.d.ts +1 -0
- package/lib/services/rules.d.ts.map +1 -1
- package/lib/services/rules.js +5 -4
- package/lib/services/rules.js.map +1 -1
- package/lib/services/rum.d.ts +2 -0
- package/lib/services/rum.d.ts.map +1 -1
- package/lib/services/rum.js +2 -0
- package/lib/services/rum.js.map +1 -1
- package/lib/services/schema-validation.d.ts +4 -0
- package/lib/services/schema-validation.d.ts.map +1 -1
- package/lib/services/schema-validation.js +4 -0
- package/lib/services/schema-validation.js.map +1 -1
- package/lib/services/secrets-store.d.ts +4 -0
- package/lib/services/secrets-store.d.ts.map +1 -1
- package/lib/services/secrets-store.js +4 -0
- package/lib/services/secrets-store.js.map +1 -1
- package/lib/services/snippets.d.ts +2 -0
- package/lib/services/snippets.d.ts.map +1 -1
- package/lib/services/snippets.js +2 -0
- package/lib/services/snippets.js.map +1 -1
- package/lib/services/spectrum.d.ts +2 -0
- package/lib/services/spectrum.d.ts.map +1 -1
- package/lib/services/spectrum.js +2 -0
- package/lib/services/spectrum.js.map +1 -1
- package/lib/services/speed.d.ts +2 -0
- package/lib/services/speed.d.ts.map +1 -1
- package/lib/services/speed.js +2 -0
- package/lib/services/speed.js.map +1 -1
- package/lib/services/token-validation.d.ts +4 -0
- package/lib/services/token-validation.d.ts.map +1 -1
- package/lib/services/token-validation.js +88 -84
- package/lib/services/token-validation.js.map +1 -1
- package/lib/services/turnstile.d.ts +2 -0
- package/lib/services/turnstile.d.ts.map +1 -1
- package/lib/services/turnstile.js +2 -0
- package/lib/services/turnstile.js.map +1 -1
- package/lib/services/waiting-rooms.d.ts +2 -0
- package/lib/services/waiting-rooms.d.ts.map +1 -1
- package/lib/services/waiting-rooms.js +2 -0
- package/lib/services/waiting-rooms.js.map +1 -1
- package/lib/services/workers-for-platforms.js +438 -438
- package/lib/services/workers-for-platforms.js.map +1 -1
- package/lib/services/workers.d.ts +6 -0
- package/lib/services/workers.d.ts.map +1 -1
- package/lib/services/workers.js +1225 -1219
- package/lib/services/workers.js.map +1 -1
- package/lib/services/workflows.d.ts +6 -0
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +15 -9
- package/lib/services/workflows.js.map +1 -1
- package/lib/services/zero-trust.d.ts +46 -0
- package/lib/services/zero-trust.d.ts.map +1 -1
- package/lib/services/zero-trust.js +4013 -3967
- package/lib/services/zero-trust.js.map +1 -1
- package/lib/services/zones.js +50 -50
- package/lib/services/zones.js.map +1 -1
- package/package.json +2 -2
- package/src/client/api.ts +38 -8
- package/src/retry.ts +32 -10
- package/src/services/abuse-reports.ts +8 -0
- package/src/services/accounts.ts +14 -0
- package/src/services/ai-gateway.ts +83 -66
- package/src/services/ai.ts +39 -35
- package/src/services/aisearch.ts +16 -0
- package/src/services/alerting.ts +4 -0
- package/src/services/api-gateway.ts +150 -130
- package/src/services/audit-logs.ts +4 -0
- package/src/services/client-certificates.ts +4 -0
- package/src/services/connectivity.ts +16 -12
- package/src/services/custom-certificates.ts +4 -0
- package/src/services/custom-hostnames.ts +4 -0
- package/src/services/d1.ts +4 -0
- package/src/services/dns-firewall.ts +4 -0
- package/src/services/dns.ts +25325 -2321
- package/src/services/durable-objects.ts +6 -0
- package/src/services/email-routing.ts +8 -0
- package/src/services/email-security.ts +28 -0
- package/src/services/filters.ts +4 -0
- package/src/services/firewall.ts +108 -80
- package/src/services/healthchecks.ts +4 -0
- package/src/services/hyperdrive.ts +28 -28
- package/src/services/iam.ts +12 -0
- package/src/services/images.ts +4 -0
- package/src/services/intel.ts +8 -0
- package/src/services/kv.ts +6 -0
- package/src/services/load-balancers.ts +4 -0
- package/src/services/magic-cloud-networking.ts +12 -8
- package/src/services/magic-transit.ts +8 -8
- package/src/services/origin-ca-certificates.ts +7 -4
- package/src/services/origin-tls-client-auth.ts +319 -6
- package/src/services/pages.ts +8 -0
- package/src/services/pipelines.ts +161 -149
- package/src/services/queues.ts +4 -0
- package/src/services/radar.ts +32 -32
- package/src/services/rate-limits.ts +4 -0
- package/src/services/realtime-kit.ts +5 -5
- package/src/services/resource-sharing.ts +12 -0
- package/src/services/rules.ts +6 -4
- package/src/services/rum.ts +4 -0
- package/src/services/schema-validation.ts +8 -0
- package/src/services/secrets-store.ts +8 -0
- package/src/services/snippets.ts +4 -0
- package/src/services/spectrum.ts +4 -0
- package/src/services/speed.ts +4 -0
- package/src/services/token-validation.ts +92 -84
- package/src/services/turnstile.ts +4 -0
- package/src/services/waiting-rooms.ts +4 -0
- package/src/services/workers-for-platforms.ts +555 -555
- package/src/services/workers.ts +1534 -1522
- package/src/services/workflows.ts +21 -9
- package/src/services/zero-trust.ts +5862 -5770
- package/src/services/zones.ts +74 -74
package/src/client/api.ts
CHANGED
|
@@ -21,6 +21,10 @@ import {
|
|
|
21
21
|
paginateWithDefaults,
|
|
22
22
|
type PaginationStrategy,
|
|
23
23
|
} from "@distilled.cloud/core/pagination";
|
|
24
|
+
import {
|
|
25
|
+
parseRetryAfterForStatus,
|
|
26
|
+
parseServerRetryHint,
|
|
27
|
+
} from "@distilled.cloud/core/retry-after";
|
|
24
28
|
import { getPath, type RequestParts } from "@distilled.cloud/core/traits";
|
|
25
29
|
import {
|
|
26
30
|
CloudflareHttpError,
|
|
@@ -32,6 +36,7 @@ import {
|
|
|
32
36
|
UnknownCloudflareError,
|
|
33
37
|
} from "../errors.ts";
|
|
34
38
|
import { Credentials, formatHeaders } from "../credentials.ts";
|
|
39
|
+
import { Retry } from "../retry.ts";
|
|
35
40
|
import { type ErrorMatcher, getErrorMatchers } from "../traits.ts";
|
|
36
41
|
|
|
37
42
|
// ============================================================================
|
|
@@ -42,9 +47,19 @@ import { type ErrorMatcher, getErrorMatchers } from "../traits.ts";
|
|
|
42
47
|
* Cloudflare error codes that map to global/default errors regardless of operation.
|
|
43
48
|
* These are infrastructure-level errors that can occur on any endpoint.
|
|
44
49
|
*/
|
|
45
|
-
const GLOBAL_ERROR_CODE_MAP: Record<
|
|
50
|
+
const GLOBAL_ERROR_CODE_MAP: Record<
|
|
51
|
+
number,
|
|
52
|
+
(message: string, headers?: Record<string, string | undefined>) => unknown
|
|
53
|
+
> = {
|
|
46
54
|
// "Please wait and consider throttling your request speed"
|
|
47
|
-
|
|
55
|
+
// Cloudflare returns this code inside an envelope with arbitrary HTTP status
|
|
56
|
+
// (often 200), so we don't gate on status — TooManyRequests always declares
|
|
57
|
+
// `retryAfter`.
|
|
58
|
+
971: (message, headers) =>
|
|
59
|
+
new TooManyRequests({
|
|
60
|
+
message,
|
|
61
|
+
retryAfter: parseServerRetryHint(headers),
|
|
62
|
+
}),
|
|
48
63
|
// Authentication-related error codes — surfaced regardless of HTTP status
|
|
49
64
|
// (Cloudflare frequently returns these inside a 400 envelope rather than 401).
|
|
50
65
|
// 6003: Invalid request headers (e.g. missing/invalid auth headers)
|
|
@@ -68,17 +83,30 @@ const GLOBAL_ERROR_CODE_MAP: Record<number, (message: string) => unknown> = {
|
|
|
68
83
|
* returns the properly categorized error (with retry categories for 5xx).
|
|
69
84
|
* For unmapped 5xx codes (e.g., Cloudflare-specific 520-530), returns a
|
|
70
85
|
* CloudflareHttpError so the status is preserved.
|
|
86
|
+
*
|
|
87
|
+
* Retryable errors carry an optional `retryAfter` parsed from the standard
|
|
88
|
+
* `Retry-After` / `RateLimit` response headers; the retry policy honors it.
|
|
71
89
|
*/
|
|
72
|
-
function httpStatusError(
|
|
90
|
+
function httpStatusError(
|
|
91
|
+
status: number,
|
|
92
|
+
body?: string,
|
|
93
|
+
headers?: Record<string, string | undefined>,
|
|
94
|
+
): unknown {
|
|
73
95
|
const ErrorClass = HTTP_STATUS_MAP[status as keyof typeof HTTP_STATUS_MAP];
|
|
74
96
|
const message = body ?? String(status);
|
|
75
97
|
if (ErrorClass) {
|
|
76
|
-
return new ErrorClass({
|
|
98
|
+
return new ErrorClass({
|
|
99
|
+
message,
|
|
100
|
+
retryAfter: parseRetryAfterForStatus(status, headers),
|
|
101
|
+
});
|
|
77
102
|
}
|
|
78
103
|
// For unmapped 5xx codes (e.g., Cloudflare-specific 520-530), use
|
|
79
104
|
// InternalServerError so they get ServerError + Retryable categories
|
|
80
105
|
if (status >= 500) {
|
|
81
|
-
return new InternalServerError({
|
|
106
|
+
return new InternalServerError({
|
|
107
|
+
message,
|
|
108
|
+
retryAfter: parseRetryAfterForStatus(status, headers),
|
|
109
|
+
});
|
|
82
110
|
}
|
|
83
111
|
return new CloudflareHttpError({
|
|
84
112
|
status,
|
|
@@ -192,6 +220,7 @@ const matchError = (
|
|
|
192
220
|
status: number,
|
|
193
221
|
errorBody: unknown,
|
|
194
222
|
errors?: readonly ApiErrorClass[],
|
|
223
|
+
headers?: Record<string, string | undefined>,
|
|
195
224
|
): Effect.Effect<never, unknown> => {
|
|
196
225
|
// Handle non-JSON error responses (e.g., HTML from malformed URLs, 520 pages)
|
|
197
226
|
const isNonJsonError =
|
|
@@ -202,7 +231,7 @@ const matchError = (
|
|
|
202
231
|
const message = String((errorBody as any).body);
|
|
203
232
|
// For 5xx errors, return a properly categorized error so retries work
|
|
204
233
|
if (status >= 500) {
|
|
205
|
-
return Effect.fail(httpStatusError(status, message));
|
|
234
|
+
return Effect.fail(httpStatusError(status, message, headers));
|
|
206
235
|
}
|
|
207
236
|
return Effect.fail(
|
|
208
237
|
new CloudflareHttpError({
|
|
@@ -245,7 +274,7 @@ const matchError = (
|
|
|
245
274
|
const bodyStr =
|
|
246
275
|
typeof errorBody === "string" ? errorBody : JSON.stringify(errorBody);
|
|
247
276
|
if (status >= 500) {
|
|
248
|
-
return Effect.fail(httpStatusError(status, bodyStr));
|
|
277
|
+
return Effect.fail(httpStatusError(status, bodyStr, headers));
|
|
249
278
|
}
|
|
250
279
|
return Effect.fail(
|
|
251
280
|
new CloudflareHttpError({
|
|
@@ -305,7 +334,7 @@ const matchError = (
|
|
|
305
334
|
|
|
306
335
|
// Check global error codes before falling through to unknown
|
|
307
336
|
if (errorCode !== undefined && errorCode in GLOBAL_ERROR_CODE_MAP) {
|
|
308
|
-
return Effect.fail(GLOBAL_ERROR_CODE_MAP[errorCode](errorMessage));
|
|
337
|
+
return Effect.fail(GLOBAL_ERROR_CODE_MAP[errorCode](errorMessage, headers));
|
|
309
338
|
}
|
|
310
339
|
|
|
311
340
|
// Heuristic fallback:
|
|
@@ -378,6 +407,7 @@ const _API = makeAPI<Credentials>({
|
|
|
378
407
|
ParseError: CloudflareDecodeError as any,
|
|
379
408
|
transformRequestParts: ({ pathTemplate, parts }) =>
|
|
380
409
|
transformCloudflareRequestParts({ pathTemplate, parts }),
|
|
410
|
+
retry: Retry as any,
|
|
381
411
|
});
|
|
382
412
|
|
|
383
413
|
const paginatePageByItems: PaginationStrategy = (
|
package/src/retry.ts
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloudflare retry configuration.
|
|
3
|
+
*
|
|
4
|
+
* Defines the per-SDK `Retry` Context.Service tag that
|
|
5
|
+
* `packages/cloudflare/src/client.ts` wires into `makeAPI`. Callers can
|
|
6
|
+
* install a blanket retry policy at the layer level and have every
|
|
7
|
+
* Cloudflare API call below it pick it up:
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import * as Cloudflare from "@distilled.cloud/cloudflare";
|
|
12
|
+
*
|
|
13
|
+
* myEffect.pipe(Cloudflare.Retry.transient);
|
|
14
|
+
* Effect.provide(myEffect, Layer.succeed(Cloudflare.Retry.Retry, customPolicy));
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import * as Context from "effect/Context";
|
|
1
18
|
import * as Effect from "effect/Effect";
|
|
2
19
|
import * as Layer from "effect/Layer";
|
|
3
|
-
import
|
|
20
|
+
import {
|
|
21
|
+
type Policy,
|
|
22
|
+
throttlingFactory,
|
|
23
|
+
transientFactory,
|
|
24
|
+
} from "@distilled.cloud/core/retry";
|
|
25
|
+
|
|
4
26
|
export {
|
|
5
27
|
type Options,
|
|
6
28
|
type Factory,
|
|
@@ -10,26 +32,26 @@ export {
|
|
|
10
32
|
capped,
|
|
11
33
|
throttlingOptions,
|
|
12
34
|
transientOptions,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type Policy,
|
|
16
|
-
throttlingOptions,
|
|
17
|
-
transientOptions,
|
|
35
|
+
throttlingFactory,
|
|
36
|
+
transientFactory,
|
|
18
37
|
} from "@distilled.cloud/core/retry";
|
|
19
38
|
|
|
39
|
+
/** Context tag for configuring retry behavior of Cloudflare API calls. */
|
|
20
40
|
export class Retry extends Context.Service<Retry, Policy>()(
|
|
21
41
|
"CloudflareRetry",
|
|
22
42
|
) {}
|
|
23
43
|
|
|
44
|
+
/** Provides a custom retry policy to every Cloudflare API call below it. */
|
|
24
45
|
export const policy = (optionsOrFactory: Policy) =>
|
|
25
46
|
Effect.provide(Layer.succeed(Retry, optionsOrFactory));
|
|
26
47
|
|
|
48
|
+
/** Disables all automatic retries. */
|
|
27
49
|
export const none = Effect.provide(
|
|
28
50
|
Layer.succeed(Retry, { while: () => false }),
|
|
29
51
|
);
|
|
30
52
|
|
|
31
|
-
/** Apply throttling retry policy (retries throttling errors indefinitely) */
|
|
32
|
-
export const throttling = policy(
|
|
53
|
+
/** Apply the throttling retry policy (retries throttling errors indefinitely). */
|
|
54
|
+
export const throttling = policy(throttlingFactory);
|
|
33
55
|
|
|
34
|
-
/** Apply transient retry policy (retries all transient errors indefinitely) */
|
|
35
|
-
export const transient = policy(
|
|
56
|
+
/** Apply the transient retry policy (retries all transient errors indefinitely). */
|
|
57
|
+
export const transient = policy(transientFactory);
|
|
@@ -185,6 +185,8 @@ export const getAbuseReport: API.OperationMethod<
|
|
|
185
185
|
export interface ListAbuseReportsRequest {
|
|
186
186
|
/** Path param: Cloudflare Account ID */
|
|
187
187
|
accountId: string;
|
|
188
|
+
page?: number;
|
|
189
|
+
perPage?: number;
|
|
188
190
|
/** Query param: Returns reports created after the specified date */
|
|
189
191
|
createdAfter?: string;
|
|
190
192
|
/** Query param: Returns reports created before the specified date */
|
|
@@ -218,6 +220,8 @@ export interface ListAbuseReportsRequest {
|
|
|
218
220
|
export const ListAbuseReportsRequest =
|
|
219
221
|
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
220
222
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
223
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
224
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
221
225
|
createdAfter: Schema.optional(Schema.String).pipe(
|
|
222
226
|
T.HttpQuery("created_after"),
|
|
223
227
|
),
|
|
@@ -558,6 +562,8 @@ export interface ListMitigationsRequest {
|
|
|
558
562
|
reportId: string;
|
|
559
563
|
/** Path param: Cloudflare Account ID */
|
|
560
564
|
accountId: string;
|
|
565
|
+
page?: number;
|
|
566
|
+
perPage?: number;
|
|
561
567
|
/** Query param: Returns mitigation that were dispatched after the given date */
|
|
562
568
|
effectiveAfter?: string;
|
|
563
569
|
/** Query param: Returns mitigations that were dispatched before the given date */
|
|
@@ -590,6 +596,8 @@ export const ListMitigationsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
|
|
|
590
596
|
{
|
|
591
597
|
reportId: Schema.String.pipe(T.HttpPath("reportId")),
|
|
592
598
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
599
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
600
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
593
601
|
effectiveAfter: Schema.optional(Schema.String).pipe(
|
|
594
602
|
T.HttpQuery("effective_after"),
|
|
595
603
|
),
|
package/src/services/accounts.ts
CHANGED
|
@@ -653,6 +653,7 @@ export const deleteAccount: API.OperationMethod<
|
|
|
653
653
|
export interface ListLogAuditsRequest {
|
|
654
654
|
/** Path param: The unique id that identifies the account. */
|
|
655
655
|
accountId: string;
|
|
656
|
+
cursor?: string;
|
|
656
657
|
/** Query param: Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339. */
|
|
657
658
|
before: string;
|
|
658
659
|
/** Query param: Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339. */
|
|
@@ -711,6 +712,7 @@ export interface ListLogAuditsRequest {
|
|
|
711
712
|
|
|
712
713
|
export const ListLogAuditsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
713
714
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
715
|
+
cursor: Schema.optional(Schema.String).pipe(T.HttpQuery("cursor")),
|
|
714
716
|
before: Schema.String.pipe(T.HttpQuery("before")),
|
|
715
717
|
since: Schema.String.pipe(T.HttpQuery("since")),
|
|
716
718
|
id: Schema.optional(
|
|
@@ -1406,6 +1408,8 @@ export const getMember: API.OperationMethod<
|
|
|
1406
1408
|
export interface ListMembersRequest {
|
|
1407
1409
|
/** Path param: Account identifier tag. */
|
|
1408
1410
|
accountId: string;
|
|
1411
|
+
page?: number;
|
|
1412
|
+
perPage?: number;
|
|
1409
1413
|
/** Query param: Direction to order results. */
|
|
1410
1414
|
direction?: "asc" | "desc";
|
|
1411
1415
|
/** Query param: Field to order results by. */
|
|
@@ -1416,6 +1420,8 @@ export interface ListMembersRequest {
|
|
|
1416
1420
|
|
|
1417
1421
|
export const ListMembersRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
1418
1422
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
1423
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
1424
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
1419
1425
|
direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
|
|
1420
1426
|
T.HttpQuery("direction"),
|
|
1421
1427
|
),
|
|
@@ -2720,10 +2726,14 @@ export const getRole: API.OperationMethod<
|
|
|
2720
2726
|
export interface ListRolesRequest {
|
|
2721
2727
|
/** Path param: Account identifier tag. */
|
|
2722
2728
|
accountId: string;
|
|
2729
|
+
page?: number;
|
|
2730
|
+
perPage?: number;
|
|
2723
2731
|
}
|
|
2724
2732
|
|
|
2725
2733
|
export const ListRolesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
2726
2734
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
2735
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
2736
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
2727
2737
|
}).pipe(
|
|
2728
2738
|
T.Http({ method: "GET", path: "/accounts/{account_id}/roles" }),
|
|
2729
2739
|
) as unknown as Schema.Schema<ListRolesRequest>;
|
|
@@ -3822,12 +3832,16 @@ export const getToken: API.OperationMethod<
|
|
|
3822
3832
|
export interface ListTokensRequest {
|
|
3823
3833
|
/** Path param: Account identifier tag. */
|
|
3824
3834
|
accountId: string;
|
|
3835
|
+
page?: number;
|
|
3836
|
+
perPage?: number;
|
|
3825
3837
|
/** Query param: Direction to order results. */
|
|
3826
3838
|
direction?: "asc" | "desc";
|
|
3827
3839
|
}
|
|
3828
3840
|
|
|
3829
3841
|
export const ListTokensRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
3830
3842
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
3843
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
3844
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
3831
3845
|
direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
|
|
3832
3846
|
T.HttpQuery("direction"),
|
|
3833
3847
|
),
|
|
@@ -217,12 +217,16 @@ export const getAiGateway: API.OperationMethod<
|
|
|
217
217
|
export interface ListAiGatewaysRequest {
|
|
218
218
|
/** Path param: */
|
|
219
219
|
accountId: string;
|
|
220
|
+
page?: number;
|
|
221
|
+
perPage?: number;
|
|
220
222
|
/** Query param: Search by id */
|
|
221
223
|
search?: string;
|
|
222
224
|
}
|
|
223
225
|
|
|
224
226
|
export const ListAiGatewaysRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
225
227
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
228
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
229
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
226
230
|
search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
|
|
227
231
|
}).pipe(
|
|
228
232
|
T.Http({ method: "GET", path: "/accounts/{account_id}/ai-gateway/gateways" }),
|
|
@@ -1331,6 +1335,8 @@ export interface ListDatasetsRequest {
|
|
|
1331
1335
|
gatewayId: string;
|
|
1332
1336
|
/** Path param: */
|
|
1333
1337
|
accountId: string;
|
|
1338
|
+
page?: number;
|
|
1339
|
+
perPage?: number;
|
|
1334
1340
|
/** Query param: */
|
|
1335
1341
|
enable?: boolean;
|
|
1336
1342
|
/** Query param: */
|
|
@@ -1342,6 +1348,8 @@ export interface ListDatasetsRequest {
|
|
|
1342
1348
|
export const ListDatasetsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
1343
1349
|
gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
|
|
1344
1350
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
1351
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
1352
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
1345
1353
|
enable: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("enable")),
|
|
1346
1354
|
name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
|
|
1347
1355
|
search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
|
|
@@ -2092,6 +2100,8 @@ export interface ListEvaluationsRequest {
|
|
|
2092
2100
|
gatewayId: string;
|
|
2093
2101
|
/** Path param: */
|
|
2094
2102
|
accountId: string;
|
|
2103
|
+
page?: number;
|
|
2104
|
+
perPage?: number;
|
|
2095
2105
|
/** Query param: */
|
|
2096
2106
|
name?: string;
|
|
2097
2107
|
/** Query param: */
|
|
@@ -2104,6 +2114,8 @@ export const ListEvaluationsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct(
|
|
|
2104
2114
|
{
|
|
2105
2115
|
gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
|
|
2106
2116
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
2117
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
2118
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
2107
2119
|
name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
|
|
2108
2120
|
processed: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("processed")),
|
|
2109
2121
|
search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
|
|
@@ -2704,6 +2716,8 @@ export const deleteEvaluation: API.OperationMethod<
|
|
|
2704
2716
|
export interface ListEvaluationTypesRequest {
|
|
2705
2717
|
/** Path param: */
|
|
2706
2718
|
accountId: string;
|
|
2719
|
+
page?: number;
|
|
2720
|
+
perPage?: number;
|
|
2707
2721
|
/** Query param: */
|
|
2708
2722
|
orderBy?: string;
|
|
2709
2723
|
/** Query param: */
|
|
@@ -2713,6 +2727,8 @@ export interface ListEvaluationTypesRequest {
|
|
|
2713
2727
|
export const ListEvaluationTypesRequest =
|
|
2714
2728
|
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
2715
2729
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
2730
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
2731
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
2716
2732
|
orderBy: Schema.optional(Schema.String).pipe(T.HttpQuery("order_by")),
|
|
2717
2733
|
orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
|
|
2718
2734
|
T.HttpQuery("order_by_direction"),
|
|
@@ -2937,6 +2953,16 @@ export interface ListLogsRequest {
|
|
|
2937
2953
|
gatewayId: string;
|
|
2938
2954
|
/** Path param: */
|
|
2939
2955
|
accountId: string;
|
|
2956
|
+
page?: number;
|
|
2957
|
+
perPage?: number;
|
|
2958
|
+
/** @deprecated Query param: */
|
|
2959
|
+
cached?: boolean;
|
|
2960
|
+
/** @deprecated Query param: */
|
|
2961
|
+
direction?: "asc" | "desc";
|
|
2962
|
+
/** @deprecated Query param: */
|
|
2963
|
+
endDate?: string;
|
|
2964
|
+
/** @deprecated Query param: */
|
|
2965
|
+
feedback?: "0" | "1";
|
|
2940
2966
|
/** Query param: */
|
|
2941
2967
|
filters?: {
|
|
2942
2968
|
key:
|
|
@@ -2968,28 +2994,6 @@ export interface ListLogsRequest {
|
|
|
2968
2994
|
operator: "eq" | "neq" | "contains" | "lt" | "gt";
|
|
2969
2995
|
value: (string | null | number | boolean)[];
|
|
2970
2996
|
}[];
|
|
2971
|
-
/** Query param: */
|
|
2972
|
-
metaInfo?: boolean;
|
|
2973
|
-
/** Query param: */
|
|
2974
|
-
orderBy?:
|
|
2975
|
-
| "created_at"
|
|
2976
|
-
| "provider"
|
|
2977
|
-
| "model"
|
|
2978
|
-
| "model_type"
|
|
2979
|
-
| "success"
|
|
2980
|
-
| "cached";
|
|
2981
|
-
/** Query param: */
|
|
2982
|
-
orderByDirection?: "asc" | "desc";
|
|
2983
|
-
/** Query param: */
|
|
2984
|
-
search?: string;
|
|
2985
|
-
/** @deprecated Query param: */
|
|
2986
|
-
cached?: boolean;
|
|
2987
|
-
/** @deprecated Query param: */
|
|
2988
|
-
direction?: "asc" | "desc";
|
|
2989
|
-
/** @deprecated Query param: */
|
|
2990
|
-
endDate?: string;
|
|
2991
|
-
/** @deprecated Query param: */
|
|
2992
|
-
feedback?: "0" | "1";
|
|
2993
2997
|
/** @deprecated Query param: */
|
|
2994
2998
|
maxCost?: number;
|
|
2995
2999
|
/** @deprecated Query param: */
|
|
@@ -3000,6 +3004,8 @@ export interface ListLogsRequest {
|
|
|
3000
3004
|
maxTokensOut?: number;
|
|
3001
3005
|
/** @deprecated Query param: */
|
|
3002
3006
|
maxTotalTokens?: number;
|
|
3007
|
+
/** Query param: */
|
|
3008
|
+
metaInfo?: boolean;
|
|
3003
3009
|
/** @deprecated Query param: */
|
|
3004
3010
|
minCost?: number;
|
|
3005
3011
|
/** @deprecated Query param: */
|
|
@@ -3014,12 +3020,24 @@ export interface ListLogsRequest {
|
|
|
3014
3020
|
model?: string;
|
|
3015
3021
|
/** @deprecated Query param: */
|
|
3016
3022
|
modelType?: string;
|
|
3023
|
+
/** Query param: */
|
|
3024
|
+
orderBy?:
|
|
3025
|
+
| "created_at"
|
|
3026
|
+
| "provider"
|
|
3027
|
+
| "model"
|
|
3028
|
+
| "model_type"
|
|
3029
|
+
| "success"
|
|
3030
|
+
| "cached";
|
|
3031
|
+
/** Query param: */
|
|
3032
|
+
orderByDirection?: "asc" | "desc";
|
|
3017
3033
|
/** @deprecated Query param: */
|
|
3018
3034
|
provider?: string;
|
|
3019
3035
|
/** @deprecated Query param: */
|
|
3020
3036
|
requestContentType?: string;
|
|
3021
3037
|
/** @deprecated Query param: */
|
|
3022
3038
|
responseContentType?: string;
|
|
3039
|
+
/** Query param: */
|
|
3040
|
+
search?: string;
|
|
3023
3041
|
/** @deprecated Query param: */
|
|
3024
3042
|
startDate?: string;
|
|
3025
3043
|
/** @deprecated Query param: */
|
|
@@ -3029,6 +3047,16 @@ export interface ListLogsRequest {
|
|
|
3029
3047
|
export const ListLogsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
3030
3048
|
gatewayId: Schema.String.pipe(T.HttpPath("gatewayId")),
|
|
3031
3049
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
3050
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
3051
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
3052
|
+
cached: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("cached")),
|
|
3053
|
+
direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
|
|
3054
|
+
T.HttpQuery("direction"),
|
|
3055
|
+
),
|
|
3056
|
+
endDate: Schema.optional(Schema.String).pipe(T.HttpQuery("end_date")),
|
|
3057
|
+
feedback: Schema.optional(Schema.Literals(["0", "1"])).pipe(
|
|
3058
|
+
T.HttpQuery("feedback"),
|
|
3059
|
+
),
|
|
3032
3060
|
filters: Schema.optional(
|
|
3033
3061
|
Schema.Array(
|
|
3034
3062
|
Schema.Struct({
|
|
@@ -3071,7 +3099,31 @@ export const ListLogsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
|
3071
3099
|
}),
|
|
3072
3100
|
),
|
|
3073
3101
|
).pipe(T.HttpQuery("filters")),
|
|
3102
|
+
maxCost: Schema.optional(Schema.Number).pipe(T.HttpQuery("max_cost")),
|
|
3103
|
+
maxDuration: Schema.optional(Schema.Number).pipe(T.HttpQuery("max_duration")),
|
|
3104
|
+
maxTokensIn: Schema.optional(Schema.Number).pipe(
|
|
3105
|
+
T.HttpQuery("max_tokens_in"),
|
|
3106
|
+
),
|
|
3107
|
+
maxTokensOut: Schema.optional(Schema.Number).pipe(
|
|
3108
|
+
T.HttpQuery("max_tokens_out"),
|
|
3109
|
+
),
|
|
3110
|
+
maxTotalTokens: Schema.optional(Schema.Number).pipe(
|
|
3111
|
+
T.HttpQuery("max_total_tokens"),
|
|
3112
|
+
),
|
|
3074
3113
|
metaInfo: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("meta_info")),
|
|
3114
|
+
minCost: Schema.optional(Schema.Number).pipe(T.HttpQuery("min_cost")),
|
|
3115
|
+
minDuration: Schema.optional(Schema.Number).pipe(T.HttpQuery("min_duration")),
|
|
3116
|
+
minTokensIn: Schema.optional(Schema.Number).pipe(
|
|
3117
|
+
T.HttpQuery("min_tokens_in"),
|
|
3118
|
+
),
|
|
3119
|
+
minTokensOut: Schema.optional(Schema.Number).pipe(
|
|
3120
|
+
T.HttpQuery("min_tokens_out"),
|
|
3121
|
+
),
|
|
3122
|
+
minTotalTokens: Schema.optional(Schema.Number).pipe(
|
|
3123
|
+
T.HttpQuery("min_total_tokens"),
|
|
3124
|
+
),
|
|
3125
|
+
model: Schema.optional(Schema.String).pipe(T.HttpQuery("model")),
|
|
3126
|
+
modelType: Schema.optional(Schema.String).pipe(T.HttpQuery("model_type")),
|
|
3075
3127
|
orderBy: Schema.optional(
|
|
3076
3128
|
Schema.Literals([
|
|
3077
3129
|
"created_at",
|
|
@@ -3085,52 +3137,17 @@ export const ListLogsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
|
3085
3137
|
orderByDirection: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(
|
|
3086
3138
|
T.HttpQuery("order_by_direction"),
|
|
3087
3139
|
),
|
|
3140
|
+
provider: Schema.optional(Schema.String).pipe(T.HttpQuery("provider")),
|
|
3141
|
+
requestContentType: Schema.optional(Schema.String).pipe(
|
|
3142
|
+
T.HttpQuery("request_content_type"),
|
|
3143
|
+
),
|
|
3144
|
+
responseContentType: Schema.optional(Schema.String).pipe(
|
|
3145
|
+
T.HttpQuery("response_content_type"),
|
|
3146
|
+
),
|
|
3088
3147
|
search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
endDate: Schema.optional(Schema.String),
|
|
3092
|
-
feedback: Schema.optional(Schema.Literals(["0", "1"])),
|
|
3093
|
-
maxCost: Schema.optional(Schema.Number),
|
|
3094
|
-
maxDuration: Schema.optional(Schema.Number),
|
|
3095
|
-
maxTokensIn: Schema.optional(Schema.Number),
|
|
3096
|
-
maxTokensOut: Schema.optional(Schema.Number),
|
|
3097
|
-
maxTotalTokens: Schema.optional(Schema.Number),
|
|
3098
|
-
minCost: Schema.optional(Schema.Number),
|
|
3099
|
-
minDuration: Schema.optional(Schema.Number),
|
|
3100
|
-
minTokensIn: Schema.optional(Schema.Number),
|
|
3101
|
-
minTokensOut: Schema.optional(Schema.Number),
|
|
3102
|
-
minTotalTokens: Schema.optional(Schema.Number),
|
|
3103
|
-
model: Schema.optional(Schema.String),
|
|
3104
|
-
modelType: Schema.optional(Schema.String),
|
|
3105
|
-
provider: Schema.optional(Schema.String),
|
|
3106
|
-
requestContentType: Schema.optional(Schema.String),
|
|
3107
|
-
responseContentType: Schema.optional(Schema.String),
|
|
3108
|
-
startDate: Schema.optional(Schema.String),
|
|
3109
|
-
success: Schema.optional(Schema.Boolean),
|
|
3148
|
+
startDate: Schema.optional(Schema.String).pipe(T.HttpQuery("start_date")),
|
|
3149
|
+
success: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("success")),
|
|
3110
3150
|
}).pipe(
|
|
3111
|
-
Schema.encodeKeys({
|
|
3112
|
-
cached: "cached",
|
|
3113
|
-
direction: "direction",
|
|
3114
|
-
endDate: "end_date",
|
|
3115
|
-
feedback: "feedback",
|
|
3116
|
-
maxCost: "max_cost",
|
|
3117
|
-
maxDuration: "max_duration",
|
|
3118
|
-
maxTokensIn: "max_tokens_in",
|
|
3119
|
-
maxTokensOut: "max_tokens_out",
|
|
3120
|
-
maxTotalTokens: "max_total_tokens",
|
|
3121
|
-
minCost: "min_cost",
|
|
3122
|
-
minDuration: "min_duration",
|
|
3123
|
-
minTokensIn: "min_tokens_in",
|
|
3124
|
-
minTokensOut: "min_tokens_out",
|
|
3125
|
-
minTotalTokens: "min_total_tokens",
|
|
3126
|
-
model: "model",
|
|
3127
|
-
modelType: "model_type",
|
|
3128
|
-
provider: "provider",
|
|
3129
|
-
requestContentType: "request_content_type",
|
|
3130
|
-
responseContentType: "response_content_type",
|
|
3131
|
-
startDate: "start_date",
|
|
3132
|
-
success: "success",
|
|
3133
|
-
}),
|
|
3134
3151
|
T.Http({
|
|
3135
3152
|
method: "GET",
|
|
3136
3153
|
path: "/accounts/{account_id}/ai-gateway/gateways/{gatewayId}/logs",
|
package/src/services/ai.ts
CHANGED
|
@@ -99,24 +99,6 @@ export type RunAiResponse =
|
|
|
99
99
|
| { description?: string | null };
|
|
100
100
|
|
|
101
101
|
export const RunAiResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
|
|
102
|
-
Schema.Array(
|
|
103
|
-
Schema.Struct({
|
|
104
|
-
label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
105
|
-
score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
106
|
-
}),
|
|
107
|
-
),
|
|
108
|
-
UploadableSchema.pipe(T.HttpFormDataFile()),
|
|
109
|
-
Schema.Struct({
|
|
110
|
-
audio: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
111
|
-
}),
|
|
112
|
-
Schema.Struct({
|
|
113
|
-
data: Schema.optional(
|
|
114
|
-
Schema.Union([Schema.Array(Schema.Array(Schema.Number)), Schema.Null]),
|
|
115
|
-
),
|
|
116
|
-
shape: Schema.optional(
|
|
117
|
-
Schema.Union([Schema.Array(Schema.Number), Schema.Null]),
|
|
118
|
-
),
|
|
119
|
-
}),
|
|
120
102
|
Schema.Struct({
|
|
121
103
|
text: Schema.String,
|
|
122
104
|
vtt: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
@@ -141,23 +123,6 @@ export const RunAiResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
|
|
|
141
123
|
words: "words",
|
|
142
124
|
}),
|
|
143
125
|
),
|
|
144
|
-
Schema.Array(
|
|
145
|
-
Schema.Struct({
|
|
146
|
-
box: Schema.optional(
|
|
147
|
-
Schema.Union([
|
|
148
|
-
Schema.Struct({
|
|
149
|
-
xmax: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
150
|
-
xmin: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
151
|
-
ymax: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
152
|
-
ymin: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
153
|
-
}),
|
|
154
|
-
Schema.Null,
|
|
155
|
-
]),
|
|
156
|
-
),
|
|
157
|
-
label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
158
|
-
score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
159
|
-
}),
|
|
160
|
-
),
|
|
161
126
|
Schema.Struct({
|
|
162
127
|
response: Schema.String,
|
|
163
128
|
toolCalls: Schema.optional(
|
|
@@ -202,6 +167,41 @@ export const RunAiResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
|
|
|
202
167
|
usage: "usage",
|
|
203
168
|
}),
|
|
204
169
|
),
|
|
170
|
+
Schema.Array(
|
|
171
|
+
Schema.Struct({
|
|
172
|
+
label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
173
|
+
score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
174
|
+
}),
|
|
175
|
+
),
|
|
176
|
+
UploadableSchema.pipe(T.HttpFormDataFile()),
|
|
177
|
+
Schema.Struct({
|
|
178
|
+
audio: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
179
|
+
}),
|
|
180
|
+
Schema.Struct({
|
|
181
|
+
data: Schema.optional(
|
|
182
|
+
Schema.Union([Schema.Array(Schema.Array(Schema.Number)), Schema.Null]),
|
|
183
|
+
),
|
|
184
|
+
shape: Schema.optional(
|
|
185
|
+
Schema.Union([Schema.Array(Schema.Number), Schema.Null]),
|
|
186
|
+
),
|
|
187
|
+
}),
|
|
188
|
+
Schema.Array(
|
|
189
|
+
Schema.Struct({
|
|
190
|
+
box: Schema.optional(
|
|
191
|
+
Schema.Union([
|
|
192
|
+
Schema.Struct({
|
|
193
|
+
xmax: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
194
|
+
xmin: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
195
|
+
ymax: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
196
|
+
ymin: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
197
|
+
}),
|
|
198
|
+
Schema.Null,
|
|
199
|
+
]),
|
|
200
|
+
),
|
|
201
|
+
label: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
202
|
+
score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
|
|
203
|
+
}),
|
|
204
|
+
),
|
|
205
205
|
Schema.Struct({
|
|
206
206
|
translatedText: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
|
|
207
207
|
}).pipe(Schema.encodeKeys({ translatedText: "translated_text" })),
|
|
@@ -543,6 +543,8 @@ export const listFinetunePublics: API.PaginatedOperationMethod<
|
|
|
543
543
|
export interface ListModelsRequest {
|
|
544
544
|
/** Path param: */
|
|
545
545
|
accountId: string;
|
|
546
|
+
page?: number;
|
|
547
|
+
perPage?: number;
|
|
546
548
|
/** Query param: Filter by Author */
|
|
547
549
|
author?: string;
|
|
548
550
|
/** Query param: Filter to hide experimental models */
|
|
@@ -557,6 +559,8 @@ export interface ListModelsRequest {
|
|
|
557
559
|
|
|
558
560
|
export const ListModelsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
|
|
559
561
|
accountId: Schema.String.pipe(T.HttpPath("account_id")),
|
|
562
|
+
page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
|
|
563
|
+
perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
|
|
560
564
|
author: Schema.optional(Schema.String).pipe(T.HttpQuery("author")),
|
|
561
565
|
hideExperimental: Schema.optional(Schema.Boolean).pipe(
|
|
562
566
|
T.HttpQuery("hide_experimental"),
|