@zuplo/cli 6.69.6 → 6.69.9
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/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/confirm-production-deploy.integration.test.js +184 -0
- package/dist/__tests__/integration/confirm-production-deploy.integration.test.js.map +1 -0
- package/dist/__tests__/integration/deploy.integration.test.js +1 -0
- package/dist/__tests__/integration/deploy.integration.test.js.map +1 -1
- package/dist/__tests__/integration/jest-mocks-setup.js +3 -0
- package/dist/__tests__/integration/jest-mocks-setup.js.map +1 -1
- package/dist/__tests__/integration/whoami.integration.test.js +27 -0
- package/dist/__tests__/integration/whoami.integration.test.js.map +1 -1
- package/dist/bucket/list/handler.d.ts +8 -0
- package/dist/bucket/list/handler.d.ts.map +1 -0
- package/dist/bucket/list/handler.js +54 -0
- package/dist/bucket/list/handler.js.map +1 -0
- package/dist/bucket/models.d.ts +23 -0
- package/dist/bucket/models.d.ts.map +1 -0
- package/dist/bucket/models.js +2 -0
- package/dist/bucket/models.js.map +1 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/cmds/bucket/index.d.ts +4 -0
- package/dist/cmds/bucket/index.d.ts.map +1 -0
- package/dist/cmds/bucket/index.js +9 -0
- package/dist/cmds/bucket/index.js.map +1 -0
- package/dist/cmds/bucket/list.d.ts +9 -0
- package/dist/cmds/bucket/list.d.ts.map +1 -0
- package/dist/cmds/bucket/list.js +60 -0
- package/dist/cmds/bucket/list.js.map +1 -0
- package/dist/cmds/deploy.d.ts.map +1 -1
- package/dist/cmds/deploy.js +4 -1
- package/dist/cmds/deploy.js.map +1 -1
- package/dist/cmds/logout.d.ts +9 -0
- package/dist/cmds/logout.d.ts.map +1 -0
- package/dist/cmds/logout.js +23 -0
- package/dist/cmds/logout.js.map +1 -0
- package/dist/cmds/whoami.d.ts.map +1 -1
- package/dist/cmds/whoami.js +1 -2
- package/dist/cmds/whoami.js.map +1 -1
- package/dist/common/middleware/confirm-production-deploy.d.ts +4 -0
- package/dist/common/middleware/confirm-production-deploy.d.ts.map +1 -0
- package/dist/common/middleware/confirm-production-deploy.js +49 -0
- package/dist/common/middleware/confirm-production-deploy.js.map +1 -0
- package/dist/common/middleware/get-environment-param.d.ts +6 -0
- package/dist/common/middleware/get-environment-param.d.ts.map +1 -1
- package/dist/common/middleware/get-environment-param.js +15 -0
- package/dist/common/middleware/get-environment-param.js.map +1 -1
- package/dist/common/middleware/get-environment-param.test.d.ts +2 -0
- package/dist/common/middleware/get-environment-param.test.d.ts.map +1 -0
- package/dist/common/middleware/get-environment-param.test.js +33 -0
- package/dist/common/middleware/get-environment-param.test.js.map +1 -0
- package/dist/common/output.d.ts +3 -0
- package/dist/common/output.d.ts.map +1 -1
- package/dist/common/output.js +11 -0
- package/dist/common/output.js.map +1 -1
- package/dist/common/read-linked-config.d.ts +6 -1
- package/dist/common/read-linked-config.d.ts.map +1 -1
- package/dist/common/read-linked-config.js +14 -4
- package/dist/common/read-linked-config.js.map +1 -1
- package/dist/common/read-linked-config.test.js +97 -0
- package/dist/common/read-linked-config.test.js.map +1 -1
- package/dist/deploy/environments.d.ts +1 -0
- package/dist/deploy/environments.d.ts.map +1 -1
- package/dist/deploy/environments.js +11 -7
- package/dist/deploy/environments.js.map +1 -1
- package/dist/login/logout.d.ts +5 -0
- package/dist/login/logout.d.ts.map +1 -0
- package/dist/login/logout.js +6 -0
- package/dist/login/logout.js.map +1 -0
- package/dist/login/tokens.d.ts +1 -0
- package/dist/login/tokens.d.ts.map +1 -1
- package/dist/login/tokens.js +16 -1
- package/dist/login/tokens.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/whoami/handler.d.ts +1 -1
- package/dist/whoami/handler.d.ts.map +1 -1
- package/dist/whoami/handler.js +8 -1
- package/dist/whoami/handler.js.map +1 -1
- package/node_modules/@zuplo/core/customer.cli.minified.js +225 -211
- package/node_modules/@zuplo/core/index.minified.js +237 -223
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/editor/node_modules/find-my-way/.github/workflows/node.js.yml +1 -1
- package/node_modules/@zuplo/editor/node_modules/find-my-way/README.md +10 -0
- package/node_modules/@zuplo/editor/node_modules/find-my-way/index.d.ts +6 -0
- package/node_modules/@zuplo/editor/node_modules/find-my-way/index.js +37 -4
- package/node_modules/@zuplo/editor/node_modules/find-my-way/lib/handler-storage.js +2 -2
- package/node_modules/@zuplo/editor/node_modules/find-my-way/package.json +3 -3
- package/node_modules/@zuplo/editor/node_modules/find-my-way/test/repro-issue-414.test.js +57 -0
- package/node_modules/@zuplo/editor/node_modules/find-my-way/test/types/router.test-d.ts +1 -0
- 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/index.js +48 -48
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +23 -2
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/graphql/index.d.ts +1 -0
- package/node_modules/graphql/language/ast.d.ts +10 -1
- package/node_modules/graphql/language/ast.js +8 -1
- package/node_modules/graphql/language/ast.mjs +8 -1
- package/node_modules/graphql/language/directiveLocation.d.ts +1 -0
- package/node_modules/graphql/language/directiveLocation.js +1 -0
- package/node_modules/graphql/language/directiveLocation.mjs +1 -0
- package/node_modules/graphql/language/index.d.ts +1 -0
- package/node_modules/graphql/language/kinds.d.ts +1 -0
- package/node_modules/graphql/language/kinds.js +1 -0
- package/node_modules/graphql/language/kinds.mjs +1 -0
- package/node_modules/graphql/language/parser.d.ts +14 -0
- package/node_modules/graphql/language/parser.js +33 -0
- package/node_modules/graphql/language/parser.mjs +33 -0
- package/node_modules/graphql/language/predicates.js +3 -1
- package/node_modules/graphql/language/predicates.mjs +5 -1
- package/node_modules/graphql/language/printer.js +13 -1
- package/node_modules/graphql/language/printer.mjs +13 -1
- package/node_modules/graphql/package.json +1 -1
- package/node_modules/graphql/type/directives.d.ts +9 -1
- package/node_modules/graphql/type/directives.js +10 -1
- package/node_modules/graphql/type/directives.mjs +10 -1
- package/node_modules/graphql/type/introspection.js +24 -1
- package/node_modules/graphql/type/introspection.mjs +24 -1
- package/node_modules/graphql/utilities/buildASTSchema.js +4 -0
- package/node_modules/graphql/utilities/buildASTSchema.mjs +4 -0
- package/node_modules/graphql/utilities/buildClientSchema.js +1 -0
- package/node_modules/graphql/utilities/buildClientSchema.mjs +1 -0
- package/node_modules/graphql/utilities/extendSchema.js +58 -3
- package/node_modules/graphql/utilities/extendSchema.mjs +58 -3
- package/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +16 -0
- package/node_modules/graphql/utilities/getIntrospectionQuery.js +31 -38
- package/node_modules/graphql/utilities/getIntrospectionQuery.mjs +31 -38
- package/node_modules/graphql/utilities/introspectionFromSchema.js +1 -0
- package/node_modules/graphql/utilities/introspectionFromSchema.mjs +1 -0
- package/node_modules/graphql/utilities/printSchema.js +1 -0
- package/node_modules/graphql/utilities/printSchema.mjs +1 -0
- package/node_modules/graphql/utilities/valueFromAST.js +12 -2
- package/node_modules/graphql/utilities/valueFromAST.mjs +12 -2
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.js +4 -0
- package/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +4 -0
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +12 -0
- package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +12 -0
- package/node_modules/graphql/version.js +3 -3
- package/node_modules/graphql/version.mjs +3 -3
- package/package.json +6 -6
|
@@ -63,6 +63,6 @@ jobs:
|
|
|
63
63
|
pull-requests: write
|
|
64
64
|
contents: write
|
|
65
65
|
steps:
|
|
66
|
-
- uses: fastify/github-action-merge-dependabot@
|
|
66
|
+
- uses: fastify/github-action-merge-dependabot@30c3f8f14a4f7b315ba38dbc1b793d27128fef82 # v3.12.0
|
|
67
67
|
with:
|
|
68
68
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -126,6 +126,16 @@ const router = require('find-my-way')({
|
|
|
126
126
|
})
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
If you want to handle the case where the `maxParamLength` is exceeded, you can provide a custom `onMaxParamLength` handler. This handler will be invoked if no other route (e.g. a wildcard) matches the path.
|
|
130
|
+
```js
|
|
131
|
+
const router = require('find-my-way')({
|
|
132
|
+
onMaxParamLength: function (path, req, res) {
|
|
133
|
+
res.statusCode = 414
|
|
134
|
+
res.end('URI Too Long')
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
```
|
|
138
|
+
|
|
129
139
|
If you are using a regex based route, `find-my-way` will throw an error if detects potentially catastrophic exponential-time regular expressions *(internally uses [`safe-regex2`](https://github.com/fastify/safe-regex2))*.<br/>
|
|
130
140
|
If you want to disable this behavior, pass the option `allowUnsafeRegex`.
|
|
131
141
|
```js
|
|
@@ -96,6 +96,7 @@ function Router (opts) {
|
|
|
96
96
|
this.ignoreTrailingSlash = opts.ignoreTrailingSlash || false
|
|
97
97
|
this.ignoreDuplicateSlashes = opts.ignoreDuplicateSlashes || false
|
|
98
98
|
this.maxParamLength = opts.maxParamLength || 100
|
|
99
|
+
this.onMaxParamLength = opts.onMaxParamLength || null
|
|
99
100
|
this.allowUnsafeRegex = opts.allowUnsafeRegex || false
|
|
100
101
|
this.constrainer = new Constrainer(opts.constraints)
|
|
101
102
|
this.useSemicolonDelimiter = opts.useSemicolonDelimiter || false
|
|
@@ -608,6 +609,7 @@ Router.prototype.find = function find (method, path, derivedConstraints) {
|
|
|
608
609
|
const pathLen = path.length
|
|
609
610
|
|
|
610
611
|
const brothersNodesStack = []
|
|
612
|
+
let maxParamLengthExceeded = false
|
|
611
613
|
|
|
612
614
|
while (true) {
|
|
613
615
|
if (pathIndex === pathLen && currentNode.isLeafNode) {
|
|
@@ -626,6 +628,9 @@ Router.prototype.find = function find (method, path, derivedConstraints) {
|
|
|
626
628
|
|
|
627
629
|
if (node === null) {
|
|
628
630
|
if (brothersNodesStack.length === 0) {
|
|
631
|
+
if (maxParamLengthExceeded && this.onMaxParamLength) {
|
|
632
|
+
return this._onMaxParamLength(originPath)
|
|
633
|
+
}
|
|
629
634
|
return null
|
|
630
635
|
}
|
|
631
636
|
|
|
@@ -667,18 +672,34 @@ Router.prototype.find = function find (method, path, derivedConstraints) {
|
|
|
667
672
|
|
|
668
673
|
if (currentNode.isRegex) {
|
|
669
674
|
const matchedParameters = currentNode.regex.exec(param)
|
|
670
|
-
if (matchedParameters === null)
|
|
675
|
+
if (matchedParameters === null) {
|
|
676
|
+
node = null
|
|
677
|
+
continue
|
|
678
|
+
}
|
|
671
679
|
|
|
680
|
+
let regexMaxParamLengthExceeded = false
|
|
672
681
|
for (let i = 1; i < matchedParameters.length; i++) {
|
|
673
682
|
const matchedParam = matchedParameters[i]
|
|
674
683
|
if (matchedParam.length > maxParamLength) {
|
|
675
|
-
|
|
684
|
+
regexMaxParamLengthExceeded = true
|
|
685
|
+
break
|
|
676
686
|
}
|
|
677
|
-
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
if (regexMaxParamLengthExceeded) {
|
|
690
|
+
maxParamLengthExceeded = true
|
|
691
|
+
node = null
|
|
692
|
+
continue
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
for (let i = 1; i < matchedParameters.length; i++) {
|
|
696
|
+
params.push(matchedParameters[i])
|
|
678
697
|
}
|
|
679
698
|
} else {
|
|
680
699
|
if (param.length > maxParamLength) {
|
|
681
|
-
|
|
700
|
+
maxParamLengthExceeded = true
|
|
701
|
+
node = null
|
|
702
|
+
continue
|
|
682
703
|
}
|
|
683
704
|
params.push(param)
|
|
684
705
|
}
|
|
@@ -719,6 +740,18 @@ Router.prototype._onBadUrl = function (path) {
|
|
|
719
740
|
}
|
|
720
741
|
}
|
|
721
742
|
|
|
743
|
+
Router.prototype._onMaxParamLength = function (path) {
|
|
744
|
+
if (this.onMaxParamLength === null) {
|
|
745
|
+
return null
|
|
746
|
+
}
|
|
747
|
+
const onMaxParamLength = this.onMaxParamLength
|
|
748
|
+
return {
|
|
749
|
+
handler: (req, res, ctx) => onMaxParamLength(path, req, res),
|
|
750
|
+
params: {},
|
|
751
|
+
store: null
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
|
|
722
755
|
Router.prototype.prettyPrint = function (options = {}) {
|
|
723
756
|
const method = options.method
|
|
724
757
|
|
|
@@ -165,8 +165,8 @@ class HandlerStorage {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
// Return the
|
|
169
|
-
lines.push('return this.handlers[Math.
|
|
168
|
+
// Return the highest set bit index in the candidates bitmask.
|
|
169
|
+
lines.push('return this.handlers[31 - Math.clz32(candidates)]')
|
|
170
170
|
|
|
171
171
|
this._getHandlerMatchingConstraints = new Function('derivedConstraints', lines.join('\n')) // eslint-disable-line
|
|
172
172
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "find-my-way",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
4
4
|
"description": "Crazy fast http radix based router",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^25.0.3",
|
|
38
38
|
"benchmark": "^2.1.4",
|
|
39
|
-
"borp": "^0.
|
|
39
|
+
"borp": "^1.0.0",
|
|
40
40
|
"chalk": "^5.4.1",
|
|
41
41
|
"inquirer": "^13.1.0",
|
|
42
|
-
"pre-commit": "^
|
|
42
|
+
"pre-commit": "^2.0.0",
|
|
43
43
|
"proxyquire": "^2.1.3",
|
|
44
44
|
"rfdc": "^1.3.0",
|
|
45
45
|
"simple-git": "^3.7.1",
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { test } = require('node:test')
|
|
4
|
+
const FindMyWay = require('../')
|
|
5
|
+
|
|
6
|
+
test('should return null when maxParamLength is exceeded (current behavior)', t => {
|
|
7
|
+
t.plan(1)
|
|
8
|
+
const findMyWay = FindMyWay({ maxParamLength: 5 })
|
|
9
|
+
findMyWay.on('GET', '/test/:param', () => 'param')
|
|
10
|
+
|
|
11
|
+
const handle = findMyWay.find('GET', '/test/123456')
|
|
12
|
+
t.assert.equal(handle, null)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
test('should still match other routes if one parametric route exceeds maxParamLength (static)', t => {
|
|
16
|
+
t.plan(2)
|
|
17
|
+
const findMyWay = FindMyWay({ maxParamLength: 5 })
|
|
18
|
+
findMyWay.on('GET', '/test/:param', () => 'param')
|
|
19
|
+
findMyWay.on('GET', '/test/special', () => 'special')
|
|
20
|
+
|
|
21
|
+
const handle = findMyWay.find('GET', '/test/special')
|
|
22
|
+
t.assert.ok(handle)
|
|
23
|
+
t.assert.equal(handle.handler(), 'special')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
test('should fail to match any route if the only candidate exceeds maxParamLength', t => {
|
|
27
|
+
t.plan(1)
|
|
28
|
+
const findMyWay = FindMyWay({ maxParamLength: 5 })
|
|
29
|
+
findMyWay.on('GET', '/test/:param', () => 'param')
|
|
30
|
+
|
|
31
|
+
const handle = findMyWay.find('GET', '/test/123456789')
|
|
32
|
+
t.assert.equal(handle, null)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
test('should match wildcard if parametric exceeds maxParamLength', t => {
|
|
36
|
+
t.plan(2)
|
|
37
|
+
const findMyWay = FindMyWay({ maxParamLength: 5 })
|
|
38
|
+
findMyWay.on('GET', '/test/:param', () => 'param')
|
|
39
|
+
findMyWay.on('GET', '/test/*', () => 'wildcard')
|
|
40
|
+
|
|
41
|
+
const handle = findMyWay.find('GET', '/test/123456789')
|
|
42
|
+
t.assert.ok(handle)
|
|
43
|
+
t.assert.equal(handle.handler(), 'wildcard')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test('should return custom onMaxParamLength handler if provided and no other route matches', t => {
|
|
47
|
+
t.plan(2)
|
|
48
|
+
const findMyWay = FindMyWay({
|
|
49
|
+
maxParamLength: 5,
|
|
50
|
+
onMaxParamLength: (path, req, res) => 'custom error'
|
|
51
|
+
})
|
|
52
|
+
findMyWay.on('GET', '/test/:param', () => 'param')
|
|
53
|
+
|
|
54
|
+
const handle = findMyWay.find('GET', '/test/123456')
|
|
55
|
+
t.assert.ok(handle)
|
|
56
|
+
t.assert.equal(handle.handler(), 'custom error')
|
|
57
|
+
})
|
|
@@ -27,6 +27,7 @@ expectType<string>(Router.trimLastSlash('/hello/'))
|
|
|
27
27
|
querystringParser: (queryString) => {},
|
|
28
28
|
defaultRoute (http1Req, http1Res) {},
|
|
29
29
|
onBadUrl (path, http1Req, http1Res) {},
|
|
30
|
+
onMaxParamLength (path, http1Req, http1Res) {},
|
|
30
31
|
constraints: {
|
|
31
32
|
foo: {
|
|
32
33
|
name: 'foo',
|