@zuplo/runtime 6.70.24 → 6.70.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-RQLHORT4.js → chunk-BOEEWEWW.js} +3 -3
- package/out/esm/{chunk-RQLHORT4.js.map → chunk-BOEEWEWW.js.map} +1 -1
- package/out/esm/index.js +1 -1
- package/out/esm/mcp-gateway/index.js +1 -1
- package/out/types/index.d.ts +11 -3
- package/package.json +1 -1
- /package/out/esm/{chunk-RQLHORT4.js.LEGAL.txt → chunk-BOEEWEWW.js.LEGAL.txt} +0 -0
package/out/esm/index.js
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{$a as Gt,$b as Nr,A as G,Aa as dt,Ab as dr,B as I,Ba as ut,Bb as ur,C as J,Ca as ft,Cb as fr,D as K,Da as xt,Db as xr,E as M,Ea as yt,Eb as yr,F as N,Fa as wt,Fb as wr,G as O,Ga as At,Gb as Ar,Ha as bt,Hb as br,Ia as lt,Ib as lr,Ja as jt,Jb as jr,Ka as Bt,Kb as Br,La as Ct,Lb as Cr,Ma as Dt,Mb as Dr,Na as Et,Nb as Er,Oa as Ht,Ob as $r,Pa as Pt,Pb as kr,Qa as St,Qb as Fr,Ra as Tt,Rb as Lr,Sa as Ut,Sb as Rr,Ta as $t,Tb as qr,Ua as kt,Ub as vr,Va as Ft,Vb as zr,Wa as Lt,Wb as Gr,Xa as Rt,Xb as Ir,Ya as qt,Yb as Jr,Za as vt,Zb as Kr,_a as zt,_b as Mr,a as n,ab as It,ac as Or,bb as Jt,bc as Qr,c as x,cb as Kt,cc as Vr,d as y,db as Mt,dc as Wr,e as w,eb as Nt,ec as Xr,f as A,fb as Ot,fc as Yr,g as b,ga as Q,gb as Qt,gc as Zr,h as l,ha as V,hb as Vt,hc as _r,i as j,ia as W,ib as Wt,ic as ts,j as B,ja as X,jb as Xt,jc as rs,ka as Y,kb as Yt,kc as ss,l as C,la as Z,lb as Zt,lc as es,m as D,ma as _,mb as _t,mc as os,n as E,na as tt,nb as tr,o as H,oa as rt,ob as rr,p as P,pa as st,pb as sr,qa as et,qb as er,r as T,ra as ot,rb as or,s as U,sa as at,sb as ar,t as $,ta as nt,tb as nr,u as k,ua as it,ub as ir,v as F,va as pt,vb as pr,w as L,wa as ct,wb as cr,x as R,xa as ht,xb as hr,y as q,ya as mt,yb as mr,z as v,za as gt,zb as gr}from"./chunk-
|
|
25
|
+
import{$a as Gt,$b as Nr,A as G,Aa as dt,Ab as dr,B as I,Ba as ut,Bb as ur,C as J,Ca as ft,Cb as fr,D as K,Da as xt,Db as xr,E as M,Ea as yt,Eb as yr,F as N,Fa as wt,Fb as wr,G as O,Ga as At,Gb as Ar,Ha as bt,Hb as br,Ia as lt,Ib as lr,Ja as jt,Jb as jr,Ka as Bt,Kb as Br,La as Ct,Lb as Cr,Ma as Dt,Mb as Dr,Na as Et,Nb as Er,Oa as Ht,Ob as $r,Pa as Pt,Pb as kr,Qa as St,Qb as Fr,Ra as Tt,Rb as Lr,Sa as Ut,Sb as Rr,Ta as $t,Tb as qr,Ua as kt,Ub as vr,Va as Ft,Vb as zr,Wa as Lt,Wb as Gr,Xa as Rt,Xb as Ir,Ya as qt,Yb as Jr,Za as vt,Zb as Kr,_a as zt,_b as Mr,a as n,ab as It,ac as Or,bb as Jt,bc as Qr,c as x,cb as Kt,cc as Vr,d as y,db as Mt,dc as Wr,e as w,eb as Nt,ec as Xr,f as A,fb as Ot,fc as Yr,g as b,ga as Q,gb as Qt,gc as Zr,h as l,ha as V,hb as Vt,hc as _r,i as j,ia as W,ib as Wt,ic as ts,j as B,ja as X,jb as Xt,jc as rs,ka as Y,kb as Yt,kc as ss,l as C,la as Z,lb as Zt,lc as es,m as D,ma as _,mb as _t,mc as os,n as E,na as tt,nb as tr,o as H,oa as rt,ob as rr,p as P,pa as st,pb as sr,qa as et,qb as er,r as T,ra as ot,rb as or,s as U,sa as at,sb as ar,t as $,ta as nt,tb as nr,u as k,ua as it,ub as ir,v as F,va as pt,vb as pr,w as L,wa as ct,wb as cr,x as R,xa as ht,xb as hr,y as q,ya as mt,yb as mr,z as v,za as gt,zb as gr}from"./chunk-BOEEWEWW.js";import{a as S,d as z,e as Hr,f as Pr,g as Sr,h as Tr,i as Ur}from"./chunk-GDWI24KD.js";import"./chunk-NW4YQXGC.js";import{V as u,X as a,Y as f,a as t}from"./chunk-JAEQKE5H.js";var e=["sha-1","sha-256","sha-384","sha-512"],r=class{static{t(this,"BaseCryptoBeta")}};var o=class extends r{static{t(this,"WorkerCryptoBeta")}async digest(s,p){if(n("runtime.crypto-beta"),!e.includes(s.toLowerCase()))throw new a(`Algorithm ${s} is not supported. Try using ${e.join(", ")}`);let c=new TextEncoder().encode(p),h=await crypto.subtle.digest(s,c);return Array.from(new Uint8Array(h)).map(m=>m.toString(16).padStart(2,"0")).join("")}};export{Dt as AIGatewayAnthropicToOpenAIInboundPolicy,Et as AIGatewayAuthInboundPolicy,I as AIGatewayMeteringInboundPolicy,Ht as AIGatewayOpenAIToAnthropicOutboundPolicy,Pt as AIGatewaySemanticCacheInboundPolicy,St as AIGatewaySemanticCacheOutboundPolicy,Tt as AIGatewayUsageTrackerPolicy,rt as AWSLoggingPlugin,Ut as AkamaiAIFirewallInboundPolicy,wt as AkamaiApiSecurityPlugin,$t as AkamaiFirewallForAiInboundPolicy,kt as AkamaiFirewallForAiOutboundPolicy,Lt as AmberfloMeteringInboundPolicy,Ft as AmberfloMeteringPolicy,qt as ApiAuthKeyInboundPolicy,es as ApiKeyConsumerClient,Rt as ApiKeyInboundPolicy,dt as AuditLogDataStaxProvider,ut as AuditLogPlugin,zt as Auth0JwtInboundPolicy,Gt as AuthZenInboundPolicy,K as AwsLambdaHandlerExtensions,It as AxiomaticsAuthZInboundPolicy,bt as AzureBlobPlugin,lt as AzureEventHubsRequestLoggerPlugin,At as BackgroundDispatcher,os as BackgroundLoader,Jt as BasicAuthInboundPolicy,br as BasicRateLimitInboundPolicy,P as BatchDispatch,Kt as BrownoutInboundPolicy,Mt as CachingInboundPolicy,Nt as ChangeMethodInboundPolicy,Ot as ClearHeadersInboundPolicy,Qt as ClearHeadersOutboundPolicy,Vt as ClerkJwtInboundPolicy,Wt as CognitoJwtInboundPolicy,Xt as CometOpikTracingInboundPolicy,Yt as ComplexRateLimitInboundPolicy,Zt as CompositeInboundPolicy,_t as CompositeOutboundPolicy,f as ConfigurationError,E as ContentTypes,v as ContextData,o as CryptoBeta,tr as CurityPhantomTokenInboundPolicy,F as DataDogLoggingPlugin,ct as DataDogMetricsPlugin,st as DynaTraceLoggingPlugin,ht as DynatraceMetricsPlugin,rr as FirebaseJwtInboundPolicy,sr as FormDataToJsonInboundPolicy,er as GalileoTracingInboundPolicy,or as GeoFilterInboundPolicy,k as GoogleCloudLoggingPlugin,G as Handler,ar as HttpDeprecationOutboundPolicy,B as HttpProblems,b as HttpStatusCode,Bt as HydrolixRequestLoggerPlugin,U as InboundPolicy,nr as JWTScopeValidationInboundPolicy,ft as JwtServicePlugin,et as LokiLoggingPlugin,L as LookupResult,mr as MTLSAuthInboundPolicy,xt as McpGatewayOAuthProtectedResourcePlugin,w as MemoryZoneReadThroughCache,ir as MockApiInboundPolicy,cr as MoesifInboundPolicy,hr as MonetizationInboundPolicy,ot as NewRelicLoggingPlugin,mt as NewRelicMetricsPlugin,yt as OAuthProtectedResourcePlugin,gt as OTelMetricsPlugin,gr as OktaFGAAuthZInboundPolicy,dr as OktaJwtInboundPolicy,ur as OpenFGAAuthZInboundPolicy,vt as OpenIdJwtInboundPolicy,fr as OpenMeterInboundPolicy,$ as OutboundPolicy,j as ProblemResponseFormatter,xr as PromptInjectionDetectionOutboundPolicy,yr as PropelAuthJwtInboundPolicy,wr as QueryParamToHeaderInboundPolicy,Ar as QuotaInboundPolicy,br as RateLimitInboundPolicy,lr as ReadmeMetricsInboundPolicy,jr as RemoveHeadersInboundPolicy,Br as RemoveHeadersOutboundPolicy,Cr as RemoveQueryParamsInboundPolicy,Dr as ReplaceStringOutboundPolicy,Ct as RequestLoggerPlugin,Er as RequestSizeLimitInboundPolicy,$r as RequestValidationInboundPolicy,Fr as RequireOriginInboundPolicy,R as ResponseSendingEvent,q as ResponseSentEvent,a as RuntimeError,u as SYSTEM_LOGGER,kr as SchemaBasedRequestValidation,Lr as SecretMaskingOutboundPolicy,T as SemanticAttributes,Rr as SemanticCacheInboundPolicy,ss as ServiceProviderImpl,qr as SetBodyInboundPolicy,vr as SetHeadersInboundPolicy,zr as SetHeadersOutboundPolicy,Gr as SetQueryParamsInboundPolicy,Ir as SetStatusOutboundPolicy,Jr as SleepInboundPolicy,at as SplunkLoggingPlugin,A as StreamingZoneCache,Kr as StripeWebhookVerificationInboundPolicy,nt as SumoLogicLoggingPlugin,Mr as SupabaseJwtInboundPolicy,S as SystemRouteName,C as TelemetryPlugin,Nr as UpstreamAzureAdServiceAuthInboundPolicy,Or as UpstreamFirebaseAdminAuthInboundPolicy,Qr as UpstreamFirebaseUserAuthInboundPolicy,Wr as UpstreamGcpFederatedAuthInboundPolicy,Xr as UpstreamGcpJwtInboundPolicy,Yr as UpstreamGcpServiceAuthInboundPolicy,Zr as UpstreamZuploJwtAuthInboundPolicy,it as VMWareLogInsightLoggingPlugin,_r as ValidateJsonSchemaInbound,ts as WebBotAuthInboundPolicy,rs as XmlToJsonOutboundPolicy,y as ZoneCache,pt as ZuploMcpSdk,D as ZuploRequest,Vr as ZuploServices,J as aiGatewayHandler,x as apiServices,M as awsLambdaHandler,jt as defaultGenerateHydrolixEntry,z as environment,Pr as getIdForParameterSchema,Tr as getIdForRefSchema,Sr as getIdForRequestBodySchema,Hr as getRawOperationDataIdentifierName,l as httpStatuses,N as legacyDevPortalHandler,Q as mcpServerHandler,V as openApiSpecHandler,W as redirectHandler,O as redirectLegacyDevPortal,Ur as sanitizedIdentifierName,H as serialize,pr as setMoesifContext,n as trackFeature,Y as urlForwardHandler,Z as urlRewriteHandler,_ as webSocketHandler,tt as webSocketPipelineHandler,X as zuploServiceProxy};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{$ as ge,H as Dp,I as rc,J as wv,K as jp,L as f,M as Hp,N as ee,O as ae,P as Lp,Q as Bp,R as we,S as C,T as I,U as Ce,V as me,W as nc,X as oc,Y as ce,Z as nt,_ as O,a as ir,aa as Gp,b as qp,ba as ac,ca as Vp,da as Fp,ea as u,fa as ue,j as po,k as Np,q as ec,z as Dt}from"../chunk-RQLHORT4.js";import{d as tc}from"../chunk-GDWI24KD.js";import{a as K}from"../chunk-NW4YQXGC.js";import{X as ln,Y as Or,Z as lo,a as o,c as x,e as Mp}from"../chunk-JAEQKE5H.js";var Po=x(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.regexpCode=te.getEsmExportName=te.getProperty=te.safeStringify=te.stringify=te.strConcat=te.addCodeArg=te.str=te._=te.nil=te._Code=te.Name=te.IDENTIFIER=te._CodeOrName=void 0;var Co=class{static{o(this,"_CodeOrName")}};te._CodeOrName=Co;te.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Mr=class extends Co{static{o(this,"Name")}constructor(t){if(super(),!te.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};te.Name=Mr;var ut=class extends Co{static{o(this,"_Code")}constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Mr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};te._Code=ut;te.nil=new ut("");function dm(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Dc(r,t[n]),r.push(e[++n]);return new ut(r)}o(dm,"_");te._=dm;var Nc=new ut("+");function lm(e,...t){let r=[Io(e[0])],n=0;for(;n<t.length;)r.push(Nc),Dc(r,t[n]),r.push(Nc,Io(e[++n]));return Vb(r),new ut(r)}o(lm,"str");te.str=lm;function Dc(e,t){t instanceof ut?e.push(...t._items):t instanceof Mr?e.push(t):e.push(Kb(t))}o(Dc,"addCodeArg");te.addCodeArg=Dc;function Vb(e){let t=1;for(;t<e.length-1;){if(e[t]===Nc){let r=Fb(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(Vb,"optimize");function Fb(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Mr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Mr))return`"${e}${t.slice(1)}`}o(Fb,"mergeExprItems");function Zb(e,t){return t.emptyStr()?e:e.emptyStr()?t:lm`${e}${t}`}o(Zb,"strConcat");te.strConcat=Zb;function Kb(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Io(Array.isArray(e)?e.join(","):e)}o(Kb,"interpolate");function Wb(e){return new ut(Io(e))}o(Wb,"stringify");te.stringify=Wb;function Io(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Io,"safeStringify");te.safeStringify=Io;function Jb(e){return typeof e=="string"&&te.IDENTIFIER.test(e)?new ut(`.${e}`):dm`[${e}]`}o(Jb,"getProperty");te.getProperty=Jb;function Yb(e){if(typeof e=="string"&&te.IDENTIFIER.test(e))return new ut(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}o(Yb,"getEsmExportName");te.getEsmExportName=Yb;function Qb(e){return new ut(e.toString())}o(Qb,"regexpCode");te.regexpCode=Qb});var Lc=x(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.ValueScope=We.ValueScopeName=We.Scope=We.varKinds=We.UsedValueState=void 0;var Ke=Po(),jc=class extends Error{static{o(this,"ValueError")}constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Xa;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Xa||(We.UsedValueState=Xa={}));We.varKinds={const:new Ke.Name("const"),let:new Ke.Name("let"),var:new Ke.Name("var")};var ei=class{static{o(this,"Scope")}constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ke.Name?t:this.name(t)}name(t){return new Ke.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};We.Scope=ei;var ti=class extends Ke.Name{static{o(this,"ValueScopeName")}constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ke._)`.${new Ke.Name(r)}[${n}]`}};We.ValueScopeName=ti;var Xb=(0,Ke._)`\n`,Hc=class extends ei{static{o(this,"ValueScope")}constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Xb:Ke.nil}}get(){return this._scope}name(t){return new ti(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(t),{prefix:i}=a,s=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[i];if(c){let l=c.get(s);if(l)return l}else c=this._values[i]=new Map;c.set(s,a);let d=this._scope[i]||(this._scope[i]=[]),p=d.length;return d[p]=r.ref,a.setValue(r,{property:i,itemIndex:p}),a}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ke._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,n)}_reduceValues(t,r,n={},a){let i=Ke.nil;for(let s in t){let c=t[s];if(!c)continue;let d=n[s]=n[s]||new Map;c.forEach(p=>{if(d.has(p))return;d.set(p,Xa.Started);let l=r(p);if(l){let m=this.opts.es5?We.varKinds.var:We.varKinds.const;i=(0,Ke._)`${i}${m} ${p} = ${l};${this.opts._n}`}else if(l=a?.(p))i=(0,Ke._)`${i}${l}${this.opts._n}`;else throw new jc(p);d.set(p,Xa.Completed)})}return i}};We.ValueScope=Hc});var F=x(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.or=Z.and=Z.not=Z.CodeGen=Z.operators=Z.varKinds=Z.ValueScopeName=Z.ValueScope=Z.Scope=Z.Name=Z.regexpCode=Z.stringify=Z.getProperty=Z.nil=Z.strConcat=Z.str=Z._=void 0;var Y=Po(),_t=Lc(),hr=Po();Object.defineProperty(Z,"_",{enumerable:!0,get:o(function(){return hr._},"get")});Object.defineProperty(Z,"str",{enumerable:!0,get:o(function(){return hr.str},"get")});Object.defineProperty(Z,"strConcat",{enumerable:!0,get:o(function(){return hr.strConcat},"get")});Object.defineProperty(Z,"nil",{enumerable:!0,get:o(function(){return hr.nil},"get")});Object.defineProperty(Z,"getProperty",{enumerable:!0,get:o(function(){return hr.getProperty},"get")});Object.defineProperty(Z,"stringify",{enumerable:!0,get:o(function(){return hr.stringify},"get")});Object.defineProperty(Z,"regexpCode",{enumerable:!0,get:o(function(){return hr.regexpCode},"get")});Object.defineProperty(Z,"Name",{enumerable:!0,get:o(function(){return hr.Name},"get")});var ai=Lc();Object.defineProperty(Z,"Scope",{enumerable:!0,get:o(function(){return ai.Scope},"get")});Object.defineProperty(Z,"ValueScope",{enumerable:!0,get:o(function(){return ai.ValueScope},"get")});Object.defineProperty(Z,"ValueScopeName",{enumerable:!0,get:o(function(){return ai.ValueScopeName},"get")});Object.defineProperty(Z,"varKinds",{enumerable:!0,get:o(function(){return ai.varKinds},"get")});Z.operators={GT:new Y._Code(">"),GTE:new Y._Code(">="),LT:new Y._Code("<"),LTE:new Y._Code("<="),EQ:new Y._Code("==="),NEQ:new Y._Code("!=="),NOT:new Y._Code("!"),OR:new Y._Code("||"),AND:new Y._Code("&&"),ADD:new Y._Code("+")};var Bt=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(t,r){return this}},Bc=class extends Bt{static{o(this,"Def")}constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?_t.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=_n(this.rhs,t,r)),this}get names(){return this.rhs instanceof Y._CodeOrName?this.rhs.names:{}}},ri=class extends Bt{static{o(this,"Assign")}constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof Y.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=_n(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Y.Name?{}:{...this.lhs.names};return oi(t,this.rhs)}},Gc=class extends ri{static{o(this,"AssignOp")}constructor(t,r,n,a){super(t,n,a),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Vc=class extends Bt{static{o(this,"Label")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Fc=class extends Bt{static{o(this,"Break")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Zc=class extends Bt{static{o(this,"Throw")}constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Kc=class extends Bt{static{o(this,"AnyCode")}constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=_n(this.code,t,r),this}get names(){return this.code instanceof Y._CodeOrName?this.code.names:{}}},xo=class extends Bt{static{o(this,"ParentNode")}constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,a=n.length;for(;a--;){let i=n[a];i.optimizeNames(t,r)||(eR(t,i.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Dr(t,r.names),{})}},Gt=class extends xo{static{o(this,"BlockNode")}render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Wc=class extends xo{static{o(this,"Root")}},Sn=class extends Gt{static{o(this,"Else")}};Sn.kind="else";var qr=class e extends Gt{static{o(this,"If")}constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Sn(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(pm(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=_n(this.condition,t,r),this}get names(){let t=super.names;return oi(t,this.condition),this.else&&Dr(t,this.else.names),t}};qr.kind="if";var Nr=class extends Gt{static{o(this,"For")}};Nr.kind="for";var Jc=class extends Nr{static{o(this,"ForLoop")}constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=_n(this.iteration,t,r),this}get names(){return Dr(super.names,this.iteration.names)}},Yc=class extends Nr{static{o(this,"ForRange")}constructor(t,r,n,a){super(),this.varKind=t,this.name=r,this.from=n,this.to=a}render(t){let r=t.es5?_t.varKinds.var:this.varKind,{name:n,from:a,to:i}=this;return`for(${r} ${n}=${a}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=oi(super.names,this.from);return oi(t,this.to)}},ni=class extends Nr{static{o(this,"ForIter")}constructor(t,r,n,a){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=a}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=_n(this.iterable,t,r),this}get names(){return Dr(super.names,this.iterable.names)}},Ao=class extends Gt{static{o(this,"Func")}constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Ao.kind="func";var ko=class extends xo{static{o(this,"Return")}render(t){return"return "+super.render(t)}};ko.kind="return";var Qc=class extends Gt{static{o(this,"Try")}render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,a;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(a=this.finally)===null||a===void 0||a.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Dr(t,this.catch.names),this.finally&&Dr(t,this.finally.names),t}},To=class extends Gt{static{o(this,"Catch")}constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};To.kind="catch";var Eo=class extends Gt{static{o(this,"Finally")}render(t){return"finally"+super.render(t)}};Eo.kind="finally";var Xc=class{static{o(this,"CodeGen")}constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
25
|
+
import{$ as ge,H as Dp,I as rc,J as wv,K as jp,L as f,M as Hp,N as ee,O as ae,P as Lp,Q as Bp,R as we,S as C,T as I,U as Ce,V as me,W as nc,X as oc,Y as ce,Z as nt,_ as O,a as ir,aa as Gp,b as qp,ba as ac,ca as Vp,da as Fp,ea as u,fa as ue,j as po,k as Np,q as ec,z as Dt}from"../chunk-BOEEWEWW.js";import{d as tc}from"../chunk-GDWI24KD.js";import{a as K}from"../chunk-NW4YQXGC.js";import{X as ln,Y as Or,Z as lo,a as o,c as x,e as Mp}from"../chunk-JAEQKE5H.js";var Po=x(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.regexpCode=te.getEsmExportName=te.getProperty=te.safeStringify=te.stringify=te.strConcat=te.addCodeArg=te.str=te._=te.nil=te._Code=te.Name=te.IDENTIFIER=te._CodeOrName=void 0;var Co=class{static{o(this,"_CodeOrName")}};te._CodeOrName=Co;te.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Mr=class extends Co{static{o(this,"Name")}constructor(t){if(super(),!te.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};te.Name=Mr;var ut=class extends Co{static{o(this,"_Code")}constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Mr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};te._Code=ut;te.nil=new ut("");function dm(e,...t){let r=[e[0]],n=0;for(;n<t.length;)Dc(r,t[n]),r.push(e[++n]);return new ut(r)}o(dm,"_");te._=dm;var Nc=new ut("+");function lm(e,...t){let r=[Io(e[0])],n=0;for(;n<t.length;)r.push(Nc),Dc(r,t[n]),r.push(Nc,Io(e[++n]));return Vb(r),new ut(r)}o(lm,"str");te.str=lm;function Dc(e,t){t instanceof ut?e.push(...t._items):t instanceof Mr?e.push(t):e.push(Kb(t))}o(Dc,"addCodeArg");te.addCodeArg=Dc;function Vb(e){let t=1;for(;t<e.length-1;){if(e[t]===Nc){let r=Fb(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}o(Vb,"optimize");function Fb(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Mr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Mr))return`"${e}${t.slice(1)}`}o(Fb,"mergeExprItems");function Zb(e,t){return t.emptyStr()?e:e.emptyStr()?t:lm`${e}${t}`}o(Zb,"strConcat");te.strConcat=Zb;function Kb(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Io(Array.isArray(e)?e.join(","):e)}o(Kb,"interpolate");function Wb(e){return new ut(Io(e))}o(Wb,"stringify");te.stringify=Wb;function Io(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}o(Io,"safeStringify");te.safeStringify=Io;function Jb(e){return typeof e=="string"&&te.IDENTIFIER.test(e)?new ut(`.${e}`):dm`[${e}]`}o(Jb,"getProperty");te.getProperty=Jb;function Yb(e){if(typeof e=="string"&&te.IDENTIFIER.test(e))return new ut(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}o(Yb,"getEsmExportName");te.getEsmExportName=Yb;function Qb(e){return new ut(e.toString())}o(Qb,"regexpCode");te.regexpCode=Qb});var Lc=x(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.ValueScope=We.ValueScopeName=We.Scope=We.varKinds=We.UsedValueState=void 0;var Ke=Po(),jc=class extends Error{static{o(this,"ValueError")}constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Xa;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Xa||(We.UsedValueState=Xa={}));We.varKinds={const:new Ke.Name("const"),let:new Ke.Name("let"),var:new Ke.Name("var")};var ei=class{static{o(this,"Scope")}constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ke.Name?t:this.name(t)}name(t){return new Ke.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};We.Scope=ei;var ti=class extends Ke.Name{static{o(this,"ValueScopeName")}constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ke._)`.${new Ke.Name(r)}[${n}]`}};We.ValueScopeName=ti;var Xb=(0,Ke._)`\n`,Hc=class extends ei{static{o(this,"ValueScope")}constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?Xb:Ke.nil}}get(){return this._scope}name(t){return new ti(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let a=this.toName(t),{prefix:i}=a,s=(n=r.key)!==null&&n!==void 0?n:r.ref,c=this._values[i];if(c){let l=c.get(s);if(l)return l}else c=this._values[i]=new Map;c.set(s,a);let d=this._scope[i]||(this._scope[i]=[]),p=d.length;return d[p]=r.ref,a.setValue(r,{property:i,itemIndex:p}),a}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ke._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,a=>{if(a.value===void 0)throw new Error(`CodeGen: name "${a}" has no value`);return a.value.code},r,n)}_reduceValues(t,r,n={},a){let i=Ke.nil;for(let s in t){let c=t[s];if(!c)continue;let d=n[s]=n[s]||new Map;c.forEach(p=>{if(d.has(p))return;d.set(p,Xa.Started);let l=r(p);if(l){let m=this.opts.es5?We.varKinds.var:We.varKinds.const;i=(0,Ke._)`${i}${m} ${p} = ${l};${this.opts._n}`}else if(l=a?.(p))i=(0,Ke._)`${i}${l}${this.opts._n}`;else throw new jc(p);d.set(p,Xa.Completed)})}return i}};We.ValueScope=Hc});var F=x(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.or=Z.and=Z.not=Z.CodeGen=Z.operators=Z.varKinds=Z.ValueScopeName=Z.ValueScope=Z.Scope=Z.Name=Z.regexpCode=Z.stringify=Z.getProperty=Z.nil=Z.strConcat=Z.str=Z._=void 0;var Y=Po(),_t=Lc(),hr=Po();Object.defineProperty(Z,"_",{enumerable:!0,get:o(function(){return hr._},"get")});Object.defineProperty(Z,"str",{enumerable:!0,get:o(function(){return hr.str},"get")});Object.defineProperty(Z,"strConcat",{enumerable:!0,get:o(function(){return hr.strConcat},"get")});Object.defineProperty(Z,"nil",{enumerable:!0,get:o(function(){return hr.nil},"get")});Object.defineProperty(Z,"getProperty",{enumerable:!0,get:o(function(){return hr.getProperty},"get")});Object.defineProperty(Z,"stringify",{enumerable:!0,get:o(function(){return hr.stringify},"get")});Object.defineProperty(Z,"regexpCode",{enumerable:!0,get:o(function(){return hr.regexpCode},"get")});Object.defineProperty(Z,"Name",{enumerable:!0,get:o(function(){return hr.Name},"get")});var ai=Lc();Object.defineProperty(Z,"Scope",{enumerable:!0,get:o(function(){return ai.Scope},"get")});Object.defineProperty(Z,"ValueScope",{enumerable:!0,get:o(function(){return ai.ValueScope},"get")});Object.defineProperty(Z,"ValueScopeName",{enumerable:!0,get:o(function(){return ai.ValueScopeName},"get")});Object.defineProperty(Z,"varKinds",{enumerable:!0,get:o(function(){return ai.varKinds},"get")});Z.operators={GT:new Y._Code(">"),GTE:new Y._Code(">="),LT:new Y._Code("<"),LTE:new Y._Code("<="),EQ:new Y._Code("==="),NEQ:new Y._Code("!=="),NOT:new Y._Code("!"),OR:new Y._Code("||"),AND:new Y._Code("&&"),ADD:new Y._Code("+")};var Bt=class{static{o(this,"Node")}optimizeNodes(){return this}optimizeNames(t,r){return this}},Bc=class extends Bt{static{o(this,"Def")}constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?_t.varKinds.var:this.varKind,a=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${a};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=_n(this.rhs,t,r)),this}get names(){return this.rhs instanceof Y._CodeOrName?this.rhs.names:{}}},ri=class extends Bt{static{o(this,"Assign")}constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof Y.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=_n(this.rhs,t,r),this}get names(){let t=this.lhs instanceof Y.Name?{}:{...this.lhs.names};return oi(t,this.rhs)}},Gc=class extends ri{static{o(this,"AssignOp")}constructor(t,r,n,a){super(t,n,a),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},Vc=class extends Bt{static{o(this,"Label")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},Fc=class extends Bt{static{o(this,"Break")}constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},Zc=class extends Bt{static{o(this,"Throw")}constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},Kc=class extends Bt{static{o(this,"AnyCode")}constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=_n(this.code,t,r),this}get names(){return this.code instanceof Y._CodeOrName?this.code.names:{}}},xo=class extends Bt{static{o(this,"ParentNode")}constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,a=n.length;for(;a--;){let i=n[a];i.optimizeNames(t,r)||(eR(t,i.names),n.splice(a,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Dr(t,r.names),{})}},Gt=class extends xo{static{o(this,"BlockNode")}render(t){return"{"+t._n+super.render(t)+"}"+t._n}},Wc=class extends xo{static{o(this,"Root")}},Sn=class extends Gt{static{o(this,"Else")}};Sn.kind="else";var qr=class e extends Gt{static{o(this,"If")}constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new Sn(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(pm(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=_n(this.condition,t,r),this}get names(){let t=super.names;return oi(t,this.condition),this.else&&Dr(t,this.else.names),t}};qr.kind="if";var Nr=class extends Gt{static{o(this,"For")}};Nr.kind="for";var Jc=class extends Nr{static{o(this,"ForLoop")}constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=_n(this.iteration,t,r),this}get names(){return Dr(super.names,this.iteration.names)}},Yc=class extends Nr{static{o(this,"ForRange")}constructor(t,r,n,a){super(),this.varKind=t,this.name=r,this.from=n,this.to=a}render(t){let r=t.es5?_t.varKinds.var:this.varKind,{name:n,from:a,to:i}=this;return`for(${r} ${n}=${a}; ${n}<${i}; ${n}++)`+super.render(t)}get names(){let t=oi(super.names,this.from);return oi(t,this.to)}},ni=class extends Nr{static{o(this,"ForIter")}constructor(t,r,n,a){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=a}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=_n(this.iterable,t,r),this}get names(){return Dr(super.names,this.iterable.names)}},Ao=class extends Gt{static{o(this,"Func")}constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};Ao.kind="func";var ko=class extends xo{static{o(this,"Return")}render(t){return"return "+super.render(t)}};ko.kind="return";var Qc=class extends Gt{static{o(this,"Try")}render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,a;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(a=this.finally)===null||a===void 0||a.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Dr(t,this.catch.names),this.finally&&Dr(t,this.finally.names),t}},To=class extends Gt{static{o(this,"Catch")}constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};To.kind="catch";var Eo=class extends Gt{static{o(this,"Finally")}render(t){return"finally"+super.render(t)}};Eo.kind="finally";var Xc=class{static{o(this,"CodeGen")}constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
26
26
|
`:""},this._extScope=t,this._scope=new _t.Scope({parent:t}),this._nodes=[new Wc]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,a){let i=this._scope.toName(r);return n!==void 0&&a&&(this._constants[i.str]=n),this._leafNode(new Bc(t,i,n)),i}const(t,r,n){return this._def(_t.varKinds.const,t,r,n)}let(t,r,n){return this._def(_t.varKinds.let,t,r,n)}var(t,r,n){return this._def(_t.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new ri(t,r,n))}add(t,r){return this._leafNode(new Gc(t,Z.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==Y.nil&&this._leafNode(new Kc(t)),this}object(...t){let r=["{"];for(let[n,a]of t)r.length>1&&r.push(","),r.push(n),(n!==a||this.opts.es5)&&(r.push(":"),(0,Y.addCodeArg)(r,a));return r.push("}"),new Y._Code(r)}if(t,r,n){if(this._blockNode(new qr(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new qr(t))}else(){return this._elseNode(new Sn)}endIf(){return this._endBlockNode(qr,Sn)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Jc(t),r)}forRange(t,r,n,a,i=this.opts.es5?_t.varKinds.var:_t.varKinds.let){let s=this._scope.toName(t);return this._for(new Yc(i,s,r,n),()=>a(s))}forOf(t,r,n,a=_t.varKinds.const){let i=this._scope.toName(t);if(this.opts.es5){let s=r instanceof Y.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Y._)`${s}.length`,c=>{this.var(i,(0,Y._)`${s}[${c}]`),n(i)})}return this._for(new ni("of",a,i,r),()=>n(i))}forIn(t,r,n,a=this.opts.es5?_t.varKinds.var:_t.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,Y._)`Object.keys(${r})`,n);let i=this._scope.toName(t);return this._for(new ni("in",a,i,r),()=>n(i))}endFor(){return this._endBlockNode(Nr)}label(t){return this._leafNode(new Vc(t))}break(t){return this._leafNode(new Fc(t))}return(t){let r=new ko;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ko)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let a=new Qc;if(this._blockNode(a),this.code(t),r){let i=this.name("e");this._currNode=a.catch=new To(i),r(i)}return n&&(this._currNode=a.finally=new Eo,this.code(n)),this._endBlockNode(To,Eo)}throw(t){return this._leafNode(new Zc(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=Y.nil,n,a){return this._blockNode(new Ao(t,r,n)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(Ao)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof qr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};Z.CodeGen=Xc;function Dr(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}o(Dr,"addNames");function oi(e,t){return t instanceof Y._CodeOrName?Dr(e,t.names):e}o(oi,"addExprNames");function _n(e,t,r){if(e instanceof Y.Name)return n(e);if(!a(e))return e;return new Y._Code(e._items.reduce((i,s)=>(s instanceof Y.Name&&(s=n(s)),s instanceof Y._Code?i.push(...s._items):i.push(s),i),[]));function n(i){let s=r[i.str];return s===void 0||t[i.str]!==1?i:(delete t[i.str],s)}function a(i){return i instanceof Y._Code&&i._items.some(s=>s instanceof Y.Name&&t[s.str]===1&&r[s.str]!==void 0)}}o(_n,"optimizeExpr");function eR(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}o(eR,"subtractNames");function pm(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Y._)`!${eu(e)}`}o(pm,"not");Z.not=pm;var tR=mm(Z.operators.AND);function rR(...e){return e.reduce(tR)}o(rR,"and");Z.and=rR;var nR=mm(Z.operators.OR);function oR(...e){return e.reduce(nR)}o(oR,"or");Z.or=oR;function mm(e){return(t,r)=>t===Y.nil?r:r===Y.nil?t:(0,Y._)`${eu(t)} ${e} ${eu(r)}`}o(mm,"mappend");function eu(e){return e instanceof Y.Name?e:(0,Y._)`(${e})`}o(eu,"par")});var re=x(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.checkStrictMode=W.getErrorPath=W.Type=W.useFunc=W.setEvaluated=W.evaluatedPropsToName=W.mergeEvaluated=W.eachItem=W.unescapeJsonPointer=W.escapeJsonPointer=W.escapeFragment=W.unescapeFragment=W.schemaRefOrVal=W.schemaHasRulesButRef=W.schemaHasRules=W.checkUnknownRules=W.alwaysValidSchema=W.toHash=void 0;var ie=F(),aR=Po();function iR(e){let t={};for(let r of e)t[r]=!0;return t}o(iR,"toHash");W.toHash=iR;function sR(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(gm(e,t),!ym(t,e.self.RULES.all))}o(sR,"alwaysValidSchema");W.alwaysValidSchema=sR;function gm(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let a=n.RULES.keywords;for(let i in t)a[i]||wm(e,`unknown keyword: "${i}"`)}o(gm,"checkUnknownRules");W.checkUnknownRules=gm;function ym(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}o(ym,"schemaHasRules");W.schemaHasRules=ym;function cR(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}o(cR,"schemaHasRulesButRef");W.schemaHasRulesButRef=cR;function uR({topSchemaRef:e,schemaPath:t},r,n,a){if(!a){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ie._)`${r}`}return(0,ie._)`${e}${t}${(0,ie.getProperty)(n)}`}o(uR,"schemaRefOrVal");W.schemaRefOrVal=uR;function dR(e){return Sm(decodeURIComponent(e))}o(dR,"unescapeFragment");W.unescapeFragment=dR;function lR(e){return encodeURIComponent(ru(e))}o(lR,"escapeFragment");W.escapeFragment=lR;function ru(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}o(ru,"escapeJsonPointer");W.escapeJsonPointer=ru;function Sm(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}o(Sm,"unescapeJsonPointer");W.unescapeJsonPointer=Sm;function pR(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}o(pR,"eachItem");W.eachItem=pR;function fm({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(a,i,s,c)=>{let d=s===void 0?i:s instanceof ie.Name?(i instanceof ie.Name?e(a,i,s):t(a,i,s),s):i instanceof ie.Name?(t(a,s,i),i):r(i,s);return c===ie.Name&&!(d instanceof ie.Name)?n(a,d):d}}o(fm,"makeMergeEvaluated");W.mergeEvaluated={props:fm({mergeNames:o((e,t,r)=>e.if((0,ie._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,ie._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,ie._)`${r} || {}`).code((0,ie._)`Object.assign(${r}, ${t})`))}),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,ie._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,ie._)`${r} || {}`),nu(e,r,t))}),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:{...e,...t},"mergeValues"),resultToName:_m}),items:fm({mergeNames:o((e,t,r)=>e.if((0,ie._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,ie._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),"mergeNames"),mergeToName:o((e,t,r)=>e.if((0,ie._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,ie._)`${r} > ${t} ? ${r} : ${t}`)),"mergeToName"),mergeValues:o((e,t)=>e===!0?!0:Math.max(e,t),"mergeValues"),resultToName:o((e,t)=>e.var("items",t),"resultToName")})};function _m(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,ie._)`{}`);return t!==void 0&&nu(e,r,t),r}o(_m,"evaluatedPropsToName");W.evaluatedPropsToName=_m;function nu(e,t,r){Object.keys(r).forEach(n=>e.assign((0,ie._)`${t}${(0,ie.getProperty)(n)}`,!0))}o(nu,"setEvaluated");W.setEvaluated=nu;var hm={};function mR(e,t){return e.scopeValue("func",{ref:t,code:hm[t.code]||(hm[t.code]=new aR._Code(t.code))})}o(mR,"useFunc");W.useFunc=mR;var tu;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(tu||(W.Type=tu={}));function fR(e,t,r){if(e instanceof ie.Name){let n=t===tu.Num;return r?n?(0,ie._)`"[" + ${e} + "]"`:(0,ie._)`"['" + ${e} + "']"`:n?(0,ie._)`"/" + ${e}`:(0,ie._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ie.getProperty)(e).toString():"/"+ru(e)}o(fR,"getErrorPath");W.getErrorPath=fR;function wm(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}o(wm,"checkStrictMode");W.checkStrictMode=wm});var Vt=x(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});var Ne=F(),hR={data:new Ne.Name("data"),valCxt:new Ne.Name("valCxt"),instancePath:new Ne.Name("instancePath"),parentData:new Ne.Name("parentData"),parentDataProperty:new Ne.Name("parentDataProperty"),rootData:new Ne.Name("rootData"),dynamicAnchors:new Ne.Name("dynamicAnchors"),vErrors:new Ne.Name("vErrors"),errors:new Ne.Name("errors"),this:new Ne.Name("this"),self:new Ne.Name("self"),scope:new Ne.Name("scope"),json:new Ne.Name("json"),jsonPos:new Ne.Name("jsonPos"),jsonLen:new Ne.Name("jsonLen"),jsonPart:new Ne.Name("jsonPart")};ou.default=hR});var Uo=x(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.extendErrors=De.resetErrorsCount=De.reportExtraError=De.reportError=De.keyword$DataError=De.keywordError=void 0;var X=F(),ii=re(),Ve=Vt();De.keywordError={message:o(({keyword:e})=>(0,X.str)`must pass "${e}" keyword validation`,"message")};De.keyword$DataError={message:o(({keyword:e,schemaType:t})=>t?(0,X.str)`"${e}" keyword must be ${t} ($data)`:(0,X.str)`"${e}" keyword is invalid ($data)`,"message")};function gR(e,t=De.keywordError,r,n){let{it:a}=e,{gen:i,compositeRule:s,allErrors:c}=a,d=Rm(e,t,r);n??(s||c)?vm(i,d):bm(a,(0,X._)`[${d}]`)}o(gR,"reportError");De.reportError=gR;function yR(e,t=De.keywordError,r){let{it:n}=e,{gen:a,compositeRule:i,allErrors:s}=n,c=Rm(e,t,r);vm(a,c),i||s||bm(n,Ve.default.vErrors)}o(yR,"reportExtraError");De.reportExtraError=yR;function SR(e,t){e.assign(Ve.default.errors,t),e.if((0,X._)`${Ve.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,X._)`${Ve.default.vErrors}.length`,t),()=>e.assign(Ve.default.vErrors,null)))}o(SR,"resetErrorsCount");De.resetErrorsCount=SR;function _R({gen:e,keyword:t,schemaValue:r,data:n,errsCount:a,it:i}){if(a===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",a,Ve.default.errors,c=>{e.const(s,(0,X._)`${Ve.default.vErrors}[${c}]`),e.if((0,X._)`${s}.instancePath === undefined`,()=>e.assign((0,X._)`${s}.instancePath`,(0,X.strConcat)(Ve.default.instancePath,i.errorPath))),e.assign((0,X._)`${s}.schemaPath`,(0,X.str)`${i.errSchemaPath}/${t}`),i.opts.verbose&&(e.assign((0,X._)`${s}.schema`,r),e.assign((0,X._)`${s}.data`,n))})}o(_R,"extendErrors");De.extendErrors=_R;function vm(e,t){let r=e.const("err",t);e.if((0,X._)`${Ve.default.vErrors} === null`,()=>e.assign(Ve.default.vErrors,(0,X._)`[${r}]`),(0,X._)`${Ve.default.vErrors}.push(${r})`),e.code((0,X._)`${Ve.default.errors}++`)}o(vm,"addError");function bm(e,t){let{gen:r,validateName:n,schemaEnv:a}=e;a.$async?r.throw((0,X._)`new ${e.ValidationError}(${t})`):(r.assign((0,X._)`${n}.errors`,t),r.return(!1))}o(bm,"returnErrors");var jr={keyword:new X.Name("keyword"),schemaPath:new X.Name("schemaPath"),params:new X.Name("params"),propertyName:new X.Name("propertyName"),message:new X.Name("message"),schema:new X.Name("schema"),parentSchema:new X.Name("parentSchema")};function Rm(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,X._)`{}`:wR(e,t,r)}o(Rm,"errorObjectCode");function wR(e,t,r={}){let{gen:n,it:a}=e,i=[vR(a,r),bR(e,r)];return RR(e,t,i),n.object(...i)}o(wR,"errorObject");function vR({errorPath:e},{instancePath:t}){let r=t?(0,X.str)`${e}${(0,ii.getErrorPath)(t,ii.Type.Str)}`:e;return[Ve.default.instancePath,(0,X.strConcat)(Ve.default.instancePath,r)]}o(vR,"errorInstancePath");function bR({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let a=n?t:(0,X.str)`${t}/${e}`;return r&&(a=(0,X.str)`${a}${(0,ii.getErrorPath)(r,ii.Type.Str)}`),[jr.schemaPath,a]}o(bR,"errorSchemaPath");function RR(e,{params:t,message:r},n){let{keyword:a,data:i,schemaValue:s,it:c}=e,{opts:d,propertyName:p,topSchemaRef:l,schemaPath:m}=c;n.push([jr.keyword,a],[jr.params,typeof t=="function"?t(e):t||(0,X._)`{}`]),d.messages&&n.push([jr.message,typeof r=="function"?r(e):r]),d.verbose&&n.push([jr.schema,s],[jr.parentSchema,(0,X._)`${l}${m}`],[Ve.default.data,i]),p&&n.push([jr.propertyName,p])}o(RR,"extraErrorProps")});var Im=x(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.boolOrEmptySchema=wn.topBoolOrEmptySchema=void 0;var CR=Uo(),IR=F(),PR=Vt(),xR={message:"boolean schema is false"};function AR(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Cm(e,!1):typeof r=="object"&&r.$async===!0?t.return(PR.default.data):(t.assign((0,IR._)`${n}.errors`,null),t.return(!0))}o(AR,"topBoolOrEmptySchema");wn.topBoolOrEmptySchema=AR;function kR(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Cm(e)):r.var(t,!0)}o(kR,"boolOrEmptySchema");wn.boolOrEmptySchema=kR;function Cm(e,t){let{gen:r,data:n}=e,a={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,CR.reportError)(a,xR,void 0,t)}o(Cm,"falseSchemaError")});var au=x(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.getRules=vn.isJSONType=void 0;var TR=["string","number","integer","boolean","null","object","array"],ER=new Set(TR);function UR(e){return typeof e=="string"&&ER.has(e)}o(UR,"isJSONType");vn.isJSONType=UR;function OR(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}o(OR,"getRules");vn.getRules=OR});var iu=x(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.shouldUseRule=gr.shouldUseGroup=gr.schemaHasRulesForType=void 0;function $R({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Pm(e,n)}o($R,"schemaHasRulesForType");gr.schemaHasRulesForType=$R;function Pm(e,t){return t.rules.some(r=>xm(e,r))}o(Pm,"shouldUseGroup");gr.shouldUseGroup=Pm;function xm(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}o(xm,"shouldUseRule");gr.shouldUseRule=xm});var Oo=x(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.reportTypeError=je.checkDataTypes=je.checkDataType=je.coerceAndCheckDataType=je.getJSONTypes=je.getSchemaTypes=je.DataType=void 0;var zR=au(),MR=iu(),qR=Uo(),V=F(),Am=re(),bn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(bn||(je.DataType=bn={}));function NR(e){let t=km(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}o(NR,"getSchemaTypes");je.getSchemaTypes=NR;function km(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(zR.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}o(km,"getJSONTypes");je.getJSONTypes=km;function DR(e,t){let{gen:r,data:n,opts:a}=e,i=jR(t,a.coerceTypes),s=t.length>0&&!(i.length===0&&t.length===1&&(0,MR.schemaHasRulesForType)(e,t[0]));if(s){let c=cu(t,n,a.strictNumbers,bn.Wrong);r.if(c,()=>{i.length?HR(e,t,i):uu(e)})}return s}o(DR,"coerceAndCheckDataType");je.coerceAndCheckDataType=DR;var Tm=new Set(["string","number","integer","boolean","null"]);function jR(e,t){return t?e.filter(r=>Tm.has(r)||t==="array"&&r==="array"):[]}o(jR,"coerceToTypes");function HR(e,t,r){let{gen:n,data:a,opts:i}=e,s=n.let("dataType",(0,V._)`typeof ${a}`),c=n.let("coerced",(0,V._)`undefined`);i.coerceTypes==="array"&&n.if((0,V._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>n.assign(a,(0,V._)`${a}[0]`).assign(s,(0,V._)`typeof ${a}`).if(cu(t,a,i.strictNumbers),()=>n.assign(c,a))),n.if((0,V._)`${c} !== undefined`);for(let p of r)(Tm.has(p)||p==="array"&&i.coerceTypes==="array")&&d(p);n.else(),uu(e),n.endIf(),n.if((0,V._)`${c} !== undefined`,()=>{n.assign(a,c),LR(e,c)});function d(p){switch(p){case"string":n.elseIf((0,V._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,V._)`"" + ${a}`).elseIf((0,V._)`${a} === null`).assign(c,(0,V._)`""`);return;case"number":n.elseIf((0,V._)`${s} == "boolean" || ${a} === null
|
|
27
27
|
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,V._)`+${a}`);return;case"integer":n.elseIf((0,V._)`${s} === "boolean" || ${a} === null
|
|
28
28
|
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,V._)`+${a}`);return;case"boolean":n.elseIf((0,V._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,V._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case"null":n.elseIf((0,V._)`${a} === "" || ${a} === 0 || ${a} === false`),n.assign(c,null);return;case"array":n.elseIf((0,V._)`${s} === "string" || ${s} === "number"
|
package/out/types/index.d.ts
CHANGED
|
@@ -6106,16 +6106,24 @@ export declare const MTLSAuthInboundPolicy: InboundPolicyHandler<MTLSAuthInbound
|
|
|
6106
6106
|
* The options for this policy.
|
|
6107
6107
|
* @public
|
|
6108
6108
|
*/
|
|
6109
|
-
export declare
|
|
6109
|
+
export declare type MTLSAuthInboundPolicyOptions = (
|
|
6110
|
+
| {
|
|
6111
|
+
[k: string]: unknown;
|
|
6112
|
+
}
|
|
6113
|
+
| {
|
|
6114
|
+
allowUnauthenticatedRequests: true;
|
|
6115
|
+
[k: string]: unknown;
|
|
6116
|
+
}
|
|
6117
|
+
) & {
|
|
6110
6118
|
/**
|
|
6111
6119
|
* Allows requests to continue even when mTLS verification fails, no client certificate is presented, or the certificate metadata cannot be parsed. Defaults to false.
|
|
6112
6120
|
*/
|
|
6113
6121
|
allowUnauthenticatedRequests?: boolean;
|
|
6114
6122
|
/**
|
|
6115
|
-
*
|
|
6123
|
+
* Fully qualified issuer distinguished name to require on the client certificate. The policy rejects certificates whose parsed issuer DN does not match this string exactly. Required unless `allowUnauthenticatedRequests` is `true`. The expected format matches the parsed metadata issuer, e.g. "CN=example-ca, O=Example, C=US".
|
|
6116
6124
|
*/
|
|
6117
6125
|
certIssuerDN?: string;
|
|
6118
|
-
}
|
|
6126
|
+
};
|
|
6119
6127
|
|
|
6120
6128
|
/**
|
|
6121
6129
|
* Parsed client certificate metadata attached by the mTLS auth policy.
|
package/package.json
CHANGED
|
File without changes
|