vona-module-a-openapi 5.0.11 → 5.0.12
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/.metadata/index.d.ts +222 -0
- package/dist/.metadata/index.js +39 -0
- package/dist/.metadata/this.d.ts +2 -0
- package/dist/.metadata/this.js +2 -0
- package/dist/config/config.d.ts +12 -0
- package/dist/config/config.js +30 -0
- package/dist/config/locale/en-us.d.ts +80 -0
- package/dist/config/locale/en-us.js +2 -0
- package/dist/config/locale/zh-cn.d.ts +80 -0
- package/dist/config/locale/zh-cn.js +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/lib/decorator/api.d.ts +23 -0
- package/dist/lib/decorator/api.js +71 -0
- package/dist/lib/decorator/arguments.d.ts +38 -0
- package/dist/lib/decorator/arguments.js +39 -0
- package/dist/lib/decorator/field.d.ts +2 -0
- package/dist/lib/decorator/field.js +15 -0
- package/dist/lib/decorator/index.d.ts +3 -0
- package/dist/lib/decorator/index.js +3 -0
- package/dist/lib/decorator/pipesArgument.d.ts +2 -0
- package/dist/lib/decorator/pipesArgument.js +35 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/index.js +4 -0
- package/dist/lib/schema/bodySchemaWrapper.d.ts +14 -0
- package/dist/lib/schema/bodySchemaWrapper.js +8 -0
- package/dist/lib/schema/index.d.ts +4 -0
- package/dist/lib/schema/index.js +4 -0
- package/dist/lib/schema/makeSchemaLikes.d.ts +4 -0
- package/dist/lib/schema/makeSchemaLikes.js +29 -0
- package/dist/lib/schema/schema.d.ts +11 -0
- package/dist/lib/schema/schema.js +40 -0
- package/dist/lib/schema/v/helpers.d.ts +13 -0
- package/dist/lib/schema/v/helpers.js +36 -0
- package/dist/lib/schema/v/openapi.d.ts +7 -0
- package/dist/lib/schema/v/openapi.js +20 -0
- package/dist/lib/schema/v/system.d.ts +9 -0
- package/dist/lib/schema/v/system.js +34 -0
- package/dist/lib/schema/v.d.ts +20 -0
- package/dist/lib/schema/v.js +22 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/utils.js +43 -0
- package/dist/lib/zod/errorUtil.d.ts +9 -0
- package/dist/lib/zod/errorUtil.js +1 -0
- package/dist/lib/zod/errorsAdapter.d.ts +2 -0
- package/dist/lib/zod/errorsAdapter.js +9 -0
- package/dist/lib/zod/index.d.ts +2 -0
- package/dist/lib/zod/index.js +2 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +9 -0
- package/dist/service/openapi.d.ts +19 -0
- package/dist/service/openapi.js +352 -0
- package/dist/types/actions.d.ts +15 -0
- package/dist/types/actions.js +1 -0
- package/dist/types/api.d.ts +33 -0
- package/dist/types/api.js +1 -0
- package/dist/types/behavior.d.ts +10 -0
- package/dist/types/behavior.js +1 -0
- package/dist/types/component.d.ts +11 -0
- package/dist/types/component.js +1 -0
- package/dist/types/database.d.ts +4 -0
- package/dist/types/database.js +4 -0
- package/dist/types/decorator.d.ts +30 -0
- package/dist/types/decorator.js +4 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.js +8 -0
- package/dist/types/rest.d.ts +37 -0
- package/dist/types/rest.js +2 -0
- package/package.json +7 -3
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import type { BeanScopeUtil, TypeLocaleBase, TypeModuleConfig, TypeModuleLocales } from 'vona';
|
|
2
|
+
import type { config } from '../config/config.ts';
|
|
3
|
+
/** service: end */
|
|
4
|
+
/** service: begin */
|
|
5
|
+
/** service: end */
|
|
6
|
+
/** service: begin */
|
|
7
|
+
import type { ServiceOpenapi } from '../service/openapi.ts';
|
|
8
|
+
/** main: end */
|
|
9
|
+
/** scope: begin */
|
|
10
|
+
import { BeanScopeBase } from 'vona';
|
|
11
|
+
/** service: end */
|
|
12
|
+
/** config: begin */
|
|
13
|
+
import 'vona';
|
|
14
|
+
import 'vona';
|
|
15
|
+
import 'vona';
|
|
16
|
+
export * from '../config/config.ts';
|
|
17
|
+
declare module 'vona-module-a-web' {
|
|
18
|
+
interface IServiceRecord {
|
|
19
|
+
'a-openapi:openapi': never;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
declare module 'vona-module-a-openapi' {
|
|
23
|
+
interface ServiceOpenapi {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export interface IModuleService {
|
|
27
|
+
openapi: ServiceOpenapi;
|
|
28
|
+
}
|
|
29
|
+
declare module 'vona' {
|
|
30
|
+
interface IBeanRecordGeneral {
|
|
31
|
+
'a-openapi.service.openapi': ServiceOpenapi;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** locale: end */
|
|
35
|
+
/** main: begin */
|
|
36
|
+
export * from '../main.ts';
|
|
37
|
+
export declare const locales: {
|
|
38
|
+
'en-us': {
|
|
39
|
+
ZodError_invalid_input: string;
|
|
40
|
+
ZodError_invalid_type_required: string;
|
|
41
|
+
ZodError_invalid_type_requiredDetail: string;
|
|
42
|
+
ZodError_invalid_literal: string;
|
|
43
|
+
ZodError_unrecognized_keys: string;
|
|
44
|
+
ZodError_invalid_union: string;
|
|
45
|
+
ZodError_invalid_union_discriminator: string;
|
|
46
|
+
ZodError_invalid_enum_value: string;
|
|
47
|
+
ZodError_invalid_arguments: string;
|
|
48
|
+
ZodError_invalid_return_type: string;
|
|
49
|
+
ZodError_invalid_date: string;
|
|
50
|
+
ZodError_invalid_string_includes: string;
|
|
51
|
+
ZodError_invalid_string_includes_position: string;
|
|
52
|
+
ZodError_invalid_string_startsWith: string;
|
|
53
|
+
ZodError_invalid_string_endsWith: string;
|
|
54
|
+
ZodError_invalid_string_validation: string;
|
|
55
|
+
ZodError_invalid_string: string;
|
|
56
|
+
ZodError_too_small_array_exact: string;
|
|
57
|
+
ZodError_too_small_array_inclusive: string;
|
|
58
|
+
ZodError_too_small_array_not_inclusive: string;
|
|
59
|
+
ZodError_too_small_string_exact: string;
|
|
60
|
+
ZodError_too_small_string_inclusive: string;
|
|
61
|
+
ZodError_too_small_string_not_inclusive: string;
|
|
62
|
+
ZodError_too_small_number_exact: string;
|
|
63
|
+
ZodError_too_small_number_inclusive: string;
|
|
64
|
+
ZodError_too_small_number_not_inclusive: string;
|
|
65
|
+
ZodError_too_small_set_exact: string;
|
|
66
|
+
ZodError_too_small_set_inclusive: string;
|
|
67
|
+
ZodError_too_small_set_not_inclusive: string;
|
|
68
|
+
ZodError_too_small_date_exact: string;
|
|
69
|
+
ZodError_too_small_date_inclusive: string;
|
|
70
|
+
ZodError_too_small_date_not_inclusive: string;
|
|
71
|
+
ZodError_too_big_array_exact: string;
|
|
72
|
+
ZodError_too_big_array_inclusive: string;
|
|
73
|
+
ZodError_too_big_array_not_inclusive: string;
|
|
74
|
+
ZodError_too_big_string_exact: string;
|
|
75
|
+
ZodError_too_big_string_inclusive: string;
|
|
76
|
+
ZodError_too_big_string_not_inclusive: string;
|
|
77
|
+
ZodError_too_big_number_exact: string;
|
|
78
|
+
ZodError_too_big_number_inclusive: string;
|
|
79
|
+
ZodError_too_big_number_not_inclusive: string;
|
|
80
|
+
ZodError_too_big_set_exact: string;
|
|
81
|
+
ZodError_too_big_set_inclusive: string;
|
|
82
|
+
ZodError_too_big_set_not_inclusive: string;
|
|
83
|
+
ZodError_too_big_date_exact: string;
|
|
84
|
+
ZodError_too_big_date_inclusive: string;
|
|
85
|
+
ZodError_too_big_date_not_inclusive: string;
|
|
86
|
+
ZodError_custom: string;
|
|
87
|
+
ZodError_invalid_intersection_types: string;
|
|
88
|
+
ZodError_not_multiple_of: string;
|
|
89
|
+
ZodError_not_finite: string;
|
|
90
|
+
ZodError_validations_email: string;
|
|
91
|
+
ZodError_validations_url: string;
|
|
92
|
+
ZodError_validations_uuid: string;
|
|
93
|
+
ZodError_validations_cuid: string;
|
|
94
|
+
ZodError_validations_regex: string;
|
|
95
|
+
ZodError_validations_datetime: string;
|
|
96
|
+
ZodError_types_function: string;
|
|
97
|
+
ZodError_types_number: string;
|
|
98
|
+
ZodError_types_string: string;
|
|
99
|
+
ZodError_types_nan: string;
|
|
100
|
+
ZodError_types_integer: string;
|
|
101
|
+
ZodError_types_float: string;
|
|
102
|
+
ZodError_types_boolean: string;
|
|
103
|
+
ZodError_types_date: string;
|
|
104
|
+
ZodError_types_bigint: string;
|
|
105
|
+
ZodError_types_undefined: string;
|
|
106
|
+
ZodError_types_symbol: string;
|
|
107
|
+
ZodError_types_null: string;
|
|
108
|
+
ZodError_types_array: string;
|
|
109
|
+
ZodError_types_object: string;
|
|
110
|
+
ZodError_types_unknown: string;
|
|
111
|
+
ZodError_types_promise: string;
|
|
112
|
+
ZodError_types_void: string;
|
|
113
|
+
ZodError_types_never: string;
|
|
114
|
+
ZodError_types_map: string;
|
|
115
|
+
ZodError_types_set: string;
|
|
116
|
+
};
|
|
117
|
+
'zh-cn': {
|
|
118
|
+
ZodError_invalid_input: string;
|
|
119
|
+
ZodError_invalid_type_required: string;
|
|
120
|
+
ZodError_invalid_type_requiredDetail: string;
|
|
121
|
+
ZodError_invalid_literal: string;
|
|
122
|
+
ZodError_unrecognized_keys: string;
|
|
123
|
+
ZodError_invalid_union: string;
|
|
124
|
+
ZodError_invalid_union_discriminator: string;
|
|
125
|
+
ZodError_invalid_enum_value: string;
|
|
126
|
+
ZodError_invalid_arguments: string;
|
|
127
|
+
ZodError_invalid_return_type: string;
|
|
128
|
+
ZodError_invalid_date: string;
|
|
129
|
+
ZodError_invalid_string_includes: string;
|
|
130
|
+
ZodError_invalid_string_includes_position: string;
|
|
131
|
+
ZodError_invalid_string_startsWith: string;
|
|
132
|
+
ZodError_invalid_string_endsWith: string;
|
|
133
|
+
ZodError_invalid_string_validation: string;
|
|
134
|
+
ZodError_invalid_string: string;
|
|
135
|
+
ZodError_too_small_array_exact: string;
|
|
136
|
+
ZodError_too_small_array_inclusive: string;
|
|
137
|
+
ZodError_too_small_array_not_inclusive: string;
|
|
138
|
+
ZodError_too_small_string_exact: string;
|
|
139
|
+
ZodError_too_small_string_inclusive: string;
|
|
140
|
+
ZodError_too_small_string_not_inclusive: string;
|
|
141
|
+
ZodError_too_small_number_exact: string;
|
|
142
|
+
ZodError_too_small_number_inclusive: string;
|
|
143
|
+
ZodError_too_small_number_not_inclusive: string;
|
|
144
|
+
ZodError_too_small_set_exact: string;
|
|
145
|
+
ZodError_too_small_set_inclusive: string;
|
|
146
|
+
ZodError_too_small_set_not_inclusive: string;
|
|
147
|
+
ZodError_too_small_date_exact: string;
|
|
148
|
+
ZodError_too_small_date_inclusive: string;
|
|
149
|
+
ZodError_too_small_date_not_inclusive: string;
|
|
150
|
+
ZodError_too_big_array_exact: string;
|
|
151
|
+
ZodError_too_big_array_inclusive: string;
|
|
152
|
+
ZodError_too_big_array_not_inclusive: string;
|
|
153
|
+
ZodError_too_big_string_exact: string;
|
|
154
|
+
ZodError_too_big_string_inclusive: string;
|
|
155
|
+
ZodError_too_big_string_not_inclusive: string;
|
|
156
|
+
ZodError_too_big_number_exact: string;
|
|
157
|
+
ZodError_too_big_number_inclusive: string;
|
|
158
|
+
ZodError_too_big_number_not_inclusive: string;
|
|
159
|
+
ZodError_too_big_set_exact: string;
|
|
160
|
+
ZodError_too_big_set_inclusive: string;
|
|
161
|
+
ZodError_too_big_set_not_inclusive: string;
|
|
162
|
+
ZodError_too_big_date_exact: string;
|
|
163
|
+
ZodError_too_big_date_inclusive: string;
|
|
164
|
+
ZodError_too_big_date_not_inclusive: string;
|
|
165
|
+
ZodError_custom: string;
|
|
166
|
+
ZodError_invalid_intersection_types: string;
|
|
167
|
+
ZodError_not_multiple_of: string;
|
|
168
|
+
ZodError_not_finite: string;
|
|
169
|
+
ZodError_validations_email: string;
|
|
170
|
+
ZodError_validations_url: string;
|
|
171
|
+
ZodError_validations_uuid: string;
|
|
172
|
+
ZodError_validations_cuid: string;
|
|
173
|
+
ZodError_validations_regex: string;
|
|
174
|
+
ZodError_validations_datetime: string;
|
|
175
|
+
ZodError_types_function: string;
|
|
176
|
+
ZodError_types_number: string;
|
|
177
|
+
ZodError_types_string: string;
|
|
178
|
+
ZodError_types_nan: string;
|
|
179
|
+
ZodError_types_integer: string;
|
|
180
|
+
ZodError_types_float: string;
|
|
181
|
+
ZodError_types_boolean: string;
|
|
182
|
+
ZodError_types_date: string;
|
|
183
|
+
ZodError_types_bigint: string;
|
|
184
|
+
ZodError_types_undefined: string;
|
|
185
|
+
ZodError_types_symbol: string;
|
|
186
|
+
ZodError_types_null: string;
|
|
187
|
+
ZodError_types_array: string;
|
|
188
|
+
ZodError_types_object: string;
|
|
189
|
+
ZodError_types_unknown: string;
|
|
190
|
+
ZodError_types_promise: string;
|
|
191
|
+
ZodError_types_void: string;
|
|
192
|
+
ZodError_types_never: string;
|
|
193
|
+
ZodError_types_map: string;
|
|
194
|
+
ZodError_types_set: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
/** service: begin */
|
|
198
|
+
export * from '../service/openapi.ts';
|
|
199
|
+
export declare class ScopeModuleAOpenapi extends BeanScopeBase {
|
|
200
|
+
}
|
|
201
|
+
export interface ScopeModuleAOpenapi {
|
|
202
|
+
util: BeanScopeUtil;
|
|
203
|
+
config: TypeModuleConfig<typeof config>;
|
|
204
|
+
locale: TypeModuleLocales<(typeof locales)[TypeLocaleBase]>;
|
|
205
|
+
service: IModuleService;
|
|
206
|
+
}
|
|
207
|
+
declare module 'vona' {
|
|
208
|
+
interface IBeanScopeRecord {
|
|
209
|
+
'a-openapi': ScopeModuleAOpenapi;
|
|
210
|
+
}
|
|
211
|
+
interface IBeanScopeContainer {
|
|
212
|
+
openapi: ScopeModuleAOpenapi;
|
|
213
|
+
}
|
|
214
|
+
interface IBeanScopeConfig {
|
|
215
|
+
'a-openapi': ReturnType<typeof config>;
|
|
216
|
+
}
|
|
217
|
+
interface IBeanScopeLocale {
|
|
218
|
+
'a-openapi': (typeof locales)[TypeLocaleBase];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export declare function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): `a-openapi::${K}`;
|
|
222
|
+
/** scope: end */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
/** main: end */
|
|
8
|
+
/** scope: begin */
|
|
9
|
+
import { BeanScopeBase } from 'vona';
|
|
10
|
+
import { Scope } from 'vona-module-a-bean';
|
|
11
|
+
/** config: end */
|
|
12
|
+
/** locale: begin */
|
|
13
|
+
import locale_en_us from "../config/locale/en-us.js";
|
|
14
|
+
import locale_zh_cn from "../config/locale/zh-cn.js";
|
|
15
|
+
/** service: end */
|
|
16
|
+
/** config: begin */
|
|
17
|
+
import 'vona';
|
|
18
|
+
import 'vona';
|
|
19
|
+
import 'vona';
|
|
20
|
+
export * from "../config/config.js";
|
|
21
|
+
/** locale: end */
|
|
22
|
+
/** main: begin */
|
|
23
|
+
export * from "../main.js";
|
|
24
|
+
export const locales = {
|
|
25
|
+
'en-us': locale_en_us,
|
|
26
|
+
'zh-cn': locale_zh_cn,
|
|
27
|
+
};
|
|
28
|
+
/** service: begin */
|
|
29
|
+
export * from "../service/openapi.js";
|
|
30
|
+
let ScopeModuleAOpenapi = class ScopeModuleAOpenapi extends BeanScopeBase {
|
|
31
|
+
};
|
|
32
|
+
ScopeModuleAOpenapi = __decorate([
|
|
33
|
+
Scope()
|
|
34
|
+
], ScopeModuleAOpenapi);
|
|
35
|
+
export { ScopeModuleAOpenapi };
|
|
36
|
+
export function $locale(key) {
|
|
37
|
+
return `a-openapi::${key}`;
|
|
38
|
+
}
|
|
39
|
+
/** scope: end */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OpenAPIObjectConfig as OpenAPIObjectConfigV30 } from '@asteasolutions/zod-to-openapi/dist/v3.0/openapi-generator.ts';
|
|
2
|
+
import type { OpenAPIObjectConfigV31 } from '@asteasolutions/zod-to-openapi/dist/v3.1/openapi-generator.ts';
|
|
3
|
+
import type { VonaApplication } from 'vona';
|
|
4
|
+
import type { TypeOpenApiVersion, TypeSecuritySchemes } from '../types/api.ts';
|
|
5
|
+
export declare function config(_app: VonaApplication): {
|
|
6
|
+
defaultVersion: TypeOpenApiVersion;
|
|
7
|
+
generateDocument: {
|
|
8
|
+
V30: OpenAPIObjectConfigV30;
|
|
9
|
+
V31: OpenAPIObjectConfigV31;
|
|
10
|
+
};
|
|
11
|
+
securitySchemes: TypeSecuritySchemes;
|
|
12
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export function config(_app) {
|
|
2
|
+
return {
|
|
3
|
+
defaultVersion: 'V31',
|
|
4
|
+
generateDocument: {
|
|
5
|
+
V30: {
|
|
6
|
+
openapi: '3.0.0',
|
|
7
|
+
info: {
|
|
8
|
+
version: '5.0.0',
|
|
9
|
+
title: 'Vona',
|
|
10
|
+
description: 'Vona API',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
V31: {
|
|
14
|
+
openapi: '3.1.0',
|
|
15
|
+
info: {
|
|
16
|
+
version: '5.0.0',
|
|
17
|
+
title: 'Vona',
|
|
18
|
+
description: 'Vona API',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
securitySchemes: {
|
|
23
|
+
bearerAuth: {
|
|
24
|
+
type: 'http',
|
|
25
|
+
scheme: 'bearer',
|
|
26
|
+
bearerFormat: 'JWT',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ZodError_invalid_input: string;
|
|
3
|
+
ZodError_invalid_type_required: string;
|
|
4
|
+
ZodError_invalid_type_requiredDetail: string;
|
|
5
|
+
ZodError_invalid_literal: string;
|
|
6
|
+
ZodError_unrecognized_keys: string;
|
|
7
|
+
ZodError_invalid_union: string;
|
|
8
|
+
ZodError_invalid_union_discriminator: string;
|
|
9
|
+
ZodError_invalid_enum_value: string;
|
|
10
|
+
ZodError_invalid_arguments: string;
|
|
11
|
+
ZodError_invalid_return_type: string;
|
|
12
|
+
ZodError_invalid_date: string;
|
|
13
|
+
ZodError_invalid_string_includes: string;
|
|
14
|
+
ZodError_invalid_string_includes_position: string;
|
|
15
|
+
ZodError_invalid_string_startsWith: string;
|
|
16
|
+
ZodError_invalid_string_endsWith: string;
|
|
17
|
+
ZodError_invalid_string_validation: string;
|
|
18
|
+
ZodError_invalid_string: string;
|
|
19
|
+
ZodError_too_small_array_exact: string;
|
|
20
|
+
ZodError_too_small_array_inclusive: string;
|
|
21
|
+
ZodError_too_small_array_not_inclusive: string;
|
|
22
|
+
ZodError_too_small_string_exact: string;
|
|
23
|
+
ZodError_too_small_string_inclusive: string;
|
|
24
|
+
ZodError_too_small_string_not_inclusive: string;
|
|
25
|
+
ZodError_too_small_number_exact: string;
|
|
26
|
+
ZodError_too_small_number_inclusive: string;
|
|
27
|
+
ZodError_too_small_number_not_inclusive: string;
|
|
28
|
+
ZodError_too_small_set_exact: string;
|
|
29
|
+
ZodError_too_small_set_inclusive: string;
|
|
30
|
+
ZodError_too_small_set_not_inclusive: string;
|
|
31
|
+
ZodError_too_small_date_exact: string;
|
|
32
|
+
ZodError_too_small_date_inclusive: string;
|
|
33
|
+
ZodError_too_small_date_not_inclusive: string;
|
|
34
|
+
ZodError_too_big_array_exact: string;
|
|
35
|
+
ZodError_too_big_array_inclusive: string;
|
|
36
|
+
ZodError_too_big_array_not_inclusive: string;
|
|
37
|
+
ZodError_too_big_string_exact: string;
|
|
38
|
+
ZodError_too_big_string_inclusive: string;
|
|
39
|
+
ZodError_too_big_string_not_inclusive: string;
|
|
40
|
+
ZodError_too_big_number_exact: string;
|
|
41
|
+
ZodError_too_big_number_inclusive: string;
|
|
42
|
+
ZodError_too_big_number_not_inclusive: string;
|
|
43
|
+
ZodError_too_big_set_exact: string;
|
|
44
|
+
ZodError_too_big_set_inclusive: string;
|
|
45
|
+
ZodError_too_big_set_not_inclusive: string;
|
|
46
|
+
ZodError_too_big_date_exact: string;
|
|
47
|
+
ZodError_too_big_date_inclusive: string;
|
|
48
|
+
ZodError_too_big_date_not_inclusive: string;
|
|
49
|
+
ZodError_custom: string;
|
|
50
|
+
ZodError_invalid_intersection_types: string;
|
|
51
|
+
ZodError_not_multiple_of: string;
|
|
52
|
+
ZodError_not_finite: string;
|
|
53
|
+
ZodError_validations_email: string;
|
|
54
|
+
ZodError_validations_url: string;
|
|
55
|
+
ZodError_validations_uuid: string;
|
|
56
|
+
ZodError_validations_cuid: string;
|
|
57
|
+
ZodError_validations_regex: string;
|
|
58
|
+
ZodError_validations_datetime: string;
|
|
59
|
+
ZodError_types_function: string;
|
|
60
|
+
ZodError_types_number: string;
|
|
61
|
+
ZodError_types_string: string;
|
|
62
|
+
ZodError_types_nan: string;
|
|
63
|
+
ZodError_types_integer: string;
|
|
64
|
+
ZodError_types_float: string;
|
|
65
|
+
ZodError_types_boolean: string;
|
|
66
|
+
ZodError_types_date: string;
|
|
67
|
+
ZodError_types_bigint: string;
|
|
68
|
+
ZodError_types_undefined: string;
|
|
69
|
+
ZodError_types_symbol: string;
|
|
70
|
+
ZodError_types_null: string;
|
|
71
|
+
ZodError_types_array: string;
|
|
72
|
+
ZodError_types_object: string;
|
|
73
|
+
ZodError_types_unknown: string;
|
|
74
|
+
ZodError_types_promise: string;
|
|
75
|
+
ZodError_types_void: string;
|
|
76
|
+
ZodError_types_never: string;
|
|
77
|
+
ZodError_types_map: string;
|
|
78
|
+
ZodError_types_set: string;
|
|
79
|
+
};
|
|
80
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
ZodError_invalid_input: string;
|
|
3
|
+
ZodError_invalid_type_required: string;
|
|
4
|
+
ZodError_invalid_type_requiredDetail: string;
|
|
5
|
+
ZodError_invalid_literal: string;
|
|
6
|
+
ZodError_unrecognized_keys: string;
|
|
7
|
+
ZodError_invalid_union: string;
|
|
8
|
+
ZodError_invalid_union_discriminator: string;
|
|
9
|
+
ZodError_invalid_enum_value: string;
|
|
10
|
+
ZodError_invalid_arguments: string;
|
|
11
|
+
ZodError_invalid_return_type: string;
|
|
12
|
+
ZodError_invalid_date: string;
|
|
13
|
+
ZodError_invalid_string_includes: string;
|
|
14
|
+
ZodError_invalid_string_includes_position: string;
|
|
15
|
+
ZodError_invalid_string_startsWith: string;
|
|
16
|
+
ZodError_invalid_string_endsWith: string;
|
|
17
|
+
ZodError_invalid_string_validation: string;
|
|
18
|
+
ZodError_invalid_string: string;
|
|
19
|
+
ZodError_too_small_array_exact: string;
|
|
20
|
+
ZodError_too_small_array_inclusive: string;
|
|
21
|
+
ZodError_too_small_array_not_inclusive: string;
|
|
22
|
+
ZodError_too_small_string_exact: string;
|
|
23
|
+
ZodError_too_small_string_inclusive: string;
|
|
24
|
+
ZodError_too_small_string_not_inclusive: string;
|
|
25
|
+
ZodError_too_small_number_exact: string;
|
|
26
|
+
ZodError_too_small_number_inclusive: string;
|
|
27
|
+
ZodError_too_small_number_not_inclusive: string;
|
|
28
|
+
ZodError_too_small_set_exact: string;
|
|
29
|
+
ZodError_too_small_set_inclusive: string;
|
|
30
|
+
ZodError_too_small_set_not_inclusive: string;
|
|
31
|
+
ZodError_too_small_date_exact: string;
|
|
32
|
+
ZodError_too_small_date_inclusive: string;
|
|
33
|
+
ZodError_too_small_date_not_inclusive: string;
|
|
34
|
+
ZodError_too_big_array_exact: string;
|
|
35
|
+
ZodError_too_big_array_inclusive: string;
|
|
36
|
+
ZodError_too_big_array_not_inclusive: string;
|
|
37
|
+
ZodError_too_big_string_exact: string;
|
|
38
|
+
ZodError_too_big_string_inclusive: string;
|
|
39
|
+
ZodError_too_big_string_not_inclusive: string;
|
|
40
|
+
ZodError_too_big_number_exact: string;
|
|
41
|
+
ZodError_too_big_number_inclusive: string;
|
|
42
|
+
ZodError_too_big_number_not_inclusive: string;
|
|
43
|
+
ZodError_too_big_set_exact: string;
|
|
44
|
+
ZodError_too_big_set_inclusive: string;
|
|
45
|
+
ZodError_too_big_set_not_inclusive: string;
|
|
46
|
+
ZodError_too_big_date_exact: string;
|
|
47
|
+
ZodError_too_big_date_inclusive: string;
|
|
48
|
+
ZodError_too_big_date_not_inclusive: string;
|
|
49
|
+
ZodError_custom: string;
|
|
50
|
+
ZodError_invalid_intersection_types: string;
|
|
51
|
+
ZodError_not_multiple_of: string;
|
|
52
|
+
ZodError_not_finite: string;
|
|
53
|
+
ZodError_validations_email: string;
|
|
54
|
+
ZodError_validations_url: string;
|
|
55
|
+
ZodError_validations_uuid: string;
|
|
56
|
+
ZodError_validations_cuid: string;
|
|
57
|
+
ZodError_validations_regex: string;
|
|
58
|
+
ZodError_validations_datetime: string;
|
|
59
|
+
ZodError_types_function: string;
|
|
60
|
+
ZodError_types_number: string;
|
|
61
|
+
ZodError_types_string: string;
|
|
62
|
+
ZodError_types_nan: string;
|
|
63
|
+
ZodError_types_integer: string;
|
|
64
|
+
ZodError_types_float: string;
|
|
65
|
+
ZodError_types_boolean: string;
|
|
66
|
+
ZodError_types_date: string;
|
|
67
|
+
ZodError_types_bigint: string;
|
|
68
|
+
ZodError_types_undefined: string;
|
|
69
|
+
ZodError_types_symbol: string;
|
|
70
|
+
ZodError_types_null: string;
|
|
71
|
+
ZodError_types_array: string;
|
|
72
|
+
ZodError_types_object: string;
|
|
73
|
+
ZodError_types_unknown: string;
|
|
74
|
+
ZodError_types_promise: string;
|
|
75
|
+
ZodError_types_void: string;
|
|
76
|
+
ZodError_types_never: string;
|
|
77
|
+
ZodError_types_map: string;
|
|
78
|
+
ZodError_types_set: string;
|
|
79
|
+
};
|
|
80
|
+
export default _default;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { MetadataKey } from 'vona';
|
|
2
|
+
import type { IOpenApiHeader, TypeResponseContentType } from '../../types/api.ts';
|
|
3
|
+
import type { SchemaLike, SchemaLikeCreate } from '../../types/decorator.ts';
|
|
4
|
+
import { Field } from './field.ts';
|
|
5
|
+
export declare function setPublic(target: object, prop?: MetadataKey, _descriptor?: PropertyDescriptor, value?: boolean): void;
|
|
6
|
+
declare function contentType(contentType: TypeResponseContentType): MethodDecorator;
|
|
7
|
+
declare function body(...schemaLikes: SchemaLike[]): MethodDecorator;
|
|
8
|
+
declare function bodyCustom(bodySchemaWrapper: SchemaLikeCreate | false, ...schemaLikes: SchemaLike[]): MethodDecorator;
|
|
9
|
+
declare function exclude(): ClassDecorator & MethodDecorator;
|
|
10
|
+
declare function tags(tags: string[]): ClassDecorator & MethodDecorator;
|
|
11
|
+
declare function header(header: IOpenApiHeader): ClassDecorator & MethodDecorator;
|
|
12
|
+
declare function headers(headers: IOpenApiHeader[]): ClassDecorator & MethodDecorator;
|
|
13
|
+
export declare const Api: {
|
|
14
|
+
field: typeof Field;
|
|
15
|
+
contentType: typeof contentType;
|
|
16
|
+
body: typeof body;
|
|
17
|
+
bodyCustom: typeof bodyCustom;
|
|
18
|
+
exclude: typeof exclude;
|
|
19
|
+
tags: typeof tags;
|
|
20
|
+
header: typeof header;
|
|
21
|
+
headers: typeof headers;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { appMetadata } from 'vona';
|
|
2
|
+
import { SymbolOpenApiOptions } from "../../types/api.js";
|
|
3
|
+
import { makeSchemaLikes } from "../schema/makeSchemaLikes.js";
|
|
4
|
+
import { Field } from "./field.js";
|
|
5
|
+
export function setPublic(target, prop, _descriptor, value) {
|
|
6
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
7
|
+
options.public = value;
|
|
8
|
+
}
|
|
9
|
+
function contentType(contentType) {
|
|
10
|
+
return function (target, prop, descriptor) {
|
|
11
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
12
|
+
options.contentType = contentType;
|
|
13
|
+
return descriptor;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function body(...schemaLikes) {
|
|
17
|
+
return function (target, prop, descriptor) {
|
|
18
|
+
// schema
|
|
19
|
+
const metaType = appMetadata.getDesignReturntype(target, prop);
|
|
20
|
+
const schema = makeSchemaLikes(schemaLikes, metaType);
|
|
21
|
+
// options
|
|
22
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
23
|
+
options.bodySchema = schema;
|
|
24
|
+
return descriptor;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function bodyCustom(bodySchemaWrapper, ...schemaLikes) {
|
|
28
|
+
return function (target, prop, descriptor) {
|
|
29
|
+
// schema
|
|
30
|
+
const metaType = appMetadata.getDesignReturntype(target, prop);
|
|
31
|
+
const schema = makeSchemaLikes(schemaLikes, metaType);
|
|
32
|
+
// options
|
|
33
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
34
|
+
options.bodySchema = schema;
|
|
35
|
+
options.bodySchemaWrapper = bodySchemaWrapper;
|
|
36
|
+
return descriptor;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function exclude() {
|
|
40
|
+
return function (target, prop, descriptor) {
|
|
41
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
42
|
+
options.exclude = true;
|
|
43
|
+
return descriptor;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function tags(tags) {
|
|
47
|
+
return function (target, prop, descriptor) {
|
|
48
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
49
|
+
options.tags = tags;
|
|
50
|
+
return descriptor;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function header(header) {
|
|
54
|
+
return function (target, prop, descriptor) {
|
|
55
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
56
|
+
if (!options.headers)
|
|
57
|
+
options.headers = [];
|
|
58
|
+
options.headers.push(header);
|
|
59
|
+
return descriptor;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function headers(headers) {
|
|
63
|
+
return function (target, prop, descriptor) {
|
|
64
|
+
const options = appMetadata.getOwnMetadataMap(false, SymbolOpenApiOptions, target, prop);
|
|
65
|
+
if (!options.headers)
|
|
66
|
+
options.headers = [];
|
|
67
|
+
options.headers.push(...headers);
|
|
68
|
+
return descriptor;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export const Api = { field: Field, contentType, body, bodyCustom, exclude, tags, header, headers };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { SchemaLike } from '../../types/decorator.ts';
|
|
2
|
+
declare function Param(): ParameterDecorator;
|
|
3
|
+
declare function Param(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
4
|
+
declare function Param(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
5
|
+
declare function Query(): ParameterDecorator;
|
|
6
|
+
declare function Query(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
7
|
+
declare function Query(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
8
|
+
declare function Body(): ParameterDecorator;
|
|
9
|
+
declare function Body(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
10
|
+
declare function Body(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
11
|
+
declare function Headers(): ParameterDecorator;
|
|
12
|
+
declare function Headers(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
13
|
+
declare function Headers(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
14
|
+
declare function Fields(): ParameterDecorator;
|
|
15
|
+
declare function Fields(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
16
|
+
declare function Fields(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
17
|
+
declare function Field(): ParameterDecorator;
|
|
18
|
+
declare function Field(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
19
|
+
declare function Field(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
20
|
+
declare function Files(): ParameterDecorator;
|
|
21
|
+
declare function Files(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
22
|
+
declare function Files(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
23
|
+
declare function File(): ParameterDecorator;
|
|
24
|
+
declare function File(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
25
|
+
declare function File(property: string, ...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
26
|
+
declare function User(...schemaLikes: SchemaLike[]): ParameterDecorator;
|
|
27
|
+
export declare const Arg: {
|
|
28
|
+
param: typeof Param;
|
|
29
|
+
query: typeof Query;
|
|
30
|
+
body: typeof Body;
|
|
31
|
+
headers: typeof Headers;
|
|
32
|
+
fields: typeof Fields;
|
|
33
|
+
field: typeof Field;
|
|
34
|
+
files: typeof Files;
|
|
35
|
+
file: typeof File;
|
|
36
|
+
user: typeof User;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createPipesArgumentDecorator } from "./pipesArgument.js";
|
|
2
|
+
function Param(property, ...schemaLikes) {
|
|
3
|
+
return createPipesArgumentDecorator('param')(property, ...schemaLikes);
|
|
4
|
+
}
|
|
5
|
+
function Query(property, ...schemaLikes) {
|
|
6
|
+
return createPipesArgumentDecorator('query')(property, ...schemaLikes);
|
|
7
|
+
}
|
|
8
|
+
function Body(property, ...schemaLikes) {
|
|
9
|
+
return createPipesArgumentDecorator('body')(property, ...schemaLikes);
|
|
10
|
+
}
|
|
11
|
+
function Headers(property, ...schemaLikes) {
|
|
12
|
+
return createPipesArgumentDecorator('headers')(property, ...schemaLikes);
|
|
13
|
+
}
|
|
14
|
+
function Fields(property, ...schemaLikes) {
|
|
15
|
+
return createPipesArgumentDecorator('fields')(property, ...schemaLikes);
|
|
16
|
+
}
|
|
17
|
+
function Field(property, ...schemaLikes) {
|
|
18
|
+
return createPipesArgumentDecorator('field')(property, ...schemaLikes);
|
|
19
|
+
}
|
|
20
|
+
function Files(property, ...schemaLikes) {
|
|
21
|
+
return createPipesArgumentDecorator('files')(property, ...schemaLikes);
|
|
22
|
+
}
|
|
23
|
+
function File(property, ...schemaLikes) {
|
|
24
|
+
return createPipesArgumentDecorator('file')(property, ...schemaLikes);
|
|
25
|
+
}
|
|
26
|
+
function User(...schemaLikes) {
|
|
27
|
+
return createPipesArgumentDecorator('user')(undefined, ...schemaLikes);
|
|
28
|
+
}
|
|
29
|
+
export const Arg = {
|
|
30
|
+
param: Param,
|
|
31
|
+
query: Query,
|
|
32
|
+
body: Body,
|
|
33
|
+
headers: Headers,
|
|
34
|
+
fields: Fields,
|
|
35
|
+
field: Field,
|
|
36
|
+
files: Files,
|
|
37
|
+
file: File,
|
|
38
|
+
user: User,
|
|
39
|
+
};
|