@zuplo/cli 7.4.5 → 7.4.6
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/@modelcontextprotocol/client/node_modules/jose/dist/types/jwks/remote.d.ts +4 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jws/general/verify.d.ts +3 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/encrypt.d.ts +8 -14
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/sign.d.ts +8 -14
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/types/jwt/unsecured.d.ts +9 -15
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +30 -8
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +8 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +6 -13
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/decrypt.js +19 -19
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwe/general/encrypt.js +27 -20
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/embedded.js +15 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwk/thumbprint.js +11 -5
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/local.js +45 -53
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwks/remote.js +82 -103
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/compact/sign.js +10 -9
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/sign.js +2 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/flattened/verify.js +8 -7
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/sign.js +5 -3
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jws/general/verify.js +51 -21
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/decrypt.js +7 -9
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/encrypt.js +21 -50
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/sign.js +8 -41
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/jwt/unsecured.js +21 -42
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_key_pair.js +6 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/generate_secret.js +7 -6
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/key/import.js +16 -12
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/asn1.js +7 -2
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/content_encryption.js +7 -15
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/deflate.js +8 -0
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/helpers.js +1 -1
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +85 -28
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +40 -12
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwk_metadata.js +20 -0
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_sign.js +47 -36
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jws_verify.js +77 -45
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +82 -47
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key.js +24 -9
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_management.js +10 -4
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/key_options.js +6 -0
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/options.js +26 -0
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/dist/webapi/lib/type_checks.js +11 -13
- package/node_modules/@modelcontextprotocol/client/node_modules/jose/package.json +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwks/remote.d.ts +4 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jws/general/verify.d.ts +3 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/encrypt.d.ts +8 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/sign.d.ts +8 -14
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/types/jwt/unsecured.d.ts +9 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +30 -8
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +8 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +6 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/decrypt.js +19 -19
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwe/general/encrypt.js +27 -20
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/embedded.js +15 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwk/thumbprint.js +11 -5
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/local.js +45 -53
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwks/remote.js +82 -103
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/compact/sign.js +10 -9
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/sign.js +2 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/flattened/verify.js +8 -7
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/sign.js +5 -3
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jws/general/verify.js +51 -21
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/decrypt.js +7 -9
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/encrypt.js +21 -50
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/sign.js +8 -41
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/jwt/unsecured.js +21 -42
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_key_pair.js +6 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/generate_secret.js +7 -6
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/key/import.js +16 -12
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/asn1.js +7 -2
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/content_encryption.js +7 -15
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/deflate.js +8 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/helpers.js +1 -1
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +85 -28
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +40 -12
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwk_metadata.js +20 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_sign.js +47 -36
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jws_verify.js +77 -45
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +82 -47
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key.js +24 -9
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_management.js +10 -4
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/key_options.js +6 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/options.js +26 -0
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/dist/webapi/lib/type_checks.js +11 -13
- package/node_modules/@modelcontextprotocol/sdk/node_modules/jose/package.json +1 -1
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +12 -18
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core-stateless.js +15 -47
- package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +15 -47
- package/node_modules/@posthog/core/dist/types.d.ts +4 -1
- package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/package.json +2 -2
- package/node_modules/@posthog/core/src/logs/index.spec.ts +77 -0
- package/node_modules/@posthog/core/src/logs/index.ts +1 -1
- package/node_modules/@posthog/core/src/posthog-core-stateless.ts +40 -65
- package/node_modules/@posthog/core/src/types.ts +3 -1
- package/node_modules/@posthog/types/dist/index.d.ts +1 -1
- package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/posthog-config.d.ts +20 -5
- package/node_modules/@posthog/types/dist/posthog-config.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/index.ts +1 -0
- package/node_modules/@posthog/types/src/posthog-config.ts +21 -5
- package/node_modules/@zuplo/core/customer.cli.minified.js +1 -1
- package/node_modules/@zuplo/core/index.minified.js +1 -1
- 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-IZE65N7D.js → chunk-CUK3VROF.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/{chunk-4CDML74A.js → chunk-K4TBJG47.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/{chunk-4VE55TG3.js → chunk-S4EBLGSU.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/{chunk-4POCC75H.js → chunk-XF3IIUDX.js} +4 -4
- package/node_modules/@zuplo/runtime/out/esm/{chunk-4POCC75H.js.map → chunk-XF3IIUDX.js.map} +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZPOD3IK4.js +403 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-ZPOD3IK4.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/package.json +1 -1
- package/node_modules/fast-uri/index.js +201 -48
- package/node_modules/fast-uri/lib/schemes.js +9 -4
- package/node_modules/fast-uri/lib/utils.js +388 -91
- package/node_modules/fast-uri/package.json +1 -1
- package/node_modules/fast-uri/test/component-safe-serialization.test.js +105 -0
- package/node_modules/fast-uri/test/equal.test.js +31 -3
- package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
- package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
- package/node_modules/fast-uri/test/ipv6-validation.test.js +90 -0
- package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
- package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
- package/node_modules/fast-uri/test/parse.test.js +7 -3
- package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
- package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
- package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
- package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
- package/node_modules/fast-uri/test/security.test.js +75 -3
- package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
- package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
- package/node_modules/hono/dist/cjs/client/client.js +25 -11
- package/node_modules/hono/dist/cjs/client/utils.js +3 -0
- package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
- package/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
- package/node_modules/hono/dist/cjs/middleware/etag/index.js +1 -1
- package/node_modules/hono/dist/cjs/request.js +8 -4
- package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +10 -3
- package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +47 -83
- package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +2 -1
- package/node_modules/hono/dist/cjs/router/trie-router/node.js +4 -3
- package/node_modules/hono/dist/cjs/router/utils.js +27 -0
- package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
- package/node_modules/hono/dist/cjs/utils/stream.js +7 -1
- package/node_modules/hono/dist/client/client.js +25 -11
- package/node_modules/hono/dist/client/utils.js +3 -0
- package/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
- package/node_modules/hono/dist/jsx/dom/render.js +2 -0
- package/node_modules/hono/dist/middleware/etag/index.js +1 -1
- package/node_modules/hono/dist/request.js +8 -4
- package/node_modules/hono/dist/router/reg-exp-router/node.js +6 -2
- package/node_modules/hono/dist/router/reg-exp-router/router.js +53 -84
- package/node_modules/hono/dist/router/reg-exp-router/trie.js +2 -1
- package/node_modules/hono/dist/router/trie-router/node.js +4 -3
- package/node_modules/hono/dist/router/utils.js +5 -0
- package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -0
- package/node_modules/hono/dist/types/router/utils.d.ts +1 -0
- package/node_modules/hono/dist/utils/cookie.js +1 -1
- package/node_modules/hono/dist/utils/stream.js +7 -1
- package/node_modules/hono/package.json +1 -1
- package/package.json +11 -11
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SX4HBWT.js +0 -409
- package/node_modules/@zuplo/runtime/out/esm/chunk-4SX4HBWT.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-IZE65N7D.js.map → chunk-CUK3VROF.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-4CDML74A.js.map → chunk-K4TBJG47.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-4VE55TG3.js.map → chunk-S4EBLGSU.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-4POCC75H.js.LEGAL.txt → chunk-XF3IIUDX.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-4SX4HBWT.js.LEGAL.txt → chunk-ZPOD3IK4.js.LEGAL.txt} +0 -0
|
@@ -5,25 +5,25 @@ import {
|
|
|
5
5
|
UnsupportedPathError
|
|
6
6
|
} from "../../router.js";
|
|
7
7
|
import { checkOptionalParameter } from "../../utils/url.js";
|
|
8
|
+
import { createNullObject } from "../utils.js";
|
|
8
9
|
import { match, emptyParam } from "./matcher.js";
|
|
9
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
LABEL_REG_EXP_STR,
|
|
12
|
+
ONLY_WILDCARD_REG_EXP_STR,
|
|
13
|
+
PATH_ERROR,
|
|
14
|
+
TAIL_WILDCARD_REG_EXP_STR
|
|
15
|
+
} from "./node.js";
|
|
10
16
|
import { Trie } from "./trie.js";
|
|
11
|
-
var wildcardRegExpCache =
|
|
17
|
+
var wildcardRegExpCache = createNullObject();
|
|
12
18
|
function buildWildcardRegExp(path) {
|
|
13
19
|
return wildcardRegExpCache[path] ??= new RegExp(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(
|
|
20
|
+
`^${path.replace(
|
|
21
|
+
/\/:[^/{}]+(?:\{\[\^\/]\+})?(?=[/{]|$)|\/?\*$|([.\\+*[^\]$()?{}|])/g,
|
|
22
|
+
(match2, metaChar) => metaChar ? `\\${metaChar}` : match2 === "/*" ? TAIL_WILDCARD_REG_EXP_STR : match2 === "*" ? ONLY_WILDCARD_REG_EXP_STR : `/:${LABEL_REG_EXP_STR}`
|
|
17
23
|
)}$`
|
|
18
24
|
);
|
|
19
25
|
}
|
|
20
|
-
function clearWildcardRegExpCache() {
|
|
21
|
-
wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
22
|
-
}
|
|
23
26
|
function findMiddleware(middleware, path) {
|
|
24
|
-
if (!middleware) {
|
|
25
|
-
return void 0;
|
|
26
|
-
}
|
|
27
27
|
for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
|
|
28
28
|
if (buildWildcardRegExp(k).test(path)) {
|
|
29
29
|
return [...middleware[k]];
|
|
@@ -37,8 +37,8 @@ var RegExpRouter = class {
|
|
|
37
37
|
#routes;
|
|
38
38
|
#tries;
|
|
39
39
|
constructor() {
|
|
40
|
-
this.#middleware = { [METHOD_NAME_ALL]:
|
|
41
|
-
this.#routes = { [METHOD_NAME_ALL]:
|
|
40
|
+
this.#middleware = { [METHOD_NAME_ALL]: createNullObject() };
|
|
41
|
+
this.#routes = { [METHOD_NAME_ALL]: createNullObject() };
|
|
42
42
|
this.#tries = { [METHOD_NAME_ALL]: new Trie() };
|
|
43
43
|
}
|
|
44
44
|
#insertPath(method, path) {
|
|
@@ -51,117 +51,86 @@ var RegExpRouter = class {
|
|
|
51
51
|
add(method, path, handler) {
|
|
52
52
|
const middleware = this.#middleware;
|
|
53
53
|
const routes = this.#routes;
|
|
54
|
-
if (!middleware
|
|
54
|
+
if (!middleware) {
|
|
55
55
|
throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
56
56
|
}
|
|
57
57
|
if (!middleware[method]) {
|
|
58
58
|
this.#tries[method] = new Trie();
|
|
59
|
-
[middleware, routes]
|
|
60
|
-
handlerMap[method] =
|
|
61
|
-
|
|
59
|
+
for (const handlerMap of [middleware, routes]) {
|
|
60
|
+
handlerMap[method] = createNullObject();
|
|
61
|
+
for (const p in handlerMap[METHOD_NAME_ALL]) {
|
|
62
62
|
handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
|
|
63
63
|
this.#insertPath(method, p);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
66
|
}
|
|
67
67
|
if (path === "/*") {
|
|
68
68
|
path = "*";
|
|
69
69
|
}
|
|
70
|
-
const
|
|
70
|
+
const methods = method === METHOD_NAME_ALL ? Object.keys(middleware) : [method];
|
|
71
71
|
if (/\*$/.test(path)) {
|
|
72
72
|
const re = buildWildcardRegExp(path);
|
|
73
|
-
|
|
74
|
-
if (
|
|
73
|
+
for (const m of methods) {
|
|
74
|
+
if (!middleware[m][path]) {
|
|
75
75
|
this.#insertPath(m, path);
|
|
76
76
|
middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
|
|
77
77
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
re.test(p) &&
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.keys(routes).forEach((m) => {
|
|
87
|
-
if (method === METHOD_NAME_ALL || method === m) {
|
|
88
|
-
Object.keys(routes[m]).forEach(
|
|
89
|
-
(p) => re.test(p) && routes[m][p].push([handler, paramCount])
|
|
90
|
-
);
|
|
78
|
+
}
|
|
79
|
+
for (const handlerMap of [middleware, routes]) {
|
|
80
|
+
for (const m of methods) {
|
|
81
|
+
for (const p in handlerMap[m]) {
|
|
82
|
+
re.test(p) && handlerMap[m][p].push([handler, path]);
|
|
83
|
+
}
|
|
91
84
|
}
|
|
92
|
-
}
|
|
85
|
+
}
|
|
93
86
|
return;
|
|
94
87
|
}
|
|
95
88
|
const paths = checkOptionalParameter(path) || [path];
|
|
96
|
-
for (
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
this.#insertPath(m, path2);
|
|
102
|
-
routes[m][path2] = [
|
|
103
|
-
...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []
|
|
104
|
-
];
|
|
105
|
-
}
|
|
106
|
-
routes[m][path2].push([handler, paramCount - len + i + 1]);
|
|
89
|
+
for (const path2 of paths) {
|
|
90
|
+
for (const m of methods) {
|
|
91
|
+
if (!routes[m][path2]) {
|
|
92
|
+
this.#insertPath(m, path2);
|
|
93
|
+
routes[m][path2] = findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || [];
|
|
107
94
|
}
|
|
108
|
-
|
|
95
|
+
routes[m][path2].push([handler, path2]);
|
|
96
|
+
}
|
|
109
97
|
}
|
|
110
98
|
}
|
|
111
99
|
match = match;
|
|
112
100
|
buildAllMatchers() {
|
|
113
|
-
const matchers =
|
|
114
|
-
Object.keys(this.#routes)
|
|
115
|
-
matchers[method]
|
|
116
|
-
}
|
|
101
|
+
const matchers = createNullObject();
|
|
102
|
+
for (const method of Object.keys(this.#routes)) {
|
|
103
|
+
matchers[method] = this.#buildMatcher(method);
|
|
104
|
+
}
|
|
117
105
|
this.#middleware = this.#routes = this.#tries = void 0;
|
|
118
|
-
|
|
106
|
+
wildcardRegExpCache = createNullObject();
|
|
119
107
|
return matchers;
|
|
120
108
|
}
|
|
121
109
|
#buildMatcher(method) {
|
|
122
110
|
const middleware = this.#middleware[method];
|
|
123
111
|
const routes = this.#routes[method];
|
|
124
112
|
const trie = this.#tries[method];
|
|
125
|
-
const staticMap =
|
|
113
|
+
const staticMap = createNullObject();
|
|
126
114
|
const handlerData = [];
|
|
127
|
-
[
|
|
115
|
+
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
116
|
+
for (const r of [middleware, routes]) {
|
|
128
117
|
for (const path in r) {
|
|
129
118
|
const handlers = r[path];
|
|
130
119
|
const pathData = trie.paths[path];
|
|
131
120
|
if (!pathData) {
|
|
132
|
-
staticMap[path] = [handlers.map(([h]) => [h,
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
const paramAssoc = pathData[1];
|
|
136
|
-
handlerData[pathData[0]] = handlers.map(([h, paramCount]) => {
|
|
137
|
-
const paramIndexMap = /* @__PURE__ */ Object.create(null);
|
|
138
|
-
paramCount -= 1;
|
|
139
|
-
for (; paramCount >= 0; paramCount--) {
|
|
140
|
-
const [key, value] = paramAssoc[paramCount];
|
|
141
|
-
paramIndexMap[key] = value;
|
|
142
|
-
}
|
|
143
|
-
return [h, paramIndexMap];
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
148
|
-
for (let i = 0, len = handlerData.length; i < len; i++) {
|
|
149
|
-
for (let j = 0, len2 = handlerData[i].length; j < len2; j++) {
|
|
150
|
-
const map = handlerData[i][j]?.[1];
|
|
151
|
-
if (!map) {
|
|
121
|
+
staticMap[path] = [handlers.map(([h]) => [h, createNullObject()]), emptyParam];
|
|
152
122
|
continue;
|
|
153
123
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
124
|
+
handlerData[pathData[0]] = handlers.map(([h, handlerPath]) => [
|
|
125
|
+
h,
|
|
126
|
+
trie.paths[handlerPath][1].reduceRight((map, [key], i) => {
|
|
127
|
+
map[key] = paramReplacementMap[pathData[1][i][1]];
|
|
128
|
+
return map;
|
|
129
|
+
}, createNullObject())
|
|
130
|
+
]);
|
|
158
131
|
}
|
|
159
132
|
}
|
|
160
|
-
|
|
161
|
-
for (const i in indexReplacementMap) {
|
|
162
|
-
handlerMap[i] = handlerData[indexReplacementMap[i]];
|
|
163
|
-
}
|
|
164
|
-
return [regexp, handlerMap, staticMap];
|
|
133
|
+
return [regexp, indexReplacementMap.map((i) => handlerData[i]), staticMap];
|
|
165
134
|
}
|
|
166
135
|
};
|
|
167
136
|
export {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// src/router/reg-exp-router/trie.ts
|
|
2
|
+
import { createNullObject } from "../utils.js";
|
|
2
3
|
import { Node } from "./node.js";
|
|
3
4
|
var Trie = class {
|
|
4
5
|
#context = { varIndex: 0 };
|
|
5
6
|
#root = new Node();
|
|
6
7
|
#index = 0;
|
|
7
8
|
// dynamic path -> [handler index, param assoc]; static paths are not registered
|
|
8
|
-
paths =
|
|
9
|
+
paths = createNullObject();
|
|
9
10
|
insert(path, isStatic) {
|
|
10
11
|
if (isStatic) {
|
|
11
12
|
this.#root.insert(path.split(""), 0, [], this.#context, true);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// src/router/trie-router/node.ts
|
|
2
2
|
import { METHOD_NAME_ALL } from "../../router.js";
|
|
3
3
|
import { getPattern, splitPath, splitRoutingPath } from "../../utils/url.js";
|
|
4
|
-
|
|
4
|
+
import { createNullObject } from "../utils.js";
|
|
5
|
+
var emptyParams = createNullObject();
|
|
5
6
|
var order = 0;
|
|
6
7
|
var Node = class _Node {
|
|
7
8
|
#methods = [];
|
|
8
|
-
#children =
|
|
9
|
+
#children = createNullObject();
|
|
9
10
|
#patterns = [];
|
|
10
11
|
#pattern;
|
|
11
12
|
#params = emptyParams;
|
|
@@ -42,7 +43,7 @@ var Node = class _Node {
|
|
|
42
43
|
const m = node.#methods[i];
|
|
43
44
|
const handlerSet = m[method] || m[METHOD_NAME_ALL];
|
|
44
45
|
if (handlerSet) {
|
|
45
|
-
handlerSet.params =
|
|
46
|
+
handlerSet.params = createNullObject();
|
|
46
47
|
handlerSets.push(handlerSet);
|
|
47
48
|
for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) {
|
|
48
49
|
const key = handlerSet.possibleKeys[i2];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const LABEL_REG_EXP_STR = "[^/]+";
|
|
2
|
+
export declare const ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
3
|
+
export declare const TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
1
4
|
export declare const PATH_ERROR: unique symbol;
|
|
2
5
|
export type ParamAssocArray = [string, number][];
|
|
3
6
|
export interface Context {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createNullObject: () => any;
|
|
@@ -77,7 +77,7 @@ var parseSigned = async (cookie, secret, name) => {
|
|
|
77
77
|
const secretKey = await getCryptoKey(secret);
|
|
78
78
|
for (const [key, value] of Object.entries(parse(cookie, name))) {
|
|
79
79
|
const signatureStartPos = value.lastIndexOf(".");
|
|
80
|
-
if (signatureStartPos <
|
|
80
|
+
if (signatureStartPos < 0) {
|
|
81
81
|
continue;
|
|
82
82
|
}
|
|
83
83
|
const signedValue = value.substring(0, signatureStartPos);
|
|
@@ -75,7 +75,13 @@ var StreamingApi = class {
|
|
|
75
75
|
abort() {
|
|
76
76
|
if (!this.aborted) {
|
|
77
77
|
this.aborted = true;
|
|
78
|
-
this.abortSubscribers.forEach((subscriber) =>
|
|
78
|
+
this.abortSubscribers.forEach((subscriber) => {
|
|
79
|
+
try {
|
|
80
|
+
void Promise.resolve(subscriber()).catch(() => {
|
|
81
|
+
});
|
|
82
|
+
} catch {
|
|
83
|
+
}
|
|
84
|
+
});
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
87
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.6",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"@opentelemetry/api": "1.9.0",
|
|
29
29
|
"@opentelemetry/api-logs": "0.220.0",
|
|
30
30
|
"@swc/core": "1.10.18",
|
|
31
|
-
"@zuplo/core": "7.4.
|
|
31
|
+
"@zuplo/core": "7.4.6",
|
|
32
32
|
"@zuplo/editor": "1.0.31094607111",
|
|
33
|
-
"@zuplo/openapi-tools": "7.4.
|
|
34
|
-
"@zuplo/runtime": "7.4.
|
|
33
|
+
"@zuplo/openapi-tools": "7.4.6",
|
|
34
|
+
"@zuplo/runtime": "7.4.6",
|
|
35
35
|
"chalk": "5.4.1",
|
|
36
36
|
"chokidar": "3.5.3",
|
|
37
37
|
"cookie": "1.0.2",
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"workerd": "1.20241230.0",
|
|
63
63
|
"yargs": "17.7.2",
|
|
64
64
|
"zod": "4.4.3",
|
|
65
|
-
"@zuplo/graphql": "7.4.
|
|
66
|
-
"@zuplo/otel": "7.4.
|
|
65
|
+
"@zuplo/graphql": "7.4.6",
|
|
66
|
+
"@zuplo/otel": "7.4.6"
|
|
67
67
|
},
|
|
68
68
|
"optionalDependencies": {
|
|
69
|
-
"@zuplo/lint-darwin-arm64": "7.4.
|
|
70
|
-
"@zuplo/lint-darwin-x64": "7.4.
|
|
71
|
-
"@zuplo/lint-linux-x64": "7.4.
|
|
72
|
-
"@zuplo/lint-linux-arm64": "7.4.
|
|
73
|
-
"@zuplo/lint-win32-x64": "7.4.
|
|
69
|
+
"@zuplo/lint-darwin-arm64": "7.4.6",
|
|
70
|
+
"@zuplo/lint-darwin-x64": "7.4.6",
|
|
71
|
+
"@zuplo/lint-linux-x64": "7.4.6",
|
|
72
|
+
"@zuplo/lint-linux-arm64": "7.4.6",
|
|
73
|
+
"@zuplo/lint-win32-x64": "7.4.6"
|
|
74
74
|
},
|
|
75
75
|
"bundleDependencies": [
|
|
76
76
|
"@inquirer/prompts",
|