@nmtjs/client 0.7.1 → 0.7.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.
- package/dist/types.js.map +1 -1
- package/package.json +5 -5
- package/src/types.ts +5 -5
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"","names":[],"sources":["src/types.ts"],"sourcesContent":["import type { CallTypeProvider, TypeProvider } from '@nmtjs/common'\nimport type { TAnyAPIContract } from '@nmtjs/contract'\nimport type {\n ProtocolBaseClientCallOptions,\n ProtocolServerStreamInterface,\n} from '@nmtjs/protocol/client'\nimport type { InputType, OutputType } from '@nmtjs/protocol/common'\nimport type { BaseTypeAny, NeverType, t } from '@nmtjs/type'\n\nexport interface StaticInputContractTypeProvider extends TypeProvider {\n output: this['input'] extends BaseTypeAny\n ? t.infer.input
|
|
1
|
+
{"mappings":"","names":[],"sources":["src/types.ts"],"sourcesContent":["import type { CallTypeProvider, TypeProvider } from '@nmtjs/common'\nimport type { TAnyAPIContract } from '@nmtjs/contract'\nimport type {\n ProtocolBaseClientCallOptions,\n ProtocolServerStreamInterface,\n} from '@nmtjs/protocol/client'\nimport type { InputType, OutputType } from '@nmtjs/protocol/common'\nimport type { BaseTypeAny, NeverType, t } from '@nmtjs/type'\n\nexport interface StaticInputContractTypeProvider extends TypeProvider {\n output: this['input'] extends BaseTypeAny\n ? t.infer.encoded.input<this['input']>\n : never\n}\n\nexport interface RuntimeInputContractTypeProvider extends TypeProvider {\n output: this['input'] extends BaseTypeAny\n ? t.infer.decoded.input<this['input']>\n : never\n}\n\nexport interface StaticOutputContractTypeProvider extends TypeProvider {\n output: this['input'] extends BaseTypeAny\n ? t.infer.encoded.output<this['input']>\n : never\n}\n\nexport interface RuntimeOutputContractTypeProvider extends TypeProvider {\n output: this['input'] extends BaseTypeAny\n ? t.infer.decoded.output<this['input']>\n : never\n}\n\nexport type ResolveAPIContract<\n C extends TAnyAPIContract = TAnyAPIContract,\n InputTypeProvider extends TypeProvider = TypeProvider,\n OutputTypeProvider extends TypeProvider = TypeProvider,\n> = {\n [N in keyof C['namespaces'] as C['namespaces'][N]['name']]: {\n procedures: {\n [P in keyof C['namespaces'][N]['procedures'] as C['namespaces'][N]['procedures'][P]['name']]: {\n contract: C['namespaces'][N]['procedures'][P]\n input: InputType<\n CallTypeProvider<\n InputTypeProvider,\n C['namespaces'][N]['procedures'][P]['input']\n >\n >\n output: C['namespaces'][N]['procedures'][P]['stream'] extends NeverType\n ? OutputType<\n CallTypeProvider<\n OutputTypeProvider,\n C['namespaces'][N]['procedures'][P]['output']\n >\n >\n : {\n response: OutputType<\n CallTypeProvider<\n OutputTypeProvider,\n C['namespaces'][N]['procedures'][P]['output']\n >\n >\n stream: ProtocolServerStreamInterface<\n CallTypeProvider<\n OutputTypeProvider,\n C['namespaces'][N]['procedures'][P]['stream']\n >\n >\n }\n }\n }\n events: {\n [KE in keyof C['namespaces'][N]['events'] as C['namespaces'][N]['events'][KE]['name']]: {\n payload: OutputType<\n CallTypeProvider<\n OutputTypeProvider,\n C['namespaces'][N]['events'][KE]['payload']\n >\n >\n }\n }\n }\n}\n\nexport type ResolveClientEvents<\n C extends ResolveAPIContract = ResolveAPIContract,\n> = {\n [N in keyof C]: {\n [KE in keyof C[N]['events']]: C[N]['events'][KE]['payload']\n }\n}\n\nexport type ClientCallers<Resolved extends ResolveAPIContract> = {\n [N in keyof Resolved]: {\n [P in keyof Resolved[N]['procedures']]: (\n ...args: Resolved[N]['procedures'][P]['input'] extends NeverType\n ? [options?: ProtocolBaseClientCallOptions]\n : t.infer.encoded.input<\n Resolved[N]['procedures'][P]['contract']['input']\n > extends undefined\n ? [\n data?: Resolved[N]['procedures'][P]['input'],\n options?: ProtocolBaseClientCallOptions,\n ]\n : [\n data: Resolved[N]['procedures'][P]['input'],\n options?: ProtocolBaseClientCallOptions,\n ]\n ) => Promise<Resolved[N]['procedures'][P]['output']>\n }\n}\n"],"version":3}
|
package/package.json
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@nmtjs/type": "0.7.
|
|
20
|
-
"@nmtjs/contract": "0.7.
|
|
21
|
-
"@nmtjs/common": "0.7.
|
|
22
|
-
"@nmtjs/protocol": "0.7.
|
|
19
|
+
"@nmtjs/type": "0.7.2",
|
|
20
|
+
"@nmtjs/contract": "0.7.2",
|
|
21
|
+
"@nmtjs/common": "0.7.2",
|
|
22
|
+
"@nmtjs/protocol": "0.7.2"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"src",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"LICENSE.md",
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
|
-
"version": "0.7.
|
|
30
|
+
"version": "0.7.2",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "neemata-build --root=./src './**/*.ts'",
|
|
33
33
|
"type-check": "tsc --noEmit"
|
package/src/types.ts
CHANGED
|
@@ -9,25 +9,25 @@ import type { BaseTypeAny, NeverType, t } from '@nmtjs/type'
|
|
|
9
9
|
|
|
10
10
|
export interface StaticInputContractTypeProvider extends TypeProvider {
|
|
11
11
|
output: this['input'] extends BaseTypeAny
|
|
12
|
-
? t.infer.input
|
|
12
|
+
? t.infer.encoded.input<this['input']>
|
|
13
13
|
: never
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface RuntimeInputContractTypeProvider extends TypeProvider {
|
|
17
17
|
output: this['input'] extends BaseTypeAny
|
|
18
|
-
? t.infer.input
|
|
18
|
+
? t.infer.decoded.input<this['input']>
|
|
19
19
|
: never
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface StaticOutputContractTypeProvider extends TypeProvider {
|
|
23
23
|
output: this['input'] extends BaseTypeAny
|
|
24
|
-
? t.infer.
|
|
24
|
+
? t.infer.encoded.output<this['input']>
|
|
25
25
|
: never
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface RuntimeOutputContractTypeProvider extends TypeProvider {
|
|
29
29
|
output: this['input'] extends BaseTypeAny
|
|
30
|
-
? t.infer.decoded<this['input']>
|
|
30
|
+
? t.infer.decoded.output<this['input']>
|
|
31
31
|
: never
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -95,7 +95,7 @@ export type ClientCallers<Resolved extends ResolveAPIContract> = {
|
|
|
95
95
|
[P in keyof Resolved[N]['procedures']]: (
|
|
96
96
|
...args: Resolved[N]['procedures'][P]['input'] extends NeverType
|
|
97
97
|
? [options?: ProtocolBaseClientCallOptions]
|
|
98
|
-
: t.infer.input
|
|
98
|
+
: t.infer.encoded.input<
|
|
99
99
|
Resolved[N]['procedures'][P]['contract']['input']
|
|
100
100
|
> extends undefined
|
|
101
101
|
? [
|