@scalar/oas-utils 0.2.2 → 0.2.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 (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/entities/workspace/collection/collection.d.ts +51 -17
  3. package/dist/entities/workspace/collection/collection.d.ts.map +1 -1
  4. package/dist/entities/workspace/collection/collection.js +27 -0
  5. package/dist/entities/workspace/cookie/cookie.d.ts +2 -2
  6. package/dist/entities/workspace/environment/environment.d.ts +3 -3
  7. package/dist/entities/workspace/folder/folder.d.ts +4 -4
  8. package/dist/entities/workspace/security/index.d.ts +3 -0
  9. package/dist/entities/workspace/security/index.d.ts.map +1 -0
  10. package/dist/entities/workspace/security/index.js +2 -0
  11. package/dist/entities/workspace/security/security-requirement.d.ts +13 -0
  12. package/dist/entities/workspace/security/security-requirement.d.ts.map +1 -0
  13. package/dist/entities/workspace/security/security-requirement.js +15 -0
  14. package/dist/entities/workspace/security/security-schemes.d.ts +664 -0
  15. package/dist/entities/workspace/security/security-schemes.d.ts.map +1 -0
  16. package/dist/entities/workspace/security/security-schemes.js +146 -0
  17. package/dist/entities/workspace/server/server.d.ts +6 -6
  18. package/dist/entities/workspace/spec/request-examples.d.ts +18 -18
  19. package/dist/entities/workspace/spec/requests.d.ts +29 -12
  20. package/dist/entities/workspace/spec/requests.d.ts.map +1 -1
  21. package/dist/entities/workspace/spec/requests.js +9 -0
  22. package/dist/entities/workspace/workspace.d.ts +6 -6
  23. package/dist/helpers/index.d.ts +2 -1
  24. package/dist/helpers/index.d.ts.map +1 -1
  25. package/dist/helpers/index.js +3 -2
  26. package/dist/helpers/object.d.ts +10 -0
  27. package/dist/helpers/object.d.ts.map +1 -0
  28. package/dist/helpers/{objectMerge.js → object.js} +6 -1
  29. package/dist/helpers/prettyPrintJson.d.ts +5 -1
  30. package/dist/helpers/prettyPrintJson.d.ts.map +1 -1
  31. package/dist/helpers/prettyPrintJson.js +31 -8
  32. package/dist/helpers/string.d.ts +10 -0
  33. package/dist/helpers/string.d.ts.map +1 -0
  34. package/dist/helpers/string.js +14 -0
  35. package/dist/spec-getters/getRequestBodyFromOperation.d.ts +1 -1
  36. package/dist/transforms/import-spec.d.ts +8 -3
  37. package/dist/transforms/import-spec.d.ts.map +1 -1
  38. package/dist/transforms/import-spec.js +13 -0
  39. package/dist/types.d.ts +1 -1
  40. package/dist/types.d.ts.map +1 -1
  41. package/package.json +4 -4
  42. package/dist/entities/workspace/security-schemes/index.d.ts +0 -2
  43. package/dist/entities/workspace/security-schemes/index.d.ts.map +0 -1
  44. package/dist/entities/workspace/security-schemes/index.js +0 -1
  45. package/dist/entities/workspace/security-schemes/security-schemes.d.ts +0 -19
  46. package/dist/entities/workspace/security-schemes/security-schemes.d.ts.map +0 -1
  47. package/dist/entities/workspace/security-schemes/security-schemes.js +0 -15
  48. package/dist/helpers/objectMerge.d.ts +0 -5
  49. package/dist/helpers/objectMerge.d.ts.map +0 -1
@@ -0,0 +1,664 @@
1
+ import type { ValueOf } from 'type-fest';
2
+ import { z } from 'zod';
3
+ declare const securitySchemeOauth2: z.ZodObject<{
4
+ type: z.ZodLiteral<"oauth2">;
5
+ uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ /** REQUIRED. An object containing configuration information for the flow types supported. */
8
+ flows: z.ZodDefault<z.ZodOptional<z.ZodObject<{
9
+ /** Configuration for the OAuth Implicit flow */
10
+ implicit: z.ZodOptional<z.ZodObject<{
11
+ authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
12
+ refreshUrl: z.ZodOptional<z.ZodString>;
13
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
14
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
15
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ authorizationUrl: string;
18
+ selectedScopes: string[];
19
+ token: string;
20
+ refreshUrl?: string | undefined;
21
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
22
+ }, {
23
+ authorizationUrl?: string | undefined;
24
+ refreshUrl?: string | undefined;
25
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
26
+ selectedScopes?: string[] | undefined;
27
+ token?: string | undefined;
28
+ }>>;
29
+ /** Configuration for the OAuth Resource Owner Password flow */
30
+ password: z.ZodOptional<z.ZodObject<{
31
+ tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
32
+ refreshUrl: z.ZodOptional<z.ZodString>;
33
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
34
+ username: z.ZodDefault<z.ZodOptional<z.ZodString>>;
35
+ password: z.ZodDefault<z.ZodOptional<z.ZodString>>;
36
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
37
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ selectedScopes: string[];
40
+ token: string;
41
+ tokenUrl: string;
42
+ username: string;
43
+ password: string;
44
+ refreshUrl?: string | undefined;
45
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
46
+ }, {
47
+ refreshUrl?: string | undefined;
48
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
49
+ selectedScopes?: string[] | undefined;
50
+ token?: string | undefined;
51
+ tokenUrl?: string | undefined;
52
+ username?: string | undefined;
53
+ password?: string | undefined;
54
+ }>>;
55
+ /** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */
56
+ clientCredentials: z.ZodOptional<z.ZodObject<{
57
+ tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
58
+ refreshUrl: z.ZodOptional<z.ZodString>;
59
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
60
+ clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
61
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
62
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
63
+ }, "strip", z.ZodTypeAny, {
64
+ selectedScopes: string[];
65
+ token: string;
66
+ tokenUrl: string;
67
+ clientSecret: string;
68
+ refreshUrl?: string | undefined;
69
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
70
+ }, {
71
+ refreshUrl?: string | undefined;
72
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
73
+ selectedScopes?: string[] | undefined;
74
+ token?: string | undefined;
75
+ tokenUrl?: string | undefined;
76
+ clientSecret?: string | undefined;
77
+ }>>;
78
+ /** Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.*/
79
+ authorizationCode: z.ZodOptional<z.ZodObject<{
80
+ authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
81
+ tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
82
+ refreshUrl: z.ZodOptional<z.ZodString>;
83
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
84
+ clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
85
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
86
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ authorizationUrl: string;
89
+ selectedScopes: string[];
90
+ token: string;
91
+ tokenUrl: string;
92
+ clientSecret: string;
93
+ refreshUrl?: string | undefined;
94
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
95
+ }, {
96
+ authorizationUrl?: string | undefined;
97
+ refreshUrl?: string | undefined;
98
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
99
+ selectedScopes?: string[] | undefined;
100
+ token?: string | undefined;
101
+ tokenUrl?: string | undefined;
102
+ clientSecret?: string | undefined;
103
+ }>>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ implicit?: {
106
+ authorizationUrl: string;
107
+ selectedScopes: string[];
108
+ token: string;
109
+ refreshUrl?: string | undefined;
110
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
111
+ } | undefined;
112
+ password?: {
113
+ selectedScopes: string[];
114
+ token: string;
115
+ tokenUrl: string;
116
+ username: string;
117
+ password: string;
118
+ refreshUrl?: string | undefined;
119
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
120
+ } | undefined;
121
+ clientCredentials?: {
122
+ selectedScopes: string[];
123
+ token: string;
124
+ tokenUrl: string;
125
+ clientSecret: string;
126
+ refreshUrl?: string | undefined;
127
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
128
+ } | undefined;
129
+ authorizationCode?: {
130
+ authorizationUrl: string;
131
+ selectedScopes: string[];
132
+ token: string;
133
+ tokenUrl: string;
134
+ clientSecret: string;
135
+ refreshUrl?: string | undefined;
136
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
137
+ } | undefined;
138
+ }, {
139
+ implicit?: {
140
+ authorizationUrl?: string | undefined;
141
+ refreshUrl?: string | undefined;
142
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
143
+ selectedScopes?: string[] | undefined;
144
+ token?: string | undefined;
145
+ } | undefined;
146
+ password?: {
147
+ refreshUrl?: string | undefined;
148
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
149
+ selectedScopes?: string[] | undefined;
150
+ token?: string | undefined;
151
+ tokenUrl?: string | undefined;
152
+ username?: string | undefined;
153
+ password?: string | undefined;
154
+ } | undefined;
155
+ clientCredentials?: {
156
+ refreshUrl?: string | undefined;
157
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
158
+ selectedScopes?: string[] | undefined;
159
+ token?: string | undefined;
160
+ tokenUrl?: string | undefined;
161
+ clientSecret?: string | undefined;
162
+ } | undefined;
163
+ authorizationCode?: {
164
+ authorizationUrl?: string | undefined;
165
+ refreshUrl?: string | undefined;
166
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
167
+ selectedScopes?: string[] | undefined;
168
+ token?: string | undefined;
169
+ tokenUrl?: string | undefined;
170
+ clientSecret?: string | undefined;
171
+ } | undefined;
172
+ }>>>;
173
+ clientId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
174
+ redirectUri: z.ZodDefault<z.ZodOptional<z.ZodString>>;
175
+ }, "strip", z.ZodTypeAny, {
176
+ type: "oauth2";
177
+ uid: string;
178
+ flows: {
179
+ implicit?: {
180
+ authorizationUrl: string;
181
+ selectedScopes: string[];
182
+ token: string;
183
+ refreshUrl?: string | undefined;
184
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
185
+ } | undefined;
186
+ password?: {
187
+ selectedScopes: string[];
188
+ token: string;
189
+ tokenUrl: string;
190
+ username: string;
191
+ password: string;
192
+ refreshUrl?: string | undefined;
193
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
194
+ } | undefined;
195
+ clientCredentials?: {
196
+ selectedScopes: string[];
197
+ token: string;
198
+ tokenUrl: string;
199
+ clientSecret: string;
200
+ refreshUrl?: string | undefined;
201
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
202
+ } | undefined;
203
+ authorizationCode?: {
204
+ authorizationUrl: string;
205
+ selectedScopes: string[];
206
+ token: string;
207
+ tokenUrl: string;
208
+ clientSecret: string;
209
+ refreshUrl?: string | undefined;
210
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
211
+ } | undefined;
212
+ };
213
+ clientId: string;
214
+ redirectUri: string;
215
+ description?: string | undefined;
216
+ }, {
217
+ type: "oauth2";
218
+ uid?: string | undefined;
219
+ description?: string | undefined;
220
+ flows?: {
221
+ implicit?: {
222
+ authorizationUrl?: string | undefined;
223
+ refreshUrl?: string | undefined;
224
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
225
+ selectedScopes?: string[] | undefined;
226
+ token?: string | undefined;
227
+ } | undefined;
228
+ password?: {
229
+ refreshUrl?: string | undefined;
230
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
231
+ selectedScopes?: string[] | undefined;
232
+ token?: string | undefined;
233
+ tokenUrl?: string | undefined;
234
+ username?: string | undefined;
235
+ password?: string | undefined;
236
+ } | undefined;
237
+ clientCredentials?: {
238
+ refreshUrl?: string | undefined;
239
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
240
+ selectedScopes?: string[] | undefined;
241
+ token?: string | undefined;
242
+ tokenUrl?: string | undefined;
243
+ clientSecret?: string | undefined;
244
+ } | undefined;
245
+ authorizationCode?: {
246
+ authorizationUrl?: string | undefined;
247
+ refreshUrl?: string | undefined;
248
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
249
+ selectedScopes?: string[] | undefined;
250
+ token?: string | undefined;
251
+ tokenUrl?: string | undefined;
252
+ clientSecret?: string | undefined;
253
+ } | undefined;
254
+ } | undefined;
255
+ clientId?: string | undefined;
256
+ redirectUri?: string | undefined;
257
+ }>;
258
+ export type SecuritySchemeOauth2 = z.infer<typeof securitySchemeOauth2>;
259
+ export type SelectedSchemeOauth2 = {
260
+ scheme: SecuritySchemeOauth2;
261
+ flow: ValueOf<Required<SecuritySchemeOauth2['flows']>>;
262
+ };
263
+ declare const securityScheme: z.ZodUnion<[z.ZodObject<{
264
+ type: z.ZodLiteral<"apiKey">;
265
+ uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
266
+ description: z.ZodOptional<z.ZodString>;
267
+ /** REQUIRED. The name of the header, query or cookie parameter to be used. */
268
+ name: z.ZodDefault<z.ZodOptional<z.ZodString>>;
269
+ /** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
270
+ in: z.ZodDefault<z.ZodOptional<z.ZodEnum<["query", "header", "cookie"]>>>;
271
+ value: z.ZodDefault<z.ZodOptional<z.ZodString>>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ type: "apiKey";
274
+ value: string;
275
+ uid: string;
276
+ name: string;
277
+ in: "query" | "header" | "cookie";
278
+ description?: string | undefined;
279
+ }, {
280
+ type: "apiKey";
281
+ value?: string | undefined;
282
+ uid?: string | undefined;
283
+ description?: string | undefined;
284
+ name?: string | undefined;
285
+ in?: "query" | "header" | "cookie" | undefined;
286
+ }>, z.ZodObject<{
287
+ type: z.ZodLiteral<"http">;
288
+ uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
289
+ description: z.ZodOptional<z.ZodString>;
290
+ /**
291
+ * REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in
292
+ * [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.
293
+ */
294
+ scheme: z.ZodDefault<z.ZodOptional<z.ZodEnum<["basic", "bearer"]>>>;
295
+ /**
296
+ * A hint to the client to identify how the bearer token is formatted.
297
+ * Bearer tokens are usually generated by an authorization server, so
298
+ * this information is primarily for documentation purposes.
299
+ */
300
+ bearerFormat: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"JWT">, z.ZodString]>>>;
301
+ value: z.ZodDefault<z.ZodOptional<z.ZodString>>;
302
+ secondValue: z.ZodDefault<z.ZodOptional<z.ZodString>>;
303
+ }, "strip", z.ZodTypeAny, {
304
+ type: "http";
305
+ value: string;
306
+ uid: string;
307
+ scheme: "basic" | "bearer";
308
+ bearerFormat: string;
309
+ secondValue: string;
310
+ description?: string | undefined;
311
+ }, {
312
+ type: "http";
313
+ value?: string | undefined;
314
+ uid?: string | undefined;
315
+ description?: string | undefined;
316
+ scheme?: "basic" | "bearer" | undefined;
317
+ bearerFormat?: string | undefined;
318
+ secondValue?: string | undefined;
319
+ }>, z.ZodObject<{
320
+ type: z.ZodLiteral<"oauth2">;
321
+ uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
322
+ description: z.ZodOptional<z.ZodString>;
323
+ /** REQUIRED. An object containing configuration information for the flow types supported. */
324
+ flows: z.ZodDefault<z.ZodOptional<z.ZodObject<{
325
+ /** Configuration for the OAuth Implicit flow */
326
+ implicit: z.ZodOptional<z.ZodObject<{
327
+ authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
328
+ refreshUrl: z.ZodOptional<z.ZodString>;
329
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
330
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
331
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
332
+ }, "strip", z.ZodTypeAny, {
333
+ authorizationUrl: string;
334
+ selectedScopes: string[];
335
+ token: string;
336
+ refreshUrl?: string | undefined;
337
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
338
+ }, {
339
+ authorizationUrl?: string | undefined;
340
+ refreshUrl?: string | undefined;
341
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
342
+ selectedScopes?: string[] | undefined;
343
+ token?: string | undefined;
344
+ }>>;
345
+ /** Configuration for the OAuth Resource Owner Password flow */
346
+ password: z.ZodOptional<z.ZodObject<{
347
+ tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
348
+ refreshUrl: z.ZodOptional<z.ZodString>;
349
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
350
+ username: z.ZodDefault<z.ZodOptional<z.ZodString>>;
351
+ password: z.ZodDefault<z.ZodOptional<z.ZodString>>;
352
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
353
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
354
+ }, "strip", z.ZodTypeAny, {
355
+ selectedScopes: string[];
356
+ token: string;
357
+ tokenUrl: string;
358
+ username: string;
359
+ password: string;
360
+ refreshUrl?: string | undefined;
361
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
362
+ }, {
363
+ refreshUrl?: string | undefined;
364
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
365
+ selectedScopes?: string[] | undefined;
366
+ token?: string | undefined;
367
+ tokenUrl?: string | undefined;
368
+ username?: string | undefined;
369
+ password?: string | undefined;
370
+ }>>;
371
+ /** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */
372
+ clientCredentials: z.ZodOptional<z.ZodObject<{
373
+ tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
374
+ refreshUrl: z.ZodOptional<z.ZodString>;
375
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
376
+ clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
377
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
378
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ selectedScopes: string[];
381
+ token: string;
382
+ tokenUrl: string;
383
+ clientSecret: string;
384
+ refreshUrl?: string | undefined;
385
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
386
+ }, {
387
+ refreshUrl?: string | undefined;
388
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
389
+ selectedScopes?: string[] | undefined;
390
+ token?: string | undefined;
391
+ tokenUrl?: string | undefined;
392
+ clientSecret?: string | undefined;
393
+ }>>;
394
+ /** Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.*/
395
+ authorizationCode: z.ZodOptional<z.ZodObject<{
396
+ authorizationUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
397
+ tokenUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
398
+ refreshUrl: z.ZodOptional<z.ZodString>;
399
+ scopes: z.ZodOptional<z.ZodUnion<[z.ZodMap<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>;
400
+ clientSecret: z.ZodDefault<z.ZodOptional<z.ZodString>>;
401
+ selectedScopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
402
+ token: z.ZodDefault<z.ZodOptional<z.ZodString>>;
403
+ }, "strip", z.ZodTypeAny, {
404
+ authorizationUrl: string;
405
+ selectedScopes: string[];
406
+ token: string;
407
+ tokenUrl: string;
408
+ clientSecret: string;
409
+ refreshUrl?: string | undefined;
410
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
411
+ }, {
412
+ authorizationUrl?: string | undefined;
413
+ refreshUrl?: string | undefined;
414
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
415
+ selectedScopes?: string[] | undefined;
416
+ token?: string | undefined;
417
+ tokenUrl?: string | undefined;
418
+ clientSecret?: string | undefined;
419
+ }>>;
420
+ }, "strip", z.ZodTypeAny, {
421
+ implicit?: {
422
+ authorizationUrl: string;
423
+ selectedScopes: string[];
424
+ token: string;
425
+ refreshUrl?: string | undefined;
426
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
427
+ } | undefined;
428
+ password?: {
429
+ selectedScopes: string[];
430
+ token: string;
431
+ tokenUrl: string;
432
+ username: string;
433
+ password: string;
434
+ refreshUrl?: string | undefined;
435
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
436
+ } | undefined;
437
+ clientCredentials?: {
438
+ selectedScopes: string[];
439
+ token: string;
440
+ tokenUrl: string;
441
+ clientSecret: string;
442
+ refreshUrl?: string | undefined;
443
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
444
+ } | undefined;
445
+ authorizationCode?: {
446
+ authorizationUrl: string;
447
+ selectedScopes: string[];
448
+ token: string;
449
+ tokenUrl: string;
450
+ clientSecret: string;
451
+ refreshUrl?: string | undefined;
452
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
453
+ } | undefined;
454
+ }, {
455
+ implicit?: {
456
+ authorizationUrl?: string | undefined;
457
+ refreshUrl?: string | undefined;
458
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
459
+ selectedScopes?: string[] | undefined;
460
+ token?: string | undefined;
461
+ } | undefined;
462
+ password?: {
463
+ refreshUrl?: string | undefined;
464
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
465
+ selectedScopes?: string[] | undefined;
466
+ token?: string | undefined;
467
+ tokenUrl?: string | undefined;
468
+ username?: string | undefined;
469
+ password?: string | undefined;
470
+ } | undefined;
471
+ clientCredentials?: {
472
+ refreshUrl?: string | undefined;
473
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
474
+ selectedScopes?: string[] | undefined;
475
+ token?: string | undefined;
476
+ tokenUrl?: string | undefined;
477
+ clientSecret?: string | undefined;
478
+ } | undefined;
479
+ authorizationCode?: {
480
+ authorizationUrl?: string | undefined;
481
+ refreshUrl?: string | undefined;
482
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
483
+ selectedScopes?: string[] | undefined;
484
+ token?: string | undefined;
485
+ tokenUrl?: string | undefined;
486
+ clientSecret?: string | undefined;
487
+ } | undefined;
488
+ }>>>;
489
+ clientId: z.ZodDefault<z.ZodOptional<z.ZodString>>;
490
+ redirectUri: z.ZodDefault<z.ZodOptional<z.ZodString>>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ type: "oauth2";
493
+ uid: string;
494
+ flows: {
495
+ implicit?: {
496
+ authorizationUrl: string;
497
+ selectedScopes: string[];
498
+ token: string;
499
+ refreshUrl?: string | undefined;
500
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
501
+ } | undefined;
502
+ password?: {
503
+ selectedScopes: string[];
504
+ token: string;
505
+ tokenUrl: string;
506
+ username: string;
507
+ password: string;
508
+ refreshUrl?: string | undefined;
509
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
510
+ } | undefined;
511
+ clientCredentials?: {
512
+ selectedScopes: string[];
513
+ token: string;
514
+ tokenUrl: string;
515
+ clientSecret: string;
516
+ refreshUrl?: string | undefined;
517
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
518
+ } | undefined;
519
+ authorizationCode?: {
520
+ authorizationUrl: string;
521
+ selectedScopes: string[];
522
+ token: string;
523
+ tokenUrl: string;
524
+ clientSecret: string;
525
+ refreshUrl?: string | undefined;
526
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
527
+ } | undefined;
528
+ };
529
+ clientId: string;
530
+ redirectUri: string;
531
+ description?: string | undefined;
532
+ }, {
533
+ type: "oauth2";
534
+ uid?: string | undefined;
535
+ description?: string | undefined;
536
+ flows?: {
537
+ implicit?: {
538
+ authorizationUrl?: string | undefined;
539
+ refreshUrl?: string | undefined;
540
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
541
+ selectedScopes?: string[] | undefined;
542
+ token?: string | undefined;
543
+ } | undefined;
544
+ password?: {
545
+ refreshUrl?: string | undefined;
546
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
547
+ selectedScopes?: string[] | undefined;
548
+ token?: string | undefined;
549
+ tokenUrl?: string | undefined;
550
+ username?: string | undefined;
551
+ password?: string | undefined;
552
+ } | undefined;
553
+ clientCredentials?: {
554
+ refreshUrl?: string | undefined;
555
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
556
+ selectedScopes?: string[] | undefined;
557
+ token?: string | undefined;
558
+ tokenUrl?: string | undefined;
559
+ clientSecret?: string | undefined;
560
+ } | undefined;
561
+ authorizationCode?: {
562
+ authorizationUrl?: string | undefined;
563
+ refreshUrl?: string | undefined;
564
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
565
+ selectedScopes?: string[] | undefined;
566
+ token?: string | undefined;
567
+ tokenUrl?: string | undefined;
568
+ clientSecret?: string | undefined;
569
+ } | undefined;
570
+ } | undefined;
571
+ clientId?: string | undefined;
572
+ redirectUri?: string | undefined;
573
+ }>, z.ZodObject<{
574
+ type: z.ZodLiteral<"openIdConnect">;
575
+ uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
576
+ description: z.ZodOptional<z.ZodString>;
577
+ /**
578
+ * REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the
579
+ * form of a URL. The OpenID Connect standard requires the use of TLS.
580
+ */
581
+ openIdConnectUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
582
+ }, "strip", z.ZodTypeAny, {
583
+ type: "openIdConnect";
584
+ uid: string;
585
+ openIdConnectUrl: string;
586
+ description?: string | undefined;
587
+ }, {
588
+ type: "openIdConnect";
589
+ uid?: string | undefined;
590
+ description?: string | undefined;
591
+ openIdConnectUrl?: string | undefined;
592
+ }>]>;
593
+ /**
594
+ * Security Scheme Object
595
+ *
596
+ * @see https://spec.openapis.org/oas/latest.html#security-scheme-object
597
+ */
598
+ export type SecurityScheme = z.infer<typeof securityScheme>;
599
+ export type SecuritySchemePayload = z.input<typeof securityScheme>;
600
+ /** Create Security Scheme with defaults */
601
+ export declare const createSecurityScheme: (payload: SecuritySchemePayload) => {
602
+ type: "apiKey";
603
+ value: string;
604
+ uid: string;
605
+ name: string;
606
+ in: "query" | "header" | "cookie";
607
+ description?: string | undefined;
608
+ } | {
609
+ type: "http";
610
+ value: string;
611
+ uid: string;
612
+ scheme: "basic" | "bearer";
613
+ bearerFormat: string;
614
+ secondValue: string;
615
+ description?: string | undefined;
616
+ } | {
617
+ type: "oauth2";
618
+ uid: string;
619
+ flows: {
620
+ implicit?: {
621
+ authorizationUrl: string;
622
+ selectedScopes: string[];
623
+ token: string;
624
+ refreshUrl?: string | undefined;
625
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
626
+ } | undefined;
627
+ password?: {
628
+ selectedScopes: string[];
629
+ token: string;
630
+ tokenUrl: string;
631
+ username: string;
632
+ password: string;
633
+ refreshUrl?: string | undefined;
634
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
635
+ } | undefined;
636
+ clientCredentials?: {
637
+ selectedScopes: string[];
638
+ token: string;
639
+ tokenUrl: string;
640
+ clientSecret: string;
641
+ refreshUrl?: string | undefined;
642
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
643
+ } | undefined;
644
+ authorizationCode?: {
645
+ authorizationUrl: string;
646
+ selectedScopes: string[];
647
+ token: string;
648
+ tokenUrl: string;
649
+ clientSecret: string;
650
+ refreshUrl?: string | undefined;
651
+ scopes?: Map<string, string | undefined> | Record<string, string | undefined> | {} | undefined;
652
+ } | undefined;
653
+ };
654
+ clientId: string;
655
+ redirectUri: string;
656
+ description?: string | undefined;
657
+ } | {
658
+ type: "openIdConnect";
659
+ uid: string;
660
+ openIdConnectUrl: string;
661
+ description?: string | undefined;
662
+ };
663
+ export {};
664
+ //# sourceMappingURL=security-schemes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-schemes.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/security/security-schemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAoIvB,QAAA,MAAM,oBAAoB;;;;IAIxB,6FAA6F;;QA3D3F,gDAAgD;;;;;;;;;;;;;;;;;;;;QAWhD,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;QAa/D,yGAAyG;;;;;;;;;;;;;;;;;;;;;;;QAYzG,uGAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BzG,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACvE,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;CACvD,CAAA;AAaD,QAAA,MAAM,cAAc;;;;IAlJlB,8EAA8E;;IAE9E,6FAA6F;;;;;;;;;;;;;;;;;;;;;IAU7F;;;OAGG;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;IAsGH,6FAA6F;;QA3D3F,gDAAgD;;;;;;;;;;;;;;;;;;;;QAWhD,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;QAa/D,yGAAyG;;;;;;;;;;;;;;;;;;;;;;;QAYzG,uGAAuG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuCzG;;;OAGG;;;;;;;;;;;;IASH,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAC3D,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAElE,2CAA2C;AAC3C,eAAO,MAAM,oBAAoB,YAAa,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACpC,CAAA"}