@nmtjs/client 0.14.0 → 0.14.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 (2) hide show
  1. package/dist/types.d.ts +9 -9
  2. package/package.json +9 -9
package/dist/types.d.ts CHANGED
@@ -1,18 +1,18 @@
1
1
  import type { CallTypeProvider, OneOf, TypeProvider } from '@nmtjs/common';
2
2
  import type { TAnyAPIContract, TAnyProcedureContract, TAnyRouterContract } from '@nmtjs/contract';
3
- import type { InputType, OutputType, ProtocolBaseClientCallOptions, ProtocolError, ProtocolServerStreamInterface } from '@nmtjs/protocol/client';
3
+ import type { ProtocolBaseClientCallOptions, ProtocolError, ProtocolServerStreamInterface } from '@nmtjs/protocol/client';
4
4
  import type { BaseTypeAny, t } from '@nmtjs/type';
5
5
  export interface StaticInputContractTypeProvider extends TypeProvider {
6
- output: this['input'] extends BaseTypeAny ? t.infer.encoded.input<this['input']> : never;
6
+ output: this['input'] extends BaseTypeAny ? t.infer.decode.input<this['input']> : never;
7
7
  }
8
8
  export interface RuntimeInputContractTypeProvider extends TypeProvider {
9
- output: this['input'] extends BaseTypeAny ? t.infer.decoded.input<this['input']> : never;
9
+ output: this['input'] extends BaseTypeAny ? t.infer.encode.input<this['input']> : never;
10
10
  }
11
11
  export interface StaticOutputContractTypeProvider extends TypeProvider {
12
- output: this['input'] extends BaseTypeAny ? t.infer.encoded.output<this['input']> : never;
12
+ output: this['input'] extends BaseTypeAny ? t.infer.encode.output<this['input']> : never;
13
13
  }
14
14
  export interface RuntimeOutputContractTypeProvider extends TypeProvider {
15
- output: this['input'] extends BaseTypeAny ? t.infer.decoded.output<this['input']> : never;
15
+ output: this['input'] extends BaseTypeAny ? t.infer.decode.output<this['input']> : never;
16
16
  }
17
17
  export type AnyResolvedAPIContractProcedure = {
18
18
  contract: TAnyProcedureContract;
@@ -30,15 +30,15 @@ export type ResolveAPIRouterRoutes<T extends TAnyRouterContract, InputTypeProvid
30
30
  routes: ResolveAPIRouterRoutes<T['routes'][K], InputTypeProvider, OutputTypeProvider>;
31
31
  } : T['routes'][K] extends TAnyProcedureContract ? {
32
32
  contract: T['routes'][K];
33
- input: InputType<CallTypeProvider<InputTypeProvider, T['routes'][K]['input']>>;
34
- output: T['routes'][K]['stream'] extends undefined | t.NeverType ? OutputType<CallTypeProvider<OutputTypeProvider, T['routes'][K]['output']>> : {
35
- result: OutputType<CallTypeProvider<OutputTypeProvider, T['routes'][K]['output']>>;
33
+ input: CallTypeProvider<InputTypeProvider, T['routes'][K]['input']>;
34
+ output: T['routes'][K]['stream'] extends undefined | t.NeverType ? CallTypeProvider<OutputTypeProvider, T['routes'][K]['output']> : {
35
+ result: CallTypeProvider<OutputTypeProvider, T['routes'][K]['output']>;
36
36
  stream: ProtocolServerStreamInterface<CallTypeProvider<OutputTypeProvider, T['routes'][K]['stream']>>;
37
37
  };
38
38
  } : never;
39
39
  };
40
40
  export type ResolveAPIContract<C extends TAnyAPIContract = TAnyAPIContract, InputTypeProvider extends TypeProvider = TypeProvider, OutputTypeProvider extends TypeProvider = TypeProvider> = ResolveAPIRouterRoutes<C['router'], InputTypeProvider, OutputTypeProvider>;
41
- export type ClientCaller<Procedure extends AnyResolvedAPIContractProcedure, SafeCall extends boolean> = (...args: Procedure['input'] extends t.NeverType ? [data?: undefined, options?: Partial<ProtocolBaseClientCallOptions>] : undefined extends t.infer.encoded.input<Procedure['contract']['input']> ? [
41
+ export type ClientCaller<Procedure extends AnyResolvedAPIContractProcedure, SafeCall extends boolean> = (...args: Procedure['input'] extends t.NeverType ? [data?: undefined, options?: Partial<ProtocolBaseClientCallOptions>] : undefined extends t.infer.encode.input<Procedure['contract']['input']> ? [
42
42
  data?: Procedure['input'],
43
43
  options?: Partial<ProtocolBaseClientCallOptions>
44
44
  ] : [
package/package.json CHANGED
@@ -19,23 +19,23 @@
19
19
  }
20
20
  },
21
21
  "peerDependencies": {
22
- "@nmtjs/type": "0.14.0",
23
- "@nmtjs/contract": "0.14.0",
24
- "@nmtjs/common": "0.14.0",
25
- "@nmtjs/protocol": "0.14.0"
22
+ "@nmtjs/contract": "0.14.2",
23
+ "@nmtjs/type": "0.14.2",
24
+ "@nmtjs/protocol": "0.14.2",
25
+ "@nmtjs/common": "0.14.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@nmtjs/type": "0.14.0",
29
- "@nmtjs/contract": "0.14.0",
30
- "@nmtjs/common": "0.14.0",
31
- "@nmtjs/protocol": "0.14.0"
28
+ "@nmtjs/type": "0.14.2",
29
+ "@nmtjs/contract": "0.14.2",
30
+ "@nmtjs/common": "0.14.2",
31
+ "@nmtjs/protocol": "0.14.2"
32
32
  },
33
33
  "files": [
34
34
  "dist",
35
35
  "LICENSE.md",
36
36
  "README.md"
37
37
  ],
38
- "version": "0.14.0",
38
+ "version": "0.14.2",
39
39
  "scripts": {
40
40
  "build": "tsc",
41
41
  "type-check": "tsc --noEmit"