@scalar/oas-utils 0.4.33 → 0.5.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/entities/cookie/cookie.d.ts +2 -17
  3. package/dist/entities/cookie/cookie.d.ts.map +1 -1
  4. package/dist/entities/environment/environment.d.ts +2 -14
  5. package/dist/entities/environment/environment.d.ts.map +1 -1
  6. package/dist/entities/shared/utility.d.ts +1 -1
  7. package/dist/entities/shared/utility.d.ts.map +1 -1
  8. package/dist/entities/spec/collection.d.ts +76 -501
  9. package/dist/entities/spec/collection.d.ts.map +1 -1
  10. package/dist/entities/spec/operation.d.ts +60 -290
  11. package/dist/entities/spec/operation.d.ts.map +1 -1
  12. package/dist/entities/spec/parameters.d.ts +33 -50
  13. package/dist/entities/spec/parameters.d.ts.map +1 -1
  14. package/dist/entities/spec/request-examples.d.ts +161 -998
  15. package/dist/entities/spec/request-examples.d.ts.map +1 -1
  16. package/dist/entities/spec/request-examples.js +11 -6
  17. package/dist/entities/spec/request-examples.js.map +2 -2
  18. package/dist/entities/spec/requests.d.ts +102 -595
  19. package/dist/entities/spec/requests.d.ts.map +1 -1
  20. package/dist/entities/spec/server.d.ts +12 -156
  21. package/dist/entities/spec/server.d.ts.map +1 -1
  22. package/dist/entities/spec/spec-objects.d.ts +37 -229
  23. package/dist/entities/spec/spec-objects.d.ts.map +1 -1
  24. package/dist/entities/spec/x-scalar-environments.d.ts +8 -56
  25. package/dist/entities/spec/x-scalar-environments.d.ts.map +1 -1
  26. package/dist/entities/spec/x-scalar-secrets.d.ts +2 -14
  27. package/dist/entities/spec/x-scalar-secrets.d.ts.map +1 -1
  28. package/dist/entities/workspace/workspace.d.ts +218 -98
  29. package/dist/entities/workspace/workspace.d.ts.map +1 -1
  30. package/dist/entities/workspace/workspace.js +4 -5
  31. package/dist/entities/workspace/workspace.js.map +2 -2
  32. package/dist/helpers/parse.js +1 -1
  33. package/dist/helpers/parse.js.map +2 -2
  34. package/dist/helpers/schema-model.d.ts +3 -3
  35. package/dist/helpers/schema-model.d.ts.map +1 -1
  36. package/dist/helpers/schema-model.js.map +1 -1
  37. package/dist/helpers/security/get-schemes.d.ts +27 -27
  38. package/dist/helpers/security/get-schemes.d.ts.map +1 -1
  39. package/dist/migrations/v-2.5.0/migration.d.ts.map +1 -1
  40. package/dist/migrations/v-2.5.0/migration.js.map +2 -2
  41. package/dist/spec-getters/get-example-from-schema.d.ts +26 -23
  42. package/dist/spec-getters/get-example-from-schema.d.ts.map +1 -1
  43. package/dist/spec-getters/get-example-from-schema.js +330 -174
  44. package/dist/spec-getters/get-example-from-schema.js.map +2 -2
  45. package/package.json +9 -9
  46. package/dist/helpers/operation-to-har/index.d.ts +0 -2
  47. package/dist/helpers/operation-to-har/index.d.ts.map +0 -1
  48. package/dist/helpers/operation-to-har/index.js +0 -5
  49. package/dist/helpers/operation-to-har/index.js.map +0 -7
  50. package/dist/helpers/operation-to-har/operation-to-har.d.ts +0 -49
  51. package/dist/helpers/operation-to-har/operation-to-har.d.ts.map +0 -1
  52. package/dist/helpers/operation-to-har/operation-to-har.js +0 -68
  53. package/dist/helpers/operation-to-har/operation-to-har.js.map +0 -7
  54. package/dist/helpers/operation-to-har/process-body.d.ts +0 -12
  55. package/dist/helpers/operation-to-har/process-body.d.ts.map +0 -1
  56. package/dist/helpers/operation-to-har/process-body.js +0 -80
  57. package/dist/helpers/operation-to-har/process-body.js.map +0 -7
  58. package/dist/helpers/operation-to-har/process-parameters.d.ts +0 -19
  59. package/dist/helpers/operation-to-har/process-parameters.d.ts.map +0 -1
  60. package/dist/helpers/operation-to-har/process-parameters.js +0 -261
  61. package/dist/helpers/operation-to-har/process-parameters.js.map +0 -7
  62. package/dist/helpers/operation-to-har/process-security-schemes.d.ts +0 -15
  63. package/dist/helpers/operation-to-har/process-security-schemes.d.ts.map +0 -1
  64. package/dist/helpers/operation-to-har/process-security-schemes.js +0 -62
  65. package/dist/helpers/operation-to-har/process-security-schemes.js.map +0 -7
  66. package/dist/helpers/operation-to-har/process-server-url.d.ts +0 -6
  67. package/dist/helpers/operation-to-har/process-server-url.d.ts.map +0 -1
  68. package/dist/helpers/operation-to-har/process-server-url.js +0 -27
  69. package/dist/helpers/operation-to-har/process-server-url.js.map +0 -7
@@ -1,80 +1,50 @@
1
1
  import { z } from 'zod';
2
2
  export declare const oasCollectionSchema: z.ZodObject<{
3
- /**
4
- * @deprecated
5
- *
6
- * Needs to be remove as it is not a spec property
7
- */
8
3
  type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"collection">>>;
9
- openapi: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"3.0.0">, z.ZodLiteral<"3.1.0">, z.ZodLiteral<"4.0.0">]>>>;
4
+ openapi: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"3.0.0">, z.ZodLiteral<"3.1.0">, z.ZodLiteral<"4.0.0">]>>>;
10
5
  jsonSchemaDialect: z.ZodOptional<z.ZodString>;
11
- info: z.ZodCatch<z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
6
+ info: z.ZodCatch<z.ZodPipe<z.ZodObject<{
12
7
  title: z.ZodCatch<z.ZodString>;
13
8
  summary: z.ZodCatch<z.ZodOptional<z.ZodString>>;
14
9
  description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
15
10
  termsOfService: z.ZodCatch<z.ZodOptional<z.ZodString>>;
16
- contact: z.ZodCatch<z.ZodOptional<z.ZodEffects<z.ZodObject<{
11
+ contact: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodObject<{
17
12
  name: z.ZodOptional<z.ZodString>;
18
13
  url: z.ZodCatch<z.ZodOptional<z.ZodString>>;
19
14
  email: z.ZodCatch<z.ZodOptional<z.ZodString>>;
20
- }, "strip", z.ZodTypeAny, {
15
+ }, z.core.$strip>, z.ZodTransform<{
21
16
  name?: string | undefined;
22
17
  url?: string | undefined;
23
18
  email?: string | undefined;
24
19
  }, {
25
- name?: string | undefined;
26
- url?: unknown;
27
- email?: unknown;
28
- }>, {
29
20
  name?: string | undefined;
30
21
  url?: string | undefined;
31
22
  email?: string | undefined;
32
- }, {
33
- name?: string | undefined;
34
- url?: unknown;
35
- email?: unknown;
36
- }>>>;
37
- license: z.ZodCatch<z.ZodOptional<z.ZodEffects<z.ZodObject<{
23
+ }>>>>;
24
+ license: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodObject<{
38
25
  name: z.ZodCatch<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
39
26
  identifier: z.ZodCatch<z.ZodOptional<z.ZodString>>;
40
27
  url: z.ZodCatch<z.ZodOptional<z.ZodString>>;
41
- }, "strip", z.ZodTypeAny, {
28
+ }, z.core.$strip>, z.ZodTransform<{
42
29
  name?: string | null | undefined;
43
30
  identifier?: string | undefined;
44
31
  url?: string | undefined;
45
32
  }, {
46
- name?: unknown;
47
- identifier?: unknown;
48
- url?: unknown;
49
- }>, {
50
33
  name?: string | null | undefined;
51
34
  identifier?: string | undefined;
52
35
  url?: string | undefined;
53
- }, {
54
- name?: unknown;
55
- identifier?: unknown;
56
- url?: unknown;
57
- }>>>;
36
+ }>>>>;
58
37
  version: z.ZodCatch<z.ZodString>;
59
- }, {
60
38
  'x-scalar-sdk-installation': z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodObject<{
61
39
  lang: z.ZodString;
62
40
  source: z.ZodCatch<z.ZodOptional<z.ZodString>>;
63
41
  description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
64
- }, "strip", z.ZodTypeAny, {
65
- lang: string;
66
- description?: string | undefined;
67
- source?: string | undefined;
68
- }, {
69
- lang: string;
70
- description?: unknown;
71
- source?: unknown;
72
- }>, "many">>>;
73
- }>, "strip", z.ZodTypeAny, {
42
+ }, z.core.$strip>>>>;
43
+ }, z.core.$strip>, z.ZodTransform<{
74
44
  title: string;
75
45
  version: string;
76
- description?: string | undefined;
77
46
  summary?: string | undefined;
47
+ description?: string | undefined;
78
48
  termsOfService?: string | undefined;
79
49
  contact?: {
80
50
  name?: string | undefined;
@@ -88,23 +58,14 @@ export declare const oasCollectionSchema: z.ZodObject<{
88
58
  } | undefined;
89
59
  'x-scalar-sdk-installation'?: {
90
60
  lang: string;
91
- description?: string | undefined;
92
61
  source?: string | undefined;
62
+ description?: string | undefined;
93
63
  }[] | undefined;
94
64
  }, {
95
- description?: unknown;
96
- title?: unknown;
97
- summary?: unknown;
98
- termsOfService?: unknown;
99
- contact?: unknown;
100
- license?: unknown;
101
- version?: unknown;
102
- 'x-scalar-sdk-installation'?: unknown;
103
- }>, {
104
65
  title: string;
105
66
  version: string;
106
- description?: string | undefined;
107
67
  summary?: string | undefined;
68
+ description?: string | undefined;
108
69
  termsOfService?: string | undefined;
109
70
  contact?: {
110
71
  name?: string | undefined;
@@ -118,307 +79,103 @@ export declare const oasCollectionSchema: z.ZodObject<{
118
79
  } | undefined;
119
80
  'x-scalar-sdk-installation'?: {
120
81
  lang: string;
121
- description?: string | undefined;
122
82
  source?: string | undefined;
83
+ description?: string | undefined;
123
84
  }[] | undefined;
124
- }, {
125
- description?: unknown;
126
- title?: unknown;
127
- summary?: unknown;
128
- termsOfService?: unknown;
129
- contact?: unknown;
130
- license?: unknown;
131
- version?: unknown;
132
- 'x-scalar-sdk-installation'?: unknown;
133
- }>>;
134
- /**
135
- * A declaration of which security mechanisms can be used across the API. The list of
136
- * values includes alternative security requirement objects that can be used. Only
137
- * one of the security requirement objects need to be satisfied to authorize a request.
138
- * Individual operations can override this definition. To make security optional, an empty
139
- * security requirement ({}) can be included in the array.
140
- */
141
- security: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>, "many">>>;
142
- externalDocs: z.ZodCatch<z.ZodOptional<z.ZodEffects<z.ZodObject<{
85
+ }>>>;
86
+ security: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>>>>>;
87
+ externalDocs: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodObject<{
143
88
  description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
144
89
  url: z.ZodString;
145
- }, "strip", z.ZodTypeAny, {
90
+ }, z.core.$strip>, z.ZodTransform<{
146
91
  url: string;
147
92
  description?: string | undefined;
148
93
  }, {
149
- url: string;
150
- description?: unknown;
151
- }>, {
152
94
  url: string;
153
95
  description?: string | undefined;
154
- }, {
155
- url: string;
156
- description?: unknown;
157
- }>>>;
158
- /** TODO: Type these */
96
+ }>>>>;
159
97
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
160
- /** TODO: Type these */
161
98
  webhooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
162
- /** A custom icon representing the collection */
163
99
  'x-scalar-icon': z.ZodDefault<z.ZodOptional<z.ZodString>>;
164
100
  'x-scalar-active-environment': z.ZodOptional<z.ZodString>;
165
101
  'x-scalar-environments': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
166
102
  description: z.ZodOptional<z.ZodString>;
167
103
  color: z.ZodOptional<z.ZodString>;
168
- variables: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
104
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
169
105
  description: z.ZodOptional<z.ZodString>;
170
106
  default: z.ZodDefault<z.ZodString>;
171
- }, "strip", z.ZodTypeAny, {
172
- default: string;
173
- description?: string | undefined;
174
- }, {
175
- description?: string | undefined;
176
- default?: string | undefined;
177
- }>, z.ZodString]>>;
178
- }, "strip", z.ZodTypeAny, {
179
- variables: Record<string, string | {
180
- default: string;
181
- description?: string | undefined;
182
- }>;
183
- color?: string | undefined;
184
- description?: string | undefined;
185
- }, {
186
- variables: Record<string, string | {
187
- description?: string | undefined;
188
- default?: string | undefined;
189
- }>;
190
- color?: string | undefined;
191
- description?: string | undefined;
192
- }>>>;
107
+ }, z.core.$strip>, z.ZodString]>>;
108
+ }, z.core.$strip>>>;
193
109
  'x-scalar-secrets': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
194
110
  description: z.ZodOptional<z.ZodString>;
195
111
  example: z.ZodOptional<z.ZodString>;
196
- }, "strip", z.ZodTypeAny, {
197
- description?: string | undefined;
198
- example?: string | undefined;
199
- }, {
200
- description?: string | undefined;
201
- example?: string | undefined;
202
- }>>>;
203
- }, "strip", z.ZodTypeAny, {
204
- type: "collection";
205
- openapi: string;
206
- info: {
207
- title: string;
208
- version: string;
209
- description?: string | undefined;
210
- summary?: string | undefined;
211
- termsOfService?: string | undefined;
212
- contact?: {
213
- name?: string | undefined;
214
- url?: string | undefined;
215
- email?: string | undefined;
216
- } | undefined;
217
- license?: {
218
- name?: string | null | undefined;
219
- identifier?: string | undefined;
220
- url?: string | undefined;
221
- } | undefined;
222
- 'x-scalar-sdk-installation'?: {
223
- lang: string;
224
- description?: string | undefined;
225
- source?: string | undefined;
226
- }[] | undefined;
227
- };
228
- security: Record<string, string[]>[];
229
- 'x-scalar-icon': string;
230
- externalDocs?: {
231
- url: string;
232
- description?: string | undefined;
233
- } | undefined;
234
- jsonSchemaDialect?: string | undefined;
235
- components?: Record<string, unknown> | undefined;
236
- webhooks?: Record<string, unknown> | undefined;
237
- 'x-scalar-active-environment'?: string | undefined;
238
- 'x-scalar-environments'?: Record<string, {
239
- variables: Record<string, string | {
240
- default: string;
241
- description?: string | undefined;
242
- }>;
243
- color?: string | undefined;
244
- description?: string | undefined;
245
- }> | undefined;
246
- 'x-scalar-secrets'?: Record<string, {
247
- description?: string | undefined;
248
- example?: string | undefined;
249
- }> | undefined;
250
- }, {
251
- type?: "collection" | undefined;
252
- externalDocs?: unknown;
253
- openapi?: string | undefined;
254
- jsonSchemaDialect?: string | undefined;
255
- info?: unknown;
256
- security?: Record<string, string[] | undefined>[] | undefined;
257
- components?: Record<string, unknown> | undefined;
258
- webhooks?: Record<string, unknown> | undefined;
259
- 'x-scalar-icon'?: string | undefined;
260
- 'x-scalar-active-environment'?: string | undefined;
261
- 'x-scalar-environments'?: Record<string, {
262
- variables: Record<string, string | {
263
- description?: string | undefined;
264
- default?: string | undefined;
265
- }>;
266
- color?: string | undefined;
267
- description?: string | undefined;
268
- }> | undefined;
269
- 'x-scalar-secrets'?: Record<string, {
270
- description?: string | undefined;
271
- example?: string | undefined;
272
- }> | undefined;
273
- }>;
112
+ }, z.core.$strip>>>;
113
+ }, z.core.$strip>;
274
114
  export declare const extendedCollectionSchema: z.ZodObject<{
275
- uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "collection">;
276
- /** A list of security schemes UIDs associated with the collection */
277
- securitySchemes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
278
- /** List of currently selected security scheme UIDs, these can be overridden per request */
279
- selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodBranded<z.ZodString, "securityScheme">, z.ZodArray<z.ZodBranded<z.ZodString, "securityScheme">, "many">]>, "many">>;
280
- /** The currently selected server */
281
- selectedServerUid: z.ZodOptional<z.ZodBranded<z.ZodString, "server">>;
282
- /** UIDs which refer to servers on the workspace base */
283
- servers: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "server">, "many">>;
284
- /** Request UIDs associated with a collection */
285
- requests: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "operation">, "many">>;
286
- /** Tag UIDs associated with the collection */
287
- tags: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "tag">, "many">>;
288
- /** List of requests without tags and top level tag "folders" */
289
- children: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodBranded<z.ZodString, "operation">, z.ZodBranded<z.ZodString, "tag">]>, "many">>;
290
- /**
291
- * A link to where this document is stored
292
- *
293
- * - Used for watch mode
294
- * - Possibly useful for Git sync down the line
295
- */
115
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "collection">;
116
+ securitySchemes: z.ZodDefault<z.ZodArray<z.ZodString>>;
117
+ selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "securityScheme">, z.ZodArray<z.core.$ZodBranded<z.ZodString, "securityScheme">>]>>>;
118
+ selectedServerUid: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "server">>;
119
+ servers: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "server">>>;
120
+ requests: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "operation">>>;
121
+ tags: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "tag">>>;
122
+ children: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "operation">, z.core.$ZodBranded<z.ZodString, "tag">]>>>;
296
123
  documentUrl: z.ZodOptional<z.ZodString>;
297
- /**
298
- * Enables polling of OpenAPI document urls
299
- *
300
- * @remarks Only effective when `documentUrl` is set
301
- */
302
124
  watchMode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
303
- /** Keeps track of which integration is associated with the specific collection */
304
125
  integration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
- /**
306
- * Selected authentication will be set at the collection level instead of the request level
307
- *
308
- * @default false
309
- */
310
126
  useCollectionSecurity: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
311
- /**
312
- * Status of the watcher from above
313
- *
314
- * @defaults to idle for all collections, doesn't mean that it can watch for changes
315
- */
316
- watchModeStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<["IDLE", "WATCHING", "ERROR"]>>>;
317
- }, "strip", z.ZodTypeAny, {
318
- uid: string & z.BRAND<"collection">;
319
- children: ((string & z.BRAND<"tag">) | (string & z.BRAND<"operation">))[];
320
- securitySchemes: string[];
321
- selectedSecuritySchemeUids: ((string & z.BRAND<"securityScheme">) | (string & z.BRAND<"securityScheme">)[])[];
322
- servers: (string & z.BRAND<"server">)[];
323
- requests: (string & z.BRAND<"operation">)[];
324
- tags: (string & z.BRAND<"tag">)[];
325
- watchMode: boolean;
326
- useCollectionSecurity: boolean;
327
- watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
328
- selectedServerUid?: (string & z.BRAND<"server">) | undefined;
329
- documentUrl?: string | undefined;
330
- integration?: string | null | undefined;
331
- }, {
332
- uid?: string | undefined;
333
- children?: string[] | undefined;
334
- securitySchemes?: string[] | undefined;
335
- selectedSecuritySchemeUids?: (string | string[])[] | undefined;
336
- selectedServerUid?: string | undefined;
337
- servers?: string[] | undefined;
338
- requests?: string[] | undefined;
339
- tags?: string[] | undefined;
340
- documentUrl?: string | undefined;
341
- watchMode?: boolean | undefined;
342
- integration?: string | null | undefined;
343
- useCollectionSecurity?: boolean | undefined;
344
- watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
345
- }>;
346
- export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
347
- /**
348
- * @deprecated
349
- *
350
- * Needs to be remove as it is not a spec property
351
- */
127
+ watchModeStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
128
+ IDLE: "IDLE";
129
+ WATCHING: "WATCHING";
130
+ ERROR: "ERROR";
131
+ }>>>;
132
+ }, z.core.$strip>;
133
+ export declare const collectionSchema: z.ZodObject<{
352
134
  type: z.ZodDefault<z.ZodOptional<z.ZodLiteral<"collection">>>;
353
- openapi: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"3.0.0">, z.ZodLiteral<"3.1.0">, z.ZodLiteral<"4.0.0">]>>>;
135
+ openapi: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"3.0.0">, z.ZodLiteral<"3.1.0">, z.ZodLiteral<"4.0.0">]>>>;
354
136
  jsonSchemaDialect: z.ZodOptional<z.ZodString>;
355
- info: z.ZodCatch<z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<{
137
+ info: z.ZodCatch<z.ZodPipe<z.ZodObject<{
356
138
  title: z.ZodCatch<z.ZodString>;
357
139
  summary: z.ZodCatch<z.ZodOptional<z.ZodString>>;
358
140
  description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
359
141
  termsOfService: z.ZodCatch<z.ZodOptional<z.ZodString>>;
360
- contact: z.ZodCatch<z.ZodOptional<z.ZodEffects<z.ZodObject<{
142
+ contact: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodObject<{
361
143
  name: z.ZodOptional<z.ZodString>;
362
144
  url: z.ZodCatch<z.ZodOptional<z.ZodString>>;
363
145
  email: z.ZodCatch<z.ZodOptional<z.ZodString>>;
364
- }, "strip", z.ZodTypeAny, {
146
+ }, z.core.$strip>, z.ZodTransform<{
365
147
  name?: string | undefined;
366
148
  url?: string | undefined;
367
149
  email?: string | undefined;
368
150
  }, {
369
- name?: string | undefined;
370
- url?: unknown;
371
- email?: unknown;
372
- }>, {
373
151
  name?: string | undefined;
374
152
  url?: string | undefined;
375
153
  email?: string | undefined;
376
- }, {
377
- name?: string | undefined;
378
- url?: unknown;
379
- email?: unknown;
380
- }>>>;
381
- license: z.ZodCatch<z.ZodOptional<z.ZodEffects<z.ZodObject<{
154
+ }>>>>;
155
+ license: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodObject<{
382
156
  name: z.ZodCatch<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
383
157
  identifier: z.ZodCatch<z.ZodOptional<z.ZodString>>;
384
158
  url: z.ZodCatch<z.ZodOptional<z.ZodString>>;
385
- }, "strip", z.ZodTypeAny, {
159
+ }, z.core.$strip>, z.ZodTransform<{
386
160
  name?: string | null | undefined;
387
161
  identifier?: string | undefined;
388
162
  url?: string | undefined;
389
163
  }, {
390
- name?: unknown;
391
- identifier?: unknown;
392
- url?: unknown;
393
- }>, {
394
164
  name?: string | null | undefined;
395
165
  identifier?: string | undefined;
396
166
  url?: string | undefined;
397
- }, {
398
- name?: unknown;
399
- identifier?: unknown;
400
- url?: unknown;
401
- }>>>;
167
+ }>>>>;
402
168
  version: z.ZodCatch<z.ZodString>;
403
- }, {
404
169
  'x-scalar-sdk-installation': z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodObject<{
405
170
  lang: z.ZodString;
406
171
  source: z.ZodCatch<z.ZodOptional<z.ZodString>>;
407
172
  description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
408
- }, "strip", z.ZodTypeAny, {
409
- lang: string;
410
- description?: string | undefined;
411
- source?: string | undefined;
412
- }, {
413
- lang: string;
414
- description?: unknown;
415
- source?: unknown;
416
- }>, "many">>>;
417
- }>, "strip", z.ZodTypeAny, {
173
+ }, z.core.$strip>>>>;
174
+ }, z.core.$strip>, z.ZodTransform<{
418
175
  title: string;
419
176
  version: string;
420
- description?: string | undefined;
421
177
  summary?: string | undefined;
178
+ description?: string | undefined;
422
179
  termsOfService?: string | undefined;
423
180
  contact?: {
424
181
  name?: string | undefined;
@@ -432,23 +189,14 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
432
189
  } | undefined;
433
190
  'x-scalar-sdk-installation'?: {
434
191
  lang: string;
435
- description?: string | undefined;
436
192
  source?: string | undefined;
193
+ description?: string | undefined;
437
194
  }[] | undefined;
438
195
  }, {
439
- description?: unknown;
440
- title?: unknown;
441
- summary?: unknown;
442
- termsOfService?: unknown;
443
- contact?: unknown;
444
- license?: unknown;
445
- version?: unknown;
446
- 'x-scalar-sdk-installation'?: unknown;
447
- }>, {
448
196
  title: string;
449
197
  version: string;
450
- description?: string | undefined;
451
198
  summary?: string | undefined;
199
+ description?: string | undefined;
452
200
  termsOfService?: string | undefined;
453
201
  contact?: {
454
202
  name?: string | undefined;
@@ -462,228 +210,55 @@ export declare const collectionSchema: z.ZodObject<z.objectUtil.extendShape<{
462
210
  } | undefined;
463
211
  'x-scalar-sdk-installation'?: {
464
212
  lang: string;
465
- description?: string | undefined;
466
213
  source?: string | undefined;
214
+ description?: string | undefined;
467
215
  }[] | undefined;
468
- }, {
469
- description?: unknown;
470
- title?: unknown;
471
- summary?: unknown;
472
- termsOfService?: unknown;
473
- contact?: unknown;
474
- license?: unknown;
475
- version?: unknown;
476
- 'x-scalar-sdk-installation'?: unknown;
477
- }>>;
478
- /**
479
- * A declaration of which security mechanisms can be used across the API. The list of
480
- * values includes alternative security requirement objects that can be used. Only
481
- * one of the security requirement objects need to be satisfied to authorize a request.
482
- * Individual operations can override this definition. To make security optional, an empty
483
- * security requirement ({}) can be included in the array.
484
- */
485
- security: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>, "many">>>;
486
- externalDocs: z.ZodCatch<z.ZodOptional<z.ZodEffects<z.ZodObject<{
216
+ }>>>;
217
+ security: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>>>>>;
218
+ externalDocs: z.ZodCatch<z.ZodOptional<z.ZodPipe<z.ZodObject<{
487
219
  description: z.ZodCatch<z.ZodOptional<z.ZodString>>;
488
220
  url: z.ZodString;
489
- }, "strip", z.ZodTypeAny, {
221
+ }, z.core.$strip>, z.ZodTransform<{
490
222
  url: string;
491
223
  description?: string | undefined;
492
224
  }, {
493
- url: string;
494
- description?: unknown;
495
- }>, {
496
225
  url: string;
497
226
  description?: string | undefined;
498
- }, {
499
- url: string;
500
- description?: unknown;
501
- }>>>;
502
- /** TODO: Type these */
227
+ }>>>>;
503
228
  components: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
504
- /** TODO: Type these */
505
229
  webhooks: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
506
- /** A custom icon representing the collection */
507
230
  'x-scalar-icon': z.ZodDefault<z.ZodOptional<z.ZodString>>;
508
231
  'x-scalar-active-environment': z.ZodOptional<z.ZodString>;
509
232
  'x-scalar-environments': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
510
233
  description: z.ZodOptional<z.ZodString>;
511
234
  color: z.ZodOptional<z.ZodString>;
512
- variables: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
235
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
513
236
  description: z.ZodOptional<z.ZodString>;
514
237
  default: z.ZodDefault<z.ZodString>;
515
- }, "strip", z.ZodTypeAny, {
516
- default: string;
517
- description?: string | undefined;
518
- }, {
519
- description?: string | undefined;
520
- default?: string | undefined;
521
- }>, z.ZodString]>>;
522
- }, "strip", z.ZodTypeAny, {
523
- variables: Record<string, string | {
524
- default: string;
525
- description?: string | undefined;
526
- }>;
527
- color?: string | undefined;
528
- description?: string | undefined;
529
- }, {
530
- variables: Record<string, string | {
531
- description?: string | undefined;
532
- default?: string | undefined;
533
- }>;
534
- color?: string | undefined;
535
- description?: string | undefined;
536
- }>>>;
238
+ }, z.core.$strip>, z.ZodString]>>;
239
+ }, z.core.$strip>>>;
537
240
  'x-scalar-secrets': z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
538
241
  description: z.ZodOptional<z.ZodString>;
539
242
  example: z.ZodOptional<z.ZodString>;
540
- }, "strip", z.ZodTypeAny, {
541
- description?: string | undefined;
542
- example?: string | undefined;
543
- }, {
544
- description?: string | undefined;
545
- example?: string | undefined;
546
- }>>>;
547
- }, {
548
- uid: z.ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "collection">;
549
- /** A list of security schemes UIDs associated with the collection */
550
- securitySchemes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
551
- /** List of currently selected security scheme UIDs, these can be overridden per request */
552
- selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodBranded<z.ZodString, "securityScheme">, z.ZodArray<z.ZodBranded<z.ZodString, "securityScheme">, "many">]>, "many">>;
553
- /** The currently selected server */
554
- selectedServerUid: z.ZodOptional<z.ZodBranded<z.ZodString, "server">>;
555
- /** UIDs which refer to servers on the workspace base */
556
- servers: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "server">, "many">>;
557
- /** Request UIDs associated with a collection */
558
- requests: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "operation">, "many">>;
559
- /** Tag UIDs associated with the collection */
560
- tags: z.ZodDefault<z.ZodArray<z.ZodBranded<z.ZodString, "tag">, "many">>;
561
- /** List of requests without tags and top level tag "folders" */
562
- children: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodBranded<z.ZodString, "operation">, z.ZodBranded<z.ZodString, "tag">]>, "many">>;
563
- /**
564
- * A link to where this document is stored
565
- *
566
- * - Used for watch mode
567
- * - Possibly useful for Git sync down the line
568
- */
243
+ }, z.core.$strip>>>;
244
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "collection">;
245
+ securitySchemes: z.ZodDefault<z.ZodArray<z.ZodString>>;
246
+ selectedSecuritySchemeUids: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "securityScheme">, z.ZodArray<z.core.$ZodBranded<z.ZodString, "securityScheme">>]>>>;
247
+ selectedServerUid: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "server">>;
248
+ servers: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "server">>>;
249
+ requests: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "operation">>>;
250
+ tags: z.ZodDefault<z.ZodArray<z.core.$ZodBranded<z.ZodString, "tag">>>;
251
+ children: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "operation">, z.core.$ZodBranded<z.ZodString, "tag">]>>>;
569
252
  documentUrl: z.ZodOptional<z.ZodString>;
570
- /**
571
- * Enables polling of OpenAPI document urls
572
- *
573
- * @remarks Only effective when `documentUrl` is set
574
- */
575
253
  watchMode: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
576
- /** Keeps track of which integration is associated with the specific collection */
577
254
  integration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
578
- /**
579
- * Selected authentication will be set at the collection level instead of the request level
580
- *
581
- * @default false
582
- */
583
255
  useCollectionSecurity: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
584
- /**
585
- * Status of the watcher from above
586
- *
587
- * @defaults to idle for all collections, doesn't mean that it can watch for changes
588
- */
589
- watchModeStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<["IDLE", "WATCHING", "ERROR"]>>>;
590
- }>, "strip", z.ZodTypeAny, {
591
- uid: string & z.BRAND<"collection">;
592
- type: "collection";
593
- children: ((string & z.BRAND<"tag">) | (string & z.BRAND<"operation">))[];
594
- openapi: string;
595
- info: {
596
- title: string;
597
- version: string;
598
- description?: string | undefined;
599
- summary?: string | undefined;
600
- termsOfService?: string | undefined;
601
- contact?: {
602
- name?: string | undefined;
603
- url?: string | undefined;
604
- email?: string | undefined;
605
- } | undefined;
606
- license?: {
607
- name?: string | null | undefined;
608
- identifier?: string | undefined;
609
- url?: string | undefined;
610
- } | undefined;
611
- 'x-scalar-sdk-installation'?: {
612
- lang: string;
613
- description?: string | undefined;
614
- source?: string | undefined;
615
- }[] | undefined;
616
- };
617
- security: Record<string, string[]>[];
618
- 'x-scalar-icon': string;
619
- securitySchemes: string[];
620
- selectedSecuritySchemeUids: ((string & z.BRAND<"securityScheme">) | (string & z.BRAND<"securityScheme">)[])[];
621
- servers: (string & z.BRAND<"server">)[];
622
- requests: (string & z.BRAND<"operation">)[];
623
- tags: (string & z.BRAND<"tag">)[];
624
- watchMode: boolean;
625
- useCollectionSecurity: boolean;
626
- watchModeStatus: "IDLE" | "WATCHING" | "ERROR";
627
- externalDocs?: {
628
- url: string;
629
- description?: string | undefined;
630
- } | undefined;
631
- jsonSchemaDialect?: string | undefined;
632
- components?: Record<string, unknown> | undefined;
633
- webhooks?: Record<string, unknown> | undefined;
634
- 'x-scalar-active-environment'?: string | undefined;
635
- 'x-scalar-environments'?: Record<string, {
636
- variables: Record<string, string | {
637
- default: string;
638
- description?: string | undefined;
639
- }>;
640
- color?: string | undefined;
641
- description?: string | undefined;
642
- }> | undefined;
643
- 'x-scalar-secrets'?: Record<string, {
644
- description?: string | undefined;
645
- example?: string | undefined;
646
- }> | undefined;
647
- selectedServerUid?: (string & z.BRAND<"server">) | undefined;
648
- documentUrl?: string | undefined;
649
- integration?: string | null | undefined;
650
- }, {
651
- uid?: string | undefined;
652
- type?: "collection" | undefined;
653
- externalDocs?: unknown;
654
- children?: string[] | undefined;
655
- openapi?: string | undefined;
656
- jsonSchemaDialect?: string | undefined;
657
- info?: unknown;
658
- security?: Record<string, string[] | undefined>[] | undefined;
659
- components?: Record<string, unknown> | undefined;
660
- webhooks?: Record<string, unknown> | undefined;
661
- 'x-scalar-icon'?: string | undefined;
662
- 'x-scalar-active-environment'?: string | undefined;
663
- 'x-scalar-environments'?: Record<string, {
664
- variables: Record<string, string | {
665
- description?: string | undefined;
666
- default?: string | undefined;
667
- }>;
668
- color?: string | undefined;
669
- description?: string | undefined;
670
- }> | undefined;
671
- 'x-scalar-secrets'?: Record<string, {
672
- description?: string | undefined;
673
- example?: string | undefined;
674
- }> | undefined;
675
- securitySchemes?: string[] | undefined;
676
- selectedSecuritySchemeUids?: (string | string[])[] | undefined;
677
- selectedServerUid?: string | undefined;
678
- servers?: string[] | undefined;
679
- requests?: string[] | undefined;
680
- tags?: string[] | undefined;
681
- documentUrl?: string | undefined;
682
- watchMode?: boolean | undefined;
683
- integration?: string | null | undefined;
684
- useCollectionSecurity?: boolean | undefined;
685
- watchModeStatus?: "IDLE" | "WATCHING" | "ERROR" | undefined;
686
- }>;
256
+ watchModeStatus: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
257
+ IDLE: "IDLE";
258
+ WATCHING: "WATCHING";
259
+ ERROR: "ERROR";
260
+ }>>>;
261
+ }, z.core.$strip>;
687
262
  export type Collection = z.infer<typeof collectionSchema>;
688
263
  export type CollectionPayload = z.input<typeof collectionSchema>;
689
264
  //# sourceMappingURL=collection.d.ts.map