@scalar/types 0.1.3 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @scalar/types
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 8efedf3: fix: allow async functions in onDocumentSelect
8
+ - 82a4ba8: chore: move security schemes into types package for future reference
9
+ - 57feba6: feat: added new auth config (v2)
10
+
3
11
  ## 0.1.3
4
12
 
5
13
  ### Patch Changes
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import type { AuthenticationConfiguration } from '../api-reference/authentication-configuration.ts';
2
3
  /** Configuration for the OpenAPI/Swagger specification */
3
4
  export declare const specConfigurationSchema: z.ZodObject<{
4
5
  /**
@@ -222,7 +223,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
222
223
  authentication?: any;
223
224
  baseServerURL?: string | undefined;
224
225
  proxyUrl?: string | undefined;
225
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
226
+ searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
226
227
  servers?: any[] | undefined;
227
228
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
228
229
  }, {
@@ -240,7 +241,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
240
241
  baseServerURL?: string | undefined;
241
242
  hideClientButton?: unknown;
242
243
  proxyUrl?: string | undefined;
243
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
244
+ searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
244
245
  servers?: any[] | undefined;
245
246
  showSidebar?: unknown;
246
247
  theme?: unknown;
@@ -446,13 +447,13 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
446
447
  hiddenClients: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>, z.ZodArray<z.ZodString, "many">, z.ZodLiteral<true>]>>;
447
448
  /** Determine the HTTP client that's selected by default */
448
449
  defaultHttpClient: z.ZodOptional<z.ZodObject<{
449
- targetKey: z.ZodType<"c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart", z.ZodTypeDef, "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart">;
450
+ targetKey: z.ZodType<"http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart", z.ZodTypeDef, "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart">;
450
451
  clientKey: z.ZodString;
451
452
  }, "strip", z.ZodTypeAny, {
452
- targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
453
+ targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
453
454
  clientKey: string;
454
455
  }, {
455
- targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
456
+ targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
456
457
  clientKey: string;
457
458
  }>>;
458
459
  /** Custom CSS to be added to the page */
@@ -462,7 +463,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
462
463
  /** onServerChange is fired on selected server change */
463
464
  onServerChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
464
465
  /** onDocumentSelect is fired when the config is selected */
465
- onDocumentSelect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
466
+ onDocumentSelect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
466
467
  /**
467
468
  * Route using paths instead of hashes, your server MUST support this
468
469
  * @example '/standalone-api-reference/:custom(.*)?'
@@ -620,7 +621,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
620
621
  authentication?: any;
621
622
  baseServerURL?: string | undefined;
622
623
  proxyUrl?: string | undefined;
623
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
624
+ searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
624
625
  servers?: any[] | undefined;
625
626
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
626
627
  proxy?: string | undefined;
@@ -630,13 +631,13 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
630
631
  favicon?: string | undefined;
631
632
  hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
632
633
  defaultHttpClient?: {
633
- targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
634
+ targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
634
635
  clientKey: string;
635
636
  } | undefined;
636
637
  customCss?: string | undefined;
637
638
  onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
638
639
  onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
639
- onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
640
+ onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
640
641
  pathRouting?: {
641
642
  basePath: string;
642
643
  } | undefined;
@@ -679,7 +680,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
679
680
  baseServerURL?: string | undefined;
680
681
  hideClientButton?: unknown;
681
682
  proxyUrl?: string | undefined;
682
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
683
+ searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
683
684
  servers?: any[] | undefined;
684
685
  showSidebar?: unknown;
685
686
  theme?: unknown;
@@ -699,13 +700,13 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
699
700
  favicon?: string | undefined;
700
701
  hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
701
702
  defaultHttpClient?: {
702
- targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
703
+ targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
703
704
  clientKey: string;
704
705
  } | undefined;
705
706
  customCss?: string | undefined;
706
707
  onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
707
708
  onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
708
- onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
709
+ onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
709
710
  pathRouting?: {
710
711
  basePath: string;
711
712
  } | undefined;
@@ -760,7 +761,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
760
761
  authentication?: any;
761
762
  baseServerURL?: string | undefined;
762
763
  proxyUrl?: string | undefined;
763
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
764
+ searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
764
765
  servers?: any[] | undefined;
765
766
  _integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
766
767
  proxy?: string | undefined;
@@ -770,13 +771,13 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
770
771
  favicon?: string | undefined;
771
772
  hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
772
773
  defaultHttpClient?: {
773
- targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
774
+ targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
774
775
  clientKey: string;
775
776
  } | undefined;
776
777
  customCss?: string | undefined;
777
778
  onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
778
779
  onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
779
- onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
780
+ onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
780
781
  pathRouting?: {
781
782
  basePath: string;
782
783
  } | undefined;
@@ -819,7 +820,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
819
820
  baseServerURL?: string | undefined;
820
821
  hideClientButton?: unknown;
821
822
  proxyUrl?: string | undefined;
822
- searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
823
+ searchHotKey?: "o" | "n" | "c" | "r" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
823
824
  servers?: any[] | undefined;
824
825
  showSidebar?: unknown;
825
826
  theme?: unknown;
@@ -839,13 +840,13 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
839
840
  favicon?: string | undefined;
840
841
  hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
841
842
  defaultHttpClient?: {
842
- targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
843
+ targetKey: "http" | "c" | "clojure" | "csharp" | "go" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
843
844
  clientKey: string;
844
845
  } | undefined;
845
846
  customCss?: string | undefined;
846
847
  onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
847
848
  onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
848
- onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
849
+ onDocumentSelect?: ((...args: unknown[]) => void | Promise<void>) | undefined;
849
850
  pathRouting?: {
850
851
  basePath: string;
851
852
  } | undefined;
@@ -876,7 +877,9 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
876
877
  operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
877
878
  }>;
878
879
  /** Configuration after parsing, this is the main type */
879
- export type ApiReferenceConfiguration = Omit<z.infer<typeof apiReferenceConfigurationSchema>, 'proxy' | 'spec'>;
880
+ export type ApiReferenceConfiguration = Omit<z.infer<typeof apiReferenceConfigurationSchema>, 'proxy' | 'spec'> & {
881
+ authentication?: AuthenticationConfiguration;
882
+ };
880
883
  /** Api Config which includes the default config */
881
884
  type ApiReferenceConfigurationWithDefault = ApiReferenceConfiguration & {
882
885
  /** Whether to use this config as the default one */
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA8EvB,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB;IAClC;;;;;;;;;;;;;;;;;QAiBI;;IAEJ;;;;;;;;;;;;;;;;;;;;QAoBI;;IAEJ;;;;;;OAMG;;IAEH;;;;;;;;;;OAUG;;;;;;;;;;;;EAEH,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAQvE,uCAAuC;AACvC,eAAO,MAAM,4BAA4B;IACvC;;QAEI;;IAEJ;;;;;QAKI;;IAEJ;;;;OAIG;;IAEH;;;;;;;;OAQG;;IAEH;;;;QAII;;QAvGJ;;;;;;;;;;;;;;;;;YAiBI;;QAEJ;;;;;;;;;;;;;;;;;;;;YAoBI;;QAEJ;;;;;;WAMG;;QAEH;;;;;;;;;;WAUG;;;;;;;;;;;;;IA8CH,6BAA6B;;IAE7B,kCAAkC;;IAElC;;;OAGG;;IAEH,gDAAgD;;IAEhD,mFAAmF;;IAEnF,qCAAqC;;IAErC;;;OAGG;;IAEH,+CAA+C;;IAE/C,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8DwG,CAAA;AAE/G,yDAAyD;AACzD,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,EAE/C,OAAO,GAAG,MAAM,CACjB,CAAA;AAED,mDAAmD;AACnD,KAAK,oCAAoC,GAAG,yBAAyB,GAAG;IACtE,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,qDAAqD;AACrD,MAAM,MAAM,oCAAoC,GAAG,IAAI,CAAC,oCAAoC,EAAE,SAAS,CAAC,GAAG;IACzG,OAAO,EAAE,CAAC,iBAAiB,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,EAAE,CAAA;CACvD,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC,GAClC,OAAO,CAAC,oCAAoC,CAAC,GAC7C,OAAO,CAAC,oCAAoC,CAAC,EAAE,CAAA;AAEnD,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,WAC7B,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,oCAAoC,CAC0C,CAAA"}
1
+ {"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAA;AA6ElG,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB;IAClC;;;;;;;;;;;;;;;;;QAiBI;;IAEJ;;;;;;;;;;;;;;;;;;;;QAoBI;;IAEJ;;;;;;OAMG;;IAEH;;;;;;;;;;OAUG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,CAAC,iBAAiB,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,EAAE,CAAA;CACvD,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,4BAA4B,GACpC,OAAO,CAAC,yBAAyB,CAAC,GAClC,OAAO,CAAC,oCAAoC,CAAC,GAC7C,OAAO,CAAC,oCAAoC,CAAC,EAAE,CAAA;AAEnD,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,WAC7B,4BAA4B,KACnC,MAAM,IAAI,OAAO,CAAC,oCAAoC,CAC0C,CAAA"}
@@ -285,7 +285,7 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
285
285
  /** onServerChange is fired on selected server change */
286
286
  onServerChange: z.function().args(z.string()).returns(z.void()).optional(),
287
287
  /** onDocumentSelect is fired when the config is selected */
288
- onDocumentSelect: z.function().returns(z.void()).optional(),
288
+ onDocumentSelect: z.function().returns(z.void().or(z.void().promise())).optional(),
289
289
  /**
290
290
  * Route using paths instead of hashes, your server MUST support this
291
291
  * @example '/standalone-api-reference/:custom(.*)?'
@@ -0,0 +1,53 @@
1
+ import type { SecurityScheme } from '../entities/security-scheme.ts';
2
+ import type { PartialDeep } from 'type-fest/source/partial-deep.ts';
3
+ /**
4
+ * Authentication configuration for the API reference.
5
+ * This config is not validated so does not need a zod schema
6
+ */
7
+ export type AuthenticationConfiguration = {
8
+ /**
9
+ * Specifies the preferred security scheme(s) to use for authentication.
10
+ * Can be one of:
11
+ * - A single security scheme name (string)
12
+ * - An array of security scheme names (OR relationship)
13
+ * - An array containing strings or arrays of strings (AND/OR relationship)
14
+ */
15
+ preferredSecurityScheme?: string | (string | string[])[] | null;
16
+ /**
17
+ * Setting security schemes this way will allow you to override any value in your openapi document
18
+ * You will also be able to set additional values such as api tokens etc.
19
+ *
20
+ * Set them via the nameKey in your components.securitySchemes.[nameKey]
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * {
25
+ * authentication: {
26
+ * preferredSecurityScheme: 'apiKeyHeader',
27
+ * securitySchemes: {
28
+ * apiKeyHeader: {
29
+ * value: 'tokenValue'
30
+ * },
31
+ * httpBearer: {
32
+ * token: 'xyz token value'
33
+ * },
34
+ * httpBasic: {
35
+ * username: 'username',
36
+ * password: 'password'
37
+ * },
38
+ * oauth2: {
39
+ * flows: {
40
+ * authorizationCode: {
41
+ * token: 'auth code token'
42
+ * }
43
+ * }
44
+ * },
45
+ * },
46
+ * }
47
+ * }
48
+ * ```
49
+ *
50
+ */
51
+ securitySchemes?: Record<string, PartialDeep<SecurityScheme>>;
52
+ };
53
+ //# sourceMappingURL=authentication-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/authentication-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAAA;IAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,CAAA;CAC9D,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=authentication-configuration.test-d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication-configuration.test-d.d.ts","sourceRoot":"","sources":["../../src/api-reference/authentication-configuration.test-d.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ 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.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,sBAAsB,CAAA"}
@@ -0,0 +1 @@
1
+ export { oasSecurityRequirementSchema, oasSecuritySchemeSchema, pkceOptions, securityApiKeySchema, securityHttpSchema, securityOauthSchema, securityOpenIdSchema, securitySchemeSchema } from './security-scheme.js';