@trpc/client 10.28.0 → 10.28.2

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 (57) hide show
  1. package/dist/TRPCClientError.d.ts +25 -25
  2. package/dist/TRPCClientError.d.ts.map +1 -1
  3. package/dist/createTRPCClient.d.ts +19 -19
  4. package/dist/createTRPCClient.d.ts.map +1 -1
  5. package/dist/createTRPCClientProxy.d.ts +38 -38
  6. package/dist/createTRPCClientProxy.d.ts.map +1 -1
  7. package/dist/createTRPCUntypedClient.d.ts +4 -4
  8. package/dist/getFetch.d.ts +2 -2
  9. package/dist/{httpUtils-1a07b2e6.js → httpUtils-00c8b54e.js} +125 -125
  10. package/dist/index.d.ts +6 -6
  11. package/dist/index.js +2 -2
  12. package/dist/index.mjs +2 -2
  13. package/dist/internals/TRPCUntypedClient.d.ts +61 -61
  14. package/dist/internals/TRPCUntypedClient.d.ts.map +1 -1
  15. package/dist/internals/dataLoader.d.ts +17 -17
  16. package/dist/internals/dataLoader.d.ts.map +1 -1
  17. package/dist/internals/getAbortController.d.ts +3 -3
  18. package/dist/internals/retryDelay.d.ts +1 -1
  19. package/dist/internals/types.d.ts +75 -102
  20. package/dist/internals/types.d.ts.map +1 -1
  21. package/dist/links/dedupeLink.d.ts +3 -3
  22. package/dist/links/httpBatchLink.d.ts +15 -15
  23. package/dist/links/httpBatchLink.d.ts.map +1 -1
  24. package/dist/links/httpFormDataLink.d.ts +1 -1
  25. package/dist/links/httpLink.d.ts +16 -16
  26. package/dist/links/httpLink.d.ts.map +1 -1
  27. package/dist/links/index.d.ts +7 -7
  28. package/dist/links/internals/createChain.d.ts +7 -7
  29. package/dist/links/internals/httpUtils.d.ts +59 -59
  30. package/dist/links/internals/httpUtils.d.ts.map +1 -1
  31. package/dist/links/internals/isObject.d.ts +1 -1
  32. package/dist/links/loggerLink.d.ts +39 -39
  33. package/dist/links/loggerLink.d.ts.map +1 -1
  34. package/dist/links/retryLink.d.ts +5 -5
  35. package/dist/links/splitLink.d.ts +13 -13
  36. package/dist/links/types.d.ts +69 -69
  37. package/dist/links/types.d.ts.map +1 -1
  38. package/dist/links/wsLink.d.ts +28 -28
  39. package/dist/links/wsLink.d.ts.map +1 -1
  40. package/dist/shared/index.d.ts +1 -1
  41. package/dist/shared/transformResult.d.ts +33 -33
  42. package/dist/shared/transformResult.d.ts.map +1 -1
  43. package/dist/{splitLink-aebd28df.js → splitLink-0df96fdc.js} +34 -34
  44. package/dist/{transformResult-fc4863b8.js → transformResult-ae8e970c.js} +80 -80
  45. package/package.json +6 -6
  46. package/src/TRPCClientError.ts +1 -1
  47. package/src/createTRPCClient.ts +1 -1
  48. package/src/createTRPCClientProxy.ts +1 -1
  49. package/src/internals/TRPCUntypedClient.ts +2 -2
  50. package/src/internals/types.ts +0 -39
  51. package/src/links/httpBatchLink.ts +2 -2
  52. package/src/links/httpFormDataLink.ts +1 -1
  53. package/src/links/httpLink.ts +2 -2
  54. package/src/links/retryLink.ts +1 -1
  55. package/src/links/types.ts +1 -1
  56. package/src/links/wsLink.ts +3 -3
  57. package/src/shared/transformResult.ts +1 -1
@@ -1,62 +1,62 @@
1
- import { AnyRouter, ClientDataTransformerOptions, CombinedDataTransformer, DataTransformerOptions, DefaultDataTransformer } from '@trpc/server';
2
- import { Unsubscribable } from '@trpc/server/observable';
3
- import { TRPCClientError } from '../TRPCClientError';
4
- import { OperationContext, TRPCClientRuntime, TRPCLink } from '../links/types';
5
- declare type CreateTRPCClientBaseOptions<TRouter extends AnyRouter> = TRouter['_def']['_config']['transformer'] extends DefaultDataTransformer ? {
6
- /**
7
- * Data transformer
8
- *
9
- * You must use the same transformer on the backend and frontend
10
- * @link https://trpc.io/docs/data-transformers
11
- **/
12
- transformer?: 'You must set a transformer on the backend router';
13
- } : TRouter['_def']['_config']['transformer'] extends DataTransformerOptions ? {
14
- /**
15
- * Data transformer
16
- *
17
- * You must use the same transformer on the backend and frontend
18
- * @link https://trpc.io/docs/data-transformers
19
- **/
20
- transformer: TRouter['_def']['_config']['transformer'] extends CombinedDataTransformer ? DataTransformerOptions : TRouter['_def']['_config']['transformer'];
21
- } : {
22
- /**
23
- * Data transformer
24
- *
25
- * You must use the same transformer on the backend and frontend
26
- * @link https://trpc.io/docs/data-transformers
27
- **/
28
- transformer?: /** @deprecated **/ ClientDataTransformerOptions | CombinedDataTransformer;
29
- };
30
- export interface TRPCRequestOptions {
31
- /**
32
- * Pass additional context to links
33
- */
34
- context?: OperationContext;
35
- signal?: AbortSignal;
36
- }
37
- export interface TRPCSubscriptionObserver<TValue, TError> {
38
- onStarted: () => void;
39
- onData: (value: TValue) => void;
40
- onError: (err: TError) => void;
41
- onStopped: () => void;
42
- onComplete: () => void;
43
- }
44
- /** @internal */
45
- export declare type CreateTRPCClientOptions<TRouter extends AnyRouter> = CreateTRPCClientBaseOptions<TRouter> & {
46
- links: TRPCLink<TRouter>[];
47
- };
48
- /** @internal */
49
- export declare type UntypedClientProperties = 'links' | 'runtime' | 'requestId' | '$request' | 'requestAsPromise' | 'query' | 'mutation' | 'subscription';
50
- export declare class TRPCUntypedClient<TRouter extends AnyRouter> {
51
- private readonly links;
52
- readonly runtime: TRPCClientRuntime;
53
- private requestId;
54
- constructor(opts: CreateTRPCClientOptions<TRouter>);
55
- private $request;
56
- private requestAsPromise;
57
- query(path: string, input?: unknown, opts?: TRPCRequestOptions): Promise<unknown>;
58
- mutation(path: string, input?: unknown, opts?: TRPCRequestOptions): Promise<unknown>;
59
- subscription(path: string, input: unknown, opts: TRPCRequestOptions & Partial<TRPCSubscriptionObserver<unknown, TRPCClientError<AnyRouter>>>): Unsubscribable;
60
- }
61
- export {};
1
+ import { AnyRouter, ClientDataTransformerOptions, CombinedDataTransformer, DataTransformerOptions, DefaultDataTransformer } from '@trpc/server';
2
+ import { Unsubscribable } from '@trpc/server/observable';
3
+ import { OperationContext, TRPCClientRuntime, TRPCLink } from '../links/types';
4
+ import { TRPCClientError } from '../TRPCClientError';
5
+ type CreateTRPCClientBaseOptions<TRouter extends AnyRouter> = TRouter['_def']['_config']['transformer'] extends DefaultDataTransformer ? {
6
+ /**
7
+ * Data transformer
8
+ *
9
+ * You must use the same transformer on the backend and frontend
10
+ * @link https://trpc.io/docs/data-transformers
11
+ **/
12
+ transformer?: 'You must set a transformer on the backend router';
13
+ } : TRouter['_def']['_config']['transformer'] extends DataTransformerOptions ? {
14
+ /**
15
+ * Data transformer
16
+ *
17
+ * You must use the same transformer on the backend and frontend
18
+ * @link https://trpc.io/docs/data-transformers
19
+ **/
20
+ transformer: TRouter['_def']['_config']['transformer'] extends CombinedDataTransformer ? DataTransformerOptions : TRouter['_def']['_config']['transformer'];
21
+ } : {
22
+ /**
23
+ * Data transformer
24
+ *
25
+ * You must use the same transformer on the backend and frontend
26
+ * @link https://trpc.io/docs/data-transformers
27
+ **/
28
+ transformer?: /** @deprecated **/ ClientDataTransformerOptions | CombinedDataTransformer;
29
+ };
30
+ export interface TRPCRequestOptions {
31
+ /**
32
+ * Pass additional context to links
33
+ */
34
+ context?: OperationContext;
35
+ signal?: AbortSignal;
36
+ }
37
+ export interface TRPCSubscriptionObserver<TValue, TError> {
38
+ onStarted: () => void;
39
+ onData: (value: TValue) => void;
40
+ onError: (err: TError) => void;
41
+ onStopped: () => void;
42
+ onComplete: () => void;
43
+ }
44
+ /** @internal */
45
+ export type CreateTRPCClientOptions<TRouter extends AnyRouter> = CreateTRPCClientBaseOptions<TRouter> & {
46
+ links: TRPCLink<TRouter>[];
47
+ };
48
+ /** @internal */
49
+ export type UntypedClientProperties = 'links' | 'runtime' | 'requestId' | '$request' | 'requestAsPromise' | 'query' | 'mutation' | 'subscription';
50
+ export declare class TRPCUntypedClient<TRouter extends AnyRouter> {
51
+ private readonly links;
52
+ readonly runtime: TRPCClientRuntime;
53
+ private requestId;
54
+ constructor(opts: CreateTRPCClientOptions<TRouter>);
55
+ private $request;
56
+ private requestAsPromise;
57
+ query(path: string, input?: unknown, opts?: TRPCRequestOptions): Promise<unknown>;
58
+ mutation(path: string, input?: unknown, opts?: TRPCRequestOptions): Promise<unknown>;
59
+ subscription(path: string, input: unknown, opts: TRPCRequestOptions & Partial<TRPCSubscriptionObserver<unknown, TRPCClientError<AnyRouter>>>): Unsubscribable;
60
+ }
61
+ export {};
62
62
  //# sourceMappingURL=TRPCUntypedClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TRPCUntypedClient.d.ts","sourceRoot":"","sources":["../../src/internals/TRPCUntypedClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,4BAA4B,EAC5B,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,cAAc,EAIf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,gBAAgB,EAEhB,iBAAiB,EACjB,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAExB,aAAK,2BAA2B,CAAC,OAAO,SAAS,SAAS,IACxD,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,GACpE;IACE;;;;;QAKI;IACJ,WAAW,CAAC,EAAE,kDAAkD,CAAC;CAClE,GACD,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,SAAS,sBAAsB,GACxE;IACE;;;;;QAKI;IACJ,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,SAAS,uBAAuB,GAClF,sBAAsB,GACtB,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;CAC/C,GACD;IACE;;;;;QAKI;IACJ,WAAW,CAAC,EACR,mBAAmB,CAAC,4BAA4B,GAChD,uBAAuB,CAAC;CAC7B,CAAC;AAGR,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,CAA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chLoader<TKey, TValue> = {
3
- validate: (keys: TKey[]) => boolean;
4
- fetch: (keys: TKey[]) => {
5
- promise: Promise<TValue[]>;
6
- cancel: CancelFn;
7
- };
8
- };
9
- /**
10
- * Dataloader that's very inspired by https://github.com/graphql/dataloader
11
- * Less configuration, no caching, and allows you to cancel requests
12
- * When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled
13
- */
14
- export declare function dataLoader<TKey, TValue>(batchLoader: BatchLoader<TKey, TValue>): {
15
- load: (key: TKey) => PromiseAndCancel<TValue>;
16
- };
17
- export {};
1
+ import { CancelFn, PromiseAndCancel } from '../links/types';
2
+ type BatchLoader<TKey, TValue> = {
3
+ validate: (keys: TKey[]) => boolean;
4
+ fetch: (keys: TKey[]) => {
5
+ promise: Promise<TValue[]>;
6
+ cancel: CancelFn;
7
+ };
8
+ };
9
+ /**
10
+ * Dataloader that's very inspired by https://github.com/graphql/dataloader
11
+ * Less configuration, no caching, and allows you to cancel requests
12
+ * When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled
13
+ */
14
+ export declare function dataLoader<TKey, TValue>(batchLoader: BatchLoader<TKey, TValue>): {
15
+ load: (key: TKey) => PromiseAndCancel<TValue>;
16
+ };
17
+ export {};
18
18
  //# sourceMappingURL=dataLoader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataLoader.d.ts","sourceRoot":"","sources":["../../src/internals/dataLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAa5D,aAAK,WAAW,CAAC,IAAI,EAAE,MAAM,IAAI;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC;IACpC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK;QACvB,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3B,MAAM,EAAE,QAAQ,CAAC;KAClB,CAAC;CACH,CAAC;AAWF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EACrC,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;gBA2FnB,IAAI,KAAG,iBAAiB,MAAM,CAAC;EAsCnD"}
1
+ {"version":3,"file":"dataLoader.d.ts","sourceRoot":"","sources":["../../src/internals/dataLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAa5D,KAAK,WAAW,CAAC,IAAI,EAAE,MAAM,IAAI;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC;IACpC,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK;QACvB,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3B,MAAM,EAAE,QAAQ,CAAC;KAClB,CAAC;CACH,CAAC;AAWF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EACrC,WAAW,EAAE,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;gBA2FnB,IAAI,KAAG,iBAAiB,MAAM,CAAC;EAsCnD"}
@@ -1,4 +1,4 @@
1
- import { Maybe } from '@trpc/server';
2
- import { AbortControllerEsque } from './types';
3
- export declare function getAbortController(customAbortControllerImpl: Maybe<AbortControllerEsque>): AbortControllerEsque | null;
1
+ import { Maybe } from '@trpc/server';
2
+ import { AbortControllerEsque } from './types';
3
+ export declare function getAbortController(customAbortControllerImpl: Maybe<AbortControllerEsque>): AbortControllerEsque | null;
4
4
  //# sourceMappingURL=getAbortController.d.ts.map
@@ -1,2 +1,2 @@
1
- export declare const retryDelay: (attemptIndex: number) => number;
1
+ export declare const retryDelay: (attemptIndex: number) => number;
2
2
  //# sourceMappingURL=retryDelay.d.ts.map
@@ -1,103 +1,76 @@
1
- export interface AbortControllerEsque {
2
- new (): AbortControllerInstanceEsque;
3
- }
4
- /**
5
- * Allows you to abort one or more requests.
6
- */
7
- export interface AbortControllerInstanceEsque {
8
- /**
9
- * The AbortSignal object associated with this object.
10
- */
11
- readonly signal: AbortSignal;
12
- /**
13
- * Sets this object's AbortSignal's aborted flag and signals to
14
- * any observers that the associated activity is to be aborted.
15
- */
16
- abort(): void;
17
- }
18
- /**
19
- * A subset of the standard fetch function type needed by tRPC internally.
20
- * @see fetch from lib.dom.d.ts
21
- * @remarks
22
- * If you need a property that you know exists but doesn't exist on this
23
- * interface, go ahead and add it.
24
- */
25
- export declare type FetchEsque = (input: RequestInfo | URL | string, init?: RequestInit | RequestInitEsque) => Promise<ResponseEsque>;
26
- /**
27
- * A simpler version of the native fetch function's type for packages with
28
- * their own fetch types, such as undici and node-fetch.
29
- */
30
- export declare type NativeFetchEsque = (url: string | URL, init?: NodeFetchRequestInitEsque) => Promise<ResponseEsque>;
31
- export interface NodeFetchRequestInitEsque {
32
- body?: string;
33
- }
34
- /**
35
- * A subset of the standard Headers properties needed by tRPC internally.
36
- * @see Headers from lib.dom.d.ts
37
- * @remarks
38
- * If you need a property that you know exists but doesn't exist on this
39
- * interface, go ahead and add it.
40
- */
41
- export interface HeadersEsque {
42
- append(name: string, value: string): void;
43
- delete(name: string): void;
44
- get(name: string): string | null;
45
- has(name: string): boolean;
46
- set(name: string, value: string): void;
47
- forEach(callbackfn: (value: string, key: string) => void, thisArg?: any): void;
48
- }
49
- export declare type ResponseType = 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect';
50
- /**
51
- * A subset of the standard RequestInit properties needed by tRPC internally.
52
- * @see RequestInit from lib.dom.d.ts
53
- * @remarks
54
- * If you need a property that you know exists but doesn't exist on this
55
- * interface, go ahead and add it.
56
- */
57
- export interface RequestInitEsque {
58
- /**
59
- * Sets the request's body.
60
- */
61
- body?: string | ReadableStream | FormData | null;
62
- /**
63
- * Sets the request's associated headers.
64
- */
65
- headers?: [string, string][] | Record<string, string>;
66
- /**
67
- * The request's HTTP-style method.
68
- */
69
- method?: string;
70
- /**
71
- * Sets the request's signal.
72
- */
73
- signal?: AbortSignal | null;
74
- }
75
- /**
76
- * A subset of the standard Response properties needed by tRPC internally.
77
- * @see Response from lib.dom.d.ts
78
- * @remarks
79
- * If you need a property that you know exists but doesn't exist on this
80
- * interface, go ahead and add it.
81
- */
82
- export interface ResponseEsque {
83
- readonly headers: HeadersEsque;
84
- readonly ok: boolean;
85
- readonly redirected: boolean;
86
- readonly status: number;
87
- readonly statusText: string;
88
- readonly type: ResponseType;
89
- readonly url: string;
90
- clone(): ResponseEsque;
91
- /**
92
- * @remarks
93
- * The built-in Response::json() method returns Promise<any>, but
94
- * that's not as type-safe as unknown. We use unknown because we're
95
- * more type-safe. You do want more type safety, right? 😉
96
- */
97
- json(): Promise<unknown>;
98
- }
99
- /**
100
- * @internal
101
- */
102
- export declare type NonEmptyArray<TItem> = [TItem, ...TItem[]];
1
+ export interface AbortControllerEsque {
2
+ new (): AbortControllerInstanceEsque;
3
+ }
4
+ /**
5
+ * Allows you to abort one or more requests.
6
+ */
7
+ export interface AbortControllerInstanceEsque {
8
+ /**
9
+ * The AbortSignal object associated with this object.
10
+ */
11
+ readonly signal: AbortSignal;
12
+ /**
13
+ * Sets this object's AbortSignal's aborted flag and signals to
14
+ * any observers that the associated activity is to be aborted.
15
+ */
16
+ abort(): void;
17
+ }
18
+ /**
19
+ * A subset of the standard fetch function type needed by tRPC internally.
20
+ * @see fetch from lib.dom.d.ts
21
+ * @remarks
22
+ * If you need a property that you know exists but doesn't exist on this
23
+ * interface, go ahead and add it.
24
+ */
25
+ export type FetchEsque = (input: RequestInfo | URL | string, init?: RequestInit | RequestInitEsque) => Promise<ResponseEsque>;
26
+ /**
27
+ * A simpler version of the native fetch function's type for packages with
28
+ * their own fetch types, such as undici and node-fetch.
29
+ */
30
+ export type NativeFetchEsque = (url: string | URL, init?: NodeFetchRequestInitEsque) => Promise<ResponseEsque>;
31
+ export interface NodeFetchRequestInitEsque {
32
+ body?: string;
33
+ }
34
+ /**
35
+ * A subset of the standard RequestInit properties needed by tRPC internally.
36
+ * @see RequestInit from lib.dom.d.ts
37
+ * @remarks
38
+ * If you need a property that you know exists but doesn't exist on this
39
+ * interface, go ahead and add it.
40
+ */
41
+ export interface RequestInitEsque {
42
+ /**
43
+ * Sets the request's body.
44
+ */
45
+ body?: string | ReadableStream | FormData | null;
46
+ /**
47
+ * Sets the request's associated headers.
48
+ */
49
+ headers?: [string, string][] | Record<string, string>;
50
+ /**
51
+ * The request's HTTP-style method.
52
+ */
53
+ method?: string;
54
+ /**
55
+ * Sets the request's signal.
56
+ */
57
+ signal?: AbortSignal | null;
58
+ }
59
+ /**
60
+ * A subset of the standard Response properties needed by tRPC internally.
61
+ * @see Response from lib.dom.d.ts
62
+ */
63
+ export interface ResponseEsque {
64
+ /**
65
+ * @remarks
66
+ * The built-in Response::json() method returns Promise<any>, but
67
+ * that's not as type-safe as unknown. We use unknown because we're
68
+ * more type-safe. You do want more type safety, right? 😉
69
+ */
70
+ json(): Promise<unknown>;
71
+ }
72
+ /**
73
+ * @internal
74
+ */
75
+ export type NonEmptyArray<TItem> = [TItem, ...TItem[]];
103
76
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/internals/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,4BAA4B,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;;;GAMG;AACH,oBAAY,UAAU,GAAG,CACvB,KAAK,EAAE,WAAW,GAAG,GAAG,GAAG,MAAM,EACjC,IAAI,CAAC,EAAE,WAAW,GAAG,gBAAgB,KAClC,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5B;;;GAGG;AACH,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,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,IAAI,CAAC;IAEjD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { AnyRouter } from '@trpc/server';
2
- import { TRPCLink } from './types';
3
- export declare function dedupeLink<TRouter extends AnyRouter = AnyRouter>(): TRPCLink<TRouter>;
1
+ import { AnyRouter } from '@trpc/server';
2
+ import { TRPCLink } from './types';
3
+ export declare function dedupeLink<TRouter extends AnyRouter = AnyRouter>(): TRPCLink<TRouter>;
4
4
  //# sourceMappingURL=dedupeLink.d.ts.map
@@ -1,16 +1,16 @@
1
- import { AnyRouter } from '@trpc/server';
2
- import { NonEmptyArray } from '../internals/types';
3
- import { HTTPLinkBaseOptions } from './internals/httpUtils';
4
- import { HTTPHeaders, Operation, TRPCLink } from './types';
5
- export interface HttpBatchLinkOptions extends HTTPLinkBaseOptions {
6
- maxURLLength?: number;
7
- /**
8
- * Headers to be set on outgoing requests or a callback that of said headers
9
- * @link http://trpc.io/docs/client/headers
10
- */
11
- headers?: HTTPHeaders | ((opts: {
12
- opList: NonEmptyArray<Operation>;
13
- }) => HTTPHeaders | Promise<HTTPHeaders>);
14
- }
15
- export declare function httpBatchLink<TRouter extends AnyRouter>(opts: HttpBatchLinkOptions): TRPCLink<TRouter>;
1
+ import { AnyRouter } from '@trpc/server';
2
+ import { NonEmptyArray } from '../internals/types';
3
+ import { HTTPLinkBaseOptions } from './internals/httpUtils';
4
+ import { HTTPHeaders, Operation, TRPCLink } from './types';
5
+ export interface HttpBatchLinkOptions extends HTTPLinkBaseOptions {
6
+ maxURLLength?: number;
7
+ /**
8
+ * Headers to be set on outgoing requests or a callback that of said headers
9
+ * @link http://trpc.io/docs/client/headers
10
+ */
11
+ headers?: HTTPHeaders | ((opts: {
12
+ opList: NonEmptyArray<Operation>;
13
+ }) => HTTPHeaders | Promise<HTTPHeaders>);
14
+ }
15
+ export declare function httpBatchLink<TRouter extends AnyRouter>(opts: HttpBatchLinkOptions): TRPCLink<TRouter>;
16
16
  //# sourceMappingURL=httpBatchLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"httpBatchLink.d.ts","sourceRoot":"","sources":["../../src/links/httpBatchLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACL,mBAAmB,EAKpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EACJ,WAAW,GACX,CAAC,CAAC,IAAI,EAAE;QACN,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KAClC,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,OAAO,SAAS,SAAS,EACrD,IAAI,EAAE,oBAAoB,GACzB,QAAQ,CAAC,OAAO,CAAC,CA2GnB"}
1
+ {"version":3,"file":"httpBatchLink.d.ts","sourceRoot":"","sources":["../../src/links/httpBatchLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAEL,mBAAmB,EAIpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EACJ,WAAW,GACX,CAAC,CAAC,IAAI,EAAE;QACN,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;KAClC,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CAC/C;AAED,wBAAgB,aAAa,CAAC,OAAO,SAAS,SAAS,EACrD,IAAI,EAAE,oBAAoB,GACzB,QAAQ,CAAC,OAAO,CAAC,CA2GnB"}
@@ -1,2 +1,2 @@
1
- export declare const experimental_formDataLink: <TRouter extends import("@trpc/server").AnyRouter>(opts: import("./httpLink").HTTPLinkOptions) => import("./types").TRPCLink<TRouter>;
1
+ export declare const experimental_formDataLink: <TRouter extends import("@trpc/server").AnyRouter>(opts: import("./httpLink").HTTPLinkOptions) => import("./types").TRPCLink<TRouter>;
2
2
  //# sourceMappingURL=httpFormDataLink.d.ts.map
@@ -1,17 +1,17 @@
1
- import { AnyRouter } from '@trpc/server';
2
- import { HTTPLinkBaseOptions, Requester } from './internals/httpUtils';
3
- import { HTTPHeaders, Operation, TRPCLink } from './types';
4
- export interface HTTPLinkOptions extends HTTPLinkBaseOptions {
5
- /**
6
- * Headers to be set on outgoing requests or a callback that of said headers
7
- * @link http://trpc.io/docs/client/headers
8
- */
9
- headers?: HTTPHeaders | ((opts: {
10
- op: Operation;
11
- }) => HTTPHeaders | Promise<HTTPHeaders>);
12
- }
13
- export declare function httpLinkFactory(factoryOpts: {
14
- requester: Requester;
15
- }): <TRouter extends AnyRouter>(opts: HTTPLinkOptions) => TRPCLink<TRouter>;
16
- export declare const httpLink: <TRouter extends AnyRouter>(opts: HTTPLinkOptions) => TRPCLink<TRouter>;
1
+ import { AnyRouter } from '@trpc/server';
2
+ import { HTTPLinkBaseOptions, Requester } from './internals/httpUtils';
3
+ import { HTTPHeaders, Operation, TRPCLink } from './types';
4
+ export interface HTTPLinkOptions extends HTTPLinkBaseOptions {
5
+ /**
6
+ * Headers to be set on outgoing requests or a callback that of said headers
7
+ * @link http://trpc.io/docs/client/headers
8
+ */
9
+ headers?: HTTPHeaders | ((opts: {
10
+ op: Operation;
11
+ }) => HTTPHeaders | Promise<HTTPHeaders>);
12
+ }
13
+ export declare function httpLinkFactory(factoryOpts: {
14
+ requester: Requester;
15
+ }): <TRouter extends AnyRouter>(opts: HTTPLinkOptions) => TRPCLink<TRouter>;
16
+ export declare const httpLink: <TRouter extends AnyRouter>(opts: HTTPLinkOptions) => TRPCLink<TRouter>;
17
17
  //# sourceMappingURL=httpLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"httpLink.d.ts","sourceRoot":"","sources":["../../src/links/httpLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,EACL,mBAAmB,EACnB,SAAS,EAGV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;;OAGG;IACH,OAAO,CAAC,EACJ,WAAW,GACX,CAAC,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,SAAS,CAAA;KAAE,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CACvE;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,qCAE3D,eAAe,uBAmDxB;AAED,eAAO,MAAM,QAAQ,oCArDX,eAAe,sBAqDgD,CAAC"}
1
+ {"version":3,"file":"httpLink.d.ts","sourceRoot":"","sources":["../../src/links/httpLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,EACL,mBAAmB,EAEnB,SAAS,EAEV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D;;;OAGG;IACH,OAAO,CAAC,EACJ,WAAW,GACX,CAAC,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,SAAS,CAAA;KAAE,KAAK,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CACvE;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,qCAE3D,eAAe,uBAmDxB;AAED,eAAO,MAAM,QAAQ,oCArDX,eAAe,sBAqDgD,CAAC"}
@@ -1,8 +1,8 @@
1
- export * from './types';
2
- export * from './httpBatchLink';
3
- export * from './httpLink';
4
- export * from './loggerLink';
5
- export * from './splitLink';
6
- export * from './wsLink';
7
- export * from './httpFormDataLink';
1
+ export * from './types';
2
+ export * from './httpBatchLink';
3
+ export * from './httpLink';
4
+ export * from './loggerLink';
5
+ export * from './splitLink';
6
+ export * from './wsLink';
7
+ export * from './httpFormDataLink';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,8 @@
1
- import { AnyRouter } from '@trpc/server';
2
- import { Operation, OperationLink, OperationResultObservable } from '../types';
3
- /** @internal */
4
- export declare function createChain<TRouter extends AnyRouter, TInput = unknown, TOutput = unknown>(opts: {
5
- links: OperationLink<TRouter, TInput, TOutput>[];
6
- op: Operation<TInput>;
7
- }): OperationResultObservable<TRouter, TOutput>;
1
+ import { AnyRouter } from '@trpc/server';
2
+ import { Operation, OperationLink, OperationResultObservable } from '../types';
3
+ /** @internal */
4
+ export declare function createChain<TRouter extends AnyRouter, TInput = unknown, TOutput = unknown>(opts: {
5
+ links: OperationLink<TRouter, TInput, TOutput>[];
6
+ op: Operation<TInput>;
7
+ }): OperationResultObservable<TRouter, TOutput>;
8
8
  //# sourceMappingURL=createChain.d.ts.map
@@ -1,60 +1,60 @@
1
- import { ProcedureType } from '@trpc/server';
2
- import { TRPCResponse } from '@trpc/server/rpc';
3
- import { AbortControllerEsque, FetchEsque, RequestInitEsque, ResponseEsque } from '../../internals/types';
4
- import { HTTPHeaders, PromiseAndCancel, TRPCClientRuntime } from '../types';
5
- /**
6
- * @internal
7
- */
8
- export interface HTTPLinkBaseOptions {
9
- url: string;
10
- /**
11
- * Add ponyfill for fetch
12
- */
13
- fetch?: FetchEsque;
14
- /**
15
- * Add ponyfill for AbortController
16
- */
17
- AbortController?: AbortControllerEsque | null;
18
- }
19
- export interface ResolvedHTTPLinkOptions {
20
- url: string;
21
- fetch: FetchEsque;
22
- AbortController: AbortControllerEsque | null;
23
- }
24
- export declare function resolveHTTPLinkOptions(opts: HTTPLinkBaseOptions): ResolvedHTTPLinkOptions;
25
- export interface HTTPResult {
26
- json: TRPCResponse;
27
- meta: {
28
- response: ResponseEsque;
29
- };
30
- }
31
- declare type GetInputOptions = {
32
- runtime: TRPCClientRuntime;
33
- } & ({
34
- inputs: unknown[];
35
- } | {
36
- input: unknown;
37
- });
38
- export declare type HTTPBaseRequestOptions = ResolvedHTTPLinkOptions & GetInputOptions & {
39
- type: ProcedureType;
40
- path: string;
41
- };
42
- export declare type GetUrl = (opts: HTTPBaseRequestOptions) => string;
43
- export declare type GetBody = (opts: HTTPBaseRequestOptions) => RequestInitEsque['body'];
44
- export declare type ContentOptions = {
45
- contentTypeHeader?: string;
46
- getUrl: GetUrl;
47
- getBody: GetBody;
48
- };
49
- export declare const getUrl: GetUrl;
50
- export declare const getBody: GetBody;
51
- export declare type Requester = (opts: HTTPBaseRequestOptions & {
52
- headers: () => HTTPHeaders | Promise<HTTPHeaders>;
53
- }) => PromiseAndCancel<HTTPResult>;
54
- export declare const jsonHttpRequester: Requester;
55
- export declare type HTTPRequestOptions = HTTPBaseRequestOptions & ContentOptions & {
56
- headers: () => HTTPHeaders | Promise<HTTPHeaders>;
57
- };
58
- export declare function httpRequest(opts: HTTPRequestOptions): PromiseAndCancel<HTTPResult>;
59
- export {};
1
+ import { ProcedureType } from '@trpc/server';
2
+ import { TRPCResponse } from '@trpc/server/rpc';
3
+ import { AbortControllerEsque, FetchEsque, RequestInitEsque, ResponseEsque } from '../../internals/types';
4
+ import { HTTPHeaders, PromiseAndCancel, TRPCClientRuntime } from '../types';
5
+ /**
6
+ * @internal
7
+ */
8
+ export interface HTTPLinkBaseOptions {
9
+ url: string;
10
+ /**
11
+ * Add ponyfill for fetch
12
+ */
13
+ fetch?: FetchEsque;
14
+ /**
15
+ * Add ponyfill for AbortController
16
+ */
17
+ AbortController?: AbortControllerEsque | null;
18
+ }
19
+ export interface ResolvedHTTPLinkOptions {
20
+ url: string;
21
+ fetch: FetchEsque;
22
+ AbortController: AbortControllerEsque | null;
23
+ }
24
+ export declare function resolveHTTPLinkOptions(opts: HTTPLinkBaseOptions): ResolvedHTTPLinkOptions;
25
+ export interface HTTPResult {
26
+ json: TRPCResponse;
27
+ meta: {
28
+ response: ResponseEsque;
29
+ };
30
+ }
31
+ type GetInputOptions = {
32
+ runtime: TRPCClientRuntime;
33
+ } & ({
34
+ inputs: unknown[];
35
+ } | {
36
+ input: unknown;
37
+ });
38
+ export type HTTPBaseRequestOptions = ResolvedHTTPLinkOptions & GetInputOptions & {
39
+ type: ProcedureType;
40
+ path: string;
41
+ };
42
+ export type GetUrl = (opts: HTTPBaseRequestOptions) => string;
43
+ export type GetBody = (opts: HTTPBaseRequestOptions) => RequestInitEsque['body'];
44
+ export type ContentOptions = {
45
+ contentTypeHeader?: string;
46
+ getUrl: GetUrl;
47
+ getBody: GetBody;
48
+ };
49
+ export declare const getUrl: GetUrl;
50
+ export declare const getBody: GetBody;
51
+ export type Requester = (opts: HTTPBaseRequestOptions & {
52
+ headers: () => HTTPHeaders | Promise<HTTPHeaders>;
53
+ }) => PromiseAndCancel<HTTPResult>;
54
+ export declare const jsonHttpRequester: Requester;
55
+ export type HTTPRequestOptions = HTTPBaseRequestOptions & ContentOptions & {
56
+ headers: () => HTTPHeaders | Promise<HTTPHeaders>;
57
+ };
58
+ export declare function httpRequest(opts: HTTPRequestOptions): PromiseAndCancel<HTTPResult>;
59
+ export {};
60
60
  //# sourceMappingURL=httpUtils.d.ts.map