@trpc/react-query 11.3.1 → 11.3.2-canary.4

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.
Files changed (129) hide show
  1. package/dist/getQueryKey-CP8onRYT.cjs +104 -0
  2. package/dist/getQueryKey-Dekty44G.mjs +53 -0
  3. package/dist/getQueryKey-Dekty44G.mjs.map +1 -0
  4. package/dist/getQueryKey.d-C_PnqPni.d.cts +892 -0
  5. package/dist/getQueryKey.d-C_PnqPni.d.cts.map +1 -0
  6. package/dist/getQueryKey.d-CruH3ncI.d.mts +892 -0
  7. package/dist/getQueryKey.d-CruH3ncI.d.mts.map +1 -0
  8. package/dist/index.cjs +47 -0
  9. package/dist/index.d.cts +31 -0
  10. package/dist/index.d.cts.map +1 -0
  11. package/dist/index.d.mts +31 -0
  12. package/dist/index.d.mts.map +1 -0
  13. package/dist/index.mjs +40 -4
  14. package/dist/index.mjs.map +1 -0
  15. package/dist/rsc.cjs +69 -0
  16. package/dist/rsc.d.cts +80 -0
  17. package/dist/rsc.d.cts.map +1 -0
  18. package/dist/rsc.d.mts +80 -0
  19. package/dist/rsc.d.mts.map +1 -0
  20. package/dist/rsc.mjs +65 -104
  21. package/dist/rsc.mjs.map +1 -0
  22. package/dist/server/index.cjs +132 -0
  23. package/dist/server/index.d.cts +31 -0
  24. package/dist/server/index.d.cts.map +1 -0
  25. package/dist/server/index.d.mts +31 -0
  26. package/dist/server/index.d.mts.map +1 -0
  27. package/dist/server/index.mjs +133 -1
  28. package/dist/server/index.mjs.map +1 -0
  29. package/dist/shared/index.cjs +13 -0
  30. package/dist/shared/index.d.cts +2 -0
  31. package/dist/shared/index.d.mts +2 -0
  32. package/dist/shared/index.mjs +4 -7
  33. package/dist/shared-CMPBsqju.mjs +784 -0
  34. package/dist/shared-CMPBsqju.mjs.map +1 -0
  35. package/dist/shared-Doe-Gsbv.cjs +846 -0
  36. package/package.json +45 -26
  37. package/rsc/package.json +1 -0
  38. package/server/package.json +1 -0
  39. package/shared/package.json +1 -0
  40. package/dist/createTRPCQueryUtils.d.ts +0 -4
  41. package/dist/createTRPCQueryUtils.d.ts.map +0 -1
  42. package/dist/createTRPCQueryUtils.js +0 -16
  43. package/dist/createTRPCQueryUtils.mjs +0 -14
  44. package/dist/createTRPCReact.d.ts +0 -147
  45. package/dist/createTRPCReact.d.ts.map +0 -1
  46. package/dist/createTRPCReact.js +0 -60
  47. package/dist/createTRPCReact.mjs +0 -38
  48. package/dist/index.d.ts +0 -6
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js +0 -19
  51. package/dist/internals/context.d.ts +0 -157
  52. package/dist/internals/context.d.ts.map +0 -1
  53. package/dist/internals/context.js +0 -33
  54. package/dist/internals/context.mjs +0 -11
  55. package/dist/internals/getClientArgs.d.ts +0 -9
  56. package/dist/internals/getClientArgs.d.ts.map +0 -1
  57. package/dist/internals/getClientArgs.js +0 -24
  58. package/dist/internals/getClientArgs.mjs +0 -22
  59. package/dist/internals/getQueryKey.d.ts +0 -49
  60. package/dist/internals/getQueryKey.d.ts.map +0 -1
  61. package/dist/internals/getQueryKey.js +0 -75
  62. package/dist/internals/getQueryKey.mjs +0 -70
  63. package/dist/internals/trpcResult.d.ts +0 -18
  64. package/dist/internals/trpcResult.d.ts.map +0 -1
  65. package/dist/internals/trpcResult.js +0 -63
  66. package/dist/internals/trpcResult.mjs +0 -40
  67. package/dist/internals/useQueries.d.ts +0 -58
  68. package/dist/internals/useQueries.d.ts.map +0 -1
  69. package/dist/rsc.d.ts +0 -80
  70. package/dist/rsc.d.ts.map +0 -1
  71. package/dist/rsc.js +0 -130
  72. package/dist/server/index.d.ts +0 -2
  73. package/dist/server/index.d.ts.map +0 -1
  74. package/dist/server/index.js +0 -7
  75. package/dist/server/ssgProxy.d.ts +0 -31
  76. package/dist/server/ssgProxy.d.ts.map +0 -1
  77. package/dist/server/ssgProxy.js +0 -141
  78. package/dist/server/ssgProxy.mjs +0 -139
  79. package/dist/shared/hooks/createHooksInternal.d.ts +0 -31
  80. package/dist/shared/hooks/createHooksInternal.d.ts.map +0 -1
  81. package/dist/shared/hooks/createHooksInternal.js +0 -543
  82. package/dist/shared/hooks/createHooksInternal.mjs +0 -522
  83. package/dist/shared/hooks/createRootHooks.d.ts +0 -2
  84. package/dist/shared/hooks/createRootHooks.d.ts.map +0 -1
  85. package/dist/shared/hooks/types.d.ts +0 -157
  86. package/dist/shared/hooks/types.d.ts.map +0 -1
  87. package/dist/shared/index.d.ts +0 -22
  88. package/dist/shared/index.d.ts.map +0 -1
  89. package/dist/shared/index.js +0 -22
  90. package/dist/shared/polymorphism/index.d.ts +0 -5
  91. package/dist/shared/polymorphism/index.d.ts.map +0 -1
  92. package/dist/shared/polymorphism/mutationLike.d.ts +0 -17
  93. package/dist/shared/polymorphism/mutationLike.d.ts.map +0 -1
  94. package/dist/shared/polymorphism/queryLike.d.ts +0 -21
  95. package/dist/shared/polymorphism/queryLike.d.ts.map +0 -1
  96. package/dist/shared/polymorphism/routerLike.d.ts +0 -11
  97. package/dist/shared/polymorphism/routerLike.d.ts.map +0 -1
  98. package/dist/shared/polymorphism/utilsLike.d.ts +0 -7
  99. package/dist/shared/polymorphism/utilsLike.d.ts.map +0 -1
  100. package/dist/shared/proxy/decorationProxy.d.ts +0 -8
  101. package/dist/shared/proxy/decorationProxy.d.ts.map +0 -1
  102. package/dist/shared/proxy/decorationProxy.js +0 -30
  103. package/dist/shared/proxy/decorationProxy.mjs +0 -28
  104. package/dist/shared/proxy/useQueriesProxy.d.ts +0 -25
  105. package/dist/shared/proxy/useQueriesProxy.d.ts.map +0 -1
  106. package/dist/shared/proxy/useQueriesProxy.js +0 -27
  107. package/dist/shared/proxy/useQueriesProxy.mjs +0 -25
  108. package/dist/shared/proxy/utilsProxy.d.ts +0 -141
  109. package/dist/shared/proxy/utilsProxy.d.ts.map +0 -1
  110. package/dist/shared/proxy/utilsProxy.js +0 -106
  111. package/dist/shared/proxy/utilsProxy.mjs +0 -102
  112. package/dist/shared/queryClient.d.ts +0 -17
  113. package/dist/shared/queryClient.d.ts.map +0 -1
  114. package/dist/shared/queryClient.js +0 -9
  115. package/dist/shared/queryClient.mjs +0 -7
  116. package/dist/shared/types.d.ts +0 -98
  117. package/dist/shared/types.d.ts.map +0 -1
  118. package/dist/utils/createUtilityFunctions.d.ts +0 -23
  119. package/dist/utils/createUtilityFunctions.d.ts.map +0 -1
  120. package/dist/utils/createUtilityFunctions.js +0 -196
  121. package/dist/utils/createUtilityFunctions.mjs +0 -194
  122. package/dist/utils/inferReactQueryProcedure.d.ts +0 -25
  123. package/dist/utils/inferReactQueryProcedure.d.ts.map +0 -1
  124. package/rsc/index.d.ts +0 -1
  125. package/rsc/index.js +0 -1
  126. package/server/index.d.ts +0 -1
  127. package/server/index.js +0 -1
  128. package/shared/index.d.ts +0 -1
  129. package/shared/index.js +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/hooks/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,YAAY,EACZ,kCAAkC,EAClC,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,+BAA+B,EAC/B,8BAA8B,EAC9B,uBAAuB,EACvB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,SAAS,EACT,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC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AK,EAAE,WAAW,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,EAClE,MAAM,CACP,GACC,cAAc;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,IACnE,cAAc,GAAG,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
@@ -1,22 +0,0 @@
1
- export * from './proxy/decorationProxy';
2
- export * from './proxy/utilsProxy';
3
- export * from './proxy/useQueriesProxy';
4
- export type { DecorateRouterRecord, DecorateProcedure, } from '../createTRPCReact';
5
- export type { TRPCUseQueries, TRPCUseSuspenseQueries, } from '../internals/useQueries';
6
- export * from './hooks/createRootHooks';
7
- export * from './queryClient';
8
- export * from './types';
9
- export * from './hooks/types';
10
- export * from './polymorphism';
11
- export {
12
- /**
13
- * @deprecated this is an internal function
14
- */
15
- getClientArgs, } from '../internals/getClientArgs';
16
- export {
17
- /**
18
- * @deprecated
19
- */
20
- TRPCContext, } from './../internals/context';
21
- export * from '../internals/context';
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,YAAY,EACV,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,cAAc,EACd,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAE/B,OAAO;AACL;;GAEG;AACH,aAAa,GACd,MAAM,4BAA4B,CAAC;AAEpC,OAAO;AACL;;GAEG;AACH,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAEhC,cAAc,sBAAsB,CAAC"}
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- var decorationProxy = require('./proxy/decorationProxy.js');
4
- var utilsProxy = require('./proxy/utilsProxy.js');
5
- var useQueriesProxy = require('./proxy/useQueriesProxy.js');
6
- var createHooksInternal = require('./hooks/createHooksInternal.js');
7
- var queryClient = require('./queryClient.js');
8
- var getClientArgs = require('../internals/getClientArgs.js');
9
- var context = require('../internals/context.js');
10
-
11
-
12
-
13
- exports.createReactDecoration = decorationProxy.createReactDecoration;
14
- exports.createQueryUtilsProxy = utilsProxy.createQueryUtilsProxy;
15
- exports.createReactQueryUtils = utilsProxy.createReactQueryUtils;
16
- exports.getQueryType = utilsProxy.getQueryType;
17
- exports.createUseQueries = useQueriesProxy.createUseQueries;
18
- exports.createRootHooks = createHooksInternal.createRootHooks;
19
- exports.getQueryClient = queryClient.getQueryClient;
20
- exports.getClientArgs = getClientArgs.getClientArgs;
21
- exports.TRPCContext = context.TRPCContext;
22
- exports.contextProps = context.contextProps;
@@ -1,5 +0,0 @@
1
- export * from './mutationLike';
2
- export * from './queryLike';
3
- export * from './routerLike';
4
- export * from './utilsLike';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { AnyProcedure, AnyRootTypes, inferProcedureInput, inferTransformedProcedureOutput } from '@trpc/server/unstable-core-do-not-import';
2
- import type { InferMutationOptions, InferMutationResult } from '../../utils/inferReactQueryProcedure';
3
- /**
4
- * Use to describe a mutation route which matches a given mutation procedure's interface
5
- */
6
- export type MutationLike<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure> = {
7
- useMutation: (opts?: InferMutationOptions<TRoot, TProcedure>) => InferMutationResult<TRoot, TProcedure>;
8
- };
9
- /**
10
- * Use to unwrap a MutationLike's input
11
- */
12
- export type InferMutationLikeInput<TMutationLike extends MutationLike<any, any>> = TMutationLike extends MutationLike<any, infer $Procedure> ? inferProcedureInput<$Procedure> : never;
13
- /**
14
- * Use to unwrap a MutationLike's data output
15
- */
16
- export type InferMutationLikeData<TMutationLike extends MutationLike<any, any>> = TMutationLike extends MutationLike<infer TRoot, infer TProcedure> ? inferTransformedProcedureOutput<TRoot, TProcedure> : never;
17
- //# sourceMappingURL=mutationLike.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mutationLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/mutationLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,+BAA+B,EAChC,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,YAAY,CACtB,KAAK,SAAS,YAAY,EAC1B,UAAU,SAAS,YAAY,IAC7B;IACF,WAAW,EAAE,CACX,IAAI,CAAC,EAAE,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,KAC3C,mBAAmB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,CAChC,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IAE5C,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,MAAM,UAAU,CAAC,GACrD,mBAAmB,CAAC,UAAU,CAAC,GAC/B,KAAK,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAC/B,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IAE5C,aAAa,SAAS,YAAY,CAAC,MAAM,KAAK,EAAE,MAAM,UAAU,CAAC,GAC7D,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,GAClD,KAAK,CAAC"}
@@ -1,21 +0,0 @@
1
- import type { TRPCClientErrorLike } from '@trpc/client';
2
- import type { AnyProcedure, AnyRootTypes, inferProcedureInput, inferProcedureOutput, inferTransformedProcedureOutput } from '@trpc/server/unstable-core-do-not-import';
3
- import type { DecoratedQuery } from '../../createTRPCReact';
4
- import type { InferQueryOptions, InferQueryResult } from '../../utils/inferReactQueryProcedure';
5
- import type { UseTRPCSuspenseQueryResult } from '../hooks/types';
6
- /**
7
- * Use to request a query route which matches a given query procedure's interface
8
- */
9
- export type QueryLike<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure> = {
10
- useQuery: (variables: inferProcedureInput<TProcedure>, opts?: InferQueryOptions<TRoot, TProcedure, any>) => InferQueryResult<TRoot, TProcedure>;
11
- useSuspenseQuery: (variables: inferProcedureInput<TProcedure>, opts?: InferQueryOptions<TRoot, TProcedure, any>) => UseTRPCSuspenseQueryResult<inferProcedureOutput<TProcedure>, TRPCClientErrorLike<TRoot>>;
12
- };
13
- /**
14
- * Use to unwrap a QueryLike's input
15
- */
16
- export type InferQueryLikeInput<TQueryLike> = TQueryLike extends DecoratedQuery<infer $Def> ? $Def['input'] : TQueryLike extends QueryLike<any, infer TProcedure> ? inferProcedureInput<TProcedure> : never;
17
- /**
18
- * Use to unwrap a QueryLike's data output
19
- */
20
- export type InferQueryLikeData<TQueryLike> = TQueryLike extends DecoratedQuery<infer $Def> ? $Def['output'] : TQueryLike extends QueryLike<infer TRoot, infer TProcedure> ? inferTransformedProcedureOutput<TRoot, TProcedure> : never;
21
- //# sourceMappingURL=queryLike.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryLike.d.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AAU,IACvC,UAAU,SAAS,cAAc,CAAC,MAAM,IAAI,CAAC,GACzC,IAAI,CAAC,QAAQ,CAAC,GACd,UAAU,SAAS,SAAS,CAAC,MAAM,KAAK,EAAE,MAAM,UAAU,CAAC,GACzD,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,GAClD,KAAK,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { AnyMutationProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
2
- import type { MutationLike } from './mutationLike';
3
- import type { QueryLike } from './queryLike';
4
- /**
5
- * Use to describe a route path which matches a given route's interface
6
- */
7
- export type RouterLike<TRouter extends AnyRouter> = RouterLikeInner<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
8
- export type RouterLikeInner<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = {
9
- [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? QueryLike<TRoot, $Value> : $Value extends AnyMutationProcedure ? MutationLike<TRoot, $Value> : $Value extends RouterRecord ? RouterLikeInner<TRoot, $Value> : never : never;
10
- };
11
- //# sourceMappingURL=routerLike.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routerLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/routerLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,SAAS,IAAI,eAAe,CACjE,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC;AACF,MAAM,MAAM,eAAe,CACzB,KAAK,SAAS,YAAY,EAC1B,OAAO,SAAS,YAAY,IAC1B;KACD,IAAI,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,MAAM,MAAM,GACvD,MAAM,SAAS,iBAAiB,GAC9B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,GACxB,MAAM,SAAS,oBAAoB,GACjC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,GAC3B,MAAM,SAAS,YAAY,GACzB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9B,KAAK,GACX,KAAK;CACV,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';
2
- import type { DecoratedProcedureUtilsRecord } from '../proxy/utilsProxy';
3
- /**
4
- * Use to describe a Utils/Context path which matches the given route's interface
5
- */
6
- export type UtilsLike<TRouter extends AnyRouter> = DecoratedProcedureUtilsRecord<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
7
- //# sourceMappingURL=utilsLike.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utilsLike.d.ts","sourceRoot":"","sources":["../../../src/shared/polymorphism/utilsLike.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,SAAS,IAC7C,6BAA6B,CAC3B,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';
2
- import type { CreateReactQueryHooks } from '../hooks/createHooksInternal';
3
- /**
4
- * Create proxy for decorating procedures
5
- * @internal
6
- */
7
- export declare function createReactDecoration<TRouter extends AnyRouter, TSSRContext = unknown>(hooks: CreateReactQueryHooks<TRouter, TSSRContext>): unknown;
8
- //# sourceMappingURL=decorationProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decorationProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/decorationProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAE1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,SAAS,SAAS,EACzB,WAAW,GAAG,OAAO,EACrB,KAAK,EAAE,qBAAqB,CAAC,OAAO,EAAE,WAAW,CAAC,WAuBnD"}
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import');
4
-
5
- /**
6
- * Create proxy for decorating procedures
7
- * @internal
8
- */ function createReactDecoration(hooks) {
9
- return unstableCoreDoNotImport.createRecursiveProxy(({ path, args })=>{
10
- const pathCopy = [
11
- ...path
12
- ];
13
- // The last arg is for instance `.useMutation` or `.useQuery()`
14
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15
- const lastArg = pathCopy.pop();
16
- if (lastArg === 'useMutation') {
17
- return hooks[lastArg](pathCopy, ...args);
18
- }
19
- if (lastArg === '_def') {
20
- return {
21
- path: pathCopy
22
- };
23
- }
24
- const [input, ...rest] = args;
25
- const opts = rest[0] ?? {};
26
- return hooks[lastArg](pathCopy, input, opts);
27
- });
28
- }
29
-
30
- exports.createReactDecoration = createReactDecoration;
@@ -1,28 +0,0 @@
1
- import { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';
2
-
3
- /**
4
- * Create proxy for decorating procedures
5
- * @internal
6
- */ function createReactDecoration(hooks) {
7
- return createRecursiveProxy(({ path, args })=>{
8
- const pathCopy = [
9
- ...path
10
- ];
11
- // The last arg is for instance `.useMutation` or `.useQuery()`
12
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
13
- const lastArg = pathCopy.pop();
14
- if (lastArg === 'useMutation') {
15
- return hooks[lastArg](pathCopy, ...args);
16
- }
17
- if (lastArg === '_def') {
18
- return {
19
- path: pathCopy
20
- };
21
- }
22
- const [input, ...rest] = args;
23
- const opts = rest[0] ?? {};
24
- return hooks[lastArg](pathCopy, input, opts);
25
- });
26
- }
27
-
28
- export { createReactDecoration };
@@ -1,25 +0,0 @@
1
- import type { TRPCClient } from '@trpc/client';
2
- import { TRPCUntypedClient, type TRPCClientError } from '@trpc/client';
3
- import type { AnyProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, inferProcedureInput, inferTransformedProcedureOutput, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
4
- import type { TrpcQueryOptionsForUseQueries, TrpcQueryOptionsForUseSuspenseQueries } from '../../internals/useQueries';
5
- type GetQueryOptions<TRoot extends AnyRootTypes, TProcedure extends AnyProcedure> = <TData = inferTransformedProcedureOutput<TRoot, TProcedure>>(input: inferProcedureInput<TProcedure>, opts?: TrpcQueryOptionsForUseQueries<inferTransformedProcedureOutput<TRoot, TProcedure>, TData, TRPCClientError<TRoot>>) => TrpcQueryOptionsForUseQueries<inferTransformedProcedureOutput<TRoot, TProcedure>, TData, TRPCClientError<TRoot>>;
6
- /**
7
- * @internal
8
- */
9
- export type UseQueriesProcedureRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = {
10
- [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? GetQueryOptions<TRoot, $Value> : $Value extends RouterRecord ? UseQueriesProcedureRecord<TRoot, $Value> : never : never;
11
- };
12
- type GetSuspenseQueryOptions<TRoot extends AnyRootTypes, TProcedure extends AnyQueryProcedure> = <TData = inferTransformedProcedureOutput<TRoot, TProcedure>>(input: inferProcedureInput<TProcedure>, opts?: TrpcQueryOptionsForUseSuspenseQueries<inferTransformedProcedureOutput<TRoot, TProcedure>, TData, TRPCClientError<TRoot>>) => TrpcQueryOptionsForUseSuspenseQueries<inferTransformedProcedureOutput<TRoot, TProcedure>, TData, TRPCClientError<TRoot>>;
13
- /**
14
- * @internal
15
- */
16
- export type UseSuspenseQueriesProcedureRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = {
17
- [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? GetSuspenseQueryOptions<TRoot, $Value> : $Value extends RouterRecord ? UseSuspenseQueriesProcedureRecord<TRoot, $Value> : never : never;
18
- };
19
- /**
20
- * Create proxy for `useQueries` options
21
- * @internal
22
- */
23
- export declare function createUseQueries<TRouter extends AnyRouter>(client: TRPCUntypedClient<TRouter> | TRPCClient<TRouter>): UseQueriesProcedureRecord<TRouter["_def"]["_config"]["$types"], TRouter["_def"]["record"]>;
24
- export {};
25
- //# sourceMappingURL=useQueriesProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useQueriesProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/useQueriesProxy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAEL,iBAAiB,EACjB,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,+BAA+B,EAC/B,YAAY,EACb,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EACV,6BAA6B,EAC7B,qCAAqC,EACtC,MAAM,4BAA4B,CAAC;AAGpC,KAAK,eAAe,CAClB,KAAK,SAAS,YAAY,EAC1B,UAAU,SAAS,YAAY,IAC7B,CAAC,KAAK,GAAG,+BAA+B,CAAC,KAAK,EAAE,UAAU,CAAC,EAC7D,KA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,GAC9B,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,GACtC,MAAM,SAAS,YAAY,GACzB,iCAAiC,CAAC,KAAK,EAAE,MAAM,CAAC,GAChD,KAAK,GACT,KAAK;CACV,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,SAAS,EACxD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,8FA4BzD"}
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- var client = require('@trpc/client');
4
- var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import');
5
- var getQueryKey = require('../../internals/getQueryKey.js');
6
-
7
- /**
8
- * Create proxy for `useQueries` options
9
- * @internal
10
- */ function createUseQueries(client$1) {
11
- const untypedClient = client$1 instanceof client.TRPCUntypedClient ? client$1 : client.getUntypedClient(client$1);
12
- return unstableCoreDoNotImport.createRecursiveProxy((opts)=>{
13
- const arrayPath = opts.path;
14
- const dotPath = arrayPath.join('.');
15
- const [input, _opts] = opts.args;
16
- const options = {
17
- queryKey: getQueryKey.getQueryKeyInternal(arrayPath, input, 'query'),
18
- queryFn: ()=>{
19
- return untypedClient.query(dotPath, input, _opts?.trpc);
20
- },
21
- ..._opts
22
- };
23
- return options;
24
- });
25
- }
26
-
27
- exports.createUseQueries = createUseQueries;
@@ -1,25 +0,0 @@
1
- import { TRPCUntypedClient, getUntypedClient } from '@trpc/client';
2
- import { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';
3
- import { getQueryKeyInternal } from '../../internals/getQueryKey.mjs';
4
-
5
- /**
6
- * Create proxy for `useQueries` options
7
- * @internal
8
- */ function createUseQueries(client) {
9
- const untypedClient = client instanceof TRPCUntypedClient ? client : getUntypedClient(client);
10
- return createRecursiveProxy((opts)=>{
11
- const arrayPath = opts.path;
12
- const dotPath = arrayPath.join('.');
13
- const [input, _opts] = opts.args;
14
- const options = {
15
- queryKey: getQueryKeyInternal(arrayPath, input, 'query'),
16
- queryFn: ()=>{
17
- return untypedClient.query(dotPath, input, _opts?.trpc);
18
- },
19
- ..._opts
20
- };
21
- return options;
22
- });
23
- }
24
-
25
- export { createUseQueries };
@@ -1,141 +0,0 @@
1
- import type { CancelOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, Query, QueryFilters, QueryKey, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, SkipToken, Updater } from '@tanstack/react-query';
2
- import type { TRPCClientError } from '@trpc/client';
3
- import type { AnyMutationProcedure, AnyQueryProcedure, AnyRootTypes, AnyRouter, DeepPartial, inferProcedureInput, inferProcedureOutput, inferTransformedProcedureOutput, ProtectedIntersection, RouterRecord } from '@trpc/server/unstable-core-do-not-import';
4
- import type { DecoratedTRPCContextProps, TRPCContextState, TRPCFetchInfiniteQueryOptions, TRPCFetchQueryOptions, TRPCQueryUtils } from '../../internals/context';
5
- import type { QueryKeyKnown, QueryType } from '../../internals/getQueryKey';
6
- import type { InferMutationOptions } from '../../utils/inferReactQueryProcedure';
7
- import type { ExtractCursorType } from '../hooks/types';
8
- import type { DefinedTRPCInfiniteQueryOptionsIn, DefinedTRPCInfiniteQueryOptionsOut, DefinedTRPCQueryOptionsIn, DefinedTRPCQueryOptionsOut, UndefinedTRPCInfiniteQueryOptionsIn, UndefinedTRPCInfiniteQueryOptionsOut, UndefinedTRPCQueryOptionsIn, UndefinedTRPCQueryOptionsOut, UnusedSkipTokenTRPCInfiniteQueryOptionsIn, UnusedSkipTokenTRPCInfiniteQueryOptionsOut, UnusedSkipTokenTRPCQueryOptionsIn, UnusedSkipTokenTRPCQueryOptionsOut } from '../types';
9
- export type DecorateQueryProcedure<TRoot extends AnyRootTypes, TProcedure extends AnyQueryProcedure> = {
10
- /**
11
- * @see https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions
12
- */
13
- queryOptions<TQueryFnData extends inferTransformedProcedureOutput<TRoot, TProcedure>, TData = TQueryFnData>(input: inferProcedureInput<TProcedure> | SkipToken, opts: DefinedTRPCQueryOptionsIn<TQueryFnData, TData, TRPCClientError<TRoot>>): DefinedTRPCQueryOptionsOut<TQueryFnData, TData, TRPCClientError<TRoot>>;
14
- /**
15
- * @see https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions
16
- */
17
- queryOptions<TQueryFnData extends inferTransformedProcedureOutput<TRoot, TProcedure>, TData = TQueryFnData>(input: inferProcedureInput<TProcedure> | SkipToken, opts?: UnusedSkipTokenTRPCQueryOptionsIn<TQueryFnData, TData, TRPCClientError<TRoot>>): UnusedSkipTokenTRPCQueryOptionsOut<TQueryFnData, TData, TRPCClientError<TRoot>>;
18
- /**
19
- * @see https://tanstack.com/query/latest/docs/framework/react/reference/queryOptions#queryoptions
20
- */
21
- queryOptions<TQueryFnData extends inferTransformedProcedureOutput<TRoot, TProcedure>, TData = TQueryFnData>(input: inferProcedureInput<TProcedure> | SkipToken, opts?: UndefinedTRPCQueryOptionsIn<TQueryFnData, TData, TRPCClientError<TRoot>>): UndefinedTRPCQueryOptionsOut<TQueryFnData, TData, TRPCClientError<TRoot>>;
22
- /**
23
- * @see https://tanstack.com/query/latest/docs/framework/react/reference/infiniteQueryOptions#infinitequeryoptions
24
- */
25
- infiniteQueryOptions<TQueryFnData extends inferTransformedProcedureOutput<TRoot, TProcedure>, TData = TQueryFnData>(input: inferProcedureInput<TProcedure> | SkipToken, opts: DefinedTRPCInfiniteQueryOptionsIn<inferProcedureInput<TProcedure>, TQueryFnData, TData, TRPCClientError<TRoot>>): DefinedTRPCInfiniteQueryOptionsOut<inferProcedureInput<TProcedure>, TQueryFnData, TData, TRPCClientError<TRoot>>;
26
- /**
27
- * @see https://tanstack.com/query/latest/docs/framework/react/reference/infiniteQueryOptions#infinitequeryoptions
28
- */
29
- infiniteQueryOptions<TQueryFnData extends inferTransformedProcedureOutput<TRoot, TProcedure>, TData = TQueryFnData>(input: inferProcedureInput<TProcedure>, opts: UnusedSkipTokenTRPCInfiniteQueryOptionsIn<inferProcedureInput<TProcedure>, TQueryFnData, TData, TRPCClientError<TRoot>>): UnusedSkipTokenTRPCInfiniteQueryOptionsOut<inferProcedureInput<TProcedure>, TQueryFnData, TData, TRPCClientError<TRoot>>;
30
- /**
31
- * @see https://tanstack.com/query/latest/docs/framework/react/reference/infiniteQueryOptions#infinitequeryoptions
32
- */
33
- infiniteQueryOptions<TQueryFnData extends inferTransformedProcedureOutput<TRoot, TProcedure>, TData = TQueryFnData>(input: inferProcedureInput<TProcedure> | SkipToken, opts?: UndefinedTRPCInfiniteQueryOptionsIn<inferProcedureInput<TProcedure>, TQueryFnData, TData, TRPCClientError<TRoot>>): UndefinedTRPCInfiniteQueryOptionsOut<inferProcedureInput<TProcedure>, TQueryFnData, TData, TRPCClientError<TRoot>>;
34
- /**
35
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchquery
36
- */
37
- fetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientError<TRoot>>): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
38
- /**
39
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientfetchinfinitequery
40
- */
41
- fetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientError<TRoot>>): Promise<InfiniteData<inferTransformedProcedureOutput<TRoot, TProcedure>, NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null>>;
42
- /**
43
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchquery
44
- */
45
- prefetch(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientError<TRoot>>): Promise<void>;
46
- /**
47
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientprefetchinfinitequery
48
- */
49
- prefetchInfinite(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchInfiniteQueryOptions<inferProcedureInput<TProcedure>, inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientError<TRoot>>): Promise<void>;
50
- /**
51
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientensurequerydata
52
- */
53
- ensureData(input: inferProcedureInput<TProcedure>, opts?: TRPCFetchQueryOptions<inferTransformedProcedureOutput<TRoot, TProcedure>, TRPCClientError<TRoot>>): Promise<inferTransformedProcedureOutput<TRoot, TProcedure>>;
54
- /**
55
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientinvalidatequeries
56
- */
57
- invalidate(input?: DeepPartial<inferProcedureInput<TProcedure>>, filters?: Omit<InvalidateQueryFilters, 'predicate'> & {
58
- predicate?: (query: Query<inferProcedureOutput<TProcedure>, TRPCClientError<TRoot>, inferTransformedProcedureOutput<TRoot, TProcedure>, QueryKeyKnown<inferProcedureInput<TProcedure>, inferProcedureInput<TProcedure> extends {
59
- cursor?: any;
60
- } | void ? 'infinite' : 'query'>>) => boolean;
61
- }, options?: InvalidateOptions): Promise<void>;
62
- /**
63
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientrefetchqueries
64
- */
65
- refetch(input?: inferProcedureInput<TProcedure>, filters?: RefetchQueryFilters, options?: RefetchOptions): Promise<void>;
66
- /**
67
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientcancelqueries
68
- */
69
- cancel(input?: inferProcedureInput<TProcedure>, options?: CancelOptions): Promise<void>;
70
- /**
71
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientresetqueries
72
- */
73
- reset(input?: inferProcedureInput<TProcedure>, options?: ResetOptions): Promise<void>;
74
- /**
75
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata
76
- */
77
- setData(
78
- /**
79
- * The input of the procedure
80
- */
81
- input: inferProcedureInput<TProcedure>, updater: Updater<inferTransformedProcedureOutput<TRoot, TProcedure> | undefined, inferTransformedProcedureOutput<TRoot, TProcedure> | undefined>, options?: SetDataOptions): void;
82
- /**
83
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata
84
- */
85
- setQueriesData(
86
- /**
87
- * The input of the procedure
88
- */
89
- input: inferProcedureInput<TProcedure>, filters: QueryFilters, updater: Updater<inferTransformedProcedureOutput<TRoot, TProcedure> | undefined, inferTransformedProcedureOutput<TRoot, TProcedure> | undefined>, options?: SetDataOptions): [QueryKey, inferTransformedProcedureOutput<TRoot, TProcedure>];
90
- /**
91
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientsetquerydata
92
- */
93
- setInfiniteData(input: inferProcedureInput<TProcedure>, updater: Updater<InfiniteData<inferTransformedProcedureOutput<TRoot, TProcedure>, NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null> | undefined, InfiniteData<inferTransformedProcedureOutput<TRoot, TProcedure>, NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null> | undefined>, options?: SetDataOptions): void;
94
- /**
95
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata
96
- */
97
- getData(input?: inferProcedureInput<TProcedure>): inferTransformedProcedureOutput<TRoot, TProcedure> | undefined;
98
- /**
99
- * @see https://tanstack.com/query/v5/docs/reference/QueryClient#queryclientgetquerydata
100
- */
101
- getInfiniteData(input?: inferProcedureInput<TProcedure>): InfiniteData<inferTransformedProcedureOutput<TRoot, TProcedure>, NonNullable<ExtractCursorType<inferProcedureInput<TProcedure>>> | null> | undefined;
102
- };
103
- type DecorateMutationProcedure<TRoot extends AnyRootTypes, TProcedure extends AnyMutationProcedure> = {
104
- setMutationDefaults<TMeta = unknown>(options: InferMutationOptions<TRoot, TProcedure, TMeta> | ((args: {
105
- canonicalMutationFn: NonNullable<InferMutationOptions<TRoot, TProcedure>['mutationFn']>;
106
- }) => InferMutationOptions<TRoot, TProcedure, TMeta>)): void;
107
- getMutationDefaults(): InferMutationOptions<TRoot, TProcedure> | undefined;
108
- isMutating(): number;
109
- };
110
- /**
111
- * this is the type that is used to add in procedures that can be used on
112
- * an entire router
113
- */
114
- type DecorateRouter = {
115
- /**
116
- * Invalidate the full router
117
- * @see https://trpc.io/docs/v10/useContext#query-invalidation
118
- * @see https://tanstack.com/query/v5/docs/framework/react/guides/query-invalidation
119
- */
120
- invalidate(input?: undefined, filters?: InvalidateQueryFilters, options?: InvalidateOptions): Promise<void>;
121
- };
122
- /**
123
- * @internal
124
- */
125
- export type DecoratedProcedureUtilsRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = DecorateRouter & {
126
- [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value ? $Value extends AnyQueryProcedure ? DecorateQueryProcedure<TRoot, $Value> : $Value extends AnyMutationProcedure ? DecorateMutationProcedure<TRoot, $Value> : $Value extends RouterRecord ? DecoratedProcedureUtilsRecord<TRoot, $Value> & DecorateRouter : never : never;
127
- };
128
- type AnyDecoratedProcedure = DecorateQueryProcedure<any, any> & DecorateMutationProcedure<any, any>;
129
- export type CreateReactUtils<TRouter extends AnyRouter, TSSRContext> = ProtectedIntersection<DecoratedTRPCContextProps<TRouter, TSSRContext>, DecoratedProcedureUtilsRecord<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>>;
130
- export type CreateQueryUtils<TRouter extends AnyRouter> = DecoratedProcedureUtilsRecord<TRouter['_def']['_config']['$types'], TRouter['_def']['record']>;
131
- export declare const getQueryType: (utilName: keyof AnyDecoratedProcedure) => QueryType;
132
- /**
133
- * @internal
134
- */
135
- export declare function createReactQueryUtils<TRouter extends AnyRouter, TSSRContext>(context: TRPCContextState<AnyRouter, TSSRContext>): ProtectedIntersection<DecoratedTRPCContextProps<TRouter, TSSRContext>, DecoratedProcedureUtilsRecord<TRouter["_def"]["_config"]["$types"], TRouter["_def"]["record"]>>;
136
- /**
137
- * @internal
138
- */
139
- export declare function createQueryUtilsProxy<TRouter extends AnyRouter>(context: TRPCQueryUtils<TRouter>): CreateQueryUtils<TRouter>;
140
- export {};
141
- //# sourceMappingURL=utilsProxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utilsProxy.d.ts","sourceRoot":"","sources":["../../../src/shared/proxy/utilsProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,OAAO,EACR,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,+BAA+B,EAC/B,qBAAqB,EACrB,YAAY,EACb,MAAM,0CAA0C,CAAC;AAKlD,OAAO,KAAK,EACV,yBAAyB,EACzB,gBAAgB,EAChB,6BAA6B,EAC7B,qBAAqB,EACrB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAK5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EACV,iCAAiC,EACjC,kCAAkC,EAClC,yBAAyB,EACzB,0BAA0B,EAC1B,mCAAmC,EACnC,oCAAoC,EACpC,2BAA2B,EAC3B,4BAA4B,EAC5B,yCAAyC,EACzC,0CAA0C,EAC1C,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,sBAAsB,CAChC,KAAK,SAAS,YAAY,EAC1B,UAAU,SAAS,iBAAiB,IAClC;IACF;;OAEG;IACH,YAAY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AAW,CAAC,EAC/C,6BAA6B,CAC3B,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CACF,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,OAAO,SAAS,SAAS,IACpD,6BAA6B,CAC3B,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EACpC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAC1B,CAAC;AAEJ,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,qBAAqB,KACpC,SA2BF,CAAC;AA2DF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,SAAS,EAAE,WAAW,EAC1E,OAAO,EAAE,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,0KAqBlD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,SAAS,EAC7D,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAC/B,gBAAgB,CAAC,OAAO,CAAC,CAE3B"}
@@ -1,106 +0,0 @@
1
- 'use strict';
2
-
3
- var client = require('@trpc/client');
4
- var unstableCoreDoNotImport = require('@trpc/server/unstable-core-do-not-import');
5
- var context = require('../../internals/context.js');
6
- var getQueryKey = require('../../internals/getQueryKey.js');
7
-
8
- const getQueryType = (utilName)=>{
9
- switch(utilName){
10
- case 'queryOptions':
11
- case 'fetch':
12
- case 'ensureData':
13
- case 'prefetch':
14
- case 'getData':
15
- case 'setData':
16
- case 'setQueriesData':
17
- return 'query';
18
- case 'infiniteQueryOptions':
19
- case 'fetchInfinite':
20
- case 'prefetchInfinite':
21
- case 'getInfiniteData':
22
- case 'setInfiniteData':
23
- return 'infinite';
24
- case 'setMutationDefaults':
25
- case 'getMutationDefaults':
26
- case 'isMutating':
27
- case 'cancel':
28
- case 'invalidate':
29
- case 'refetch':
30
- case 'reset':
31
- return 'any';
32
- }
33
- };
34
- /**
35
- * @internal
36
- */ function createRecursiveUtilsProxy(context) {
37
- return unstableCoreDoNotImport.createRecursiveProxy((opts)=>{
38
- const path = [
39
- ...opts.path
40
- ];
41
- const utilName = path.pop();
42
- const args = [
43
- ...opts.args
44
- ];
45
- const input = args.shift(); // args can now be spread when input removed
46
- const queryType = getQueryType(utilName);
47
- const queryKey = getQueryKey.getQueryKeyInternal(path, input, queryType);
48
- const contextMap = {
49
- infiniteQueryOptions: ()=>context.infiniteQueryOptions(path, queryKey, args[0]),
50
- queryOptions: ()=>context.queryOptions(path, queryKey, ...args),
51
- /**
52
- * DecorateQueryProcedure
53
- */ fetch: ()=>context.fetchQuery(queryKey, ...args),
54
- fetchInfinite: ()=>context.fetchInfiniteQuery(queryKey, args[0]),
55
- prefetch: ()=>context.prefetchQuery(queryKey, ...args),
56
- prefetchInfinite: ()=>context.prefetchInfiniteQuery(queryKey, args[0]),
57
- ensureData: ()=>context.ensureQueryData(queryKey, ...args),
58
- invalidate: ()=>context.invalidateQueries(queryKey, ...args),
59
- reset: ()=>context.resetQueries(queryKey, ...args),
60
- refetch: ()=>context.refetchQueries(queryKey, ...args),
61
- cancel: ()=>context.cancelQuery(queryKey, ...args),
62
- setData: ()=>{
63
- context.setQueryData(queryKey, args[0], args[1]);
64
- },
65
- setQueriesData: ()=>context.setQueriesData(queryKey, args[0], args[1], args[2]),
66
- setInfiniteData: ()=>{
67
- context.setInfiniteQueryData(queryKey, args[0], args[1]);
68
- },
69
- getData: ()=>context.getQueryData(queryKey),
70
- getInfiniteData: ()=>context.getInfiniteQueryData(queryKey),
71
- /**
72
- * DecorateMutationProcedure
73
- */ setMutationDefaults: ()=>context.setMutationDefaults(getQueryKey.getMutationKeyInternal(path), input),
74
- getMutationDefaults: ()=>context.getMutationDefaults(getQueryKey.getMutationKeyInternal(path)),
75
- isMutating: ()=>context.isMutating({
76
- mutationKey: getQueryKey.getMutationKeyInternal(path)
77
- })
78
- };
79
- return contextMap[utilName]();
80
- });
81
- }
82
- /**
83
- * @internal
84
- */ function createReactQueryUtils(context$1) {
85
- const clientProxy = client.createTRPCClientProxy(context$1.client);
86
- const proxy = createRecursiveUtilsProxy(context$1);
87
- return unstableCoreDoNotImport.createFlatProxy((key)=>{
88
- const contextName = key;
89
- if (contextName === 'client') {
90
- return clientProxy;
91
- }
92
- if (context.contextProps.includes(contextName)) {
93
- return context$1[contextName];
94
- }
95
- return proxy[key];
96
- });
97
- }
98
- /**
99
- * @internal
100
- */ function createQueryUtilsProxy(context) {
101
- return createRecursiveUtilsProxy(context);
102
- }
103
-
104
- exports.createQueryUtilsProxy = createQueryUtilsProxy;
105
- exports.createReactQueryUtils = createReactQueryUtils;
106
- exports.getQueryType = getQueryType;