@zuplo/cli 6.72.7 → 6.72.9
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/index.d.ts +1 -0
- package/node_modules/@posthog/core/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/surveys/activation.d.ts +20 -0
- package/node_modules/@posthog/core/dist/surveys/activation.d.ts.map +1 -0
- package/node_modules/@posthog/core/dist/surveys/activation.js +45 -0
- package/node_modules/@posthog/core/dist/surveys/activation.mjs +8 -0
- package/node_modules/@posthog/core/dist/surveys/events.d.ts +1 -4
- package/node_modules/@posthog/core/dist/surveys/events.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/surveys/index.d.ts +2 -0
- package/node_modules/@posthog/core/dist/surveys/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/surveys/index.js +16 -2
- package/node_modules/@posthog/core/dist/surveys/index.mjs +3 -1
- package/node_modules/@posthog/core/dist/surveys/keys.d.ts +14 -0
- package/node_modules/@posthog/core/dist/surveys/keys.d.ts.map +1 -0
- package/node_modules/@posthog/core/dist/surveys/keys.js +45 -0
- package/node_modules/@posthog/core/dist/surveys/keys.mjs +8 -0
- package/node_modules/@posthog/core/dist/types.d.ts +87 -76
- package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/types.js +65 -76
- package/node_modules/@posthog/core/dist/types.mjs +66 -77
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.d.ts +17 -0
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.js +18 -1
- package/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs +9 -1
- package/node_modules/@posthog/core/dist/utils/type-utils.d.ts.map +1 -1
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/index.ts +3 -0
- package/node_modules/@posthog/core/src/posthog-core-stateless.ts +0 -1
- package/node_modules/@posthog/core/src/posthog-core.ts +0 -1
- package/node_modules/@posthog/core/src/surveys/activation.spec.ts +61 -0
- package/node_modules/@posthog/core/src/surveys/activation.ts +28 -0
- package/node_modules/@posthog/core/src/surveys/events.ts +1 -5
- package/node_modules/@posthog/core/src/surveys/index.ts +2 -0
- package/node_modules/@posthog/core/src/surveys/keys.spec.ts +29 -0
- package/node_modules/@posthog/core/src/surveys/keys.ts +23 -0
- package/node_modules/@posthog/core/src/types.ts +88 -76
- package/node_modules/@posthog/core/src/utils/bucketed-rate-limiter.spec.ts +38 -1
- package/node_modules/@posthog/core/src/utils/bucketed-rate-limiter.ts +29 -0
- package/node_modules/@posthog/core/src/utils/type-utils.ts +0 -6
- package/node_modules/@posthog/types/LICENSE +2 -2
- package/node_modules/@posthog/types/dist/index.d.ts +1 -1
- package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +32 -11
- 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/index.ts +1 -0
- package/node_modules/@posthog/types/src/posthog-config.ts +34 -11
- 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-423FXHUV.js → chunk-HKSZ4V6H.js} +124 -124
- package/node_modules/@zuplo/runtime/out/esm/chunk-HKSZ4V6H.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/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/types/index.d.ts +283 -3
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +5 -5
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/ws/lib/receiver.js +15 -32
- package/node_modules/ws/lib/websocket-server.js +4 -4
- package/node_modules/ws/lib/websocket.js +4 -4
- package/node_modules/ws/package.json +5 -1
- package/package.json +6 -6
- package/node_modules/@zuplo/runtime/out/esm/chunk-423FXHUV.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-423FXHUV.js.LEGAL.txt → chunk-HKSZ4V6H.js.LEGAL.txt} +0 -0
|
@@ -139,6 +139,35 @@ export declare interface AIGatewayAuthInboundPolicyOptions {
|
|
|
139
139
|
authScheme?: string;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
export declare type AIGatewayCapability =
|
|
143
|
+
| "completions"
|
|
144
|
+
| "embeddings"
|
|
145
|
+
| "rerank"
|
|
146
|
+
| "moderations"
|
|
147
|
+
| "images"
|
|
148
|
+
| "audio_speech"
|
|
149
|
+
| "audio_transcriptions";
|
|
150
|
+
|
|
151
|
+
export declare interface AIGatewayCapabilityRouting {
|
|
152
|
+
model: AIGatewayModelRef;
|
|
153
|
+
fallback?: AIGatewayFallbackRef;
|
|
154
|
+
quotaFallback?: AIGatewayModelRef;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare interface AIGatewayCapabilitySelection {
|
|
158
|
+
candidates: AIGatewayModelCandidate[];
|
|
159
|
+
fallbackTimeoutSeconds?: number;
|
|
160
|
+
quotaFallback?: AIGatewayModelCandidate;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export declare interface AIGatewayFallbackRef extends AIGatewayModelRef {
|
|
164
|
+
/**
|
|
165
|
+
* Bounds the primary call before failing over. Defaults to 60 seconds and is
|
|
166
|
+
* only meaningful when a fallback is configured.
|
|
167
|
+
*/
|
|
168
|
+
timeoutSeconds?: number;
|
|
169
|
+
}
|
|
170
|
+
|
|
142
171
|
/**
|
|
143
172
|
* Handler that routes AI/LLM requests through Zuplo's LLM Translation Layer.
|
|
144
173
|
* This handler forwards requests to the translation layer that handles provider-specific
|
|
@@ -165,6 +194,36 @@ export declare function aiGatewayHandler(
|
|
|
165
194
|
context: ZuploContext
|
|
166
195
|
): Promise<Response>;
|
|
167
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Routes AI requests using the model selection stored in the request context.
|
|
199
|
+
* Attach the `ai-gateway-models-inbound` policy before this handler runs. To
|
|
200
|
+
* compute routing per request, set that policy's `routingFunction` option to
|
|
201
|
+
* a module export.
|
|
202
|
+
*
|
|
203
|
+
* @beta
|
|
204
|
+
* @param request - The incoming AI Gateway request.
|
|
205
|
+
* @param context - The ZuploContext containing the model selection.
|
|
206
|
+
* @returns A response from the selected AI provider.
|
|
207
|
+
*
|
|
208
|
+
* @public
|
|
209
|
+
* @example
|
|
210
|
+
* ```json
|
|
211
|
+
* {
|
|
212
|
+
* "handler": {
|
|
213
|
+
* "export": "aiGatewayHandlerV2",
|
|
214
|
+
* "module": "$import(@zuplo/runtime)"
|
|
215
|
+
* },
|
|
216
|
+
* "policies": {
|
|
217
|
+
* "inbound": ["ai-gateway-models"]
|
|
218
|
+
* }
|
|
219
|
+
* }
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
export declare function aiGatewayHandlerV2(
|
|
223
|
+
request: ZuploRequest,
|
|
224
|
+
context: ZuploContext
|
|
225
|
+
): Promise<Response>;
|
|
226
|
+
|
|
168
227
|
/* Excluded from this release type: AIGatewayMeterIncrements */
|
|
169
228
|
|
|
170
229
|
/**
|
|
@@ -263,6 +322,69 @@ export declare interface AIGatewayMeteringInboundPolicyOptions {
|
|
|
263
322
|
throwOnFailure?: boolean;
|
|
264
323
|
}
|
|
265
324
|
|
|
325
|
+
export declare interface AIGatewayModelCandidate {
|
|
326
|
+
provider: string;
|
|
327
|
+
model: string;
|
|
328
|
+
apiKey?: string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export declare interface AIGatewayModelRef {
|
|
332
|
+
provider: string;
|
|
333
|
+
model: string;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export declare interface AIGatewayModelRouting {
|
|
337
|
+
providers: AIGatewayProviderCredential[];
|
|
338
|
+
completions?: AIGatewayCapabilityRouting;
|
|
339
|
+
embeddings?: AIGatewayCapabilityRouting;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export declare interface AIGatewayModelSelection {
|
|
343
|
+
byCapability: Partial<
|
|
344
|
+
Record<AIGatewayCapability, AIGatewayCapabilitySelection>
|
|
345
|
+
>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Selects AI Gateway models and fallbacks for each configured capability.
|
|
350
|
+
*
|
|
351
|
+
* @title AI Gateway Models
|
|
352
|
+
* @beta
|
|
353
|
+
* @product ai-gateway
|
|
354
|
+
* @hidden
|
|
355
|
+
* @requiresAI
|
|
356
|
+
* @param request - The ZuploRequest
|
|
357
|
+
* @param context - The ZuploContext
|
|
358
|
+
* @param options - The policy options set in policies.json
|
|
359
|
+
* @param policyName - The name of the policy as set in policies.json
|
|
360
|
+
* @returns The request with the model selection stored in context
|
|
361
|
+
*/
|
|
362
|
+
export declare class AIGatewayModelsInboundPolicy extends InboundPolicy<AIGatewayModelsInboundPolicyOptions> {
|
|
363
|
+
#private;
|
|
364
|
+
static readonly policyType = "ai-gateway-models";
|
|
365
|
+
/* Excluded from this release type: setModelSelection */
|
|
366
|
+
/** Get the model selection for the current request. */
|
|
367
|
+
static getModelSelection(
|
|
368
|
+
context: ZuploContext
|
|
369
|
+
): AIGatewayModelSelection | undefined;
|
|
370
|
+
constructor(options: AIGatewayModelsInboundPolicyOptions, policyName: string);
|
|
371
|
+
handler(
|
|
372
|
+
request: ZuploRequest,
|
|
373
|
+
context: ZuploContext
|
|
374
|
+
): Promise<ZuploRequest | Response>;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Options for provider credentials and per-capability AI model routing.
|
|
379
|
+
* @public
|
|
380
|
+
*/
|
|
381
|
+
export declare interface AIGatewayModelsInboundPolicyOptions {
|
|
382
|
+
providers?: Providers;
|
|
383
|
+
completions?: CompletionsRouting;
|
|
384
|
+
routingFunction?: RoutingFunction;
|
|
385
|
+
embeddings?: EmbeddingsRouting;
|
|
386
|
+
}
|
|
387
|
+
|
|
266
388
|
/**
|
|
267
389
|
* Converts OpenAI Chat Completions format responses back to Anthropic Messages format.
|
|
268
390
|
* This policy translates the response when the original request was in Anthropic format.
|
|
@@ -285,6 +407,44 @@ export declare const AIGatewayOpenAIToAnthropicOutboundPolicy: OutboundPolicyHan
|
|
|
285
407
|
*/
|
|
286
408
|
export declare interface AIGatewayOpenAIToAnthropicOutboundPolicyOptions {}
|
|
287
409
|
|
|
410
|
+
export declare interface AIGatewayProviderCredential {
|
|
411
|
+
provider: string;
|
|
412
|
+
apiKey: string;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Computes model routing for a request. Set as the models policy's
|
|
417
|
+
* `routingFunction` option. The returned routing is validated exactly like the
|
|
418
|
+
* static policy options and replaces them for the request. Return undefined to
|
|
419
|
+
* use `options.defaultRouting` unchanged. The function owns merge semantics:
|
|
420
|
+
* return the defaults as-is, a modified copy, or entirely new routing. The
|
|
421
|
+
* request is an isolated clone, so reading its body does not consume the request
|
|
422
|
+
* used by later policies or the route handler.
|
|
423
|
+
*/
|
|
424
|
+
export declare type AIGatewayRoutingFunction = (
|
|
425
|
+
request: ZuploRequest,
|
|
426
|
+
context: ZuploContext,
|
|
427
|
+
options: AIGatewayRoutingFunctionOptions
|
|
428
|
+
) =>
|
|
429
|
+
| AIGatewayModelRouting
|
|
430
|
+
| undefined
|
|
431
|
+
| Promise<AIGatewayModelRouting | undefined>;
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Options passed to an {@link AIGatewayRoutingFunction}.
|
|
435
|
+
*/
|
|
436
|
+
export declare interface AIGatewayRoutingFunctionOptions {
|
|
437
|
+
/**
|
|
438
|
+
* The policy's parsed static routing from policies.json, or undefined when
|
|
439
|
+
* no static routing is configured.
|
|
440
|
+
*/
|
|
441
|
+
defaultRouting: AIGatewayModelRouting | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* The name of the models policy as set in policies.json.
|
|
444
|
+
*/
|
|
445
|
+
policyName: string;
|
|
446
|
+
}
|
|
447
|
+
|
|
288
448
|
/**
|
|
289
449
|
* AI Gateway Semantic Cache policy for caching chat completion responses
|
|
290
450
|
* based on semantic similarity of user messages.
|
|
@@ -559,7 +719,7 @@ export declare function AkamaiAIFirewallInboundPolicy(
|
|
|
559
719
|
*/
|
|
560
720
|
export declare interface AkamaiAIFirewallPolicyOptions {
|
|
561
721
|
configurationId: ConfigurationID;
|
|
562
|
-
"api-key":
|
|
722
|
+
"api-key": APIKey_2;
|
|
563
723
|
applicationId?: ApplicationID;
|
|
564
724
|
streamingAccumulation?: StreamingAccumulationSettings;
|
|
565
725
|
}
|
|
@@ -599,7 +759,7 @@ export declare function AkamaiAIFirewallV2InboundPolicy(
|
|
|
599
759
|
*/
|
|
600
760
|
export declare interface AkamaiAIFirewallV2PolicyOptions {
|
|
601
761
|
configurationId: ConfigurationID_2;
|
|
602
|
-
"api-key":
|
|
762
|
+
"api-key": APIKey_3;
|
|
603
763
|
applicationId?: ApplicationID_2;
|
|
604
764
|
streamingAccumulation?: StreamingAccumulationSettings_2;
|
|
605
765
|
endpoints?: ApplicableEndpoints_2;
|
|
@@ -958,7 +1118,7 @@ export declare interface ApiAuthKeyInboundPolicyOptions {
|
|
|
958
1118
|
}
|
|
959
1119
|
|
|
960
1120
|
/**
|
|
961
|
-
* The API key
|
|
1121
|
+
* The API key itself. Use $env(MY_KEY) to substitute an environment variable at build time.
|
|
962
1122
|
* @public
|
|
963
1123
|
*/
|
|
964
1124
|
declare type APIKey = string;
|
|
@@ -969,6 +1129,12 @@ declare type APIKey = string;
|
|
|
969
1129
|
*/
|
|
970
1130
|
declare type APIKey_2 = string;
|
|
971
1131
|
|
|
1132
|
+
/**
|
|
1133
|
+
* The API key for the AI Firewall.
|
|
1134
|
+
* @public
|
|
1135
|
+
*/
|
|
1136
|
+
declare type APIKey_3 = string;
|
|
1137
|
+
|
|
972
1138
|
/**
|
|
973
1139
|
* Represents a consumer in the API Key service.
|
|
974
1140
|
* @public
|
|
@@ -3014,6 +3180,29 @@ declare interface CompatibilityFlags {
|
|
|
3014
3180
|
return501ForUnsupportedHttpMethods: boolean;
|
|
3015
3181
|
}
|
|
3016
3182
|
|
|
3183
|
+
/**
|
|
3184
|
+
* Routing for chat completions, Responses, and Anthropic Messages requests.
|
|
3185
|
+
* @public
|
|
3186
|
+
*/
|
|
3187
|
+
declare interface CompletionsRouting {
|
|
3188
|
+
model: {
|
|
3189
|
+
provider: string;
|
|
3190
|
+
model: string;
|
|
3191
|
+
};
|
|
3192
|
+
fallback?: {
|
|
3193
|
+
provider: string;
|
|
3194
|
+
model: string;
|
|
3195
|
+
/**
|
|
3196
|
+
* How long the primary model may take before the fallback is attempted.
|
|
3197
|
+
*/
|
|
3198
|
+
timeoutSeconds?: number;
|
|
3199
|
+
};
|
|
3200
|
+
quotaFallback?: {
|
|
3201
|
+
provider: string;
|
|
3202
|
+
model: string;
|
|
3203
|
+
};
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3017
3206
|
/**
|
|
3018
3207
|
* @public
|
|
3019
3208
|
*/
|
|
@@ -3947,6 +4136,29 @@ export declare class DynatraceMetricsPlugin extends MetricsPlugin {
|
|
|
3947
4136
|
static setContext(context: ZuploContext, data: DynatraceMetricsContext): void;
|
|
3948
4137
|
}
|
|
3949
4138
|
|
|
4139
|
+
/**
|
|
4140
|
+
* Routing for embedding requests.
|
|
4141
|
+
* @public
|
|
4142
|
+
*/
|
|
4143
|
+
declare interface EmbeddingsRouting {
|
|
4144
|
+
model: {
|
|
4145
|
+
provider: string;
|
|
4146
|
+
model: string;
|
|
4147
|
+
};
|
|
4148
|
+
fallback?: {
|
|
4149
|
+
provider: string;
|
|
4150
|
+
model: string;
|
|
4151
|
+
/**
|
|
4152
|
+
* How long the primary model may take before the fallback is attempted.
|
|
4153
|
+
*/
|
|
4154
|
+
timeoutSeconds?: number;
|
|
4155
|
+
};
|
|
4156
|
+
quotaFallback?: {
|
|
4157
|
+
provider: string;
|
|
4158
|
+
model: string;
|
|
4159
|
+
};
|
|
4160
|
+
}
|
|
4161
|
+
|
|
3950
4162
|
/**
|
|
3951
4163
|
* Enable accumulation and validation of streaming responses.
|
|
3952
4164
|
* @public
|
|
@@ -11484,6 +11696,29 @@ export declare interface PropelAuthJwtInboundPolicyOptions {
|
|
|
11484
11696
|
oAuthResourceMetadataEnabled?: boolean;
|
|
11485
11697
|
}
|
|
11486
11698
|
|
|
11699
|
+
/**
|
|
11700
|
+
* The provider registry key, such as openai, anthropic, or a custom provider name.
|
|
11701
|
+
* @public
|
|
11702
|
+
*/
|
|
11703
|
+
declare type Provider = string;
|
|
11704
|
+
|
|
11705
|
+
/**
|
|
11706
|
+
* Provider credentials used by model routing. Each entry must define apiKey.
|
|
11707
|
+
*
|
|
11708
|
+
* @minItems 1
|
|
11709
|
+
* @public
|
|
11710
|
+
*/
|
|
11711
|
+
declare type Providers = [
|
|
11712
|
+
{
|
|
11713
|
+
provider: Provider;
|
|
11714
|
+
apiKey: APIKey;
|
|
11715
|
+
},
|
|
11716
|
+
...{
|
|
11717
|
+
provider: Provider;
|
|
11718
|
+
apiKey: APIKey;
|
|
11719
|
+
}[],
|
|
11720
|
+
];
|
|
11721
|
+
|
|
11487
11722
|
/**
|
|
11488
11723
|
* Extracts a query parameter and sets it as a header in the request.
|
|
11489
11724
|
*
|
|
@@ -13301,6 +13536,21 @@ export declare interface RouteHandler<T = unknown> {
|
|
|
13301
13536
|
|
|
13302
13537
|
/* Excluded from this release type: Router */
|
|
13303
13538
|
|
|
13539
|
+
/**
|
|
13540
|
+
* Custom function that computes model routing for each request. The export must be an AIGatewayRoutingFunction. It receives the policy's parsed static routing (if any) as defaultRouting; its return value is validated like the static options and replaces the routing for the request. Returning undefined keeps the defaults unchanged.
|
|
13541
|
+
* @public
|
|
13542
|
+
*/
|
|
13543
|
+
declare interface RoutingFunction {
|
|
13544
|
+
/**
|
|
13545
|
+
* Module to load the routing function from, e.g. $import(./modules/model-routing).
|
|
13546
|
+
*/
|
|
13547
|
+
module: string;
|
|
13548
|
+
/**
|
|
13549
|
+
* Named export of the routing function, e.g. 'default' or 'routeModels'.
|
|
13550
|
+
*/
|
|
13551
|
+
export: string;
|
|
13552
|
+
}
|
|
13553
|
+
|
|
13304
13554
|
/**
|
|
13305
13555
|
* 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.
|
|
13306
13556
|
* @public
|
|
@@ -14774,6 +15024,21 @@ declare interface UrlConfig {
|
|
|
14774
15024
|
* }
|
|
14775
15025
|
* }
|
|
14776
15026
|
* ```
|
|
15027
|
+
*
|
|
15028
|
+
* @example
|
|
15029
|
+
* ```json
|
|
15030
|
+
* // Abort the request with a 504 if the upstream takes longer than 30 seconds
|
|
15031
|
+
* {
|
|
15032
|
+
* "handler": {
|
|
15033
|
+
* "export": "urlForwardHandler",
|
|
15034
|
+
* "module": "$import(@zuplo/runtime)",
|
|
15035
|
+
* "options": {
|
|
15036
|
+
* "baseUrl": "https://backend.example.com",
|
|
15037
|
+
* "requestTimeoutSeconds": 30
|
|
15038
|
+
* }
|
|
15039
|
+
* }
|
|
15040
|
+
* }
|
|
15041
|
+
* ```
|
|
14777
15042
|
*/
|
|
14778
15043
|
export declare function urlForwardHandler(
|
|
14779
15044
|
request: ZuploRequest,
|
|
@@ -14841,6 +15106,21 @@ export declare function urlForwardHandler(
|
|
|
14841
15106
|
* }
|
|
14842
15107
|
* }
|
|
14843
15108
|
* ```
|
|
15109
|
+
*
|
|
15110
|
+
* @example
|
|
15111
|
+
* ```json
|
|
15112
|
+
* // Abort the request with a 504 if the upstream takes longer than 30 seconds
|
|
15113
|
+
* {
|
|
15114
|
+
* "handler": {
|
|
15115
|
+
* "export": "urlRewriteHandler",
|
|
15116
|
+
* "module": "$import(@zuplo/runtime)",
|
|
15117
|
+
* "options": {
|
|
15118
|
+
* "rewritePattern": "https://backend.internal/api${url.pathname}",
|
|
15119
|
+
* "requestTimeoutSeconds": 30
|
|
15120
|
+
* }
|
|
15121
|
+
* }
|
|
15122
|
+
* }
|
|
15123
|
+
* ```
|
|
14844
15124
|
*/
|
|
14845
15125
|
export declare function urlRewriteHandler(
|
|
14846
15126
|
request: ZuploRequest,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Optional per-caller access control. Defaults to mode 'allPublic' (no access control). Set mode to 'rolesAndGroups' to match the caller's role/group claims against each capability's markup (
|
|
4
|
+
* Optional per-caller access control. Defaults to mode 'allPublic' (no access control). Set mode to 'rolesAndGroups' to match the caller's role/group claims against each capability's markup (a capability with no roles/groups/public markup is available to no one), or 'function' to delegate to a custom resolver.
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
7
|
declare interface AccessControl {
|
|
@@ -128,9 +128,9 @@ declare interface BuildRouteConfiguration {
|
|
|
128
128
|
* `roles`/`groups`, each allowing a dot-path such as `realm_access.roles`).
|
|
129
129
|
* `request.user.data` is populated by whichever auth policy ran (JWT claims,
|
|
130
130
|
* API-key metadata, etc.). A capability marked `public: true` is allowed for
|
|
131
|
-
* everyone; otherwise the caller must match any listed role or group.
|
|
132
|
-
*
|
|
133
|
-
* nothing is
|
|
131
|
+
* everyone; otherwise the caller must match any listed role or group. A
|
|
132
|
+
* capability with no roles/groups/public markup is available to no one until
|
|
133
|
+
* it is classified, so nothing is ever exposed by omission.
|
|
134
134
|
*
|
|
135
135
|
* @public
|
|
136
136
|
*/
|
|
@@ -4541,7 +4541,7 @@ declare interface PromptProjection {
|
|
|
4541
4541
|
}
|
|
4542
4542
|
|
|
4543
4543
|
/**
|
|
4544
|
-
* Access control: mark this capability as available to all callers. In mode 'rolesAndGroups'
|
|
4544
|
+
* Access control: mark this capability as available to all callers. In mode 'rolesAndGroups' a capability with no roles/groups/public markup is available to no one until it is classified, so nothing is ever exposed by omission. Combining public: true with roles/groups is a configuration error.
|
|
4545
4545
|
* @public
|
|
4546
4546
|
*/
|
|
4547
4547
|
declare type Public = boolean;
|
|
@@ -77,6 +77,7 @@ class Receiver extends Writable {
|
|
|
77
77
|
|
|
78
78
|
this._totalPayloadLength = 0;
|
|
79
79
|
this._messageLength = 0;
|
|
80
|
+
this._numFragments = 0;
|
|
80
81
|
this._fragments = [];
|
|
81
82
|
|
|
82
83
|
this._errored = false;
|
|
@@ -500,6 +501,19 @@ class Receiver extends Writable {
|
|
|
500
501
|
return;
|
|
501
502
|
}
|
|
502
503
|
|
|
504
|
+
if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
|
|
505
|
+
const error = this.createError(
|
|
506
|
+
RangeError,
|
|
507
|
+
'Too many message fragments',
|
|
508
|
+
false,
|
|
509
|
+
1008,
|
|
510
|
+
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
511
|
+
);
|
|
512
|
+
|
|
513
|
+
cb(error);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
|
|
503
517
|
if (this._compressed) {
|
|
504
518
|
this._state = INFLATING;
|
|
505
519
|
this.decompress(data, cb);
|
|
@@ -507,22 +521,6 @@ class Receiver extends Writable {
|
|
|
507
521
|
}
|
|
508
522
|
|
|
509
523
|
if (data.length) {
|
|
510
|
-
if (
|
|
511
|
-
this._maxFragments > 0 &&
|
|
512
|
-
this._fragments.length >= this._maxFragments
|
|
513
|
-
) {
|
|
514
|
-
const error = this.createError(
|
|
515
|
-
RangeError,
|
|
516
|
-
'Too many message fragments',
|
|
517
|
-
false,
|
|
518
|
-
1008,
|
|
519
|
-
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
520
|
-
);
|
|
521
|
-
|
|
522
|
-
cb(error);
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
524
|
//
|
|
527
525
|
// This message is not compressed so its length is the sum of the payload
|
|
528
526
|
// length of all fragments.
|
|
@@ -562,22 +560,6 @@ class Receiver extends Writable {
|
|
|
562
560
|
return;
|
|
563
561
|
}
|
|
564
562
|
|
|
565
|
-
if (
|
|
566
|
-
this._maxFragments > 0 &&
|
|
567
|
-
this._fragments.length >= this._maxFragments
|
|
568
|
-
) {
|
|
569
|
-
const error = this.createError(
|
|
570
|
-
RangeError,
|
|
571
|
-
'Too many message fragments',
|
|
572
|
-
false,
|
|
573
|
-
1008,
|
|
574
|
-
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
|
575
|
-
);
|
|
576
|
-
|
|
577
|
-
cb(error);
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
563
|
this._fragments.push(buf);
|
|
582
564
|
}
|
|
583
565
|
|
|
@@ -604,6 +586,7 @@ class Receiver extends Writable {
|
|
|
604
586
|
this._totalPayloadLength = 0;
|
|
605
587
|
this._messageLength = 0;
|
|
606
588
|
this._fragmented = 0;
|
|
589
|
+
this._numFragments = 0;
|
|
607
590
|
this._fragments = [];
|
|
608
591
|
|
|
609
592
|
if (this._opcode === 2) {
|
|
@@ -43,9 +43,9 @@ class WebSocketServer extends EventEmitter {
|
|
|
43
43
|
* called
|
|
44
44
|
* @param {Function} [options.handleProtocols] A hook to handle protocols
|
|
45
45
|
* @param {String} [options.host] The hostname where to bind the server
|
|
46
|
-
* @param {Number} [options.maxBufferedChunks=
|
|
46
|
+
* @param {Number} [options.maxBufferedChunks=262144] The maximum number of
|
|
47
47
|
* buffered data chunks
|
|
48
|
-
* @param {Number} [options.maxFragments=
|
|
48
|
+
* @param {Number} [options.maxFragments=16384] The maximum number of message
|
|
49
49
|
* fragments
|
|
50
50
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
51
51
|
* size
|
|
@@ -69,8 +69,8 @@ class WebSocketServer extends EventEmitter {
|
|
|
69
69
|
options = {
|
|
70
70
|
allowSynchronousEvents: true,
|
|
71
71
|
autoPong: true,
|
|
72
|
-
maxBufferedChunks:
|
|
73
|
-
maxFragments:
|
|
72
|
+
maxBufferedChunks: 256 * 1024,
|
|
73
|
+
maxFragments: 16 * 1024,
|
|
74
74
|
maxPayload: 100 * 1024 * 1024,
|
|
75
75
|
skipUTF8Validation: false,
|
|
76
76
|
perMessageDeflate: false,
|
|
@@ -646,9 +646,9 @@ module.exports = WebSocket;
|
|
|
646
646
|
* masking key
|
|
647
647
|
* @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
|
|
648
648
|
* handshake request
|
|
649
|
-
* @param {Number} [options.maxBufferedChunks=
|
|
649
|
+
* @param {Number} [options.maxBufferedChunks=262144] The maximum number of
|
|
650
650
|
* buffered data chunks
|
|
651
|
-
* @param {Number} [options.maxFragments=
|
|
651
|
+
* @param {Number} [options.maxFragments=16384] The maximum number of message
|
|
652
652
|
* fragments
|
|
653
653
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
654
654
|
* size
|
|
@@ -670,8 +670,8 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
670
670
|
autoPong: true,
|
|
671
671
|
closeTimeout: CLOSE_TIMEOUT,
|
|
672
672
|
protocolVersion: protocolVersions[1],
|
|
673
|
-
maxBufferedChunks:
|
|
674
|
-
maxFragments:
|
|
673
|
+
maxBufferedChunks: 256 * 1024,
|
|
674
|
+
maxFragments: 16 * 1024,
|
|
675
675
|
maxPayload: 100 * 1024 * 1024,
|
|
676
676
|
skipUTF8Validation: false,
|
|
677
677
|
perMessageDeflate: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ws",
|
|
3
|
-
"version": "8.21.
|
|
3
|
+
"version": "8.21.1",
|
|
4
4
|
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"HyBi",
|
|
@@ -66,5 +66,9 @@
|
|
|
66
66
|
"nyc": "^15.0.0",
|
|
67
67
|
"prettier": "^3.0.0",
|
|
68
68
|
"utf-8-validate": "^6.0.0"
|
|
69
|
+
},
|
|
70
|
+
"allowScripts": {
|
|
71
|
+
"bufferutil": true,
|
|
72
|
+
"utf-8-validate": true
|
|
69
73
|
}
|
|
70
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "6.72.
|
|
3
|
+
"version": "6.72.9",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"@opentelemetry/api": "1.9.0",
|
|
28
28
|
"@opentelemetry/api-logs": "0.201.1",
|
|
29
29
|
"@swc/core": "1.10.18",
|
|
30
|
-
"@zuplo/core": "6.72.
|
|
30
|
+
"@zuplo/core": "6.72.9",
|
|
31
31
|
"@zuplo/editor": "1.0.20821740935",
|
|
32
|
-
"@zuplo/openapi-tools": "6.72.
|
|
33
|
-
"@zuplo/runtime": "6.72.
|
|
32
|
+
"@zuplo/openapi-tools": "6.72.9",
|
|
33
|
+
"@zuplo/runtime": "6.72.9",
|
|
34
34
|
"chalk": "5.4.1",
|
|
35
35
|
"chokidar": "3.5.3",
|
|
36
36
|
"cookie": "1.0.2",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"workerd": "1.20241230.0",
|
|
62
62
|
"yargs": "17.7.2",
|
|
63
63
|
"zod": "3.25.76",
|
|
64
|
-
"@zuplo/graphql": "6.72.
|
|
65
|
-
"@zuplo/otel": "6.72.
|
|
64
|
+
"@zuplo/graphql": "6.72.9",
|
|
65
|
+
"@zuplo/otel": "6.72.9"
|
|
66
66
|
},
|
|
67
67
|
"bundleDependencies": [
|
|
68
68
|
"@inquirer/prompts",
|