@moostjs/swagger 0.3.10 → 0.3.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/index.cjs +511 -525
- package/dist/index.d.ts +82 -94
- package/dist/index.mjs +511 -525
- package/package.json +7 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,94 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
maxItems?: number;
|
|
84
|
-
uniqueItems?: boolean;
|
|
85
|
-
properties?: Record<string, TSwaggerSchema>;
|
|
86
|
-
additionalProperties?: boolean | TSwaggerSchema;
|
|
87
|
-
required?: string[];
|
|
88
|
-
allOf?: TSwaggerSchema[];
|
|
89
|
-
anyOf?: TSwaggerSchema[];
|
|
90
|
-
oneOf?: TSwaggerSchema[];
|
|
91
|
-
not?: TSwaggerSchema;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export { }
|
|
1
|
+
import { THeaderHook, TStatusHook } from '@wooksjs/event-http';
|
|
2
|
+
import * as _prostojs_mate from '@prostojs/mate';
|
|
3
|
+
import * as moost from 'moost';
|
|
4
|
+
import { z } from '@moostjs/zod';
|
|
5
|
+
|
|
6
|
+
declare class SwaggerController {
|
|
7
|
+
protected title: string;
|
|
8
|
+
constructor(title?: string);
|
|
9
|
+
assetPath: string;
|
|
10
|
+
serveIndex(url: string, location: THeaderHook, status: TStatusHook): string;
|
|
11
|
+
'swagger-initializer.js'(): string;
|
|
12
|
+
spec?: Record<string, unknown>;
|
|
13
|
+
'spec.json'(): Promise<Record<string, unknown>>;
|
|
14
|
+
files(url: string): Promise<unknown>;
|
|
15
|
+
serve(path: string): Promise<unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type TFunction = Function;
|
|
19
|
+
interface TEmpty {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface TSwaggerSchema {
|
|
23
|
+
type?: string;
|
|
24
|
+
$ref?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
format?: string;
|
|
28
|
+
default?: unknown;
|
|
29
|
+
enum?: string[];
|
|
30
|
+
nullable?: boolean;
|
|
31
|
+
readOnly?: boolean;
|
|
32
|
+
writeOnly?: boolean;
|
|
33
|
+
example?: unknown;
|
|
34
|
+
minLength?: number;
|
|
35
|
+
maxLength?: number;
|
|
36
|
+
pattern?: string;
|
|
37
|
+
minimum?: number;
|
|
38
|
+
maximum?: number;
|
|
39
|
+
exclusiveMinimum?: number;
|
|
40
|
+
exclusiveMaximum?: number;
|
|
41
|
+
multipleOf?: number;
|
|
42
|
+
items?: TSwaggerSchema | TSwaggerSchema[];
|
|
43
|
+
minItems?: number;
|
|
44
|
+
maxItems?: number;
|
|
45
|
+
uniqueItems?: boolean;
|
|
46
|
+
properties?: Record<string, TSwaggerSchema>;
|
|
47
|
+
additionalProperties?: boolean | TSwaggerSchema;
|
|
48
|
+
required?: string[];
|
|
49
|
+
allOf?: TSwaggerSchema[];
|
|
50
|
+
anyOf?: TSwaggerSchema[];
|
|
51
|
+
oneOf?: TSwaggerSchema[];
|
|
52
|
+
not?: TSwaggerSchema;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare function getSwaggerMate(): _prostojs_mate.Mate<moost.TMoostMetadata<TEmpty> & TSwaggerMate & {
|
|
56
|
+
params: (TEmpty & _prostojs_mate.TMateParamMeta)[];
|
|
57
|
+
}, moost.TMoostMetadata<TEmpty> & TSwaggerMate & {
|
|
58
|
+
params: (TEmpty & _prostojs_mate.TMateParamMeta)[];
|
|
59
|
+
}>;
|
|
60
|
+
interface TSwaggerMate {
|
|
61
|
+
swaggerTags: string[];
|
|
62
|
+
swaggerExclude: boolean;
|
|
63
|
+
swaggerDescription: string;
|
|
64
|
+
swaggerResponses: Record<number, Record<string, TSwaggerResponseConfigValue>>;
|
|
65
|
+
swaggerRequestBody: Record<string, TSwaggerResponseConfigValue>;
|
|
66
|
+
}
|
|
67
|
+
type TSwaggerResponseConfigValue = TFunction | z.ZodType | TSwaggerSchema;
|
|
68
|
+
interface TSwaggerResponseConfig {
|
|
69
|
+
contentType?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
response: TSwaggerResponseConfigValue;
|
|
72
|
+
}
|
|
73
|
+
type TSwaggerResponseOpts = TSwaggerResponseConfigValue | TSwaggerResponseConfig;
|
|
74
|
+
|
|
75
|
+
declare const SwaggerTag: (tag: string) => MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
|
|
76
|
+
declare const SwaggerExclude: () => MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
|
|
77
|
+
declare const SwaggerDescription: (descr: string) => MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
|
|
78
|
+
declare function SwaggerResponse(opts: TSwaggerResponseOpts): MethodDecorator;
|
|
79
|
+
declare function SwaggerResponse(code: number, opts: TSwaggerResponseOpts): MethodDecorator;
|
|
80
|
+
declare function SwaggerRequestBody(opt: TSwaggerResponseOpts): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
|
|
81
|
+
|
|
82
|
+
export { SwaggerController, SwaggerDescription, SwaggerExclude, SwaggerRequestBody, SwaggerResponse, SwaggerTag, type TSwaggerMate, type TSwaggerResponseConfigValue, type TSwaggerResponseOpts, getSwaggerMate };
|