vovk-cli 0.0.1-draft.205 → 0.0.1-draft.207
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.
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
import type { VovkClientFetcher } from 'vovk';
|
|
4
4
|
import type { fetcher } from '<%= t.imports.module.fetcher %>';
|
|
5
5
|
import type { createRPC } from '<%= t.imports.module.createRPC %>';
|
|
6
|
+
<% if(t.isTsStandalone) { %>
|
|
7
|
+
import type {
|
|
8
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
9
|
+
Segment<%= i %> as Controllers<%= i %>
|
|
10
|
+
<% }) %>
|
|
11
|
+
} from './types.d<%= t.nodeNextResolutionExt.ts %>';
|
|
12
|
+
<% } else { %>
|
|
6
13
|
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
7
14
|
import type { Controllers as Controllers<%= i %> } from "<%= t.segmentMeta[segment.segmentName].segmentImportPath %>";
|
|
8
15
|
<% }) %>
|
|
16
|
+
<% } %>
|
|
9
17
|
type Options = typeof fetcher extends VovkClientFetcher<infer U> ? U : never;
|
|
10
18
|
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => {
|
|
11
19
|
Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
import type { VovkClientFetcher } from 'vovk';
|
|
4
4
|
import type { fetcher } from '<%= t.imports.module.fetcher %>';
|
|
5
5
|
import type { createRPC } from '<%= t.imports.module.createRPC %>';
|
|
6
|
+
<% if(t.isTsStandalone) { %>
|
|
7
|
+
import type {
|
|
8
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
9
|
+
Segment<%= i %> as Controllers<%= i %>
|
|
10
|
+
<% }) %>
|
|
11
|
+
} from './types.d<%= t.nodeNextResolutionExt.ts %>';
|
|
12
|
+
<% } else { %>
|
|
6
13
|
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
7
14
|
import type { Controllers as Controllers<%= i %> } from "<%= t.segmentMeta[segment.segmentName].segmentImportPath %>";
|
|
8
15
|
<% }) %>
|
|
16
|
+
<% } %>
|
|
9
17
|
type Options = typeof fetcher extends VovkClientFetcher<infer U> ? U : never;
|
|
10
18
|
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => {
|
|
11
19
|
Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { VovkRequest, VovkStreamAsyncIterable, KnownAny } from 'vovk';
|
|
2
|
-
<% Object.entries(t.schema.segments).forEach(([segmentName, segment], i) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<% Object.entries(controllerSchema.handlers).forEach(([handlerName, handler]) => { %>
|
|
7
|
-
|
|
8
|
-
<% }) %>
|
|
2
|
+
<% Object.entries(t.schema.segments).forEach(([segmentName, segment], i) => { %>
|
|
3
|
+
export type Segment<%= i %> = {
|
|
4
|
+
<% Object.values(segment.controllers).forEach((controllerSchema) => { %>
|
|
5
|
+
<%= controllerSchema.originalControllerName ?? controllerSchema.rpcModuleName + 'Controller' %>: {
|
|
6
|
+
<% Object.entries(controllerSchema.handlers).forEach(([handlerName, handler]) => { %>
|
|
7
|
+
<%= handlerName %>: (req: VovkRequest<<%- t.convertJSONSchemaToTypeScriptDef(handler.validation?.body) ?? 'KnownAny' %>, <%- t.convertJSONSchemaToTypeScriptDef(handler.validation?.query) ?? 'KnownAny' %>, <%- t.convertJSONSchemaToTypeScriptDef(handler.validation?.params ?? 'KnownAny') %>>): <%= handler.validation?.output ? `Promise<${t.convertJSONSchemaToTypeScriptDef(handler.validation?.body)}>` : handler.validation?.iteration ? `Promise<VovkStreamAsyncIterable<${t.convertJSONSchemaToTypeScriptDef(handler.validation?.iteration)}>>` : 'Promise<KnownAny>' %>:
|
|
8
|
+
<% }) %>
|
|
9
|
+
};
|
|
10
|
+
<% }) %>
|
|
9
11
|
};
|
|
10
12
|
<% }) %>
|
|
11
|
-
<% }) %>
|
|
12
13
|
|
|
@@ -3,9 +3,18 @@ import type { VovkClientFetcher } from 'vovk';
|
|
|
3
3
|
import { fetcher } from '<%= t.imports.fetcher %>';
|
|
4
4
|
import { createRPC } from '<%= t.imports.createRPC %>';
|
|
5
5
|
import { schema } from './schema<%= t.nodeNextResolutionExt.ts %>';
|
|
6
|
+
<% if(t.isTsStandalone) { %>
|
|
7
|
+
import type {
|
|
8
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
9
|
+
Segment<%= i %> as Controllers<%= i %>
|
|
10
|
+
<% }) %>
|
|
11
|
+
} from './types.d<%= t.nodeNextResolutionExt.ts %>';
|
|
12
|
+
<% } else { %>
|
|
6
13
|
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
7
14
|
import type { Controllers as Controllers<%= i %> } from "<%= t.segmentMeta[segment.segmentName].segmentImportPath %>";
|
|
8
|
-
<% })
|
|
15
|
+
<% }) %>
|
|
16
|
+
<% } %>
|
|
17
|
+
<% if (t.imports.validateOnClient) { %>
|
|
9
18
|
import { validateOnClient } from '<%= t.imports.validateOnClient %>';
|
|
10
19
|
<% } else { %>
|
|
11
20
|
const validateOnClient = undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vovk-cli",
|
|
3
|
-
"version": "0.0.1-draft.
|
|
3
|
+
"version": "0.0.1-draft.207",
|
|
4
4
|
"bin": {
|
|
5
5
|
"vovk": "./dist/index.mjs"
|
|
6
6
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://vovk.dev",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"vovk": "^3.0.0-draft.
|
|
38
|
+
"vovk": "^3.0.0-draft.186"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
41
|
"vovk-python-client": "^0.0.1-draft.37"
|