@orpc/openapi-client 0.0.0-next.f356b86 → 0.0.0-next.f437dcb

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 CHANGED
@@ -30,7 +30,8 @@
30
30
  - **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
31
31
  - **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
32
32
  - **📝 Contract-First Development**: Optionally define your API contract before implementation.
33
- - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
33
+ - **🔍 First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability.
34
+ - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), SWR, Pinia Colada, and more.
34
35
  - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
35
36
  - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
36
37
  - **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
@@ -38,7 +39,6 @@
38
39
  - **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
39
40
  - **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
40
41
  - **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
41
- - **🛡️ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
42
42
 
43
43
  ## Documentation
44
44
 
@@ -50,9 +50,11 @@ You can find the full documentation [here](https://orpc.unnoq.com).
50
50
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
51
51
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
52
52
  - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
53
+ - [@orpc/otel](https://www.npmjs.com/package/@orpc/otel): [OpenTelemetry](https://opentelemetry.io/) integration for observability.
53
54
  - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
54
55
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
55
56
  - [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): [TanStack Query](https://tanstack.com/query/latest) integration.
57
+ - [@orpc/experimental-react-swr](https://www.npmjs.com/package/@orpc/experimental-react-swr): [SWR](https://swr.vercel.app/) integration.
56
58
  - [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
57
59
  - [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.
58
60
  - [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
@@ -1,12 +1,12 @@
1
1
  import { ClientContext } from '@orpc/client';
2
2
  import { LinkFetchClientOptions } from '@orpc/client/fetch';
3
3
  import { AnyContractRouter } from '@orpc/contract';
4
- import { g as StandardOpenAPILinkOptions, h as StandardOpenAPILink } from '../../shared/openapi-client.f2unmElJ.mjs';
4
+ import { g as StandardOpenAPILinkOptions, h as StandardOpenAPILink } from '../../shared/openapi-client.Cv0hBP4Y.mjs';
5
5
  import '@orpc/client/standard';
6
6
  import '@orpc/shared';
7
7
  import '@orpc/standard-server';
8
8
 
9
- interface OpenAPILinkOptions<T extends ClientContext> extends StandardOpenAPILinkOptions<T>, LinkFetchClientOptions<T> {
9
+ interface OpenAPILinkOptions<T extends ClientContext> extends LinkFetchClientOptions<T>, Omit<StandardOpenAPILinkOptions<T>, 'plugins'> {
10
10
  }
11
11
  /**
12
12
  * The OpenAPI Link for fetch runtime communicates with the server that follow the OpenAPI specification.
@@ -1,12 +1,12 @@
1
1
  import { ClientContext } from '@orpc/client';
2
2
  import { LinkFetchClientOptions } from '@orpc/client/fetch';
3
3
  import { AnyContractRouter } from '@orpc/contract';
4
- import { g as StandardOpenAPILinkOptions, h as StandardOpenAPILink } from '../../shared/openapi-client.f2unmElJ.js';
4
+ import { g as StandardOpenAPILinkOptions, h as StandardOpenAPILink } from '../../shared/openapi-client.Cv0hBP4Y.js';
5
5
  import '@orpc/client/standard';
6
6
  import '@orpc/shared';
7
7
  import '@orpc/standard-server';
8
8
 
9
- interface OpenAPILinkOptions<T extends ClientContext> extends StandardOpenAPILinkOptions<T>, LinkFetchClientOptions<T> {
9
+ interface OpenAPILinkOptions<T extends ClientContext> extends LinkFetchClientOptions<T>, Omit<StandardOpenAPILinkOptions<T>, 'plugins'> {
10
10
  }
11
11
  /**
12
12
  * The OpenAPI Link for fetch runtime communicates with the server that follow the OpenAPI specification.
@@ -1,7 +1,7 @@
1
1
  import { LinkFetchClient } from '@orpc/client/fetch';
2
2
  import '@orpc/shared';
3
3
  import '@orpc/contract';
4
- import { b as StandardOpenAPILink } from '../../shared/openapi-client.D3eD5ojB.mjs';
4
+ import { b as StandardOpenAPILink } from '../../shared/openapi-client.BfDCd-PU.mjs';
5
5
  import '@orpc/client';
6
6
  import '@orpc/client/standard';
7
7
  import '@orpc/standard-server';
@@ -1,4 +1,4 @@
1
- export { S as StandardBracketNotationSerialized, b as StandardBracketNotationSerializer, a as StandardBracketNotationSerializerOptions, d as StandardOpenAPICustomJsonSerializer, c as StandardOpenAPIJsonSerialized, f as StandardOpenAPIJsonSerializer, e as StandardOpenAPIJsonSerializerOptions, h as StandardOpenAPILink, g as StandardOpenAPILinkOptions, k as StandardOpenAPISerializeOptions, l as StandardOpenAPISerializer, j as StandardOpenapiLinkCodec, i as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.f2unmElJ.mjs';
1
+ export { S as StandardBracketNotationSerialized, b as StandardBracketNotationSerializer, a as StandardBracketNotationSerializerOptions, d as StandardOpenAPICustomJsonSerializer, c as StandardOpenAPIJsonSerialized, f as StandardOpenAPIJsonSerializer, e as StandardOpenAPIJsonSerializerOptions, h as StandardOpenAPILink, g as StandardOpenAPILinkOptions, k as StandardOpenAPISerializeOptions, l as StandardOpenAPISerializer, j as StandardOpenapiLinkCodec, i as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.Cv0hBP4Y.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, b as StandardBracketNotationSerializer, a as StandardBracketNotationSerializerOptions, d as StandardOpenAPICustomJsonSerializer, c as StandardOpenAPIJsonSerialized, f as StandardOpenAPIJsonSerializer, e as StandardOpenAPIJsonSerializerOptions, h as StandardOpenAPILink, g as StandardOpenAPILinkOptions, k as StandardOpenAPISerializeOptions, l as StandardOpenAPISerializer, j as StandardOpenapiLinkCodec, i as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.f2unmElJ.js';
1
+ export { S as StandardBracketNotationSerialized, b as StandardBracketNotationSerializer, a as StandardBracketNotationSerializerOptions, d as StandardOpenAPICustomJsonSerializer, c as StandardOpenAPIJsonSerialized, f as StandardOpenAPIJsonSerializer, e as StandardOpenAPIJsonSerializerOptions, h as StandardOpenAPILink, g as StandardOpenAPILinkOptions, k as StandardOpenAPISerializeOptions, l as StandardOpenAPISerializer, j as StandardOpenapiLinkCodec, i as StandardOpenapiLinkCodecOptions } from '../../shared/openapi-client.Cv0hBP4Y.js';
2
2
  import { HTTPPath } from '@orpc/client';
3
3
  import '@orpc/client/standard';
4
4
  import '@orpc/contract';
@@ -1,5 +1,5 @@
1
- import { S as StandardBracketNotationSerializer } from '../../shared/openapi-client.D3eD5ojB.mjs';
2
- export { a as StandardOpenAPIJsonSerializer, b as StandardOpenAPILink, d as StandardOpenAPISerializer, c as StandardOpenapiLinkCodec, g as getDynamicParams, s as standardizeHTTPPath } from '../../shared/openapi-client.D3eD5ojB.mjs';
1
+ import { S as StandardBracketNotationSerializer } from '../../shared/openapi-client.BfDCd-PU.mjs';
2
+ export { a as StandardOpenAPIJsonSerializer, b as StandardOpenAPILink, d as StandardOpenAPISerializer, c as StandardOpenapiLinkCodec, g as getDynamicParams, s as standardizeHTTPPath } from '../../shared/openapi-client.BfDCd-PU.mjs';
3
3
  import { isSchemaIssue } from '@orpc/contract';
4
4
  import { isTypescriptObject } from '@orpc/shared';
5
5
  import '@orpc/client/standard';
@@ -1,4 +1,4 @@
1
- import { toHttpPath, getMalformedResponseErrorCode, StandardLink } from '@orpc/client/standard';
1
+ import { toStandardHeaders, toHttpPath, getMalformedResponseErrorCode, StandardLink } from '@orpc/client/standard';
2
2
  import { isObject, NullProtoObj, value, get, isAsyncIteratorObject } from '@orpc/shared';
3
3
  import { isORPCErrorStatus, isORPCErrorJson, createORPCErrorFromJson, mapEventIterator, toORPCError } from '@orpc/client';
4
4
  import { isContractProcedure, fallbackContractConfig, ORPCError } from '@orpc/contract';
@@ -216,11 +216,11 @@ class StandardOpenapiLinkCodec {
216
216
  baseUrl;
217
217
  headers;
218
218
  async encode(path, input, options) {
219
- const baseUrl = await value(this.baseUrl, options, path, input);
220
- let headers = await value(this.headers, options, path, input);
219
+ let headers = toStandardHeaders(await value(this.headers, options, path, input));
221
220
  if (options.lastEventId !== void 0) {
222
221
  headers = mergeStandardHeaders(headers, { "last-event-id": options.lastEventId });
223
222
  }
223
+ const baseUrl = await value(this.baseUrl, options, path, input);
224
224
  const procedure = get(this.contract, path);
225
225
  if (!isContractProcedure(procedure)) {
226
226
  throw new Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${path.join(".")}`);
@@ -70,7 +70,7 @@ interface StandardOpenapiLinkCodecOptions<T extends ClientContext> {
70
70
  /**
71
71
  * Inject headers to the request.
72
72
  */
73
- headers?: Value<Promisable<StandardHeaders>, [
73
+ headers?: Value<Promisable<StandardHeaders | Headers>, [
74
74
  options: ClientOptions<T>,
75
75
  path: readonly string[],
76
76
  input: unknown
@@ -70,7 +70,7 @@ interface StandardOpenapiLinkCodecOptions<T extends ClientContext> {
70
70
  /**
71
71
  * Inject headers to the request.
72
72
  */
73
- headers?: Value<Promisable<StandardHeaders>, [
73
+ headers?: Value<Promisable<StandardHeaders | Headers>, [
74
74
  options: ClientOptions<T>,
75
75
  path: readonly string[],
76
76
  input: unknown
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.f356b86",
4
+ "version": "0.0.0-next.f437dcb",
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/contract": "0.0.0-next.f356b86",
38
- "@orpc/client": "0.0.0-next.f356b86",
39
- "@orpc/shared": "0.0.0-next.f356b86",
40
- "@orpc/standard-server": "0.0.0-next.f356b86"
37
+ "@orpc/contract": "0.0.0-next.f437dcb",
38
+ "@orpc/shared": "0.0.0-next.f437dcb",
39
+ "@orpc/standard-server": "0.0.0-next.f437dcb",
40
+ "@orpc/client": "0.0.0-next.f437dcb"
41
41
  },
42
42
  "devDependencies": {
43
- "@orpc/server": "0.0.0-next.f356b86"
43
+ "@orpc/server": "0.0.0-next.f437dcb"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "unbuild",