@scalar/oas-utils 0.11.0 → 0.12.0
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/CHANGELOG.md +13 -0
- package/dist/helpers/index.d.ts +0 -82
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +0 -78
- package/dist/migrations/migrate-to-indexdb.d.ts.map +1 -1
- package/dist/migrations/migrate-to-indexdb.js +1 -1
- package/dist/migrations/v-2.5.0/types.generated.d.ts +428 -34
- package/dist/migrations/v-2.5.0/types.generated.d.ts.map +1 -1
- package/package.json +8 -62
- package/dist/entities/cookie/cookie.d.ts +0 -15
- package/dist/entities/cookie/cookie.d.ts.map +0 -1
- package/dist/entities/cookie/cookie.js +0 -12
- package/dist/entities/cookie/index.d.ts +0 -2
- package/dist/entities/cookie/index.d.ts.map +0 -1
- package/dist/entities/cookie/index.js +0 -1
- package/dist/entities/environment/environment.d.ts +0 -12
- package/dist/entities/environment/environment.d.ts.map +0 -1
- package/dist/entities/environment/environment.js +0 -8
- package/dist/entities/environment/index.d.ts +0 -2
- package/dist/entities/environment/index.d.ts.map +0 -1
- package/dist/entities/environment/index.js +0 -1
- package/dist/entities/hotkeys/hotkeys.d.ts +0 -15
- package/dist/entities/hotkeys/hotkeys.d.ts.map +0 -1
- package/dist/entities/hotkeys/hotkeys.js +0 -118
- package/dist/entities/hotkeys/index.d.ts +0 -2
- package/dist/entities/hotkeys/index.d.ts.map +0 -1
- package/dist/entities/hotkeys/index.js +0 -1
- package/dist/entities/shared/index.d.ts +0 -2
- package/dist/entities/shared/index.d.ts.map +0 -1
- package/dist/entities/shared/index.js +0 -1
- package/dist/entities/shared/utility.d.ts +0 -5
- package/dist/entities/shared/utility.d.ts.map +0 -1
- package/dist/entities/shared/utility.js +0 -9
- package/dist/entities/spec/collection.d.ts +0 -133
- package/dist/entities/spec/collection.d.ts.map +0 -1
- package/dist/entities/spec/collection.js +0 -95
- package/dist/entities/spec/index.d.ts +0 -12
- package/dist/entities/spec/index.d.ts.map +0 -1
- package/dist/entities/spec/index.js +0 -10
- package/dist/entities/spec/operation.d.ts +0 -99
- package/dist/entities/spec/operation.d.ts.map +0 -1
- package/dist/entities/spec/operation.js +0 -6
- package/dist/entities/spec/parameters.d.ts +0 -44
- package/dist/entities/spec/parameters.d.ts.map +0 -1
- package/dist/entities/spec/parameters.js +0 -41
- package/dist/entities/spec/request-examples.d.ts +0 -380
- package/dist/entities/spec/request-examples.d.ts.map +0 -1
- package/dist/entities/spec/request-examples.js +0 -449
- package/dist/entities/spec/requests.d.ts +0 -137
- package/dist/entities/spec/requests.d.ts.map +0 -1
- package/dist/entities/spec/requests.js +0 -123
- package/dist/entities/spec/server.d.ts +0 -15
- package/dist/entities/spec/server.d.ts.map +0 -1
- package/dist/entities/spec/server.js +0 -67
- package/dist/entities/spec/spec-objects.d.ts +0 -171
- package/dist/entities/spec/spec-objects.d.ts.map +0 -1
- package/dist/entities/spec/spec-objects.js +0 -134
- package/dist/entities/spec/x-scalar-environments.d.ts +0 -22
- package/dist/entities/spec/x-scalar-environments.d.ts.map +0 -1
- package/dist/entities/spec/x-scalar-environments.js +0 -22
- package/dist/entities/spec/x-scalar-secrets.d.ts +0 -6
- package/dist/entities/spec/x-scalar-secrets.d.ts.map +0 -1
- package/dist/entities/spec/x-scalar-secrets.js +0 -8
- package/dist/entities/workspace/index.d.ts +0 -2
- package/dist/entities/workspace/index.d.ts.map +0 -1
- package/dist/entities/workspace/index.js +0 -1
- package/dist/entities/workspace/workspace.d.ts +0 -236
- package/dist/entities/workspace/workspace.d.ts.map +0 -1
- package/dist/entities/workspace/workspace.js +0 -49
- package/dist/helpers/fetch-document.d.ts +0 -7
- package/dist/helpers/fetch-document.d.ts.map +0 -1
- package/dist/helpers/fetch-document.js +0 -32
- package/dist/helpers/fetch-with-proxy-fallback.d.ts +0 -15
- package/dist/helpers/fetch-with-proxy-fallback.d.ts.map +0 -1
- package/dist/helpers/fetch-with-proxy-fallback.js +0 -29
- package/dist/helpers/normalize-mime-type-object.d.ts +0 -8
- package/dist/helpers/normalize-mime-type-object.d.ts.map +0 -1
- package/dist/helpers/normalize-mime-type-object.js +0 -21
- package/dist/helpers/normalize-mime-type.d.ts +0 -10
- package/dist/helpers/normalize-mime-type.d.ts.map +0 -1
- package/dist/helpers/normalize-mime-type.js +0 -12
- package/dist/helpers/operation-stability.d.ts +0 -19
- package/dist/helpers/operation-stability.d.ts.map +0 -1
- package/dist/helpers/operation-stability.js +0 -24
- package/dist/helpers/schema-model.d.ts +0 -5
- package/dist/helpers/schema-model.d.ts.map +0 -1
- package/dist/helpers/schema-model.js +0 -14
- package/dist/helpers/security/get-schemes.d.ts +0 -97
- package/dist/helpers/security/get-schemes.d.ts.map +0 -1
- package/dist/helpers/security/get-schemes.js +0 -8
- package/dist/helpers/security/has-token.d.ts +0 -4
- package/dist/helpers/security/has-token.d.ts.map +0 -1
- package/dist/helpers/security/has-token.js +0 -19
- package/dist/helpers/security/index.d.ts +0 -3
- package/dist/helpers/security/index.d.ts.map +0 -1
- package/dist/helpers/security/index.js +0 -2
- package/dist/helpers/servers.d.ts +0 -24
- package/dist/helpers/servers.d.ts.map +0 -1
- package/dist/helpers/servers.js +0 -146
- package/dist/helpers/should-ignore-entity.d.ts +0 -8
- package/dist/helpers/should-ignore-entity.d.ts.map +0 -1
- package/dist/helpers/should-ignore-entity.js +0 -4
- package/dist/migrations/generate-types.d.ts +0 -2
- package/dist/migrations/generate-types.d.ts.map +0 -1
- package/dist/migrations/generate-types.js +0 -53
- package/dist/spec-getters/get-example-from-schema.d.ts +0 -36
- package/dist/spec-getters/get-example-from-schema.d.ts.map +0 -1
- package/dist/spec-getters/get-example-from-schema.js +0 -521
- package/dist/spec-getters/get-parameters-from-operation.d.ts +0 -17
- package/dist/spec-getters/get-parameters-from-operation.d.ts.map +0 -1
- package/dist/spec-getters/get-parameters-from-operation.js +0 -40
- package/dist/spec-getters/get-request-body-from-operation.d.ts +0 -14
- package/dist/spec-getters/get-request-body-from-operation.d.ts.map +0 -1
- package/dist/spec-getters/get-request-body-from-operation.js +0 -176
- package/dist/spec-getters/get-server-variable-examples.d.ts +0 -4
- package/dist/spec-getters/get-server-variable-examples.d.ts.map +0 -1
- package/dist/spec-getters/get-server-variable-examples.js +0 -12
- package/dist/spec-getters/index.d.ts +0 -5
- package/dist/spec-getters/index.d.ts.map +0 -1
- package/dist/spec-getters/index.js +0 -4
- package/dist/transforms/import-spec.d.ts +0 -64
- package/dist/transforms/import-spec.d.ts.map +0 -1
- package/dist/transforms/import-spec.js +0 -397
- package/dist/transforms/index.d.ts +0 -2
- package/dist/transforms/index.d.ts.map +0 -1
- package/dist/transforms/index.js +0 -1
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { RequestParameter } from './parameters.js';
|
|
3
|
-
import type { Request } from './requests.js';
|
|
4
|
-
import type { Server } from './server.js';
|
|
5
|
-
/**
|
|
6
|
-
* TODO: Deprecate this.
|
|
7
|
-
*
|
|
8
|
-
* The request schema should be stored in the request and any
|
|
9
|
-
* parameters should be validated against that
|
|
10
|
-
*/
|
|
11
|
-
export declare const requestExampleParametersSchema: z.ZodPipe<z.ZodObject<{
|
|
12
|
-
key: z.ZodDefault<z.ZodString>;
|
|
13
|
-
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
14
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
-
file: z.ZodOptional<z.ZodAny>;
|
|
16
|
-
description: z.ZodOptional<z.ZodString>;
|
|
17
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
20
|
-
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
21
|
-
format: z.ZodOptional<z.ZodString>;
|
|
22
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
23
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
24
|
-
default: z.ZodOptional<z.ZodAny>;
|
|
25
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
27
|
-
key: string;
|
|
28
|
-
value: string;
|
|
29
|
-
enabled: boolean;
|
|
30
|
-
file?: any;
|
|
31
|
-
description?: string | undefined;
|
|
32
|
-
required?: boolean | undefined;
|
|
33
|
-
enum?: string[] | undefined;
|
|
34
|
-
examples?: any[] | undefined;
|
|
35
|
-
type?: string | string[] | undefined;
|
|
36
|
-
format?: string | undefined;
|
|
37
|
-
minimum?: number | undefined;
|
|
38
|
-
maximum?: number | undefined;
|
|
39
|
-
default?: any;
|
|
40
|
-
nullable?: boolean | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
key: string;
|
|
43
|
-
value: string;
|
|
44
|
-
enabled: boolean;
|
|
45
|
-
file?: any;
|
|
46
|
-
description?: string | undefined;
|
|
47
|
-
required?: boolean | undefined;
|
|
48
|
-
enum?: string[] | undefined;
|
|
49
|
-
examples?: any[] | undefined;
|
|
50
|
-
type?: string | string[] | undefined;
|
|
51
|
-
format?: string | undefined;
|
|
52
|
-
minimum?: number | undefined;
|
|
53
|
-
maximum?: number | undefined;
|
|
54
|
-
default?: any;
|
|
55
|
-
nullable?: boolean | undefined;
|
|
56
|
-
}>>;
|
|
57
|
-
/** Convert the array of parameters to an object keyed by the parameter name */
|
|
58
|
-
export declare const parameterArrayToObject: (params: RequestExampleParameter[]) => Record<string, string>;
|
|
59
|
-
/** Request examples - formerly known as instances - are "children" of requests */
|
|
60
|
-
export type RequestExampleParameter = z.infer<typeof requestExampleParametersSchema>;
|
|
61
|
-
export declare const requestExampleSchema: z.ZodObject<{
|
|
62
|
-
uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "example", "out">;
|
|
63
|
-
type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"requestExample">>>;
|
|
64
|
-
requestUid: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "operation", "out">>;
|
|
65
|
-
name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
66
|
-
body: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
67
|
-
raw: z.ZodOptional<z.ZodObject<{
|
|
68
|
-
encoding: z.ZodEnum<{
|
|
69
|
-
xml: "xml";
|
|
70
|
-
json: "json";
|
|
71
|
-
html: "html";
|
|
72
|
-
text: "text";
|
|
73
|
-
javascript: "javascript";
|
|
74
|
-
yaml: "yaml";
|
|
75
|
-
edn: "edn";
|
|
76
|
-
}>;
|
|
77
|
-
value: z.ZodDefault<z.ZodString>;
|
|
78
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
79
|
-
}, z.core.$strip>>;
|
|
80
|
-
formData: z.ZodOptional<z.ZodObject<{
|
|
81
|
-
encoding: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"form-data">, z.ZodLiteral<"urlencoded">]>>;
|
|
82
|
-
value: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
83
|
-
key: z.ZodDefault<z.ZodString>;
|
|
84
|
-
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
85
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
-
file: z.ZodOptional<z.ZodAny>;
|
|
87
|
-
description: z.ZodOptional<z.ZodString>;
|
|
88
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
91
|
-
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
92
|
-
format: z.ZodOptional<z.ZodString>;
|
|
93
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
95
|
-
default: z.ZodOptional<z.ZodAny>;
|
|
96
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
98
|
-
key: string;
|
|
99
|
-
value: string;
|
|
100
|
-
enabled: boolean;
|
|
101
|
-
file?: any;
|
|
102
|
-
description?: string | undefined;
|
|
103
|
-
required?: boolean | undefined;
|
|
104
|
-
enum?: string[] | undefined;
|
|
105
|
-
examples?: any[] | undefined;
|
|
106
|
-
type?: string | string[] | undefined;
|
|
107
|
-
format?: string | undefined;
|
|
108
|
-
minimum?: number | undefined;
|
|
109
|
-
maximum?: number | undefined;
|
|
110
|
-
default?: any;
|
|
111
|
-
nullable?: boolean | undefined;
|
|
112
|
-
}, {
|
|
113
|
-
key: string;
|
|
114
|
-
value: string;
|
|
115
|
-
enabled: boolean;
|
|
116
|
-
file?: any;
|
|
117
|
-
description?: string | undefined;
|
|
118
|
-
required?: boolean | undefined;
|
|
119
|
-
enum?: string[] | undefined;
|
|
120
|
-
examples?: any[] | undefined;
|
|
121
|
-
type?: string | string[] | undefined;
|
|
122
|
-
format?: string | undefined;
|
|
123
|
-
minimum?: number | undefined;
|
|
124
|
-
maximum?: number | undefined;
|
|
125
|
-
default?: any;
|
|
126
|
-
nullable?: boolean | undefined;
|
|
127
|
-
}>>>>;
|
|
128
|
-
}, z.core.$strip>>;
|
|
129
|
-
binary: z.ZodOptional<z.ZodCustom<Blob, Blob>>;
|
|
130
|
-
activeBody: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"raw">, z.ZodLiteral<"formData">, z.ZodLiteral<"binary">]>>;
|
|
131
|
-
}, z.core.$strip>>>;
|
|
132
|
-
parameters: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
133
|
-
path: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
134
|
-
key: z.ZodDefault<z.ZodString>;
|
|
135
|
-
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
136
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
137
|
-
file: z.ZodOptional<z.ZodAny>;
|
|
138
|
-
description: z.ZodOptional<z.ZodString>;
|
|
139
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
142
|
-
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
143
|
-
format: z.ZodOptional<z.ZodString>;
|
|
144
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
145
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
146
|
-
default: z.ZodOptional<z.ZodAny>;
|
|
147
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
149
|
-
key: string;
|
|
150
|
-
value: string;
|
|
151
|
-
enabled: boolean;
|
|
152
|
-
file?: any;
|
|
153
|
-
description?: string | undefined;
|
|
154
|
-
required?: boolean | undefined;
|
|
155
|
-
enum?: string[] | undefined;
|
|
156
|
-
examples?: any[] | undefined;
|
|
157
|
-
type?: string | string[] | undefined;
|
|
158
|
-
format?: string | undefined;
|
|
159
|
-
minimum?: number | undefined;
|
|
160
|
-
maximum?: number | undefined;
|
|
161
|
-
default?: any;
|
|
162
|
-
nullable?: boolean | undefined;
|
|
163
|
-
}, {
|
|
164
|
-
key: string;
|
|
165
|
-
value: string;
|
|
166
|
-
enabled: boolean;
|
|
167
|
-
file?: any;
|
|
168
|
-
description?: string | undefined;
|
|
169
|
-
required?: boolean | undefined;
|
|
170
|
-
enum?: string[] | undefined;
|
|
171
|
-
examples?: any[] | undefined;
|
|
172
|
-
type?: string | string[] | undefined;
|
|
173
|
-
format?: string | undefined;
|
|
174
|
-
minimum?: number | undefined;
|
|
175
|
-
maximum?: number | undefined;
|
|
176
|
-
default?: any;
|
|
177
|
-
nullable?: boolean | undefined;
|
|
178
|
-
}>>>>;
|
|
179
|
-
query: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
180
|
-
key: z.ZodDefault<z.ZodString>;
|
|
181
|
-
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
182
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
183
|
-
file: z.ZodOptional<z.ZodAny>;
|
|
184
|
-
description: z.ZodOptional<z.ZodString>;
|
|
185
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
187
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
188
|
-
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
189
|
-
format: z.ZodOptional<z.ZodString>;
|
|
190
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
191
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
192
|
-
default: z.ZodOptional<z.ZodAny>;
|
|
193
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
195
|
-
key: string;
|
|
196
|
-
value: string;
|
|
197
|
-
enabled: boolean;
|
|
198
|
-
file?: any;
|
|
199
|
-
description?: string | undefined;
|
|
200
|
-
required?: boolean | undefined;
|
|
201
|
-
enum?: string[] | undefined;
|
|
202
|
-
examples?: any[] | undefined;
|
|
203
|
-
type?: string | string[] | undefined;
|
|
204
|
-
format?: string | undefined;
|
|
205
|
-
minimum?: number | undefined;
|
|
206
|
-
maximum?: number | undefined;
|
|
207
|
-
default?: any;
|
|
208
|
-
nullable?: boolean | undefined;
|
|
209
|
-
}, {
|
|
210
|
-
key: string;
|
|
211
|
-
value: string;
|
|
212
|
-
enabled: boolean;
|
|
213
|
-
file?: any;
|
|
214
|
-
description?: string | undefined;
|
|
215
|
-
required?: boolean | undefined;
|
|
216
|
-
enum?: string[] | undefined;
|
|
217
|
-
examples?: any[] | undefined;
|
|
218
|
-
type?: string | string[] | undefined;
|
|
219
|
-
format?: string | undefined;
|
|
220
|
-
minimum?: number | undefined;
|
|
221
|
-
maximum?: number | undefined;
|
|
222
|
-
default?: any;
|
|
223
|
-
nullable?: boolean | undefined;
|
|
224
|
-
}>>>>;
|
|
225
|
-
headers: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
226
|
-
key: z.ZodDefault<z.ZodString>;
|
|
227
|
-
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
228
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
229
|
-
file: z.ZodOptional<z.ZodAny>;
|
|
230
|
-
description: z.ZodOptional<z.ZodString>;
|
|
231
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
233
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
234
|
-
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
235
|
-
format: z.ZodOptional<z.ZodString>;
|
|
236
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
237
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
238
|
-
default: z.ZodOptional<z.ZodAny>;
|
|
239
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
240
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
241
|
-
key: string;
|
|
242
|
-
value: string;
|
|
243
|
-
enabled: boolean;
|
|
244
|
-
file?: any;
|
|
245
|
-
description?: string | undefined;
|
|
246
|
-
required?: boolean | undefined;
|
|
247
|
-
enum?: string[] | undefined;
|
|
248
|
-
examples?: any[] | undefined;
|
|
249
|
-
type?: string | string[] | undefined;
|
|
250
|
-
format?: string | undefined;
|
|
251
|
-
minimum?: number | undefined;
|
|
252
|
-
maximum?: number | undefined;
|
|
253
|
-
default?: any;
|
|
254
|
-
nullable?: boolean | undefined;
|
|
255
|
-
}, {
|
|
256
|
-
key: string;
|
|
257
|
-
value: string;
|
|
258
|
-
enabled: boolean;
|
|
259
|
-
file?: any;
|
|
260
|
-
description?: string | undefined;
|
|
261
|
-
required?: boolean | undefined;
|
|
262
|
-
enum?: string[] | undefined;
|
|
263
|
-
examples?: any[] | undefined;
|
|
264
|
-
type?: string | string[] | undefined;
|
|
265
|
-
format?: string | undefined;
|
|
266
|
-
minimum?: number | undefined;
|
|
267
|
-
maximum?: number | undefined;
|
|
268
|
-
default?: any;
|
|
269
|
-
nullable?: boolean | undefined;
|
|
270
|
-
}>>>>;
|
|
271
|
-
cookies: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
272
|
-
key: z.ZodDefault<z.ZodString>;
|
|
273
|
-
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
274
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
275
|
-
file: z.ZodOptional<z.ZodAny>;
|
|
276
|
-
description: z.ZodOptional<z.ZodString>;
|
|
277
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
279
|
-
examples: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
280
|
-
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
281
|
-
format: z.ZodOptional<z.ZodString>;
|
|
282
|
-
minimum: z.ZodOptional<z.ZodNumber>;
|
|
283
|
-
maximum: z.ZodOptional<z.ZodNumber>;
|
|
284
|
-
default: z.ZodOptional<z.ZodAny>;
|
|
285
|
-
nullable: z.ZodOptional<z.ZodBoolean>;
|
|
286
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
287
|
-
key: string;
|
|
288
|
-
value: string;
|
|
289
|
-
enabled: boolean;
|
|
290
|
-
file?: any;
|
|
291
|
-
description?: string | undefined;
|
|
292
|
-
required?: boolean | undefined;
|
|
293
|
-
enum?: string[] | undefined;
|
|
294
|
-
examples?: any[] | undefined;
|
|
295
|
-
type?: string | string[] | undefined;
|
|
296
|
-
format?: string | undefined;
|
|
297
|
-
minimum?: number | undefined;
|
|
298
|
-
maximum?: number | undefined;
|
|
299
|
-
default?: any;
|
|
300
|
-
nullable?: boolean | undefined;
|
|
301
|
-
}, {
|
|
302
|
-
key: string;
|
|
303
|
-
value: string;
|
|
304
|
-
enabled: boolean;
|
|
305
|
-
file?: any;
|
|
306
|
-
description?: string | undefined;
|
|
307
|
-
required?: boolean | undefined;
|
|
308
|
-
enum?: string[] | undefined;
|
|
309
|
-
examples?: any[] | undefined;
|
|
310
|
-
type?: string | string[] | undefined;
|
|
311
|
-
format?: string | undefined;
|
|
312
|
-
minimum?: number | undefined;
|
|
313
|
-
maximum?: number | undefined;
|
|
314
|
-
default?: any;
|
|
315
|
-
nullable?: boolean | undefined;
|
|
316
|
-
}>>>>;
|
|
317
|
-
}, z.core.$strip>>>;
|
|
318
|
-
serverVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
319
|
-
}, z.core.$strip>;
|
|
320
|
-
export type RequestExample = z.infer<typeof requestExampleSchema>;
|
|
321
|
-
/** Schema for the OAS serialization of request examples */
|
|
322
|
-
export declare const xScalarExampleSchema: z.ZodObject<{
|
|
323
|
-
name: z.ZodOptional<z.ZodString>;
|
|
324
|
-
body: z.ZodOptional<z.ZodObject<{
|
|
325
|
-
encoding: z.ZodEnum<{
|
|
326
|
-
binary: "binary";
|
|
327
|
-
"application/json": "application/json";
|
|
328
|
-
"text/plain": "text/plain";
|
|
329
|
-
"text/html": "text/html";
|
|
330
|
-
"application/javascript": "application/javascript";
|
|
331
|
-
"application/xml": "application/xml";
|
|
332
|
-
"application/yaml": "application/yaml";
|
|
333
|
-
"application/edn": "application/edn";
|
|
334
|
-
"application/octet-stream": "application/octet-stream";
|
|
335
|
-
"application/x-www-form-urlencoded": "application/x-www-form-urlencoded";
|
|
336
|
-
"multipart/form-data": "multipart/form-data";
|
|
337
|
-
}>;
|
|
338
|
-
content: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodString]>;
|
|
339
|
-
file: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
340
|
-
url: z.ZodString;
|
|
341
|
-
base64: z.ZodOptional<z.ZodString>;
|
|
342
|
-
}, z.core.$strip>>>;
|
|
343
|
-
}, z.core.$strip>>;
|
|
344
|
-
parameters: z.ZodObject<{
|
|
345
|
-
path: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
346
|
-
query: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
347
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
348
|
-
cookies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
349
|
-
}, z.core.$strip>;
|
|
350
|
-
}, z.core.$strip>;
|
|
351
|
-
/**
|
|
352
|
-
* Convert a request example to the xScalar serialized format
|
|
353
|
-
*
|
|
354
|
-
* TODO: The base format should be migrated to align MUCH closer to the serialized format
|
|
355
|
-
*/
|
|
356
|
-
export declare function convertExampleToXScalar(example: RequestExample): {
|
|
357
|
-
parameters: {
|
|
358
|
-
path?: Record<string, string> | undefined;
|
|
359
|
-
query?: Record<string, string> | undefined;
|
|
360
|
-
headers?: Record<string, string> | undefined;
|
|
361
|
-
cookies?: Record<string, string> | undefined;
|
|
362
|
-
};
|
|
363
|
-
name?: string | undefined;
|
|
364
|
-
body?: {
|
|
365
|
-
encoding: "binary" | "application/json" | "text/plain" | "text/html" | "application/javascript" | "application/xml" | "application/yaml" | "application/edn" | "application/octet-stream" | "application/x-www-form-urlencoded" | "multipart/form-data";
|
|
366
|
-
content: string | Record<string, any>;
|
|
367
|
-
file?: {
|
|
368
|
-
url: string;
|
|
369
|
-
base64?: string | undefined;
|
|
370
|
-
} | null | undefined;
|
|
371
|
-
} | undefined;
|
|
372
|
-
};
|
|
373
|
-
/** Create new instance parameter from a request parameter */
|
|
374
|
-
export declare function createParamInstance(param: RequestParameter): RequestExampleParameter;
|
|
375
|
-
/**
|
|
376
|
-
* Create new request example from a request
|
|
377
|
-
* Iterates the name of the example if provided
|
|
378
|
-
*/
|
|
379
|
-
export declare function createExampleFromRequest(request: Request, name: string, server?: Server): RequestExample;
|
|
380
|
-
//# sourceMappingURL=request-examples.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-examples.d.ts","sourceRoot":"","sources":["../../../src/entities/spec/request-examples.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAKtC;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCvC,CAAA;AAEJ,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,GAAI,QAAQ,uBAAuB,EAAE,2BAIhE,CAAA;AAER,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAoHpF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsB/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAKjE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAU/B,CAAA;AAIF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,cAAc;;;;;;;;;;;;;;;;EAqD9D;AAKD,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,uBAAuB,CAsHpF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CA2HxG"}
|