@scalar/types 0.3.2 → 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 (53) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/api-reference/api-client-configuration.d.ts +7 -0
  3. package/dist/api-reference/api-client-configuration.d.ts.map +1 -1
  4. package/dist/api-reference/api-reference-configuration.d.ts +28 -19
  5. package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
  6. package/dist/api-reference/api-reference-configuration.js +7 -6
  7. package/dist/api-reference/api-reference-configuration.js.map +2 -2
  8. package/dist/api-reference/api-reference-plugin.d.ts +15 -1
  9. package/dist/api-reference/api-reference-plugin.d.ts.map +1 -1
  10. package/dist/api-reference/api-reference-plugin.js +26 -3
  11. package/dist/api-reference/api-reference-plugin.js.map +2 -2
  12. package/dist/api-reference/authentication-configuration.test-d.js.map +2 -2
  13. package/dist/api-reference/base-configuration.d.ts +6 -0
  14. package/dist/api-reference/base-configuration.d.ts.map +1 -1
  15. package/dist/api-reference/base-configuration.js +8 -0
  16. package/dist/api-reference/base-configuration.js.map +2 -2
  17. package/dist/api-reference/index.d.ts +2 -2
  18. package/dist/api-reference/index.d.ts.map +1 -1
  19. package/dist/api-reference/index.js.map +2 -2
  20. package/dist/api-reference/source-configuration.d.ts +1 -0
  21. package/dist/api-reference/source-configuration.d.ts.map +1 -1
  22. package/dist/api-reference/source-configuration.js +1 -0
  23. package/dist/api-reference/source-configuration.js.map +2 -2
  24. package/dist/entities/index.d.ts +1 -0
  25. package/dist/entities/index.d.ts.map +1 -1
  26. package/dist/entities/index.js.map +2 -2
  27. package/dist/entities/security-scheme.d.ts +8 -9
  28. package/dist/entities/security-scheme.d.ts.map +1 -1
  29. package/dist/entities/security-scheme.js +0 -1
  30. package/dist/entities/security-scheme.js.map +2 -2
  31. package/dist/index.d.ts +5 -2
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -1
  34. package/dist/index.js.map +2 -2
  35. package/dist/legacy/index.d.ts +3 -1
  36. package/dist/legacy/index.d.ts.map +1 -1
  37. package/dist/legacy/index.js +4 -1
  38. package/dist/legacy/index.js.map +2 -2
  39. package/dist/legacy/reference-config.d.ts +1 -211
  40. package/dist/legacy/reference-config.d.ts.map +1 -1
  41. package/dist/legacy/reference-config.js.map +2 -2
  42. package/dist/snippetz/index.d.ts +3 -1
  43. package/dist/snippetz/index.d.ts.map +1 -1
  44. package/dist/snippetz/index.js +4 -1
  45. package/dist/snippetz/index.js.map +2 -2
  46. package/dist/utils/index.d.ts +3 -1
  47. package/dist/utils/index.d.ts.map +1 -1
  48. package/dist/utils/index.js.map +2 -2
  49. package/dist/utils/nanoid.d.ts +1 -1
  50. package/dist/utils/nanoid.d.ts.map +1 -1
  51. package/dist/utils/nanoid.js +1 -1
  52. package/dist/utils/nanoid.js.map +2 -2
  53. package/package.json +4 -5
@@ -1,5 +1,6 @@
1
1
  import z from "zod";
2
2
  const sourceConfigurationSchema = z.object({
3
+ default: z.boolean().default(false).optional().catch(false),
3
4
  /**
4
5
  * URL to an OpenAPI/Swagger document
5
6
  * @example
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/api-reference/source-configuration.ts"],
4
- "sourcesContent": ["import z from 'zod'\n\n/**\n * A source is any potential document input used for API Reference\n * and API Client integrations. Sources may be specified in the configuration\n * or used independently. Some configurations may have multiple sources.\n */\nexport const sourceConfigurationSchema = z.object({\n /**\n * URL to an OpenAPI/Swagger document\n * @example\n * ```ts\n * const oldConfiguration = {\n * spec: {\n * url: 'https://example.com/openapi.json',\n * },\n * }\n *\n * const newConfiguration = {\n * url: 'https://example.com/openapi.json',\n * }\n * ```\n **/\n url: z.string().optional(),\n /**\n * Directly embed the OpenAPI document.\n * Can be a string, object, function returning an object, or null.\n *\n * @remarks It's recommended to pass a URL instead of content.\n * @example\n * ```ts\n * const oldConfiguration = {\n * spec: {\n * content: '\u2026',\n * },\n * }\n *\n * const newConfiguration = {\n * content: '\u2026',\n * }\n * ```\n **/\n content: z\n .union([\n z.string(),\n z.null(),\n z.record(z.string(), z.any()),\n z.function({\n input: [],\n output: z.record(z.string(), z.any()),\n }),\n ])\n .optional(),\n /**\n * The title of the OpenAPI document.\n *\n * @example 'Scalar Galaxy'\n *\n * @deprecated Please move `title` to the top level and remove the `spec` prefix.\n */\n title: z.string().optional(),\n /**\n * The slug of the OpenAPI document used in the URL.\n *\n * If none is passed, the title will be used.\n *\n * If no title is used, it'll just use the index.\n *\n * @example 'scalar-galaxy'\n *\n * @deprecated Please move `slug` to the top level and remove the `spec` prefix.\n */\n slug: z.string().optional(),\n /**\n * The OpenAPI/Swagger document to render\n *\n * @deprecated Use `url` and `content` on the top level instead.\n **/\n spec: z\n .object({\n url: z.string().optional(),\n content: z\n .union([\n z.string(),\n z.null(),\n z.record(z.string(), z.any()),\n z.function({\n input: [],\n output: z.record(z.string(), z.any()),\n }),\n ])\n .optional(),\n })\n .optional(),\n})\n\nexport type SourceConfiguration = z.infer<typeof sourceConfigurationSchema>\n"],
5
- "mappings": "AAAA,OAAO,OAAO;AAOP,MAAM,4BAA4B,EAAE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBhD,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBzB,SAAS,EACN,MAAM;AAAA,IACL,EAAE,OAAO;AAAA,IACT,EAAE,KAAK;AAAA,IACP,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,IAC5B,EAAE,SAAS;AAAA,MACT,OAAO,CAAC;AAAA,MACR,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,IACtC,CAAC;AAAA,EACH,CAAC,EACA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQZ,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAY3B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1B,MAAM,EACH,OAAO;AAAA,IACN,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,IACzB,SAAS,EACN,MAAM;AAAA,MACL,EAAE,OAAO;AAAA,MACT,EAAE,KAAK;AAAA,MACP,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,MAC5B,EAAE,SAAS;AAAA,QACT,OAAO,CAAC;AAAA,QACR,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,MACtC,CAAC;AAAA,IACH,CAAC,EACA,SAAS;AAAA,EACd,CAAC,EACA,SAAS;AACd,CAAC;",
4
+ "sourcesContent": ["import z from 'zod'\n\n/**\n * A source is any potential document input used for API Reference\n * and API Client integrations. Sources may be specified in the configuration\n * or used independently. Some configurations may have multiple sources.\n */\nexport const sourceConfigurationSchema = z.object({\n default: z.boolean().default(false).optional().catch(false),\n /**\n * URL to an OpenAPI/Swagger document\n * @example\n * ```ts\n * const oldConfiguration = {\n * spec: {\n * url: 'https://example.com/openapi.json',\n * },\n * }\n *\n * const newConfiguration = {\n * url: 'https://example.com/openapi.json',\n * }\n * ```\n **/\n url: z.string().optional(),\n /**\n * Directly embed the OpenAPI document.\n * Can be a string, object, function returning an object, or null.\n *\n * @remarks It's recommended to pass a URL instead of content.\n * @example\n * ```ts\n * const oldConfiguration = {\n * spec: {\n * content: '\u2026',\n * },\n * }\n *\n * const newConfiguration = {\n * content: '\u2026',\n * }\n * ```\n **/\n content: z\n .union([\n z.string(),\n z.null(),\n z.record(z.string(), z.any()),\n z.function({\n input: [],\n output: z.record(z.string(), z.any()),\n }),\n ])\n .optional(),\n /**\n * The title of the OpenAPI document.\n *\n * @example 'Scalar Galaxy'\n *\n * @deprecated Please move `title` to the top level and remove the `spec` prefix.\n */\n title: z.string().optional(),\n /**\n * The slug of the OpenAPI document used in the URL.\n *\n * If none is passed, the title will be used.\n *\n * If no title is used, it'll just use the index.\n *\n * @example 'scalar-galaxy'\n *\n * @deprecated Please move `slug` to the top level and remove the `spec` prefix.\n */\n slug: z.string().optional(),\n /**\n * The OpenAPI/Swagger document to render\n *\n * @deprecated Use `url` and `content` on the top level instead.\n **/\n spec: z\n .object({\n url: z.string().optional(),\n content: z\n .union([\n z.string(),\n z.null(),\n z.record(z.string(), z.any()),\n z.function({\n input: [],\n output: z.record(z.string(), z.any()),\n }),\n ])\n .optional(),\n })\n .optional(),\n})\n\nexport type SourceConfiguration = z.infer<typeof sourceConfigurationSchema>\n"],
5
+ "mappings": "AAAA,OAAO,OAAO;AAOP,MAAM,4BAA4B,EAAE,OAAO;AAAA,EAChD,SAAS,EAAE,QAAQ,EAAE,QAAQ,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgB1D,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBzB,SAAS,EACN,MAAM;AAAA,IACL,EAAE,OAAO;AAAA,IACT,EAAE,KAAK;AAAA,IACP,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,IAC5B,EAAE,SAAS;AAAA,MACT,OAAO,CAAC;AAAA,MACR,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,IACtC,CAAC;AAAA,EACH,CAAC,EACA,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQZ,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAY3B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1B,MAAM,EACH,OAAO;AAAA,IACN,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,IACzB,SAAS,EACN,MAAM;AAAA,MACL,EAAE,OAAO;AAAA,MACT,EAAE,KAAK;AAAA,MACP,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,MAC5B,EAAE,SAAS;AAAA,QACT,OAAO,CAAC;AAAA,QACR,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC;AAAA,MACtC,CAAC;AAAA,IACH,CAAC,EACA,SAAS;AAAA,EACd,CAAC,EACA,SAAS;AACd,CAAC;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,3 @@
1
+ /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
1
2
  export { type Oauth2Flow, type Oauth2FlowPayload, type SecuritySchemaHttp, type SecuritySchemaOpenId, type SecurityScheme, type SecuritySchemeApiKey, type SecuritySchemeOauth2, type SecuritySchemeOauth2Payload, type SecuritySchemePayload, oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema, } from './security-scheme.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,OAAO,EACL,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,qBAAqB,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/entities/index.ts"],
4
- "sourcesContent": ["export {\n type Oauth2Flow,\n type Oauth2FlowPayload,\n type SecuritySchemaHttp,\n type SecuritySchemaOpenId,\n type SecurityScheme,\n type SecuritySchemeApiKey,\n type SecuritySchemeOauth2,\n type SecuritySchemeOauth2Payload,\n type SecuritySchemePayload,\n oasSecurityRequirementSchema,\n oasSecuritySchemeSchema,\n pkceOptions,\n securityApiKeySchema,\n securityHttpSchema,\n securityOauthSchema,\n securityOpenIdSchema,\n securitySchemeSchema,\n} from './security-scheme'\n"],
5
- "mappings": "AAAA;AAAA,EAUE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
4
+ "sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\nexport {\n type Oauth2Flow,\n type Oauth2FlowPayload,\n type SecuritySchemaHttp,\n type SecuritySchemaOpenId,\n type SecurityScheme,\n type SecuritySchemeApiKey,\n type SecuritySchemeOauth2,\n type SecuritySchemeOauth2Payload,\n type SecuritySchemePayload,\n oasSecurityRequirementSchema,\n oasSecuritySchemeSchema,\n pkceOptions,\n securityApiKeySchema,\n securityHttpSchema,\n securityOauthSchema,\n securityOpenIdSchema,\n securitySchemeSchema,\n} from './security-scheme'\n"],
5
+ "mappings": "AACA;AAAA,EAUE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- export declare const securitySchemeApiKeyIn: readonly ["query", "header", "cookie"];
3
2
  export declare const securityApiKeySchema: z.ZodObject<{
4
3
  description: z.ZodOptional<z.ZodString>;
5
4
  type: z.ZodLiteral<"apiKey">;
@@ -9,7 +8,7 @@ export declare const securityApiKeySchema: z.ZodObject<{
9
8
  query: "query";
10
9
  header: "header";
11
10
  }>>>>;
12
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
11
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
13
12
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
14
13
  value: z.ZodDefault<z.ZodString>;
15
14
  }, z.core.$strip>;
@@ -22,7 +21,7 @@ export declare const securityHttpSchema: z.ZodObject<{
22
21
  bearer: "bearer";
23
22
  }>>>>;
24
23
  bearerFormat: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"JWT">, z.ZodString]>>>;
25
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
24
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
26
25
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
27
26
  username: z.ZodDefault<z.ZodString>;
28
27
  password: z.ZodDefault<z.ZodString>;
@@ -33,7 +32,7 @@ export declare const securityOpenIdSchema: z.ZodObject<{
33
32
  description: z.ZodOptional<z.ZodString>;
34
33
  type: z.ZodLiteral<"openIdConnect">;
35
34
  openIdConnectUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
36
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
35
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
37
36
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
38
37
  }, z.core.$strip>;
39
38
  export type SecuritySchemaOpenId = z.infer<typeof securityOpenIdSchema>;
@@ -118,7 +117,7 @@ export declare const securityOauthSchema: z.ZodObject<{
118
117
  }>>;
119
118
  }, z.core.$strip>>;
120
119
  }, z.core.$strip>>;
121
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
120
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
122
121
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
123
122
  }, z.core.$strip>;
124
123
  export type SecuritySchemeOauth2 = z.infer<typeof securityOauthSchema>;
@@ -249,7 +248,7 @@ export declare const securitySchemeSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.
249
248
  query: "query";
250
249
  header: "header";
251
250
  }>>>>;
252
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
251
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
253
252
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
254
253
  value: z.ZodDefault<z.ZodString>;
255
254
  }, z.core.$strip>, z.ZodObject<{
@@ -260,7 +259,7 @@ export declare const securitySchemeSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.
260
259
  bearer: "bearer";
261
260
  }>>>>;
262
261
  bearerFormat: z.ZodDefault<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"JWT">, z.ZodString]>>>;
263
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
262
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
264
263
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
265
264
  username: z.ZodDefault<z.ZodString>;
266
265
  password: z.ZodDefault<z.ZodString>;
@@ -269,7 +268,7 @@ export declare const securitySchemeSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.
269
268
  description: z.ZodOptional<z.ZodString>;
270
269
  type: z.ZodLiteral<"openIdConnect">;
271
270
  openIdConnectUrl: z.ZodDefault<z.ZodOptional<z.ZodString>>;
272
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
271
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
273
272
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
274
273
  }, z.core.$strip>, z.ZodObject<{
275
274
  description: z.ZodOptional<z.ZodString>;
@@ -350,7 +349,7 @@ export declare const securitySchemeSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.
350
349
  }>>;
351
350
  }, z.core.$strip>>;
352
351
  }, z.core.$strip>>;
353
- uid: z.core.$ZodBranded<z.ZodDefault<z.ZodOptional<z.ZodString>>, "securityScheme">;
352
+ uid: z.core.$ZodBranded<z.ZodDefault<z.ZodString>, "securityScheme">;
354
353
  nameKey: z.ZodDefault<z.ZodOptional<z.ZodString>>;
355
354
  }, z.core.$strip>], "type">, z.ZodTransform<{
356
355
  type: "apiKey";
@@ -1 +1 @@
1
- {"version":3,"file":"security-scheme.d.ts","sourceRoot":"","sources":["../../src/entities/security-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAsBvB,eAAO,MAAM,sBAAsB,wC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAa7B,CAAA;AAEJ;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACjE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
@@ -156,7 +156,6 @@ export {
156
156
  securityHttpSchema,
157
157
  securityOauthSchema,
158
158
  securityOpenIdSchema,
159
- securitySchemeApiKeyIn,
160
159
  securitySchemeSchema
161
160
  };
162
161
  //# sourceMappingURL=security-scheme.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/entities/security-scheme.ts"],
4
- "sourcesContent": ["import { z } from 'zod'\n\nimport { type ENTITY_BRANDS, nanoidSchema } from '../utils/nanoid'\n\n// ---------------------------------------------------------------------------\n// COMMON PROPS FOR ALL SECURITY SCHEMES\n\n/** Some common properties used in all security schemes */\nconst commonProps = z.object({\n /* A description for security scheme. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional(),\n})\n\nconst extendedSecuritySchema = z.object({\n uid: nanoidSchema.brand<ENTITY_BRANDS['SECURITY_SCHEME']>(),\n /** The name key that links a security requirement to a security object */\n nameKey: z.string().optional().default(''),\n})\n\n// ---------------------------------------------------------------------------\n// API KEY\n\nexport const securitySchemeApiKeyIn = ['query', 'header', 'cookie'] as const\n\nconst oasSecuritySchemeApiKey = commonProps.extend({\n type: z.literal('apiKey'),\n /** REQUIRED. The name of the header, query or cookie parameter to be used. */\n name: z.string().optional().default(''),\n /** REQUIRED. The location of the API key. Valid values are \"query\", \"header\" or \"cookie\". */\n in: z.enum(securitySchemeApiKeyIn).optional().default('header').catch('header'),\n})\n\nconst apiKeyValueSchema = z.object({\n value: z.string().default(''),\n})\n\nexport const securityApiKeySchema = oasSecuritySchemeApiKey.merge(extendedSecuritySchema).merge(apiKeyValueSchema)\nexport type SecuritySchemeApiKey = z.infer<typeof securityApiKeySchema>\n\n// ---------------------------------------------------------------------------\n// HTTP\n\nconst oasSecuritySchemeHttp = commonProps.extend({\n type: z.literal('http'),\n /**\n * REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in\n * [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.\n */\n scheme: z\n .string()\n .toLowerCase()\n .pipe(z.enum(['basic', 'bearer']))\n .optional()\n .default('basic'),\n /**\n * A hint to the client to identify how the bearer token is formatted.\n * Bearer tokens are usually generated by an authorization server, so\n * this information is primarily for documentation purposes.\n */\n bearerFormat: z\n .union([z.literal('JWT'), z.string()])\n .optional()\n .default('JWT'),\n})\n\nconst httpValueSchema = z.object({\n username: z.string().default(''),\n password: z.string().default(''),\n token: z.string().default(''),\n})\n\nexport const securityHttpSchema = oasSecuritySchemeHttp.merge(extendedSecuritySchema).merge(httpValueSchema)\nexport type SecuritySchemaHttp = z.infer<typeof securityHttpSchema>\n\n// ---------------------------------------------------------------------------\n// OPENID CONNECT\nconst oasSecuritySchemeOpenId = commonProps.extend({\n type: z.literal('openIdConnect'),\n /**\n * REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the\n * form of a URL. The OpenID Connect standard requires the use of TLS.\n */\n openIdConnectUrl: z.string().optional().default(''),\n})\n\nexport const securityOpenIdSchema = oasSecuritySchemeOpenId.merge(extendedSecuritySchema)\nexport type SecuritySchemaOpenId = z.infer<typeof securityOpenIdSchema>\n\n// ---------------------------------------------------------------------------\n\n/**\n * REQUIRED. The authorization URL to be used for this flow. This MUST be in\n * the form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst authorizationUrl = z.string().default('')\n\n/**\n * REQUIRED. The token URL to be used for this flow. This MUST be in the\n * form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst tokenUrl = z.string().default('')\n\n/** Common properties used across all oauth2 flows */\nconst flowsCommon = z.object({\n /**\n * The URL to be used for obtaining refresh tokens. This MUST be in the form of a\n * URL. The OAuth2 standard requires the use of TLS.\n */\n 'refreshUrl': z.string().optional().default(''),\n /**\n * REQUIRED. The available scopes for the OAuth2 security scheme. A map\n * between the scope name and a short description for it. The map MAY be empty.\n */\n 'scopes': z.record(z.string(), z.string().optional().default('')).optional().default({}).catch({}),\n 'selectedScopes': z.array(z.string()).optional().default([]),\n /** Extension to save the client Id associated with an oauth flow */\n 'x-scalar-client-id': z.string().optional().default(''),\n /** The auth token */\n 'token': z.string().default(''),\n /** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */\n 'x-scalar-security-query': z.record(z.string(), z.string()).optional(),\n /** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */\n 'x-scalar-security-body': z.record(z.string(), z.string()).optional(),\n /** Extension to specify custom token name in the response (defaults to 'access_token') */\n 'x-tokenName': z.string().optional(),\n})\n\n/** Setup a default redirect uri if we can */\nconst defaultRedirectUri = typeof window !== 'undefined' ? window.location.origin + window.location.pathname : ''\n\n/** Options for the x-usePkce extension */\nexport const pkceOptions = ['SHA-256', 'plain', 'no'] as const\n\nconst credentialsLocationExtension = z.enum(['header', 'body']).optional()\n\n/** Oauth2 security scheme */\nconst oasSecuritySchemeOauth2 = commonProps.extend({\n type: z.literal('oauth2'),\n /** The default scopes for the oauth flow */\n 'x-default-scopes': z.array(z.string()).optional(),\n /** REQUIRED. An object containing configuration information for the flow types supported. */\n flows: z\n .object({\n /** Configuration for the OAuth Implicit flow */\n implicit: flowsCommon.extend({\n 'type': z.literal('implicit').default('implicit'),\n authorizationUrl,\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n }),\n /** Configuration for the OAuth Resource Owner Password flow */\n password: flowsCommon.extend({\n type: z.literal('password').default('password'),\n tokenUrl,\n clientSecret: z.string().default(''),\n username: z.string().default(''),\n password: z.string().default(''),\n 'x-scalar-credentials-location': credentialsLocationExtension,\n }),\n /** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */\n clientCredentials: flowsCommon.extend({\n type: z.literal('clientCredentials').default('clientCredentials'),\n tokenUrl,\n clientSecret: z.string().default(''),\n 'x-scalar-credentials-location': credentialsLocationExtension,\n }),\n /** Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.*/\n authorizationCode: flowsCommon.extend({\n 'type': z.literal('authorizationCode').default('authorizationCode'),\n authorizationUrl,\n 'x-usePkce': z.enum(pkceOptions).optional().default('no'),\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n tokenUrl,\n clientSecret: z.string().default(''),\n 'x-scalar-credentials-location': credentialsLocationExtension,\n }),\n })\n .partial()\n .default({\n implicit: {\n selectedScopes: [],\n scopes: {},\n 'x-scalar-client-id': '',\n refreshUrl: '',\n token: '',\n type: 'implicit',\n authorizationUrl: 'http://localhost:8080',\n 'x-scalar-redirect-uri': defaultRedirectUri,\n },\n }),\n})\n\nexport const securityOauthSchema = oasSecuritySchemeOauth2.merge(extendedSecuritySchema)\n\nexport type SecuritySchemeOauth2 = z.infer<typeof securityOauthSchema>\nexport type SecuritySchemeOauth2Payload = z.input<typeof securityOauthSchema>\nexport type Oauth2Flow = NonNullable<\n SecuritySchemeOauth2['flows']['authorizationCode' | 'clientCredentials' | 'implicit' | 'password']\n>\n/** Payload for the oauth 2 flows + extensions */\nexport type Oauth2FlowPayload = NonNullable<SecuritySchemeOauth2Payload['flows']>[\n | 'authorizationCode'\n | 'clientCredentials'\n | 'implicit'\n | 'password'] &\n Record<`x-${string}`, string>\n\n// ---------------------------------------------------------------------------\n// Final Types\n\n/**\n * Security Requirement\n * Lists the required security schemes to execute this operation OR the whole collection/spec.\n * The name used for each property MUST correspond to a security scheme declared in the Security\n * Schemes under the Components Object.\n *\n * The key (name) here will be matched to the key of the securityScheme for linking\n *\n * @see https://spec.openapis.org/oas/latest.html#security-requirement-object\n */\nexport const oasSecurityRequirementSchema = z.record(z.string(), z.array(z.string()).optional().default([]))\n\n/** OAS Compliant security schemes */\nexport const oasSecuritySchemeSchema = z.union([\n oasSecuritySchemeApiKey,\n oasSecuritySchemeHttp,\n oasSecuritySchemeOauth2,\n oasSecuritySchemeOpenId,\n])\n\n/** Extended security schemes for workspace usage */\nexport const securitySchemeSchema = z\n .discriminatedUnion('type', [securityApiKeySchema, securityHttpSchema, securityOpenIdSchema, securityOauthSchema])\n .transform((data) => {\n // Set selected scopes from x-default-scopes\n if (data.type === 'oauth2' && data['x-default-scopes']?.length) {\n const keys = Object.keys(data.flows) as Array<keyof typeof data.flows>\n keys.forEach((key) => {\n if (data.flows[key]?.selectedScopes && data['x-default-scopes']) {\n data.flows[key].selectedScopes = [data['x-default-scopes']].flat()\n }\n })\n }\n return data\n })\n\n/**\n * Security Scheme Object\n *\n * @see https://spec.openapis.org/oas/latest.html#security-scheme-object\n */\nexport type SecurityScheme = z.infer<typeof securitySchemeSchema>\nexport type SecuritySchemePayload = z.input<typeof securitySchemeSchema>\n"],
5
- "mappings": "AAAA,SAAS,SAAS;AAElB,SAA6B,oBAAoB;AAMjD,MAAM,cAAc,EAAE,OAAO;AAAA;AAAA,EAE3B,aAAa,EAAE,OAAO,EAAE,SAAS;AACnC,CAAC;AAED,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,KAAK,aAAa,MAAwC;AAAA;AAAA,EAE1D,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAC3C,CAAC;AAKM,MAAM,yBAAyB,CAAC,SAAS,UAAU,QAAQ;AAElE,MAAM,0BAA0B,YAAY,OAAO;AAAA,EACjD,MAAM,EAAE,QAAQ,QAAQ;AAAA;AAAA,EAExB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA;AAAA,EAEtC,IAAI,EAAE,KAAK,sBAAsB,EAAE,SAAS,EAAE,QAAQ,QAAQ,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AAQ,CAAC,CAAC,CAAC;AAGpG,MAAM,0BAA0B,EAAE,MAAM;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,MAAM,uBAAuB,EACjC,mBAAmB,QAAQ,CAAC,sBAAsB,oBAAoB,sBAAsB,mBAAmB,CAAC,EAChH,UAAU,CAAC,SAAS;AAEnB,MAAI,KAAK,SAAS,YAAY,KAAK,kBAAkB,GAAG,QAAQ;AAC9D,UAAM,OAAO,OAAO,KAAK,KAAK,KAAK;AACnC,SAAK,QAAQ,CAAC,QAAQ;AACpB,UAAI,KAAK,MAAM,GAAG,GAAG,kBAAkB,KAAK,kBAAkB,GAAG;AAC/D,aAAK,MAAM,GAAG,EAAE,iBAAiB,CAAC,KAAK,kBAAkB,CAAC,EAAE,KAAK;AAAA,MACnE;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO;AACT,CAAC;",
4
+ "sourcesContent": ["import { z } from 'zod'\n\nimport { type ENTITY_BRANDS, nanoidSchema } from '../utils/nanoid'\n\n// ---------------------------------------------------------------------------\n// COMMON PROPS FOR ALL SECURITY SCHEMES\n\n/** Some common properties used in all security schemes */\nconst commonProps = z.object({\n /* A description for security scheme. CommonMark syntax MAY be used for rich text representation. */\n description: z.string().optional(),\n})\n\nconst extendedSecuritySchema = z.object({\n uid: nanoidSchema.brand<ENTITY_BRANDS['SECURITY_SCHEME']>(),\n /** The name key that links a security requirement to a security object */\n nameKey: z.string().optional().default(''),\n})\n\n// ---------------------------------------------------------------------------\n// API KEY\n\nconst securitySchemeApiKeyIn = ['query', 'header', 'cookie'] as const\n\nconst oasSecuritySchemeApiKey = commonProps.extend({\n type: z.literal('apiKey'),\n /** REQUIRED. The name of the header, query or cookie parameter to be used. */\n name: z.string().optional().default(''),\n /** REQUIRED. The location of the API key. Valid values are \"query\", \"header\" or \"cookie\". */\n in: z.enum(securitySchemeApiKeyIn).optional().default('header').catch('header'),\n})\n\nconst apiKeyValueSchema = z.object({\n value: z.string().default(''),\n})\n\nexport const securityApiKeySchema = oasSecuritySchemeApiKey.merge(extendedSecuritySchema).merge(apiKeyValueSchema)\nexport type SecuritySchemeApiKey = z.infer<typeof securityApiKeySchema>\n\n// ---------------------------------------------------------------------------\n// HTTP\n\nconst oasSecuritySchemeHttp = commonProps.extend({\n type: z.literal('http'),\n /**\n * REQUIRED. The name of the HTTP Authorization scheme to be used in the Authorization header as defined in\n * [RFC7235]. The values used SHOULD be registered in the IANA Authentication Scheme registry.\n */\n scheme: z\n .string()\n .toLowerCase()\n .pipe(z.enum(['basic', 'bearer']))\n .optional()\n .default('basic'),\n /**\n * A hint to the client to identify how the bearer token is formatted.\n * Bearer tokens are usually generated by an authorization server, so\n * this information is primarily for documentation purposes.\n */\n bearerFormat: z\n .union([z.literal('JWT'), z.string()])\n .optional()\n .default('JWT'),\n})\n\nconst httpValueSchema = z.object({\n username: z.string().default(''),\n password: z.string().default(''),\n token: z.string().default(''),\n})\n\nexport const securityHttpSchema = oasSecuritySchemeHttp.merge(extendedSecuritySchema).merge(httpValueSchema)\nexport type SecuritySchemaHttp = z.infer<typeof securityHttpSchema>\n\n// ---------------------------------------------------------------------------\n// OPENID CONNECT\nconst oasSecuritySchemeOpenId = commonProps.extend({\n type: z.literal('openIdConnect'),\n /**\n * REQUIRED. OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the\n * form of a URL. The OpenID Connect standard requires the use of TLS.\n */\n openIdConnectUrl: z.string().optional().default(''),\n})\n\nexport const securityOpenIdSchema = oasSecuritySchemeOpenId.merge(extendedSecuritySchema)\nexport type SecuritySchemaOpenId = z.infer<typeof securityOpenIdSchema>\n\n// ---------------------------------------------------------------------------\n\n/**\n * REQUIRED. The authorization URL to be used for this flow. This MUST be in\n * the form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst authorizationUrl = z.string().default('')\n\n/**\n * REQUIRED. The token URL to be used for this flow. This MUST be in the\n * form of a URL. The OAuth2 standard requires the use of TLS.\n */\nconst tokenUrl = z.string().default('')\n\n/** Common properties used across all oauth2 flows */\nconst flowsCommon = z.object({\n /**\n * The URL to be used for obtaining refresh tokens. This MUST be in the form of a\n * URL. The OAuth2 standard requires the use of TLS.\n */\n 'refreshUrl': z.string().optional().default(''),\n /**\n * REQUIRED. The available scopes for the OAuth2 security scheme. A map\n * between the scope name and a short description for it. The map MAY be empty.\n */\n 'scopes': z.record(z.string(), z.string().optional().default('')).optional().default({}).catch({}),\n 'selectedScopes': z.array(z.string()).optional().default([]),\n /** Extension to save the client Id associated with an oauth flow */\n 'x-scalar-client-id': z.string().optional().default(''),\n /** The auth token */\n 'token': z.string().default(''),\n /** Additional query parameters for the OAuth authorization request. Example: { prompt: 'consent', audience: 'scalar' }. */\n 'x-scalar-security-query': z.record(z.string(), z.string()).optional(),\n /** Additional body parameters for the OAuth token request. Example: { audience: 'foo' }. */\n 'x-scalar-security-body': z.record(z.string(), z.string()).optional(),\n /** Extension to specify custom token name in the response (defaults to 'access_token') */\n 'x-tokenName': z.string().optional(),\n})\n\n/** Setup a default redirect uri if we can */\nconst defaultRedirectUri = typeof window !== 'undefined' ? window.location.origin + window.location.pathname : ''\n\n/** Options for the x-usePkce extension */\nexport const pkceOptions = ['SHA-256', 'plain', 'no'] as const\n\nconst credentialsLocationExtension = z.enum(['header', 'body']).optional()\n\n/** Oauth2 security scheme */\nconst oasSecuritySchemeOauth2 = commonProps.extend({\n type: z.literal('oauth2'),\n /** The default scopes for the oauth flow */\n 'x-default-scopes': z.array(z.string()).optional(),\n /** REQUIRED. An object containing configuration information for the flow types supported. */\n flows: z\n .object({\n /** Configuration for the OAuth Implicit flow */\n implicit: flowsCommon.extend({\n 'type': z.literal('implicit').default('implicit'),\n authorizationUrl,\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n }),\n /** Configuration for the OAuth Resource Owner Password flow */\n password: flowsCommon.extend({\n type: z.literal('password').default('password'),\n tokenUrl,\n clientSecret: z.string().default(''),\n username: z.string().default(''),\n password: z.string().default(''),\n 'x-scalar-credentials-location': credentialsLocationExtension,\n }),\n /** Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0. */\n clientCredentials: flowsCommon.extend({\n type: z.literal('clientCredentials').default('clientCredentials'),\n tokenUrl,\n clientSecret: z.string().default(''),\n 'x-scalar-credentials-location': credentialsLocationExtension,\n }),\n /** Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.*/\n authorizationCode: flowsCommon.extend({\n 'type': z.literal('authorizationCode').default('authorizationCode'),\n authorizationUrl,\n 'x-usePkce': z.enum(pkceOptions).optional().default('no'),\n 'x-scalar-redirect-uri': z.string().optional().default(defaultRedirectUri),\n tokenUrl,\n clientSecret: z.string().default(''),\n 'x-scalar-credentials-location': credentialsLocationExtension,\n }),\n })\n .partial()\n .default({\n implicit: {\n selectedScopes: [],\n scopes: {},\n 'x-scalar-client-id': '',\n refreshUrl: '',\n token: '',\n type: 'implicit',\n authorizationUrl: 'http://localhost:8080',\n 'x-scalar-redirect-uri': defaultRedirectUri,\n },\n }),\n})\n\nexport const securityOauthSchema = oasSecuritySchemeOauth2.merge(extendedSecuritySchema)\n\nexport type SecuritySchemeOauth2 = z.infer<typeof securityOauthSchema>\nexport type SecuritySchemeOauth2Payload = z.input<typeof securityOauthSchema>\nexport type Oauth2Flow = NonNullable<\n SecuritySchemeOauth2['flows']['authorizationCode' | 'clientCredentials' | 'implicit' | 'password']\n>\n/** Payload for the oauth 2 flows + extensions */\nexport type Oauth2FlowPayload = NonNullable<SecuritySchemeOauth2Payload['flows']>[\n | 'authorizationCode'\n | 'clientCredentials'\n | 'implicit'\n | 'password'] &\n Record<`x-${string}`, string>\n\n// ---------------------------------------------------------------------------\n// Final Types\n\n/**\n * Security Requirement\n * Lists the required security schemes to execute this operation OR the whole collection/spec.\n * The name used for each property MUST correspond to a security scheme declared in the Security\n * Schemes under the Components Object.\n *\n * The key (name) here will be matched to the key of the securityScheme for linking\n *\n * @see https://spec.openapis.org/oas/latest.html#security-requirement-object\n */\nexport const oasSecurityRequirementSchema = z.record(z.string(), z.array(z.string()).optional().default([]))\n\n/** OAS Compliant security schemes */\nexport const oasSecuritySchemeSchema = z.union([\n oasSecuritySchemeApiKey,\n oasSecuritySchemeHttp,\n oasSecuritySchemeOauth2,\n oasSecuritySchemeOpenId,\n])\n\n/** Extended security schemes for workspace usage */\nexport const securitySchemeSchema = z\n .discriminatedUnion('type', [securityApiKeySchema, securityHttpSchema, securityOpenIdSchema, securityOauthSchema])\n .transform((data) => {\n // Set selected scopes from x-default-scopes\n if (data.type === 'oauth2' && data['x-default-scopes']?.length) {\n const keys = Object.keys(data.flows) as Array<keyof typeof data.flows>\n keys.forEach((key) => {\n if (data.flows[key]?.selectedScopes && data['x-default-scopes']) {\n data.flows[key].selectedScopes = [data['x-default-scopes']].flat()\n }\n })\n }\n return data\n })\n\n/**\n * Security Scheme Object\n *\n * @see https://spec.openapis.org/oas/latest.html#security-scheme-object\n */\nexport type SecurityScheme = z.infer<typeof securitySchemeSchema>\nexport type SecuritySchemePayload = z.input<typeof securitySchemeSchema>\n"],
5
+ "mappings": "AAAA,SAAS,SAAS;AAElB,SAA6B,oBAAoB;AAMjD,MAAM,cAAc,EAAE,OAAO;AAAA;AAAA,EAE3B,aAAa,EAAE,OAAO,EAAE,SAAS;AACnC,CAAC;AAED,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,KAAK,aAAa,MAAwC;AAAA;AAAA,EAE1D,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAC3C,CAAC;AAKD,MAAM,yBAAyB,CAAC,SAAS,UAAU,QAAQ;AAE3D,MAAM,0BAA0B,YAAY,OAAO;AAAA,EACjD,MAAM,EAAE,QAAQ,QAAQ;AAAA;AAAA,EAExB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA;AAAA,EAEtC,IAAI,EAAE,KAAK,sBAAsB,EAAE,SAAS,EAAE,QAAQ,QAAQ,EAAE,MA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AC,CAAC,CAAC;AAGpG,MAAM,0BAA0B,EAAE,MAAM;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,MAAM,uBAAuB,EACjC,mBAAmB,QAAQ,CAAC,sBAAsB,oBAAoB,sBAAsB,mBAAmB,CAAC,EAChH,UAAU,CAAC,SAAS;AAEnB,MAAI,KAAK,SAAS,YAAY,KAAK,kBAAkB,GAAG,QAAQ;AAC9D,UAAM,OAAO,OAAO,KAAK,KAAK,KAAK;AACnC,SAAK,QAAQ,CAAC,QAAQ;AACpB,UAAI,KAAK,MAAM,GAAG,GAAG,kBAAkB,KAAK,kBAAkB,GAAG;AAC/D,aAAK,MAAM,GAAG,EAAE,iBAAiB,CAAC,KAAK,kBAAkB,CAAC,EAAE,KAAK;AAAA,MACnE;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO;AACT,CAAC;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- /** We should not use these exports anymore, but we need them for commonjs compatibility. */
1
+ /**
2
+ * We should not use these exports anymore, but we need them for commonjs compatibility.
3
+ */
4
+ /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
5
  export * from './api-reference/index.js';
3
- export * from './legacy/index.js';
6
+ export { XScalarStability } from './legacy/index.js';
4
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAE5F,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,iEAAiE;AAGjE,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
1
  export * from "./api-reference/index.js";
2
- export * from "./legacy/index.js";
2
+ import { XScalarStability } from "./legacy/index.js";
3
+ export {
4
+ XScalarStability
5
+ };
3
6
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["/** We should not use these exports anymore, but we need them for commonjs compatibility. */\n\nexport * from './api-reference/index'\nexport * from './legacy/index'\n"],
5
- "mappings": "AAEA,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["/**\n * We should not use these exports anymore, but we need them for commonjs compatibility.\n */\n/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\n\n// biome-ignore lint/performance/noReExportAll: leave this to avoid copy exports\nexport * from './api-reference/index'\nexport { XScalarStability } from './legacy/index'\n"],
5
+ "mappings": "AAMA,cAAc;AACd,SAAS,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,4 @@
1
- export * from './reference-config.js';
1
+ /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
+ export type { ContentType, Heading, } from './reference-config.js';
3
+ export { XScalarStability } from './reference-config.js';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,YAAY,EACV,WAAW,EACX,OAAO,GACR,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -1,2 +1,5 @@
1
- export * from "./reference-config.js";
1
+ import { XScalarStability } from "./reference-config.js";
2
+ export {
3
+ XScalarStability
4
+ };
2
5
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/legacy/index.ts"],
4
- "sourcesContent": ["export * from './reference-config'\n"],
5
- "mappings": "AAAA,cAAc;",
4
+ "sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\nexport type {\n ContentType,\n Heading,\n} from './reference-config'\nexport { XScalarStability } from './reference-config'\n"],
5
+ "mappings": "AAKA,SAAS,wBAAwB;",
6
6
  "names": []
7
7
  }
@@ -1,224 +1,14 @@
1
- import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
2
- import type { ApiReferenceConfiguration } from '../api-reference/index.js';
3
- import type { TargetId } from '../snippetz/index.js';
4
- /**
5
- * This re-export is needed due to a typescript issue
6
- * @see https://github.com/microsoft/TypeScript/issues/42873
7
- */
8
- export type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1, } from '@scalar/openapi-types';
9
- export type ClientInfo = {
10
- key: string;
11
- title: string;
12
- link: string;
13
- description: string;
14
- };
15
- /**
16
- * Alias for the OpenAPI 3.1 ServerObject type
17
- *
18
- * @deprecated Use OpenAPIV3_1.ServerObject instead
19
- */
20
- export type Server = OpenAPIV3_1.ServerObject;
21
- export type TargetInfo = {
22
- key: TargetId;
23
- title: string;
24
- extname: `.${string}` | null;
25
- default: string;
26
- };
27
- export type HiddenClients = true | Partial<Record<TargetInfo['key'], boolean | ClientInfo['key'][]>> | ClientInfo['key'][];
28
- export type PathRouting = {
29
- basePath: string;
30
- };
31
- /**
32
- * @deprecated Use ApiReferenceConfiguration instead
33
- *
34
- * @example import type { ApiReferenceConfiguration } from '@scalar/types/api-reference'
35
- */
36
- export type ReferenceConfiguration = Partial<ApiReferenceConfiguration>;
37
- export type BaseParameter = {
38
- name: string;
39
- description?: string | null;
40
- value: string | number | Record<string, any>;
41
- required?: boolean;
42
- enabled: boolean;
43
- };
44
1
  type OptionalCharset = string | null;
45
2
  export type ContentType = `application/json${OptionalCharset}` | `application/xml${OptionalCharset}` | `text/plain${OptionalCharset}` | `text/html${OptionalCharset}` | `application/octet-stream${OptionalCharset}` | `application/x-www-form-urlencoded${OptionalCharset}` | `multipart/form-data${OptionalCharset}` | `*/*${OptionalCharset}` | `application/vnd.${string}+json${OptionalCharset}`;
46
- export type Cookie = {
47
- name: string;
48
- value: string;
49
- };
50
- export type CustomRequestExample = {
51
- lang: string;
52
- label: string;
53
- source: string;
54
- };
55
- export type Header = {
56
- name: string;
57
- value: string;
58
- };
59
3
  export declare enum XScalarStability {
60
4
  Deprecated = "deprecated",
61
5
  Experimental = "experimental",
62
6
  Stable = "stable"
63
7
  }
64
- export type Operation = {
65
- id: string;
66
- httpVerb: OpenAPIV3_1.HttpMethods;
67
- path: string;
68
- name: string;
69
- isWebhook: boolean;
70
- description?: string;
71
- information: OpenAPIV3_1.OperationObject;
72
- servers?: OpenAPIV3_1.ServerObject[];
73
- pathParameters?: OpenAPIV3_1.ParameterObject[];
74
- };
75
- /**
76
- * @deprecated Use Parameter instead
77
- */
78
- export type Parameters = Parameter;
79
- export type Parameter = {
80
- name: string;
81
- in?: string;
82
- description?: string;
83
- required?: boolean;
84
- deprecated?: boolean;
85
- allowEmptyValue?: boolean;
86
- style?: 'form' | 'simple';
87
- explode?: boolean;
88
- allowReserved?: boolean;
89
- schema?: Schema;
90
- example?: any;
91
- examples?: Map<string, any>;
92
- content?: RequestBodyMimeTypes;
93
- headers?: {
94
- [key: string]: OpenAPI.HeaderObject;
95
- };
96
- };
97
- export type Query = {
98
- name: string;
99
- value: string;
100
- };
101
- export type RequestBodyMimeTypes = {
102
- [K in ContentType]?: {
103
- schema?: any;
104
- example?: any;
105
- examples?: any;
106
- };
107
- };
108
- export type RequestBody = {
109
- description?: string;
110
- required?: boolean;
111
- content?: RequestBodyMimeTypes;
112
- };
113
- export type Schema = {
114
- type: string;
115
- name?: string;
116
- example?: any;
117
- default?: any;
118
- format?: string;
119
- description?: string;
120
- properties?: Record<string, Schema>;
121
- };
122
- /**
123
- * This is a very strange and custom way to represent the operation object.
124
- * It's the outcome of the `parse` helper.
125
- *
126
- * @deprecated This is evil. Stop using it. We'll transition to use the new store.
127
- */
128
- export type TransformedOperation = Operation & {
129
- pathParameters?: Parameter[];
130
- };
131
- export type CollapsedSidebarItems = Record<string, boolean>;
132
- export type AuthenticationState = {
133
- customSecurity?: boolean;
134
- /** You can pre-select a single security scheme, multiple, or complex security using an array of arrays */
135
- preferredSecurityScheme?: string | (string | string[])[] | null;
136
- securitySchemes?: OpenAPIV2.SecurityDefinitionsObject | OpenAPIV3.ComponentsObject['securitySchemes'] | OpenAPIV3_1.ComponentsObject['securitySchemes'];
137
- http?: {
138
- basic?: {
139
- username?: string;
140
- password?: string;
141
- };
142
- bearer?: {
143
- token?: string;
144
- };
145
- };
146
- apiKey?: {
147
- token?: string;
148
- };
149
- oAuth2?: {
150
- clientId?: string;
151
- scopes?: string[];
152
- accessToken?: string;
153
- state?: string;
154
- username?: string;
155
- password?: string;
156
- };
157
- };
158
8
  export type Heading = {
159
9
  depth: number;
160
10
  value: string;
161
11
  slug?: string;
162
12
  };
163
- export type CodeBlockSSRKey = `components-scalar-code-block${number}`;
164
- export type DescriptionSectionSSRKey = `components-Content-Introduction-Description-sections${number}`;
165
- export type ScalarState = {
166
- 'hash'?: string;
167
- 'useGlobalStore-authentication'?: AuthenticationState;
168
- 'useSidebarContent-collapsedSidebarItems'?: CollapsedSidebarItems;
169
- [key: CodeBlockSSRKey]: string;
170
- [key: DescriptionSectionSSRKey]: {
171
- heading: Heading;
172
- content: string;
173
- }[];
174
- };
175
- export type Tag = {
176
- 'name': string;
177
- 'description': string;
178
- 'operations': TransformedOperation[];
179
- 'x-displayName'?: string;
180
- 'externalDocs'?: OpenAPIV3_1.ExternalDocumentationObject;
181
- };
182
- export type TagGroup = {
183
- name: string;
184
- tags: string[];
185
- };
186
- export type Definitions = OpenAPIV2.DefinitionsObject;
187
- /**
188
- * Webhook (after our super custom transformation process)
189
- *
190
- * @deprecated Let's get rid of those super custom transformed entities and use the store instead.
191
- */
192
- export type Webhooks = Record<string, Record<OpenAPIV3_1.HttpMethods, TransformedOperation & {
193
- 'x-internal'?: boolean;
194
- }>>;
195
- /**
196
- * The native OpenAPI Webhook object, but with the x-internal and x-scalar-ignore properties
197
- */
198
- export type Webhook = (OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject) & {
199
- 'x-internal'?: boolean;
200
- 'x-scalar-ignore'?: boolean;
201
- };
202
- /**
203
- * @deprecated Use `@scalar/openapi-types` instead
204
- */
205
- export type Spec = {
206
- 'tags'?: Tag[];
207
- 'info': Partial<OpenAPIV2.Document['info']> | Partial<OpenAPIV3.Document['info']> | Partial<OpenAPIV3_1.Document['info']>;
208
- 'host'?: OpenAPIV2.Document['host'];
209
- 'basePath'?: OpenAPIV2.Document['basePath'];
210
- 'schemes'?: OpenAPIV2.Document['schemes'];
211
- 'externalDocs'?: {
212
- url: string;
213
- description?: string;
214
- };
215
- 'servers'?: OpenAPIV3.Document['servers'] | OpenAPIV3_1.Document['servers'];
216
- 'components'?: OpenAPIV3.ComponentsObject | OpenAPIV3_1.ComponentsObject;
217
- 'webhooks'?: TransformedOperation[];
218
- 'definitions'?: Definitions;
219
- 'swagger'?: OpenAPIV2.Document['swagger'];
220
- 'openapi'?: OpenAPIV3.Document['openapi'] | OpenAPIV3_1.Document['openapi'];
221
- 'x-tagGroups'?: TagGroup[];
222
- 'security'?: OpenAPIV3.SecurityRequirementObject[];
223
- };
13
+ export {};
224
14
  //# sourceMappingURL=reference-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reference-config.d.ts","sourceRoot":"","sources":["../../src/legacy/reference-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AA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AM,GAAG,IAAI,CAAA;AAEpC,MAAM,MAAM,WAAW,GACnB,mBAAmB,eAAe,EAAE,GACpC,kBAAkB,eAAe,EAAE,GACnC,aAAa,eAAe,EAAE,GAC9B,YAAY,eAAe,EAAE,GAC7B,2BAA2B,eAAe,EAAE,GAC5C,oCAAoC,eAAe,EAAE,GACrD,sBAAsB,eAAe,EAAE,GACvC,MAAM,eAAe,EAAE,GACvB,mBAAmB,MAAM,QAAQ,eAAe,EAAE,CAAA;AAEtD,oBAAY,gBAAgB;IAC1B,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,MAAM,WAAW;CAClB;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/legacy/reference-config.ts"],
4
- "sourcesContent": ["import type { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types'\n\nimport type { ApiReferenceConfiguration } from '../api-reference/index'\nimport type { TargetId } from '../snippetz/index'\n\n/**\n * This re-export is needed due to a typescript issue\n * @see https://github.com/microsoft/TypeScript/issues/42873\n */\nexport type {\n OpenAPI,\n OpenAPIV2,\n OpenAPIV3,\n OpenAPIV3_1,\n} from '@scalar/openapi-types'\n\nexport type ClientInfo = {\n key: string\n title: string\n link: string\n description: string\n}\n\n/**\n * Alias for the OpenAPI 3.1 ServerObject type\n *\n * @deprecated Use OpenAPIV3_1.ServerObject instead\n */\nexport type Server = OpenAPIV3_1.ServerObject\n\nexport type TargetInfo = {\n key: TargetId\n title: string\n extname: `.${string}` | null\n default: string\n}\n\nexport type HiddenClients =\n // Just hide all\n | true\n // Exclude whole targets or just specific clients\n | Partial<Record<TargetInfo['key'], boolean | ClientInfo['key'][]>>\n // Backwards compatibility with the previous behavior ['fetch', 'xhr']\n | ClientInfo['key'][]\n\nexport type PathRouting = {\n basePath: string\n}\n\n/**\n * @deprecated Use ApiReferenceConfiguration instead\n *\n * @example import type { ApiReferenceConfiguration } from '@scalar/types/api-reference'\n */\nexport type ReferenceConfiguration = Partial<ApiReferenceConfiguration>\n\nexport type BaseParameter = {\n name: string\n description?: string | null\n value: string | number | Record<string, any>\n required?: boolean\n enabled: boolean\n}\n\ntype OptionalCharset = string | null\n\nexport type ContentType =\n | `application/json${OptionalCharset}`\n | `application/xml${OptionalCharset}`\n | `text/plain${OptionalCharset}`\n | `text/html${OptionalCharset}`\n | `application/octet-stream${OptionalCharset}`\n | `application/x-www-form-urlencoded${OptionalCharset}`\n | `multipart/form-data${OptionalCharset}`\n | `*/*${OptionalCharset}`\n | `application/vnd.${string}+json${OptionalCharset}`\n\nexport type Cookie = {\n name: string\n value: string\n}\n\nexport type CustomRequestExample = {\n lang: string\n label: string\n source: string\n}\n\nexport type Header = {\n name: string\n value: string\n}\n\nexport enum XScalarStability {\n Deprecated = 'deprecated',\n Experimental = 'experimental',\n Stable = 'stable',\n}\n\nexport type Operation = {\n id: string\n httpVerb: OpenAPIV3_1.HttpMethods\n path: string\n name: string\n isWebhook: boolean\n description?: string\n information: OpenAPIV3_1.OperationObject\n servers?: OpenAPIV3_1.ServerObject[]\n pathParameters?: OpenAPIV3_1.ParameterObject[]\n}\n\n/**\n * @deprecated Use Parameter instead\n */\nexport type Parameters = Parameter\n\nexport type Parameter = {\n // Fixed Fields\n name: string\n in?: string\n description?: string\n required?: boolean\n deprecated?: boolean\n allowEmptyValue?: boolean\n // Other\n style?: 'form' | 'simple'\n explode?: boolean\n allowReserved?: boolean\n schema?: Schema\n example?: any\n examples?: Map<string, any>\n content?: RequestBodyMimeTypes\n headers?: { [key: string]: OpenAPI.HeaderObject }\n}\n\nexport type Query = {\n name: string\n value: string\n}\n\n// Create a mapped type to ensure keys are a subset of ContentType\nexport type RequestBodyMimeTypes = {\n [K in ContentType]?: {\n schema?: any\n example?: any\n examples?: any\n }\n}\n\nexport type RequestBody = {\n description?: string\n required?: boolean\n content?: RequestBodyMimeTypes\n}\n\nexport type Schema = {\n type: string\n name?: string\n example?: any\n default?: any\n format?: string\n description?: string\n properties?: Record<string, Schema>\n}\n\n/**\n * This is a very strange and custom way to represent the operation object.\n * It's the outcome of the `parse` helper.\n *\n * @deprecated This is evil. Stop using it. We'll transition to use the new store.\n */\nexport type TransformedOperation = Operation & {\n pathParameters?: Parameter[]\n}\n\nexport type CollapsedSidebarItems = Record<string, boolean>\n\nexport type AuthenticationState = {\n customSecurity?: boolean\n /** You can pre-select a single security scheme, multiple, or complex security using an array of arrays */\n preferredSecurityScheme?: string | (string | string[])[] | null\n securitySchemes?:\n | OpenAPIV2.SecurityDefinitionsObject\n | OpenAPIV3.ComponentsObject['securitySchemes']\n | OpenAPIV3_1.ComponentsObject['securitySchemes']\n http?: {\n basic?: {\n username?: string\n password?: string\n }\n bearer?: {\n token?: string\n }\n }\n apiKey?: {\n token?: string\n }\n oAuth2?: {\n clientId?: string\n scopes?: string[]\n accessToken?: string\n state?: string\n username?: string\n password?: string\n }\n}\n\nexport type Heading = {\n depth: number\n value: string\n slug?: string\n}\n\nexport type CodeBlockSSRKey = `components-scalar-code-block${number}`\nexport type DescriptionSectionSSRKey = `components-Content-Introduction-Description-sections${number}`\n\nexport type ScalarState = {\n 'hash'?: string\n 'useGlobalStore-authentication'?: AuthenticationState\n 'useSidebarContent-collapsedSidebarItems'?: CollapsedSidebarItems\n [key: CodeBlockSSRKey]: string\n [key: DescriptionSectionSSRKey]: {\n heading: Heading\n content: string\n }[]\n}\n\nexport type Tag = {\n 'name': string\n 'description': string\n 'operations': TransformedOperation[]\n 'x-displayName'?: string\n 'externalDocs'?: OpenAPIV3_1.ExternalDocumentationObject\n}\n\nexport type TagGroup = {\n name: string\n tags: string[]\n}\n\nexport type Definitions = OpenAPIV2.DefinitionsObject\n\n/**\n * Webhook (after our super custom transformation process)\n *\n * @deprecated Let's get rid of those super custom transformed entities and use the store instead.\n */\nexport type Webhooks = Record<\n string,\n Record<\n OpenAPIV3_1.HttpMethods,\n TransformedOperation & {\n 'x-internal'?: boolean\n }\n >\n>\n\n/**\n * The native OpenAPI Webhook object, but with the x-internal and x-scalar-ignore properties\n */\nexport type Webhook = (OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject) & {\n 'x-internal'?: boolean\n 'x-scalar-ignore'?: boolean\n}\n\n/**\n * @deprecated Use `@scalar/openapi-types` instead\n */\nexport type Spec = {\n 'tags'?: Tag[]\n 'info':\n | Partial<OpenAPIV2.Document['info']>\n | Partial<OpenAPIV3.Document['info']>\n | Partial<OpenAPIV3_1.Document['info']>\n 'host'?: OpenAPIV2.Document['host']\n 'basePath'?: OpenAPIV2.Document['basePath']\n 'schemes'?: OpenAPIV2.Document['schemes']\n 'externalDocs'?: {\n url: string\n description?: string\n }\n 'servers'?: OpenAPIV3.Document['servers'] | OpenAPIV3_1.Document['servers']\n 'components'?: OpenAPIV3.ComponentsObject | OpenAPIV3_1.ComponentsObject\n 'webhooks'?: TransformedOperation[]\n 'definitions'?: Definitions\n 'swagger'?: OpenAPIV2.Document['swagger']\n 'openapi'?: OpenAPIV3.Document['openapi'] | OpenAPIV3_1.Document['openapi']\n 'x-tagGroups'?: TagGroup[]\n 'security'?: OpenAPIV3.SecurityRequirementObject[]\n}\n"],
5
- "mappings": "AA6FO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,gBAAa;AACb,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,YAAS;AAHC,SAAAA;AAAA,GAAA;",
4
+ "sourcesContent": ["type OptionalCharset = string | null\n\nexport type ContentType =\n | `application/json${OptionalCharset}`\n | `application/xml${OptionalCharset}`\n | `text/plain${OptionalCharset}`\n | `text/html${OptionalCharset}`\n | `application/octet-stream${OptionalCharset}`\n | `application/x-www-form-urlencoded${OptionalCharset}`\n | `multipart/form-data${OptionalCharset}`\n | `*/*${OptionalCharset}`\n | `application/vnd.${string}+json${OptionalCharset}`\n\nexport enum XScalarStability {\n Deprecated = 'deprecated',\n Experimental = 'experimental',\n Stable = 'stable',\n}\n\nexport type Heading = {\n depth: number\n value: string\n slug?: string\n}\n"],
5
+ "mappings": "AAaO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,gBAAa;AACb,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,YAAS;AAHC,SAAAA;AAAA,GAAA;",
6
6
  "names": ["XScalarStability"]
7
7
  }
@@ -1,2 +1,4 @@
1
- export * from './snippetz.js';
1
+ /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
+ export type { AvailableClient, AvailableClients, AvailableClientsArray, ClientId, FormDataParam, HarRequest, Plugin, PluginConfiguration, Target, TargetId, } from './snippetz.js';
3
+ export { AVAILABLE_CLIENTS } from './snippetz.js';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snippetz/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/snippetz/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,QAAQ,GACT,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA"}
@@ -1,2 +1,5 @@
1
- export * from "./snippetz.js";
1
+ import { AVAILABLE_CLIENTS } from "./snippetz.js";
2
+ export {
3
+ AVAILABLE_CLIENTS
4
+ };
2
5
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/snippetz/index.ts"],
4
- "sourcesContent": ["export * from './snippetz'\n"],
5
- "mappings": "AAAA,cAAc;",
4
+ "sourcesContent": ["/** biome-ignore-all lint/performance/noBarrelFile: entrypoint */\nexport type {\n AvailableClient,\n AvailableClients,\n AvailableClientsArray,\n ClientId,\n FormDataParam,\n HarRequest,\n Plugin,\n PluginConfiguration,\n Target,\n TargetId,\n} from './snippetz'\nexport { AVAILABLE_CLIENTS } from './snippetz'\n"],
5
+ "mappings": "AAaA,SAAS,yBAAyB;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,5 @@
1
+ /** biome-ignore-all lint/performance/noBarrelFile: entrypoint */
2
+ export type { ENTITY_BRANDS } from './nanoid.js';
3
+ export { nanoidSchema } from './nanoid.js';
1
4
  export type { UnknownObject } from './utility-types.js';
2
- export { type ENTITY_BRANDS, nanoidSchema } from './nanoid.js';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA"}