@nmtjs/client 0.14.3 → 0.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/types.d.ts +10 -3
  2. package/package.json +9 -9
package/dist/types.d.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  import type { CallTypeProvider, OneOf, TypeProvider } from '@nmtjs/common';
2
2
  import type { TAnyAPIContract, TAnyProcedureContract, TAnyRouterContract } from '@nmtjs/contract';
3
- import type { ProtocolBaseClientCallOptions, ProtocolError, ProtocolServerStreamInterface } from '@nmtjs/protocol/client';
3
+ import type { ProtocolBlobInterface } from '@nmtjs/protocol';
4
+ import type { ProtocolBaseClientCallOptions, ProtocolError, ProtocolServerBlobStream, ProtocolServerStreamInterface } from '@nmtjs/protocol/client';
4
5
  import type { BaseTypeAny, t } from '@nmtjs/type';
6
+ import type { PlainType } from '@nmtjs/type/_plain';
7
+ export type ClientOutputType<T> = T extends ProtocolBlobInterface ? ProtocolServerBlobStream : T extends {
8
+ [PlainType]?: true;
9
+ } ? {
10
+ [K in keyof Omit<T, PlainType>]: ClientOutputType<T[K]>;
11
+ } : T;
5
12
  export interface StaticInputContractTypeProvider extends TypeProvider {
6
13
  output: this['input'] extends BaseTypeAny ? t.infer.decode.input<this['input']> : never;
7
14
  }
@@ -9,10 +16,10 @@ export interface RuntimeInputContractTypeProvider extends TypeProvider {
9
16
  output: this['input'] extends BaseTypeAny ? t.infer.encode.input<this['input']> : never;
10
17
  }
11
18
  export interface StaticOutputContractTypeProvider extends TypeProvider {
12
- output: this['input'] extends BaseTypeAny ? t.infer.encode.output<this['input']> : never;
19
+ output: this['input'] extends BaseTypeAny ? ClientOutputType<t.infer.encodeRaw.output<this['input']>> : never;
13
20
  }
14
21
  export interface RuntimeOutputContractTypeProvider extends TypeProvider {
15
- output: this['input'] extends BaseTypeAny ? t.infer.decode.output<this['input']> : never;
22
+ output: this['input'] extends BaseTypeAny ? ClientOutputType<t.infer.decodeRaw.output<this['input']>> : never;
16
23
  }
17
24
  export type AnyResolvedAPIContractProcedure = {
18
25
  contract: TAnyProcedureContract;
package/package.json CHANGED
@@ -19,23 +19,23 @@
19
19
  }
20
20
  },
21
21
  "peerDependencies": {
22
- "@nmtjs/type": "0.14.3",
23
- "@nmtjs/contract": "0.14.3",
24
- "@nmtjs/protocol": "0.14.3",
25
- "@nmtjs/common": "0.14.3"
22
+ "@nmtjs/type": "0.14.5",
23
+ "@nmtjs/common": "0.14.5",
24
+ "@nmtjs/protocol": "0.14.5",
25
+ "@nmtjs/contract": "0.14.5"
26
26
  },
27
27
  "devDependencies": {
28
- "@nmtjs/type": "0.14.3",
29
- "@nmtjs/contract": "0.14.3",
30
- "@nmtjs/common": "0.14.3",
31
- "@nmtjs/protocol": "0.14.3"
28
+ "@nmtjs/type": "0.14.5",
29
+ "@nmtjs/contract": "0.14.5",
30
+ "@nmtjs/common": "0.14.5",
31
+ "@nmtjs/protocol": "0.14.5"
32
32
  },
33
33
  "files": [
34
34
  "dist",
35
35
  "LICENSE.md",
36
36
  "README.md"
37
37
  ],
38
- "version": "0.14.3",
38
+ "version": "0.14.5",
39
39
  "scripts": {
40
40
  "build": "tsc",
41
41
  "type-check": "tsc --noEmit"