@scalar/types 0.2.16 → 0.3.1

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 +19 -0
  2. package/dist/api-reference/api-client-configuration.d.ts +122 -0
  3. package/dist/api-reference/api-client-configuration.d.ts.map +1 -0
  4. package/dist/api-reference/api-client-configuration.js +7 -0
  5. package/dist/api-reference/api-client-configuration.js.map +7 -0
  6. package/dist/api-reference/api-client-plugin.d.ts +39 -0
  7. package/dist/api-reference/api-client-plugin.d.ts.map +1 -0
  8. package/dist/api-reference/api-client-plugin.js +34 -0
  9. package/dist/api-reference/api-client-plugin.js.map +7 -0
  10. package/dist/api-reference/api-reference-configuration.d.ts +177 -2144
  11. package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
  12. package/dist/api-reference/api-reference-configuration.js +263 -440
  13. package/dist/api-reference/api-reference-configuration.js.map +2 -2
  14. package/dist/api-reference/api-reference-plugin.d.ts +7 -65
  15. package/dist/api-reference/api-reference-plugin.d.ts.map +1 -1
  16. package/dist/api-reference/api-reference-plugin.js +8 -7
  17. package/dist/api-reference/api-reference-plugin.js.map +2 -2
  18. package/dist/api-reference/base-configuration.d.ts +118 -0
  19. package/dist/api-reference/base-configuration.d.ts.map +1 -0
  20. package/dist/api-reference/base-configuration.js +139 -0
  21. package/dist/api-reference/base-configuration.js.map +7 -0
  22. package/dist/api-reference/html-rendering-configuration.d.ts +3 -21
  23. package/dist/api-reference/html-rendering-configuration.d.ts.map +1 -1
  24. package/dist/api-reference/html-rendering-configuration.js.map +2 -2
  25. package/dist/api-reference/index.d.ts +6 -3
  26. package/dist/api-reference/index.d.ts.map +1 -1
  27. package/dist/api-reference/index.js +12 -3
  28. package/dist/api-reference/index.js.map +2 -2
  29. package/dist/api-reference/source-configuration.d.ts +18 -0
  30. package/dist/api-reference/source-configuration.d.ts.map +1 -0
  31. package/dist/api-reference/source-configuration.js +87 -0
  32. package/dist/api-reference/source-configuration.js.map +7 -0
  33. package/dist/entities/security-scheme.d.ts +220 -1641
  34. package/dist/entities/security-scheme.d.ts.map +1 -1
  35. package/dist/entities/security-scheme.js +11 -2
  36. package/dist/entities/security-scheme.js.map +2 -2
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +1 -1
  40. package/dist/index.js.map +2 -2
  41. package/dist/snippetz/snippetz.d.ts +9 -3
  42. package/dist/snippetz/snippetz.d.ts.map +1 -1
  43. package/dist/snippetz/snippetz.js +1 -0
  44. package/dist/snippetz/snippetz.js.map +2 -2
  45. package/package.json +4 -4
  46. package/dist/api-client/api-client-plugin.d.ts +0 -172
  47. package/dist/api-client/api-client-plugin.d.ts.map +0 -1
  48. package/dist/api-client/api-client-plugin.js +0 -33
  49. package/dist/api-client/api-client-plugin.js.map +0 -7
  50. package/dist/api-client/index.d.ts +0 -2
  51. package/dist/api-client/index.d.ts.map +0 -1
  52. package/dist/api-client/index.js +0 -6
  53. package/dist/api-client/index.js.map +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @scalar/types
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e01464: Adds a new ApiReferenceConfigWithSource type and make the base ApiReferenceConfig type agnostic of any document sources.
8
+ - Updated dependencies [15c4240]
9
+ - @scalar/openapi-types@0.4.1
10
+
11
+ ## 0.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 008a0f3: feat: migrate to Zod 4
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [008a0f3]
20
+ - @scalar/openapi-types@0.4.0
21
+
3
22
  ## 0.2.16
4
23
 
5
24
  ### Patch Changes
@@ -0,0 +1,122 @@
1
+ import type z from 'zod';
2
+ export declare const apiClientConfigurationSchema: z.ZodObject<{
3
+ authentication: z.ZodOptional<z.ZodAny>;
4
+ baseServerURL: z.ZodOptional<z.ZodString>;
5
+ hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
6
+ proxyUrl: z.ZodOptional<z.ZodString>;
7
+ searchHotKey: z.ZodOptional<z.ZodEnum<{
8
+ a: "a";
9
+ b: "b";
10
+ c: "c";
11
+ d: "d";
12
+ e: "e";
13
+ f: "f";
14
+ g: "g";
15
+ h: "h";
16
+ i: "i";
17
+ j: "j";
18
+ k: "k";
19
+ l: "l";
20
+ m: "m";
21
+ n: "n";
22
+ o: "o";
23
+ p: "p";
24
+ q: "q";
25
+ r: "r";
26
+ s: "s";
27
+ t: "t";
28
+ u: "u";
29
+ v: "v";
30
+ w: "w";
31
+ x: "x";
32
+ y: "y";
33
+ z: "z";
34
+ }>>;
35
+ servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
36
+ showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
37
+ showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
38
+ never: "never";
39
+ always: "always";
40
+ localhost: "localhost";
41
+ }>>>>;
42
+ operationTitleSource: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
43
+ summary: "summary";
44
+ path: "path";
45
+ }>>>>;
46
+ theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
47
+ default: "default";
48
+ alternate: "alternate";
49
+ moon: "moon";
50
+ purple: "purple";
51
+ solarized: "solarized";
52
+ bluePlanet: "bluePlanet";
53
+ deepSpace: "deepSpace";
54
+ saturn: "saturn";
55
+ kepler: "kepler";
56
+ elysiajs: "elysiajs";
57
+ fastify: "fastify";
58
+ mars: "mars";
59
+ laserwave: "laserwave";
60
+ none: "none";
61
+ }>>>>;
62
+ _integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
63
+ elysiajs: "elysiajs";
64
+ fastify: "fastify";
65
+ adonisjs: "adonisjs";
66
+ docusaurus: "docusaurus";
67
+ dotnet: "dotnet";
68
+ express: "express";
69
+ fastapi: "fastapi";
70
+ go: "go";
71
+ hono: "hono";
72
+ html: "html";
73
+ laravel: "laravel";
74
+ litestar: "litestar";
75
+ nestjs: "nestjs";
76
+ nextjs: "nextjs";
77
+ nitro: "nitro";
78
+ nuxt: "nuxt";
79
+ platformatic: "platformatic";
80
+ react: "react";
81
+ rust: "rust";
82
+ svelte: "svelte";
83
+ vue: "vue";
84
+ }>>>;
85
+ onRequestSent: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodVoid>>;
86
+ persistAuth: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
87
+ plugins: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodObject<{
88
+ name: z.ZodString;
89
+ views: z.ZodOptional<z.ZodObject<{
90
+ 'request.section': z.ZodOptional<z.ZodArray<z.ZodObject<{
91
+ title: z.ZodOptional<z.ZodString>;
92
+ component: z.ZodUnknown;
93
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
94
+ }, z.core.$strip>>>;
95
+ 'response.section': z.ZodOptional<z.ZodArray<z.ZodObject<{
96
+ title: z.ZodOptional<z.ZodString>;
97
+ component: z.ZodUnknown;
98
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
99
+ }, z.core.$strip>>>;
100
+ }, z.core.$strip>>;
101
+ hooks: z.ZodOptional<z.ZodObject<{
102
+ onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
103
+ request: z.ZodCustom<Request, Request>;
104
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
105
+ onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
106
+ response: z.ZodCustom<Response, Response>;
107
+ operation: z.ZodRecord<z.ZodString, z.ZodAny>;
108
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
109
+ }, z.core.$strip>>;
110
+ }, z.core.$strip>>>>;
111
+ telemetry: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
112
+ url: z.ZodOptional<z.ZodString>;
113
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
114
+ title: z.ZodOptional<z.ZodString>;
115
+ slug: z.ZodOptional<z.ZodString>;
116
+ spec: z.ZodOptional<z.ZodObject<{
117
+ url: z.ZodOptional<z.ZodString>;
118
+ content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
119
+ }, z.core.$strip>>;
120
+ }, z.core.$strip>;
121
+ export type ApiClientConfiguration = z.infer<typeof apiClientConfigurationSchema>;
122
+ //# sourceMappingURL=api-client-configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-client-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAkE,CAAA;AAE3G,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { baseConfigurationSchema } from "./base-configuration.js";
2
+ import { sourceConfigurationSchema } from "./source-configuration.js";
3
+ const apiClientConfigurationSchema = baseConfigurationSchema.extend(sourceConfigurationSchema.shape);
4
+ export {
5
+ apiClientConfigurationSchema
6
+ };
7
+ //# sourceMappingURL=api-client-configuration.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/api-reference/api-client-configuration.ts"],
4
+ "sourcesContent": ["import type z from 'zod'\n\nimport { baseConfigurationSchema } from './base-configuration'\nimport { sourceConfigurationSchema } from './source-configuration'\n\nexport const apiClientConfigurationSchema = baseConfigurationSchema.extend(sourceConfigurationSchema.shape)\n\nexport type ApiClientConfiguration = z.infer<typeof apiClientConfigurationSchema>\n"],
5
+ "mappings": "AAEA,SAAS,+BAA+B;AACxC,SAAS,iCAAiC;AAEnC,MAAM,+BAA+B,wBAAwB,OAAO,0BAA0B,KAAK;",
6
+ "names": []
7
+ }
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ export declare const hooksSchema: z.ZodObject<{
3
+ onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
4
+ request: z.ZodCustom<Request, Request>;
5
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
6
+ onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
7
+ response: z.ZodCustom<Response, Response>;
8
+ operation: z.ZodRecord<z.ZodString, z.ZodAny>;
9
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
10
+ }, z.core.$strip>;
11
+ /**
12
+ * An API client plugin that can connect into request and response hooks
13
+ */
14
+ export declare const apiClientPluginSchema: z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodObject<{
15
+ name: z.ZodString;
16
+ views: z.ZodOptional<z.ZodObject<{
17
+ 'request.section': z.ZodOptional<z.ZodArray<z.ZodObject<{
18
+ title: z.ZodOptional<z.ZodString>;
19
+ component: z.ZodUnknown;
20
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
21
+ }, z.core.$strip>>>;
22
+ 'response.section': z.ZodOptional<z.ZodArray<z.ZodObject<{
23
+ title: z.ZodOptional<z.ZodString>;
24
+ component: z.ZodUnknown;
25
+ props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
26
+ }, z.core.$strip>>>;
27
+ }, z.core.$strip>>;
28
+ hooks: z.ZodOptional<z.ZodObject<{
29
+ onBeforeRequest: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
30
+ request: z.ZodCustom<Request, Request>;
31
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
32
+ onResponseReceived: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
33
+ response: z.ZodCustom<Response, Response>;
34
+ operation: z.ZodRecord<z.ZodString, z.ZodAny>;
35
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>>;
38
+ export type ApiClientPlugin = z.infer<typeof apiClientPluginSchema>;
39
+ //# sourceMappingURL=api-client-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-client-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-client-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAcvB,eAAO,MAAM,WAAW;;;;;;;;iBAatB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;kBAOhC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ const sectionViewSchema = z.object({
3
+ title: z.string().optional(),
4
+ // Since this is meant to be a Vue component, we'll use unknown
5
+ component: z.unknown(),
6
+ props: z.record(z.string(), z.any()).optional()
7
+ });
8
+ const viewsSchema = z.object({
9
+ "request.section": z.array(sectionViewSchema).optional(),
10
+ "response.section": z.array(sectionViewSchema).optional()
11
+ });
12
+ const hooksSchema = z.object({
13
+ onBeforeRequest: z.function({
14
+ input: [z.object({ request: z.instanceof(Request) })],
15
+ output: z.union([z.void(), z.promise(z.void())])
16
+ }).optional(),
17
+ onResponseReceived: z.function({
18
+ input: [z.object({ response: z.instanceof(Response), operation: z.record(z.string(), z.any()) })],
19
+ output: z.union([z.void(), z.promise(z.void())])
20
+ }).optional()
21
+ });
22
+ const apiClientPluginSchema = z.function({
23
+ input: [],
24
+ output: z.object({
25
+ name: z.string(),
26
+ views: viewsSchema.optional(),
27
+ hooks: hooksSchema.optional()
28
+ })
29
+ });
30
+ export {
31
+ apiClientPluginSchema,
32
+ hooksSchema
33
+ };
34
+ //# sourceMappingURL=api-client-plugin.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/api-reference/api-client-plugin.ts"],
4
+ "sourcesContent": ["import { z } from 'zod'\n\nconst sectionViewSchema = z.object({\n title: z.string().optional(),\n // Since this is meant to be a Vue component, we'll use unknown\n component: z.unknown(),\n props: z.record(z.string(), z.any()).optional(),\n})\n\nconst viewsSchema = z.object({\n 'request.section': z.array(sectionViewSchema).optional(),\n 'response.section': z.array(sectionViewSchema).optional(),\n})\n\nexport const hooksSchema = z.object({\n onBeforeRequest: z\n .function({\n input: [z.object({ request: z.instanceof(Request) })],\n output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional(),\n onResponseReceived: z\n .function({\n input: [z.object({ response: z.instanceof(Response), operation: z.record(z.string(), z.any()) })],\n output: z.union([z.void(), z.promise(z.void())]),\n })\n .optional(),\n})\n\n/**\n * An API client plugin that can connect into request and response hooks\n */\nexport const apiClientPluginSchema = z.function({\n input: [],\n output: z.object({\n name: z.string(),\n views: viewsSchema.optional(),\n hooks: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