@trpc/client 11.0.0-next-alpha.152 → 11.0.0-next-alpha.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{TRPCClientError-c88f4205.js → TRPCClientError-27d80214.js} +1 -2
- package/dist/{TRPCClientError-2ec26a15.mjs → TRPCClientError-3414c3d5.mjs} +1 -2
- package/dist/{TRPCClientError-848288ef.js → TRPCClientError-67aefe1c.js} +3 -4
- package/dist/TRPCClientError.d.ts +2 -4
- package/dist/TRPCClientError.d.ts.map +1 -1
- package/dist/bundle-analysis.json +61 -76
- package/dist/createTRPCClient.d.ts +3 -4
- package/dist/createTRPCClient.d.ts.map +1 -1
- package/dist/createTRPCUntypedClient.d.ts +1 -1
- package/dist/createTRPCUntypedClient.d.ts.map +1 -1
- package/dist/{httpBatchLink-865a32d4.js → httpBatchLink-4653e4a1.js} +4 -4
- package/dist/{httpBatchLink-35588380.mjs → httpBatchLink-a1f60db9.mjs} +4 -4
- package/dist/{httpBatchLink-32dfcf36.js → httpBatchLink-f7c51d58.js} +4 -4
- package/dist/{httpUtils-7ea72426.js → httpUtils-49fa3edc.js} +1 -1
- package/dist/{httpUtils-85f06c75.js → httpUtils-60af4c3d.js} +1 -1
- package/dist/{httpUtils-e82f7939.mjs → httpUtils-82ae6a64.mjs} +1 -1
- package/dist/index.js +18 -19
- package/dist/index.mjs +21 -22
- package/dist/internals/TRPCUntypedClient.d.ts +2 -2
- package/dist/internals/TRPCUntypedClient.d.ts.map +1 -1
- package/dist/internals/getAbortController.d.ts +1 -1
- package/dist/internals/getAbortController.d.ts.map +1 -1
- package/dist/links/httpBatchLink.d.ts +1 -1
- package/dist/links/httpBatchLink.d.ts.map +1 -1
- package/dist/links/httpBatchLink.js +6 -6
- package/dist/links/httpBatchLink.mjs +6 -6
- package/dist/links/httpBatchStreamLink.d.ts +1 -1
- package/dist/links/httpBatchStreamLink.d.ts.map +1 -1
- package/dist/links/httpFormDataLink.d.ts +1 -1
- package/dist/links/httpFormDataLink.d.ts.map +1 -1
- package/dist/links/httpLink.d.ts +1 -1
- package/dist/links/httpLink.d.ts.map +1 -1
- package/dist/links/httpLink.js +5 -5
- package/dist/links/httpLink.mjs +5 -5
- package/dist/links/internals/createChain.d.ts +1 -1
- package/dist/links/internals/createChain.d.ts.map +1 -1
- package/dist/links/internals/createHTTPBatchLink.d.ts +1 -1
- package/dist/links/internals/createHTTPBatchLink.d.ts.map +1 -1
- package/dist/links/internals/dedupeLink.d.ts +1 -1
- package/dist/links/internals/dedupeLink.d.ts.map +1 -1
- package/dist/links/internals/httpUtils.d.ts +4 -4
- package/dist/links/internals/httpUtils.d.ts.map +1 -1
- package/dist/links/internals/retryLink.d.ts +1 -1
- package/dist/links/internals/retryLink.d.ts.map +1 -1
- package/dist/links/loggerLink.d.ts +2 -2
- package/dist/links/loggerLink.d.ts.map +1 -1
- package/dist/links/loggerLink.js +1 -1
- package/dist/links/loggerLink.mjs +1 -1
- package/dist/links/splitLink.d.ts +1 -1
- package/dist/links/splitLink.d.ts.map +1 -1
- package/dist/links/splitLink.js +2 -2
- package/dist/links/splitLink.mjs +2 -2
- package/dist/links/types.d.ts +3 -3
- package/dist/links/types.d.ts.map +1 -1
- package/dist/links/wsLink.d.ts +3 -4
- package/dist/links/wsLink.d.ts.map +1 -1
- package/dist/links/wsLink.js +4 -4
- package/dist/links/wsLink.mjs +4 -4
- package/dist/shared/index.js +2 -1
- package/dist/shared/index.mjs +2 -1
- package/dist/shared/transformResult.d.ts +6 -4
- package/dist/shared/transformResult.d.ts.map +1 -1
- package/dist/{splitLink-4c75f7be.mjs → splitLink-13989f7f.mjs} +1 -1
- package/dist/{splitLink-f29e84be.js → splitLink-18238436.js} +1 -1
- package/dist/{splitLink-0df96fdc.js → splitLink-bd4bf809.js} +1 -1
- package/dist/{transformResult-db438b36.js → transformResult-150436c9.js} +3 -7
- package/dist/{transformResult-15ae4dcc.js → transformResult-c388d1ca.js} +2 -5
- package/dist/{transformResult-c5af197e.mjs → transformResult-e5b21a85.mjs} +2 -5
- package/package.json +13 -14
- package/src/TRPCClientError.ts +5 -5
- package/src/createTRPCClient.ts +4 -4
- package/src/createTRPCUntypedClient.ts +1 -1
- package/src/internals/TRPCUntypedClient.ts +2 -2
- package/src/internals/getAbortController.ts +1 -1
- package/src/links/httpFormDataLink.ts +10 -12
- package/src/links/httpLink.ts +2 -2
- package/src/links/internals/createChain.ts +2 -2
- package/src/links/internals/createHTTPBatchLink.ts +2 -2
- package/src/links/internals/dedupeLink.ts +2 -2
- package/src/links/internals/httpUtils.ts +4 -7
- package/src/links/internals/parseJSONStream.ts +1 -1
- package/src/links/internals/retryLink.ts +2 -2
- package/src/links/loggerLink.ts +3 -3
- package/src/links/splitLink.ts +2 -2
- package/src/links/types.ts +3 -3
- package/src/links/wsLink.ts +8 -4
- package/src/shared/transformResult.ts +2 -3
- package/dist/internals/isObject.d.ts +0 -2
- package/dist/internals/isObject.d.ts.map +0 -1
- package/src/internals/isObject.ts +0 -4
package/src/createTRPCClient.ts
CHANGED
|
@@ -9,15 +9,15 @@ import type {
|
|
|
9
9
|
ProcedureArgs,
|
|
10
10
|
ProcedureRouterRecord,
|
|
11
11
|
ProcedureType,
|
|
12
|
-
} from '@trpc/
|
|
13
|
-
import type { Unsubscribable } from '@trpc/server/observable';
|
|
12
|
+
} from '@trpc/core';
|
|
14
13
|
import {
|
|
15
14
|
createFlatProxy,
|
|
16
15
|
createRecursiveProxy,
|
|
17
16
|
inferTransformedProcedureOutput,
|
|
18
17
|
inferTransformedSubscriptionOutput,
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
IntersectionError,
|
|
19
|
+
} from '@trpc/core';
|
|
20
|
+
import type { Unsubscribable } from '@trpc/core/observable';
|
|
21
21
|
import { CreateTRPCClientOptions } from './createTRPCUntypedClient';
|
|
22
22
|
import {
|
|
23
23
|
TRPCSubscriptionObserver,
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
CombinedDataTransformer,
|
|
4
4
|
DataTransformerOptions,
|
|
5
5
|
DefaultDataTransformer,
|
|
6
|
-
} from '@trpc/
|
|
6
|
+
} from '@trpc/core';
|
|
7
7
|
import {
|
|
8
8
|
inferObservableValue,
|
|
9
9
|
observableToPromise,
|
|
10
10
|
share,
|
|
11
11
|
Unsubscribable,
|
|
12
|
-
} from '@trpc/
|
|
12
|
+
} from '@trpc/core/observable';
|
|
13
13
|
import { createChain } from '../links/internals/createChain';
|
|
14
14
|
import {
|
|
15
15
|
OperationContext,
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { httpLinkFactory } from './httpLink';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const getBody: GetBody = (opts) => {
|
|
5
|
-
if (!('input' in opts)) {
|
|
6
|
-
return undefined;
|
|
7
|
-
}
|
|
8
|
-
if (!(opts.input instanceof FormData)) {
|
|
9
|
-
throw new Error('Input is not FormData');
|
|
10
|
-
}
|
|
11
|
-
return opts.input;
|
|
12
|
-
};
|
|
2
|
+
import { httpRequest, Requester } from './internals/httpUtils';
|
|
13
3
|
|
|
14
4
|
const formDataRequester: Requester = (opts) => {
|
|
15
5
|
if (opts.type !== 'mutation') {
|
|
@@ -21,7 +11,15 @@ const formDataRequester: Requester = (opts) => {
|
|
|
21
11
|
getUrl() {
|
|
22
12
|
return `${opts.url}/${opts.path}`;
|
|
23
13
|
},
|
|
24
|
-
getBody
|
|
14
|
+
getBody(opts) {
|
|
15
|
+
if (!('input' in opts)) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
if (!(opts.input instanceof FormData)) {
|
|
19
|
+
throw new Error('Input is not FormData');
|
|
20
|
+
}
|
|
21
|
+
return opts.input;
|
|
22
|
+
},
|
|
25
23
|
});
|
|
26
24
|
};
|
|
27
25
|
|
package/src/links/httpLink.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/
|
|
2
|
-
import { observable } from '@trpc/
|
|
1
|
+
import { AnyRouter } from '@trpc/core';
|
|
2
|
+
import { observable } from '@trpc/core/observable';
|
|
3
3
|
import { transformResult } from '../shared/transformResult';
|
|
4
4
|
import { TRPCClientError } from '../TRPCClientError';
|
|
5
5
|
import {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/
|
|
2
|
-
import { observable } from '@trpc/
|
|
1
|
+
import { AnyRouter } from '@trpc/core';
|
|
2
|
+
import { observable } from '@trpc/core/observable';
|
|
3
3
|
import { Operation, OperationLink, OperationResultObservable } from '../types';
|
|
4
4
|
|
|
5
5
|
/** @internal */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyRouter, ProcedureType } from '@trpc/
|
|
2
|
-
import { observable } from '@trpc/
|
|
1
|
+
import { AnyRouter, ProcedureType } from '@trpc/core';
|
|
2
|
+
import { observable } from '@trpc/core/observable';
|
|
3
3
|
import { dataLoader } from '../../internals/dataLoader';
|
|
4
4
|
import { transformResult } from '../../shared/transformResult';
|
|
5
5
|
import { TRPCClientError } from '../../TRPCClientError';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* istanbul ignore file -- @preserve */
|
|
2
2
|
// We're not actually exporting this link
|
|
3
|
-
import { AnyRouter } from '@trpc/
|
|
4
|
-
import { Observable, observable, share } from '@trpc/
|
|
3
|
+
import { AnyRouter } from '@trpc/core';
|
|
4
|
+
import { Observable, observable, share } from '@trpc/core/observable';
|
|
5
5
|
import { TRPCLink } from '../types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ProcedureType } from '@trpc/
|
|
2
|
-
import { TRPCResponse } from '@trpc/
|
|
1
|
+
import { ProcedureType } from '@trpc/core';
|
|
2
|
+
import { TRPCResponse } from '@trpc/core/rpc';
|
|
3
3
|
import { getFetch } from '../../getFetch';
|
|
4
4
|
import { getAbortController } from '../../internals/getAbortController';
|
|
5
5
|
import {
|
|
@@ -85,11 +85,8 @@ export type HTTPBaseRequestOptions = GetInputOptions &
|
|
|
85
85
|
path: string;
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
opts: HTTPBaseRequestOptions,
|
|
91
|
-
) => RequestInitEsque['body'];
|
|
92
|
-
|
|
88
|
+
type GetUrl = (opts: HTTPBaseRequestOptions) => string;
|
|
89
|
+
type GetBody = (opts: HTTPBaseRequestOptions) => RequestInitEsque['body'];
|
|
93
90
|
export type ContentOptions = {
|
|
94
91
|
batchModeHeader?: 'stream';
|
|
95
92
|
contentTypeHeader?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Stream parsing adapted from https://www.loginradius.com/blog/engineering/guest-post/http-streaming-with-nodejs-and-fetch-api/
|
|
2
|
-
import { TRPCResponse } from '@trpc/
|
|
2
|
+
import { TRPCResponse } from '@trpc/core/rpc';
|
|
3
3
|
import { WebReadableStreamEsque } from '../../internals/types';
|
|
4
4
|
import { HTTPHeaders } from '../types';
|
|
5
5
|
import {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* istanbul ignore file -- @preserve */
|
|
2
2
|
// We're not actually exporting this link
|
|
3
|
-
import { AnyRouter } from '@trpc/
|
|
4
|
-
import { observable, Unsubscribable } from '@trpc/
|
|
3
|
+
import { AnyRouter } from '@trpc/core';
|
|
4
|
+
import { observable, Unsubscribable } from '@trpc/core/observable';
|
|
5
5
|
import { TRPCLink } from '../types';
|
|
6
6
|
|
|
7
7
|
/**
|
package/src/links/loggerLink.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
// Using triple-slash directive makes sure that it will be available,
|
|
6
6
|
// even if end-user `tsconfig.json` omits it in the `lib` array.
|
|
7
7
|
|
|
8
|
-
import { AnyRouter } from '@trpc/
|
|
9
|
-
import { observable, tap } from '@trpc/
|
|
10
|
-
import { TRPCClientError } from '
|
|
8
|
+
import { AnyRouter } from '@trpc/core';
|
|
9
|
+
import { observable, tap } from '@trpc/core/observable';
|
|
10
|
+
import { TRPCClientError } from '../TRPCClientError';
|
|
11
11
|
import { Operation, OperationResultEnvelope, TRPCLink } from './types';
|
|
12
12
|
|
|
13
13
|
type ConsoleEsque = {
|
package/src/links/splitLink.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyRouter } from '@trpc/
|
|
2
|
-
import { observable } from '@trpc/
|
|
1
|
+
import { AnyRouter } from '@trpc/core';
|
|
2
|
+
import { observable } from '@trpc/core/observable';
|
|
3
3
|
import { createChain } from './internals/createChain';
|
|
4
4
|
import { Operation, TRPCLink } from './types';
|
|
5
5
|
|
package/src/links/types.ts
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
AnyRouter,
|
|
3
3
|
CombinedDataTransformer,
|
|
4
4
|
DataTransformer,
|
|
5
|
-
} from '@trpc/
|
|
6
|
-
import { Observable, Observer } from '@trpc/
|
|
7
|
-
import { TRPCResultMessage, TRPCSuccessResponse } from '@trpc/
|
|
5
|
+
} from '@trpc/core';
|
|
6
|
+
import { Observable, Observer } from '@trpc/core/observable';
|
|
7
|
+
import { TRPCResultMessage, TRPCSuccessResponse } from '@trpc/core/rpc';
|
|
8
8
|
import { ResponseEsque } from '../internals/types';
|
|
9
9
|
import { TRPCClientError } from '../TRPCClientError';
|
|
10
10
|
|
package/src/links/wsLink.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
AnyRouter,
|
|
3
|
+
inferRouterError,
|
|
4
|
+
MaybePromise,
|
|
5
|
+
ProcedureType,
|
|
6
|
+
} from '@trpc/core';
|
|
7
|
+
import { observable, Observer, UnsubscribeFn } from '@trpc/core/observable';
|
|
3
8
|
import {
|
|
4
9
|
TRPCClientIncomingMessage,
|
|
5
10
|
TRPCClientIncomingRequest,
|
|
6
11
|
TRPCClientOutgoingMessage,
|
|
7
12
|
TRPCRequestMessage,
|
|
8
13
|
TRPCResponseMessage,
|
|
9
|
-
} from '@trpc/
|
|
10
|
-
import { MaybePromise } from '@trpc/server/unstableInternalsExport';
|
|
14
|
+
} from '@trpc/core/rpc';
|
|
11
15
|
import { transformResult } from '../shared/transformResult';
|
|
12
16
|
import { TRPCClientError } from '../TRPCClientError';
|
|
13
17
|
import { Operation, TRPCLink } from './types';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { isObject, type AnyRouter, type inferRouterError } from '@trpc/core';
|
|
2
2
|
import type {
|
|
3
3
|
TRPCResponse,
|
|
4
4
|
TRPCResponseMessage,
|
|
5
5
|
TRPCResultMessage,
|
|
6
|
-
} from '@trpc/
|
|
7
|
-
import { isObject } from '../internals/isObject';
|
|
6
|
+
} from '@trpc/core/rpc';
|
|
8
7
|
import type { TRPCClientRuntime } from '../links';
|
|
9
8
|
|
|
10
9
|
// FIXME:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isObject.d.ts","sourceRoot":"","sources":["../../src/internals/isObject.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGzE"}
|