@orpc/client
Advanced tools
Comparing version 0.42.0 to 0.43.0
import { | ||
RPCSerializer | ||
} from "./chunk-4FUUNP74.js"; | ||
} from "./chunk-4HZVK3GJ.js"; | ||
import { | ||
ORPCError, | ||
createAutoRetryEventIterator | ||
} from "./chunk-OGAGXWCU.js"; | ||
} from "./chunk-X34KXUAJ.js"; | ||
// src/adapters/fetch/rpc-link.ts | ||
import { isAsyncIteratorObject } from "@orpc/server-standard"; | ||
import { toFetchBody, toStandardBody } from "@orpc/server-standard-fetch"; | ||
import { trim, value } from "@orpc/shared"; | ||
import { isAsyncIteratorObject } from "@orpc/standard-server"; | ||
import { toFetchBody, toStandardBody } from "@orpc/standard-server-fetch"; | ||
var InvalidEventSourceRetryResponse = class extends Error { | ||
@@ -14,0 +14,0 @@ }; |
@@ -13,3 +13,3 @@ import { | ||
updateEventIteratorStatus | ||
} from "./chunk-OGAGXWCU.js"; | ||
} from "./chunk-X34KXUAJ.js"; | ||
@@ -57,9 +57,18 @@ // src/client.ts | ||
const output = await promise; | ||
return [output, void 0, false]; | ||
return Object.assign( | ||
[null, output, false], | ||
{ error: null, data: output, isDefined: false } | ||
); | ||
} catch (e) { | ||
const error = e; | ||
if (isDefinedError(error)) { | ||
return [void 0, error, true]; | ||
return Object.assign( | ||
[error, void 0, true], | ||
{ error, data: void 0, isDefined: true } | ||
); | ||
} | ||
return [void 0, error, false]; | ||
return Object.assign( | ||
[error, void 0, false], | ||
{ error, data: void 0, isDefined: false } | ||
); | ||
} | ||
@@ -66,0 +75,0 @@ } |
@@ -5,3 +5,3 @@ import { | ||
toORPCError | ||
} from "./chunk-OGAGXWCU.js"; | ||
} from "./chunk-X34KXUAJ.js"; | ||
@@ -95,2 +95,3 @@ // src/openapi/bracket-notation.ts | ||
const segments = []; | ||
let inBrackets = false; | ||
let currentSegment = ""; | ||
@@ -101,3 +102,6 @@ let backslashCount = 0; | ||
const nextChar = path[i + 1]; | ||
if (char === "]" && (nextChar === void 0 || nextChar === "[") && backslashCount % 2 === 0) { | ||
if (inBrackets && char === "]" && (nextChar === void 0 || nextChar === "[") && backslashCount % 2 === 0) { | ||
if (nextChar === void 0) { | ||
inBrackets = false; | ||
} | ||
segments.push(currentSegment); | ||
@@ -107,2 +111,3 @@ currentSegment = ""; | ||
} else if (segments.length === 0 && char === "[" && backslashCount % 2 === 0) { | ||
inBrackets = true; | ||
segments.push(currentSegment); | ||
@@ -117,8 +122,3 @@ currentSegment = ""; | ||
} | ||
if (!segments.length) { | ||
segments.push(currentSegment); | ||
} else if (currentSegment) { | ||
segments[segments.length - 1] += segments.length === 1 ? `[${currentSegment}` : `][${currentSegment}`; | ||
} | ||
return segments; | ||
return inBrackets || segments.length === 0 ? [path] : segments; | ||
} | ||
@@ -169,3 +169,3 @@ }; | ||
// src/openapi/serializer.ts | ||
import { ErrorEvent, isAsyncIteratorObject } from "@orpc/server-standard"; | ||
import { ErrorEvent, isAsyncIteratorObject } from "@orpc/standard-server"; | ||
var OpenAPISerializer = class { | ||
@@ -172,0 +172,0 @@ constructor(jsonSerializer = new OpenAPIJsonSerializer(), bracketNotation = new BracketNotationSerializer()) { |
import { | ||
RPCJsonSerializer, | ||
RPCSerializer | ||
} from "./chunk-4FUUNP74.js"; | ||
import "./chunk-OGAGXWCU.js"; | ||
} from "./chunk-4HZVK3GJ.js"; | ||
import "./chunk-X34KXUAJ.js"; | ||
export { | ||
@@ -7,0 +7,0 @@ RPCJsonSerializer, |
import type { ORPCError } from './error'; | ||
import type { ClientPromiseResult } from './types'; | ||
export type SafeResult<TOutput, TError extends Error> = [output: TOutput, error: undefined, isDefinedError: false] | [output: undefined, error: TError, isDefinedError: false] | [output: undefined, error: Extract<TError, ORPCError<any, any>>, isDefinedError: true]; | ||
export type SafeResult<TOutput, TError extends Error> = [error: null, data: TOutput, isDefined: false] & { | ||
error: null; | ||
data: TOutput; | ||
isDefined: false; | ||
} | [error: Exclude<TError, ORPCError<any, any>>, data: undefined, isDefined: false] & { | ||
error: Exclude<TError, ORPCError<any, any>>; | ||
data: undefined; | ||
isDefined: false; | ||
} | [error: Extract<TError, ORPCError<any, any>>, data: undefined, isDefined: true] & { | ||
error: Extract<TError, ORPCError<any, any>>; | ||
data: undefined; | ||
isDefined: true; | ||
}; | ||
export declare function safe<TOutput, TError extends Error>(promise: ClientPromiseResult<TOutput, TError>): Promise<SafeResult<TOutput, TError>>; | ||
//# sourceMappingURL=utils.d.ts.map |
{ | ||
"name": "@orpc/client", | ||
"type": "module", | ||
"version": "0.42.0", | ||
"version": "0.43.0", | ||
"license": "MIT", | ||
@@ -47,5 +47,5 @@ "homepage": "https://orpc.unnoq.com", | ||
"dependencies": { | ||
"@orpc/server-standard": "^0.4.0", | ||
"@orpc/server-standard-fetch": "^0.4.0", | ||
"@orpc/shared": "0.42.0" | ||
"@orpc/shared": "0.43.0", | ||
"@orpc/standard-server-fetch": "0.43.0", | ||
"@orpc/standard-server": "0.43.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "devDependencies": { |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
50560
1281
+ Added@orpc/standard-server@0.43.0
+ Added@orpc/shared@0.43.0(transitive)
+ Added@orpc/standard-server@0.43.0(transitive)
+ Added@orpc/standard-server-fetch@0.43.0(transitive)
- Removed@orpc/server-standard@^0.4.0
- Removed@orpc/server-standard-fetch@^0.4.0
- Removed@orpc/server-standard@0.4.0(transitive)
- Removed@orpc/server-standard-fetch@0.4.0(transitive)
- Removed@orpc/shared@0.42.0(transitive)
Updated@orpc/shared@0.43.0