@zuplo/runtime 7.8.24 → 7.8.25
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/out/esm/{chunk-7NJIR6WX.js → chunk-KMX3RLHQ.js} +88 -88
- package/out/esm/chunk-KMX3RLHQ.js.map +1 -0
- package/out/esm/index.js +1 -1
- package/out/esm/mcp-gateway/index.js +1 -1
- package/out/esm/mocks/index.js +1 -1
- package/out/types/index.d.ts +5 -5
- package/package.json +1 -1
- package/out/esm/chunk-7NJIR6WX.js.map +0 -1
- /package/out/esm/{chunk-7NJIR6WX.js.LEGAL.txt → chunk-KMX3RLHQ.js.LEGAL.txt} +0 -0
package/out/esm/mocks/index.js
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{E as p,J as c,M as u}from"../chunk-
|
|
25
|
+
import{E as p,J as c,M as u}from"../chunk-KMX3RLHQ.js";import"../chunk-54HRCPVQ.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-6O4OZCO6.js";import{aa as i}from"../chunk-MWIJG5KC.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
package/out/types/index.d.ts
CHANGED
|
@@ -204,7 +204,7 @@ export declare type AIGatewayCapability =
|
|
|
204
204
|
* gateway root.
|
|
205
205
|
*
|
|
206
206
|
* Place this policy on AI Gateway routes after optional authentication and
|
|
207
|
-
* optional `ai-gateway-configuration-loader-
|
|
207
|
+
* optional `ai-gateway-configuration-loader-inbound`. When either of those
|
|
208
208
|
* already populated the app-configuration channel, this policy reuses it.
|
|
209
209
|
* Otherwise it loads the configuration with the route's `app_id` path
|
|
210
210
|
* parameter. Applications select from policies pre-declared by the gateway.
|
|
@@ -246,7 +246,7 @@ export { AIGatewayConfigurationExecutorInboundPolicy as AIGatewayConfigurationEx
|
|
|
246
246
|
*/
|
|
247
247
|
declare interface AIGatewayConfigurationExecutorInboundPolicyOptions {
|
|
248
248
|
/**
|
|
249
|
-
* The time in seconds to cache app configurations loaded by app_id. Defaults to 10 seconds when omitted. Higher values decrease latency; lower values pick up portal changes sooner. Cached results remain valid until the cache expires even if the configuration changes in the portal. This cache is only used when neither ai-gateway-auth-
|
|
249
|
+
* The time in seconds to cache app configurations loaded by app_id. Defaults to 10 seconds when omitted. Higher values decrease latency; lower values pick up portal changes sooner. Cached results remain valid until the cache expires even if the configuration changes in the portal. This cache is only used when neither ai-gateway-auth-inbound nor ai-gateway-configuration-loader-inbound already loaded the configuration for the request.
|
|
250
250
|
*/
|
|
251
251
|
cacheTtlSeconds?: number;
|
|
252
252
|
}
|
|
@@ -258,8 +258,8 @@ export { AIGatewayConfigurationExecutorInboundPolicyOptions as AIGatewayConfigur
|
|
|
258
258
|
* request-scoped channel and does nothing else.
|
|
259
259
|
*
|
|
260
260
|
* Place this policy on AI Gateway routes before
|
|
261
|
-
* `ai-gateway-configuration-executor-
|
|
262
|
-
* loading separated from chain execution. When `ai-gateway-auth-
|
|
261
|
+
* `ai-gateway-configuration-executor-inbound` when you want configuration
|
|
262
|
+
* loading separated from chain execution. When `ai-gateway-auth-inbound`
|
|
263
263
|
* already populated the channel, this policy reuses it. Otherwise it loads
|
|
264
264
|
* the configuration with the route's `app_id` path parameter.
|
|
265
265
|
*
|
|
@@ -291,7 +291,7 @@ export { AIGatewayConfigurationLoaderInboundPolicy as AIGatewayConfigurationLoad
|
|
|
291
291
|
*/
|
|
292
292
|
declare interface AIGatewayConfigurationLoaderInboundPolicyOptions {
|
|
293
293
|
/**
|
|
294
|
-
* The time in seconds to cache app configurations loaded by app_id. Defaults to 10 seconds when omitted. Higher values decrease latency; lower values pick up portal changes sooner. Cached results remain valid until the cache expires even if the configuration changes in the portal. When ai-gateway-auth-
|
|
294
|
+
* The time in seconds to cache app configurations loaded by app_id. Defaults to 10 seconds when omitted. Higher values decrease latency; lower values pick up portal changes sooner. Cached results remain valid until the cache expires even if the configuration changes in the portal. When ai-gateway-auth-inbound already loaded the configuration for the request, this cache is not used.
|
|
295
295
|
*/
|
|
296
296
|
cacheTtlSeconds?: number;
|
|
297
297
|
}
|