@zuplo/runtime 7.7.14 → 7.7.16
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-2JN5KYSY.js → chunk-B5DKYXCI.js} +2 -2
- package/out/esm/{chunk-JTYJUJYO.js → chunk-GCOWKKQW.js} +2 -2
- package/out/esm/{chunk-A7PEKB6K.js → chunk-HWNKBEMX.js} +4 -4
- package/out/esm/{chunk-A7PEKB6K.js.map → chunk-HWNKBEMX.js.map} +1 -1
- package/out/esm/chunk-SIIXGJ76.js +410 -0
- package/out/esm/chunk-SIIXGJ76.js.map +1 -0
- package/out/esm/index.js +1 -1
- package/out/esm/internal/index.js +1 -1
- package/out/esm/mcp-gateway/index.js +1 -1
- package/out/esm/mocks/index.js +1 -1
- package/out/esm/sdks/aws/index.js +1 -1
- package/out/types/index.d.ts +27 -2
- package/package.json +1 -1
- package/out/esm/chunk-VUNRXOEM.js +0 -410
- package/out/esm/chunk-VUNRXOEM.js.map +0 -1
- /package/out/esm/{chunk-2JN5KYSY.js.map → chunk-B5DKYXCI.js.map} +0 -0
- /package/out/esm/{chunk-JTYJUJYO.js.map → chunk-GCOWKKQW.js.map} +0 -0
- /package/out/esm/{chunk-A7PEKB6K.js.LEGAL.txt → chunk-HWNKBEMX.js.LEGAL.txt} +0 -0
- /package/out/esm/{chunk-VUNRXOEM.js.LEGAL.txt → chunk-SIIXGJ76.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-SIIXGJ76.js";import"../chunk-B5DKYXCI.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-GCOWKKQW.js";import{$ as i}from"../chunk-HWNKBEMX.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
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-
|
|
25
|
+
import{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-GCOWKKQW.js";import"../../chunk-HWNKBEMX.js";import{a as i}from"../../chunk-TYV53J3B.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
|
package/out/types/index.d.ts
CHANGED
|
@@ -286,7 +286,6 @@ export declare class AIGatewayConfigurationExecutorV2InboundPolicy extends Inbou
|
|
|
286
286
|
private blockOnViolation;
|
|
287
287
|
private emitHierarchyWarning;
|
|
288
288
|
private getConsumerSub;
|
|
289
|
-
private requestCapability;
|
|
290
289
|
private createQuotaExceededResponse;
|
|
291
290
|
}
|
|
292
291
|
|
|
@@ -664,7 +663,6 @@ export declare class AIGatewayMeteringV2InboundPolicy extends InboundPolicy<AIGa
|
|
|
664
663
|
private checkWarnings;
|
|
665
664
|
private hasWarning;
|
|
666
665
|
private findViolation;
|
|
667
|
-
private requestCapability;
|
|
668
666
|
private createQuotaExceededResponse;
|
|
669
667
|
}
|
|
670
668
|
|
|
@@ -3063,6 +3061,14 @@ export declare class BackgroundDispatchError extends Error {
|
|
|
3063
3061
|
|
|
3064
3062
|
/**
|
|
3065
3063
|
* A utility for loading and caching data in the background with automatic refresh
|
|
3064
|
+
*
|
|
3065
|
+
* When a cache entry expires and the loader then fails — it rejects, or it
|
|
3066
|
+
* exceeds `loaderTimeoutSeconds` — {@link BackgroundLoader.get} falls back to
|
|
3067
|
+
* the last value it successfully loaded rather than throwing, for up to
|
|
3068
|
+
* `staleIfErrorSeconds` past expiry. A loader whose upstream is briefly
|
|
3069
|
+
* unavailable therefore keeps serving the previous value instead of failing
|
|
3070
|
+
* every caller. The error is surfaced when there is no previously loaded value
|
|
3071
|
+
* to fall back to, or when that value is older than `staleIfErrorSeconds`.
|
|
3066
3072
|
* @public
|
|
3067
3073
|
*/
|
|
3068
3074
|
export declare class BackgroundLoader<T = unknown> {
|
|
@@ -3093,6 +3099,25 @@ export declare interface BackgroundLoaderFunction<T> {
|
|
|
3093
3099
|
declare interface BackgroundLoaderOptions {
|
|
3094
3100
|
ttlSeconds: number;
|
|
3095
3101
|
loaderTimeoutSeconds?: number;
|
|
3102
|
+
/**
|
|
3103
|
+
* How long past `ttlSeconds` the last successfully loaded value may still be
|
|
3104
|
+
* served while refreshes keep failing, so that a brief upstream outage does
|
|
3105
|
+
* not fail every caller.
|
|
3106
|
+
*
|
|
3107
|
+
* Set to `0` to always surface the error instead of serving an expired
|
|
3108
|
+
* value. Defaults to unbounded — an expired value is served for as long as
|
|
3109
|
+
* refreshes keep failing.
|
|
3110
|
+
*
|
|
3111
|
+
* @example
|
|
3112
|
+
* ```ts
|
|
3113
|
+
* // Serve the last known-good value for up to 5 minutes past expiry
|
|
3114
|
+
* const loader = new BackgroundLoader(fetchConfig, {
|
|
3115
|
+
* ttlSeconds: 60,
|
|
3116
|
+
* staleIfErrorSeconds: 300,
|
|
3117
|
+
* });
|
|
3118
|
+
* ```
|
|
3119
|
+
*/
|
|
3120
|
+
staleIfErrorSeconds?: number;
|
|
3096
3121
|
}
|
|
3097
3122
|
|
|
3098
3123
|
/**
|