@zuplo/cli 7.15.0 → 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 +236 -0
- package/LICENSE.txt +5 -78
- package/README.md +18 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -0
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +2 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@posthog/core/dist/privacy.d.ts +6 -1
- package/node_modules/@posthog/core/dist/privacy.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/privacy.js +69 -10
- package/node_modules/@posthog/core/dist/privacy.mjs +65 -9
- package/node_modules/@posthog/core/dist/traces/span.d.ts +6 -0
- package/node_modules/@posthog/core/dist/traces/span.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/traces/span.js +18 -0
- package/node_modules/@posthog/core/dist/traces/span.mjs +18 -0
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/privacy.ts +100 -18
- package/node_modules/@posthog/core/src/traces/span.spec.ts +15 -1
- package/node_modules/@posthog/core/src/traces/span.ts +23 -0
- package/node_modules/@posthog/types/dist/traces.d.ts +10 -0
- package/node_modules/@posthog/types/dist/traces.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/traces.ts +12 -0
- package/node_modules/@zuplo/core/LICENSE.third-party.txt +622 -0
- package/node_modules/@zuplo/core/LICENSE.txt +5 -78
- package/node_modules/@zuplo/core/README.md +7 -0
- package/node_modules/@zuplo/core/constants.minified.js +7 -20
- package/node_modules/@zuplo/core/customer.cli.minified.js +28 -41
- package/node_modules/@zuplo/core/index.minified.js +35 -48
- package/node_modules/@zuplo/core/package.json +4 -2
- package/node_modules/@zuplo/core/zeno.js +7 -20
- package/node_modules/@zuplo/graphql/LICENSE.third-party.txt +29 -0
- package/node_modules/@zuplo/graphql/LICENSE.txt +5 -78
- package/node_modules/@zuplo/graphql/README.md +7 -0
- package/node_modules/@zuplo/graphql/out/esm/index.js +7 -20
- package/node_modules/@zuplo/graphql/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/graphql/package.json +3 -2
- package/node_modules/@zuplo/openapi-tools/LICENSE.txt +7 -0
- package/node_modules/@zuplo/openapi-tools/README.md +7 -0
- package/node_modules/@zuplo/openapi-tools/package.json +3 -2
- package/node_modules/@zuplo/otel/LICENSE.third-party.txt +243 -0
- package/node_modules/@zuplo/otel/LICENSE.txt +5 -78
- package/node_modules/@zuplo/otel/README.md +33 -0
- package/node_modules/@zuplo/otel/out/esm/chunk-6YAK7LGJ.js +13 -0
- package/node_modules/@zuplo/otel/out/esm/chunk-6YAK7LGJ.js.map +1 -0
- package/node_modules/@zuplo/otel/out/esm/index.js +8 -21
- package/node_modules/@zuplo/otel/out/types/index.d.ts +41 -0
- package/node_modules/@zuplo/otel/package.json +3 -2
- package/node_modules/@zuplo/runtime/LICENSE.third-party.txt +511 -0
- package/node_modules/@zuplo/runtime/LICENSE.txt +5 -78
- package/node_modules/@zuplo/runtime/README.md +7 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-5JGLAPFA.js +13 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-5JGLAPFA.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-SX6JF7A6.js → chunk-AJ3MMWJS.js} +9 -22
- package/node_modules/@zuplo/runtime/out/esm/chunk-AJ3MMWJS.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-BH4DKEES.js +13 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-BH4DKEES.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-G42UYZ6V.js +24 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-M4IZPJP6.js.map → chunk-G42UYZ6V.js.map} +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-OE2WMJXK.js +431 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-OE2WMJXK.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-R6UNMRUU.js +13 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-R6UNMRUU.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-GWGCD6Z7.js → chunk-T2WKOG7J.js} +9 -22
- package/node_modules/@zuplo/runtime/out/esm/chunk-T2WKOG7J.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-HTXNM72E.js → chunk-TOJD4RET.js} +9 -22
- package/node_modules/@zuplo/runtime/out/esm/chunk-TOJD4RET.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-VXPFMOL5.js +13 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-VXPFMOL5.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +8 -21
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/internal/index.js +8 -21
- package/node_modules/@zuplo/runtime/out/esm/mcp/messages/index.js +8 -21
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +11 -39
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +8 -21
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +8 -21
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +248 -6
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +101 -0
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +127 -0
- package/node_modules/@zuplo/runtime/package.json +3 -2
- package/node_modules/express-rate-limit/dist/index.cjs +33 -4
- package/node_modules/express-rate-limit/dist/index.mjs +33 -4
- package/node_modules/express-rate-limit/package.json +1 -1
- package/package.json +12 -11
- package/node_modules/@zuplo/otel/out/esm/chunk-PVCAT62X.js +0 -26
- package/node_modules/@zuplo/otel/out/esm/chunk-PVCAT62X.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-A3QGJZO7.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-A3QGJZO7.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-F4G3YEN2.js +0 -429
- package/node_modules/@zuplo/runtime/out/esm/chunk-F4G3YEN2.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-GWGCD6Z7.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-HTXNM72E.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-M4IZPJP6.js +0 -37
- package/node_modules/@zuplo/runtime/out/esm/chunk-SX6JF7A6.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-TYV53J3B.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-TYV53J3B.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-UKQQD2JN.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-UKQQD2JN.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-VP5Q3DEN.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-VP5Q3DEN.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-M4IZPJP6.js.LEGAL.txt → chunk-G42UYZ6V.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-F4G3YEN2.js.LEGAL.txt → chunk-OE2WMJXK.js.LEGAL.txt} +0 -0
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
*
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Zuplo, Inc. All rights reserved.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Development Devices solely for the above stated purpose.
|
|
5
|
+
* Use of this software is governed by the Zuplo Terms of Service at
|
|
6
|
+
* https://zuplo.com/legal/terms, or by a separate agreement your company has
|
|
7
|
+
* signed with Zuplo.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
|
|
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
* See https://zuplo.com/legal/eula for more information.
|
|
10
|
+
*/
|
|
24
11
|
|
|
25
|
-
import{
|
|
12
|
+
import{P as p,V as c,Z as u}from"../chunk-OE2WMJXK.js";import"../chunk-BH4DKEES.js";import{a as d}from"../chunk-T2WKOG7J.js";import"../chunk-R6UNMRUU.js";import"../chunk-AJ3MMWJS.js";import"../chunk-5JGLAPFA.js";import{Y as i}from"../chunk-G42UYZ6V.js";import{a as o}from"../chunk-VXPFMOL5.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
|
|
26
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@zuplo/runtime/mocks/context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@zuplo/runtime/mocks/context.ts"],"mappings":"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","names":["createMockContext","options","waitUntilPromises","waitUntil","promise","__name","MockZuploContext","DEFAULT_ROUTE_CONFIG","#event","#originalRequest","event","route","parentContext","originalRequest","internals_default","ZuploGatewayAnalyticsContext","policyName","request","response","input","init","hook","handler","ext","ZuploContextExtensions","ZuploRequest","registerPreRequestHandler","entry","type","wrapped","e","err"]}
|
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
*
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Zuplo, Inc. All rights reserved.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Development Devices solely for the above stated purpose.
|
|
5
|
+
* Use of this software is governed by the Zuplo Terms of Service at
|
|
6
|
+
* https://zuplo.com/legal/terms, or by a separate agreement your company has
|
|
7
|
+
* signed with Zuplo.
|
|
9
8
|
*
|
|
10
|
-
*
|
|
11
|
-
|
|
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
9
|
+
* See https://zuplo.com/legal/eula for more information.
|
|
10
|
+
*/
|
|
24
11
|
|
|
25
|
-
import{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-
|
|
12
|
+
import{H as a,I as l,J as c,K as o,N as p,O as y,P as m}from"../../chunk-AJ3MMWJS.js";import"../../chunk-5JGLAPFA.js";import"../../chunk-G42UYZ6V.js";import{a as i}from"../../chunk-VXPFMOL5.js";async function g(r,e){let t=typeof e.credentials=="function"?await e.credentials():e.credentials,n=r.method,d=n!=="GET"&&n!=="HEAD"&&r.body!=null?await r.arrayBuffer():null,s=await new o({method:n,url:r.url,headers:r.headers,body:d,accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,service:e.service,region:e.region,signQuery:e.signQuery}).sign();return new Request(s.url.toString(),{method:s.method,headers:s.headers,body:s.body})}i(g,"signRequest");export{c as AwsClient,o as AwsV4Signer,p as fromTemporaryCredentials,y as fromWebToken,m as fromZuploIdentity,l as getAwsCredentialProvider,a as setAwsCredentialProvider,g as signRequest};
|
|
26
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@zuplo/runtime/sdks/aws/sign.ts"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@zuplo/runtime/sdks/aws/sign.ts"],"mappings":";;;;;;;;;;;kMAiDA,eAAsBA,EACpBC,EACAC,EACkB,CAClB,IAAMC,EACJ,OAAOD,EAAQ,aAAgB,WAC3B,MAAMA,EAAQ,YAAY,EAC1BA,EAAQ,YAERE,EAASH,EAAQ,OAEjBI,EADUD,IAAW,OAASA,IAAW,QAAUH,EAAQ,MAAQ,KAClD,MAAMA,EAAQ,YAAY,EAAI,KAe/CK,EAAS,MAbA,IAAIC,EAAY,CAC7B,OAAAH,EACA,IAAKH,EAAQ,IACb,QAASA,EAAQ,QACjB,KAAAI,EACA,YAAaF,EAAY,YACzB,gBAAiBA,EAAY,gBAC7B,aAAcA,EAAY,aAC1B,QAASD,EAAQ,QACjB,OAAQA,EAAQ,OAChB,UAAWA,EAAQ,SACrB,CAAC,EAE2B,KAAK,EAEjC,OAAO,IAAI,QAAQI,EAAO,IAAI,SAAS,EAAG,CACxC,OAAQA,EAAO,OACf,QAASA,EAAO,QAChB,KAAMA,EAAO,IACf,CAAC,CACH,CAjCsBE,EAAAR,EAAA","names":["signRequest","request","options","credentials","method","body","signed","AwsV4Signer","__name"]}
|
|
@@ -5085,6 +5085,91 @@ export declare interface CorsPolicyConfiguration {
|
|
|
5085
5085
|
exposeHeaders?: string[] | string;
|
|
5086
5086
|
}
|
|
5087
5087
|
|
|
5088
|
+
/* Excluded from this release type: createRedactionBudget */
|
|
5089
|
+
|
|
5090
|
+
/**
|
|
5091
|
+
* Create a {@link TelemetryRedactor} from the Data Loss Prevention
|
|
5092
|
+
* recognizers, plus query parameter and field name rules. Register it with
|
|
5093
|
+
* `runtime.addTelemetryRedactor` in `zuplo.runtime.ts`.
|
|
5094
|
+
*
|
|
5095
|
+
* Pattern matching cannot find every form sensitive data takes. Add your own
|
|
5096
|
+
* redactor for data specific to your API.
|
|
5097
|
+
*
|
|
5098
|
+
* @example
|
|
5099
|
+
* ```ts
|
|
5100
|
+
* import { RuntimeExtensions, createRedactor } from "@zuplo/runtime";
|
|
5101
|
+
*
|
|
5102
|
+
* export function runtimeInit(runtime: RuntimeExtensions) {
|
|
5103
|
+
* runtime.addTelemetryRedactor(
|
|
5104
|
+
* createRedactor({
|
|
5105
|
+
* entities: ["pii", "secret"],
|
|
5106
|
+
* queryParameters: ["ssn", "account_number"],
|
|
5107
|
+
* fieldNames: ["password"],
|
|
5108
|
+
* })
|
|
5109
|
+
* );
|
|
5110
|
+
* }
|
|
5111
|
+
* ```
|
|
5112
|
+
*
|
|
5113
|
+
* @throws {@link ConfigurationError} when an option is invalid: an unknown
|
|
5114
|
+
* entity, a custom pattern that is not a valid regular expression, a
|
|
5115
|
+
* `minConfidence` outside 0 to 1, or a non-string `replacement`. A typo must
|
|
5116
|
+
* not silently turn redaction off.
|
|
5117
|
+
*
|
|
5118
|
+
* @public
|
|
5119
|
+
*/
|
|
5120
|
+
export declare function createRedactor(
|
|
5121
|
+
options: CreateRedactorOptions
|
|
5122
|
+
): TelemetryRedactor;
|
|
5123
|
+
|
|
5124
|
+
/**
|
|
5125
|
+
* Options for {@link createRedactor}. Every option is off unless set.
|
|
5126
|
+
* @public
|
|
5127
|
+
*/
|
|
5128
|
+
export declare interface CreateRedactorOptions {
|
|
5129
|
+
/**
|
|
5130
|
+
* Built-in Data Loss Prevention recognizers to run on every value: ids
|
|
5131
|
+
* such as `"finance-credit-card"` or `"id-us-ssn"`, a group such as
|
|
5132
|
+
* `"pii"`, `"secret"` or `"region-eu"`, or an id prefix such as `"id-us"`.
|
|
5133
|
+
* These are the same names the Data Loss Prevention policies accept in
|
|
5134
|
+
* their `entities` option. When omitted, no built-in recognizer runs.
|
|
5135
|
+
*/
|
|
5136
|
+
entities?: string[];
|
|
5137
|
+
/**
|
|
5138
|
+
* Your own regular expression recognizers, in the same form as the Data
|
|
5139
|
+
* Loss Prevention policies' `customPatterns` option.
|
|
5140
|
+
*/
|
|
5141
|
+
customPatterns?: RedactorCustomPattern[];
|
|
5142
|
+
/**
|
|
5143
|
+
* Minimum confidence (0 to 1) a match needs to be redacted. Defaults to
|
|
5144
|
+
* 0.5, the same as the Data Loss Prevention policies.
|
|
5145
|
+
*/
|
|
5146
|
+
minConfidence?: number;
|
|
5147
|
+
/**
|
|
5148
|
+
* Matched text that is never redacted, compared exactly
|
|
5149
|
+
* (case-sensitive, separators included), for example a test card number.
|
|
5150
|
+
*/
|
|
5151
|
+
allowValues?: string[];
|
|
5152
|
+
/**
|
|
5153
|
+
* Redact the values of these query parameters wherever a query string
|
|
5154
|
+
* appears: request URLs, span attributes such as `url.full`, and URLs
|
|
5155
|
+
* inside log messages. Names match case-insensitively, after decoding.
|
|
5156
|
+
*/
|
|
5157
|
+
queryParameters?: string[];
|
|
5158
|
+
/**
|
|
5159
|
+
* Redact every value under a property whose name is in this list, for
|
|
5160
|
+
* example `["password", "dob"]`: a string or number directly under the
|
|
5161
|
+
* name, and every value nested in an object or array under it, such as
|
|
5162
|
+
* `{ card: { number: "…" } }` for `"card"`. Names match
|
|
5163
|
+
* case-insensitively. Property names themselves are recorded as written.
|
|
5164
|
+
*/
|
|
5165
|
+
fieldNames?: string[];
|
|
5166
|
+
/**
|
|
5167
|
+
* The text recorded in place of a match. It is used literally. Defaults
|
|
5168
|
+
* to `"[REDACTED]"`.
|
|
5169
|
+
*/
|
|
5170
|
+
replacement?: string;
|
|
5171
|
+
}
|
|
5172
|
+
|
|
5088
5173
|
declare class Cron {
|
|
5089
5174
|
readonly seconds: readonly number[];
|
|
5090
5175
|
readonly minutes: readonly number[];
|
|
@@ -6540,6 +6625,8 @@ export declare interface HandlerDefinition {
|
|
|
6540
6625
|
options?: unknown;
|
|
6541
6626
|
}
|
|
6542
6627
|
|
|
6628
|
+
/* Excluded from this release type: hasTelemetryRedactors */
|
|
6629
|
+
|
|
6543
6630
|
/**
|
|
6544
6631
|
* Request header authentication.
|
|
6545
6632
|
* @public
|
|
@@ -8883,9 +8970,9 @@ declare interface JevTypeSafe {
|
|
|
8883
8970
|
declare type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
8884
8971
|
|
|
8885
8972
|
/**
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8973
|
+
Matches a JSON object.
|
|
8974
|
+
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
|
|
8975
|
+
*/
|
|
8889
8976
|
declare type JsonObject = {
|
|
8890
8977
|
[Key in string]: JsonValue;
|
|
8891
8978
|
} & {
|
|
@@ -8895,9 +8982,9 @@ declare type JsonObject = {
|
|
|
8895
8982
|
declare type JsonPrimitive = string | number | boolean | null;
|
|
8896
8983
|
|
|
8897
8984
|
/**
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8985
|
+
Matches any valid JSON value.
|
|
8986
|
+
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
|
|
8987
|
+
*/
|
|
8901
8988
|
declare type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
8902
8989
|
|
|
8903
8990
|
/**
|
|
@@ -13752,6 +13839,98 @@ export declare function recordGraphqlCacheState(
|
|
|
13752
13839
|
cacheState: GraphqlCacheState
|
|
13753
13840
|
): void;
|
|
13754
13841
|
|
|
13842
|
+
/**
|
|
13843
|
+
* The value recorded in place of one the redactor failed on.
|
|
13844
|
+
* @public
|
|
13845
|
+
*/
|
|
13846
|
+
export declare const REDACTION_FAILED_PLACEHOLDER = "[REDACTION_FAILED]";
|
|
13847
|
+
|
|
13848
|
+
/* Excluded from this release type: RedactionBudget */
|
|
13849
|
+
|
|
13850
|
+
/**
|
|
13851
|
+
* Describes the value a {@link TelemetryRedactor} is asked to redact.
|
|
13852
|
+
*
|
|
13853
|
+
* @public
|
|
13854
|
+
*/
|
|
13855
|
+
export declare interface RedactionContext {
|
|
13856
|
+
/**
|
|
13857
|
+
* The kind of record the value is written to.
|
|
13858
|
+
*/
|
|
13859
|
+
readonly kind: RedactionRecordKind;
|
|
13860
|
+
/**
|
|
13861
|
+
* The path of the value in the record, for example `message[0]`,
|
|
13862
|
+
* `message[1].user.email`, `properties.customerId`, `attributes.http.url`,
|
|
13863
|
+
* `events[0].attributes.exception.message` or `url`.
|
|
13864
|
+
*/
|
|
13865
|
+
readonly field: string;
|
|
13866
|
+
/**
|
|
13867
|
+
* The last property name in {@link RedactionContext.field}, for example `email`
|
|
13868
|
+
* or `http.url`. `undefined` when the value is not a property of an object
|
|
13869
|
+
* (a log message string, an array element, a span name).
|
|
13870
|
+
*/
|
|
13871
|
+
readonly key: string | undefined;
|
|
13872
|
+
/**
|
|
13873
|
+
* Every property name on the way from the record to the value, outermost
|
|
13874
|
+
* first: `["user", "email"]` for `message[1].user.email`, `["dob"]` for
|
|
13875
|
+
* `message[1].dob[0]`. Array indices are left out, so a value in an array
|
|
13876
|
+
* keeps the name the array is under. When {@link RedactionContext.key} is
|
|
13877
|
+
* set, it is the last entry. Empty for a value with no property name above
|
|
13878
|
+
* it (a log message string, a span name).
|
|
13879
|
+
*/
|
|
13880
|
+
readonly keys: readonly string[];
|
|
13881
|
+
}
|
|
13882
|
+
|
|
13883
|
+
/**
|
|
13884
|
+
* The kind of record a value is about to be written to.
|
|
13885
|
+
*
|
|
13886
|
+
* - `log`: a log entry from `context.log`, `console.*` in customer code, or the
|
|
13887
|
+
* gateway's own request logs. Goes to Zuplo's log pipeline and to every
|
|
13888
|
+
* configured log integration.
|
|
13889
|
+
* - `span`: an OpenTelemetry span: its name, attributes, events and status.
|
|
13890
|
+
* - `analytics`: the URL and customer-set properties on the per-request
|
|
13891
|
+
* analytics row (also sent to metrics plugins), and URL fields of analytics
|
|
13892
|
+
* events. Fields that usage and billing are computed from are never
|
|
13893
|
+
* redacted.
|
|
13894
|
+
* - `request-log`: an entry produced by a request logger plugin (Azure Blob,
|
|
13895
|
+
* Azure Event Hubs, Hydrolix).
|
|
13896
|
+
* - `audit-log`: an event recorded by the Audit Log policy.
|
|
13897
|
+
*
|
|
13898
|
+
* @public
|
|
13899
|
+
*/
|
|
13900
|
+
export declare type RedactionRecordKind =
|
|
13901
|
+
| "log"
|
|
13902
|
+
| "span"
|
|
13903
|
+
| "analytics"
|
|
13904
|
+
| "request-log"
|
|
13905
|
+
| "audit-log";
|
|
13906
|
+
|
|
13907
|
+
/**
|
|
13908
|
+
* A regular expression recognizer for {@link createRedactor}, in the same
|
|
13909
|
+
* form as the Data Loss Prevention policies' `customPatterns` entries.
|
|
13910
|
+
* @public
|
|
13911
|
+
*/
|
|
13912
|
+
export declare interface RedactorCustomPattern {
|
|
13913
|
+
/** A name for the pattern, used in configuration errors. */
|
|
13914
|
+
name: string;
|
|
13915
|
+
/** A JavaScript regular expression source string. */
|
|
13916
|
+
pattern: string;
|
|
13917
|
+
/**
|
|
13918
|
+
* Base confidence (0 to 1) for matches. Defaults to 0.85, above the
|
|
13919
|
+
* default `minConfidence`.
|
|
13920
|
+
*/
|
|
13921
|
+
confidence?: number;
|
|
13922
|
+
/**
|
|
13923
|
+
* Words that raise a match's confidence when they appear near it in the
|
|
13924
|
+
* same value. Use with a low `confidence` for values that are sensitive
|
|
13925
|
+
* only in context.
|
|
13926
|
+
*/
|
|
13927
|
+
context?: string[];
|
|
13928
|
+
}
|
|
13929
|
+
|
|
13930
|
+
/* Excluded from this release type: redactTelemetryAttributes */
|
|
13931
|
+
|
|
13932
|
+
/* Excluded from this release type: redactTelemetryString */
|
|
13933
|
+
|
|
13755
13934
|
/**
|
|
13756
13935
|
* Handler that returns HTTP redirects.
|
|
13757
13936
|
* Useful for URL shortening, legacy URL handling, or routing to external services.
|
|
@@ -14609,6 +14788,29 @@ export declare interface RuntimeExtensions {
|
|
|
14609
14788
|
* @param hook - The pre-routing hook function
|
|
14610
14789
|
*/
|
|
14611
14790
|
addPreRoutingHook(hook: PreRoutingHook): void;
|
|
14791
|
+
/**
|
|
14792
|
+
* Add a redactor that redacts sensitive data before Zuplo records it.
|
|
14793
|
+
*
|
|
14794
|
+
* Request content the gateway records passes through the registered
|
|
14795
|
+
* redactors first: log entries (messages, structured fields, errors, log
|
|
14796
|
+
* properties), OpenTelemetry spans (names, attributes, events, status), the
|
|
14797
|
+
* URL and custom properties on the per-request analytics row, request
|
|
14798
|
+
* logger plugin entries and Audit Log policy events. The fields usage and
|
|
14799
|
+
* billing are computed from (route pattern, method, status, consumer) are
|
|
14800
|
+
* never redacted. Redactors run in the order they are added. With none
|
|
14801
|
+
* added, nothing is redacted and nothing changes.
|
|
14802
|
+
*
|
|
14803
|
+
* Call it only in `runtimeInit`; calls after startup throw. At most 16
|
|
14804
|
+
* redactors can be registered.
|
|
14805
|
+
*
|
|
14806
|
+
* If a redactor throws or returns something other than a string, the value
|
|
14807
|
+
* is recorded as `"[REDACTION_FAILED]"` and a warning, without the value, is
|
|
14808
|
+
* written to the request log at most once a minute.
|
|
14809
|
+
*
|
|
14810
|
+
* @param redactor - The redactor function. Use `createRedactor` for
|
|
14811
|
+
* built-in patterns.
|
|
14812
|
+
*/
|
|
14813
|
+
addTelemetryRedactor(redactor: TelemetryRedactor): void;
|
|
14612
14814
|
}
|
|
14613
14815
|
|
|
14614
14816
|
/**
|
|
@@ -15341,6 +15543,46 @@ export declare abstract class TelemetryPlugin extends RuntimePlugin {
|
|
|
15341
15543
|
/* Excluded from this release type: instrument */
|
|
15342
15544
|
}
|
|
15343
15545
|
|
|
15546
|
+
/**
|
|
15547
|
+
* A function that redacts sensitive data from a value before Zuplo records
|
|
15548
|
+
* it. Return the value to record: the input unchanged, or a redacted copy.
|
|
15549
|
+
*
|
|
15550
|
+
* The function runs synchronously on the request path for every string (and
|
|
15551
|
+
* every number, as its decimal string) the gateway records, so keep it fast.
|
|
15552
|
+
* It must be pure: the same input and context must always give the same
|
|
15553
|
+
* output, because results for short values are cached and reused. Values over
|
|
15554
|
+
* 32,768 characters are cut to that length before the function sees them.
|
|
15555
|
+
* Anything the function logs is dropped.
|
|
15556
|
+
* If it throws, or returns something other than a string, the value is
|
|
15557
|
+
* replaced with `"[REDACTION_FAILED]"` and the failure is recorded without the
|
|
15558
|
+
* value.
|
|
15559
|
+
*
|
|
15560
|
+
* @example
|
|
15561
|
+
* ```ts
|
|
15562
|
+
* import { RuntimeExtensions, createRedactor } from "@zuplo/runtime";
|
|
15563
|
+
*
|
|
15564
|
+
* export function runtimeInit(runtime: RuntimeExtensions) {
|
|
15565
|
+
* // Built-in patterns
|
|
15566
|
+
* runtime.addTelemetryRedactor(
|
|
15567
|
+
* createRedactor({
|
|
15568
|
+
* entities: ["finance-credit-card", "id-us-ssn"],
|
|
15569
|
+
* queryParameters: ["ssn", "card_number"],
|
|
15570
|
+
* })
|
|
15571
|
+
* );
|
|
15572
|
+
*
|
|
15573
|
+
* // A custom rule: drop the value of any field named "dob"
|
|
15574
|
+
* runtime.addTelemetryRedactor((value, { key }) =>
|
|
15575
|
+
* key === "dob" ? "[REDACTED]" : value
|
|
15576
|
+
* );
|
|
15577
|
+
* }
|
|
15578
|
+
* ```
|
|
15579
|
+
*
|
|
15580
|
+
* @public
|
|
15581
|
+
*/
|
|
15582
|
+
export declare interface TelemetryRedactor {
|
|
15583
|
+
(value: string, context: RedactionContext): string;
|
|
15584
|
+
}
|
|
15585
|
+
|
|
15344
15586
|
declare interface ToolChoice {
|
|
15345
15587
|
type: "function";
|
|
15346
15588
|
function: {
|
|
@@ -2282,6 +2282,65 @@ export declare interface PromptArgument {
|
|
|
2282
2282
|
required: boolean;
|
|
2283
2283
|
}
|
|
2284
2284
|
|
|
2285
|
+
/**
|
|
2286
|
+
* Describes the value a {@link TelemetryRedactor} is asked to redact.
|
|
2287
|
+
*
|
|
2288
|
+
* @public
|
|
2289
|
+
*/
|
|
2290
|
+
declare interface RedactionContext {
|
|
2291
|
+
/**
|
|
2292
|
+
* The kind of record the value is written to.
|
|
2293
|
+
*/
|
|
2294
|
+
readonly kind: RedactionRecordKind;
|
|
2295
|
+
/**
|
|
2296
|
+
* The path of the value in the record, for example `message[0]`,
|
|
2297
|
+
* `message[1].user.email`, `properties.customerId`, `attributes.http.url`,
|
|
2298
|
+
* `events[0].attributes.exception.message` or `url`.
|
|
2299
|
+
*/
|
|
2300
|
+
readonly field: string;
|
|
2301
|
+
/**
|
|
2302
|
+
* The last property name in {@link RedactionContext.field}, for example `email`
|
|
2303
|
+
* or `http.url`. `undefined` when the value is not a property of an object
|
|
2304
|
+
* (a log message string, an array element, a span name).
|
|
2305
|
+
*/
|
|
2306
|
+
readonly key: string | undefined;
|
|
2307
|
+
/**
|
|
2308
|
+
* Every property name on the way from the record to the value, outermost
|
|
2309
|
+
* first: `["user", "email"]` for `message[1].user.email`, `["dob"]` for
|
|
2310
|
+
* `message[1].dob[0]`. Array indices are left out, so a value in an array
|
|
2311
|
+
* keeps the name the array is under. When {@link RedactionContext.key} is
|
|
2312
|
+
* set, it is the last entry. Empty for a value with no property name above
|
|
2313
|
+
* it (a log message string, a span name).
|
|
2314
|
+
*/
|
|
2315
|
+
readonly keys: readonly string[];
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* The kind of record a value is about to be written to.
|
|
2320
|
+
*
|
|
2321
|
+
* - `log`: a log entry from `context.log`, `console.*` in customer code, or the
|
|
2322
|
+
* gateway's own request logs. Goes to Zuplo's log pipeline and to every
|
|
2323
|
+
* configured log integration.
|
|
2324
|
+
* - `span`: an OpenTelemetry span: its name, attributes, events and status.
|
|
2325
|
+
* - `analytics`: the URL and customer-set properties on the per-request
|
|
2326
|
+
* analytics row (also sent to metrics plugins), and URL fields of analytics
|
|
2327
|
+
* events. Fields that usage and billing are computed from are never
|
|
2328
|
+
* redacted.
|
|
2329
|
+
* - `request-log`: an entry produced by a request logger plugin (Azure Blob,
|
|
2330
|
+
* Azure Event Hubs, Hydrolix).
|
|
2331
|
+
* - `audit-log`: an event recorded by the Audit Log policy.
|
|
2332
|
+
*
|
|
2333
|
+
* @public
|
|
2334
|
+
*/
|
|
2335
|
+
declare type RedactionRecordKind =
|
|
2336
|
+
| "log"
|
|
2337
|
+
| "span"
|
|
2338
|
+
| "analytics"
|
|
2339
|
+
| "request-log"
|
|
2340
|
+
| "audit-log";
|
|
2341
|
+
|
|
2342
|
+
/* Excluded from this release type: registerTelemetryRedactor */
|
|
2343
|
+
|
|
2285
2344
|
/**
|
|
2286
2345
|
* Generic type parameters for a request.
|
|
2287
2346
|
* Extends RequestInitGeneric and adds query parameter typing.
|
|
@@ -2330,6 +2389,8 @@ declare interface RequestUser<TUserData> {
|
|
|
2330
2389
|
data: TUserData;
|
|
2331
2390
|
}
|
|
2332
2391
|
|
|
2392
|
+
/* Excluded from this release type: resetRedactorsForTesting */
|
|
2393
|
+
|
|
2333
2394
|
/**
|
|
2334
2395
|
* The name and URI `mcpServerHandler` advertises for an operation it registers
|
|
2335
2396
|
* as a resource. The handler and the build's resource URI check
|
|
@@ -2515,6 +2576,46 @@ export declare function setGlobalZuploEventContext(
|
|
|
2515
2576
|
|
|
2516
2577
|
/* Excluded from this release type: StandardEnv */
|
|
2517
2578
|
|
|
2579
|
+
/**
|
|
2580
|
+
* A function that redacts sensitive data from a value before Zuplo records
|
|
2581
|
+
* it. Return the value to record: the input unchanged, or a redacted copy.
|
|
2582
|
+
*
|
|
2583
|
+
* The function runs synchronously on the request path for every string (and
|
|
2584
|
+
* every number, as its decimal string) the gateway records, so keep it fast.
|
|
2585
|
+
* It must be pure: the same input and context must always give the same
|
|
2586
|
+
* output, because results for short values are cached and reused. Values over
|
|
2587
|
+
* 32,768 characters are cut to that length before the function sees them.
|
|
2588
|
+
* Anything the function logs is dropped.
|
|
2589
|
+
* If it throws, or returns something other than a string, the value is
|
|
2590
|
+
* replaced with `"[REDACTION_FAILED]"` and the failure is recorded without the
|
|
2591
|
+
* value.
|
|
2592
|
+
*
|
|
2593
|
+
* @example
|
|
2594
|
+
* ```ts
|
|
2595
|
+
* import { RuntimeExtensions, createRedactor } from "@zuplo/runtime";
|
|
2596
|
+
*
|
|
2597
|
+
* export function runtimeInit(runtime: RuntimeExtensions) {
|
|
2598
|
+
* // Built-in patterns
|
|
2599
|
+
* runtime.addTelemetryRedactor(
|
|
2600
|
+
* createRedactor({
|
|
2601
|
+
* entities: ["finance-credit-card", "id-us-ssn"],
|
|
2602
|
+
* queryParameters: ["ssn", "card_number"],
|
|
2603
|
+
* })
|
|
2604
|
+
* );
|
|
2605
|
+
*
|
|
2606
|
+
* // A custom rule: drop the value of any field named "dob"
|
|
2607
|
+
* runtime.addTelemetryRedactor((value, { key }) =>
|
|
2608
|
+
* key === "dob" ? "[REDACTED]" : value
|
|
2609
|
+
* );
|
|
2610
|
+
* }
|
|
2611
|
+
* ```
|
|
2612
|
+
*
|
|
2613
|
+
* @public
|
|
2614
|
+
*/
|
|
2615
|
+
declare interface TelemetryRedactor {
|
|
2616
|
+
(value: string, context: RedactionContext): string;
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2518
2619
|
declare interface UrlConfig {
|
|
2519
2620
|
defaultUrl: string;
|
|
2520
2621
|
urls: string[];
|