@orpc/tanstack-query 1.4.3 → 1.4.5

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/dist/index.d.mts CHANGED
@@ -1,21 +1,7 @@
1
- import { OperationType as OperationType$1, OperationKeyOptions as OperationKeyOptions$1, OperationKey as OperationKey$1 } from '@orpc/tanstack-query';
2
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
3
2
  import { SetOptional, PartialDeep, MaybeOptionalOptions } from '@orpc/shared';
4
3
  import { SkipToken, QueryObserverOptions, QueryKey, QueryFunction, experimental_streamedQuery, InfiniteQueryObserverOptions, InfiniteData, MutationObserverOptions } from '@tanstack/query-core';
5
4
 
6
- /**
7
- * Utils at any level (procedure or router)
8
- */
9
- interface GeneralUtils<TInput> {
10
- /**
11
- * Generate a query/mutation key for checking status, invalidate, set, get, etc.
12
- *
13
- * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
14
- */
15
- key<TType extends OperationType$1>(options?: OperationKeyOptions$1<TType, TInput>): OperationKey$1<TType, TInput>;
16
- }
17
- declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
18
-
19
5
  type experimental_StreamedQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
20
6
  type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
21
7
  type OperationType = 'query' | 'streamed' | 'infinite' | 'mutation';
@@ -75,6 +61,19 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
75
61
  }) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
76
62
  type MutationOptions<TInput, TOutput, TError, TMutationContext> = MutationObserverOptions<TOutput, TError, TInput, TMutationContext>;
77
63
 
64
+ /**
65
+ * Utils at any level (procedure or router)
66
+ */
67
+ interface GeneralUtils<TInput> {
68
+ /**
69
+ * Generate a query/mutation key for checking status, invalidate, set, get, etc.
70
+ *
71
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
72
+ */
73
+ key<TType extends OperationType>(options?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
74
+ }
75
+ declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
76
+
78
77
  declare function generateOperationKey<TType extends OperationType, TInput>(path: readonly string[], state?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
79
78
 
80
79
  interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
package/dist/index.d.ts CHANGED
@@ -1,21 +1,7 @@
1
- import { OperationType as OperationType$1, OperationKeyOptions as OperationKeyOptions$1, OperationKey as OperationKey$1 } from '@orpc/tanstack-query';
2
1
  import { ClientContext, Client, NestedClient } from '@orpc/client';
3
2
  import { SetOptional, PartialDeep, MaybeOptionalOptions } from '@orpc/shared';
4
3
  import { SkipToken, QueryObserverOptions, QueryKey, QueryFunction, experimental_streamedQuery, InfiniteQueryObserverOptions, InfiniteData, MutationObserverOptions } from '@tanstack/query-core';
5
4
 
6
- /**
7
- * Utils at any level (procedure or router)
8
- */
9
- interface GeneralUtils<TInput> {
10
- /**
11
- * Generate a query/mutation key for checking status, invalidate, set, get, etc.
12
- *
13
- * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
14
- */
15
- key<TType extends OperationType$1>(options?: OperationKeyOptions$1<TType, TInput>): OperationKey$1<TType, TInput>;
16
- }
17
- declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
18
-
19
5
  type experimental_StreamedQueryOutput<TOutput> = TOutput extends AsyncIterable<infer U> ? U[] : never;
20
6
  type experimental_StreamedQueryOptions = Omit<Parameters<typeof experimental_streamedQuery>[0], 'queryFn'>;
21
7
  type OperationType = 'query' | 'streamed' | 'infinite' | 'mutation';
@@ -75,6 +61,19 @@ type MutationOptionsIn<TClientContext extends ClientContext, TInput, TOutput, TE
75
61
  }) & MutationOptions<TInput, TOutput, TError, TMutationContext>;
76
62
  type MutationOptions<TInput, TOutput, TError, TMutationContext> = MutationObserverOptions<TOutput, TError, TInput, TMutationContext>;
77
63
 
64
+ /**
65
+ * Utils at any level (procedure or router)
66
+ */
67
+ interface GeneralUtils<TInput> {
68
+ /**
69
+ * Generate a query/mutation key for checking status, invalidate, set, get, etc.
70
+ *
71
+ * @see {@link https://orpc.unnoq.com/docs/integrations/tanstack-query-old/basic#query-mutation-key Tanstack Query/Mutation Key Docs}
72
+ */
73
+ key<TType extends OperationType>(options?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
74
+ }
75
+ declare function createGeneralUtils<TInput>(path: readonly string[]): GeneralUtils<TInput>;
76
+
78
77
  declare function generateOperationKey<TType extends OperationType, TInput>(path: readonly string[], state?: OperationKeyOptions<TType, TInput>): OperationKey<TType, TInput>;
79
78
 
80
79
  interface ProcedureUtils<TClientContext extends ClientContext, TInput, TOutput, TError> {
package/dist/index.mjs CHANGED
@@ -1,15 +1,6 @@
1
- import { generateOperationKey as generateOperationKey$1 } from '@orpc/tanstack-query';
2
1
  import { isAsyncIteratorObject, toArray } from '@orpc/shared';
3
2
  import { skipToken, experimental_streamedQuery } from '@tanstack/query-core';
4
3
 
5
- function createGeneralUtils(path) {
6
- return {
7
- key(options) {
8
- return generateOperationKey$1(path, options);
9
- }
10
- };
11
- }
12
-
13
4
  function generateOperationKey(path, state = {}) {
14
5
  return [path, {
15
6
  ...state.input !== void 0 ? { input: state.input } : {},
@@ -18,6 +9,14 @@ function generateOperationKey(path, state = {}) {
18
9
  }];
19
10
  }
20
11
 
12
+ function createGeneralUtils(path) {
13
+ return {
14
+ key(options) {
15
+ return generateOperationKey(path, options);
16
+ }
17
+ };
18
+ }
19
+
21
20
  const OPERATION_CONTEXT_SYMBOL = Symbol("ORPC_OPERATION_CONTEXT");
22
21
 
23
22
  function createProcedureUtils(client, options) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/tanstack-query",
3
3
  "type": "module",
4
- "version": "1.4.3",
4
+ "version": "1.4.5",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -25,10 +25,10 @@
25
25
  ],
26
26
  "peerDependencies": {
27
27
  "@tanstack/query-core": ">=5.80.2",
28
- "@orpc/client": "1.4.3"
28
+ "@orpc/client": "1.4.5"
29
29
  },
30
30
  "dependencies": {
31
- "@orpc/shared": "1.4.3"
31
+ "@orpc/shared": "1.4.5"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@angular/core": "^20.0.0",