@zuplo/cli 6.72.12 → 6.72.14
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/node_modules/@posthog/core/dist/gzip.js +1 -1
- package/node_modules/@posthog/core/dist/gzip.mjs +1 -1
- package/node_modules/@posthog/core/package.json +1 -1
- package/node_modules/@posthog/core/src/gzip.ts +1 -1
- package/node_modules/@posthog/types/dist/capture.d.ts +1 -1
- package/node_modules/@posthog/types/dist/capture.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +40 -3
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/capture.ts +1 -0
- package/node_modules/@posthog/types/src/posthog-config.ts +47 -3
- package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
- package/node_modules/@zuplo/core/index.minified.js +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-4MNJC7E2.js → chunk-32F3RZS4.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/chunk-32F3RZS4.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-K77Z5PRN.js → chunk-J6K7HSIK.js} +3 -3
- package/node_modules/@zuplo/runtime/out/esm/chunk-J6K7HSIK.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-SQVIQSIN.js +385 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-SQVIQSIN.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +235 -190
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/express-rate-limit/dist/index.cjs +69 -5
- package/node_modules/express-rate-limit/dist/index.d.cts +18 -0
- package/node_modules/express-rate-limit/dist/index.d.mts +18 -0
- package/node_modules/express-rate-limit/dist/index.d.ts +18 -0
- package/node_modules/express-rate-limit/dist/index.mjs +55 -5
- package/node_modules/express-rate-limit/package.json +11 -8
- package/node_modules/express-rate-limit/readme.md +2 -2
- package/package.json +6 -6
- package/node_modules/@zuplo/runtime/out/esm/chunk-4MNJC7E2.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-K77Z5PRN.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-UC4YZB5V.js +0 -399
- package/node_modules/@zuplo/runtime/out/esm/chunk-UC4YZB5V.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-UC4YZB5V.js.LEGAL.txt → chunk-SQVIQSIN.js.LEGAL.txt} +0 -0
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{i as a,j as l,k as c,l as o,o as p,p as y,q as m}from"../../chunk-
|
|
25
|
+
import{i as a,j as l,k as c,l as o,o as p,p as y,q as m}from"../../chunk-J6K7HSIK.js";import{a as i}from"../../chunk-DSZS6PZJ.js";async function g(r,e){let t=typeof e.credentials=="function"?await e.credentials():e.credentials,n=r.method,d=n!=="GET"&&n!=="HEAD"&&r.body!=null?await r.arrayBuffer():null,s=await new o({method:n,url:r.url,headers:r.headers,body:d,accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,service:e.service,region:e.region,signQuery:e.signQuery}).sign();return new Request(s.url.toString(),{method:s.method,headers:s.headers,body:s.body})}i(g,"signRequest");export{c as AwsClient,o as AwsV4Signer,p as fromTemporaryCredentials,y as fromWebToken,m as fromZuploIdentity,l as getAwsCredentialProvider,a as setAwsCredentialProvider,g as signRequest};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -27,6 +27,9 @@ export declare type AiFormat =
|
|
|
27
27
|
* Converts Anthropic Messages API format requests to OpenAI Chat Completions format.
|
|
28
28
|
* This policy translates between the two formats to allow seamless routing to different providers.
|
|
29
29
|
*
|
|
30
|
+
* @deprecated Platform AI Gateway routes use native Anthropic passthrough. This
|
|
31
|
+
* policy is retained for legacy custom routes that explicitly require translation.
|
|
32
|
+
*
|
|
30
33
|
* @hidden
|
|
31
34
|
* @title Anthropic to OpenAI Format Translator
|
|
32
35
|
* @product ai-gateway
|
|
@@ -143,6 +146,10 @@ export declare interface AIGatewayAuthInboundPolicyOptions {
|
|
|
143
146
|
* An AI Gateway capability that can have a resolved model selection.
|
|
144
147
|
*
|
|
145
148
|
* @public
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const capability: AIGatewayCapability = "completions";
|
|
152
|
+
* ```
|
|
146
153
|
*/
|
|
147
154
|
export declare type AIGatewayCapability =
|
|
148
155
|
| "completions"
|
|
@@ -153,39 +160,6 @@ export declare type AIGatewayCapability =
|
|
|
153
160
|
| "audio_speech"
|
|
154
161
|
| "audio_transcriptions";
|
|
155
162
|
|
|
156
|
-
/**
|
|
157
|
-
* Primary and optional fallback routing for one AI Gateway capability.
|
|
158
|
-
*
|
|
159
|
-
* @public
|
|
160
|
-
*/
|
|
161
|
-
export declare interface AIGatewayCapabilityRouting {
|
|
162
|
-
/** The primary provider and model. */
|
|
163
|
-
model: AIGatewayModelRef;
|
|
164
|
-
/** The provider and model used after a retryable error or timeout. */
|
|
165
|
-
fallback?: AIGatewayFallbackRef;
|
|
166
|
-
/** The provider and model used after a usage-limit-exceeded signal. */
|
|
167
|
-
quotaFallback?: AIGatewayModelRef;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export declare interface AIGatewayCapabilitySelection {
|
|
171
|
-
candidates: AIGatewayModelCandidate[];
|
|
172
|
-
fallbackTimeoutSeconds?: number;
|
|
173
|
-
quotaFallback?: AIGatewayModelCandidate;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* A model used after a retryable primary-provider failure or timeout.
|
|
178
|
-
*
|
|
179
|
-
* @public
|
|
180
|
-
*/
|
|
181
|
-
export declare interface AIGatewayFallbackRef extends AIGatewayModelRef {
|
|
182
|
-
/**
|
|
183
|
-
* Bounds the primary call before failing over. Defaults to 60 seconds and is
|
|
184
|
-
* only meaningful when a fallback is configured.
|
|
185
|
-
*/
|
|
186
|
-
timeoutSeconds?: number;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
163
|
/**
|
|
190
164
|
* Handler that routes AI/LLM requests through Zuplo's LLM Translation Layer.
|
|
191
165
|
* This handler forwards requests to the translation layer that handles provider-specific
|
|
@@ -214,9 +188,9 @@ export declare function aiGatewayHandler(
|
|
|
214
188
|
|
|
215
189
|
/**
|
|
216
190
|
* Routes AI requests using the model selection stored in the request context.
|
|
217
|
-
* Attach the `ai-gateway-model-routing-v2-inbound` policy before this handler
|
|
218
|
-
*
|
|
219
|
-
*
|
|
191
|
+
* Attach the `ai-gateway-model-routing-v2-inbound` policy before this handler
|
|
192
|
+
* runs, or call `AIGatewayModelRouting.set(context, routing)` from a custom
|
|
193
|
+
* inbound policy.
|
|
220
194
|
*
|
|
221
195
|
* @beta
|
|
222
196
|
* @param request - The incoming AI Gateway request.
|
|
@@ -340,23 +314,23 @@ export declare interface AIGatewayMeteringInboundPolicyOptions {
|
|
|
340
314
|
throwOnFailure?: boolean;
|
|
341
315
|
}
|
|
342
316
|
|
|
343
|
-
export declare interface AIGatewayModelCandidate {
|
|
344
|
-
provider: string;
|
|
345
|
-
model: string;
|
|
346
|
-
apiKey?: string;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
317
|
/**
|
|
350
|
-
* Catalog information about
|
|
351
|
-
*
|
|
352
|
-
* Model catalog membership does not indicate that the project has credentials
|
|
353
|
-
* for the model's provider. The policy resolves credentials only after the
|
|
354
|
-
* routing function returns a provider and model.
|
|
318
|
+
* Catalog information about an AI Gateway model.
|
|
355
319
|
*
|
|
356
320
|
* @public
|
|
321
|
+
* @example
|
|
322
|
+
* ```typescript
|
|
323
|
+
* const model: AIGatewayModelInfo = {
|
|
324
|
+
* model: "gpt-5",
|
|
325
|
+
* capability: "completions",
|
|
326
|
+
* status: "active",
|
|
327
|
+
* inputCostPerToken: 0.00000125,
|
|
328
|
+
* outputCostPerToken: 0.00001,
|
|
329
|
+
* };
|
|
330
|
+
* ```
|
|
357
331
|
*/
|
|
358
332
|
export declare interface AIGatewayModelInfo {
|
|
359
|
-
/** The provider-specific model identifier
|
|
333
|
+
/** The provider-specific model identifier. */
|
|
360
334
|
model: string;
|
|
361
335
|
/** The AI Gateway capability supported by the model. */
|
|
362
336
|
capability: "completions" | "embeddings";
|
|
@@ -369,59 +343,65 @@ export declare interface AIGatewayModelInfo {
|
|
|
369
343
|
}
|
|
370
344
|
|
|
371
345
|
/**
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
* @public
|
|
375
|
-
*/
|
|
376
|
-
export declare interface AIGatewayModelRef {
|
|
377
|
-
/** The case-insensitive provider identifier, such as `openai`. */
|
|
378
|
-
provider: string;
|
|
379
|
-
/** The provider-specific model identifier, such as `gpt-5`. */
|
|
380
|
-
model: string;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* Routing returned by an {@link AIGatewayRoutingFunction}.
|
|
346
|
+
* Sets and reads the model routing selected for an AI Gateway request.
|
|
385
347
|
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
*
|
|
348
|
+
* The built-in model-routing policy matches the request against its allowList
|
|
349
|
+
* of {@link AIGatewayRouteTarget} items, then `set()`s the winning target.
|
|
350
|
+
* Custom policies can call `set()` directly instead. Provider API keys are
|
|
351
|
+
* resolved internally and are never returned by `get()`.
|
|
389
352
|
*
|
|
390
353
|
* @public
|
|
354
|
+
* @example
|
|
355
|
+
* ```typescript
|
|
356
|
+
* import { AIGatewayModelRouting } from "@zuplo/runtime";
|
|
357
|
+
*
|
|
358
|
+
* await AIGatewayModelRouting.set(context, {
|
|
359
|
+
* completions: {
|
|
360
|
+
* main: "openai/gpt-5",
|
|
361
|
+
* backup: "anthropic/claude-sonnet-4-6",
|
|
362
|
+
* },
|
|
363
|
+
* });
|
|
364
|
+
* const routing = AIGatewayModelRouting.get(context);
|
|
365
|
+
* ```
|
|
391
366
|
*/
|
|
392
|
-
export declare
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
embeddings?: AIGatewayCapabilityRouting;
|
|
397
|
-
}
|
|
367
|
+
export declare const AIGatewayModelRouting: {
|
|
368
|
+
set(context: ZuploContext, routing: AIGatewayRouting): Promise<void>;
|
|
369
|
+
get(context: ZuploContext): AIGatewayRouting | undefined;
|
|
370
|
+
};
|
|
398
371
|
|
|
399
372
|
/**
|
|
400
|
-
*
|
|
373
|
+
* Matches AI Gateway requests against curated allow lists or open block lists,
|
|
374
|
+
* then stores the winning {@link AIGatewayRouteTarget} for the route handler.
|
|
401
375
|
*
|
|
402
376
|
* @title AI Gateway Model Routing (v2)
|
|
403
377
|
* @beta
|
|
404
378
|
* @product ai-gateway
|
|
405
|
-
* @hidden
|
|
406
379
|
* @requiresAI
|
|
407
380
|
* @param request - The ZuploRequest
|
|
408
381
|
* @param context - The ZuploContext
|
|
409
382
|
* @param options - The policy options set in policies.json
|
|
410
383
|
* @param policyName - The name of the policy as set in policies.json
|
|
411
|
-
* @returns The request with
|
|
384
|
+
* @returns The request with model routing stored in context, or a 4xx response
|
|
385
|
+
* @example
|
|
386
|
+
* ```json
|
|
387
|
+
* {
|
|
388
|
+
* "models": {
|
|
389
|
+
* "completions": {
|
|
390
|
+
* "allowList": [
|
|
391
|
+
* "openai/gpt-5",
|
|
392
|
+
* {
|
|
393
|
+
* "main": "anthropic/claude-sonnet-4-6",
|
|
394
|
+
* "backup": "openai/gpt-5-mini"
|
|
395
|
+
* }
|
|
396
|
+
* ]
|
|
397
|
+
* }
|
|
398
|
+
* }
|
|
399
|
+
* }
|
|
400
|
+
* ```
|
|
412
401
|
*/
|
|
413
402
|
export declare class AIGatewayModelRoutingV2InboundPolicy extends InboundPolicy<AIGatewayModelRoutingV2InboundPolicyOptions> {
|
|
414
403
|
#private;
|
|
415
404
|
static readonly policyType = "ai-gateway-model-routing-v2";
|
|
416
|
-
/* Excluded from this release type: setModelSelection */
|
|
417
|
-
/** Get the model selection for the current request. */
|
|
418
|
-
static getModelSelection(
|
|
419
|
-
context: ZuploContext
|
|
420
|
-
): AIGatewayModelSelection | undefined;
|
|
421
|
-
/** Get the provider catalog loaded for the current request. */
|
|
422
|
-
static getProviders(
|
|
423
|
-
context: ZuploContext
|
|
424
|
-
): AIGatewayProviderInfo[] | undefined;
|
|
425
405
|
constructor(
|
|
426
406
|
options: AIGatewayModelRoutingV2InboundPolicyOptions,
|
|
427
407
|
policyName: string
|
|
@@ -433,27 +413,38 @@ export declare class AIGatewayModelRoutingV2InboundPolicy extends InboundPolicy<
|
|
|
433
413
|
}
|
|
434
414
|
|
|
435
415
|
/**
|
|
436
|
-
* Options for
|
|
416
|
+
* Options for allowing or blocking provider/model routes for each AI Gateway capability.
|
|
437
417
|
* @public
|
|
438
418
|
*/
|
|
439
|
-
export declare
|
|
440
|
-
|
|
441
|
-
} & {
|
|
442
|
-
completions?: CompletionsRouting;
|
|
443
|
-
routingFunction?: RoutingFunction;
|
|
444
|
-
embeddings?: EmbeddingsRouting;
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
export declare interface AIGatewayModelSelection {
|
|
448
|
-
byCapability: Partial<
|
|
449
|
-
Record<AIGatewayCapability, AIGatewayCapabilitySelection>
|
|
450
|
-
>;
|
|
419
|
+
export declare interface AIGatewayModelRoutingV2InboundPolicyOptions {
|
|
420
|
+
models: Models;
|
|
451
421
|
}
|
|
452
422
|
|
|
423
|
+
/**
|
|
424
|
+
* Accesses the live AI Gateway provider and model catalog.
|
|
425
|
+
*
|
|
426
|
+
* Results use the existing 60-second catalog cache. Credentials and the names
|
|
427
|
+
* of their environment-variable bindings are never returned.
|
|
428
|
+
*
|
|
429
|
+
* @public
|
|
430
|
+
* @example
|
|
431
|
+
* ```typescript
|
|
432
|
+
* import { AIGatewayModels } from "@zuplo/runtime";
|
|
433
|
+
*
|
|
434
|
+
* const providers = await AIGatewayModels.load(context);
|
|
435
|
+
* ```
|
|
436
|
+
*/
|
|
437
|
+
export declare const AIGatewayModels: {
|
|
438
|
+
load(context: ZuploContext): Promise<AIGatewayProviderInfo[]>;
|
|
439
|
+
};
|
|
440
|
+
|
|
453
441
|
/**
|
|
454
442
|
* Converts OpenAI Chat Completions format responses back to Anthropic Messages format.
|
|
455
443
|
* This policy translates the response when the original request was in Anthropic format.
|
|
456
444
|
*
|
|
445
|
+
* @deprecated Platform AI Gateway routes use native Anthropic passthrough. This
|
|
446
|
+
* policy is retained for legacy custom routes that explicitly require translation.
|
|
447
|
+
*
|
|
457
448
|
* @hidden
|
|
458
449
|
* @title OpenAI to Anthropic Format Translator
|
|
459
450
|
* @product ai-gateway
|
|
@@ -473,14 +464,18 @@ export declare const AIGatewayOpenAIToAnthropicOutboundPolicy: OutboundPolicyHan
|
|
|
473
464
|
export declare interface AIGatewayOpenAIToAnthropicOutboundPolicyOptions {}
|
|
474
465
|
|
|
475
466
|
/**
|
|
476
|
-
*
|
|
467
|
+
* Public metadata for an AI Gateway provider and its models.
|
|
477
468
|
*
|
|
478
|
-
* Credentials and environment-variable names are never exposed
|
|
479
|
-
* code. A provider can appear in this catalog without a key configured for the
|
|
480
|
-
* project, so routing functions should restrict candidates to providers that
|
|
481
|
-
* the project is configured to use.
|
|
469
|
+
* Credentials and environment-variable names are never exposed.
|
|
482
470
|
*
|
|
483
471
|
* @public
|
|
472
|
+
* @example
|
|
473
|
+
* ```typescript
|
|
474
|
+
* const providers = await AIGatewayModels.load(context);
|
|
475
|
+
* const activeOpenAIModels = providers
|
|
476
|
+
* .find((provider) => provider.name === "openai")
|
|
477
|
+
* ?.models.filter((model) => model.status === "active");
|
|
478
|
+
* ```
|
|
484
479
|
*/
|
|
485
480
|
export declare interface AIGatewayProviderInfo {
|
|
486
481
|
/** The case-insensitive provider identifier used in model routing. */
|
|
@@ -496,51 +491,54 @@ export declare interface AIGatewayProviderInfo {
|
|
|
496
491
|
}
|
|
497
492
|
|
|
498
493
|
/**
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
* used by later policies or the route handler.
|
|
494
|
+
* A single AI Gateway routing target.
|
|
495
|
+
*
|
|
496
|
+
* Model references use `"provider/model"`; the string form is shorthand for
|
|
497
|
+
* `{ main: "provider/model" }`. The built-in model-routing policy uses this
|
|
498
|
+
* same type for each allow-list item: it matches the request against its
|
|
499
|
+
* allowList and `set()`s the winning target.
|
|
506
500
|
*
|
|
507
|
-
* @param request - An isolated clone of the incoming gateway request.
|
|
508
|
-
* @param context - The current Zuplo request context.
|
|
509
|
-
* @param options - Static defaults, the live provider catalog, and policy name.
|
|
510
|
-
* @returns Per-request model routing, or undefined to keep the static defaults.
|
|
511
501
|
* @public
|
|
502
|
+
* @example
|
|
503
|
+
* ```typescript
|
|
504
|
+
* const target: AIGatewayRouteTarget = {
|
|
505
|
+
* main: "openai/gpt-5",
|
|
506
|
+
* backup: "anthropic/claude-sonnet-4-6",
|
|
507
|
+
* fallbackTimeoutSeconds: 30,
|
|
508
|
+
* quotaFallback: "openai/gpt-5-mini",
|
|
509
|
+
* };
|
|
510
|
+
* ```
|
|
512
511
|
*/
|
|
513
|
-
export declare type
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
512
|
+
export declare type AIGatewayRouteTarget =
|
|
513
|
+
| string
|
|
514
|
+
| {
|
|
515
|
+
main: string;
|
|
516
|
+
backup?: string;
|
|
517
|
+
fallbackTimeoutSeconds?: number;
|
|
518
|
+
quotaFallback?: string;
|
|
519
|
+
};
|
|
521
520
|
|
|
522
521
|
/**
|
|
523
|
-
*
|
|
522
|
+
* The model routing selected for the current AI Gateway request.
|
|
523
|
+
*
|
|
524
|
+
* Each capability accepts the same {@link AIGatewayRouteTarget} used by an
|
|
525
|
+
* allow-list item in the built-in policy. The policy matches its allowList and
|
|
526
|
+
* `set()`s the one winning target for the request.
|
|
524
527
|
*
|
|
525
528
|
* @public
|
|
529
|
+
* @example
|
|
530
|
+
* ```typescript
|
|
531
|
+
* const routing: AIGatewayRouting = {
|
|
532
|
+
* completions: "openai/gpt-5",
|
|
533
|
+
* embeddings: { main: "openai/text-embedding-3-small" },
|
|
534
|
+
* };
|
|
535
|
+
* ```
|
|
526
536
|
*/
|
|
527
|
-
export declare interface
|
|
528
|
-
/**
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
defaultRouting: AIGatewayModelRouting | undefined;
|
|
533
|
-
/**
|
|
534
|
-
* The live provider catalog, including model pricing and lifecycle status.
|
|
535
|
-
* Catalog membership does not guarantee that the project has credentials for
|
|
536
|
-
* a provider. Credentials and their environment-variable names are not
|
|
537
|
-
* exposed to the routing function.
|
|
538
|
-
*/
|
|
539
|
-
providers: AIGatewayProviderInfo[];
|
|
540
|
-
/**
|
|
541
|
-
* The name of the model-routing policy as set in policies.json.
|
|
542
|
-
*/
|
|
543
|
-
policyName: string;
|
|
537
|
+
export declare interface AIGatewayRouting {
|
|
538
|
+
/** Routing for chat completions, Responses, and Anthropic Messages. */
|
|
539
|
+
completions?: AIGatewayRouteTarget;
|
|
540
|
+
/** Routing for embedding requests. */
|
|
541
|
+
embeddings?: AIGatewayRouteTarget;
|
|
544
542
|
}
|
|
545
543
|
|
|
546
544
|
/**
|
|
@@ -791,9 +789,9 @@ export declare interface AiUsage {
|
|
|
791
789
|
* @product ai-gateway
|
|
792
790
|
* @requiresAI
|
|
793
791
|
*
|
|
794
|
-
* This policy integrates with Akamai's AI Firewall service to detect
|
|
795
|
-
*
|
|
796
|
-
*
|
|
792
|
+
* This policy integrates with Akamai's AI Firewall service to detect and block
|
|
793
|
+
* malicious AI inputs and outputs. It uses the shared AI Gateway shape and
|
|
794
|
+
* streaming helpers for both streaming and non-streaming responses.
|
|
797
795
|
*
|
|
798
796
|
* For streaming responses, it uses a transform stream that can block
|
|
799
797
|
* content mid-stream if harmful content is detected.
|
|
@@ -1056,6 +1054,14 @@ export declare interface AkamaiFirewallForAiOutboundPolicyOptions {
|
|
|
1056
1054
|
detectUrl?: string;
|
|
1057
1055
|
}
|
|
1058
1056
|
|
|
1057
|
+
/**
|
|
1058
|
+
* Curated targets clients may select; the first entry is the default when model is omitted.
|
|
1059
|
+
*
|
|
1060
|
+
* @minItems 1
|
|
1061
|
+
* @public
|
|
1062
|
+
*/
|
|
1063
|
+
declare type AllowedModels = [RouteTarget, ...RouteTarget[]];
|
|
1064
|
+
|
|
1059
1065
|
/**
|
|
1060
1066
|
* Amberflo is a usage metering and billing service. This policy allows
|
|
1061
1067
|
* you to send metering calls for each API to their meter ingest endpoint.
|
|
@@ -1471,7 +1477,7 @@ declare interface APITokenCredentialConfig {
|
|
|
1471
1477
|
}
|
|
1472
1478
|
|
|
1473
1479
|
/**
|
|
1474
|
-
* The endpoint shapes to cache. Defaults to ['openai-chat'
|
|
1480
|
+
* The endpoint shapes to cache. Defaults to ['openai-chat', 'anthropic-messages']; OpenAI Responses remains unsupported.
|
|
1475
1481
|
* @public
|
|
1476
1482
|
*/
|
|
1477
1483
|
declare type ApplicableEndpoints = (
|
|
@@ -2544,6 +2550,14 @@ declare interface BatchDispatcherOptions {
|
|
|
2544
2550
|
name?: string;
|
|
2545
2551
|
}
|
|
2546
2552
|
|
|
2553
|
+
/**
|
|
2554
|
+
* Configured provider/model targets rejected in open-but-filtered mode; requests may use a bare model name or provider/model.
|
|
2555
|
+
*
|
|
2556
|
+
* @minItems 1
|
|
2557
|
+
* @public
|
|
2558
|
+
*/
|
|
2559
|
+
declare type BlockedModels = [ProviderAndModel, ...ProviderAndModel[]];
|
|
2560
|
+
|
|
2547
2561
|
/**
|
|
2548
2562
|
* The brownout policy allows performing scheduled downtime on your API
|
|
2549
2563
|
*
|
|
@@ -2714,6 +2728,14 @@ export declare interface CachingInboundPolicyOptions {
|
|
|
2714
2728
|
dangerouslyIgnoreAuthorizationHeader?: boolean;
|
|
2715
2729
|
}
|
|
2716
2730
|
|
|
2731
|
+
/**
|
|
2732
|
+
* Choose curated allow-list mode or open-but-filtered block-list mode.
|
|
2733
|
+
* @public
|
|
2734
|
+
*/
|
|
2735
|
+
declare type CapabilityModelRules =
|
|
2736
|
+
| CuratedModelRules
|
|
2737
|
+
| OpenButFilteredModelRules;
|
|
2738
|
+
|
|
2717
2739
|
/**
|
|
2718
2740
|
* Controls which parts of the incoming request are sent to Akamai for inspection. Akamai's detect endpoint receives the captured fields concatenated into a single labeled text payload as `llmInput`.
|
|
2719
2741
|
* @public
|
|
@@ -3273,27 +3295,10 @@ declare interface CompatibilityFlags {
|
|
|
3273
3295
|
}
|
|
3274
3296
|
|
|
3275
3297
|
/**
|
|
3276
|
-
*
|
|
3298
|
+
* Rules for chat completions, Responses, and Anthropic Messages requests.
|
|
3277
3299
|
* @public
|
|
3278
3300
|
*/
|
|
3279
|
-
declare
|
|
3280
|
-
model: {
|
|
3281
|
-
provider: string;
|
|
3282
|
-
model: string;
|
|
3283
|
-
};
|
|
3284
|
-
fallback?: {
|
|
3285
|
-
provider: string;
|
|
3286
|
-
model: string;
|
|
3287
|
-
/**
|
|
3288
|
-
* How long the primary model may take before the fallback is attempted.
|
|
3289
|
-
*/
|
|
3290
|
-
timeoutSeconds?: number;
|
|
3291
|
-
};
|
|
3292
|
-
quotaFallback?: {
|
|
3293
|
-
provider: string;
|
|
3294
|
-
model: string;
|
|
3295
|
-
};
|
|
3296
|
-
}
|
|
3301
|
+
declare type CompletionsModels = CapabilityModelRules;
|
|
3297
3302
|
|
|
3298
3303
|
/**
|
|
3299
3304
|
* @public
|
|
@@ -3718,6 +3723,14 @@ export declare class CryptoBeta extends BaseCryptoBeta {
|
|
|
3718
3723
|
digest(algorithm: string, data: string): Promise<string>;
|
|
3719
3724
|
}
|
|
3720
3725
|
|
|
3726
|
+
/**
|
|
3727
|
+
* Allow only listed targets and use entry zero as the default.
|
|
3728
|
+
* @public
|
|
3729
|
+
*/
|
|
3730
|
+
declare interface CuratedModelRules {
|
|
3731
|
+
allowList: AllowedModels;
|
|
3732
|
+
}
|
|
3733
|
+
|
|
3721
3734
|
/**
|
|
3722
3735
|
* Authenticate users using the Curity Phantom Token Pattern.
|
|
3723
3736
|
*
|
|
@@ -4229,27 +4242,10 @@ export declare class DynatraceMetricsPlugin extends MetricsPlugin {
|
|
|
4229
4242
|
}
|
|
4230
4243
|
|
|
4231
4244
|
/**
|
|
4232
|
-
*
|
|
4245
|
+
* Rules for embedding requests.
|
|
4233
4246
|
* @public
|
|
4234
4247
|
*/
|
|
4235
|
-
declare
|
|
4236
|
-
model: {
|
|
4237
|
-
provider: string;
|
|
4238
|
-
model: string;
|
|
4239
|
-
};
|
|
4240
|
-
fallback?: {
|
|
4241
|
-
provider: string;
|
|
4242
|
-
model: string;
|
|
4243
|
-
/**
|
|
4244
|
-
* How long the primary model may take before the fallback is attempted.
|
|
4245
|
-
*/
|
|
4246
|
-
timeoutSeconds?: number;
|
|
4247
|
-
};
|
|
4248
|
-
quotaFallback?: {
|
|
4249
|
-
provider: string;
|
|
4250
|
-
model: string;
|
|
4251
|
-
};
|
|
4252
|
-
}
|
|
4248
|
+
declare type EmbeddingsModels = CapabilityModelRules;
|
|
4253
4249
|
|
|
4254
4250
|
/**
|
|
4255
4251
|
* Enable accumulation and validation of streaming responses.
|
|
@@ -4376,6 +4372,12 @@ export declare function extractStreamTextDelta(
|
|
|
4376
4372
|
format: AiFormat
|
|
4377
4373
|
): string | undefined;
|
|
4378
4374
|
|
|
4375
|
+
/**
|
|
4376
|
+
* How long the main model may take before the backup is attempted.
|
|
4377
|
+
* @public
|
|
4378
|
+
*/
|
|
4379
|
+
declare type FallbackTimeoutSeconds = number;
|
|
4380
|
+
|
|
4379
4381
|
declare interface FetchOptions<T> {
|
|
4380
4382
|
method?: HttpMethod_2;
|
|
4381
4383
|
data?: T;
|
|
@@ -9925,6 +9927,26 @@ declare interface ModelConfiguration {
|
|
|
9925
9927
|
provider: string;
|
|
9926
9928
|
}
|
|
9927
9929
|
|
|
9930
|
+
/**
|
|
9931
|
+
* A primary model and optional failure or quota fallbacks.
|
|
9932
|
+
* @public
|
|
9933
|
+
*/
|
|
9934
|
+
declare interface ModelRouteTarget {
|
|
9935
|
+
main: ProviderAndModel1;
|
|
9936
|
+
backup?: ProviderAndModel2;
|
|
9937
|
+
fallbackTimeoutSeconds?: FallbackTimeoutSeconds;
|
|
9938
|
+
quotaFallback?: ProviderAndModel3;
|
|
9939
|
+
}
|
|
9940
|
+
|
|
9941
|
+
/**
|
|
9942
|
+
* Declarative model-routing rules, grouped by AI Gateway capability.
|
|
9943
|
+
* @public
|
|
9944
|
+
*/
|
|
9945
|
+
declare interface Models {
|
|
9946
|
+
completions?: CompletionsModels;
|
|
9947
|
+
embeddings?: EmbeddingsModels;
|
|
9948
|
+
}
|
|
9949
|
+
|
|
9928
9950
|
declare type Modify<T, R> = Omit<T, keyof R> & R;
|
|
9929
9951
|
|
|
9930
9952
|
declare interface MoesifContext {
|
|
@@ -11072,6 +11094,14 @@ declare namespace OpenAPIV3_1 {
|
|
|
11072
11094
|
}
|
|
11073
11095
|
}
|
|
11074
11096
|
|
|
11097
|
+
/**
|
|
11098
|
+
* Allow any requested target except those explicitly blocked.
|
|
11099
|
+
* @public
|
|
11100
|
+
*/
|
|
11101
|
+
declare interface OpenButFilteredModelRules {
|
|
11102
|
+
blockList: BlockedModels;
|
|
11103
|
+
}
|
|
11104
|
+
|
|
11075
11105
|
/**
|
|
11076
11106
|
* Authorize requests using OpenFGA.
|
|
11077
11107
|
*
|
|
@@ -11788,6 +11818,30 @@ export declare interface PropelAuthJwtInboundPolicyOptions {
|
|
|
11788
11818
|
oAuthResourceMetadataEnabled?: boolean;
|
|
11789
11819
|
}
|
|
11790
11820
|
|
|
11821
|
+
/**
|
|
11822
|
+
* A model reference in provider/model form, split on the first slash.
|
|
11823
|
+
* @public
|
|
11824
|
+
*/
|
|
11825
|
+
declare type ProviderAndModel = string;
|
|
11826
|
+
|
|
11827
|
+
/**
|
|
11828
|
+
* A model reference in provider/model form, split on the first slash.
|
|
11829
|
+
* @public
|
|
11830
|
+
*/
|
|
11831
|
+
declare type ProviderAndModel1 = string;
|
|
11832
|
+
|
|
11833
|
+
/**
|
|
11834
|
+
* A model reference in provider/model form, split on the first slash.
|
|
11835
|
+
* @public
|
|
11836
|
+
*/
|
|
11837
|
+
declare type ProviderAndModel2 = string;
|
|
11838
|
+
|
|
11839
|
+
/**
|
|
11840
|
+
* A model reference in provider/model form, split on the first slash.
|
|
11841
|
+
* @public
|
|
11842
|
+
*/
|
|
11843
|
+
declare type ProviderAndModel3 = string;
|
|
11844
|
+
|
|
11791
11845
|
/**
|
|
11792
11846
|
* Extracts a query parameter and sets it as a header in the request.
|
|
11793
11847
|
*
|
|
@@ -13606,19 +13660,10 @@ export declare interface RouteHandler<T = unknown> {
|
|
|
13606
13660
|
/* Excluded from this release type: Router */
|
|
13607
13661
|
|
|
13608
13662
|
/**
|
|
13609
|
-
*
|
|
13663
|
+
* A provider/model string shorthand or a full model route target.
|
|
13610
13664
|
* @public
|
|
13611
13665
|
*/
|
|
13612
|
-
declare
|
|
13613
|
-
/**
|
|
13614
|
-
* Module to load the routing function from, e.g. $import(./modules/model-routing).
|
|
13615
|
-
*/
|
|
13616
|
-
module: string;
|
|
13617
|
-
/**
|
|
13618
|
-
* Named export of the routing function, e.g. 'default' or 'routeModels'.
|
|
13619
|
-
*/
|
|
13620
|
-
export: string;
|
|
13621
|
-
}
|
|
13666
|
+
declare type RouteTarget = ProviderAndModel | ModelRouteTarget;
|
|
13622
13667
|
|
|
13623
13668
|
/**
|
|
13624
13669
|
* The authorization rule evaluated against the authenticated user's claims (request.user.data, populated by the authentication policy that runs before this one — a JWT policy, API key auth, mTLS, etc.). A rule is either a single claim check (eq, in, or startsWith) or an and/or combination of nested rules. Combinators may nest up to three levels deep. Requests that fail the rule receive a 403 Forbidden response.
|