@zuplo/runtime 7.14.8 → 7.15.1
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/LICENSE.third-party.txt +511 -0
- package/LICENSE.txt +5 -78
- package/README.md +7 -0
- package/out/esm/chunk-5JGLAPFA.js +13 -0
- package/out/esm/chunk-5JGLAPFA.js.map +1 -0
- package/out/esm/{chunk-6R2COTV6.js → chunk-AJ3MMWJS.js} +9 -22
- package/out/esm/chunk-AJ3MMWJS.js.map +1 -0
- package/out/esm/chunk-BH4DKEES.js +13 -0
- package/out/esm/chunk-BH4DKEES.js.map +1 -0
- package/out/esm/chunk-G42UYZ6V.js +24 -0
- package/out/esm/{chunk-2HVCLUM4.js.map → chunk-G42UYZ6V.js.map} +1 -1
- package/out/esm/chunk-OE2WMJXK.js +431 -0
- package/out/esm/chunk-OE2WMJXK.js.map +1 -0
- package/out/esm/chunk-R6UNMRUU.js +13 -0
- package/out/esm/chunk-R6UNMRUU.js.map +1 -0
- package/out/esm/{chunk-PY52EHDX.js → chunk-T2WKOG7J.js} +9 -22
- package/out/esm/chunk-T2WKOG7J.js.map +1 -0
- package/out/esm/{chunk-SNTU476S.js → chunk-TOJD4RET.js} +9 -22
- package/out/esm/chunk-TOJD4RET.js.map +1 -0
- package/out/esm/chunk-VXPFMOL5.js +13 -0
- package/out/esm/chunk-VXPFMOL5.js.map +1 -0
- package/out/esm/index.js +8 -21
- package/out/esm/index.js.map +1 -1
- package/out/esm/internal/index.js +8 -21
- package/out/esm/mcp/messages/index.js +8 -21
- package/out/esm/mcp-gateway/index.js +11 -39
- package/out/esm/mcp-gateway/index.js.map +1 -1
- package/out/esm/mocks/index.js +8 -21
- package/out/esm/mocks/index.js.map +1 -1
- package/out/esm/sdks/aws/index.js +8 -21
- package/out/esm/sdks/aws/index.js.map +1 -1
- package/out/types/index.d.ts +248 -6
- package/out/types/internal/index.d.ts +101 -0
- package/out/types/mcp-gateway/index.d.ts +127 -0
- package/package.json +3 -2
- package/out/esm/chunk-2HVCLUM4.js +0 -37
- package/out/esm/chunk-6R2COTV6.js.map +0 -1
- package/out/esm/chunk-A3QGJZO7.js +0 -26
- package/out/esm/chunk-A3QGJZO7.js.map +0 -1
- package/out/esm/chunk-DB6LKZ36.js +0 -429
- package/out/esm/chunk-DB6LKZ36.js.map +0 -1
- package/out/esm/chunk-PY52EHDX.js.map +0 -1
- package/out/esm/chunk-SNTU476S.js.map +0 -1
- package/out/esm/chunk-TYV53J3B.js +0 -26
- package/out/esm/chunk-TYV53J3B.js.map +0 -1
- package/out/esm/chunk-UKQQD2JN.js +0 -26
- package/out/esm/chunk-UKQQD2JN.js.map +0 -1
- package/out/esm/chunk-VP5Q3DEN.js +0 -26
- package/out/esm/chunk-VP5Q3DEN.js.map +0 -1
- /package/out/esm/{chunk-2HVCLUM4.js.LEGAL.txt → chunk-G42UYZ6V.js.LEGAL.txt} +0 -0
- /package/out/esm/{chunk-DB6LKZ36.js.LEGAL.txt → chunk-OE2WMJXK.js.LEGAL.txt} +0 -0
|
@@ -3025,6 +3025,12 @@ export declare interface McpTokenExchangeInboundPolicyOptions {
|
|
|
3025
3025
|
* Overrides the OIDC `prompt` parameter on upstream authorization requests. The MCP SDK adds `prompt=consent` whenever the requested scope includes `offline_access`, which forces a consent screen on every authorization on providers like Microsoft Entra ID even after a tenant admin has granted org-wide admin consent. Leave unset to keep the SDK's behavior; set to `false` to strip the `prompt` parameter; set an explicit value to replace it. Warning: stripping `prompt=consent` while requesting `offline_access` can silently prevent refresh-token issuance on providers that require a fresh consent grant for offline access (e.g. Google) — only use this when the provider grants offline access via pre-authorized/admin consent (e.g. Entra tenant admin consent).
|
|
3026
3026
|
*/
|
|
3027
3027
|
prompt?: ("none" | "login" | "consent" | "select_account") | false;
|
|
3028
|
+
/**
|
|
3029
|
+
* Extra query parameters added to upstream authorization requests, for providers that need a parameter the MCP authorization flow does not send. For example, Google issues a refresh token only when the request carries `access_type=offline`, so Google upstreams set `{ "access_type": "offline" }`, usually with `prompt: "consent"`. A value replaces any parameter of the same name. Parameters the gateway manages cannot be set here: `response_type`, `response_mode`, `client_id`, `redirect_uri`, `scope`, `state`, `code_challenge`, `code_challenge_method`, `resource`, and `prompt` (use the `prompt` option). Available only with `user-oauth` and `shared-oauth`.
|
|
3030
|
+
*/
|
|
3031
|
+
authorizationParams?: {
|
|
3032
|
+
[k: string]: string;
|
|
3033
|
+
};
|
|
3028
3034
|
/**
|
|
3029
3035
|
* Allows the authorization server metadata's `issuer` to differ from the server URL used for discovery. Defaults to `false`. Enable only for a confirmed provider metadata mismatch after verifying that its metadata and OAuth endpoints are trusted. This disables the RFC 8414 section 3.3 issuer check; authorization-response and callback checks still apply. Available only with `user-oauth` and `shared-oauth`.
|
|
3030
3036
|
*/
|
|
@@ -4063,6 +4069,63 @@ declare interface PromptProjection {
|
|
|
4063
4069
|
*/
|
|
4064
4070
|
declare type Public = boolean;
|
|
4065
4071
|
|
|
4072
|
+
/**
|
|
4073
|
+
* Describes the value a {@link TelemetryRedactor} is asked to redact.
|
|
4074
|
+
*
|
|
4075
|
+
* @public
|
|
4076
|
+
*/
|
|
4077
|
+
declare interface RedactionContext {
|
|
4078
|
+
/**
|
|
4079
|
+
* The kind of record the value is written to.
|
|
4080
|
+
*/
|
|
4081
|
+
readonly kind: RedactionRecordKind;
|
|
4082
|
+
/**
|
|
4083
|
+
* The path of the value in the record, for example `message[0]`,
|
|
4084
|
+
* `message[1].user.email`, `properties.customerId`, `attributes.http.url`,
|
|
4085
|
+
* `events[0].attributes.exception.message` or `url`.
|
|
4086
|
+
*/
|
|
4087
|
+
readonly field: string;
|
|
4088
|
+
/**
|
|
4089
|
+
* The last property name in {@link RedactionContext.field}, for example `email`
|
|
4090
|
+
* or `http.url`. `undefined` when the value is not a property of an object
|
|
4091
|
+
* (a log message string, an array element, a span name).
|
|
4092
|
+
*/
|
|
4093
|
+
readonly key: string | undefined;
|
|
4094
|
+
/**
|
|
4095
|
+
* Every property name on the way from the record to the value, outermost
|
|
4096
|
+
* first: `["user", "email"]` for `message[1].user.email`, `["dob"]` for
|
|
4097
|
+
* `message[1].dob[0]`. Array indices are left out, so a value in an array
|
|
4098
|
+
* keeps the name the array is under. When {@link RedactionContext.key} is
|
|
4099
|
+
* set, it is the last entry. Empty for a value with no property name above
|
|
4100
|
+
* it (a log message string, a span name).
|
|
4101
|
+
*/
|
|
4102
|
+
readonly keys: readonly string[];
|
|
4103
|
+
}
|
|
4104
|
+
|
|
4105
|
+
/**
|
|
4106
|
+
* The kind of record a value is about to be written to.
|
|
4107
|
+
*
|
|
4108
|
+
* - `log`: a log entry from `context.log`, `console.*` in customer code, or the
|
|
4109
|
+
* gateway's own request logs. Goes to Zuplo's log pipeline and to every
|
|
4110
|
+
* configured log integration.
|
|
4111
|
+
* - `span`: an OpenTelemetry span: its name, attributes, events and status.
|
|
4112
|
+
* - `analytics`: the URL and customer-set properties on the per-request
|
|
4113
|
+
* analytics row (also sent to metrics plugins), and URL fields of analytics
|
|
4114
|
+
* events. Fields that usage and billing are computed from are never
|
|
4115
|
+
* redacted.
|
|
4116
|
+
* - `request-log`: an entry produced by a request logger plugin (Azure Blob,
|
|
4117
|
+
* Azure Event Hubs, Hydrolix).
|
|
4118
|
+
* - `audit-log`: an event recorded by the Audit Log policy.
|
|
4119
|
+
*
|
|
4120
|
+
* @public
|
|
4121
|
+
*/
|
|
4122
|
+
declare type RedactionRecordKind =
|
|
4123
|
+
| "log"
|
|
4124
|
+
| "span"
|
|
4125
|
+
| "analytics"
|
|
4126
|
+
| "request-log"
|
|
4127
|
+
| "audit-log";
|
|
4128
|
+
|
|
4066
4129
|
/**
|
|
4067
4130
|
* Generic type parameters for a request.
|
|
4068
4131
|
* Extends RequestInitGeneric and adds query parameter typing.
|
|
@@ -4295,6 +4358,29 @@ declare interface RuntimeExtensions {
|
|
|
4295
4358
|
* @param hook - The pre-routing hook function
|
|
4296
4359
|
*/
|
|
4297
4360
|
addPreRoutingHook(hook: PreRoutingHook): void;
|
|
4361
|
+
/**
|
|
4362
|
+
* Add a redactor that redacts sensitive data before Zuplo records it.
|
|
4363
|
+
*
|
|
4364
|
+
* Request content the gateway records passes through the registered
|
|
4365
|
+
* redactors first: log entries (messages, structured fields, errors, log
|
|
4366
|
+
* properties), OpenTelemetry spans (names, attributes, events, status), the
|
|
4367
|
+
* URL and custom properties on the per-request analytics row, request
|
|
4368
|
+
* logger plugin entries and Audit Log policy events. The fields usage and
|
|
4369
|
+
* billing are computed from (route pattern, method, status, consumer) are
|
|
4370
|
+
* never redacted. Redactors run in the order they are added. With none
|
|
4371
|
+
* added, nothing is redacted and nothing changes.
|
|
4372
|
+
*
|
|
4373
|
+
* Call it only in `runtimeInit`; calls after startup throw. At most 16
|
|
4374
|
+
* redactors can be registered.
|
|
4375
|
+
*
|
|
4376
|
+
* If a redactor throws or returns something other than a string, the value
|
|
4377
|
+
* is recorded as `"[REDACTION_FAILED]"` and a warning, without the value, is
|
|
4378
|
+
* written to the request log at most once a minute.
|
|
4379
|
+
*
|
|
4380
|
+
* @param redactor - The redactor function. Use `createRedactor` for
|
|
4381
|
+
* built-in patterns.
|
|
4382
|
+
*/
|
|
4383
|
+
addTelemetryRedactor(redactor: TelemetryRedactor): void;
|
|
4298
4384
|
}
|
|
4299
4385
|
|
|
4300
4386
|
/**
|
|
@@ -4313,6 +4399,46 @@ declare abstract class SystemRuntimePlugin extends RuntimePlugin {
|
|
|
4313
4399
|
/* Excluded from this release type: registerRoutes */
|
|
4314
4400
|
}
|
|
4315
4401
|
|
|
4402
|
+
/**
|
|
4403
|
+
* A function that redacts sensitive data from a value before Zuplo records
|
|
4404
|
+
* it. Return the value to record: the input unchanged, or a redacted copy.
|
|
4405
|
+
*
|
|
4406
|
+
* The function runs synchronously on the request path for every string (and
|
|
4407
|
+
* every number, as its decimal string) the gateway records, so keep it fast.
|
|
4408
|
+
* It must be pure: the same input and context must always give the same
|
|
4409
|
+
* output, because results for short values are cached and reused. Values over
|
|
4410
|
+
* 32,768 characters are cut to that length before the function sees them.
|
|
4411
|
+
* Anything the function logs is dropped.
|
|
4412
|
+
* If it throws, or returns something other than a string, the value is
|
|
4413
|
+
* replaced with `"[REDACTION_FAILED]"` and the failure is recorded without the
|
|
4414
|
+
* value.
|
|
4415
|
+
*
|
|
4416
|
+
* @example
|
|
4417
|
+
* ```ts
|
|
4418
|
+
* import { RuntimeExtensions, createRedactor } from "@zuplo/runtime";
|
|
4419
|
+
*
|
|
4420
|
+
* export function runtimeInit(runtime: RuntimeExtensions) {
|
|
4421
|
+
* // Built-in patterns
|
|
4422
|
+
* runtime.addTelemetryRedactor(
|
|
4423
|
+
* createRedactor({
|
|
4424
|
+
* entities: ["finance-credit-card", "id-us-ssn"],
|
|
4425
|
+
* queryParameters: ["ssn", "card_number"],
|
|
4426
|
+
* })
|
|
4427
|
+
* );
|
|
4428
|
+
*
|
|
4429
|
+
* // A custom rule: drop the value of any field named "dob"
|
|
4430
|
+
* runtime.addTelemetryRedactor((value, { key }) =>
|
|
4431
|
+
* key === "dob" ? "[REDACTED]" : value
|
|
4432
|
+
* );
|
|
4433
|
+
* }
|
|
4434
|
+
* ```
|
|
4435
|
+
*
|
|
4436
|
+
* @public
|
|
4437
|
+
*/
|
|
4438
|
+
declare interface TelemetryRedactor {
|
|
4439
|
+
(value: string, context: RedactionContext): string;
|
|
4440
|
+
}
|
|
4441
|
+
|
|
4316
4442
|
declare interface ToolProjection {
|
|
4317
4443
|
/**
|
|
4318
4444
|
* Tool name to expose.
|
|
@@ -4397,6 +4523,7 @@ declare interface UpstreamOAuthConfig {
|
|
|
4397
4523
|
scopes: string[];
|
|
4398
4524
|
scopeDelimiter: string;
|
|
4399
4525
|
prompt?: UpstreamOAuthPromptOverride;
|
|
4526
|
+
authorizationParams?: Record<string, string>;
|
|
4400
4527
|
skipIssuerMetadataValidation?: boolean;
|
|
4401
4528
|
skipResourceIndicatorValidation?: boolean;
|
|
4402
4529
|
clientRegistration: UpstreamOAuthClientRegistrationConfig;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.15.1",
|
|
5
5
|
"repository": "https://github.com/zuplo/zuplo",
|
|
6
6
|
"author": "Zuplo, Inc.",
|
|
7
7
|
"exports": {
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"out/**/*",
|
|
39
39
|
"README.md",
|
|
40
|
-
"LICENSE.txt"
|
|
40
|
+
"LICENSE.txt",
|
|
41
|
+
"LICENSE.third-party.txt"
|
|
41
42
|
],
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/node": "^22.13.4",
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Zuplo, Inc. All rights reserved.
|
|
4
|
-
*
|
|
5
|
-
* This software and associated documentation files (the "Software") is intended to be used
|
|
6
|
-
* only by Zuplo customers solely to develop and test applications that will be deployed
|
|
7
|
-
* to Zuplo hosted services. You and others in your organization may use these files on your
|
|
8
|
-
* Development Devices solely for the above stated purpose.
|
|
9
|
-
*
|
|
10
|
-
* Outside of uses stated above, no license is granted for any other purpose including
|
|
11
|
-
* without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
12
|
-
* sublicense, host, and/or sell copies of the Software.
|
|
13
|
-
*
|
|
14
|
-
* The software may include third party components with separate legal notices or governed by
|
|
15
|
-
* other agreements, as described in licenses either embedded in or accompanying the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
18
|
-
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
19
|
-
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
20
|
-
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
21
|
-
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
22
|
-
* DEALINGS IN THE SOFTWARE.
|
|
23
|
-
*--------------------------------------------------------------------------------------------*/
|
|
24
|
-
|
|
25
|
-
import{a as r}from"./chunk-TYV53J3B.js";var w=class extends Error{static{r(this,"SystemError")}constructor(t,n){super(t,n),this.name="InternalError"}},N=class extends TypeError{static{r(this,"NetworkError")}cause;constructor(t){super("The upstream request failed due to a network error.",{cause:t}),this.name="TypeError",this.cause=t}},A=class extends Error{static{r(this,"RuntimeError")}extensionMembers;constructor(t,n){typeof t=="string"?super(t,n):(super(t.message,n),this.extensionMembers=t.extensionMembers),this.name="RuntimeError"}},K=class extends A{static{r(this,"ConfigurationError")}constructor(t,n){super(t,n),this.name="ConfigurationError"}};var ht="zuplo-request-id",Ee="zp-rid",he="zp-body-removed",Re="cf-ray",Rt="x-forwarded-scheme",Ot="x-forwarded-proto",yt="x-scheme",Oe="cf-ipcity",ye="cf-ipcontinent",Ae="cf-ipcountry",Se="cf-iplongitude",Te="cf-iplatitude",At="cf-region",St="cf-region-code",Tt="cf-metro-code",bt="cf-postal-code",Pt="cf-timezone",Lt="zp-ipcity",Ct="zp-ipcontinent",xt="zp-ipcountry",It="zp-iplongitude",Ut="zp-iplatitude",X="x-real-ip",v="true-client-ip";var be="zp-client-cert",Pe="zp-mtls-status",Le="zp-mtls-failure-reason",Ce="zp-mtls-cert-fingerprint-sha256",xe="zp-mtls-cert-not-before",Ie="zp-mtls-cert-not-after",Ue="zp-mtls-cert-issuer-dn",we="zp-mtls-cert-subject-dn",Ne="zp-asn",Me="zp-asorg",De="zp-colo",ve="zp-postalcode",He="zp-metrocode",ze="zp-region",Fe="zp-regioncode",Ze="zp-timezone",wt="zp-http-protocol",H="zp-local-service",Ve="zp-gateway-api-key",ke="x-akamai-edgescape",Nt=[be,Pe,Le,Ce,xe,Ie,Ue,we,ke,H],Mt=[Oe,ye,Ae,Se,Te,Ne,Me,De,ve,He,ze,Fe,Ze],Dt=["zp-","cf-"],vt=[Ee,Re,he,Ve];var Ht="system-logger";var Be=!1;function P(e,t){return{open:`\x1B[${e.join(";")}m`,close:`\x1B[${t}m`,regexp:new RegExp(`\\x1b\\[${t}m`,"g")}}r(P,"code");function L(e,t){return Be?`${t.open}${e.replace(t.regexp,t.open)}${t.close}`:e}r(L,"run");function Ge(e){return L(e,P([31],39))}r(Ge,"red");function $e(e){return L(e,P([32],39))}r($e,"green");function je(e){return L(e,P([33],39))}r(je,"yellow");function Ye(e){return L(e,P([34],39))}r(Ye,"blue");function qe(e){return L(e,P([35],39))}r(qe,"magenta");function We(e){return L(e,P([36],39))}r(We,"cyan");var Ft=new RegExp(["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|"),"g");var Q=[Ge,$e,je,Ye,qe,We];function Je(e){let t=0,n=e.length,i=0;if(n>0)for(;i<n;)t=(t<<5)-t+e.charCodeAt(i++)|0;return t}r(Je,"hashCode");function ee(e){let t=Math.abs(Je(e));return Q[t%Q.length]}r(ee,"generateColor");function te(e,t,...n){let i=0,o=n.length,c=String(t).replace(/%[sdjoO%]/g,s=>{if(s==="%%")return"%";if(i>=o)return s;switch(s){case"%s":return String(n[i++]);case"%d":return Number(n[i++]).toString();case"%o":return e(n[i++]).split(`
|
|
26
|
-
`).map(l=>l.trim()).join(" ");case"%O":return e(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}default:return s}});for(let s of n.splice(i))s===null||!(typeof s=="object"&&s!==null)?c+=" "+s:c+=" "+e(s);return c}r(te,"format");function T(e,t,n,i){let o={seen:[],stylize:Ke,showHidden:t??!1,depth:n??2,colors:i??!1,customInspect:!0};return o.colors&&(o.stylize=Qe),M(o,e,o.depth)}r(T,"inspect");T.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};T.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ke(e,t){return e}r(Ke,"stylizeNoColor");function Xe(e){return typeof e=="boolean"}r(Xe,"isBoolean");function re(e){return e===void 0}r(re,"isUndefined");function Qe(e,t){let n=T.styles[t];return n?"\x1B["+T.colors[n][0]+"m"+e+"\x1B["+T.colors[n][1]+"m":e}r(Qe,"stylizeWithColor");function z(e){return typeof e=="function"}r(z,"isFunction");function oe(e){return typeof e=="string"}r(oe,"isString");function et(e){return typeof e=="number"}r(et,"isNumber");function ie(e){return e===null}r(ie,"isNull");function se(e,t){return Object.hasOwn(e,t)}r(se,"hasOwn");function F(e){return B(e)&&G(e)==="[object RegExp]"}r(F,"isRegExp");function B(e){return typeof e=="object"&&e!==null}r(B,"isObject");function Z(e){return B(e)&&(G(e)==="[object Error]"||e instanceof Error)}r(Z,"isError");function ne(e){return B(e)&&G(e)==="[object Date]"}r(ne,"isDate");function G(e){return Object.prototype.toString.call(e)}r(G,"objectToString");function tt(e){let t={};return e.forEach(function(n,i){t[n]=!0}),t}r(tt,"arrayToHash");function nt(e,t,n,i,o){let c=[];for(let s=0,l=t.length;s<l;++s)se(t,String(s))?c.push(k(e,t,n,i,String(s),!0)):c.push("");return o.forEach(function(s){s.match(/^\d+$/)||c.push(k(e,t,n,i,s,!0))}),c}r(nt,"formatArray");function V(e){return"["+Error.prototype.toString.call(e)+"]"}r(V,"formatError");function M(e,t,n){if(e.customInspect&&t&&z(t.inspect)&&t.inspect!==T&&!(t.constructor&&t.constructor.prototype===t)){let u=t.inspect(n,e);return oe(u)||(u=M(e,u,n)),u}let i=rt(e,t);if(i)return i;let o=Object.keys(t),c=tt(o);try{e.showHidden&&Object.getOwnPropertyNames&&(o=Object.getOwnPropertyNames(t))}catch{}if(Z(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return V(t);if(o.length===0){if(z(t)){let u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(F(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(ne(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Z(t))return V(t)}let s="",l=!1,p=["{","}"];if(Array.isArray(t)&&(l=!0,p=["[","]"]),z(t)&&(s=" [Function"+(t.name?": "+t.name:"")+"]"),F(t)&&(s=" "+RegExp.prototype.toString.call(t)),ne(t)&&(s=" "+Date.prototype.toUTCString.call(t)),Z(t)&&(s=" "+V(t)),o.length===0&&(!l||t.length==0))return p[0]+s+p[1];if(n<0)return F(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);let a;return l?a=nt(e,t,n,c,o):a=o.map(function(u){return k(e,t,n,c,u,l)}),e.seen.pop(),ot(a,s,p)}r(M,"formatValue");function k(e,t,n,i,o,c){let s,l,p;p={value:void 0};try{p.value=t[o]}catch{}try{Object.getOwnPropertyDescriptor&&(p=Object.getOwnPropertyDescriptor(t,o)||p)}catch{}if(p.get?p.set?l=e.stylize("[Getter/Setter]","special"):l=e.stylize("[Getter]","special"):p.set&&(l=e.stylize("[Setter]","special")),se(i,o)||(s="["+o+"]"),l||(e.seen.indexOf(p.value)<0?(ie(n)?l=M(e,p.value,null):l=M(e,p.value,n-1),l.indexOf(`
|
|
27
|
-
`)>-1&&(c?l=l.split(`
|
|
28
|
-
`).map(function(a){return" "+a}).join(`
|
|
29
|
-
`).substr(2):l=`
|
|
30
|
-
`+l.split(`
|
|
31
|
-
`).map(function(a){return" "+a}).join(`
|
|
32
|
-
`))):l=e.stylize("[Circular]","special")),re(s)){if(c&&o.match(/^\d+$/))return l;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+l}r(k,"formatProperty");function rt(e,t){if(re(t))return e.stylize("undefined","undefined");if(oe(t)){let n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(et(t))return e.stylize(""+t,"number");if(Xe(t))return e.stylize(""+t,"boolean");if(ie(t))return e.stylize("null","null")}r(rt,"formatPrimitive");function ot(e,t,n){let i=0;return e.reduce(function(c,s){return i++,s.indexOf(`
|
|
33
|
-
`)>=0&&i++,c+s.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(t===""?"":t+`
|
|
34
|
-
`)+" "+e.join(`,
|
|
35
|
-
`)+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}r(ot,"reduceToSingleString");var ae=r((e,...t)=>te(T,e,t),"format");var $=class{static{r(this,"Debugger")}manager;ns;color;last;enabled;constructor(t,n){this.manager=t,this.ns=n,this.color=ee(n),this.last=0,this.enabled=t.enabled.some(i=>i.test(n))}log(...t){if(!this.enabled)return;let n,i=t[0];typeof i=="function"?n=i():n=String(i);let o=Date.now()-(this.last||Date.now());n=ae(n,...t);let c=`${this.color(this.ns)} ${n} ${this.color(`+${o}ms`)}`;console.log(c),this.last=Date.now()}},j=class{static{r(this,"DebugManager")}debuggers;enabled;constructor(t){this.debuggers=new Map,this.enabled=t??[]}};function it(e){return!e||e.length===0?[]:(e=e.replace(/\s/g,"").replace(/\*/g,".+"),e.split(",").map(t=>new RegExp(`^${t}$`)))}r(it,"extract");var D;function ce(e){let t=globalThis.DEBUG;D||(D=new j(it(t)));let n=new $(D,e);return D.debuggers.set(e,n),Object.assign(n.log.bind(n),{self:n})}r(ce,"debug");function st(e){if(e.length>=255)throw new TypeError("Alphabet too long");let t=new Uint8Array(256);for(let a=0;a<t.length;a++)t[a]=255;for(let a=0;a<e.length;a++){let u=e.charAt(a),E=u.charCodeAt(0);if(t[E]!==255)throw new TypeError(u+" is ambiguous");t[E]=a}let n=e.length,i=e.charAt(0),o=Math.log(n)/Math.log(256),c=Math.log(256)/Math.log(n);function s(a){if(a instanceof Uint8Array||(ArrayBuffer.isView(a)?a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength):Array.isArray(a)&&(a=Uint8Array.from(a))),!(a instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(a.length===0)return"";let u=0,E=0,g=0,d=a.length;for(;g!==d&&a[g]===0;)g++,u++;let R=(d-g)*c+1>>>0,m=new Uint8Array(R);for(;g!==d;){let O=a[g],h=0;for(let S=R-1;(O!==0||h<E)&&S!==-1;S--,h++)O+=256*m[S]>>>0,m[S]=O%n>>>0,O=O/n>>>0;if(O!==0)throw new Error("Non-zero carry");E=h,g++}let f=R-E;for(;f!==R&&m[f]===0;)f++;let y=i.repeat(u);for(;f<R;++f)y+=e.charAt(m[f]);return y}r(s,"encode");function l(a){if(typeof a!="string")throw new TypeError("Expected String");if(a.length===0)return new Uint8Array;let u=0,E=0,g=0;for(;a[u]===i;)E++,u++;let d=(a.length-u)*o+1>>>0,R=new Uint8Array(d);for(;u<a.length;){let O=a.charCodeAt(u);if(O>255)return;let h=t[O];if(h===255)return;let S=0;for(let U=d-1;(h!==0||S<g)&&U!==-1;U--,S++)h+=n*R[U]>>>0,R[U]=h%256>>>0,h=h/256>>>0;if(h!==0)throw new Error("Non-zero carry");g=S,u++}let m=d-g;for(;m!==d&&R[m]===0;)m++;let f=new Uint8Array(E+(d-m)),y=E;for(;m!==d;)f[y++]=R[m++];return f}r(l,"decodeUnsafe");function p(a){let u=l(a);if(u)return u;throw new Error("Non-base"+n+" character")}return r(p,"decode"),{encode:s,decodeUnsafe:l,decode:p}}r(st,"base");var le=st;var at="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",ue=le(at);var ct=/: client error \((?:Connect|SendRequest)\):/;function lt(e){return e instanceof TypeError&&e.message.startsWith("error sending request ")&&ct.test(e.message)}r(lt,"isDenoClientError");function C(e,t){return t?e.catch(n=>{throw lt(n)?new N(n):n}):e}r(C,"wrapDenoNetworkErrors");var b=ce("zuplo:runtime:external-service");function ut(){let e,{__ZUPLO_EXTERNAL_SERVICE_TOKEN:t}=_.instance.runtime;if(t&&t!=="undefined")try{let n=atob(t);e=JSON.parse(n)}catch{}return e}r(ut,"getServiceAuth");async function pe(e,t){let n=".proxy",i=".tunnel";if(typeof e=="string"){let o=new URL(e),c=o.hostname;if(c.endsWith(n)){let f=c.slice(0,-n.length),y=new URL(`http://${f}${o.pathname}${o.search}`);b(`Routing to proxy: ${y.toString()}`);let O=t??{};return x(y.toString(),O)}let s=c.endsWith(i),l=c.indexOf(".")===-1;if(!(s||l))throw new A(`Invalid service hostname suffix: ${c}. Use .proxy for proxy routing, .tunnel for explicit tunnel routing, or no suffix for default tunnel routing.`);let a=s?c.slice(0,-i.length):c,u=ut();if(!u)throw b("There is no external service auth configured for this zup."),new A("There are no external services configured for this zup.");b(`Using external service auth. ClientId: ${u.clientId})`);let E=t??{},g=new Headers(E.headers||{});g.set("CF-Access-Client-Id",u.clientId),g.set("CF-Access-Client-Secret",u.clientSecret),E.headers=g;let d;if(u.customServiceMapping?.[a])d=`https://${u.customServiceMapping[a]}`;else if(_.instance.useLegacyServiceRouting)d=`https://${a}.zuptunnel.com`;else{b("Using sha256 service routing");let f=_.instance.build;if(f.ACCOUNT_NAME&&f.PROJECT_NAME&&f.ENVIRONMENT_TYPE){let y=await pt(a,f.ACCOUNT_NAME,f.PROJECT_NAME,f.ENVIRONMENT_TYPE),O=de(f.ENVIRONMENT_TYPE),h=await Y(`${f.ACCOUNT_NAME}-${f.PROJECT_NAME}-${O}`);h==="40d7ad502f5d743997999594c177184a00161a77865423511f3a1ea21eb5a5e"||h==="d05bffe8fa91a300187d2cf43e8aa4a56bd809c442ae10d1ee49af7d29a5a11"?d=`https://${y}.zuptunnel.com`:d=`https://${y}.t.zuplo.app`}else throw b("Cannot use sha256 service routing, missing build variables"),new A("Failed to generate fully qualified tunnel url.")}let R=new URL(`${d}${o.pathname}${o.search}`);b(`Calling external service: ${R.toString()}`);let m=await x(R.toString(),E);if(m.status===403&&m.headers.get("cf-access-domain")!==null)throw I.console.error("403 Forbidden when calling external service.",{clientId:u.clientId,tunnelHost:d}),new A("Could not connect to secure tunnel.");return m}else throw b("Cannot call external service with Request object"),new A("Currently, we only support fetch(<some_string>, ...).")}r(pe,"externalServiceHandler");async function fe(e,t){if(typeof e=="string"){let n=new URL(e),i=n.hostname,o=t??{},c=`http://${i}.zuplo.svc.cluster.local:9000`,s=new URL(`${c}${n.pathname}${n.search}`),l=new Headers(o.headers||{});return l.set(H,i),o.headers=l,await x(s.toString(),o)}else throw new A("Currently, we only support fetch(<some_string>, ...).")}r(fe,"clusterServiceHandler");async function pt(e,t,n,i){let o=e.toLowerCase(),c=t.toLowerCase(),s=n.toLowerCase(),l=de(i);b(`Hashing service name: ${c}-${o}.${c}-${s}-${l}`);let p=await Y(`${c}-${o}`),a=await Y(`${c}-${s}-${l}`);return`${p}.${a}`}r(pt,"hashServiceName");async function Y(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(c=>c.toString(16).padStart(2,"0")).join("").slice(0,-1)}r(Y,"hashSegment");function de(e){let t=e.toLowerCase();switch(t){case"production":case"preview":return t;default:return"working-copy"}}r(de,"sanitizeEnvironmentType");var q=new Map;q.set("service:",pe);q.set("local:",fe);var x=globalThis.fetch;function W(e,t){let{transformedInit:n,mtlsCertificate:i}=ft(t);if(typeof e=="string"){let o=new URL(e),c=q.get(o.protocol);return c?C(c(e,n),_.instance.isDeno):ge(e,n,i)}else return ge(e,n,i)}r(W,"internalFetch");globalThis.fetch=W;function ge(e,t,n){if(!n)return C(x(e,t),_.instance.isDeno);if(_.instance.isCloudflare){let o=_.instance.runtime[n];if(!o)throw new Error(`mTLS certificate binding '${n}' not found. Ensure the certificate is uploaded and properly configured.`);if(typeof o!="object"||typeof o.fetch!="function")throw new Error(`mTLS certificate binding '${n}' is not a valid mTLS certificate binding. Make sure it's configured as an mTLS certificate, not an environment variable.`);return C(o.fetch(e,t),_.instance.isDeno)}else if(_.instance.isDeno){let i=globalThis.managedDedicatedMtlsBindings?.[n];if(!i)throw new Error(`mTLS certificate binding '${n}' not found. Ensure the certificate is uploaded and properly configured.`);if(typeof i.fetch!="function")throw new Error(`mTLS certificate binding '${n}' is not a valid mTLS certificate binding.`);return C(i.fetch(e,t),!0)}else throw new Error("mTLS client certificates are not supported in this runtime environment")}r(ge,"performFetch");var ft=r(e=>{if(!e||e instanceof Request)return{transformedInit:e,mtlsCertificate:void 0};let t=e;if(!t.zuplo)return{transformedInit:e,mtlsCertificate:void 0};let n=t.zuplo.mtlsCertificate,i=e;return i.cf={cacheEverything:t.zuplo?.cacheEverything,cacheTtl:t.zuplo?.cacheTtlSeconds},delete e.zuplo,{transformedInit:e,mtlsCertificate:n}},"transformInit");var dt={console:{log:console.log.bind(console),info:console.info.bind(console),warn:console.warn.bind(console),error:console.error.bind(console),debug:console.debug.bind(console),assert:console.assert.bind(console),clear:console.clear.bind(console),count:console.count.bind(console),countReset:console.countReset.bind(console),dir:console.dir.bind(console),dirxml:console.dirxml.bind(console),group:console.group.bind(console),groupCollapsed:console.groupCollapsed.bind(console),groupEnd:console.groupEnd.bind(console),table:console.table.bind(console),time:console.time.bind(console),timeEnd:console.timeEnd.bind(console),timeLog:console.timeLog.bind(console),timeStamp:console.timeStamp.bind(console),trace:console.trace.bind(console),profile:console.profile.bind(console),profileEnd:console.profileEnd.bind(console)},fetch:W},I=dt;var J="2025-02-06",me=Object.freeze({none:{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1,escapeOpenApiPathCharacters:!1,delimitOpenApiPathParameters:!1,chainResponseSendingHooks:!1,return501ForUnsupportedHttpMethods:!1,improvedSchemaValidation:!1,serializeMcpParametersByStyle:!1,sanitizeMcpToolNames:!1,omitMcpFieldsNewerThanNegotiatedVersion:!1,treatBlankOptionalStringOptionsAsUnset:!1,mcpProtocolVersion20260728:!1,failMcpResourceReadsOnErrorStatus:!1,rejectInvalidMcpResourceUris:!1,mcpGatewaySpecCompliance:!1,mcpServerSpecCompliance:!1},"2023-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!1,doNotRunHooksOnSystemRoutes:!1,removeAllVendorHeadersExceptListed:!1,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1,escapeOpenApiPathCharacters:!1,delimitOpenApiPathParameters:!1,chainResponseSendingHooks:!1,return501ForUnsupportedHttpMethods:!1,improvedSchemaValidation:!1,serializeMcpParametersByStyle:!1,sanitizeMcpToolNames:!1,omitMcpFieldsNewerThanNegotiatedVersion:!1,treatBlankOptionalStringOptionsAsUnset:!1,mcpProtocolVersion20260728:!1,failMcpResourceReadsOnErrorStatus:!1,rejectInvalidMcpResourceUris:!1,mcpGatewaySpecCompliance:!1,mcpServerSpecCompliance:!1},"2024-01-15":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1,escapeOpenApiPathCharacters:!1,delimitOpenApiPathParameters:!1,chainResponseSendingHooks:!1,return501ForUnsupportedHttpMethods:!1,improvedSchemaValidation:!1,serializeMcpParametersByStyle:!1,sanitizeMcpToolNames:!1,omitMcpFieldsNewerThanNegotiatedVersion:!1,treatBlankOptionalStringOptionsAsUnset:!1,mcpProtocolVersion20260728:!1,failMcpResourceReadsOnErrorStatus:!1,rejectInvalidMcpResourceUris:!1,mcpGatewaySpecCompliance:!1,mcpServerSpecCompliance:!1},"2024-03-14":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!1,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1,escapeOpenApiPathCharacters:!1,delimitOpenApiPathParameters:!1,chainResponseSendingHooks:!1,return501ForUnsupportedHttpMethods:!1,improvedSchemaValidation:!1,serializeMcpParametersByStyle:!1,sanitizeMcpToolNames:!1,omitMcpFieldsNewerThanNegotiatedVersion:!1,treatBlankOptionalStringOptionsAsUnset:!1,mcpProtocolVersion20260728:!1,failMcpResourceReadsOnErrorStatus:!1,rejectInvalidMcpResourceUris:!1,mcpGatewaySpecCompliance:!1,mcpServerSpecCompliance:!1},"2024-09-02":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0,removeLegacyLogInitialization:!1,useForwardRedirectsPropOnUrlForwardHandler:!1,escapeOpenApiPathCharacters:!1,delimitOpenApiPathParameters:!1,chainResponseSendingHooks:!1,return501ForUnsupportedHttpMethods:!1,improvedSchemaValidation:!1,serializeMcpParametersByStyle:!1,sanitizeMcpToolNames:!1,omitMcpFieldsNewerThanNegotiatedVersion:!1,treatBlankOptionalStringOptionsAsUnset:!1,mcpProtocolVersion20260728:!1,failMcpResourceReadsOnErrorStatus:!1,rejectInvalidMcpResourceUris:!1,mcpGatewaySpecCompliance:!1,mcpServerSpecCompliance:!1},"2025-02-06":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0,removeLegacyLogInitialization:!0,useForwardRedirectsPropOnUrlForwardHandler:!0,escapeOpenApiPathCharacters:!0,delimitOpenApiPathParameters:!1,chainResponseSendingHooks:!1,return501ForUnsupportedHttpMethods:!1,improvedSchemaValidation:!1,serializeMcpParametersByStyle:!1,sanitizeMcpToolNames:!1,omitMcpFieldsNewerThanNegotiatedVersion:!1,treatBlankOptionalStringOptionsAsUnset:!1,mcpProtocolVersion20260728:!1,failMcpResourceReadsOnErrorStatus:!1,rejectInvalidMcpResourceUris:!1,mcpGatewaySpecCompliance:!1,mcpServerSpecCompliance:!1},"2026-03-01":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0,removeLegacyLogInitialization:!0,useForwardRedirectsPropOnUrlForwardHandler:!0,escapeOpenApiPathCharacters:!0,delimitOpenApiPathParameters:!1,chainResponseSendingHooks:!0,return501ForUnsupportedHttpMethods:!0,improvedSchemaValidation:!1,serializeMcpParametersByStyle:!1,sanitizeMcpToolNames:!1,omitMcpFieldsNewerThanNegotiatedVersion:!1,treatBlankOptionalStringOptionsAsUnset:!1,mcpProtocolVersion20260728:!1,failMcpResourceReadsOnErrorStatus:!1,rejectInvalidMcpResourceUris:!1,mcpGatewaySpecCompliance:!1,mcpServerSpecCompliance:!1},"2026-11-06":{runOutboundPoliciesOnHandlerOnAllStatuses:!0,doNotRunHooksOnSystemRoutes:!0,removeAllVendorHeadersExceptListed:!0,allowCustomPorts:!0,removeLegacyLogInitialization:!0,useForwardRedirectsPropOnUrlForwardHandler:!0,escapeOpenApiPathCharacters:!0,delimitOpenApiPathParameters:!0,chainResponseSendingHooks:!0,return501ForUnsupportedHttpMethods:!0,improvedSchemaValidation:!0,serializeMcpParametersByStyle:!0,sanitizeMcpToolNames:!0,omitMcpFieldsNewerThanNegotiatedVersion:!0,treatBlankOptionalStringOptionsAsUnset:!0,mcpProtocolVersion20260728:!0,failMcpResourceReadsOnErrorStatus:!0,rejectInvalidMcpResourceUris:!0,mcpGatewaySpecCompliance:!0,mcpServerSpecCompliance:!0}});function _e(e={}){let{runtime:t="cloudflare"}=e;return new _({build:{ACCOUNT_NAME:"mock-account-name",PROJECT_NAME:"mock-project-name",API_VERSION:"0.0.0",BUILD_ID:crypto.randomUUID(),TIMESTAMP:new Date().toISOString(),BUILD_ENV:"test",ZUPLO_VERSION:"0.0.0",COMPATIBILITY_DATE:J,ENVIRONMENT_TYPE:"mock-environment-type",GIT_SHA:void 0,IS_LOCAL_DEVELOPMENT:!1,COMPATIBILITY_FLAGS:me[J]},runtime:{RUNTIME_ENV:"test",RUNTIME_STAGE:"test",__ZUPLO_DEPLOYMENT_NAME:"mock-deployment-name",__ZUPLO_LOG_LEVEL:"debug",__ZUPLO_LOG_FORMAT:"pretty",__ZUPLO_MANAGEMENT_API_URL:"",__ZUPLO_RUNTIME_TYPE:t,__ZUPLO_AUTH_API_JWT:"",ZUPLO_SERVICE_BUCKET_ID:"bckt_mock"}})}r(_e,"getMockEnvironment");var gt=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function mt(e,t){let n=e.__ZUPLO_TRUSTED_IP_HEADER?.trim();if(!n)return t?v:X;if(!gt.test(n))throw new w(`__ZUPLO_TRUSTED_IP_HEADER is set to '${n}', which is not a valid HTTP header name. Header names may only contain the RFC 9110 token characters (letters, digits, and !#$%&'*+-.^_\`|~) - spaces, colons and tabs are not allowed. Set it to a valid header name such as '${v}' or 'cf-connecting-ip'.`);return n.toLowerCase()}r(mt,"resolveTrustedIpHeader");var _=class e{static{r(this,"Environment")}config;#n;static#e;static#t=!1;static initialize(t){e.#e||(e.#e=new e(t),e.#t=!0)}static get instance(){return e.#t||(I.console.debug("Environment has not been initialized. This is okay when running tests, a mock environment will be used."),e.#e??=_e(),e.#t=!0),e.#e}constructor({build:t,runtime:n}){let i;try{if(n.ZUPLO_SYSTEM_CONFIGURATIONS){let o=new TextDecoder().decode(ue.decode(n.ZUPLO_SYSTEM_CONFIGURATIONS)),c=JSON.parse(o);for(let s of Object.keys(c))n[s]||(n[s]=c[s])}if(n.__ZUPLO_CONFIG){let o=atob(n.__ZUPLO_CONFIG);i=JSON.parse(o)}}catch(o){I.console.error("Failed to parse runtime configuration",o)}this.config=i??{},this.build=t,this.runtime=n,this.instanceId=crypto.randomUUID(),this.#n=mt(n,this.isCloudflare)}build;runtime;instanceId;get deploymentName(){return this.runtime.__ZUPLO_DEPLOYMENT_NAME??this.config.deployment_name??void 0}get accountName(){return this.build.ACCOUNT_NAME??this.runtime.ZUPLO_ACCOUNT_NAME??void 0}get projectName(){return this.build.PROJECT_NAME??this.runtime.ZUPLO_PROJECT_NAME??void 0}get useLegacyServiceRouting(){return this.config.use_legacy_service_routing??void 0}get useProxyForFetchFromZups(){return this.config.use_proxy_for_fetch_from_zups??void 0}get devPortalBaseUrl(){return this.runtime.__ZUPLO_DEV_PORTAL_URL??this.config.dev_portal_url??"https://dev-portal-v4-1.zuplo.com"}get buildAssetsUrl(){return this.runtime.__ZUPLO_BUILD_ASSETS_URL??this.config.build_assets_url??"https://build-assets.zuplo.com"}get zuploEdgeApiUrl(){return this.runtime.__ZUPLO_EDGE_API_URL??this.config.zuplo_edge_api_url??"https://api.zuploedge.com"}get remoteLogToken(){return this.runtime.__ZUPLO_REMOTE_LOG_TOKEN??this.config.remote_log_token??void 0}get zuploClientAuthBucketId(){return this.config.zuplo_auth_client_bucket_id??"auth_o8PUdhKxSTOiB794GWPwLQCD"}get managementApiURL(){return this.runtime.__ZUPLO_MANAGEMENT_API_URL??this.config.management_api_url??"https://api.zuplo.com"}get developerApiUrl(){return this.config.developer_api_url??"https://dev.zuplo.com"}get cdnURL(){return this.runtime.__ZUPLO_CDN_URL??this.config.cdn_url??"https://cdn.zuplo.com"}get remoteLogURL(){return this.runtime.__ZUPLO_REMOTE_LOG_URL??this.config.log_event_api??"https://ellie.zuploedge.com"}get loggingId(){return this.runtime.__ZUPLO_LOGGING_ID??this.config.logging_id??void 0}get redisURL(){return this.runtime.__ZUPLO_REDIS_URL??this.config.redis_proxy_url??"https://redis-proxy.zuploedge.com"}get apiKeyServiceUrl(){return this.runtime.__ZUPLO_API_KEY_SERVICE_URL??this.config.api_key_service_url??"https://apikey.zuploedge.com"}get meteringServiceUrl(){return this.config.metering_service_url??"https://meters.zuploedge.com"}get authApiJWT(){return this.runtime.__ZUPLO_AUTH_API_JWT??void 0}get authClientId(){return this.config.auth_client_id??this.runtime.__ZUPLO_AUTH_CLIENT_ID}get authClientSecret(){return this.config.auth_client_secret??this.runtime.__ZUPLO_AUTH_CLIENT_SECRET}get authPublicKey(){return this.config.auth_public_key??this.runtime.__ZUPLO_AUTH_PUBLIC_KEY}get authPrivateKey(){return this.config.auth_private_key??this.runtime.__ZUPLO_AUTH_PRIVATE_KEY}get userLogLevel(){return this.runtime.ZUPLO_LOG_LEVEL??this.runtime.__ZUPLO_LOG_LEVEL??this.config.user_log_level??"debug"}get systemLogLevel(){return this.runtime.__ZUPLO_LOG_LEVEL??this.config.system_log_level??"debug"}get logFormat(){return this.runtime.__ZUPLO_LOG_FORMAT??this.config.log_format??"cloudflare"}get isCloudflare(){return this.runtime.__ZUPLO_RUNTIME_TYPE?this.runtime.__ZUPLO_RUNTIME_TYPE==="cloudflare":this.config.runtime_type?this.config.runtime_type==="cloudflare":typeof WebSocketPair=="function"}get isManagedDedicated(){return this.runtime.__ZUPLO_IS_MANAGED_DEDICATED==="true"}get trustedIpHeader(){return this.#n}get isDeno(){if(this.runtime.__ZUPLO_RUNTIME_TYPE)return this.runtime.__ZUPLO_RUNTIME_TYPE==="deno";if(this.config.runtime_type)return this.config.runtime_type==="deno";{let t=globalThis.Deno?.version?.deno;return typeof WebSocketPair!="function"&&t}}get isLocalDevelopment(){return this.build.IS_LOCAL_DEVELOPMENT}get isTestMode(){return!!this.runtime.__ZUPLO_TEST_MODE}get budgetRulesCaptureDisabled(){return this.runtime.__ZUPLO_BUDGET_RULES_CAPTURE==="off"}get budgetDimensionLogValuesEnabled(){return this.runtime.__ZUPLO_BUDGET_DIMENSION_LOG_VALUES==="on"}get systemUserAgent(){return`Zuplo/${this.build.ZUPLO_VERSION}`}get loggingEnvironmentType(){return this.isCloudflare?"edge":this.isLocalDevelopment?"local":this.isDeno?"working-copy":"unknown"}get loggingEnvironmentStage(){return this.build.ENVIRONMENT_TYPE==="PRODUCTION"?"production":this.build.ENVIRONMENT_TYPE==="PREVIEW"?"preview":this.isLocalDevelopment?"local":this.isWorkingCopy?"working-copy":"unknown"}get isWorkingCopy(){return this.build.ENVIRONMENT_TYPE==="WORKING_COPY"}get rateLimitServiceTimeoutMs(){let t=this.runtime.__ZUPLO_RATE_LIMIT_TIMEOUT_MS,n=this.config.rate_limit_service_timeout_ms,i=t??n;if(!i)return 500;let o=Number(i);return Number.isFinite(o)&&o>0?o:500}};export{w as a,N as b,A as c,K as d,ce as e,ht as f,Ee as g,he as h,Re as i,Rt as j,Ot as k,yt as l,Oe as m,ye as n,Ae as o,Se as p,Te as q,At as r,St as s,Tt as t,bt as u,Pt as v,Lt as w,Ct as x,xt as y,It as z,Ut as A,X as B,be as C,Pe as D,Le as E,Ce as F,xe as G,Ie as H,Ue as I,we as J,Ne as K,Me as L,De as M,ve as N,He as O,ze as P,Fe as Q,Ze as R,wt as S,H as T,Ve as U,ke as V,Nt as W,Mt as X,Dt as Y,vt as Z,Ht as _,_ as $,I as aa};
|
|
36
|
-
/*! For license information please see chunk-2HVCLUM4.js.LEGAL.txt */
|
|
37
|
-
//# sourceMappingURL=chunk-2HVCLUM4.js.map
|