@orpc/nest 2.0.0-beta.25 → 2.0.0-beta.26
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/index.mjs +18 -13
- package/package.json +7 -6
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { getOpenAPIMeta, DEFAULT_OPENAPI_METHOD, getDynamicPathParams } from '@o
|
|
|
6
6
|
import { OpenAPIHandlerCodecCore } from '@orpc/openapi/standard';
|
|
7
7
|
import { unlazy, Procedure, DEFAULT_SUCCESS_STATUS, getRouter } from '@orpc/server';
|
|
8
8
|
import { StandardHandler } from '@orpc/server/standard';
|
|
9
|
-
import { value, isAsyncIteratorObject, stringifyJSON, mergeHttpPath } from '@orpc/shared';
|
|
9
|
+
import { value, isAsyncIteratorObject, stringifyJSON, mergeHttpPath, NullProtoObj } from '@orpc/shared';
|
|
10
10
|
import { flattenStandardHeader, generateContentDisposition } from '@standardserver/core';
|
|
11
11
|
import { toStandardLazyRequest, toEventStream } from '@standardserver/node';
|
|
12
12
|
import { mergeMap } from 'rxjs';
|
|
@@ -260,21 +260,26 @@ function flattenParamValue(value2) {
|
|
|
260
260
|
}
|
|
261
261
|
function toORPCOpenAPIParams(contract, params) {
|
|
262
262
|
const meta = getOpenAPIMeta(contract);
|
|
263
|
-
if (!params || meta?.path === void 0) {
|
|
263
|
+
if (!params || meta?.path === void 0 || Object.keys(params).length === 0) {
|
|
264
264
|
return void 0;
|
|
265
265
|
}
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
266
|
+
const orpcParams = new NullProtoObj();
|
|
267
|
+
const restKey = Object.hasOwn(params, "*") ? "*" : "path";
|
|
268
|
+
for (const [key, value2] of Object.entries(params)) {
|
|
269
|
+
if (key === restKey) {
|
|
270
|
+
const restParams = getDynamicPathParams(
|
|
271
|
+
meta.prefix ? mergeHttpPath(meta.prefix, meta.path) : meta.path
|
|
272
|
+
)?.filter((c) => c.allowsSlash);
|
|
273
|
+
if (restParams?.length) {
|
|
274
|
+
for (const c of restParams) {
|
|
275
|
+
orpcParams[c.parameterName] = flattenParamValue(value2);
|
|
276
|
+
}
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
274
279
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
280
|
+
orpcParams[key] = flattenParamValue(value2);
|
|
281
|
+
}
|
|
282
|
+
return orpcParams;
|
|
278
283
|
}
|
|
279
284
|
function toNestPattern(path) {
|
|
280
285
|
const params = getDynamicPathParams(path);
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/nest",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.26",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"funding": "https://github.com/sponsors/dinwwwh",
|
|
6
7
|
"homepage": "https://orpc.dev",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
@@ -39,11 +40,11 @@
|
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"@standardserver/core": "^0.7.1",
|
|
41
42
|
"@standardserver/node": "^0.7.1",
|
|
42
|
-
"@orpc/client": "2.0.0-beta.
|
|
43
|
-
"@orpc/contract": "2.0.0-beta.
|
|
44
|
-
"@orpc/openapi": "2.0.0-beta.
|
|
45
|
-
"@orpc/server": "2.0.0-beta.
|
|
46
|
-
"@orpc/shared": "2.0.0-beta.
|
|
43
|
+
"@orpc/client": "2.0.0-beta.26",
|
|
44
|
+
"@orpc/contract": "2.0.0-beta.26",
|
|
45
|
+
"@orpc/openapi": "2.0.0-beta.26",
|
|
46
|
+
"@orpc/server": "2.0.0-beta.26",
|
|
47
|
+
"@orpc/shared": "2.0.0-beta.26"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@fastify/cookie": "^11.0.2",
|