@orpc/openapi-client 0.0.0-next.783ae4e → 0.0.0-next.7b73a06
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/README.md +13 -17
- package/dist/adapters/fetch/index.d.mts +12 -5
- package/dist/adapters/fetch/index.d.ts +12 -5
- package/dist/adapters/fetch/index.mjs +4 -8
- package/dist/adapters/standard/index.d.mts +1 -1
- package/dist/adapters/standard/index.d.ts +1 -1
- package/dist/adapters/standard/index.mjs +2 -2
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/shared/{openapi-client.V75iq1Nn.mjs → openapi-client.D89vdV2Y.mjs} +24 -12
- package/dist/shared/{openapi-client.N18yafE2.d.mts → openapi-client.D_hC2pAM.d.mts} +6 -2
- package/dist/shared/{openapi-client.N18yafE2.d.ts → openapi-client.D_hC2pAM.d.ts} +6 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -21,28 +21,24 @@
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">Typesafe APIs Made Simple 🪄</h3>
|
|
23
23
|
|
|
24
|
-
**oRPC is a powerful combination of RPC and OpenAPI**, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards
|
|
24
|
+
**oRPC is a powerful combination of RPC and OpenAPI**, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
28
|
## Highlights
|
|
29
29
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
- **Reusability 🔄**: Write once and reuse your code across multiple purposes effortlessly.
|
|
43
|
-
- **Extendability 🔌**: Easily enhance oRPC with plugins, middleware, and interceptors.
|
|
44
|
-
- **Reliability 🛡️**: Well-tested, fully TypeScript, production-ready, and MIT licensed for peace of mind.
|
|
45
|
-
- **Simplicity 💡**: Enjoy straightforward, clean code with no hidden magic.
|
|
30
|
+
- **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
|
|
31
|
+
- **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
|
|
32
|
+
- **📝 Contract-First Development**: Optionally define your API contract before implementation.
|
|
33
|
+
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
|
|
34
|
+
- **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
|
|
35
|
+
- **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
|
|
36
|
+
- **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
|
|
37
|
+
- **⏱️ Lazy Router**: Enhance cold start times with our lazy routing feature.
|
|
38
|
+
- **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
|
|
39
|
+
- **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
|
|
40
|
+
- **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
|
|
41
|
+
- **🛡️ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
|
|
46
42
|
|
|
47
43
|
## Documentation
|
|
48
44
|
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { ClientContext } from '@orpc/client';
|
|
2
|
-
import { AnyContractRouter } from '@orpc/contract';
|
|
3
2
|
import { LinkFetchClientOptions } from '@orpc/client/fetch';
|
|
4
|
-
import {
|
|
5
|
-
import { f as StandardOpenAPILinkOptions } from '../../shared/openapi-client.
|
|
3
|
+
import { AnyContractRouter } from '@orpc/contract';
|
|
4
|
+
import { f as StandardOpenAPILinkOptions, g as StandardOpenAPILink } from '../../shared/openapi-client.D_hC2pAM.mjs';
|
|
5
|
+
import '@orpc/client/standard';
|
|
6
6
|
import '@orpc/shared';
|
|
7
7
|
import '@orpc/standard-server';
|
|
8
8
|
|
|
9
9
|
interface OpenAPILinkOptions<T extends ClientContext> extends StandardOpenAPILinkOptions<T>, LinkFetchClientOptions<T> {
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The OpenAPI Link for fetch runtime communicates with the server that follow the OpenAPI specification.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/client/openapi-link OpenAPI Link Docs}
|
|
15
|
+
* @see {@link https://swagger.io/specification/ OpenAPI Specification}
|
|
16
|
+
*/
|
|
17
|
+
declare class OpenAPILink<T extends ClientContext> extends StandardOpenAPILink<T> {
|
|
12
18
|
constructor(contract: AnyContractRouter, options: OpenAPILinkOptions<T>);
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
export { OpenAPILink
|
|
21
|
+
export { OpenAPILink };
|
|
22
|
+
export type { OpenAPILinkOptions };
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { ClientContext } from '@orpc/client';
|
|
2
|
-
import { AnyContractRouter } from '@orpc/contract';
|
|
3
2
|
import { LinkFetchClientOptions } from '@orpc/client/fetch';
|
|
4
|
-
import {
|
|
5
|
-
import { f as StandardOpenAPILinkOptions } from '../../shared/openapi-client.
|
|
3
|
+
import { AnyContractRouter } from '@orpc/contract';
|
|
4
|
+
import { f as StandardOpenAPILinkOptions, g as StandardOpenAPILink } from '../../shared/openapi-client.D_hC2pAM.js';
|
|
5
|
+
import '@orpc/client/standard';
|
|
6
6
|
import '@orpc/shared';
|
|
7
7
|
import '@orpc/standard-server';
|
|
8
8
|
|
|
9
9
|
interface OpenAPILinkOptions<T extends ClientContext> extends StandardOpenAPILinkOptions<T>, LinkFetchClientOptions<T> {
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The OpenAPI Link for fetch runtime communicates with the server that follow the OpenAPI specification.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/client/openapi-link OpenAPI Link Docs}
|
|
15
|
+
* @see {@link https://swagger.io/specification/ OpenAPI Specification}
|
|
16
|
+
*/
|
|
17
|
+
declare class OpenAPILink<T extends ClientContext> extends StandardOpenAPILink<T> {
|
|
12
18
|
constructor(contract: AnyContractRouter, options: OpenAPILinkOptions<T>);
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
export { OpenAPILink
|
|
21
|
+
export { OpenAPILink };
|
|
22
|
+
export type { OpenAPILinkOptions };
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { LinkFetchClient } from '@orpc/client/fetch';
|
|
2
|
-
import { StandardLink } from '@orpc/client/standard';
|
|
3
|
-
import { a as StandardOpenAPIJsonSerializer, b as StandardOpenapiLinkCodec, c as StandardOpenAPISerializer, S as StandardBracketNotationSerializer } from '../../shared/openapi-client.V75iq1Nn.mjs';
|
|
4
2
|
import '@orpc/shared';
|
|
3
|
+
import { b as StandardOpenAPILink } from '../../shared/openapi-client.D89vdV2Y.mjs';
|
|
5
4
|
import '@orpc/client';
|
|
5
|
+
import '@orpc/client/standard';
|
|
6
6
|
import '@orpc/contract';
|
|
7
7
|
import '@orpc/standard-server';
|
|
8
8
|
|
|
9
|
-
class OpenAPILink extends
|
|
9
|
+
class OpenAPILink extends StandardOpenAPILink {
|
|
10
10
|
constructor(contract, options) {
|
|
11
|
-
const jsonSerializer = new StandardOpenAPIJsonSerializer(options);
|
|
12
|
-
const bracketNotationSerializer = new StandardBracketNotationSerializer();
|
|
13
|
-
const serializer = new StandardOpenAPISerializer(jsonSerializer, bracketNotationSerializer);
|
|
14
|
-
const linkCodec = new StandardOpenapiLinkCodec(contract, serializer, options);
|
|
15
11
|
const linkClient = new LinkFetchClient(options);
|
|
16
|
-
super(
|
|
12
|
+
super(contract, linkClient, options);
|
|
17
13
|
}
|
|
18
14
|
}
|
|
19
15
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as StandardBracketNotationSerialized, a as StandardBracketNotationSerializer, c as StandardOpenAPICustomJsonSerializer, b as StandardOpenAPIJsonSerialized, e as StandardOpenAPIJsonSerializer, d as StandardOpenAPIJsonSerializerOptions, f as StandardOpenAPILinkOptions,
|
|
1
|
+
export { S as StandardBracketNotationSerialized, a as StandardBracketNotationSerializer, c as StandardOpenAPICustomJsonSerializer, b as StandardOpenAPIJsonSerialized, e as StandardOpenAPIJsonSerializer, d as StandardOpenAPIJsonSerializerOptions, g as StandardOpenAPILink, f as StandardOpenAPILinkOptions, j as StandardOpenAPISerializeOptions, k as StandardOpenAPISerializer, i as StandardOpenapiLinkCodec, h as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.D_hC2pAM.mjs';
|
|
2
2
|
import { HTTPPath } from '@orpc/client';
|
|
3
3
|
import '@orpc/client/standard';
|
|
4
4
|
import '@orpc/contract';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as StandardBracketNotationSerialized, a as StandardBracketNotationSerializer, c as StandardOpenAPICustomJsonSerializer, b as StandardOpenAPIJsonSerialized, e as StandardOpenAPIJsonSerializer, d as StandardOpenAPIJsonSerializerOptions, f as StandardOpenAPILinkOptions,
|
|
1
|
+
export { S as StandardBracketNotationSerialized, a as StandardBracketNotationSerializer, c as StandardOpenAPICustomJsonSerializer, b as StandardOpenAPIJsonSerialized, e as StandardOpenAPIJsonSerializer, d as StandardOpenAPIJsonSerializerOptions, g as StandardOpenAPILink, f as StandardOpenAPILinkOptions, j as StandardOpenAPISerializeOptions, k as StandardOpenAPISerializer, i as StandardOpenapiLinkCodec, h as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.D_hC2pAM.js';
|
|
2
2
|
import { HTTPPath } from '@orpc/client';
|
|
3
3
|
import '@orpc/client/standard';
|
|
4
4
|
import '@orpc/contract';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { S as StandardBracketNotationSerializer, a as StandardOpenAPIJsonSerializer,
|
|
1
|
+
export { S as StandardBracketNotationSerializer, a as StandardOpenAPIJsonSerializer, b as StandardOpenAPILink, d as StandardOpenAPISerializer, c as StandardOpenapiLinkCodec, g as getDynamicParams, s as standardizeHTTPPath } from '../../shared/openapi-client.D89vdV2Y.mjs';
|
|
2
|
+
import '@orpc/client/standard';
|
|
2
3
|
import '@orpc/shared';
|
|
3
4
|
import '@orpc/client';
|
|
4
|
-
import '@orpc/client/standard';
|
|
5
5
|
import '@orpc/contract';
|
|
6
6
|
import '@orpc/standard-server';
|
package/dist/index.d.mts
CHANGED
|
@@ -4,6 +4,11 @@ type JsonifiedValue<T> = T extends string ? T : T extends number ? T : T extends
|
|
|
4
4
|
[K in keyof T]: JsonifiedValue<T[K]>;
|
|
5
5
|
} : T extends Date ? string : T extends bigint ? string : T extends File ? File : T extends Blob ? Blob : T extends RegExp ? string : T extends URL ? string : T extends Map<infer K, infer V> ? JsonifiedArray<[K, V][]> : T extends Set<infer U> ? JsonifiedArray<U[]> : T extends AsyncIteratorObject<infer U, infer V> ? AsyncIteratorObject<JsonifiedValue<U>, JsonifiedValue<V>> : unknown;
|
|
6
6
|
type JsonifiedArray<T extends Array<unknown>> = T extends readonly [] ? [] : T extends readonly [infer U, ...infer V] ? [U extends undefined ? null : JsonifiedValue<U>, ...JsonifiedArray<V>] : T extends Array<infer U> ? Array<JsonifiedValue<U>> : unknown;
|
|
7
|
+
/**
|
|
8
|
+
* Convert types that JSON not support to corresponding json types
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/client/openapi-link OpenAPI Link Docs}
|
|
11
|
+
*/
|
|
7
12
|
type JsonifiedClient<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? Client<UClientContext, UInput, JsonifiedValue<UOutput>, UError extends ORPCError<infer UCode, infer UData> ? ORPCError<UCode, JsonifiedValue<UData>> : UError> : {
|
|
8
13
|
[K in keyof T]: T[K] extends NestedClient<any> ? JsonifiedClient<T[K]> : T[K];
|
|
9
14
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ type JsonifiedValue<T> = T extends string ? T : T extends number ? T : T extends
|
|
|
4
4
|
[K in keyof T]: JsonifiedValue<T[K]>;
|
|
5
5
|
} : T extends Date ? string : T extends bigint ? string : T extends File ? File : T extends Blob ? Blob : T extends RegExp ? string : T extends URL ? string : T extends Map<infer K, infer V> ? JsonifiedArray<[K, V][]> : T extends Set<infer U> ? JsonifiedArray<U[]> : T extends AsyncIteratorObject<infer U, infer V> ? AsyncIteratorObject<JsonifiedValue<U>, JsonifiedValue<V>> : unknown;
|
|
6
6
|
type JsonifiedArray<T extends Array<unknown>> = T extends readonly [] ? [] : T extends readonly [infer U, ...infer V] ? [U extends undefined ? null : JsonifiedValue<U>, ...JsonifiedArray<V>] : T extends Array<infer U> ? Array<JsonifiedValue<U>> : unknown;
|
|
7
|
+
/**
|
|
8
|
+
* Convert types that JSON not support to corresponding json types
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/client/openapi-link OpenAPI Link Docs}
|
|
11
|
+
*/
|
|
7
12
|
type JsonifiedClient<T extends NestedClient<any>> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? Client<UClientContext, UInput, JsonifiedValue<UOutput>, UError extends ORPCError<infer UCode, infer UData> ? ORPCError<UCode, JsonifiedValue<UData>> : UError> : {
|
|
8
13
|
[K in keyof T]: T[K] extends NestedClient<any> ? JsonifiedClient<T[K]> : T[K];
|
|
9
14
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { toHttpPath, getMalformedResponseErrorCode, StandardLink } from '@orpc/client/standard';
|
|
1
2
|
import { isObject, value, get, isAsyncIteratorObject } from '@orpc/shared';
|
|
2
|
-
import { isORPCErrorStatus,
|
|
3
|
-
import { toHttpPath } from '@orpc/client/standard';
|
|
3
|
+
import { isORPCErrorStatus, isORPCErrorJson, createORPCErrorFromJson, mapEventIterator, toORPCError } from '@orpc/client';
|
|
4
4
|
import { isContractProcedure, fallbackContractConfig, ORPCError } from '@orpc/contract';
|
|
5
5
|
import { mergeStandardHeaders, ErrorEvent } from '@orpc/standard-server';
|
|
6
6
|
|
|
@@ -202,7 +202,7 @@ class StandardOpenapiLinkCodec {
|
|
|
202
202
|
throw new Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${path.join(".")}`);
|
|
203
203
|
}
|
|
204
204
|
const inputStructure = fallbackContractConfig("defaultInputStructure", procedure["~orpc"].route.inputStructure);
|
|
205
|
-
return inputStructure === "compact" ? this.#encodeCompact(procedure, path, input, options, baseUrl
|
|
205
|
+
return inputStructure === "compact" ? this.#encodeCompact(procedure, path, input, options, baseUrl, headers) : this.#encodeDetailed(procedure, path, input, options, baseUrl, headers);
|
|
206
206
|
}
|
|
207
207
|
#encodeCompact(procedure, path, input, options, baseUrl, headers) {
|
|
208
208
|
let httpPath = standardizeHTTPPath(procedure["~orpc"].route.path ?? toHttpPath(path));
|
|
@@ -221,7 +221,8 @@ class StandardOpenapiLinkCodec {
|
|
|
221
221
|
httpBody = Object.keys(body).length ? body : void 0;
|
|
222
222
|
}
|
|
223
223
|
const method = fallbackContractConfig("defaultMethod", procedure["~orpc"].route.method);
|
|
224
|
-
const url = new URL(
|
|
224
|
+
const url = new URL(baseUrl);
|
|
225
|
+
url.pathname = `${url.pathname.replace(/\/$/, "")}${httpPath}`;
|
|
225
226
|
if (method === "GET") {
|
|
226
227
|
const serialized = this.serializer.serialize(httpBody, { outputFormat: "URLSearchParams" });
|
|
227
228
|
for (const [key, value2] of serialized) {
|
|
@@ -266,7 +267,8 @@ class StandardOpenapiLinkCodec {
|
|
|
266
267
|
mergedHeaders = mergeStandardHeaders(input.headers, headers);
|
|
267
268
|
}
|
|
268
269
|
const method = fallbackContractConfig("defaultMethod", procedure["~orpc"].route.method);
|
|
269
|
-
const url = new URL(
|
|
270
|
+
const url = new URL(baseUrl);
|
|
271
|
+
url.pathname = `${url.pathname.replace(/\/$/, "")}${httpPath}`;
|
|
270
272
|
if (input?.query !== void 0) {
|
|
271
273
|
const query = this.serializer.serialize(input.query, { outputFormat: "URLSearchParams" });
|
|
272
274
|
for (const [key, value2] of query) {
|
|
@@ -310,12 +312,12 @@ class StandardOpenapiLinkCodec {
|
|
|
310
312
|
}
|
|
311
313
|
})();
|
|
312
314
|
if (!isOk) {
|
|
313
|
-
if (
|
|
314
|
-
throw
|
|
315
|
+
if (isORPCErrorJson(deserialized)) {
|
|
316
|
+
throw createORPCErrorFromJson(deserialized);
|
|
315
317
|
}
|
|
316
|
-
throw new ORPCError(
|
|
318
|
+
throw new ORPCError(getMalformedResponseErrorCode(response.status), {
|
|
317
319
|
status: response.status,
|
|
318
|
-
data: deserialized
|
|
320
|
+
data: { ...response, body: deserialized }
|
|
319
321
|
});
|
|
320
322
|
}
|
|
321
323
|
const procedure = get(this.contract, path);
|
|
@@ -387,8 +389,8 @@ class StandardOpenAPISerializer {
|
|
|
387
389
|
return mapEventIterator(data, {
|
|
388
390
|
value: async (value) => value,
|
|
389
391
|
error: async (e) => {
|
|
390
|
-
if (e instanceof ErrorEvent &&
|
|
391
|
-
return
|
|
392
|
+
if (e instanceof ErrorEvent && isORPCErrorJson(e.data)) {
|
|
393
|
+
return createORPCErrorFromJson(e.data, { cause: e });
|
|
392
394
|
}
|
|
393
395
|
return e;
|
|
394
396
|
}
|
|
@@ -398,4 +400,14 @@ class StandardOpenAPISerializer {
|
|
|
398
400
|
}
|
|
399
401
|
}
|
|
400
402
|
|
|
401
|
-
|
|
403
|
+
class StandardOpenAPILink extends StandardLink {
|
|
404
|
+
constructor(contract, linkClient, options) {
|
|
405
|
+
const jsonSerializer = new StandardOpenAPIJsonSerializer(options);
|
|
406
|
+
const bracketNotationSerializer = new StandardBracketNotationSerializer();
|
|
407
|
+
const serializer = new StandardOpenAPISerializer(jsonSerializer, bracketNotationSerializer);
|
|
408
|
+
const linkCodec = new StandardOpenapiLinkCodec(contract, serializer, options);
|
|
409
|
+
super(linkCodec, linkClient, options);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export { StandardBracketNotationSerializer as S, StandardOpenAPIJsonSerializer as a, StandardOpenAPILink as b, StandardOpenapiLinkCodec as c, StandardOpenAPISerializer as d, getDynamicParams as g, standardizeHTTPPath as s };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClientContext, ClientOptions } from '@orpc/client';
|
|
2
|
-
import { StandardLinkCodec, StandardLinkOptions } from '@orpc/client/standard';
|
|
2
|
+
import { StandardLinkCodec, StandardLinkOptions, StandardLink, StandardLinkClient } from '@orpc/client/standard';
|
|
3
3
|
import { AnyContractRouter } from '@orpc/contract';
|
|
4
4
|
import { Segment, Value } from '@orpc/shared';
|
|
5
5
|
import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
@@ -71,5 +71,9 @@ declare class StandardOpenapiLinkCodec<T extends ClientContext> implements Stand
|
|
|
71
71
|
|
|
72
72
|
interface StandardOpenAPILinkOptions<T extends ClientContext> extends StandardLinkOptions<T>, StandardOpenapiLinkCodecOptions<T>, StandardOpenAPIJsonSerializerOptions {
|
|
73
73
|
}
|
|
74
|
+
declare class StandardOpenAPILink<T extends ClientContext> extends StandardLink<T> {
|
|
75
|
+
constructor(contract: AnyContractRouter, linkClient: StandardLinkClient<T>, options: StandardOpenAPILinkOptions<T>);
|
|
76
|
+
}
|
|
74
77
|
|
|
75
|
-
export {
|
|
78
|
+
export { StandardBracketNotationSerializer as a, StandardOpenAPIJsonSerializer as e, StandardOpenAPILink as g, StandardOpenapiLinkCodec as i, StandardOpenAPISerializer as k };
|
|
79
|
+
export type { StandardBracketNotationSerialized as S, StandardOpenAPIJsonSerialized as b, StandardOpenAPICustomJsonSerializer as c, StandardOpenAPIJsonSerializerOptions as d, StandardOpenAPILinkOptions as f, StandardOpenapiLinkCodecOptions as h, StandardOpenAPISerializeOptions as j };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClientContext, ClientOptions } from '@orpc/client';
|
|
2
|
-
import { StandardLinkCodec, StandardLinkOptions } from '@orpc/client/standard';
|
|
2
|
+
import { StandardLinkCodec, StandardLinkOptions, StandardLink, StandardLinkClient } from '@orpc/client/standard';
|
|
3
3
|
import { AnyContractRouter } from '@orpc/contract';
|
|
4
4
|
import { Segment, Value } from '@orpc/shared';
|
|
5
5
|
import { StandardHeaders, StandardRequest, StandardLazyResponse } from '@orpc/standard-server';
|
|
@@ -71,5 +71,9 @@ declare class StandardOpenapiLinkCodec<T extends ClientContext> implements Stand
|
|
|
71
71
|
|
|
72
72
|
interface StandardOpenAPILinkOptions<T extends ClientContext> extends StandardLinkOptions<T>, StandardOpenapiLinkCodecOptions<T>, StandardOpenAPIJsonSerializerOptions {
|
|
73
73
|
}
|
|
74
|
+
declare class StandardOpenAPILink<T extends ClientContext> extends StandardLink<T> {
|
|
75
|
+
constructor(contract: AnyContractRouter, linkClient: StandardLinkClient<T>, options: StandardOpenAPILinkOptions<T>);
|
|
76
|
+
}
|
|
74
77
|
|
|
75
|
-
export {
|
|
78
|
+
export { StandardBracketNotationSerializer as a, StandardOpenAPIJsonSerializer as e, StandardOpenAPILink as g, StandardOpenapiLinkCodec as i, StandardOpenAPISerializer as k };
|
|
79
|
+
export type { StandardBracketNotationSerialized as S, StandardOpenAPIJsonSerialized as b, StandardOpenAPICustomJsonSerializer as c, StandardOpenAPIJsonSerializerOptions as d, StandardOpenAPILinkOptions as f, StandardOpenapiLinkCodecOptions as h, StandardOpenAPISerializeOptions as j };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/openapi-client",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-next.
|
|
4
|
+
"version": "0.0.0-next.7b73a06",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@orpc/
|
|
38
|
-
"@orpc/shared": "0.0.0-next.
|
|
39
|
-
"@orpc/
|
|
40
|
-
"@orpc/
|
|
37
|
+
"@orpc/client": "0.0.0-next.7b73a06",
|
|
38
|
+
"@orpc/shared": "0.0.0-next.7b73a06",
|
|
39
|
+
"@orpc/contract": "0.0.0-next.7b73a06",
|
|
40
|
+
"@orpc/standard-server": "0.0.0-next.7b73a06"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@orpc/server": "0.0.0-next.
|
|
43
|
+
"@orpc/server": "0.0.0-next.7b73a06"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "unbuild",
|