@innet/server 2.0.0-beta.17 → 2.0.0-beta.18
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/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -75,6 +75,16 @@ export interface ValuesSchemaProps<T> extends BaseSchemaProps<T> {
|
|
|
75
75
|
value?: T;
|
|
76
76
|
values?: SchemaValues<T>;
|
|
77
77
|
}
|
|
78
|
+
export interface Bin {
|
|
79
|
+
disposition: string;
|
|
80
|
+
extension?: string;
|
|
81
|
+
fieldName: string;
|
|
82
|
+
filename: string;
|
|
83
|
+
originalFilename: string;
|
|
84
|
+
path: string;
|
|
85
|
+
size: number;
|
|
86
|
+
type: string;
|
|
87
|
+
}
|
|
78
88
|
export type TResponse = Record<ResponseStatus, unknown>;
|
|
79
89
|
export interface TEndpoint {
|
|
80
90
|
body?: unknown;
|
|
@@ -84,5 +94,9 @@ export interface TEndpoint {
|
|
|
84
94
|
response?: Record<string, TResponse>;
|
|
85
95
|
search?: Record<string, unknown>;
|
|
86
96
|
}
|
|
87
|
-
export
|
|
88
|
-
|
|
97
|
+
export interface ApiEndpoints {
|
|
98
|
+
[key: string]: TEndpoint;
|
|
99
|
+
}
|
|
100
|
+
export interface ApiSchemas {
|
|
101
|
+
[key: string]: unknown;
|
|
102
|
+
}
|
|
@@ -97,17 +97,8 @@ function generateSchemaTypes(schema, spaces = 2, lastChar = '\n') {
|
|
|
97
97
|
}
|
|
98
98
|
function generateTypes(docs, namespace = 'Api') {
|
|
99
99
|
var _a;
|
|
100
|
-
let result = `
|
|
101
|
-
|
|
102
|
-
filename: string
|
|
103
|
-
fieldName: string
|
|
104
|
-
originalFilename: string
|
|
105
|
-
path: string
|
|
106
|
-
type: string
|
|
107
|
-
disposition: string
|
|
108
|
-
size: number
|
|
109
|
-
extension?: string
|
|
110
|
-
}
|
|
100
|
+
let result = `import { Bin } from '@innet/server'
|
|
101
|
+
declare namespace ${namespace} {
|
|
111
102
|
`;
|
|
112
103
|
const schemas = (_a = docs.components) === null || _a === void 0 ? void 0 : _a.schemas;
|
|
113
104
|
const paths = docs.paths;
|
|
@@ -187,8 +178,8 @@ function generateTypes(docs, namespace = 'Api') {
|
|
|
187
178
|
return `${body}
|
|
188
179
|
|
|
189
180
|
declare module '@innet/server' {
|
|
190
|
-
|
|
191
|
-
|
|
181
|
+
interface ApiEndpoints extends ${namespace}.Endpoints {}
|
|
182
|
+
interface ApiSchemas extends ${namespace}.Schemas {}
|
|
192
183
|
}
|
|
193
184
|
`;
|
|
194
185
|
}
|
|
@@ -101,17 +101,8 @@ function generateSchemaTypes(schema, spaces = 2, lastChar = '\n') {
|
|
|
101
101
|
}
|
|
102
102
|
function generateTypes(docs, namespace = 'Api') {
|
|
103
103
|
var _a;
|
|
104
|
-
let result = `
|
|
105
|
-
|
|
106
|
-
filename: string
|
|
107
|
-
fieldName: string
|
|
108
|
-
originalFilename: string
|
|
109
|
-
path: string
|
|
110
|
-
type: string
|
|
111
|
-
disposition: string
|
|
112
|
-
size: number
|
|
113
|
-
extension?: string
|
|
114
|
-
}
|
|
104
|
+
let result = `import { Bin } from '@innet/server'
|
|
105
|
+
declare namespace ${namespace} {
|
|
115
106
|
`;
|
|
116
107
|
const schemas = (_a = docs.components) === null || _a === void 0 ? void 0 : _a.schemas;
|
|
117
108
|
const paths = docs.paths;
|
|
@@ -191,8 +182,8 @@ function generateTypes(docs, namespace = 'Api') {
|
|
|
191
182
|
return `${body}
|
|
192
183
|
|
|
193
184
|
declare module '@innet/server' {
|
|
194
|
-
|
|
195
|
-
|
|
185
|
+
interface ApiEndpoints extends ${namespace}.Endpoints {}
|
|
186
|
+
interface ApiSchemas extends ${namespace}.Schemas {}
|
|
196
187
|
}
|
|
197
188
|
`;
|
|
198
189
|
}
|