ts-class-to-openapi 1.3.2 → 1.3.4

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.
Files changed (45) hide show
  1. package/dist/index.cjs +976 -0
  2. package/dist/index.d.cts +56 -0
  3. package/dist/index.d.mts +58 -0
  4. package/dist/index.mjs +951 -0
  5. package/package.json +32 -28
  6. package/dist/__test__/entities/additional-test-classes.d.ts +0 -12
  7. package/dist/__test__/entities/circular-reference-cases.d.ts +0 -1
  8. package/dist/__test__/entities/circular-reference-classes.d.ts +0 -110
  9. package/dist/__test__/entities/collision/arrays/number-array.d.ts +0 -3
  10. package/dist/__test__/entities/collision/arrays/string-array.d.ts +0 -3
  11. package/dist/__test__/entities/collision/number-props/same-name.d.ts +0 -5
  12. package/dist/__test__/entities/collision/string-props/same-name.d.ts +0 -5
  13. package/dist/__test__/entities/collision/throwing/class-a.d.ts +0 -4
  14. package/dist/__test__/entities/collision/throwing/class-b.d.ts +0 -4
  15. package/dist/__test__/entities/complex-circular-dependencies.d.ts +0 -71
  16. package/dist/__test__/entities/decorated-classes.d.ts +0 -54
  17. package/dist/__test__/entities/deep-nested-classes.d.ts +0 -1
  18. package/dist/__test__/entities/enum-classes.d.ts +0 -38
  19. package/dist/__test__/entities/evaluation/generics.d.ts +0 -6
  20. package/dist/__test__/entities/evaluation/modifiers.d.ts +0 -7
  21. package/dist/__test__/entities/generic-circular-classes.d.ts +0 -57
  22. package/dist/__test__/entities/nested-classes.d.ts +0 -70
  23. package/dist/__test__/entities/nested-reuse-classes.d.ts +0 -43
  24. package/dist/__test__/entities/pure-classes.d.ts +0 -37
  25. package/dist/__test__/entities/schema-validation-classes.d.ts +0 -35
  26. package/dist/__test__/index.d.ts +0 -8
  27. package/dist/__test__/test.d.ts +0 -1
  28. package/dist/__test__/testCases/collision-advanced.test.d.ts +0 -1
  29. package/dist/__test__/testCases/collision.test.d.ts +0 -1
  30. package/dist/__test__/testCases/decorated-classes.test.d.ts +0 -1
  31. package/dist/__test__/testCases/edge-cases.test.d.ts +0 -1
  32. package/dist/__test__/testCases/enum-properties.test.d.ts +0 -1
  33. package/dist/__test__/testCases/generics-and-modifiers.test.d.ts +0 -1
  34. package/dist/__test__/testCases/nested-classes.test.d.ts +0 -1
  35. package/dist/__test__/testCases/nested-reuse.test.d.ts +0 -1
  36. package/dist/__test__/testCases/pure-classes.test.d.ts +0 -1
  37. package/dist/__test__/testCases/schema-validation.test.d.ts +0 -1
  38. package/dist/index.d.ts +0 -3
  39. package/dist/index.esm.js +0 -1230
  40. package/dist/index.js +0 -1232
  41. package/dist/run.d.ts +0 -1
  42. package/dist/run.js +0 -1319
  43. package/dist/transformer.d.ts +0 -5
  44. package/dist/transformer.fixtures.d.ts +0 -175
  45. package/dist/types.d.ts +0 -97
@@ -1,5 +0,0 @@
1
- import { SchemaType, TransformerOptions } from './types';
2
- export declare function transform<T>(cls: new (...args: any[]) => T, options?: TransformerOptions): {
3
- name: string;
4
- schema: SchemaType;
5
- };
@@ -1,175 +0,0 @@
1
- declare const messages: {
2
- errors: {
3
- tsconfigNotFound: (path: string) => string;
4
- classNotFound: (className: string) => string;
5
- fileNotFound: (filePath: string) => string;
6
- };
7
- };
8
- declare const constants: {
9
- TS_CONFIG_DEFAULT_PATH: string;
10
- jsPrimitives: {
11
- String: {
12
- type: string;
13
- value: string;
14
- };
15
- Any: {
16
- type: string;
17
- value: string;
18
- };
19
- Unknown: {
20
- type: string;
21
- value: string;
22
- };
23
- Number: {
24
- type: string;
25
- value: string;
26
- format: string;
27
- };
28
- Boolean: {
29
- type: string;
30
- value: string;
31
- };
32
- Symbol: {
33
- type: string;
34
- value: string;
35
- };
36
- BigInt: {
37
- type: string;
38
- value: string;
39
- format: string;
40
- };
41
- null: {
42
- type: string;
43
- value: string;
44
- };
45
- Object: {
46
- type: string;
47
- value: string;
48
- };
49
- Array: {
50
- type: string;
51
- value: string;
52
- };
53
- Date: {
54
- type: string;
55
- value: string;
56
- format: string;
57
- };
58
- Function: {
59
- type: string;
60
- value: string;
61
- };
62
- Buffer: {
63
- type: string;
64
- value: string;
65
- format: string;
66
- };
67
- Uint8Array: {
68
- type: string;
69
- value: string;
70
- format: string;
71
- };
72
- UploadFile: {
73
- type: string;
74
- value: string;
75
- format: string;
76
- };
77
- UploadFileDto: {
78
- type: string;
79
- value: string;
80
- format: string;
81
- };
82
- File: {
83
- type: string;
84
- value: string;
85
- format: string;
86
- };
87
- };
88
- validatorDecorators: {
89
- Length: {
90
- name: string;
91
- type: string;
92
- };
93
- MinLength: {
94
- name: string;
95
- type: string;
96
- };
97
- MaxLength: {
98
- name: string;
99
- type: string;
100
- };
101
- IsInt: {
102
- name: string;
103
- type: string;
104
- format: string;
105
- };
106
- IsNumber: {
107
- name: string;
108
- type: string;
109
- format: string;
110
- };
111
- IsString: {
112
- name: string;
113
- type: string;
114
- format: string;
115
- };
116
- IsPositive: {
117
- name: string;
118
- type: string;
119
- };
120
- IsDate: {
121
- name: string;
122
- type: string;
123
- format: string;
124
- };
125
- IsEmail: {
126
- name: string;
127
- type: string;
128
- format: string;
129
- };
130
- IsNotEmpty: {
131
- name: string;
132
- };
133
- IsOptional: {
134
- name: string;
135
- };
136
- IsBoolean: {
137
- name: string;
138
- type: string;
139
- };
140
- IsArray: {
141
- name: string;
142
- type: string;
143
- };
144
- Min: {
145
- name: string;
146
- };
147
- Max: {
148
- name: string;
149
- };
150
- ArrayNotEmpty: {
151
- name: string;
152
- };
153
- ArrayMaxSize: {
154
- name: string;
155
- };
156
- ArrayMinSize: {
157
- name: string;
158
- };
159
- IsEnum: {
160
- name: string;
161
- type: string;
162
- };
163
- };
164
- tsUtilityTypes: {
165
- Partial: {
166
- type: string;
167
- value: string;
168
- };
169
- Required: {
170
- type: string;
171
- value: string;
172
- };
173
- };
174
- };
175
- export { messages, constants };
package/dist/types.d.ts DELETED
@@ -1,97 +0,0 @@
1
- import ts from 'typescript';
2
- type Property = ({
3
- [key: string]: any;
4
- } & {
5
- type: string;
6
- }) | SchemaType;
7
- type SchemaType = ({
8
- [key: string]: any;
9
- } & {
10
- properties: {
11
- [key: string]: any;
12
- } & {
13
- additionalProperties?: boolean;
14
- };
15
- } & {
16
- required?: string[];
17
- } & {
18
- type: string;
19
- }) | ({
20
- [key: string]: any;
21
- } & {
22
- $ref: string;
23
- }) | ({
24
- [key: string]: any;
25
- } & {
26
- type: 'array';
27
- } & {
28
- items: SchemaType;
29
- });
30
- /**
31
- * Information about a class-validator decorator found on a property.
32
- * @interface DecoratorInfo
33
- */
34
- interface DecoratorInfo {
35
- /** The name of the decorator (e.g., "IsString", "MinLength") */
36
- name: string;
37
- /** Arguments passed to the decorator */
38
- arguments: any[];
39
- }
40
- /**
41
- * Information about a class property including its type and decorators.
42
- * @interface PropertyInfo
43
- */
44
- interface PropertyInfo {
45
- /** The name of the property */
46
- name: string;
47
- /** The TypeScript type of the property as a string */
48
- type: string;
49
- /** Array of decorators applied to this property */
50
- decorators: DecoratorInfo[];
51
- /** Whether the property is optional (has ? operator) */
52
- isOptional: boolean;
53
- /** Whether the property type is a generic type */
54
- isGeneric: boolean;
55
- /** Whether the property type is a primitive type */
56
- isPrimitive: boolean;
57
- /** Whether the property type is a class type */
58
- isClassType?: boolean;
59
- /** Whether the property type is an array type */
60
- isArray?: boolean;
61
- /** Whether the property type is an enum type */
62
- isEnum?: boolean;
63
- /** The original TypeScript property declaration (optional) */
64
- originalProperty: ts.PropertyDeclaration;
65
- /** Whether the property is a reference to another or yourselves schema */
66
- isRef?: boolean;
67
- isTypeLiteral?: boolean;
68
- /** The class declaration reference when the property is a type literal with a class argument */
69
- typeLiteralClassReference?: ts.ClassDeclaration;
70
- }
71
- /**
72
- * Configuration options for SchemaTransformer memory management
73
- * @interface TransformerOptions
74
- */
75
- interface TransformerOptions {
76
- /** Maximum number of schemas to cache before cleanup (default: 100) */
77
- maxCacheSize?: number;
78
- /** Whether to automatically clean up cache (default: true) */
79
- autoCleanup?: boolean;
80
- /** Options related to the source of the class being transformed */
81
- sourceOptions?: {
82
- /** Whether the class is from an external module */
83
- isExternal: true;
84
- /** The package name (required when isExternal is true) */
85
- packageName: string;
86
- /** The file path of the class being transformed */
87
- filePath?: string;
88
- } | {
89
- /** Whether the class is from an external module */
90
- isExternal: false;
91
- /** The package name (optional when isExternal is false) */
92
- packageName: never;
93
- /** The file path of the class being transformed */
94
- filePath?: string;
95
- };
96
- }
97
- export { type SchemaType, type Property, type DecoratorInfo, type PropertyInfo, type TransformerOptions, };