@trpc/next 11.19.0 → 11.21.1-canary.20.10e2ef98f

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.
@@ -0,0 +1 @@
1
+ export * from '../../dist/app-dir/client';
@@ -0,0 +1 @@
1
+ module.exports = require('../../dist/app-dir/client');
@@ -0,0 +1 @@
1
+ export * from '../../../dist/app-dir/links/nextCache';
@@ -0,0 +1 @@
1
+ module.exports = require('../../../dist/app-dir/links/nextCache');
@@ -0,0 +1 @@
1
+ export * from '../../../dist/app-dir/links/nextHttp';
@@ -0,0 +1 @@
1
+ module.exports = require('../../../dist/app-dir/links/nextHttp');
@@ -0,0 +1 @@
1
+ export * from '../../dist/app-dir/server';
@@ -0,0 +1 @@
1
+ module.exports = require('../../dist/app-dir/server');
@@ -1,9 +1,13 @@
1
- import { a as ActionHandlerDef, o as CreateTRPCNextAppRouterOptions, t as TRPCActionHandler } from "../server-BSCiwefJ.cjs";
1
+ import { a as ActionHandlerDef, o as CreateTRPCNextAppRouterOptions, t as TRPCActionHandler } from "../server-C9BehF33.cjs";
2
2
  import { CreateTRPCClientOptions, TRPCClient, TRPCClientError, TRPCLink, TRPCProcedureOptions } from "@trpc/client";
3
3
  import { AnyRouter, InferrableClientTypes, MaybePromise, Simplify, TypeError, inferClientTypes } from "@trpc/server/unstable-core-do-not-import";
4
4
  import { TransformerOptions } from "@trpc/client/unstable-internals";
5
5
  //#region src/app-dir/create-action-hook.d.ts
6
6
  type MutationArgs<TDef extends ActionHandlerDef> = TDef['input'] extends void ? [input?: undefined | void, opts?: TRPCProcedureOptions] : [input: FormData | TDef['input'], opts?: TRPCProcedureOptions];
7
+ type ActionError<TDef extends ActionHandlerDef> = TRPCClientError<{
8
+ errorShape: TDef['errorShape'];
9
+ transformer: boolean;
10
+ }>;
7
11
  interface UseTRPCActionBaseResult<TDef extends ActionHandlerDef> {
8
12
  mutate: (...args: MutationArgs<TDef>) => void;
9
13
  mutateAsync: (...args: MutationArgs<TDef>) => Promise<TDef['output']>;
@@ -15,7 +19,7 @@ interface UseTRPCActionSuccessResult<TDef extends ActionHandlerDef> extends UseT
15
19
  }
16
20
  interface UseTRPCActionErrorResult<TDef extends ActionHandlerDef> extends UseTRPCActionBaseResult<TDef> {
17
21
  data?: never;
18
- error: TRPCClientError<TDef['errorShape']>;
22
+ error: ActionError<TDef>;
19
23
  status: 'error';
20
24
  }
21
25
  interface UseTRPCActionIdleResult<TDef extends ActionHandlerDef> extends UseTRPCActionBaseResult<TDef> {
@@ -36,7 +40,7 @@ export declare function experimental_serverActionLink<TInferrable extends Inferr
36
40
  }>]): TRPCLink<TInferrable>;
37
41
  interface UseTRPCActionOptions<TDef extends ActionHandlerDef> {
38
42
  onSuccess?: (result: TDef['output']) => MaybePromise<void> | void;
39
- onError?: (result: TRPCClientError<TDef['errorShape']>) => MaybePromise<void>;
43
+ onError?: (result: ActionError<TDef>) => MaybePromise<void>;
40
44
  }
41
45
  export declare function experimental_createActionHook<TInferrable extends InferrableClientTypes>(opts: InferrableClientTypes extends TInferrable ? TypeError<'Generic parameter missing in `experimental_createActionHook<HERE>()`'> : CreateTRPCClientOptions<TInferrable>): <TDef extends ActionHandlerDef>(handler: TRPCActionHandler<TDef>, useActionOpts?: UseTRPCActionOptions<Simplify<TDef>>) => UseTRPCActionResult<TDef>;
42
46
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.cts","names":[],"sources":["../../src/app-dir/create-action-hook.tsx","../../src/app-dir/client.ts"],"mappings":";;;;;KA0BK,aAAa,aAAa,oBAAoB,8BAC9C,0BAA0B,OAAO,yBACjC,OAAO,WAAW,eAAe,OAAO;UAEnC,wBAAwB,aAAa;EAC7C,YAAY,MAAM,aAAa;EAC/B,iBAAiB,MAAM,aAAa,UAAU,QAAQ;;UAG9C,2BACR,aAAa,0BACL,wBAAwB;EAChC,MAAM;EACN;EACA;;UAGQ,yBACR,aAAa,0BACL,wBAAwB;EAChC;EACA,OAAO,gBAAgB;EACvB;;UAGQ,wBACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;UAGQ,2BACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;KAIU,oBAAoB,aAAa,oBACzC,yBAAyB,QACzB,wBAAwB,QACxB,2BAA2B,QAC3B,2BAA2B;wBAOf,8BACd,oBAAoB,0BAEjB,MAAM,8BAA8B,eAEjC,8HAEF,iBAAiB,4CAEb,MAAM;EACJ;OAIF,OAAO;EACL;MAGT,SAAS;UAiCF,qBAAqB,aAAa;EAC1C,aAAa,QAAQ,mBAAmB;EACxC,WAAW,QAAQ,gBAAgB,wBAAwB;;wBAG7C,8BACd,oBAAoB,uBAEpB,MAAM,8BAA8B,cAChC,oFACA,wBAAwB,gBAQF,aAAa,kBAAgB,SAC5C,kBAAkB,OAAK,gBAChB,qBAAqB,SAAS,WAAM,oBAAA;;;wBC7HxC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,WAAA"}
1
+ {"version":3,"file":"client.d.cts","names":[],"sources":["../../src/app-dir/create-action-hook.tsx","../../src/app-dir/client.ts"],"mappings":";;;;;KA0BK,aAAa,aAAa,oBAAoB,8BAC9C,0BAA0B,OAAO,yBACjC,OAAO,WAAW,eAAe,OAAO;KAExC,YAAY,aAAa,oBAAoB;EAChD,YAAY;EACZ;;UAGQ,wBAAwB,aAAa;EAC7C,YAAY,MAAM,aAAa;EAC/B,iBAAiB,MAAM,aAAa,UAAU,QAAQ;;UAG9C,2BACR,aAAa,0BACL,wBAAwB;EAChC,MAAM;EACN;EACA;;UAGQ,yBACR,aAAa,0BACL,wBAAwB;EAChC;EACA,OAAO,YAAY;EACnB;;UAGQ,wBACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;UAGQ,2BACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;KAIU,oBAAoB,aAAa,oBACzC,yBAAyB,QACzB,wBAAwB,QACxB,2BAA2B,QAC3B,2BAA2B;wBAOf,8BACd,oBAAoB,0BAEjB,MAAM,8BAA8B,eAEjC,8HAEF,iBAAiB,4CAEb,MAAM;EACJ;OAIF,OAAO;EACL;MAGT,SAAS;UAiCF,qBAAqB,aAAa;EAC1C,aAAa,QAAQ,mBAAmB;EACxC,WAAW,QAAQ,YAAY,UAAU;;wBAG3B,8BACd,oBAAoB,uBAEpB,MAAM,8BAA8B,cAChC,oFACA,wBAAwB,gBAQF,aAAa,kBAAgB,SAC5C,kBAAkB,OAAK,gBAChB,qBAAqB,SAAS,WAAM,oBAAA;;;wBClIxC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,WAAA"}
@@ -1,9 +1,13 @@
1
- import { a as ActionHandlerDef, o as CreateTRPCNextAppRouterOptions, t as TRPCActionHandler } from "../server-DQOX6CNV.mjs";
1
+ import { a as ActionHandlerDef, o as CreateTRPCNextAppRouterOptions, t as TRPCActionHandler } from "../server-iViolfKj.mjs";
2
2
  import { TransformerOptions } from "@trpc/client/unstable-internals";
3
3
  import { AnyRouter, InferrableClientTypes, MaybePromise, Simplify, TypeError, inferClientTypes } from "@trpc/server/unstable-core-do-not-import";
4
4
  import { CreateTRPCClientOptions, TRPCClient, TRPCClientError, TRPCLink, TRPCProcedureOptions } from "@trpc/client";
5
5
  //#region src/app-dir/create-action-hook.d.ts
6
6
  type MutationArgs<TDef extends ActionHandlerDef> = TDef['input'] extends void ? [input?: undefined | void, opts?: TRPCProcedureOptions] : [input: FormData | TDef['input'], opts?: TRPCProcedureOptions];
7
+ type ActionError<TDef extends ActionHandlerDef> = TRPCClientError<{
8
+ errorShape: TDef['errorShape'];
9
+ transformer: boolean;
10
+ }>;
7
11
  interface UseTRPCActionBaseResult<TDef extends ActionHandlerDef> {
8
12
  mutate: (...args: MutationArgs<TDef>) => void;
9
13
  mutateAsync: (...args: MutationArgs<TDef>) => Promise<TDef['output']>;
@@ -15,7 +19,7 @@ interface UseTRPCActionSuccessResult<TDef extends ActionHandlerDef> extends UseT
15
19
  }
16
20
  interface UseTRPCActionErrorResult<TDef extends ActionHandlerDef> extends UseTRPCActionBaseResult<TDef> {
17
21
  data?: never;
18
- error: TRPCClientError<TDef['errorShape']>;
22
+ error: ActionError<TDef>;
19
23
  status: 'error';
20
24
  }
21
25
  interface UseTRPCActionIdleResult<TDef extends ActionHandlerDef> extends UseTRPCActionBaseResult<TDef> {
@@ -36,7 +40,7 @@ export declare function experimental_serverActionLink<TInferrable extends Inferr
36
40
  }>]): TRPCLink<TInferrable>;
37
41
  interface UseTRPCActionOptions<TDef extends ActionHandlerDef> {
38
42
  onSuccess?: (result: TDef['output']) => MaybePromise<void> | void;
39
- onError?: (result: TRPCClientError<TDef['errorShape']>) => MaybePromise<void>;
43
+ onError?: (result: ActionError<TDef>) => MaybePromise<void>;
40
44
  }
41
45
  export declare function experimental_createActionHook<TInferrable extends InferrableClientTypes>(opts: InferrableClientTypes extends TInferrable ? TypeError<'Generic parameter missing in `experimental_createActionHook<HERE>()`'> : CreateTRPCClientOptions<TInferrable>): <TDef extends ActionHandlerDef>(handler: TRPCActionHandler<TDef>, useActionOpts?: UseTRPCActionOptions<Simplify<TDef>>) => UseTRPCActionResult<TDef>;
42
46
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.mts","names":[],"sources":["../../src/app-dir/create-action-hook.tsx","../../src/app-dir/client.ts"],"mappings":";;;;;KA0BK,aAAa,aAAa,oBAAoB,8BAC9C,0BAA0B,OAAO,yBACjC,OAAO,WAAW,eAAe,OAAO;UAEnC,wBAAwB,aAAa;EAC7C,YAAY,MAAM,aAAa;EAC/B,iBAAiB,MAAM,aAAa,UAAU,QAAQ;;UAG9C,2BACR,aAAa,0BACL,wBAAwB;EAChC,MAAM;EACN;EACA;;UAGQ,yBACR,aAAa,0BACL,wBAAwB;EAChC;EACA,OAAO,gBAAgB;EACvB;;UAGQ,wBACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;UAGQ,2BACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;KAIU,oBAAoB,aAAa,oBACzC,yBAAyB,QACzB,wBAAwB,QACxB,2BAA2B,QAC3B,2BAA2B;wBAOf,8BACd,oBAAoB,0BAEjB,MAAM,8BAA8B,eAEjC,8HAEF,iBAAiB,4CAEb,MAAM;EACJ;OAIF,OAAO;EACL;MAGT,SAAS;UAiCF,qBAAqB,aAAa;EAC1C,aAAa,QAAQ,mBAAmB;EACxC,WAAW,QAAQ,gBAAgB,wBAAwB;;wBAG7C,8BACd,oBAAoB,uBAEpB,MAAM,8BAA8B,cAChC,oFACA,wBAAwB,gBAQF,aAAa,kBAAgB,SAC5C,kBAAkB,OAAK,gBAChB,qBAAqB,SAAS,WAAM,oBAAA;;;wBC7HxC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,WAAA"}
1
+ {"version":3,"file":"client.d.mts","names":[],"sources":["../../src/app-dir/create-action-hook.tsx","../../src/app-dir/client.ts"],"mappings":";;;;;KA0BK,aAAa,aAAa,oBAAoB,8BAC9C,0BAA0B,OAAO,yBACjC,OAAO,WAAW,eAAe,OAAO;KAExC,YAAY,aAAa,oBAAoB;EAChD,YAAY;EACZ;;UAGQ,wBAAwB,aAAa;EAC7C,YAAY,MAAM,aAAa;EAC/B,iBAAiB,MAAM,aAAa,UAAU,QAAQ;;UAG9C,2BACR,aAAa,0BACL,wBAAwB;EAChC,MAAM;EACN;EACA;;UAGQ,yBACR,aAAa,0BACL,wBAAwB;EAChC;EACA,OAAO,YAAY;EACnB;;UAGQ,wBACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;UAGQ,2BACR,aAAa,0BACL,wBAAwB;EAChC;EACA;EACA;;KAIU,oBAAoB,aAAa,oBACzC,yBAAyB,QACzB,wBAAwB,QACxB,2BAA2B,QAC3B,2BAA2B;wBAOf,8BACd,oBAAoB,0BAEjB,MAAM,8BAA8B,eAEjC,8HAEF,iBAAiB,4CAEb,MAAM;EACJ;OAIF,OAAO;EACL;MAGT,SAAS;UAiCF,qBAAqB,aAAa;EAC1C,aAAa,QAAQ,mBAAmB;EACxC,WAAW,QAAQ,YAAY,UAAU;;wBAG3B,8BACd,oBAAoB,uBAEpB,MAAM,8BAA8B,cAChC,oFACA,wBAAwB,gBAQF,aAAa,kBAAgB,SAC5C,kBAAkB,OAAK,gBAChB,qBAAqB,SAAS,WAAM,oBAAA;;;wBClIxC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,WAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"client.mjs","names":[],"sources":["../../src/app-dir/create-action-hook.tsx","../../src/app-dir/client.ts"],"sourcesContent":["import type {\n CreateTRPCClientOptions,\n TRPCLink,\n TRPCProcedureOptions,\n TRPCRequestOptions,\n} from '@trpc/client';\nimport { createTRPCUntypedClient, TRPCClientError } from '@trpc/client';\nimport type {\n CoercedTransformerParameters,\n TransformerOptions,\n} from '@trpc/client/unstable-internals';\nimport { getTransformer } from '@trpc/client/unstable-internals';\nimport { observable } from '@trpc/server/observable';\nimport type {\n inferClientTypes,\n InferrableClientTypes,\n MaybePromise,\n Simplify,\n TypeError,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { transformResult } from '@trpc/server/unstable-core-do-not-import';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { TRPCActionHandler } from './server';\nimport type { ActionHandlerDef } from './shared';\nimport { isFormData } from './shared';\n\ntype MutationArgs<TDef extends ActionHandlerDef> = TDef['input'] extends void\n ? [input?: undefined | void, opts?: TRPCProcedureOptions]\n : [input: FormData | TDef['input'], opts?: TRPCProcedureOptions];\n\ninterface UseTRPCActionBaseResult<TDef extends ActionHandlerDef> {\n mutate: (...args: MutationArgs<TDef>) => void;\n mutateAsync: (...args: MutationArgs<TDef>) => Promise<TDef['output']>;\n}\n\ninterface UseTRPCActionSuccessResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data: TDef['output'];\n error?: never;\n status: 'success';\n}\n\ninterface UseTRPCActionErrorResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data?: never;\n error: TRPCClientError<TDef['errorShape']>;\n status: 'error';\n}\n\ninterface UseTRPCActionIdleResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data?: never;\n error?: never;\n status: 'idle';\n}\n\ninterface UseTRPCActionLoadingResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data?: never;\n error?: never;\n status: 'loading';\n}\n\n// ts-prune-ignore-next\nexport type UseTRPCActionResult<TDef extends ActionHandlerDef> =\n | UseTRPCActionErrorResult<TDef>\n | UseTRPCActionIdleResult<TDef>\n | UseTRPCActionLoadingResult<TDef>\n | UseTRPCActionSuccessResult<TDef>;\n\ntype ActionContext = {\n _action: (...args: any[]) => Promise<any>;\n};\n\n// ts-prune-ignore-next\nexport function experimental_serverActionLink<\n TInferrable extends InferrableClientTypes,\n>(\n ...args: InferrableClientTypes extends TInferrable\n ? [\n TypeError<'Generic parameter missing in `experimental_createActionHook<HERE>()` or experimental_serverActionLink<HERE>()'>,\n ]\n : inferClientTypes<TInferrable>['transformer'] extends true\n ? [\n opts: TransformerOptions<{\n transformer: true;\n }>,\n ]\n : [\n opts?: TransformerOptions<{\n transformer: false;\n }>,\n ]\n): TRPCLink<TInferrable> {\n const [opts] = args as [CoercedTransformerParameters];\n const transformer = getTransformer(opts?.transformer);\n return () =>\n ({ op }) =>\n observable((observer) => {\n const context = op.context as ActionContext;\n\n context\n ._action(\n isFormData(op.input)\n ? op.input\n : transformer.input.serialize(op.input),\n )\n .then((data) => {\n const transformed = transformResult(data, transformer.output);\n\n if (!transformed.ok) {\n observer.error(TRPCClientError.from(transformed.error, {}));\n return;\n }\n observer.next({\n context: op.context,\n result: transformed.result,\n });\n observer.complete();\n })\n .catch((cause) => {\n observer.error(TRPCClientError.from(cause));\n });\n });\n}\n\ninterface UseTRPCActionOptions<TDef extends ActionHandlerDef> {\n onSuccess?: (result: TDef['output']) => MaybePromise<void> | void;\n onError?: (result: TRPCClientError<TDef['errorShape']>) => MaybePromise<void>;\n}\n// ts-prune-ignore-next\nexport function experimental_createActionHook<\n TInferrable extends InferrableClientTypes,\n>(\n opts: InferrableClientTypes extends TInferrable\n ? TypeError<'Generic parameter missing in `experimental_createActionHook<HERE>()`'>\n : CreateTRPCClientOptions<TInferrable>,\n) {\n type ActionContext = {\n _action: (...args: any[]) => Promise<any>;\n };\n const client = createTRPCUntypedClient(\n opts as Exclude<typeof opts, TypeError<any>>,\n );\n return function useAction<TDef extends ActionHandlerDef>(\n handler: TRPCActionHandler<TDef>,\n useActionOpts?: UseTRPCActionOptions<Simplify<TDef>>,\n ) {\n const count = useRef(0);\n\n type Result = UseTRPCActionResult<TDef>;\n type State = Omit<Result, 'mutate' | 'mutateAsync'>;\n const [state, setState] = useState<State>({\n status: 'idle',\n });\n\n const actionOptsRef = useRef(useActionOpts);\n actionOptsRef.current = useActionOpts;\n\n useEffect(() => {\n return () => {\n // cleanup after unmount to prevent calling hook opts after unmount\n count.current = -1;\n actionOptsRef.current = undefined;\n };\n }, []);\n\n const mutateAsync = useCallback(\n (input: any, requestOptions?: TRPCRequestOptions) => {\n const idx = ++count.current;\n const context: ActionContext = {\n ...requestOptions?.context,\n _action(innerInput) {\n return handler(innerInput);\n },\n };\n\n setState({\n status: 'loading',\n });\n return client\n .mutation('serverAction', input, {\n ...requestOptions,\n context,\n })\n .then(async (data) => {\n await actionOptsRef.current?.onSuccess?.(data);\n if (idx !== count.current) {\n return;\n }\n setState({\n status: 'success',\n data,\n });\n })\n .catch(async (error) => {\n await actionOptsRef.current?.onError?.(error);\n throw error;\n })\n .catch((error) => {\n if (idx !== count.current) {\n return;\n }\n setState({\n status: 'error',\n error: TRPCClientError.from(error, {}),\n });\n throw error;\n });\n },\n [handler],\n ) as Result['mutateAsync'];\n\n const mutate: Result['mutate'] = useCallback(\n (...args: any[]) => {\n void (mutateAsync as any)(...args).catch(() => {\n // ignored\n });\n },\n [mutateAsync],\n );\n\n return useMemo(\n () => ({\n ...state,\n mutate,\n mutateAsync,\n }),\n [mutate, mutateAsync, state],\n ) as Result;\n };\n}\n","import type { TRPCClient } from '@trpc/client';\nimport {\n clientCallTypeToProcedureType,\n createTRPCUntypedClient,\n} from '@trpc/client';\nimport type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';\nimport { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';\nimport type { CreateTRPCNextAppRouterOptions } from './shared';\n\nexport {\n // ts-prune-ignore-next\n experimental_createActionHook,\n // ts-prune-ignore-next\n experimental_serverActionLink,\n // ts-prune-ignore-next\n type UseTRPCActionResult,\n} from './create-action-hook';\n\ntype QueryResult = {\n data?: unknown;\n error?: unknown;\n promise?: Promise<unknown>;\n};\n\n// ts-prune-ignore-next\nexport function experimental_createTRPCNextAppDirClient<\n TRouter extends AnyRouter,\n>(opts: CreateTRPCNextAppRouterOptions<TRouter>) {\n const client = createTRPCUntypedClient<TRouter>(opts.config());\n // const useProxy = createUseProxy<TRouter>(client);\n\n const cache = new Map<string, QueryResult>();\n\n return createRecursiveProxy<TRPCClient<TRouter>>(({ path, args }) => {\n // const pathCopy = [key, ...path];\n const pathCopy = [...path];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const procedureType = clientCallTypeToProcedureType(pathCopy.pop()!);\n\n if (procedureType === 'query') {\n const queryCacheKey = JSON.stringify([path, args[0]]);\n const cached = cache.get(queryCacheKey);\n\n if (cached?.promise) {\n return cached.promise;\n }\n }\n\n const fullPath = pathCopy.join('.');\n\n const promise: Promise<unknown> = (client as any)[procedureType](\n fullPath,\n ...args,\n );\n if (procedureType !== 'query') {\n return promise;\n }\n\n const queryCacheKey = JSON.stringify([path, args[0]]);\n\n cache.set(queryCacheKey, {\n promise,\n });\n\n return promise;\n });\n // });\n}\n"],"mappings":";;;;;;;;AA+EA,SAAgB,8BAGd,GAAG,MAeoB;CACvB,MAAM,CAAC,QAAQ;CACf,MAAM,cAAc,eAAA,SAAA,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E,CAAC;GACpD,MAAM,SAAS,MAAM,IAAI,aAAa;GAEtC,IAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IAAI,OAAQ,SACV,OAAO,OAAO;EAElB;EAEA,MAAM,WAAW,SAAS,KAAK,GAAG;EAElC,MAAM,UAA6B,OAAe,cAAc,CAC9D,UACA,GAAG,IACL;EACA,IAAI,kBAAkB,SACpB,OAAO;EAGT,MAAM,gBAAgB,KAAK,UAAU,CAAC,MAAM,KAAK,EAAE,CAAC;EAEpD,MAAM,IAAI,eAAe,EACvB,QACF,CAAC;EAED,OAAO;CACT,CAAC;AAEH"}
1
+ {"version":3,"file":"client.mjs","names":[],"sources":["../../src/app-dir/create-action-hook.tsx","../../src/app-dir/client.ts"],"sourcesContent":["import type {\n CreateTRPCClientOptions,\n TRPCLink,\n TRPCProcedureOptions,\n TRPCRequestOptions,\n} from '@trpc/client';\nimport { createTRPCUntypedClient, TRPCClientError } from '@trpc/client';\nimport type {\n CoercedTransformerParameters,\n TransformerOptions,\n} from '@trpc/client/unstable-internals';\nimport { getTransformer } from '@trpc/client/unstable-internals';\nimport { observable } from '@trpc/server/observable';\nimport type {\n inferClientTypes,\n InferrableClientTypes,\n MaybePromise,\n Simplify,\n TypeError,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { transformResult } from '@trpc/server/unstable-core-do-not-import';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { TRPCActionHandler } from './server';\nimport type { ActionHandlerDef } from './shared';\nimport { isFormData } from './shared';\n\ntype MutationArgs<TDef extends ActionHandlerDef> = TDef['input'] extends void\n ? [input?: undefined | void, opts?: TRPCProcedureOptions]\n : [input: FormData | TDef['input'], opts?: TRPCProcedureOptions];\n\ntype ActionError<TDef extends ActionHandlerDef> = TRPCClientError<{\n errorShape: TDef['errorShape'];\n transformer: boolean;\n}>;\n\ninterface UseTRPCActionBaseResult<TDef extends ActionHandlerDef> {\n mutate: (...args: MutationArgs<TDef>) => void;\n mutateAsync: (...args: MutationArgs<TDef>) => Promise<TDef['output']>;\n}\n\ninterface UseTRPCActionSuccessResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data: TDef['output'];\n error?: never;\n status: 'success';\n}\n\ninterface UseTRPCActionErrorResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data?: never;\n error: ActionError<TDef>;\n status: 'error';\n}\n\ninterface UseTRPCActionIdleResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data?: never;\n error?: never;\n status: 'idle';\n}\n\ninterface UseTRPCActionLoadingResult<\n TDef extends ActionHandlerDef,\n> extends UseTRPCActionBaseResult<TDef> {\n data?: never;\n error?: never;\n status: 'loading';\n}\n\n// ts-prune-ignore-next\nexport type UseTRPCActionResult<TDef extends ActionHandlerDef> =\n | UseTRPCActionErrorResult<TDef>\n | UseTRPCActionIdleResult<TDef>\n | UseTRPCActionLoadingResult<TDef>\n | UseTRPCActionSuccessResult<TDef>;\n\ntype ActionContext = {\n _action: (...args: any[]) => Promise<any>;\n};\n\n// ts-prune-ignore-next\nexport function experimental_serverActionLink<\n TInferrable extends InferrableClientTypes,\n>(\n ...args: InferrableClientTypes extends TInferrable\n ? [\n TypeError<'Generic parameter missing in `experimental_createActionHook<HERE>()` or experimental_serverActionLink<HERE>()'>,\n ]\n : inferClientTypes<TInferrable>['transformer'] extends true\n ? [\n opts: TransformerOptions<{\n transformer: true;\n }>,\n ]\n : [\n opts?: TransformerOptions<{\n transformer: false;\n }>,\n ]\n): TRPCLink<TInferrable> {\n const [opts] = args as [CoercedTransformerParameters];\n const transformer = getTransformer(opts?.transformer);\n return () =>\n ({ op }) =>\n observable((observer) => {\n const context = op.context as ActionContext;\n\n context\n ._action(\n isFormData(op.input)\n ? op.input\n : transformer.input.serialize(op.input),\n )\n .then((data) => {\n const transformed = transformResult(data, transformer.output);\n\n if (!transformed.ok) {\n observer.error(TRPCClientError.from(transformed.error, {}));\n return;\n }\n observer.next({\n context: op.context,\n result: transformed.result,\n });\n observer.complete();\n })\n .catch((cause) => {\n observer.error(TRPCClientError.from(cause));\n });\n });\n}\n\ninterface UseTRPCActionOptions<TDef extends ActionHandlerDef> {\n onSuccess?: (result: TDef['output']) => MaybePromise<void> | void;\n onError?: (result: ActionError<TDef>) => MaybePromise<void>;\n}\n// ts-prune-ignore-next\nexport function experimental_createActionHook<\n TInferrable extends InferrableClientTypes,\n>(\n opts: InferrableClientTypes extends TInferrable\n ? TypeError<'Generic parameter missing in `experimental_createActionHook<HERE>()`'>\n : CreateTRPCClientOptions<TInferrable>,\n) {\n type ActionContext = {\n _action: (...args: any[]) => Promise<any>;\n };\n const client = createTRPCUntypedClient(\n opts as Exclude<typeof opts, TypeError<any>>,\n );\n return function useAction<TDef extends ActionHandlerDef>(\n handler: TRPCActionHandler<TDef>,\n useActionOpts?: UseTRPCActionOptions<Simplify<TDef>>,\n ) {\n const count = useRef(0);\n\n type Result = UseTRPCActionResult<TDef>;\n type State = Omit<Result, 'mutate' | 'mutateAsync'>;\n const [state, setState] = useState<State>({\n status: 'idle',\n });\n\n const actionOptsRef = useRef(useActionOpts);\n actionOptsRef.current = useActionOpts;\n\n useEffect(() => {\n return () => {\n // cleanup after unmount to prevent calling hook opts after unmount\n count.current = -1;\n actionOptsRef.current = undefined;\n };\n }, []);\n\n const mutateAsync = useCallback(\n (input: any, requestOptions?: TRPCRequestOptions) => {\n const idx = ++count.current;\n const context: ActionContext = {\n ...requestOptions?.context,\n _action(innerInput) {\n return handler(innerInput);\n },\n };\n\n setState({\n status: 'loading',\n });\n return client\n .mutation('serverAction', input, {\n ...requestOptions,\n context,\n })\n .then(async (data) => {\n await actionOptsRef.current?.onSuccess?.(data);\n if (idx !== count.current) {\n return;\n }\n setState({\n status: 'success',\n data,\n });\n })\n .catch(async (error) => {\n await actionOptsRef.current?.onError?.(error);\n throw error;\n })\n .catch((error) => {\n if (idx !== count.current) {\n return;\n }\n setState({\n status: 'error',\n error: TRPCClientError.from(error, {}),\n });\n throw error;\n });\n },\n [handler],\n ) as Result['mutateAsync'];\n\n const mutate: Result['mutate'] = useCallback(\n (...args: any[]) => {\n void (mutateAsync as any)(...args).catch(() => {\n // ignored\n });\n },\n [mutateAsync],\n );\n\n return useMemo(\n () => ({\n ...state,\n mutate,\n mutateAsync,\n }),\n [mutate, mutateAsync, state],\n ) as Result;\n };\n}\n","import type { TRPCClient } from '@trpc/client';\nimport {\n clientCallTypeToProcedureType,\n createTRPCUntypedClient,\n} from '@trpc/client';\nimport type { AnyRouter } from '@trpc/server/unstable-core-do-not-import';\nimport { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';\nimport type { CreateTRPCNextAppRouterOptions } from './shared';\n\nexport {\n // ts-prune-ignore-next\n experimental_createActionHook,\n // ts-prune-ignore-next\n experimental_serverActionLink,\n // ts-prune-ignore-next\n type UseTRPCActionResult,\n} from './create-action-hook';\n\ntype QueryResult = {\n data?: unknown;\n error?: unknown;\n promise?: Promise<unknown>;\n};\n\n// ts-prune-ignore-next\nexport function experimental_createTRPCNextAppDirClient<\n TRouter extends AnyRouter,\n>(opts: CreateTRPCNextAppRouterOptions<TRouter>) {\n const client = createTRPCUntypedClient<TRouter>(opts.config());\n // const useProxy = createUseProxy<TRouter>(client);\n\n const cache = new Map<string, QueryResult>();\n\n return createRecursiveProxy<TRPCClient<TRouter>>(({ path, args }) => {\n // const pathCopy = [key, ...path];\n const pathCopy = [...path];\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const procedureType = clientCallTypeToProcedureType(pathCopy.pop()!);\n\n if (procedureType === 'query') {\n const queryCacheKey = JSON.stringify([path, args[0]]);\n const cached = cache.get(queryCacheKey);\n\n if (cached?.promise) {\n return cached.promise;\n }\n }\n\n const fullPath = pathCopy.join('.');\n\n const promise: Promise<unknown> = (client as any)[procedureType](\n fullPath,\n ...args,\n );\n if (procedureType !== 'query') {\n return promise;\n }\n\n const queryCacheKey = JSON.stringify([path,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W;EAEnE,MAAM,WAAW,CAAC,GAAG,IAAI;EAEzB,MAAM,gBAAgB,8BAA8B,SAAS,IAAI,CAAE;EAEnE,IAAI,kBAAkB,SAAS;GAC7B,MAAM,gBAAgB,KAAK,UAAU,CAAC,MAAM,KAAK,EAAE,CAAC;GACpD,MAAM,SAAS,MAAM,IAAI,aAAa;GAEtC,IAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IAAI,OAAQ,SACV,OAAO,OAAO;EAElB;EAEA,MAAM,WAAW,SAAS,KAAK,GAAG;EAElC,MAAM,UAA6B,OAAe,cAAc,CAC9D,UACA,GAAG,IACL;EACA,IAAI,kBAAkB,SACpB,OAAO;EAGT,MAAM,gBAAgB,KAAK,UAAU,CAAC,MAAM,KAAK,EAAE,CAAC;EAEpD,MAAM,IAAI,eAAe,EACvB,QACF,CAAC;EAED,OAAO;CACT,CAAC;AAEH"}
@@ -1,2 +1,2 @@
1
- import { a as ActionHandlerDef, i as experimental_revalidateEndpoint, n as experimental_createServerActionHandler, r as experimental_createTRPCNextAppDirServer, t as TRPCActionHandler } from "../server-BSCiwefJ.cjs";
1
+ import { a as ActionHandlerDef, i as experimental_revalidateEndpoint, n as experimental_createServerActionHandler, r as experimental_createTRPCNextAppDirServer, t as TRPCActionHandler } from "../server-C9BehF33.cjs";
2
2
  export { type ActionHandlerDef, TRPCActionHandler, experimental_createServerActionHandler, experimental_createTRPCNextAppDirServer, experimental_revalidateEndpoint };
@@ -1,2 +1,2 @@
1
- import { a as ActionHandlerDef, i as experimental_revalidateEndpoint, n as experimental_createServerActionHandler, r as experimental_createTRPCNextAppDirServer, t as TRPCActionHandler } from "../server-DQOX6CNV.mjs";
1
+ import { a as ActionHandlerDef, i as experimental_revalidateEndpoint, n as experimental_createServerActionHandler, r as experimental_createTRPCNextAppDirServer, t as TRPCActionHandler } from "../server-iViolfKj.mjs";
2
2
  export { type ActionHandlerDef, TRPCActionHandler, experimental_createServerActionHandler, experimental_createTRPCNextAppDirServer, experimental_revalidateEndpoint };
@@ -1,5 +1,5 @@
1
1
  import { CreateTRPCClientOptions, Resolver, TRPCClient, TRPCUntypedClient } from "@trpc/client";
2
- import { AnyClientTypes, AnyProcedure, AnyRootTypes, AnyRouter, ErrorHandlerOptions, MaybePromise, ProcedureType, ProtectedIntersection, RootConfig, RouterRecord, Simplify, TRPCResponse, inferClientTypes, inferProcedureInput, inferTransformedProcedureOutput } from "@trpc/server/unstable-core-do-not-import";
2
+ import { AnyClientTypes, AnyProcedure, AnyRootTypes, AnyRouter, ErrorHandlerOptions, MaybePromise, ProcedureType, ProtectedIntersection, RootConfig, RouterRecord, Simplify, TRPCResponse, inferClientTypes, inferProcedureErrorShape, inferProcedureInput, inferTransformedProcedureOutput } from "@trpc/server/unstable-core-do-not-import";
3
3
  import { CreateContextCallback, inferProcedureOutput } from "@trpc/server";
4
4
  //#region src/app-dir/shared.d.ts
5
5
  /**
@@ -22,7 +22,7 @@ interface ActionHandlerDef {
22
22
  type inferActionDef<TRoot extends AnyClientTypes, TProc extends AnyProcedure> = {
23
23
  input: inferProcedureInput<TProc>;
24
24
  output: inferProcedureOutput<TProc>;
25
- errorShape: TRoot['errorShape'];
25
+ errorShape: inferProcedureErrorShape<TRoot, TProc>;
26
26
  };
27
27
  //#endregion
28
28
  //#region src/app-dir/types.d.ts
@@ -48,7 +48,7 @@ type DecorateProcedureServer<TType extends ProcedureType, TDef extends ResolverD
48
48
  type NextAppDirDecorateRouterRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = { [TKey in keyof TRecord]: TRecord[TKey] extends (infer $Value) ? $Value extends AnyProcedure ? DecorateProcedureServer<$Value['_def']['type'], {
49
49
  input: inferProcedureInput<$Value>;
50
50
  output: inferTransformedProcedureOutput<TRoot, $Value>;
51
- errorShape: TRoot['errorShape'];
51
+ errorShape: inferProcedureErrorShape<TRoot, $Value>;
52
52
  transformer: TRoot['transformer'];
53
53
  }> : $Value extends RouterRecord ? NextAppDirDecorateRouterRecord<TRoot, $Value> : never : never; };
54
54
  //#endregion
@@ -79,4 +79,4 @@ declare function experimental_createServerActionHandler<TInstance extends {
79
79
  declare function experimental_revalidateEndpoint(req: Request): Promise<Response>;
80
80
  //#endregion
81
81
  export { ActionHandlerDef as a, experimental_revalidateEndpoint as i, experimental_createServerActionHandler as n, CreateTRPCNextAppRouterOptions as o, experimental_createTRPCNextAppDirServer as r, TRPCActionHandler as t };
82
- //# sourceMappingURL=server-BSCiwefJ.d.cts.map
82
+ //# sourceMappingURL=server-C9BehF33.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-C9BehF33.d.cts","names":[],"sources":["../src/app-dir/shared.ts","../src/app-dir/types.ts","../src/app-dir/server.ts"],"mappings":";;;;;;;UA+FiB,+BAA+B,gBAAgB;EAC9D,cAAc,wBAAwB;;;;;UAuBvB;EACf;EACA;EACA;;;;;KAOU,eACV,cAAc,gBACd,cAAc;EAEd,OAAO,oBAAoB;EAC3B,QAAQ,qBAAqB;EAC7B,YAAY,yBAAyB,OAAO;;;;KC5HzC;EACH;EACA;EACA;EACA;;KAGU,wBACV,cAAc,eACd,aAAa,eACX;EAEE,OAAO,SAAS;EAChB,aACE,QAAQ,kBACL;IACD;IAAoB;;IAAoB;;IAG9C;EAEI,QAAQ,SAAS;IAEnB;EAEI,WAAW,SAAS;;KAIlB,+BACV,cAAc,cACd,gBAAgB,mBAEf,cAAc,UAAU,QAAQ,qBAAoB,UACjD,eAAe,eACb,wBACE;EAEE,OAAO,oBAAoB;EAC3B,QAAQ,gCAAgC,OAAO;EAC/C,YAAY,yBAAyB,OAAO;EAC5C,aAAa;KAGjB,eAAe,eACb,+BAA+B,OAAO;;;iBChBhC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,+BAAA,sCAAA;;;;KAkCnC,kBAAkB,aAAa,qBACzC,OAAO,WAAW,kBACf,QAAQ,aAAa,gBAAgB;iBAE1B,uCACd;EACE,SAAS,WAAW;GAGtB,GAAG,WACH,MAAM,sBACJ,6CACM,aAAa;;;;;EAMnB;;;;EAIA,WACE,MAAM,oBAAoB;;;;;EAO5B;KAaiC,cAAc,cAAY,MACrD,UACL,kBACD,SAAS,eAAe,iBAAiB,YAAY;iBA4EnC,gCAAgC,KAAK,UAAO,QAAA"}
@@ -1,4 +1,4 @@
1
- import { AnyClientTypes, AnyProcedure, AnyRootTypes, AnyRouter, ErrorHandlerOptions, MaybePromise, ProcedureType, ProtectedIntersection, RootConfig, RouterRecord, Simplify, TRPCResponse, inferClientTypes, inferProcedureInput, inferTransformedProcedureOutput } from "@trpc/server/unstable-core-do-not-import";
1
+ import { AnyClientTypes, AnyProcedure, AnyRootTypes, AnyRouter, ErrorHandlerOptions, MaybePromise, ProcedureType, ProtectedIntersection, RootConfig, RouterRecord, Simplify, TRPCResponse, inferClientTypes, inferProcedureErrorShape, inferProcedureInput, inferTransformedProcedureOutput } from "@trpc/server/unstable-core-do-not-import";
2
2
  import { CreateTRPCClientOptions, Resolver, TRPCClient, TRPCUntypedClient } from "@trpc/client";
3
3
  import { CreateContextCallback, inferProcedureOutput } from "@trpc/server";
4
4
  //#region src/app-dir/shared.d.ts
@@ -22,7 +22,7 @@ interface ActionHandlerDef {
22
22
  type inferActionDef<TRoot extends AnyClientTypes, TProc extends AnyProcedure> = {
23
23
  input: inferProcedureInput<TProc>;
24
24
  output: inferProcedureOutput<TProc>;
25
- errorShape: TRoot['errorShape'];
25
+ errorShape: inferProcedureErrorShape<TRoot, TProc>;
26
26
  };
27
27
  //#endregion
28
28
  //#region src/app-dir/types.d.ts
@@ -48,7 +48,7 @@ type DecorateProcedureServer<TType extends ProcedureType, TDef extends ResolverD
48
48
  type NextAppDirDecorateRouterRecord<TRoot extends AnyRootTypes, TRecord extends RouterRecord> = { [TKey in keyof TRecord]: TRecord[TKey] extends (infer $Value) ? $Value extends AnyProcedure ? DecorateProcedureServer<$Value['_def']['type'], {
49
49
  input: inferProcedureInput<$Value>;
50
50
  output: inferTransformedProcedureOutput<TRoot, $Value>;
51
- errorShape: TRoot['errorShape'];
51
+ errorShape: inferProcedureErrorShape<TRoot, $Value>;
52
52
  transformer: TRoot['transformer'];
53
53
  }> : $Value extends RouterRecord ? NextAppDirDecorateRouterRecord<TRoot, $Value> : never : never; };
54
54
  //#endregion
@@ -79,4 +79,4 @@ declare function experimental_createServerActionHandler<TInstance extends {
79
79
  declare function experimental_revalidateEndpoint(req: Request): Promise<Response>;
80
80
  //#endregion
81
81
  export { ActionHandlerDef as a, experimental_revalidateEndpoint as i, experimental_createServerActionHandler as n, CreateTRPCNextAppRouterOptions as o, experimental_createTRPCNextAppDirServer as r, TRPCActionHandler as t };
82
- //# sourceMappingURL=server-DQOX6CNV.d.mts.map
82
+ //# sourceMappingURL=server-iViolfKj.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-iViolfKj.d.mts","names":[],"sources":["../src/app-dir/shared.ts","../src/app-dir/types.ts","../src/app-dir/server.ts"],"mappings":";;;;;;;UA+FiB,+BAA+B,gBAAgB;EAC9D,cAAc,wBAAwB;;;;;UAuBvB;EACf;EACA;EACA;;;;;KAOU,eACV,cAAc,gBACd,cAAc;EAEd,OAAO,oBAAoB;EAC3B,QAAQ,qBAAqB;EAC7B,YAAY,yBAAyB,OAAO;;;;KC5HzC;EACH;EACA;EACA;EACA;;KAGU,wBACV,cAAc,eACd,aAAa,eACX;EAEE,OAAO,SAAS;EAChB,aACE,QAAQ,kBACL;IACD;IAAoB;;IAAoB;;IAG9C;EAEI,QAAQ,SAAS;IAEnB;EAEI,WAAW,SAAS;;KAIlB,+BACV,cAAc,cACd,gBAAgB,mBAEf,cAAc,UAAU,QAAQ,qBAAoB,UACjD,eAAe,eACb,wBACE;EAEE,OAAO,oBAAoB;EAC3B,QAAQ,gCAAgC,OAAO;EAC/C,YAAY,yBAAyB,OAAO;EAC5C,aAAa;KAGjB,eAAe,eACb,+BAA+B,OAAO;;;iBChBhC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,+BAAA,sCAAA;;;;KAkCnC,kBAAkB,aAAa,qBACzC,OAAO,WAAW,kBACf,QAAQ,aAAa,gBAAgB;iBAE1B,uCACd;EACE,SAAS,WAAW;GAGtB,GAAG,WACH,MAAM,sBACJ,6CACM,aAAa;;;;;EAMnB;;;;EAIA,WACE,MAAM,oBAAoB;;;;;EAO5B;KAaiC,cAAc,cAAY,MACrD,UACL,kBACD,SAAS,eAAe,iBAAiB,YAAY;iBA4EnC,gCAAgC,KAAK,UAAO,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"shared-DJ-gGeuI.mjs","names":[],"sources":["../src/app-dir/shared.ts"],"sourcesContent":["import type {\n CreateTRPCClientOptions,\n Resolver,\n TRPCClient,\n} from '@trpc/client';\nimport { getUntypedClient, TRPCUntypedClient } from '@trpc/client';\nimport type { inferProcedureOutput } from '@trpc/server';\nimport type {\n AnyClientTypes,\n AnyProcedure,\n AnyQueryProcedure,\n AnyRootTypes,\n AnyRouter,\n inferProcedureInput,\n inferTransformedProcedureOutput,\n ProtectedIntersection,\n RouterRecord,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';\n\n/**\n * @internal\n */\nexport type UseProcedureRecord<\n TRoot extends AnyRootTypes,\n TRecord extends RouterRecord,\n> = {\n [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value\n ? $Value extends AnyQueryProcedure\n ? Resolver<{\n input: inferProcedureInput<$Value>;\n output: inferTransformedProcedureOutput<TRoot, $Value>;\n errorShape: TRoot['errorShape'];\n transformer: TRoot['transformer'];\n }>\n : $Value extends RouterRecord\n ? UseProcedureRecord<TRoot, $Value>\n : never\n : never;\n};\n\nexport function createUseProxy<TRouter extends AnyRouter>(\n client: TRPCUntypedClient<TRouter> | TRPCClient<TRouter>,\n) {\n const untypedClient: TRPCUntypedClient<TRouter> =\n client instanceof TRPCUntypedClient ? client : getUntypedClient(client);\n\n return createRecursiveProxy<\n UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >\n >((opts) => {\n const path = opts.path.join('.');\n\n return untypedClient.query(path, ...opts.args);\n });\n}\n\ntype NextAppRouterUse<TRouter extends AnyRouter> = {\n <TData extends Promise<unknown>[]>(\n cb: (\n t: UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >,\n ) => [...TData],\n ): {\n [TKey in keyof TData]: Awaited<TData[TKey]>;\n };\n <TData extends Promise<unknown>>(\n cb: (\n t: UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >,\n ) => TData,\n ): Awaited<TData>;\n};\ntype CreateTRPCNextAppRouterBase<TRouter extends AnyRouter> = {\n use: NextAppRouterUse<TRouter>;\n};\nexport type CreateTRPCNextAppRouter<TRouter extends AnyRouter> =\n ProtectedIntersection<\n CreateTRPCNextAppRouterBase<TRouter>,\n UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >\n >;\n\n/**\n * @internal\n */\nexport interface CreateTRPCNextAppRouterOptions<TRouter extends AnyRouter> {\n config: () => CreateTRPCClientOptions<TRouter>;\n}\n\n/**\n * @internal\n */\nexport function generateCacheTag(procedurePath: string, input: any) {\n return input\n ? `${procedurePath}?input=${JSON.stringify(input)}`\n : procedurePath;\n}\n\nexport function isFormData(value: unknown): value is FormData {\n if (typeof FormData === 'undefined') {\n // FormData is not supported\n return false;\n }\n return value instanceof FormData;\n}\n\n/**\n * @internal\n */\nexport interface ActionHandlerDef {\n input?: any;\n output?: any;\n errorShape: any;\n}\n\n// ts-prune-ignore-next\n/**\n * @internal\n */\nexport type inferActionDef<\n TRoot extends AnyClientTypes,\n TProc extends AnyProcedure,\n> = {\n input: inferProcedureInput<TProc>;\n output: inferProcedureOutput<TProc>;\n errorShape: TRoot['errorShape'];\n};\n"],"mappings":";;;;;;AAqGA,SAAgB,iBAAiB,eAAuB,OAAY;CAClE,OAAO,QACH,GAAG,cAAc,SAAS,KAAK,UAAU,KAAK,MAC9C;AACN;AAEA,SAAgB,WAAW,OAAmC;CAC5D,IAAI,OAAO,aAAa,aAEtB,OAAO;CAET,OAAO,iBAAiB;AAC1B"}
1
+ {"version":3,"file":"shared-DJ-gGeuI.mjs","names":[],"sources":["../src/app-dir/shared.ts"],"sourcesContent":["import type {\n CreateTRPCClientOptions,\n Resolver,\n TRPCClient,\n} from '@trpc/client';\nimport { getUntypedClient, TRPCUntypedClient } from '@trpc/client';\nimport type { inferProcedureOutput } from '@trpc/server';\nimport type {\n AnyClientTypes,\n AnyProcedure,\n AnyQueryProcedure,\n AnyRootTypes,\n AnyRouter,\n inferProcedureErrorShape,\n inferProcedureInput,\n inferTransformedProcedureOutput,\n ProtectedIntersection,\n RouterRecord,\n} from '@trpc/server/unstable-core-do-not-import';\nimport { createRecursiveProxy } from '@trpc/server/unstable-core-do-not-import';\n\n/**\n * @internal\n */\nexport type UseProcedureRecord<\n TRoot extends AnyRootTypes,\n TRecord extends RouterRecord,\n> = {\n [TKey in keyof TRecord]: TRecord[TKey] extends infer $Value\n ? $Value extends AnyQueryProcedure\n ? Resolver<{\n input: inferProcedureInput<$Value>;\n output: inferTransformedProcedureOutput<TRoot, $Value>;\n errorShape: inferProcedureErrorShape<TRoot, $Value>;\n transformer: TRoot['transformer'];\n }>\n : $Value extends RouterRecord\n ? UseProcedureRecord<TRoot, $Value>\n : never\n : never;\n};\n\nexport function createUseProxy<TRouter extends AnyRouter>(\n client: TRPCUntypedClient<TRouter> | TRPCClient<TRouter>,\n) {\n const untypedClient: TRPCUntypedClient<TRouter> =\n client instanceof TRPCUntypedClient ? client : getUntypedClient(client);\n\n return createRecursiveProxy<\n UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >\n >((opts) => {\n const path = opts.path.join('.');\n\n return untypedClient.query(path, ...opts.args);\n });\n}\n\ntype NextAppRouterUse<TRouter extends AnyRouter> = {\n <TData extends Promise<unknown>[]>(\n cb: (\n t: UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >,\n ) => [...TData],\n ): {\n [TKey in keyof TData]: Awaited<TData[TKey]>;\n };\n <TData extends Promise<unknown>>(\n cb: (\n t: UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >,\n ) => TData,\n ): Awaited<TData>;\n};\ntype CreateTRPCNextAppRouterBase<TRouter extends AnyRouter> = {\n use: NextAppRouterUse<TRouter>;\n};\nexport type CreateTRPCNextAppRouter<TRouter extends AnyRouter> =\n ProtectedIntersection<\n CreateTRPCNextAppRouterBase<TRouter>,\n UseProcedureRecord<\n TRouter['_def']['_config']['$types'],\n TRouter['_def']['record']\n >\n >;\n\n/**\n * @internal\n */\nexport interface CreateTRPCNextAppRouterOptions<TRouter extends AnyRouter> {\n config: () => CreateTRPCClientOptions<TRouter>;\n}\n\n/**\n * @internal\n */\nexport function generateCacheTag(procedurePath: string, input: any) {\n return input\n ? `${procedurePath}?input=${JSON.stringify(input)}`\n : procedurePath;\n}\n\nexport function isFormData(value: unknown): value is FormData {\n if (typeof FormData === 'undefined') {\n // FormData is not supported\n return false;\n }\n return value instanceof FormData;\n}\n\n/**\n * @internal\n */\nexport interface ActionHandlerDef {\n input?: any;\n output?: any;\n errorShape: any;\n}\n\n// ts-prune-ignore-next\n/**\n * @internal\n */\nexport type inferActionDef<\n TRoot extends AnyClientTypes,\n TProc extends AnyProcedure,\n> = {\n input: inferProcedureInput<TProc>;\n output: inferProcedureOutput<TProc>;\n errorShape: inferProcedureErrorShape<TRoot, TProc>;\n};\n"],"mappings":";;;;;;AAsGA,SAAgB,iBAAiB,eAAuB,OAAY;CAClE,OAAO,QACH,GAAG,cAAc,SAAS,KAAK,UAAU,KAAK,MAC9C;AACN;AAEA,SAAgB,WAAW,OAAmC;CAC5D,IAAI,OAAO,aAAa,aAEtB,OAAO;CAET,OAAO,iBAAiB;AAC1B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@trpc/next",
4
- "version": "11.19.0",
4
+ "version": "11.21.1-canary.20.10e2ef98f",
5
5
  "description": "The tRPC Next.js library",
6
6
  "author": "KATT",
7
7
  "license": "MIT",
@@ -107,9 +107,9 @@
107
107
  ],
108
108
  "peerDependencies": {
109
109
  "@tanstack/react-query": "^5.59.15",
110
- "@trpc/client": "11.19.0",
111
- "@trpc/react-query": "11.19.0",
112
- "@trpc/server": "11.19.0",
110
+ "@trpc/client": "11.21.1",
111
+ "@trpc/react-query": "11.21.1",
112
+ "@trpc/server": "11.21.1",
113
113
  "next": "*",
114
114
  "react": ">=16.8.0",
115
115
  "react-dom": ">=16.8.0",
@@ -126,21 +126,21 @@
126
126
  "devDependencies": {
127
127
  "@tanstack/intent": "^0.0.27",
128
128
  "@tanstack/react-query": "^5.80.3",
129
- "@trpc/client": "11.19.0",
130
- "@trpc/react-query": "11.19.0",
131
- "@trpc/server": "11.19.0",
129
+ "@trpc/client": "11.21.1",
130
+ "@trpc/react-query": "11.21.1",
131
+ "@trpc/server": "11.21.1",
132
132
  "@types/express": "^5.0.0",
133
- "@types/node": "catalog:",
133
+ "@types/node": "^24.13.4",
134
134
  "@types/react": "^19.1.0",
135
135
  "@types/react-dom": "^19.1.1",
136
- "devalue": "catalog:",
137
- "eslint": "catalog:",
136
+ "devalue": "^5.9.2",
137
+ "eslint": "^10.10.0",
138
138
  "express": "^5.0.0",
139
- "next": "catalog:",
139
+ "next": "^15.5.25",
140
140
  "react": "^19.1.0",
141
141
  "react-dom": "^19.1.0",
142
- "tsdown": "catalog:",
143
- "typescript": "catalog:",
142
+ "tsdown": "0.23.0",
143
+ "typescript": "^7.0.2",
144
144
  "zod": "^4.2.1"
145
145
  },
146
146
  "publishConfig": {
@@ -155,5 +155,5 @@
155
155
  "bin": {
156
156
  "intent": "./bin/intent.js"
157
157
  },
158
- "gitHead": "fcc6bca0ece2762e393e6d8c8527bbaa17a878d2"
158
+ "gitHead": "10e2ef98f7842b94eb3026e4f9bcfe62cc39b088"
159
159
  }
@@ -28,6 +28,11 @@ type MutationArgs<TDef extends ActionHandlerDef> = TDef['input'] extends void
28
28
  ? [input?: undefined | void, opts?: TRPCProcedureOptions]
29
29
  : [input: FormData | TDef['input'], opts?: TRPCProcedureOptions];
30
30
 
31
+ type ActionError<TDef extends ActionHandlerDef> = TRPCClientError<{
32
+ errorShape: TDef['errorShape'];
33
+ transformer: boolean;
34
+ }>;
35
+
31
36
  interface UseTRPCActionBaseResult<TDef extends ActionHandlerDef> {
32
37
  mutate: (...args: MutationArgs<TDef>) => void;
33
38
  mutateAsync: (...args: MutationArgs<TDef>) => Promise<TDef['output']>;
@@ -45,7 +50,7 @@ interface UseTRPCActionErrorResult<
45
50
  TDef extends ActionHandlerDef,
46
51
  > extends UseTRPCActionBaseResult<TDef> {
47
52
  data?: never;
48
- error: TRPCClientError<TDef['errorShape']>;
53
+ error: ActionError<TDef>;
49
54
  status: 'error';
50
55
  }
51
56
 
@@ -130,7 +135,7 @@ export function experimental_serverActionLink<
130
135
 
131
136
  interface UseTRPCActionOptions<TDef extends ActionHandlerDef> {
132
137
  onSuccess?: (result: TDef['output']) => MaybePromise<void> | void;
133
- onError?: (result: TRPCClientError<TDef['errorShape']>) => MaybePromise<void>;
138
+ onError?: (result: ActionError<TDef>) => MaybePromise<void>;
134
139
  }
135
140
  // ts-prune-ignore-next
136
141
  export function experimental_createActionHook<
@@ -11,6 +11,7 @@ import type {
11
11
  AnyQueryProcedure,
12
12
  AnyRootTypes,
13
13
  AnyRouter,
14
+ inferProcedureErrorShape,
14
15
  inferProcedureInput,
15
16
  inferTransformedProcedureOutput,
16
17
  ProtectedIntersection,
@@ -30,7 +31,7 @@ export type UseProcedureRecord<
30
31
  ? Resolver<{
31
32
  input: inferProcedureInput<$Value>;
32
33
  output: inferTransformedProcedureOutput<TRoot, $Value>;
33
- errorShape: TRoot['errorShape'];
34
+ errorShape: inferProcedureErrorShape<TRoot, $Value>;
34
35
  transformer: TRoot['transformer'];
35
36
  }>
36
37
  : $Value extends RouterRecord
@@ -132,5 +133,5 @@ export type inferActionDef<
132
133
  > = {
133
134
  input: inferProcedureInput<TProc>;
134
135
  output: inferProcedureOutput<TProc>;
135
- errorShape: TRoot['errorShape'];
136
+ errorShape: inferProcedureErrorShape<TRoot, TProc>;
136
137
  };
@@ -2,6 +2,7 @@ import type { Resolver } from '@trpc/client';
2
2
  import type {
3
3
  AnyProcedure,
4
4
  AnyRootTypes,
5
+ inferProcedureErrorShape,
5
6
  inferProcedureInput,
6
7
  inferTransformedProcedureOutput,
7
8
  ProcedureType,
@@ -48,7 +49,7 @@ export type NextAppDirDecorateRouterRecord<
48
49
  {
49
50
  input: inferProcedureInput<$Value>;
50
51
  output: inferTransformedProcedureOutput<TRoot, $Value>;
51
- errorShape: TRoot['errorShape'];
52
+ errorShape: inferProcedureErrorShape<TRoot, $Value>;
52
53
  transformer: TRoot['transformer'];
53
54
  }
54
55
  >
@@ -0,0 +1 @@
1
+ export * from '../dist/ssrPrepass';
@@ -0,0 +1 @@
1
+ module.exports = require('../dist/ssrPrepass');
@@ -1 +0,0 @@
1
- {"version":3,"file":"server-BSCiwefJ.d.cts","names":[],"sources":["../src/app-dir/shared.ts","../src/app-dir/types.ts","../src/app-dir/server.ts"],"mappings":";;;;;;;UA8FiB,+BAA+B,gBAAgB;EAC9D,cAAc,wBAAwB;;;;;UAuBvB;EACf;EACA;EACA;;;;;KAOU,eACV,cAAc,gBACd,cAAc;EAEd,OAAO,oBAAoB;EAC3B,QAAQ,qBAAqB;EAC7B,YAAY;;;;KC5HT;EACH;EACA;EACA;EACA;;KAGU,wBACV,cAAc,eACd,aAAa,eACX;EAEE,OAAO,SAAS;EAChB,aACE,QAAQ,kBACL;IACD;IAAoB;;IAAoB;;IAG9C;EAEI,QAAQ,SAAS;IAEnB;EAEI,WAAW,SAAS;;KAIlB,+BACV,cAAc,cACd,gBAAgB,mBAEf,cAAc,UAAU,QAAQ,qBAAoB,UACjD,eAAe,eACb,wBACE;EAEE,OAAO,oBAAoB;EAC3B,QAAQ,gCAAgC,OAAO;EAC/C,YAAY;EACZ,aAAa;KAGjB,eAAe,eACb,+BAA+B,OAAO;;;iBCfhC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,+BAAA,sCAAA;;;;KAkCnC,kBAAkB,aAAa,qBACzC,OAAO,WAAW,kBACf,QAAQ,aAAa,gBAAgB;iBAE1B,uCACd;EACE,SAAS,WAAW;GAGtB,GAAG,WACH,MAAM,sBACJ,6CACM,aAAa;;;;;EAMnB;;;;EAIA,WACE,MAAM,oBAAoB;;;;;EAO5B;KAaiC,cAAc,cAAY,MACrD,UACL,kBACD,SAAS,eAAe,iBAAiB,YAAY;iBA4EnC,gCAAgC,KAAK,UAAO,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"server-DQOX6CNV.d.mts","names":[],"sources":["../src/app-dir/shared.ts","../src/app-dir/types.ts","../src/app-dir/server.ts"],"mappings":";;;;;;;UA8FiB,+BAA+B,gBAAgB;EAC9D,cAAc,wBAAwB;;;;;UAuBvB;EACf;EACA;EACA;;;;;KAOU,eACV,cAAc,gBACd,cAAc;EAEd,OAAO,oBAAoB;EAC3B,QAAQ,qBAAqB;EAC7B,YAAY;;;;KC5HT;EACH;EACA;EACA;EACA;;KAGU,wBACV,cAAc,eACd,aAAa,eACX;EAEE,OAAO,SAAS;EAChB,aACE,QAAQ,kBACL;IACD;IAAoB;;IAAoB;;IAG9C;EAEI,QAAQ,SAAS;IAEnB;EAEI,WAAW,SAAS;;KAIlB,+BACV,cAAc,cACd,gBAAgB,mBAEf,cAAc,UAAU,QAAQ,qBAAoB,UACjD,eAAe,eACb,wBACE;EAEE,OAAO,oBAAoB;EAC3B,QAAQ,gCAAgC,OAAO;EAC/C,YAAY;EACZ,aAAa;KAGjB,eAAe,eACb,+BAA+B,OAAO;;;iBCfhC,wCACd,gBAAgB,WAChB,MAAM,+BAA+B,WAAQ,+BAAA,sCAAA;;;;KAkCnC,kBAAkB,aAAa,qBACzC,OAAO,WAAW,kBACf,QAAQ,aAAa,gBAAgB;iBAE1B,uCACd;EACE,SAAS,WAAW;GAGtB,GAAG,WACH,MAAM,sBACJ,6CACM,aAAa;;;;;EAMnB;;;;EAIA,WACE,MAAM,oBAAoB;;;;;EAO5B;KAaiC,cAAc,cAAY,MACrD,UACL,kBACD,SAAS,eAAe,iBAAiB,YAAY;iBA4EnC,gCAAgC,KAAK,UAAO,QAAA"}