@innet/server 2.0.0-alpha.29 → 2.0.0-alpha.30
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 +1 -1
- package/plugins/schema/field/field.d.ts +1 -0
- package/plugins/schema/field/field.es6.js +4 -1
- package/plugins/schema/field/field.js +4 -1
- package/utils/generateTypes/generateTypes.es6.js +6 -0
- package/utils/generateTypes/generateTypes.js +6 -0
- package/example/app/App/App.d.ts +0 -1
- package/example/app/App/index.d.ts +0 -1
- package/example/index.d.ts +0 -1
- package/example/return/index.d.ts +0 -1
- package/example/return/todo/AddTodo/AddTodo.d.ts +0 -1
- package/example/return/todo/AddTodo/index.d.ts +0 -1
- package/example/return/todo/DeleteTodo/DeleteTodo.d.ts +0 -1
- package/example/return/todo/DeleteTodo/index.d.ts +0 -1
- package/example/return/todo/EditTodo/EditTodo.d.ts +0 -1
- package/example/return/todo/EditTodo/index.d.ts +0 -1
- package/example/return/todo/GetTodo/GetTodo.d.ts +0 -1
- package/example/return/todo/GetTodo/index.d.ts +0 -1
- package/example/return/todo/GetTodos/GetTodos.d.ts +0 -1
- package/example/return/todo/GetTodos/index.d.ts +0 -1
- package/example/return/todo/index.d.ts +0 -5
- package/example/return/todo/todos.d.ts +0 -1
- package/example/schemas/app/ListQueryParams/ListQueryParams.d.ts +0 -1
- package/example/schemas/app/ListQueryParams/index.d.ts +0 -1
- package/example/schemas/app/ListSchema/ListSchema.d.ts +0 -4
- package/example/schemas/app/ListSchema/index.d.ts +0 -1
- package/example/schemas/app/index.d.ts +0 -2
- package/example/schemas/index.d.ts +0 -2
- package/example/schemas/todo/TodoSchema/TodoSchema.d.ts +0 -4
- package/example/schemas/todo/TodoSchema/index.d.ts +0 -1
- package/example/schemas/todo/index.d.ts +0 -1
- package/example/tags/Todo/Todo.d.ts +0 -1
- package/example/tags/Todo/index.d.ts +0 -1
- package/example/tags/index.d.ts +0 -1
- package/openApi.test.d.ts +0 -1
- package/utils/decorators/once/once.test.d.ts +0 -1
- package/utils/generateTypes/generateTypes.test.d.ts +0 -1
- package/utils/parseSearch/parseSearch.test.d.ts +0 -1
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { required } from '../../../utils/rules/required/required.es6.js';
|
|
|
10
10
|
|
|
11
11
|
const field = () => {
|
|
12
12
|
const handler = useNewHandler();
|
|
13
|
-
const { key, optional, } = useProps();
|
|
13
|
+
const { deprecated, key, optional, } = useProps();
|
|
14
14
|
const schema = useObjectSchemaContext();
|
|
15
15
|
const children = useChildren();
|
|
16
16
|
if (!schema.properties) {
|
|
@@ -21,6 +21,9 @@ const field = () => {
|
|
|
21
21
|
}
|
|
22
22
|
const fieldSchema = {};
|
|
23
23
|
schemaContext.set(handler, fieldSchema);
|
|
24
|
+
if (deprecated) {
|
|
25
|
+
fieldSchema.deprecated = true;
|
|
26
|
+
}
|
|
24
27
|
schema.properties[key] = fieldSchema;
|
|
25
28
|
if (!optional) {
|
|
26
29
|
if (!schema.required) {
|
|
@@ -18,7 +18,7 @@ var innet__default = /*#__PURE__*/_interopDefaultLegacy(innet);
|
|
|
18
18
|
|
|
19
19
|
const field = () => {
|
|
20
20
|
const handler = innet.useNewHandler();
|
|
21
|
-
const { key, optional, } = jsx.useProps();
|
|
21
|
+
const { deprecated, key, optional, } = jsx.useProps();
|
|
22
22
|
const schema = useObjectSchemaContext.useObjectSchemaContext();
|
|
23
23
|
const children = jsx.useChildren();
|
|
24
24
|
if (!schema.properties) {
|
|
@@ -29,6 +29,9 @@ const field = () => {
|
|
|
29
29
|
}
|
|
30
30
|
const fieldSchema = {};
|
|
31
31
|
useSchemaContext.schemaContext.set(handler, fieldSchema);
|
|
32
|
+
if (deprecated) {
|
|
33
|
+
fieldSchema.deprecated = true;
|
|
34
|
+
}
|
|
32
35
|
schema.properties[key] = fieldSchema;
|
|
33
36
|
if (!optional) {
|
|
34
37
|
if (!schema.required) {
|
|
@@ -54,6 +54,9 @@ function generateSchemaTypes(schema, spaces = 2, lastChar = '\n') {
|
|
|
54
54
|
const splitter = required.includes(key) || hasDefault(prop)
|
|
55
55
|
? ':'
|
|
56
56
|
: '?:';
|
|
57
|
+
if ('deprecated' in prop && prop.deprecated) {
|
|
58
|
+
result += `${space}/** @deprecated */\n`;
|
|
59
|
+
}
|
|
57
60
|
result += `${space}${key}${splitter} ${generateSchemaTypes(prop, spaces + 2)}`;
|
|
58
61
|
}
|
|
59
62
|
}
|
|
@@ -97,6 +100,9 @@ function generateTypes(docs, namespace = 'Api') {
|
|
|
97
100
|
const parameters = endpoint.parameters;
|
|
98
101
|
const requestBody = endpoint.requestBody;
|
|
99
102
|
const responses = endpoint.responses;
|
|
103
|
+
if (endpoint.deprecated) {
|
|
104
|
+
result += ' /** @deprecated */\n';
|
|
105
|
+
}
|
|
100
106
|
result += ` ['${method.toUpperCase()}:${path}']: {\n`;
|
|
101
107
|
if (parameters) {
|
|
102
108
|
const params = {
|
|
@@ -58,6 +58,9 @@ function generateSchemaTypes(schema, spaces = 2, lastChar = '\n') {
|
|
|
58
58
|
const splitter = required.includes(key) || hasDefault(prop)
|
|
59
59
|
? ':'
|
|
60
60
|
: '?:';
|
|
61
|
+
if ('deprecated' in prop && prop.deprecated) {
|
|
62
|
+
result += `${space}/** @deprecated */\n`;
|
|
63
|
+
}
|
|
61
64
|
result += `${space}${key}${splitter} ${generateSchemaTypes(prop, spaces + 2)}`;
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -101,6 +104,9 @@ function generateTypes(docs, namespace = 'Api') {
|
|
|
101
104
|
const parameters = endpoint.parameters;
|
|
102
105
|
const requestBody = endpoint.requestBody;
|
|
103
106
|
const responses = endpoint.responses;
|
|
107
|
+
if (endpoint.deprecated) {
|
|
108
|
+
result += ' /** @deprecated */\n';
|
|
109
|
+
}
|
|
104
110
|
result += ` ['${method.toUpperCase()}:${path}']: {\n`;
|
|
105
111
|
if (parameters) {
|
|
106
112
|
const params = {
|
package/example/app/App/App.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function App(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './App';
|
package/example/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './todo';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AddTodo(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AddTodo';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function DeleteTodo(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './DeleteTodo';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function EditTodo(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './EditTodo';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function GetTodo(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './GetTodo';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function GetTodos(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './GetTodos';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const todos: Api.Schemas.TodoSchema[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ListQueryParams(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ListQueryParams';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ListSchema';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TodoSchema';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './TodoSchema';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Todo(): any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Todo';
|
package/example/tags/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Todo';
|
package/openApi.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|