@orpc/tanstack-query 2.0.0-beta.52 → 2.0.0-beta.53

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
@@ -63,7 +63,7 @@ Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [
63
63
 
64
64
  | Package | Purpose | Docs |
65
65
  | -------------------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
66
- | [@orpc/contract](https://www.npmjs.com/package/@orpc/contract) | Define API contract as the single source of truth. | [Procedure Contract](https://orpc.dev/docs/contract/procedure), [Contract Router](https://orpc.dev/docs/contract/router), [Implementation](https://orpc.dev/docs/contract/implementation), [Generate from OpenAPI](https://orpc.dev/docs/contract/generate-from-openapi) |
66
+ | [@orpc/contract](https://www.npmjs.com/package/@orpc/contract) | Define API contract as the single source of truth. | [Procedure Contract](https://orpc.dev/docs/contract/procedure), [Router Contract](https://orpc.dev/docs/contract/router), [Implementation](https://orpc.dev/docs/contract/implementation), [Generate from OpenAPI](https://orpc.dev/docs/contract/generate-from-openapi) |
67
67
  | [@orpc/server](https://www.npmjs.com/package/@orpc/server) | Build APIs or implement contracts. | [Procedure](https://orpc.dev/docs/procedure), [Router](https://orpc.dev/docs/router), [Middleware](https://orpc.dev/docs/middleware), [Context](https://orpc.dev/docs/context), [RPC Handler](https://orpc.dev/docs/rpc/handler) |
68
68
  | [@orpc/client](https://www.npmjs.com/package/@orpc/client) | Consume APIs with end-to-end type safety. | [Client-Side Clients](https://orpc.dev/docs/client/client-side), [Server-Side Clients](https://orpc.dev/docs/client/server-side), [RPC Link](https://orpc.dev/docs/rpc/link), [Error Handling](https://orpc.dev/docs/client/error-handling) |
69
69
  | [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi) | Add OpenAPI compatibility to APIs. | [OpenAPI Handler](https://orpc.dev/docs/openapi/handler), [OpenAPI Link](https://orpc.dev/docs/openapi/link), [Specification](https://orpc.dev/docs/openapi/specification), [Scalar](https://orpc.dev/docs/openapi/scalar) |
package/dist/index.d.ts CHANGED
@@ -5,10 +5,10 @@ import { RouterUtilsPlugin } from "./plugin.js";
5
5
  import { ProcedureUtils, ProcedureUtilsInfiniteInterceptor, ProcedureUtilsInfiniteInterceptorOptions, ProcedureUtilsLiveInterceptor, ProcedureUtilsLiveInterceptorOptions, ProcedureUtilsModifier, ProcedureUtilsMutationInterceptor, ProcedureUtilsMutationInterceptorOptions, ProcedureUtilsOptions, ProcedureUtilsQueryInterceptor, ProcedureUtilsQueryInterceptorOptions, ProcedureUtilsStreamedInterceptor, ProcedureUtilsStreamedInterceptorOptions, mergeProcedureUtilsOptions } from "./procedure-utils.js";
6
6
  import { RouterUtils, RouterUtilsInternal, RouterUtilsOptions, RouterUtilsScoped, RouterUtilsScopedInternal, createRouterUtils } from "./router-utils.js";
7
7
  import { SharedUtils } from "./shared-utils.js";
8
- import { StreamQuerySSRUtilsPlugin, StreamQuerySSRUtilsPluginOptions, createHydrationOptions } from "./ssr.js";
8
+ import { CreateHydrationOptionsOptions, StreamQuerySSRUtilsPlugin, StreamQuerySSRUtilsPluginOptions, createHydrationOptions } from "./ssr.js";
9
9
  import { SerializableStreamedQueryOptions, SettleOnFirstDataOptions } from "./stream-query.js";
10
- import { StructuralSharing, createStructuralSharing } from "./structural-sharing.js";
11
- import { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, LiveOptionsInRest, MutationKeyOptions, MutationOptionsIn, MutationOptionsInRest, MutationOptionsOut, OPERATION_CONTEXT_SYMBOL, OperationContext, OperationType, QueryKeyOptions, QueryOptionsIn, QueryOptionsInRest, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsInRest, StreamedOptionsOut } from "./types.js";
10
+ import { CreateStructuralSharingOptions, StructuralSharing, createStructuralSharing } from "./structural-sharing.js";
11
+ import { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, LiveOptionsInRest, MutationKeyOptions, MutationOptionsIn, MutationOptionsInRest, MutationOptionsOut, OperationType, QueryKeyOptions, QueryOptionsIn, QueryOptionsInRest, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsInRest, StreamedOptionsOut, TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL, TanstackQueryOperationContext } from "./types.js";
12
12
  import { Public } from "@orpc/shared";
13
13
  import { AnyNestedClient } from "@orpc/client";
14
- export { type AnyNestedClient, ContractJsonifiedUtilsFactory, ContractJsonifiedUtilsFactoryOptions, ContractOptionsUtilsPlugin, ContractUtilsFactory, ContractUtilsFactoryOptions, InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, LiveOptionsInRest, MutationKeyOptions, MutationOptionsIn, MutationOptionsInRest, MutationOptionsOut, OPERATION_CONTEXT_SYMBOL, OperationContext, type OperationKey, type OperationKeyBaseOptions, type OperationKeyOptions, type OperationKeyPrefixOptions, OperationType, ProcedureUtils, type ProcedureUtilsInfiniteInterceptor, type ProcedureUtilsInfiniteInterceptorOptions, type ProcedureUtilsLiveInterceptor, type ProcedureUtilsLiveInterceptorOptions, type ProcedureUtilsModifier, type ProcedureUtilsMutationInterceptor, type ProcedureUtilsMutationInterceptorOptions, type ProcedureUtilsOptions, type ProcedureUtilsQueryInterceptor, type ProcedureUtilsQueryInterceptorOptions, type ProcedureUtilsStreamedInterceptor, type ProcedureUtilsStreamedInterceptorOptions, type Public, QueryKeyOptions, QueryOptionsIn, QueryOptionsInRest, QueryOptionsOut, RouterUtils, RouterUtilsInternal, RouterUtilsOptions, type RouterUtilsPlugin, RouterUtilsScoped, RouterUtilsScopedInternal, type SerializableStreamedQueryOptions, type SettleOnFirstDataOptions, SharedUtils, StreamQuerySSRUtilsPlugin, StreamQuerySSRUtilsPluginOptions, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsInRest, StreamedOptionsOut, StructuralSharing, OPERATION_CONTEXT_SYMBOL as TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL, TanstackQueryMetaOptions, TanstackQueryMetaPlugin, type OperationContext as TanstackQueryOperationContext, createContractJsonifiedUtilsFactory, createContractUtilsFactory, createHydrationOptions, createRouterUtils, createStructuralSharing, createRouterUtils as createTanstackQueryUtils, getTanstackQueryMeta, mergeProcedureUtilsOptions, tanstackQuery };
14
+ export { type AnyNestedClient, ContractJsonifiedUtilsFactory, ContractJsonifiedUtilsFactoryOptions, ContractOptionsUtilsPlugin, ContractUtilsFactory, ContractUtilsFactoryOptions, CreateHydrationOptionsOptions, CreateStructuralSharingOptions, InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, LiveOptionsInRest, MutationKeyOptions, MutationOptionsIn, MutationOptionsInRest, MutationOptionsOut, TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL as OPERATION_CONTEXT_SYMBOL, type TanstackQueryOperationContext as OperationContext, type OperationKey, type OperationKeyBaseOptions, type OperationKeyOptions, type OperationKeyPrefixOptions, OperationType, ProcedureUtils, type ProcedureUtilsInfiniteInterceptor, type ProcedureUtilsInfiniteInterceptorOptions, type ProcedureUtilsLiveInterceptor, type ProcedureUtilsLiveInterceptorOptions, type ProcedureUtilsModifier, type ProcedureUtilsMutationInterceptor, type ProcedureUtilsMutationInterceptorOptions, type ProcedureUtilsOptions, type ProcedureUtilsQueryInterceptor, type ProcedureUtilsQueryInterceptorOptions, type ProcedureUtilsStreamedInterceptor, type ProcedureUtilsStreamedInterceptorOptions, type Public, QueryKeyOptions, QueryOptionsIn, QueryOptionsInRest, QueryOptionsOut, RouterUtils, RouterUtilsInternal, RouterUtilsOptions, type RouterUtilsPlugin, RouterUtilsScoped, RouterUtilsScopedInternal, type SerializableStreamedQueryOptions, type SettleOnFirstDataOptions, SharedUtils, StreamQuerySSRUtilsPlugin, StreamQuerySSRUtilsPluginOptions, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsInRest, StreamedOptionsOut, StructuralSharing, TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL, TanstackQueryMetaOptions, TanstackQueryMetaPlugin, TanstackQueryOperationContext, createContractJsonifiedUtilsFactory, createContractUtilsFactory, createHydrationOptions, createRouterUtils, createStructuralSharing, createRouterUtils as createTanstackQueryUtils, getTanstackQueryMeta, mergeProcedureUtilsOptions, tanstackQuery };
package/dist/index.js CHANGED
@@ -5,4 +5,4 @@ export { createRouterUtils, createRouterUtils as createTanstackQueryUtils } from
5
5
  export { SharedUtils } from "./shared-utils.js";
6
6
  export { StreamQuerySSRUtilsPlugin, createHydrationOptions } from "./ssr.js";
7
7
  export { createStructuralSharing } from "./structural-sharing.js";
8
- export { OPERATION_CONTEXT_SYMBOL, OPERATION_CONTEXT_SYMBOL as TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL } from "./types.js";
8
+ export { TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL as OPERATION_CONTEXT_SYMBOL, TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL } from "./types.js";
@@ -1,12 +1,12 @@
1
1
  import { OperationKeyBaseOptions } from "./key.js";
2
2
  import { SharedUtils } from "./shared-utils.js";
3
- import { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, LiveOptionsInRest, MutationKeyOptions, MutationOptionsIn, MutationOptionsInRest, MutationOptionsOut, OperationContext, QueryKeyOptions, QueryOptionsIn, QueryOptionsInRest, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsInRest, StreamedOptionsOut } from "./types.js";
3
+ import { InferLiveQueryOutput, InferStreamedQueryOutput, InfiniteKeyOptions, InfiniteOptionsIn, InfiniteOptionsOut, LiveOptionsIn, LiveOptionsInRest, MutationKeyOptions, MutationOptionsIn, MutationOptionsInRest, MutationOptionsOut, QueryKeyOptions, QueryOptionsIn, QueryOptionsInRest, QueryOptionsOut, StreamedKeyOptions, StreamedOptionsIn, StreamedOptionsInRest, StreamedOptionsOut, TanstackQueryOperationContext } from "./types.js";
4
4
  import { Interceptor, MaybeOptionalOptions, PromiseWithError } from "@orpc/shared";
5
5
  import { Client, ClientContext } from "@orpc/client";
6
6
  import { DataTag, InfiniteData, MutationFunctionContext, QueryFunctionContext, QueryKey, SkipToken } from "@tanstack/query-core";
7
7
  export interface ProcedureUtilsQueryInterceptorOptions<TClientContext extends ClientContext, TInput> {
8
8
  path: string[];
9
- context: TClientContext & OperationContext;
9
+ context: TClientContext & TanstackQueryOperationContext;
10
10
  input: TInput | SkipToken;
11
11
  fnContext: QueryFunctionContext;
12
12
  }
@@ -2,7 +2,7 @@ import { liveQuery } from "./live-query.js";
2
2
  import { SharedUtils } from "./shared-utils.js";
3
3
  import { serializableStreamedQuery } from "./stream-query.js";
4
4
  import { createStructuralSharing } from "./structural-sharing.js";
5
- import { OPERATION_CONTEXT_SYMBOL } from "./types.js";
5
+ import { TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL } from "./types.js";
6
6
  import { intercept, isAsyncIteratorObject, isNonPrimitive, resolveMaybeOptionalOptions, toArray } from "@orpc/shared";
7
7
  import { skipToken } from "@tanstack/query-core";
8
8
  // src/procedure-utils.ts
@@ -121,14 +121,14 @@ var ProcedureUtils = class extends SharedUtils {
121
121
  };
122
122
  const queryKey = this.queryKey(optionsIn);
123
123
  return {
124
- structuralSharing: createStructuralSharing(this.options.serializer),
124
+ structuralSharing: createStructuralSharing({ serializer: this.options.serializer }),
125
125
  ...optionsIn,
126
126
  queryKey,
127
127
  queryFn: (fnContext) => {
128
128
  return intercept(this.options.queryInterceptors, {
129
129
  path: this.path,
130
130
  context: {
131
- [OPERATION_CONTEXT_SYMBOL]: {
131
+ [TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL]: {
132
132
  key: queryKey,
133
133
  type: "query"
134
134
  },
@@ -161,7 +161,7 @@ var ProcedureUtils = class extends SharedUtils {
161
161
  return optionsIn.queryKey ?? this.key({
162
162
  type: "streamed",
163
163
  input: optionsIn.input,
164
- fnOptions: optionsIn.queryFnOptions
164
+ fnOptions: optionsIn.fnOptions
165
165
  });
166
166
  }
167
167
  /**
@@ -186,7 +186,7 @@ var ProcedureUtils = class extends SharedUtils {
186
186
  return intercept(toArray(this.options.streamedInterceptors), {
187
187
  path: this.path,
188
188
  context: {
189
- [OPERATION_CONTEXT_SYMBOL]: {
189
+ [TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL]: {
190
190
  key: queryKey,
191
191
  type: "streamed"
192
192
  },
@@ -205,7 +205,7 @@ var ProcedureUtils = class extends SharedUtils {
205
205
  if (!isAsyncIteratorObject(output)) throw new Error("streamedQuery requires an AsyncIteratorObject output");
206
206
  return output;
207
207
  }, {
208
- ...optionsIn.queryFnOptions,
208
+ ...optionsIn.fnOptions,
209
209
  settleOnFirstData
210
210
  })(fnContext);
211
211
  });
@@ -243,14 +243,14 @@ var ProcedureUtils = class extends SharedUtils {
243
243
  const queryKey = this.liveKey(optionsIn);
244
244
  const { settleOnFirstData, ...queryOptions } = optionsIn;
245
245
  return {
246
- structuralSharing: createStructuralSharing(this.options.serializer),
246
+ structuralSharing: createStructuralSharing({ serializer: this.options.serializer }),
247
247
  ...queryOptions,
248
248
  queryKey,
249
249
  queryFn: (fnContext) => {
250
250
  return intercept(toArray(this.options.liveInterceptors), {
251
251
  path: this.path,
252
252
  context: {
253
- [OPERATION_CONTEXT_SYMBOL]: {
253
+ [TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL]: {
254
254
  key: queryKey,
255
255
  type: "live"
256
256
  },
@@ -299,14 +299,14 @@ var ProcedureUtils = class extends SharedUtils {
299
299
  };
300
300
  const queryKey = this.infiniteKey(optionsIn);
301
301
  return {
302
- structuralSharing: createStructuralSharing(this.options.serializer),
302
+ structuralSharing: createStructuralSharing({ serializer: this.options.serializer }),
303
303
  ...optionsIn,
304
304
  queryKey,
305
305
  queryFn: (fnContext) => {
306
306
  return intercept(toArray(this.options.infiniteInterceptors), {
307
307
  path: this.path,
308
308
  context: {
309
- [OPERATION_CONTEXT_SYMBOL]: {
309
+ [TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL]: {
310
310
  key: queryKey,
311
311
  type: "infinite"
312
312
  },
@@ -355,7 +355,7 @@ var ProcedureUtils = class extends SharedUtils {
355
355
  return intercept(toArray(this.options.mutationInterceptors), {
356
356
  path: this.path,
357
357
  context: {
358
- [OPERATION_CONTEXT_SYMBOL]: {
358
+ [TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL]: {
359
359
  key: mutationKey,
360
360
  type: "mutation"
361
361
  },
@@ -11,8 +11,20 @@ import { AnyNestedClient, Client, InferClientContext, InferClientError } from "@
11
11
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query | TanStack Query Integration}
12
12
  */
13
13
  export type RouterUtils<T extends AnyNestedClient> = RouterUtilsInternal<T>;
14
+ /**
15
+ * The recursion behind {@link RouterUtils}. Exported only so TypeScript can name it
16
+ * in declarations emitted for generic code, do not use it directly.
17
+ *
18
+ * @internal
19
+ */
14
20
  export type RouterUtilsInternal<T> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? Public<ProcedureUtils<UClientContext, UInput, UOutput, UError>> : { [K in keyof T]: RouterUtilsInternal<T[K] & {}>; } & Public<SharedUtils<unknown>>;
15
21
  export type RouterUtilsScoped<T extends AnyNestedClient> = RouterUtilsScopedInternal<T>;
22
+ /**
23
+ * The recursion behind {@link RouterUtilsScoped}. Exported only so TypeScript can name it
24
+ * in declarations emitted for generic code, do not use it directly.
25
+ *
26
+ * @internal
27
+ */
16
28
  export type RouterUtilsScopedInternal<T> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? ProcedureUtilsOptions<UClientContext, UInput, UOutput, UError> : { [K in keyof T]?: RouterUtilsScopedInternal<T[K] & {}> | undefined; };
17
29
  export interface RouterUtilsOptions<T extends AnyNestedClient> extends OperationKeyBaseOptions {
18
30
  /**
package/dist/ssr.d.ts CHANGED
@@ -2,12 +2,21 @@ import { RouterUtilsPlugin } from "./plugin.js";
2
2
  import { ProcedureUtilsOptions } from "./procedure-utils.js";
3
3
  import { Public } from "@orpc/shared";
4
4
  import { AnyNestedClient, InferClientContext, InferClientError, RPCJsonSerialization, RPCJsonSerializer } from "@orpc/client";
5
+ export interface CreateHydrationOptionsOptions {
6
+ /**
7
+ * Serializes query data when dehydrating, and deserializes it when hydrating.
8
+ * Pass the serializer your link uses so custom types are supported.
9
+ *
10
+ * @default new RPCJsonSerializer()
11
+ */
12
+ serializer?: Public<RPCJsonSerializer> | undefined;
13
+ }
5
14
  /**
6
15
  * Creates `dehydrate` and `hydrate` query client defaults that preserve oRPC types.
7
16
  *
8
17
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#custom-serializers | TanStack Query Integration - Custom Serializers}
9
18
  */
10
- export declare function createHydrationOptions(serializer?: Public<RPCJsonSerializer>): {
19
+ export declare function createHydrationOptions(options?: CreateHydrationOptionsOptions): {
11
20
  dehydrate: {
12
21
  serializeData: (data: unknown) => RPCJsonSerialization;
13
22
  };
package/dist/ssr.js CHANGED
@@ -7,7 +7,8 @@ import { environmentManager } from "@tanstack/query-core";
7
7
  *
8
8
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#custom-serializers | TanStack Query Integration - Custom Serializers}
9
9
  */
10
- function createHydrationOptions(serializer = new RPCJsonSerializer()) {
10
+ function createHydrationOptions(options = {}) {
11
+ const serializer = options.serializer ?? new RPCJsonSerializer();
11
12
  return {
12
13
  dehydrate: { serializeData(data) {
13
14
  const { json, meta } = serializer.serializeJson(data);
@@ -1,6 +1,13 @@
1
1
  import { Public } from "@orpc/shared";
2
2
  import { RPCJsonSerializer } from "@orpc/client";
3
3
  export type StructuralSharing = <T>(oldData: unknown, newData: T) => T;
4
+ export interface CreateStructuralSharingOptions {
5
+ /**
6
+ * Compares custom types by what their handler serializes them to.
7
+ * Without it, only the built-in types are compared.
8
+ */
9
+ serializer?: Public<RPCJsonSerializer> | undefined;
10
+ }
4
11
  /**
5
12
  * Creates a `structuralSharing` function that works like TanStack Query's default, but also keeps
6
13
  * the previous reference for equal `Date`, `URL`, `Map` and `Set` values, which oRPC's serializer
@@ -11,4 +18,4 @@ export type StructuralSharing = <T>(oldData: unknown, newData: T) => T;
11
18
  *
12
19
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#structural-sharing | TanStack Query Integration - Structural Sharing}
13
20
  */
14
- export declare function createStructuralSharing(serializer?: Public<RPCJsonSerializer>): StructuralSharing;
21
+ export declare function createStructuralSharing(options?: CreateStructuralSharingOptions): StructuralSharing;
@@ -10,7 +10,8 @@ import { setOwn, stringifyJSON } from "@orpc/shared";
10
10
  *
11
11
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#structural-sharing | TanStack Query Integration - Structural Sharing}
12
12
  */
13
- function createStructuralSharing(serializer) {
13
+ function createStructuralSharing(options = {}) {
14
+ const serializer = options.serializer;
14
15
  return (oldData, newData) => replaceEqualDeep(oldData, newData, 0, serializer);
15
16
  }
16
17
  function replaceEqualDeep(a, b, depth, serializer) {
package/dist/types.d.ts CHANGED
@@ -10,15 +10,15 @@ export type OperationType = "query" | "streamed" | "live" | "infinite" | "mutati
10
10
  *
11
11
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#client-context | TanStack Query Integration - Client Context}
12
12
  */
13
- export declare const OPERATION_CONTEXT_SYMBOL: unique symbol;
13
+ export declare const TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL: unique symbol;
14
14
  /**
15
15
  * A client context automatically populated by TanStack Query utils,
16
16
  * exposing the operation key and type of the calling operation.
17
17
  *
18
18
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#client-context | TanStack Query Integration - Client Context}
19
19
  */
20
- export interface OperationContext {
21
- [OPERATION_CONTEXT_SYMBOL]?: {
20
+ export interface TanstackQueryOperationContext {
21
+ [TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL]?: {
22
22
  key: QueryKey;
23
23
  type: OperationType;
24
24
  };
@@ -57,12 +57,12 @@ export type StreamedKeyOptions<TInput> = ((undefined extends TInput ? {
57
57
  } : {
58
58
  input: TInput | SkipToken;
59
59
  }) & {
60
- queryFnOptions?: SerializableStreamedQueryOptions | undefined;
60
+ fnOptions?: SerializableStreamedQueryOptions | undefined;
61
61
  }) | {
62
62
  queryKey: QueryKey;
63
63
  };
64
64
  export type StreamedOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TError, TSelectData, TInitialData> = QueryOptionsIn<TClientContext, TInput, TOutput, TError, TSelectData, TInitialData> & {
65
- queryFnOptions?: SerializableStreamedQueryOptions | undefined;
65
+ fnOptions?: SerializableStreamedQueryOptions | undefined;
66
66
  } & SettleOnFirstDataOptions;
67
67
  /**
68
68
  * Rest parameters of `.streamedOptions`: optional when input and context are.
package/dist/types.js CHANGED
@@ -5,5 +5,5 @@
5
5
  *
6
6
  * @see {@link https://orpc.dev/docs/integrations/tanstack-query#client-context | TanStack Query Integration - Client Context}
7
7
  */
8
- const OPERATION_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol.for("ORPC_TANSTACK_QUERY_OPERATION_CONTEXT");
9
- export { OPERATION_CONTEXT_SYMBOL };
8
+ const TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL = /* @__PURE__ */ Symbol.for("ORPC_TANSTACK_QUERY_OPERATION_CONTEXT");
9
+ export { TANSTACK_QUERY_OPERATION_CONTEXT_SYMBOL };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orpc/tanstack-query",
3
- "version": "2.0.0-beta.52",
3
+ "version": "2.0.0-beta.53",
4
4
  "description": "TanStack Query integration for oRPC: typesafe queries, mutations, streaming, and SSR for React, Vue, Solid, Svelte, and Angular",
5
5
  "keywords": [
6
6
  "angular-query",
@@ -41,10 +41,10 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@orpc/client": "2.0.0-beta.52",
45
- "@orpc/contract": "2.0.0-beta.52",
46
- "@orpc/openapi": "2.0.0-beta.52",
47
- "@orpc/shared": "2.0.0-beta.52"
44
+ "@orpc/client": "2.0.0-beta.53",
45
+ "@orpc/contract": "2.0.0-beta.53",
46
+ "@orpc/openapi": "2.0.0-beta.53",
47
+ "@orpc/shared": "2.0.0-beta.53"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@angular/core": "^22.2.4",