@zuplo/cli 7.13.10 → 7.14.0
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/node_modules/@posthog/core/dist/cookie.d.ts +4 -0
- package/node_modules/@posthog/core/dist/cookie.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/cookie.js +8 -2
- package/node_modules/@posthog/core/dist/cookie.mjs +8 -2
- package/node_modules/@posthog/core/dist/posthog-core.d.ts +2 -0
- package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.js +19 -2
- package/node_modules/@posthog/core/dist/posthog-core.mjs +19 -2
- package/node_modules/@posthog/core/dist/utils/bot-detection.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/bot-detection.js +1 -0
- package/node_modules/@posthog/core/dist/utils/bot-detection.mjs +1 -0
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/cookie.ts +13 -2
- package/node_modules/@posthog/core/src/posthog-core.ts +25 -2
- package/node_modules/@posthog/core/src/utils/bot-detection.spec.ts +7 -0
- package/node_modules/@posthog/core/src/utils/bot-detection.ts +1 -0
- package/node_modules/@zuplo/core/customer.cli.minified.js +332 -332
- package/node_modules/@zuplo/core/index.minified.js +320 -320
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-SXGSDVGB.js → chunk-4SVXBKXH.js} +85 -85
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SVXBKXH.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-VP5Q3DEN.js +26 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-VP5Q3DEN.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-PXS4NOKU.js → chunk-WUZE2HKB.js} +17 -17
- package/node_modules/@zuplo/runtime/out/esm/chunk-WUZE2HKB.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +78 -1
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +137 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/express-rate-limit/dist/index.cjs +1 -1
- package/node_modules/express-rate-limit/dist/index.mjs +1 -1
- package/node_modules/express-rate-limit/package.json +1 -1
- package/node_modules/ip-address/README.md +39 -39
- package/node_modules/ip-address/dist/ipv6.js +1 -1
- package/node_modules/ip-address/dist/ipv6.js.map +1 -1
- package/node_modules/ip-address/package.json +1 -1
- package/node_modules/thread-stream/.github/workflows/ci.yml +1 -1
- package/node_modules/thread-stream/SECURITY.md +77 -0
- package/node_modules/thread-stream/index.d.ts +2 -1
- package/node_modules/thread-stream/index.js +65 -7
- package/node_modules/thread-stream/lib/wait.js +23 -5
- package/node_modules/thread-stream/package.json +10 -5
- package/node_modules/thread-stream/test/create-and-exit.js +1 -1
- package/node_modules/thread-stream/test/end.test.js +35 -0
- package/node_modules/thread-stream/test/error-flush.test.js +96 -0
- package/node_modules/thread-stream/test/error-immediate.js +17 -0
- package/node_modules/thread-stream/test/flush-ref-keeps-alive.js +23 -0
- package/node_modules/thread-stream/test/flush-unref-exit.js +23 -0
- package/node_modules/thread-stream/test/ready-race-worker.js +22 -0
- package/node_modules/thread-stream/test/ready.test.js +46 -0
- package/node_modules/thread-stream/test/thread-management.test.js +68 -0
- package/node_modules/thread-stream/test/to-file-sync.js +23 -0
- package/node_modules/thread-stream/test/types/index.test-d.ts +26 -0
- package/node_modules/thread-stream/test/wait.test.js +131 -0
- package/package.json +11 -11
- package/node_modules/@zuplo/runtime/out/esm/chunk-PXS4NOKU.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-SXGSDVGB.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZCJ5QBVD.js +0 -26
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZCJ5QBVD.js.map +0 -1
- package/node_modules/thread-stream/.claude/settings.local.json +0 -15
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-SXGSDVGB.js.LEGAL.txt → chunk-4SVXBKXH.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-PXS4NOKU.js.LEGAL.txt → chunk-WUZE2HKB.js.LEGAL.txt} +0 -0
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{G as p,L as c,O as u}from"../chunk-
|
|
25
|
+
import{G as p,L as c,O as u}from"../chunk-4SVXBKXH.js";import"../chunk-VP5Q3DEN.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import{aa as i}from"../chunk-WUZE2HKB.js";import"../chunk-UKQQD2JN.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{Ia as a,Ja as l,Ka as c,La as o,Oa as p,Pa as y,Qa as m}from"../../chunk-
|
|
25
|
+
import{Ia as a,Ja as l,Ka as c,La as o,Oa as p,Pa as y,Qa as m}from"../../chunk-WUZE2HKB.js";import"../../chunk-UKQQD2JN.js";import{a as i}from"../../chunk-TYV53J3B.js";async function g(r,e){let t=typeof e.credentials=="function"?await e.credentials():e.credentials,n=r.method,d=n!=="GET"&&n!=="HEAD"&&r.body!=null?await r.arrayBuffer():null,s=await new o({method:n,url:r.url,headers:r.headers,body:d,accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,service:e.service,region:e.region,signQuery:e.signQuery}).sign();return new Request(s.url.toString(),{method:s.method,headers:s.headers,body:s.body})}i(g,"signRequest");export{c as AwsClient,o as AwsV4Signer,p as fromTemporaryCredentials,y as fromWebToken,m as fromZuploIdentity,l as getAwsCredentialProvider,a as setAwsCredentialProvider,g as signRequest};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -4230,7 +4230,8 @@ declare type CompatibilityDate =
|
|
|
4230
4230
|
| "2024-03-14"
|
|
4231
4231
|
| "2024-09-02"
|
|
4232
4232
|
| "2025-02-06"
|
|
4233
|
-
| "2026-03-01"
|
|
4233
|
+
| "2026-03-01"
|
|
4234
|
+
| "2026-11-06";
|
|
4234
4235
|
|
|
4235
4236
|
declare interface CompatibilityFlags {
|
|
4236
4237
|
/**
|
|
@@ -4277,6 +4278,42 @@ declare interface CompatibilityFlags {
|
|
|
4277
4278
|
* @compatibilityDate 2025-02-06
|
|
4278
4279
|
*/
|
|
4279
4280
|
useForwardRedirectsPropOnUrlForwardHandler: boolean;
|
|
4281
|
+
/**
|
|
4282
|
+
* Whether the build matches an OpenAPI route's path literally, escaping
|
|
4283
|
+
* the URLPattern special characters in it.
|
|
4284
|
+
*
|
|
4285
|
+
* Before this flag: The path is passed to URLPattern as written, after
|
|
4286
|
+
* `{param}` becomes `:param`, so `/foo/{id}/(.*)` mixes URLPattern syntax
|
|
4287
|
+
* into an OpenAPI path. A path that is not a valid URLPattern fails the
|
|
4288
|
+
* build.
|
|
4289
|
+
*
|
|
4290
|
+
* After this flag: `* + ? ( ) [ ] . | ^ $ \ :` in the path are escaped, so
|
|
4291
|
+
* each matches only itself, and `{param}` is the only placeholder.
|
|
4292
|
+
*
|
|
4293
|
+
* The build reads this flag; the runtime does not.
|
|
4294
|
+
*
|
|
4295
|
+
* @compatibilityDate 2025-02-06
|
|
4296
|
+
*/
|
|
4297
|
+
escapeOpenApiPathCharacters: boolean;
|
|
4298
|
+
/**
|
|
4299
|
+
* Whether an OpenAPI path parameter ends at its closing `}`, so a path
|
|
4300
|
+
* such as `/x/{id}abc` binds `id` as written.
|
|
4301
|
+
*
|
|
4302
|
+
* Before this flag: The build writes `{id}` as `:id`. URLPattern reads a
|
|
4303
|
+
* name for as long as the next characters are letters, digits, `_` or `$`,
|
|
4304
|
+
* so `/x/{id}abc` becomes `/x/:idabc`: it matches `/x/<anything>` and sets
|
|
4305
|
+
* `idabc`, never `id`. The build warns about each such path.
|
|
4306
|
+
*
|
|
4307
|
+
* After this flag: When a letter, digit, `_` or `$` follows the `}`, the
|
|
4308
|
+
* build writes `{:id}abc`, so `/x/fooabc` matches with `id` set to `foo`
|
|
4309
|
+
* and `/x/foo` does not match. `mcpServerHandler` writes the parameter's
|
|
4310
|
+
* value in its place. Other paths build exactly as before.
|
|
4311
|
+
*
|
|
4312
|
+
* The build and the MCP server handler read this flag.
|
|
4313
|
+
*
|
|
4314
|
+
* @compatibilityDate 2026-11-06
|
|
4315
|
+
*/
|
|
4316
|
+
delimitOpenApiPathParameters: boolean;
|
|
4280
4317
|
/**
|
|
4281
4318
|
* Whether response sending hooks should chain properly, where each hook
|
|
4282
4319
|
* receives the response from the previous hook instead of the original response.
|
|
@@ -4318,6 +4355,8 @@ declare interface CompatibilityFlags {
|
|
|
4318
4355
|
* and `allOf`. `request-validation-inbound` validates with the same dialect,
|
|
4319
4356
|
* `format` and pattern rules, and keeps its parameter type coercion
|
|
4320
4357
|
* (specs/compat-improved-schema-validation.md).
|
|
4358
|
+
*
|
|
4359
|
+
* @compatibilityDate 2026-11-06
|
|
4321
4360
|
*/
|
|
4322
4361
|
improvedSchemaValidation: boolean;
|
|
4323
4362
|
/**
|
|
@@ -4334,6 +4373,8 @@ declare interface CompatibilityFlags {
|
|
|
4334
4373
|
* Style Examples table says, for example `rgb[R]=100&rgb[G]=200` for a
|
|
4335
4374
|
* `deepObject` and `.blue.black.brown` for a path `label`. Values are
|
|
4336
4375
|
* percent-encoded as UTF-8 and a space is `%20`.
|
|
4376
|
+
*
|
|
4377
|
+
* @compatibilityDate 2026-11-06
|
|
4337
4378
|
*/
|
|
4338
4379
|
serializeMcpParametersByStyle: boolean;
|
|
4339
4380
|
/**
|
|
@@ -4360,6 +4401,8 @@ declare interface CompatibilityFlags {
|
|
|
4360
4401
|
*
|
|
4361
4402
|
* The build warns about every name that breaks the rule or repeats, with or
|
|
4362
4403
|
* without this flag. Set `x-zuplo-route.mcp.name` to keep a name stable.
|
|
4404
|
+
*
|
|
4405
|
+
* @compatibilityDate 2026-11-06
|
|
4363
4406
|
*/
|
|
4364
4407
|
sanitizeMcpToolNames: boolean;
|
|
4365
4408
|
/**
|
|
@@ -4384,6 +4427,8 @@ declare interface CompatibilityFlags {
|
|
|
4384
4427
|
* - Before `2025-03-26`: tools also leave out `annotations`.
|
|
4385
4428
|
*
|
|
4386
4429
|
* `_meta` is sent on every version.
|
|
4430
|
+
*
|
|
4431
|
+
* @compatibilityDate 2026-11-06
|
|
4387
4432
|
*/
|
|
4388
4433
|
omitMcpFieldsNewerThanNegotiatedVersion: boolean;
|
|
4389
4434
|
/**
|
|
@@ -4405,8 +4450,40 @@ declare interface CompatibilityFlags {
|
|
|
4405
4450
|
* secrets, and options whose unset default grants more access keep their
|
|
4406
4451
|
* current behavior. `BLANK_IS_NOT_UNSET` in
|
|
4407
4452
|
* `policies/optional-string-options.spec.ts` lists them with the reason.
|
|
4453
|
+
*
|
|
4454
|
+
* @compatibilityDate 2026-11-06
|
|
4408
4455
|
*/
|
|
4409
4456
|
treatBlankOptionalStringOptionsAsUnset: boolean;
|
|
4457
|
+
/**
|
|
4458
|
+
* Whether the MCP server handler answers `resources/read` with a JSON-RPC
|
|
4459
|
+
* error when the resource's route answers an error status.
|
|
4460
|
+
*
|
|
4461
|
+
* Before this flag: The route's response body is returned as the
|
|
4462
|
+
* resource's contents whatever its status, so a route's 403 problem+json
|
|
4463
|
+
* reaches the client as a successful read.
|
|
4464
|
+
*
|
|
4465
|
+
* After this flag: A status outside 200 to 299, a redirect included,
|
|
4466
|
+
* answers `resources/read` with JSON-RPC error -32603 naming the resource,
|
|
4467
|
+
* its URI and the status, with `data: { uri, status }`. The route's body is
|
|
4468
|
+
* not read or sent.
|
|
4469
|
+
*
|
|
4470
|
+
* @compatibilityDate 2026-11-06
|
|
4471
|
+
*/
|
|
4472
|
+
failMcpResourceReadsOnErrorStatus: boolean;
|
|
4473
|
+
/**
|
|
4474
|
+
* Whether the build fails for an MCP resource URI that is not an absolute
|
|
4475
|
+
* RFC 3986 URI.
|
|
4476
|
+
*
|
|
4477
|
+
* Before this flag: `x-zuplo-route.mcp.uri` (or the deprecated
|
|
4478
|
+
* `x-zuplo-mcp-resource.uri`) is advertised and served as written, for
|
|
4479
|
+
* example `audit doc with spaces`. The build warns.
|
|
4480
|
+
*
|
|
4481
|
+
* After this flag: The build fails, naming the operation, its file and the
|
|
4482
|
+
* URI. The default URI (`mcp://resources/<name>`) is always valid.
|
|
4483
|
+
*
|
|
4484
|
+
* @compatibilityDate 2026-11-06
|
|
4485
|
+
*/
|
|
4486
|
+
rejectInvalidMcpResourceUris: boolean;
|
|
4410
4487
|
}
|
|
4411
4488
|
|
|
4412
4489
|
declare interface CompletionsFallbacks {
|
|
@@ -101,7 +101,8 @@ declare type CompatibilityDate =
|
|
|
101
101
|
| "2024-03-14"
|
|
102
102
|
| "2024-09-02"
|
|
103
103
|
| "2025-02-06"
|
|
104
|
-
| "2026-03-01"
|
|
104
|
+
| "2026-03-01"
|
|
105
|
+
| "2026-11-06";
|
|
105
106
|
|
|
106
107
|
declare interface CompatibilityFlags {
|
|
107
108
|
/**
|
|
@@ -148,6 +149,42 @@ declare interface CompatibilityFlags {
|
|
|
148
149
|
* @compatibilityDate 2025-02-06
|
|
149
150
|
*/
|
|
150
151
|
useForwardRedirectsPropOnUrlForwardHandler: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Whether the build matches an OpenAPI route's path literally, escaping
|
|
154
|
+
* the URLPattern special characters in it.
|
|
155
|
+
*
|
|
156
|
+
* Before this flag: The path is passed to URLPattern as written, after
|
|
157
|
+
* `{param}` becomes `:param`, so `/foo/{id}/(.*)` mixes URLPattern syntax
|
|
158
|
+
* into an OpenAPI path. A path that is not a valid URLPattern fails the
|
|
159
|
+
* build.
|
|
160
|
+
*
|
|
161
|
+
* After this flag: `* + ? ( ) [ ] . | ^ $ \ :` in the path are escaped, so
|
|
162
|
+
* each matches only itself, and `{param}` is the only placeholder.
|
|
163
|
+
*
|
|
164
|
+
* The build reads this flag; the runtime does not.
|
|
165
|
+
*
|
|
166
|
+
* @compatibilityDate 2025-02-06
|
|
167
|
+
*/
|
|
168
|
+
escapeOpenApiPathCharacters: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Whether an OpenAPI path parameter ends at its closing `}`, so a path
|
|
171
|
+
* such as `/x/{id}abc` binds `id` as written.
|
|
172
|
+
*
|
|
173
|
+
* Before this flag: The build writes `{id}` as `:id`. URLPattern reads a
|
|
174
|
+
* name for as long as the next characters are letters, digits, `_` or `$`,
|
|
175
|
+
* so `/x/{id}abc` becomes `/x/:idabc`: it matches `/x/<anything>` and sets
|
|
176
|
+
* `idabc`, never `id`. The build warns about each such path.
|
|
177
|
+
*
|
|
178
|
+
* After this flag: When a letter, digit, `_` or `$` follows the `}`, the
|
|
179
|
+
* build writes `{:id}abc`, so `/x/fooabc` matches with `id` set to `foo`
|
|
180
|
+
* and `/x/foo` does not match. `mcpServerHandler` writes the parameter's
|
|
181
|
+
* value in its place. Other paths build exactly as before.
|
|
182
|
+
*
|
|
183
|
+
* The build and the MCP server handler read this flag.
|
|
184
|
+
*
|
|
185
|
+
* @compatibilityDate 2026-11-06
|
|
186
|
+
*/
|
|
187
|
+
delimitOpenApiPathParameters: boolean;
|
|
151
188
|
/**
|
|
152
189
|
* Whether response sending hooks should chain properly, where each hook
|
|
153
190
|
* receives the response from the previous hook instead of the original response.
|
|
@@ -189,6 +226,8 @@ declare interface CompatibilityFlags {
|
|
|
189
226
|
* and `allOf`. `request-validation-inbound` validates with the same dialect,
|
|
190
227
|
* `format` and pattern rules, and keeps its parameter type coercion
|
|
191
228
|
* (specs/compat-improved-schema-validation.md).
|
|
229
|
+
*
|
|
230
|
+
* @compatibilityDate 2026-11-06
|
|
192
231
|
*/
|
|
193
232
|
improvedSchemaValidation: boolean;
|
|
194
233
|
/**
|
|
@@ -205,6 +244,8 @@ declare interface CompatibilityFlags {
|
|
|
205
244
|
* Style Examples table says, for example `rgb[R]=100&rgb[G]=200` for a
|
|
206
245
|
* `deepObject` and `.blue.black.brown` for a path `label`. Values are
|
|
207
246
|
* percent-encoded as UTF-8 and a space is `%20`.
|
|
247
|
+
*
|
|
248
|
+
* @compatibilityDate 2026-11-06
|
|
208
249
|
*/
|
|
209
250
|
serializeMcpParametersByStyle: boolean;
|
|
210
251
|
/**
|
|
@@ -231,6 +272,8 @@ declare interface CompatibilityFlags {
|
|
|
231
272
|
*
|
|
232
273
|
* The build warns about every name that breaks the rule or repeats, with or
|
|
233
274
|
* without this flag. Set `x-zuplo-route.mcp.name` to keep a name stable.
|
|
275
|
+
*
|
|
276
|
+
* @compatibilityDate 2026-11-06
|
|
234
277
|
*/
|
|
235
278
|
sanitizeMcpToolNames: boolean;
|
|
236
279
|
/**
|
|
@@ -255,6 +298,8 @@ declare interface CompatibilityFlags {
|
|
|
255
298
|
* - Before `2025-03-26`: tools also leave out `annotations`.
|
|
256
299
|
*
|
|
257
300
|
* `_meta` is sent on every version.
|
|
301
|
+
*
|
|
302
|
+
* @compatibilityDate 2026-11-06
|
|
258
303
|
*/
|
|
259
304
|
omitMcpFieldsNewerThanNegotiatedVersion: boolean;
|
|
260
305
|
/**
|
|
@@ -276,8 +321,40 @@ declare interface CompatibilityFlags {
|
|
|
276
321
|
* secrets, and options whose unset default grants more access keep their
|
|
277
322
|
* current behavior. `BLANK_IS_NOT_UNSET` in
|
|
278
323
|
* `policies/optional-string-options.spec.ts` lists them with the reason.
|
|
324
|
+
*
|
|
325
|
+
* @compatibilityDate 2026-11-06
|
|
279
326
|
*/
|
|
280
327
|
treatBlankOptionalStringOptionsAsUnset: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Whether the MCP server handler answers `resources/read` with a JSON-RPC
|
|
330
|
+
* error when the resource's route answers an error status.
|
|
331
|
+
*
|
|
332
|
+
* Before this flag: The route's response body is returned as the
|
|
333
|
+
* resource's contents whatever its status, so a route's 403 problem+json
|
|
334
|
+
* reaches the client as a successful read.
|
|
335
|
+
*
|
|
336
|
+
* After this flag: A status outside 200 to 299, a redirect included,
|
|
337
|
+
* answers `resources/read` with JSON-RPC error -32603 naming the resource,
|
|
338
|
+
* its URI and the status, with `data: { uri, status }`. The route's body is
|
|
339
|
+
* not read or sent.
|
|
340
|
+
*
|
|
341
|
+
* @compatibilityDate 2026-11-06
|
|
342
|
+
*/
|
|
343
|
+
failMcpResourceReadsOnErrorStatus: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Whether the build fails for an MCP resource URI that is not an absolute
|
|
346
|
+
* RFC 3986 URI.
|
|
347
|
+
*
|
|
348
|
+
* Before this flag: `x-zuplo-route.mcp.uri` (or the deprecated
|
|
349
|
+
* `x-zuplo-mcp-resource.uri`) is advertised and served as written, for
|
|
350
|
+
* example `audit doc with spaces`. The build warns.
|
|
351
|
+
*
|
|
352
|
+
* After this flag: The build fails, naming the operation, its file and the
|
|
353
|
+
* URI. The default URI (`mcp://resources/<name>`) is always valid.
|
|
354
|
+
*
|
|
355
|
+
* @compatibilityDate 2026-11-06
|
|
356
|
+
*/
|
|
357
|
+
rejectInvalidMcpResourceUris: boolean;
|
|
281
358
|
}
|
|
282
359
|
|
|
283
360
|
/**
|
|
@@ -1231,6 +1308,18 @@ declare type Iso3166Alpha2Code =
|
|
|
1231
1308
|
|
|
1232
1309
|
/* Excluded from this release type: isRestrictedEnvVariableName */
|
|
1233
1310
|
|
|
1311
|
+
/**
|
|
1312
|
+
* Whether `uri` is an absolute RFC 3986 URI (section 3: `scheme ":"
|
|
1313
|
+
* hier-part [ "?" query ] [ "#" fragment ]`), as MCP requires a resource URI
|
|
1314
|
+
* to be (compat-reject-invalid-mcp-resource-uris MCPRESURI-1). The structure
|
|
1315
|
+
* is checked, not just the characters: a bracketed host must be an IP
|
|
1316
|
+
* literal, a port must be digits, and a fragment holds no second `#`. Any
|
|
1317
|
+
* scheme is allowed, so custom schemes such as `docs:` pass.
|
|
1318
|
+
*
|
|
1319
|
+
* @param uri - the resource URI as the handler advertises it (trimmed)
|
|
1320
|
+
*/
|
|
1321
|
+
export declare function isValidMcpResourceUri(uri: string): boolean;
|
|
1322
|
+
|
|
1234
1323
|
/* Excluded from this release type: isZuploReadableEnvVariableName */
|
|
1235
1324
|
|
|
1236
1325
|
declare type JsonArray = JsonValue[] | readonly JsonValue[];
|
|
@@ -1311,6 +1400,36 @@ declare interface Logger extends BaseLogger {
|
|
|
1311
1400
|
): void;
|
|
1312
1401
|
}
|
|
1313
1402
|
|
|
1403
|
+
/** The name and URI `resources/list` advertises for a resource. */
|
|
1404
|
+
export declare interface McpResourceIdentity {
|
|
1405
|
+
/**
|
|
1406
|
+
* The resource's name. Empty only on the `"resources"` path for an
|
|
1407
|
+
* operation with neither a name nor an operationId, which the handler
|
|
1408
|
+
* refuses at startup.
|
|
1409
|
+
*/
|
|
1410
|
+
name: string;
|
|
1411
|
+
/** The advertised URI: the configured one, trimmed, or the default. */
|
|
1412
|
+
uri: string;
|
|
1413
|
+
/** Whether the URI is configured (non-empty after trimming), not the default. */
|
|
1414
|
+
configured: boolean;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
/** The part of a resource extension that names a resource and its URI. */
|
|
1418
|
+
export declare interface McpResourceIdentityConfig {
|
|
1419
|
+
name?: string;
|
|
1420
|
+
uri?: string;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* How `mcpServerHandler` registers a resource, which decides the extension
|
|
1425
|
+
* its name and URI come from:
|
|
1426
|
+
* - `"operations"`: `options.operations`, from `x-zuplo-route.mcp` with
|
|
1427
|
+
* `type: "resource"`.
|
|
1428
|
+
* - `"resources"`: the deprecated `options.resources`, from
|
|
1429
|
+
* `x-zuplo-mcp-resource`.
|
|
1430
|
+
*/
|
|
1431
|
+
export declare type McpResourceRegistration = "operations" | "resources";
|
|
1432
|
+
|
|
1314
1433
|
declare type Modify<T, R> = Omit<T, keyof R> & R;
|
|
1315
1434
|
|
|
1316
1435
|
/**
|
|
@@ -2025,6 +2144,23 @@ declare interface RequestUser<TUserData> {
|
|
|
2025
2144
|
data: TUserData;
|
|
2026
2145
|
}
|
|
2027
2146
|
|
|
2147
|
+
/**
|
|
2148
|
+
* The name and URI `mcpServerHandler` advertises for an operation it registers
|
|
2149
|
+
* as a resource. The handler and the build's resource URI check
|
|
2150
|
+
* (compat-reject-invalid-mcp-resource-uris MCPRESURI-1) both decide it here.
|
|
2151
|
+
* An empty URI gets the default, `mcp://resources/<encoded name>`.
|
|
2152
|
+
*
|
|
2153
|
+
* @param operationId - the operation's operationId
|
|
2154
|
+
* @param config - `x-zuplo-route.mcp` for `"operations"`,
|
|
2155
|
+
* `x-zuplo-mcp-resource` for `"resources"`
|
|
2156
|
+
* @param registration - the handler option that registers the resource
|
|
2157
|
+
*/
|
|
2158
|
+
export declare function resolveMcpResourceIdentity(
|
|
2159
|
+
operationId: string,
|
|
2160
|
+
config: McpResourceIdentityConfig | undefined,
|
|
2161
|
+
registration: McpResourceRegistration
|
|
2162
|
+
): McpResourceIdentity;
|
|
2163
|
+
|
|
2028
2164
|
declare type ResolveRequestParams<
|
|
2029
2165
|
TParams extends RequestParamsDefault | undefined,
|
|
2030
2166
|
> = TParams extends RequestParamsDefault ? TParams : RequestParamsDefault;
|
|
@@ -1061,7 +1061,7 @@ var rateLimit = (passedOptions) => {
|
|
|
1061
1061
|
const retryAfter = await retrieveRetryAfter;
|
|
1062
1062
|
setRetryAfterHeader(response, info, config.windowMs, retryAfter);
|
|
1063
1063
|
}
|
|
1064
|
-
config.handler(request, response, next, options);
|
|
1064
|
+
await config.handler(request, response, next, options);
|
|
1065
1065
|
return;
|
|
1066
1066
|
}
|
|
1067
1067
|
next();
|
|
@@ -1018,7 +1018,7 @@ var rateLimit = (passedOptions) => {
|
|
|
1018
1018
|
const retryAfter = await retrieveRetryAfter;
|
|
1019
1019
|
setRetryAfterHeader(response, info, config.windowMs, retryAfter);
|
|
1020
1020
|
}
|
|
1021
|
-
config.handler(request, response, next, options);
|
|
1021
|
+
await config.handler(request, response, next, options);
|
|
1022
1022
|
return;
|
|
1023
1023
|
}
|
|
1024
1024
|
next();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-rate-limit",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.3",
|
|
4
4
|
"description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Nathan Friedly",
|
|
@@ -186,9 +186,9 @@ A few terms used throughout the API can be confusing if you haven't worked deepl
|
|
|
186
186
|
- `static fromWildcard(input: string): Address6` — Construct an `Address6` from a wildcard pattern with trailing `*` groups. The number of trailing wildcards determines the prefix length: each `*` represents 16 bits. `::` is expanded to zero groups (not wildcards) before evaluating trailing wildcards. Only trailing whole-group wildcards are supported. Partial-group wildcards (e.g. `2001:db8::0*`) and interior wildcards (e.g. `*::1`) throw `AddressError`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L331)
|
|
187
187
|
- `static fromAddress4(address: string): Address6` — Create an IPv6-mapped address given an IPv4 address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L392)
|
|
188
188
|
- `static fromArpa(arpaFormAddress: string): Address6` — Return an address from ip6.arpa form. A full 32-nibble name gives a /128 address; a shorter name, as used for a delegated reverse zone, gives the network it covers, with a subnet mask of four bits per nibble, so `fromArpa(x.reverseForm())` round-trips reverseForm for any prefix. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L412)
|
|
189
|
-
- `static fromAddress4Nat64(address: string, prefix?: string): Address6` — Embed an IPv4 address into a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. The prefix length must be one of 32, 40, 48, 56, 64, or 96; for prefixes shorter than /64 the IPv4 octets are split around the reserved bits 64–71. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
190
|
-
- `static fromByteArray(bytes: number[]): Address6` — Convert a byte array to an Address6 object. Accepts unsigned bytes (0 to 255) or signed bytes (-128 to 127, as an `Int8Array` or a Java `byte[]` holds them), folding signed values to their unsigned equivalent. Throws `AddressError` unless given exactly 16 integers from -128 to 255. To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
191
|
-
- `static fromUnsignedByteArray(bytes: number[]): Address6` — Convert an unsigned byte array to an Address6 object. Throws `AddressError` unless given exactly 16 integers from 0 to 255. To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
189
|
+
- `static fromAddress4Nat64(address: string, prefix?: string): Address6` — Embed an IPv4 address into a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. The prefix length must be one of 32, 40, 48, 56, 64, or 96; for prefixes shorter than /64 the IPv4 octets are split around the reserved bits 64–71. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1122)
|
|
190
|
+
- `static fromByteArray(bytes: number[]): Address6` — Convert a byte array to an Address6 object. Accepts unsigned bytes (0 to 255) or signed bytes (-128 to 127, as an `Int8Array` or a Java `byte[]` holds them), folding signed values to their unsigned equivalent. Throws `AddressError` unless given exactly 16 integers from -128 to 255. To convert from a Node.js `Buffer`, spread it: `Address6.fromByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1237)
|
|
191
|
+
- `static fromUnsignedByteArray(bytes: number[]): Address6` — Convert an unsigned byte array to an Address6 object. Throws `AddressError` unless given exactly 16 integers from 0 to 255. To convert from a Node.js `Buffer`, spread it: `Address6.fromUnsignedByteArray([...buf])`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1254)
|
|
192
192
|
|
|
193
193
|
**Instance methods**
|
|
194
194
|
|
|
@@ -215,39 +215,39 @@ A few terms used throughout the API can be confusing if you haven't worked deepl
|
|
|
215
215
|
- `binaryZeroPad(): string` — Return a zero-padded base-2 string representation of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L783)
|
|
216
216
|
- `parse4in6(address: string): string` — Parses a v4-in-v6 string (e.g. `::ffff:192.168.0.1`) by extracting the trailing IPv4 address into `this.address4` / `this.parsedAddress4` and returning the address with the v4 portion converted to two v6 groups. Used internally by `parse()`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L797)
|
|
217
217
|
- `parse(address: string): string[]` — Parses an IPv6 address string into its 8 hexadecimal groups (expanding any `::` elision and any trailing v4-in-v6 portion) and stores the result on `this.parsedAddress`. Called automatically by the constructor; you typically don't need to call it directly. Throws `AddressError` if the input is malformed. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L854)
|
|
218
|
-
- `canonicalForm(): string` — Returns the canonical (fully expanded) form of the address: all 8 groups, each padded to 4 hex digits, with no `::` collapsing (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and byte-exact comparison. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
219
|
-
- `decimal(): string` — Return the decimal form of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
220
|
-
- `bigInt(): bigint` — Return the address as a BigInt [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
221
|
-
- `to4(): Address4` — Return the last two groups of this address as an IPv4 address string. If this address carries a CIDR prefix that covers the trailing 32 bits (i.e. `subnetMask >= 96`), the resulting `Address4` inherits the corresponding v4 prefix (`subnetMask - 96`); otherwise it defaults to `/32`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
222
|
-
- `to4in6(): string` — Return the v4-in-v6 form of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
223
|
-
- `inspectTeredo(): TeredoProperties` — Decodes the Teredo tunneling fields embedded in this address. Returns the Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag, UDP port, and Microsoft-format flag breakdown (reserved, universal/local, group/individual, nonce). Only meaningful for addresses in `2001::/32`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
224
|
-
- `inspect6to4(): SixToFourProperties` — Decodes the 6to4 tunneling fields embedded in this address. Returns the 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for addresses in `2002::/16`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
225
|
-
- `to6to4(): Address6 | null` — Return a v6 6to4 address from a v6 v4inv6 address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
226
|
-
- `toAddress4Nat64(prefix?: string): Address4 | null` — Extract the embedded IPv4 address from a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. Returns `null` if this address is not contained within the given prefix. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
227
|
-
- `toByteArray(): number[]` — Return a byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
228
|
-
- `toUnsignedByteArray(): number[]` — Return an unsigned byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
229
|
-
- `isCanonical(): boolean` — Returns true if the address is in the canonical form, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
230
|
-
- `isLinkLocal(): boolean` — Returns true if the address is a link-local unicast address in `fe80::/10` ([RFC 4291 §2.4](https://datatracker.ietf.org/doc/html/rfc4291#section-2.4)) or an IPv4-mapped / NAT64 address whose embedded IPv4 address is link-local (`169.254.0.0/16`, e.g. `::ffff:169.254.169.254`), false otherwise. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
231
|
-
- `isMulticast(): boolean` — Returns true if the address is a multicast address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
232
|
-
- `is4(): boolean` — Returns true if the address was written in v4-in-v6 dotted-quad notation (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level flag and does not reflect whether the address bits lie in the IPv4-mapped (`::ffff:0:0/96`) subnet — for that, see isMapped4. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
233
|
-
- `isMapped4(): boolean` — Returns true if the address is an IPv4-mapped IPv6 address in `::ffff:0:0/96` ([RFC 4291 §2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2)), false otherwise. Unlike is4, this checks the underlying address bits rather than the textual notation, so `::ffff:127.0.0.1` and `::ffff:7f00:1` both return true. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
234
|
-
- `embeddedIPv4(): Address4 | null` — If this address embeds a routable IPv4 address — i.e. it is IPv4-mapped (`::ffff:0:0/96`) or sits in the NAT64 well-known prefix (`64:ff9b::/96`, [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052)) — return that embedded address as an Address4; otherwise return null. The special-property checks (`isLoopback`, `isLinkLocal`, `isMulticast`, `isUnspecified`, `isPrivate`, `isCGNAT`, `isBroadcast`) call this first and delegate to the embedded Address4 when present, so a literal such as `::ffff:127.0.0.1` is classified by what it actually reaches (loopback) rather than by its IPv6 wrapper (which `getType()` reports as IPv4-mapped). This matters wherever the checks back a trust-boundary decision (e.g. an SSRF allow/deny filter): without normalization, `::ffff:10.0.0.1`, `::ffff:169.254.169.254`, `64:ff9b::7f00:1`, etc. would all read as non-internal. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
235
|
-
- `isTeredo(): boolean` — Returns true if the address is a Teredo address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
236
|
-
- `is6to4(): boolean` — Returns true if the address is a 6to4 address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
237
|
-
- `isLoopback(): boolean` — Returns true if the address is a loopback address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
238
|
-
- `isULA(): boolean` — Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 equivalent of IPv4 [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private addresses. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
239
|
-
- `isPrivate(): boolean` — Returns true if the address is private, i.e. a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)), an address in the NAT64 local-use range `64:ff9b:1::/48` ([RFC 8215](https://datatracker.ietf.org/doc/html/rfc8215)), or an IPv4-mapped / NAT64 well-known address whose embedded IPv4 address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private ranges (e.g. `::ffff:10.0.0.1`). This is the IPv6 counterpart to Address4.isPrivate; use it instead of isULA when you need to catch mapped RFC 1918 addresses as well as native ULAs. The local-use NAT64 range is reported private as a whole rather than by its embedded IPv4 address: an operator may carve a prefix of any RFC 6052 length out of `64:ff9b:1::/48`, so the same bits decode to different IPv4 addresses under different deployments and no single decoding is correct. Use toAddress4Nat64 with the deployment's prefix to decode one. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
240
|
-
- `isCGNAT(): boolean` — Returns true if the address is an IPv4-mapped / NAT64 address whose embedded IPv4 address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)), false otherwise. There is no native IPv6 CGNAT range, so this only ever returns true for an embedded IPv4 address (e.g. `::ffff:100.64.0.1`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
241
|
-
- `isBroadcast(): boolean` — Returns true if the address is an IPv4-mapped / NAT64 address whose embedded IPv4 address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)), false otherwise. There is no IPv6 broadcast, so this only ever returns true for an embedded IPv4 address (e.g. `::ffff:255.255.255.255`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
242
|
-
- `isUnspecified(): boolean` — Returns true if the address is the unspecified address `::`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
243
|
-
- `isDocumentation(): boolean` — Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
244
|
-
- `isBenchmarking(): boolean` — Returns true if the address is in the benchmarking range `2001:2::/48` ([RFC 5180](https://datatracker.ietf.org/doc/html/rfc5180)) or is an IPv4-mapped / NAT64 address whose embedded IPv4 address is in `198.18.0.0/15`, false otherwise. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
245
|
-
- `isGlobal(): boolean` — Returns true if the address is globally reachable: inside the global unicast allocation `2000::/3` (the only range the [IANA IPv6 Address Space Registry](https://www.iana.org/assignments/ipv6-address-space/) assigns for global unicast; everything else is reserved, ULA, link-local, or multicast) and not in any block the [IANA IPv6 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv6-special-registry/) marks as not globally reachable. An IPv4-mapped or NAT64 well-known address answers for its embedded IPv4 address, so `::ffff:10.0.0.1` and `64:ff9b::7f00:1` are not global. Teredo (`2001::/32`) and 6to4 (`2002::/16`) are not global either: the registry lists them as N/A and a packet to one needs a relay. This covers everything the individual classifiers name and the blocks they do not: the discard-only prefix `100::/64`, the IETF protocol assignments in `2001::/23`, the deprecated site-local `fec0::/10` and IPv4-compatible `::/96` ranges, and unallocated space such as `4000::/3`. It is the single predicate to use where a request must not reach an internal or special-purpose destination; see SECURITY.md. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
246
|
-
- `href(optionalPort?: string | number): string` — Returns the address as an HTTP URL with the host bracketed, e.g. `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended, e.g. `http://[2001:db8::1]:8080/`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
247
|
-
- `link(options?: { className?: string; prefix?: string; v4?: boolean }): string` — Returns an HTML `<a>` element whose `href` encodes the address in a URL hash fragment (default prefix `/#address=`). Useful for linking between pages of an address-inspector UI. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
248
|
-
- `group(): string` — Groups an address. Returns an HTML fragment: each group is wrapped in a `<span>` carrying the group classes an address-inspector UI hovers on. The address content is HTML-escaped; anything you concatenate around it is your responsibility. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
249
|
-
- `regularExpressionString(substringSearch?: boolean): string` — Generate a regular expression string that can be used to find or validate all variations of this address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
250
|
-
- `regularExpression(substringSearch?: boolean): RegExp` — Generate a regular expression that can be used to find or validate all variations of this address. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
218
|
+
- `canonicalForm(): string` — Returns the canonical (fully expanded) form of the address: all 8 groups, each padded to 4 hex digits, with no `::` collapsing (e.g. `2001:0db8:0000:0000:0000:0000:0000:0001`). Useful for sorting and byte-exact comparison. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L937)
|
|
219
|
+
- `decimal(): string` — Return the decimal form of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L945)
|
|
220
|
+
- `bigInt(): bigint` — Return the address as a BigInt [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L953)
|
|
221
|
+
- `to4(): Address4` — Return the last two groups of this address as an IPv4 address string. If this address carries a CIDR prefix that covers the trailing 32 bits (i.e. `subnetMask >= 96`), the resulting `Address4` inherits the corresponding v4 prefix (`subnetMask - 96`); otherwise it defaults to `/32`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L968)
|
|
222
|
+
- `to4in6(): string` — Return the v4-in-v6 form of the address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L992)
|
|
223
|
+
- `inspectTeredo(): TeredoProperties` — Decodes the Teredo tunneling fields embedded in this address. Returns the Teredo prefix, server IPv4, client IPv4, raw flag bits, cone-NAT flag, UDP port, and Microsoft-format flag breakdown (reserved, universal/local, group/individual, nonce). Only meaningful for addresses in `2001::/32`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1013)
|
|
224
|
+
- `inspect6to4(): SixToFourProperties` — Decodes the 6to4 tunneling fields embedded in this address. Returns the 6to4 prefix and the embedded IPv4 gateway address. Only meaningful for addresses in `2002::/16`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1076)
|
|
225
|
+
- `to6to4(): Address6 | null` — Return a v6 6to4 address from a v6 v4inv6 address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1096)
|
|
226
|
+
- `toAddress4Nat64(prefix?: string): Address4 | null` — Extract the embedded IPv4 address from a NAT64 IPv6 address using the encoding defined by [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052). The default prefix is the well-known prefix `64:ff9b::/96`. Returns `null` if this address is not contained within the given prefix. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1165)
|
|
227
|
+
- `toByteArray(): number[]` — Return a byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1200)
|
|
228
|
+
- `toUnsignedByteArray(): number[]` — Return an unsigned byte array. To get a Node.js `Buffer`, wrap the result: `Buffer.from(address.toUnsignedByteArray())`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1219)
|
|
229
|
+
- `isCanonical(): boolean` — Returns true if the address is in the canonical form, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1301)
|
|
230
|
+
- `isLinkLocal(): boolean` — Returns true if the address is a link-local unicast address in `fe80::/10` ([RFC 4291 §2.4](https://datatracker.ietf.org/doc/html/rfc4291#section-2.4)) or an IPv4-mapped / NAT64 address whose embedded IPv4 address is link-local (`169.254.0.0/16`, e.g. `::ffff:169.254.169.254`), false otherwise. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1312)
|
|
231
|
+
- `isMulticast(): boolean` — Returns true if the address is a multicast address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1325)
|
|
232
|
+
- `is4(): boolean` — Returns true if the address was written in v4-in-v6 dotted-quad notation (e.g. `::ffff:127.0.0.1`), false otherwise. This is a notation-level flag and does not reflect whether the address bits lie in the IPv4-mapped (`::ffff:0:0/96`) subnet — for that, see isMapped4. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1342)
|
|
233
|
+
- `isMapped4(): boolean` — Returns true if the address is an IPv4-mapped IPv6 address in `::ffff:0:0/96` ([RFC 4291 §2.5.5.2](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.5.2)), false otherwise. Unlike is4, this checks the underlying address bits rather than the textual notation, so `::ffff:127.0.0.1` and `::ffff:7f00:1` both return true. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1354)
|
|
234
|
+
- `embeddedIPv4(): Address4 | null` — If this address embeds a routable IPv4 address — i.e. it is IPv4-mapped (`::ffff:0:0/96`) or sits in the NAT64 well-known prefix (`64:ff9b::/96`, [RFC 6052](https://datatracker.ietf.org/doc/html/rfc6052)) — return that embedded address as an Address4; otherwise return null. The special-property checks (`isLoopback`, `isLinkLocal`, `isMulticast`, `isUnspecified`, `isPrivate`, `isCGNAT`, `isBroadcast`) call this first and delegate to the embedded Address4 when present, so a literal such as `::ffff:127.0.0.1` is classified by what it actually reaches (loopback) rather than by its IPv6 wrapper (which `getType()` reports as IPv4-mapped). This matters wherever the checks back a trust-boundary decision (e.g. an SSRF allow/deny filter): without normalization, `::ffff:10.0.0.1`, `::ffff:169.254.169.254`, `64:ff9b::7f00:1`, etc. would all read as non-internal. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1375)
|
|
235
|
+
- `isTeredo(): boolean` — Returns true if the address is a Teredo address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1387)
|
|
236
|
+
- `is6to4(): boolean` — Returns true if the address is a 6to4 address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1395)
|
|
237
|
+
- `isLoopback(): boolean` — Returns true if the address is a loopback address, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1403)
|
|
238
|
+
- `isULA(): boolean` — Returns true if the address is a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)). ULAs are the IPv6 equivalent of IPv4 [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private addresses. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1416)
|
|
239
|
+
- `isPrivate(): boolean` — Returns true if the address is private, i.e. a Unique Local Address in `fc00::/7` ([RFC 4193](https://datatracker.ietf.org/doc/html/rfc4193)), an address in the NAT64 local-use range `64:ff9b:1::/48` ([RFC 8215](https://datatracker.ietf.org/doc/html/rfc8215)), or an IPv4-mapped / NAT64 well-known address whose embedded IPv4 address is in one of the [RFC 1918](https://datatracker.ietf.org/doc/html/rfc1918) private ranges (e.g. `::ffff:10.0.0.1`). This is the IPv6 counterpart to Address4.isPrivate; use it instead of isULA when you need to catch mapped RFC 1918 addresses as well as native ULAs. The local-use NAT64 range is reported private as a whole rather than by its embedded IPv4 address: an operator may carve a prefix of any RFC 6052 length out of `64:ff9b:1::/48`, so the same bits decode to different IPv4 addresses under different deployments and no single decoding is correct. Use toAddress4Nat64 with the deployment's prefix to decode one. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1438)
|
|
240
|
+
- `isCGNAT(): boolean` — Returns true if the address is an IPv4-mapped / NAT64 address whose embedded IPv4 address is in the carrier-grade NAT range `100.64.0.0/10` ([RFC 6598](https://datatracker.ietf.org/doc/html/rfc6598)), false otherwise. There is no native IPv6 CGNAT range, so this only ever returns true for an embedded IPv4 address (e.g. `::ffff:100.64.0.1`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1455)
|
|
241
|
+
- `isBroadcast(): boolean` — Returns true if the address is an IPv4-mapped / NAT64 address whose embedded IPv4 address is the limited broadcast address `255.255.255.255` ([RFC 919](https://datatracker.ietf.org/doc/html/rfc919)), false otherwise. There is no IPv6 broadcast, so this only ever returns true for an embedded IPv4 address (e.g. `::ffff:255.255.255.255`). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1472)
|
|
242
|
+
- `isUnspecified(): boolean` — Returns true if the address is the unspecified address `::`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1485)
|
|
243
|
+
- `isDocumentation(): boolean` — Returns true if the address is in the documentation prefix `2001:db8::/32` ([RFC 3849](https://datatracker.ietf.org/doc/html/rfc3849)). [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1498)
|
|
244
|
+
- `isBenchmarking(): boolean` — Returns true if the address is in the benchmarking range `2001:2::/48` ([RFC 5180](https://datatracker.ietf.org/doc/html/rfc5180)) or is an IPv4-mapped / NAT64 address whose embedded IPv4 address is in `198.18.0.0/15`, false otherwise. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1509)
|
|
245
|
+
- `isGlobal(): boolean` — Returns true if the address is globally reachable: inside the global unicast allocation `2000::/3` (the only range the [IANA IPv6 Address Space Registry](https://www.iana.org/assignments/ipv6-address-space/) assigns for global unicast; everything else is reserved, ULA, link-local, or multicast) and not in any block the [IANA IPv6 Special-Purpose Address Registry](https://www.iana.org/assignments/iana-ipv6-special-registry/) marks as not globally reachable. An IPv4-mapped or NAT64 well-known address answers for its embedded IPv4 address, so `::ffff:10.0.0.1` and `64:ff9b::7f00:1` are not global. Teredo (`2001::/32`) and 6to4 (`2002::/16`) are not global either: the registry lists them as N/A and a packet to one needs a relay. This covers everything the individual classifiers name and the blocks they do not: the discard-only prefix `100::/64`, the IETF protocol assignments in `2001::/23`, the deprecated site-local `fec0::/10` and IPv4-compatible `::/96` ranges, and unallocated space such as `4000::/3`. It is the single predicate to use where a request must not reach an internal or special-purpose destination; see SECURITY.md. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1538)
|
|
246
|
+
- `href(optionalPort?: string | number): string` — Returns the address as an HTTP URL with the host bracketed, e.g. `http://[2001:db8::1]/`. If `optionalPort` is provided it is appended, e.g. `http://[2001:db8::1]:8080/`. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1557)
|
|
247
|
+
- `link(options?: { className?: string; prefix?: string; v4?: boolean }): string` — Returns an HTML `<a>` element whose `href` encodes the address in a URL hash fragment (default prefix `/#address=`). Useful for linking between pages of an address-inspector UI. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1575)
|
|
248
|
+
- `group(): string` — Groups an address. Returns an HTML fragment: each group is wrapped in a `<span>` carrying the group classes an address-inspector UI hovers on. The address content is HTML-escaped; anything you concatenate around it is your responsibility. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1620)
|
|
249
|
+
- `regularExpressionString(substringSearch?: boolean): string` — Generate a regular expression string that can be used to find or validate all variations of this address [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1672)
|
|
250
|
+
- `regularExpression(substringSearch?: boolean): RegExp` — Generate a regular expression that can be used to find or validate all variations of this address. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1726)
|
|
251
251
|
|
|
252
252
|
**Properties**
|
|
253
253
|
|
|
@@ -265,9 +265,9 @@ A few terms used throughout the API can be confusing if you haven't worked deepl
|
|
|
265
265
|
- `subnetMask: number` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L108)
|
|
266
266
|
- `v4: boolean` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L109)
|
|
267
267
|
- `zone: string` — [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L110)
|
|
268
|
-
- `isInSubnet: (address: Address4 | Address6) => boolean` — Returns true if the given address is in the subnet of the current address. An `Address4` is never in the subnet of an `Address6`; convert with `Address6.fromAddress4()` or `to4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
269
|
-
- `isHostInSubnet: (address: Address4 | Address6) => boolean` — Returns true if this address's host bits fall inside the given subnet, ignoring this address's own subnet mask. Prefer this over `isInSubnet` when classifying a single address, so the answer doesn't change with the CIDR suffix the caller happened to write — notably when the address came from untrusted input and the result backs a trust-boundary decision. An `Address4` is never in the subnet of an `Address6`; convert with `Address6.fromAddress4()` or `to4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
270
|
-
- `isCorrect: () => boolean` — Returns true if the address is correct, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#
|
|
268
|
+
- `isInSubnet: (address: Address4 | Address6) => boolean` — Returns true if the given address is in the subnet of the current address. An `Address4` is never in the subnet of an `Address6`; convert with `Address6.fromAddress4()` or `to4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1277)
|
|
269
|
+
- `isHostInSubnet: (address: Address4 | Address6) => boolean` — Returns true if this address's host bits fall inside the given subnet, ignoring this address's own subnet mask. Prefer this over `isInSubnet` when classifying a single address, so the answer doesn't change with the CIDR suffix the caller happened to write — notably when the address came from untrusted input and the result backs a trust-boundary decision. An `Address4` is never in the subnet of an `Address6`; convert with `Address6.fromAddress4()` or `to4()` to compare across families. [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1289)
|
|
270
|
+
- `isCorrect: () => boolean` — Returns true if the address is correct, false otherwise [src](https://github.com/beaugunderson/ip-address/blob/main/src/ipv6.ts#L1295)
|
|
271
271
|
|
|
272
272
|
</details>
|
|
273
273
|
|
|
@@ -733,7 +733,7 @@ class Address6 {
|
|
|
733
733
|
address = this.parse4in6(address);
|
|
734
734
|
const badCharacters = address.match(constants6.RE_BAD_CHARACTERS);
|
|
735
735
|
if (badCharacters) {
|
|
736
|
-
throw new address_error_1.AddressError(`Bad character${badCharacters.length > 1 ? 's' : ''} detected in address: ${badCharacters.join('')}`, address.replace(constants6.RE_BAD_CHARACTERS,
|
|
736
|
+
throw new address_error_1.AddressError(`Bad character${badCharacters.length > 1 ? 's' : ''} detected in address: ${badCharacters.join('')}`, address.replace(constants6.RE_BAD_CHARACTERS, (character) => `<span class="parse-error">${helpers.escapeHtml(character)}</span>`));
|
|
737
737
|
}
|
|
738
738
|
const badAddress = address.match(constants6.RE_BAD_ADDRESS);
|
|
739
739
|
if (badAddress) {
|