@orpc/server
Advanced tools
Comparing version 0.0.0-next-20241126025042 to 0.0.0-next-20241126071108
import { | ||
createProcedureCaller, | ||
isProcedure | ||
} from "./chunk-LYQ2OSU4.js"; | ||
} from "./chunk-YYGRQD4L.js"; | ||
@@ -16,4 +16,4 @@ // src/adapters/fetch.ts | ||
mapValues, | ||
resolvePromisableValue, | ||
trim | ||
trim, | ||
value | ||
} from "@orpc/shared"; | ||
@@ -130,3 +130,3 @@ import { ORPCError } from "@orpc/shared/error"; | ||
let name = part.slice(2); | ||
let value; | ||
let value2; | ||
if (name.charCodeAt(name.length - 1) === 125) { | ||
@@ -141,3 +141,3 @@ const openBracePos = name.indexOf("{"); | ||
name = name.slice(0, openBracePos); | ||
value = restPath.slice(...match.indices[0]); | ||
value2 = restPath.slice(...match.indices[0]); | ||
pos += match.indices[0][1] + 1; | ||
@@ -152,6 +152,6 @@ } else { | ||
} | ||
value = path.slice(pos + 1, endValuePos); | ||
value2 = path.slice(pos + 1, endValuePos); | ||
pos = endValuePos; | ||
} | ||
params[name] ||= value; | ||
params[name] ||= value2; | ||
} else { | ||
@@ -387,4 +387,4 @@ const index = path.indexOf(part, pos); | ||
for (; paramCount >= 0; paramCount--) { | ||
const [key, value] = paramAssoc[paramCount]; | ||
paramIndexMap[key] = value; | ||
const [key, value2] = paramAssoc[paramCount]; | ||
paramIndexMap[key] = value2; | ||
} | ||
@@ -559,3 +559,3 @@ return [h, paramIndexMap]; | ||
const serializer = isORPCTransformer ? new ORPCSerializer() : new OpenAPISerializer({ accept }); | ||
const context = await resolvePromisableValue(requestOptions.context); | ||
const context = await value(requestOptions.context); | ||
const handler = async () => { | ||
@@ -562,0 +562,0 @@ const url = new URL(requestOptions.request.url); |
@@ -8,3 +8,3 @@ import { | ||
mergeContext | ||
} from "./chunk-LYQ2OSU4.js"; | ||
} from "./chunk-YYGRQD4L.js"; | ||
@@ -11,0 +11,0 @@ // src/builder.ts |
@@ -1,2 +0,2 @@ | ||
import type { PartialOnUndefinedDeep, Promisable, PromisableValue } from '@orpc/shared'; | ||
import type { PartialOnUndefinedDeep, Promisable, Value } from '@orpc/shared'; | ||
import type { Router } from '../router'; | ||
@@ -37,3 +37,3 @@ export interface FetchHandlerHooks { | ||
*/ | ||
context: PromisableValue<TRouter extends Router<infer UContext> ? UContext : never>; | ||
context: Value<TRouter extends Router<infer UContext> ? UContext : never>; | ||
}>; | ||
@@ -40,0 +40,0 @@ export interface FetchHandler<TRouter extends Router<any>> { |
import type { SchemaInput, SchemaOutput } from '@orpc/contract'; | ||
import type { Procedure } from './procedure'; | ||
import { type PromisableValue } from '@orpc/shared'; | ||
import { type Value } from '@orpc/shared'; | ||
export interface CreateProcedureCallerOptions<TProcedure extends Procedure<any, any, any, any, any>> { | ||
@@ -9,3 +9,3 @@ procedure: TProcedure; | ||
*/ | ||
context: PromisableValue<TProcedure extends Procedure<infer UContext, any, any, any, any> ? UContext : never>; | ||
context: Value<TProcedure extends Procedure<infer UContext, any, any, any, any> ? UContext : never>; | ||
/** | ||
@@ -12,0 +12,0 @@ * This is helpful for logging and analytics. |
@@ -1,2 +0,2 @@ | ||
import type { PromisableValue } from '@orpc/shared'; | ||
import type { Value } from '@orpc/shared'; | ||
import type { Router } from './router'; | ||
@@ -10,3 +10,3 @@ import { type Procedure } from './procedure'; | ||
*/ | ||
context: PromisableValue<TRouter extends Router<infer UContext> ? UContext : never>; | ||
context: Value<TRouter extends Router<infer UContext> ? UContext : never>; | ||
/** | ||
@@ -13,0 +13,0 @@ * This is helpful for logging and analytics. |
{ | ||
"name": "@orpc/server", | ||
"type": "module", | ||
"version": "0.0.0-next-20241126025042", | ||
"version": "0.0.0-next-20241126071108", | ||
"author": { | ||
@@ -43,5 +43,5 @@ "name": "unnoq", | ||
"dependencies": { | ||
"@orpc/contract": "0.0.0-next-20241126025042", | ||
"@orpc/shared": "0.0.0-next-20241126025042", | ||
"@orpc/transformer": "0.0.0-next-20241126025042" | ||
"@orpc/contract": "0.0.0-next-20241126071108", | ||
"@orpc/shared": "0.0.0-next-20241126071108", | ||
"@orpc/transformer": "0.0.0-next-20241126071108" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
@@ -6,3 +6,3 @@ /// <reference lib="dom" /> | ||
Promisable, | ||
PromisableValue, | ||
Value, | ||
} from '@orpc/shared' | ||
@@ -20,4 +20,4 @@ import type { Router } from '../router' | ||
mapValues, | ||
resolvePromisableValue, | ||
trim, | ||
value, | ||
} from '@orpc/shared' | ||
@@ -98,3 +98,3 @@ import { ORPCError } from '@orpc/shared/error' | ||
const context = await resolvePromisableValue(requestOptions.context) | ||
const context = await value(requestOptions.context) | ||
@@ -276,3 +276,3 @@ const handler = async () => { | ||
*/ | ||
context: PromisableValue< | ||
context: Value< | ||
TRouter extends Router<infer UContext> ? UContext : never | ||
@@ -279,0 +279,0 @@ > |
@@ -5,3 +5,3 @@ import type { SchemaInput, SchemaOutput } from '@orpc/contract' | ||
import type { Context } from './types' | ||
import { type PromisableValue, resolvePromisableValue } from '@orpc/shared' | ||
import { type Value, value } from '@orpc/shared' | ||
import { ORPCError } from '@orpc/shared/error' | ||
@@ -19,3 +19,3 @@ import { OpenAPIDeserializer } from '@orpc/transformer' | ||
*/ | ||
context: PromisableValue< | ||
context: Value< | ||
TProcedure extends Procedure<infer UContext, any, any, any, any> | ||
@@ -91,3 +91,3 @@ ? UContext | ||
let currentMidIndex = 0 | ||
let currentContext: Context = await resolvePromisableValue(options.context) | ||
let currentContext: Context = await value(options.context) | ||
@@ -94,0 +94,0 @@ const next: MiddlewareMeta<unknown>['next'] = async (nextOptions) => { |
@@ -1,2 +0,2 @@ | ||
import type { PromisableValue } from '@orpc/shared' | ||
import type { Value } from '@orpc/shared' | ||
import type { Router } from './router' | ||
@@ -14,3 +14,3 @@ import { isProcedure, type Procedure } from './procedure' | ||
*/ | ||
context: PromisableValue< | ||
context: Value< | ||
TRouter extends Router<infer UContext> ? UContext : never | ||
@@ -17,0 +17,0 @@ > |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
356113
+ Added@orpc/contract@0.0.0-next-20241126071108(transitive)
+ Added@orpc/shared@0.0.0-next-20241126071108(transitive)
+ Added@orpc/transformer@0.0.0-next-20241126071108(transitive)
- Removed@orpc/contract@0.0.0-next-20241126025042(transitive)
- Removed@orpc/shared@0.0.0-next-20241126025042(transitive)
- Removed@orpc/transformer@0.0.0-next-20241126025042(transitive)