@scalar/oas-utils 0.2.3 → 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 (43) hide show
  1. package/CHANGELOG.md +6 -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 +23 -11
  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 +2 -1
  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/string.d.ts +10 -0
  30. package/dist/helpers/string.d.ts.map +1 -0
  31. package/dist/helpers/string.js +14 -0
  32. package/dist/transforms/import-spec.d.ts +8 -3
  33. package/dist/transforms/import-spec.d.ts.map +1 -1
  34. package/dist/transforms/import-spec.js +13 -0
  35. package/package.json +4 -4
  36. package/dist/entities/workspace/security-schemes/index.d.ts +0 -2
  37. package/dist/entities/workspace/security-schemes/index.d.ts.map +0 -1
  38. package/dist/entities/workspace/security-schemes/index.js +0 -1
  39. package/dist/entities/workspace/security-schemes/security-schemes.d.ts +0 -19
  40. package/dist/entities/workspace/security-schemes/security-schemes.d.ts.map +0 -1
  41. package/dist/entities/workspace/security-schemes/security-schemes.js +0 -15
  42. package/dist/helpers/objectMerge.d.ts +0 -5
  43. package/dist/helpers/objectMerge.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/oas-utils
2
2
 
3
+ ## 0.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - c20c7d0: feat: security schemes and requirements
8
+
3
9
  ## 0.2.3
4
10
 
5
11
  ### Patch Changes
@@ -14,14 +14,22 @@ declare const exteralDocumentationSchema: z.ZodObject<{
14
14
  url: string;
15
15
  description?: string | undefined;
16
16
  }, {
17
- url?: string | undefined;
18
17
  description?: string | undefined;
18
+ url?: string | undefined;
19
19
  }>;
20
20
  export type ExternalDocumentation = z.infer<typeof exteralDocumentationSchema>;
21
21
  declare const collectionSchema: z.ZodObject<{
22
22
  uid: z.ZodDefault<z.ZodOptional<z.ZodString>>;
23
23
  spec: z.ZodDefault<z.ZodOptional<z.ZodObject<{
24
24
  openapi: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"3.1.0">, z.ZodLiteral<"4.0.0">]>>>;
25
+ /**
26
+ * A declaration of which security mechanisms can be used across the API. The list of
27
+ * values includes alternative security requirement objects that can be used. Only
28
+ * one of the security requirement objects need to be satisfied to authorize a request.
29
+ * Individual operations can override this definition. To make security optional, an empty
30
+ * security requirement ({}) can be included in the array.
31
+ */
32
+ security: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>, "many">>>;
25
33
  /** OAS info */
26
34
  info: z.ZodOptional<z.ZodObject<{
27
35
  /** REQUIRED. The title of the API. */
@@ -77,8 +85,8 @@ declare const collectionSchema: z.ZodObject<{
77
85
  }, "strip", z.ZodTypeAny, {
78
86
  title: string;
79
87
  version: string;
80
- summary?: string | undefined;
81
88
  description?: string | undefined;
89
+ summary?: string | undefined;
82
90
  termsOfService?: string | undefined;
83
91
  contact?: {
84
92
  name?: string | undefined;
@@ -91,9 +99,9 @@ declare const collectionSchema: z.ZodObject<{
91
99
  url?: string | undefined;
92
100
  } | undefined;
93
101
  }, {
102
+ description?: string | undefined;
94
103
  title?: string | undefined;
95
104
  summary?: string | undefined;
96
- description?: string | undefined;
97
105
  termsOfService?: string | undefined;
98
106
  contact?: {
99
107
  name?: string | undefined;
@@ -125,8 +133,8 @@ declare const collectionSchema: z.ZodObject<{
125
133
  url: string;
126
134
  description?: string | undefined;
127
135
  }, {
128
- url?: string | undefined;
129
136
  description?: string | undefined;
137
+ url?: string | undefined;
130
138
  }>>;
131
139
  }, "strip", z.ZodTypeAny, {
132
140
  name: string;
@@ -136,11 +144,11 @@ declare const collectionSchema: z.ZodObject<{
136
144
  description?: string | undefined;
137
145
  } | undefined;
138
146
  }, {
139
- name?: string | undefined;
140
147
  description?: string | undefined;
148
+ name?: string | undefined;
141
149
  externalDocs?: {
142
- url?: string | undefined;
143
150
  description?: string | undefined;
151
+ url?: string | undefined;
144
152
  } | undefined;
145
153
  }>, "many">>;
146
154
  externalDocs: z.ZodOptional<z.ZodObject<{
@@ -152,11 +160,12 @@ declare const collectionSchema: z.ZodObject<{
152
160
  url: string;
153
161
  description?: string | undefined;
154
162
  }, {
155
- url?: string | undefined;
156
163
  description?: string | undefined;
164
+ url?: string | undefined;
157
165
  }>>;
158
166
  }, "strip", z.ZodTypeAny, {
159
167
  openapi: string;
168
+ security: Record<string, string[]>[];
160
169
  serverUids: string[];
161
170
  tags: {
162
171
  name: string;
@@ -173,8 +182,8 @@ declare const collectionSchema: z.ZodObject<{
173
182
  info?: {
174
183
  title: string;
175
184
  version: string;
176
- summary?: string | undefined;
177
185
  description?: string | undefined;
186
+ summary?: string | undefined;
178
187
  termsOfService?: string | undefined;
179
188
  contact?: {
180
189
  name?: string | undefined;
@@ -189,14 +198,15 @@ declare const collectionSchema: z.ZodObject<{
189
198
  } | undefined;
190
199
  }, {
191
200
  externalDocs?: {
192
- url?: string | undefined;
193
201
  description?: string | undefined;
202
+ url?: string | undefined;
194
203
  } | undefined;
195
204
  openapi?: string | undefined;
205
+ security?: Record<string, string[] | undefined>[] | undefined;
196
206
  info?: {
207
+ description?: string | undefined;
197
208
  title?: string | undefined;
198
209
  summary?: string | undefined;
199
- description?: string | undefined;
200
210
  termsOfService?: string | undefined;
201
211
  contact?: {
202
212
  name?: string | undefined;
@@ -212,14 +222,28 @@ declare const collectionSchema: z.ZodObject<{
212
222
  } | undefined;
213
223
  serverUids?: string[] | undefined;
214
224
  tags?: {
215
- name?: string | undefined;
216
225
  description?: string | undefined;
226
+ name?: string | undefined;
217
227
  externalDocs?: {
218
- url?: string | undefined;
219
228
  description?: string | undefined;
229
+ url?: string | undefined;
220
230
  } | undefined;
221
231
  }[] | undefined;
222
232
  }>>>;
233
+ /**
234
+ * The currently selected security scheme key
235
+ * TODO eventually we will need to maintain one per request + collection but this will do for now
236
+ */
237
+ selectedSecuritySchemes: z.ZodDefault<z.ZodArray<z.ZodObject<{
238
+ uid: z.ZodString;
239
+ flowKey: z.ZodOptional<z.ZodEnum<["implicit", "clientCredentials", "password", "authorizationCode"]>>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ uid: string;
242
+ flowKey?: "implicit" | "password" | "clientCredentials" | "authorizationCode" | undefined;
243
+ }, {
244
+ uid: string;
245
+ flowKey?: "implicit" | "password" | "clientCredentials" | "authorizationCode" | undefined;
246
+ }>, "many">>;
223
247
  /** The currently selected server */
224
248
  selectedServerUid: z.ZodDefault<z.ZodString>;
225
249
  /** List of uids that correspond to collection requests or folders */
@@ -228,6 +252,7 @@ declare const collectionSchema: z.ZodObject<{
228
252
  uid: string;
229
253
  spec: {
230
254
  openapi: string;
255
+ security: Record<string, string[]>[];
231
256
  serverUids: string[];
232
257
  tags: {
233
258
  name: string;
@@ -244,8 +269,8 @@ declare const collectionSchema: z.ZodObject<{
244
269
  info?: {
245
270
  title: string;
246
271
  version: string;
247
- summary?: string | undefined;
248
272
  description?: string | undefined;
273
+ summary?: string | undefined;
249
274
  termsOfService?: string | undefined;
250
275
  contact?: {
251
276
  name?: string | undefined;
@@ -259,20 +284,25 @@ declare const collectionSchema: z.ZodObject<{
259
284
  } | undefined;
260
285
  } | undefined;
261
286
  };
287
+ selectedSecuritySchemes: {
288
+ uid: string;
289
+ flowKey?: "implicit" | "password" | "clientCredentials" | "authorizationCode" | undefined;
290
+ }[];
262
291
  selectedServerUid: string;
263
292
  childUids: string[];
264
293
  }, {
265
294
  uid?: string | undefined;
266
295
  spec?: {
267
296
  externalDocs?: {
268
- url?: string | undefined;
269
297
  description?: string | undefined;
298
+ url?: string | undefined;
270
299
  } | undefined;
271
300
  openapi?: string | undefined;
301
+ security?: Record<string, string[] | undefined>[] | undefined;
272
302
  info?: {
303
+ description?: string | undefined;
273
304
  title?: string | undefined;
274
305
  summary?: string | undefined;
275
- description?: string | undefined;
276
306
  termsOfService?: string | undefined;
277
307
  contact?: {
278
308
  name?: string | undefined;
@@ -288,14 +318,18 @@ declare const collectionSchema: z.ZodObject<{
288
318
  } | undefined;
289
319
  serverUids?: string[] | undefined;
290
320
  tags?: {
291
- name?: string | undefined;
292
321
  description?: string | undefined;
322
+ name?: string | undefined;
293
323
  externalDocs?: {
294
- url?: string | undefined;
295
324
  description?: string | undefined;
325
+ url?: string | undefined;
296
326
  } | undefined;
297
327
  }[] | undefined;
298
328
  } | undefined;
329
+ selectedSecuritySchemes?: {
330
+ uid: string;
331
+ flowKey?: "implicit" | "password" | "clientCredentials" | "authorizationCode" | undefined;
332
+ }[] | undefined;
299
333
  selectedServerUid?: string | undefined;
300
334
  childUids?: string[] | undefined;
301
335
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/collection/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6DvB;;;;;GAKG;AACH,QAAA,MAAM,0BAA0B;IAC9B,6GAA6G;;IAE7G,yFAAyF;;;;;;;;EAEzF,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAgC9E,QAAA,MAAM,gBAAgB;;;;QATpB,eAAe;;YAtDf,sCAAsC;;YAEtC,kCAAkC;;YAElC,4FAA4F;;YAE5F,oFAAoF;;YAEpF,mDAAmD;;gBAxBnD,+DAA+D;;gBAE/D,sFAAsF;;gBAEtF,0GAA0G;;;;;;;;;;;YAsB1G,mDAAmD;;gBA5CnD,mDAAmD;;gBAEnD,2GAA2G;;gBAE3G;;;mBAGG;;;;;;;;;;;YAuCH;;;eAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAyCH,wDAAwD;;QAExD,eAAe;;YAjBf,qCAAqC;;YAErC,6FAA6F;;YAE7F,sDAAsD;;gBAnBtD,6GAA6G;;gBAE7G,yFAAyF;;;;;;;;;;;;;;;;;;;;;;;;;YAFzF,6GAA6G;;YAE7G,yFAAyF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsCzF,oCAAoC;;IAEpC,sEAAsE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtE,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEhE,8BAA8B;AAC9B,eAAO,MAAM,gBAAgB,YAAa,iBAAiB,KAAG,UACd,CAAA"}
1
+ {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/collection/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA+DvB;;;;;GAKG;AACH,QAAA,MAAM,0BAA0B;IAC9B,6GAA6G;;IAE7G,yFAAyF;;;;;;;;EAEzF,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAwC9E,QAAA,MAAM,gBAAgB;;;;QAjBpB;;;;;;WAMG;;QAEH,eAAe;;YA9Df,sCAAsC;;YAEtC,kCAAkC;;YAElC,4FAA4F;;YAE5F,oFAAoF;;YAEpF,mDAAmD;;gBAxBnD,+DAA+D;;gBAE/D,sFAAsF;;gBAEtF,0GAA0G;;;;;;;;;;;YAsB1G,mDAAmD;;gBA5CnD,mDAAmD;;gBAEnD,2GAA2G;;gBAE3G;;;mBAGG;;;;;;;;;;;YAuCH;;;eAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAiDH,wDAAwD;;QAExD,eAAe;;YAzBf,qCAAqC;;YAErC,6FAA6F;;YAE7F,sDAAsD;;gBAnBtD,6GAA6G;;gBAE7G,yFAAyF;;;;;;;;;;;;;;;;;;;;;;;;;YAFzF,6GAA6G;;YAE7G,yFAAyF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8CzF;;;OAGG;;;;;;;;;;;IAiBH,oCAAoC;;IAEpC,sEAAsE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtE,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AACzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEhE,8BAA8B;AAC9B,eAAO,MAAM,gBAAgB,YAAa,iBAAiB,KAAG,UACd,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { securityRequirement } from '../security/security-requirement.js';
2
3
  import { nanoidSchema } from '../shared/utility.js';
3
4
  import { deepMerge } from '../../../helpers/deepMerge.js';
4
5
 
@@ -90,6 +91,14 @@ const specSchema = z.object({
90
91
  .union([z.string(), z.literal('3.1.0'), z.literal('4.0.0')])
91
92
  .optional()
92
93
  .default('3.1.0'),
94
+ /**
95
+ * A declaration of which security mechanisms can be used across the API. The list of
96
+ * values includes alternative security requirement objects that can be used. Only
97
+ * one of the security requirement objects need to be satisfied to authorize a request.
98
+ * Individual operations can override this definition. To make security optional, an empty
99
+ * security requirement ({}) can be included in the array.
100
+ */
101
+ security: z.array(securityRequirement).optional().default([]),
93
102
  /** OAS info */
94
103
  info: infoSchema.optional(),
95
104
  /** Uids which refer to servers on the workspace base */
@@ -101,6 +110,24 @@ const specSchema = z.object({
101
110
  const collectionSchema = z.object({
102
111
  uid: nanoidSchema,
103
112
  spec: specSchema.optional().default({}),
113
+ /**
114
+ * The currently selected security scheme key
115
+ * TODO eventually we will need to maintain one per request + collection but this will do for now
116
+ */
117
+ selectedSecuritySchemes: z
118
+ .array(z.object({
119
+ uid: z.string(),
120
+ // Wasn't sure how to extract the keys from another schema so hard coded these for now
121
+ flowKey: z
122
+ .enum([
123
+ 'implicit',
124
+ 'clientCredentials',
125
+ 'password',
126
+ 'authorizationCode',
127
+ ])
128
+ .optional(),
129
+ }))
130
+ .default([]),
104
131
  /** The currently selected server */
105
132
  selectedServerUid: z.string().default(''),
106
133
  /** List of uids that correspond to collection requests or folders */
@@ -36,8 +36,8 @@ declare const cookieSchema: z.ZodObject<{
36
36
  secure: z.ZodOptional<z.ZodBoolean>;
37
37
  }, "strip", z.ZodTypeAny, {
38
38
  value: string;
39
- name: string;
40
39
  uid: string;
40
+ name: string;
41
41
  sameSite: "Lax" | "Strict" | "None";
42
42
  path?: string | undefined;
43
43
  domain?: string | undefined;
@@ -69,8 +69,8 @@ export type CookiePayload = z.input<typeof cookieSchema>;
69
69
  /** Create cookie helper */
70
70
  export declare const createCookie: (payload: CookiePayload) => {
71
71
  value: string;
72
- name: string;
73
72
  uid: string;
73
+ name: string;
74
74
  sameSite: "Lax" | "Strict" | "None";
75
75
  path?: string | undefined;
76
76
  domain?: string | undefined;
@@ -16,8 +16,8 @@ declare const environmentSchema: z.ZodObject<{
16
16
  }>, "many">>>;
17
17
  isDefault: z.ZodOptional<z.ZodBoolean>;
18
18
  }, "strip", z.ZodTypeAny, {
19
- name: string;
20
19
  uid: string;
20
+ name: string;
21
21
  color: string;
22
22
  raw: string;
23
23
  parsed: {
@@ -26,8 +26,8 @@ declare const environmentSchema: z.ZodObject<{
26
26
  }[];
27
27
  isDefault?: boolean | undefined;
28
28
  }, {
29
- name?: string | undefined;
30
29
  uid?: string | undefined;
30
+ name?: string | undefined;
31
31
  color?: string | undefined;
32
32
  raw?: string | undefined;
33
33
  parsed?: {
@@ -41,8 +41,8 @@ export type Environment = z.infer<typeof environmentSchema>;
41
41
  export type EnvironmentPayload = z.input<typeof environmentSchema>;
42
42
  /** Create environment helper */
43
43
  export declare const createEnvironment: (payload: EnvironmentPayload) => {
44
- name: string;
45
44
  uid: string;
45
+ name: string;
46
46
  color: string;
47
47
  raw: string;
48
48
  parsed: {
@@ -12,14 +12,14 @@ declare const folderSchema: z.ZodObject<{
12
12
  */
13
13
  childUids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
14
14
  }, "strip", z.ZodTypeAny, {
15
- name: string;
16
15
  uid: string;
16
+ name: string;
17
17
  childUids: string[];
18
18
  description?: string | undefined;
19
19
  }, {
20
- name?: string | undefined;
21
- description?: string | undefined;
22
20
  uid?: string | undefined;
21
+ description?: string | undefined;
22
+ name?: string | undefined;
23
23
  childUids?: string[] | undefined;
24
24
  }>;
25
25
  /** Folders will correspond to the x- */
@@ -27,8 +27,8 @@ export type Folder = z.infer<typeof folderSchema>;
27
27
  export type FolderPayload = z.input<typeof folderSchema>;
28
28
  /** Create folder helper */
29
29
  export declare const createFolder: (payload: FolderPayload) => {
30
- name: string;
31
30
  uid: string;
31
+ name: string;
32
32
  childUids: string[];
33
33
  description?: string | undefined;
34
34
  };
@@ -0,0 +1,3 @@
1
+ export * from './security-requirement.js';
2
+ export * from './security-schemes.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/security/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { securityRequirement } from './security-requirement.js';
2
+ export { createSecurityScheme } from './security-schemes.js';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Security Requirement
4
+ * Lists the required security schemes to execute this operation OR the whole collection/spec.
5
+ * The name used for each property MUST correspond to a security scheme declared in the Security
6
+ * Schemes under the Components Object.
7
+ *
8
+ * The key (name) here will be matched to the key of the securityScheme for linking
9
+ *
10
+ * @see https://spec.openapis.org/oas/latest.html#security-requirement-object
11
+ */
12
+ export declare const securityRequirement: z.ZodRecord<z.ZodString, z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>>;
13
+ //# sourceMappingURL=security-requirement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security-requirement.d.ts","sourceRoot":"","sources":["../../../../src/entities/workspace/security/security-requirement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,wFAG/B,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Security Requirement
5
+ * Lists the required security schemes to execute this operation OR the whole collection/spec.
6
+ * The name used for each property MUST correspond to a security scheme declared in the Security
7
+ * Schemes under the Components Object.
8
+ *
9
+ * The key (name) here will be matched to the key of the securityScheme for linking
10
+ *
11
+ * @see https://spec.openapis.org/oas/latest.html#security-requirement-object
12
+ */
13
+ const securityRequirement = z.record(z.string(), z.array(z.string()).optional().default([]));
14
+
15
+ export { securityRequirement };