@hey-api/openapi-ts 0.29.0 → 0.29.1

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.
@@ -1,101 +1,3 @@
1
- interface Enum {
2
- 'x-enum-description'?: string;
3
- 'x-enum-varname'?: string;
4
- description?: string;
5
- value: string | number;
6
- }
7
- interface OperationError {
8
- code: number;
9
- description: string;
10
- }
11
- interface OperationParameter extends Model {
12
- in: 'path' | 'query' | 'header' | 'formData' | 'body' | 'cookie';
13
- prop: string;
14
- mediaType: string | null;
15
- }
16
- interface OperationParameters extends Pick<Model, '$refs' | 'imports'> {
17
- parameters: OperationParameter[];
18
- parametersBody: OperationParameter | null;
19
- parametersCookie: OperationParameter[];
20
- parametersForm: OperationParameter[];
21
- parametersHeader: OperationParameter[];
22
- parametersPath: OperationParameter[];
23
- parametersQuery: OperationParameter[];
24
- }
25
- interface OperationResponse extends Model {
26
- in: 'response' | 'header';
27
- code: number;
28
- }
29
- interface Operation extends OperationParameters {
30
- deprecated: boolean;
31
- description: string | null;
32
- errors: OperationError[];
33
- method: 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT';
34
- /**
35
- * Method name. Methods contain the request logic.
36
- */
37
- name: string;
38
- path: string;
39
- responseHeader: string | null;
40
- results: OperationResponse[];
41
- /**
42
- * Service name, might be without postfix. This will be used to name the
43
- * exported class.
44
- */
45
- service: string;
46
- summary: string | null;
47
- }
48
- interface Schema {
49
- exclusiveMaximum?: boolean;
50
- exclusiveMinimum?: boolean;
51
- format?: 'binary' | 'boolean' | 'byte' | 'date-time' | 'date' | 'double' | 'float' | 'int32' | 'int64' | 'password' | 'string';
52
- isDefinition: boolean;
53
- isNullable: boolean;
54
- isReadOnly: boolean;
55
- isRequired: boolean;
56
- maximum?: number;
57
- maxItems?: number;
58
- maxLength?: number;
59
- maxProperties?: number;
60
- minimum?: number;
61
- minItems?: number;
62
- minLength?: number;
63
- minProperties?: number;
64
- multipleOf?: number;
65
- pattern?: string;
66
- uniqueItems?: boolean;
67
- }
68
- interface Model extends Schema {
69
- /**
70
- * **Experimental.** Contains list of original refs so they can be used
71
- * to access the schema from anywhere instead of relying on string name.
72
- * This allows us to do things like detect type of ref.
73
- */
74
- $refs: string[];
75
- base: string;
76
- default?: string;
77
- deprecated?: boolean;
78
- description: string | null;
79
- enum: Enum[];
80
- enums: Model[];
81
- export: 'all-of' | 'any-of' | 'array' | 'const' | 'dictionary' | 'enum' | 'generic' | 'interface' | 'one-of' | 'reference';
82
- imports: string[];
83
- link: Model | null;
84
- name: string;
85
- properties: Model[];
86
- template: string | null;
87
- type: string;
88
- }
89
- interface Service extends Pick<Model, '$refs' | 'imports' | 'name'> {
90
- operations: Operation[];
91
- }
92
- interface Client {
93
- models: Model[];
94
- server: string;
95
- services: Service[];
96
- version: string;
97
- }
98
-
99
1
  interface UserConfig {
100
2
  /**
101
3
  * Manually set base in OpenAPI config instead of inferring from server value
@@ -199,6 +101,105 @@ interface UserConfig {
199
101
  write?: boolean;
200
102
  }
201
103
 
104
+ interface Enum {
105
+ 'x-enum-description'?: string;
106
+ 'x-enum-varname'?: string;
107
+ description?: string;
108
+ value: string | number;
109
+ }
110
+ interface OperationError {
111
+ code: number;
112
+ description: string;
113
+ }
114
+ interface OperationParameter extends Model {
115
+ in: 'path' | 'query' | 'header' | 'formData' | 'body' | 'cookie';
116
+ prop: string;
117
+ mediaType: string | null;
118
+ }
119
+ interface OperationParameters extends Pick<Model, '$refs' | 'imports'> {
120
+ parameters: OperationParameter[];
121
+ parametersBody: OperationParameter | null;
122
+ parametersCookie: OperationParameter[];
123
+ parametersForm: OperationParameter[];
124
+ parametersHeader: OperationParameter[];
125
+ parametersPath: OperationParameter[];
126
+ parametersQuery: OperationParameter[];
127
+ }
128
+ interface OperationResponse extends Model {
129
+ in: 'response' | 'header';
130
+ code: number;
131
+ }
132
+ interface Operation extends OperationParameters {
133
+ deprecated: boolean;
134
+ description: string | null;
135
+ errors: OperationError[];
136
+ method: 'DELETE' | 'GET' | 'HEAD' | 'OPTIONS' | 'PATCH' | 'POST' | 'PUT';
137
+ /**
138
+ * Method name. Methods contain the request logic.
139
+ */
140
+ name: string;
141
+ path: string;
142
+ responseHeader: string | null;
143
+ results: OperationResponse[];
144
+ /**
145
+ * Service name, might be without postfix. This will be used to name the
146
+ * exported class.
147
+ */
148
+ service: string;
149
+ summary: string | null;
150
+ }
151
+ interface Schema {
152
+ exclusiveMaximum?: boolean;
153
+ exclusiveMinimum?: boolean;
154
+ format?: 'binary' | 'boolean' | 'byte' | 'date-time' | 'date' | 'double' | 'float' | 'int32' | 'int64' | 'password' | 'string';
155
+ isDefinition: boolean;
156
+ isNullable: boolean;
157
+ isReadOnly: boolean;
158
+ isRequired: boolean;
159
+ maximum?: number;
160
+ maxItems?: number;
161
+ maxLength?: number;
162
+ maxProperties?: number;
163
+ minimum?: number;
164
+ minItems?: number;
165
+ minLength?: number;
166
+ minProperties?: number;
167
+ multipleOf?: number;
168
+ pattern?: string;
169
+ uniqueItems?: boolean;
170
+ }
171
+ interface Model extends Schema {
172
+ /**
173
+ * **Experimental.** Contains list of original refs so they can be used
174
+ * to access the schema from anywhere instead of relying on string name.
175
+ * This allows us to do things like detect type of ref.
176
+ */
177
+ $refs: string[];
178
+ base: string;
179
+ default?: string;
180
+ deprecated?: boolean;
181
+ description: string | null;
182
+ enum: Enum[];
183
+ enums: Model[];
184
+ export: 'all-of' | 'any-of' | 'array' | 'const' | 'dictionary' | 'enum' | 'generic' | 'interface' | 'one-of' | 'reference';
185
+ imports: string[];
186
+ link: Model | null;
187
+ name: string;
188
+ properties: Model[];
189
+ template: string | null;
190
+ type: string;
191
+ }
192
+ interface Service extends Pick<Model, '$refs' | 'imports' | 'name'> {
193
+ operations: Operation[];
194
+ }
195
+
196
+ interface Client {
197
+ models: Model[];
198
+ server: string;
199
+ services: Service[];
200
+ version: string;
201
+ }
202
+
202
203
  /**
203
204
  * Generate the OpenAPI client. This method will read the OpenAPI specification and based on the
204
205
  * given language it will generate the client, including the typed models, validation schemas,