@scalar/api-reference 1.25.127 → 1.25.128
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 +29 -0
- package/dist/browser/standalone.js +16046 -15965
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.d.ts.map +1 -1
- package/dist/components/ApiReference.vue.js +40 -64
- package/dist/components/ApiReferenceLayout.vue.d.ts +2 -2
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +158 -159
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +69 -17
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +5 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +73 -94
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts +16 -0
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.d.ts.map +1 -0
- package/dist/components/Content/ClientLibraries/useFeaturedHttpClients.js +36 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +4 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +2 -2
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +143 -124
- package/dist/components/GettingStarted.vue.d.ts.map +1 -1
- package/dist/components/GettingStarted.vue.js +1 -1
- package/dist/components/GettingStarted.vue2.js +13 -13
- package/dist/components/Layouts/ClassicLayout.vue.d.ts +3 -3
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/Layouts.vue.d.ts +3 -3
- package/dist/components/Layouts/Layouts.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.d.ts +3 -3
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue.d.ts.map +1 -1
- package/dist/components/Section/CompactSection.vue.js +2 -2
- package/dist/components/Section/CompactSection.vue2.js +30 -29
- package/dist/esm.d.ts +5 -3
- package/dist/esm.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/useApiClient.d.ts +362 -342
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.d.ts.map +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue.js +1 -1
- package/dist/features/ExampleRequest/ExampleRequest.vue2.js +82 -74
- package/dist/features/ExampleResponses/ExampleResponse.vue.d.ts.map +1 -1
- package/dist/features/ExampleResponses/ExampleResponse.vue.js +2 -2
- package/dist/features/ExampleResponses/ExampleResponse.vue2.js +11 -11
- package/dist/features/ExampleResponses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/ExampleResponses/ExampleResponses.vue.js +2 -2
- package/dist/features/ExampleResponses/ExampleResponses.vue2.js +90 -78
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue.js +1 -1
- package/dist/features/Operation/components/ContentTypeSelect.vue2.js +29 -25
- package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
- package/dist/features/Operation/components/ParameterListItem.vue2.js +40 -47
- package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/RequestBody.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/helpers/get-request.d.ts +1 -1
- package/dist/helpers/get-request.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/useConfig.d.ts +3 -3
- package/dist/hooks/useConfig.d.ts.map +1 -1
- package/dist/hooks/useConfig.js +5 -4
- package/dist/index.js +17 -19
- package/dist/standalone/lib/html-api.d.ts +3 -3
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/standalone/lib/html-rendering.d.ts +23 -24
- package/dist/standalone/lib/html-rendering.d.ts.map +1 -1
- package/dist/standalone/lib/html-rendering.js +39 -29
- package/dist/stores/useHttpClientStore.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +19 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -10
- package/dist/hooks/useDeprecationWarnings.d.ts +0 -6
- package/dist/hooks/useDeprecationWarnings.d.ts.map +0 -1
- package/dist/hooks/useDeprecationWarnings.js +0 -20
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
2
|
/**
|
|
3
3
|
* Reading the configuration from the data-attributes.
|
|
4
4
|
*/
|
|
5
|
-
export declare function getConfigurationFromDataAttributes(doc: Document):
|
|
5
|
+
export declare function getConfigurationFromDataAttributes(doc: Document): ApiReferenceConfiguration;
|
|
6
6
|
/**
|
|
7
7
|
* Mount the Scalar API Reference on a given document.
|
|
8
8
|
* Read the HTML data-attributes for configuration.
|
|
9
9
|
*/
|
|
10
|
-
export declare function mountScalarApiReference(doc: Document, configuration:
|
|
10
|
+
export declare function mountScalarApiReference(doc: Document, configuration: ApiReferenceConfiguration): void;
|
|
11
11
|
//# sourceMappingURL=html-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,KAAK,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAQ7G;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,QAAQ,GAAG,yBAAyB,CA8G3F;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,yBAAyB,QAsF9F"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Zod schema for HTML rendering configuration
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
+
export declare const htmlRenderingOptionsSchema: z.ZodObject<{
|
|
6
7
|
/**
|
|
7
8
|
* The URL to the Scalar API Reference JS CDN.
|
|
8
9
|
*
|
|
@@ -12,40 +13,38 @@ export type CdnConfiguration = {
|
|
|
12
13
|
*
|
|
13
14
|
* @example https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.122
|
|
14
15
|
*/
|
|
15
|
-
cdn
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* The page title configuration for the Scalar API Reference.
|
|
19
|
-
*/
|
|
20
|
-
export type PageTitleConfiguration = {
|
|
16
|
+
cdn: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
21
17
|
/**
|
|
22
18
|
* The title of the page.
|
|
23
19
|
*/
|
|
24
|
-
pageTitle
|
|
25
|
-
}
|
|
26
|
-
|
|
20
|
+
pageTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
cdn: string;
|
|
23
|
+
pageTitle: string;
|
|
24
|
+
}, {
|
|
25
|
+
cdn?: string | undefined;
|
|
26
|
+
pageTitle?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
type HtmlRenderingOptions = z.infer<typeof htmlRenderingOptionsSchema>;
|
|
29
|
+
export type HtmlRenderingConfiguration = ApiReferenceConfiguration & HtmlRenderingOptions;
|
|
27
30
|
/**
|
|
28
31
|
* The HTML document to render the Scalar API reference.
|
|
32
|
+
*
|
|
33
|
+
* We must check the passed in configuration and not the parsedConfig for the theme as the parsedConfig will have it
|
|
34
|
+
* defaulted to 'default'
|
|
29
35
|
*/
|
|
30
|
-
export declare
|
|
36
|
+
export declare const getHtmlDocument: (configuration: Partial<HtmlRenderingConfiguration>, customTheme?: string) => string;
|
|
31
37
|
/**
|
|
32
38
|
* The script tags to load the @scalar/api-reference package from the CDN.
|
|
33
39
|
*/
|
|
34
|
-
export declare function getScriptTags(configuration:
|
|
40
|
+
export declare function getScriptTags(configuration: ApiReferenceConfiguration, cdn: string): string;
|
|
35
41
|
/**
|
|
36
42
|
* The configuration to pass to the @scalar/api-reference package.
|
|
37
43
|
*/
|
|
38
|
-
export declare
|
|
44
|
+
export declare const getConfiguration: (givenConfiguration: ApiReferenceConfiguration) => string;
|
|
39
45
|
/**
|
|
40
46
|
* The content to pass to the @scalar/api-reference package as the <script> tag content.
|
|
41
47
|
*/
|
|
42
|
-
export declare
|
|
43
|
-
|
|
44
|
-
* The CDN URL to load the @scalar/api-reference package from.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getCdnUrl(configuration: HtmlRenderingConfiguration): string;
|
|
47
|
-
/**
|
|
48
|
-
* The page title for the Scalar API Reference.
|
|
49
|
-
*/
|
|
50
|
-
export declare function getPageTitle(configuration: HtmlRenderingConfiguration): string;
|
|
48
|
+
export declare const getScriptTagContent: (configuration: ApiReferenceConfiguration) => string;
|
|
49
|
+
export {};
|
|
51
50
|
//# sourceMappingURL=html-rendering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-rendering.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-rendering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"html-rendering.d.ts","sourceRoot":"","sources":["../../../src/standalone/lib/html-rendering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,0BAA0B;IACrC;;;;;;;;OAQG;;IAEH;;OAEG;;;;;;;;EAEH,CAAA;AACF,KAAK,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEtE,MAAM,MAAM,0BAA0B,GAAG,yBAAyB,GAAG,oBAAoB,CAAA;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,kBAAmB,OAAO,CAAC,0BAA0B,CAAC,iCAuBjF,CAAA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,aAAa,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,UAQlF;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,uBAAwB,yBAAyB,WAa7E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,kBAAmB,yBAAyB,WAKpE,CAAA"}
|
|
@@ -1,54 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
import { apiReferenceConfigurationSchema as o } from "@scalar/types/api-reference";
|
|
2
|
+
import { z as s } from "zod";
|
|
3
|
+
const a = s.object({
|
|
4
|
+
/**
|
|
5
|
+
* The URL to the Scalar API Reference JS CDN.
|
|
6
|
+
*
|
|
7
|
+
* Use this to pin a specific version of the Scalar API Reference.
|
|
8
|
+
*
|
|
9
|
+
* @default https://cdn.jsdelivr.net/npm/@scalar/api-reference
|
|
10
|
+
*
|
|
11
|
+
* @example https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.122
|
|
12
|
+
*/
|
|
13
|
+
cdn: s.string().optional().default("https://cdn.jsdelivr.net/npm/@scalar/api-reference"),
|
|
14
|
+
/**
|
|
15
|
+
* The title of the page.
|
|
16
|
+
*/
|
|
17
|
+
pageTitle: s.string().optional().default("Scalar API Reference")
|
|
18
|
+
}), h = (e, t = "") => {
|
|
19
|
+
const { cdn: n, pageTitle: c, ...i } = e, r = a.parse({ cdn: n, pageTitle: c, customTheme: t }), p = o.parse(i);
|
|
2
20
|
return `
|
|
3
21
|
<!DOCTYPE html>
|
|
4
22
|
<html>
|
|
5
23
|
<head>
|
|
6
|
-
<title>${
|
|
24
|
+
<title>${r.pageTitle}</title>
|
|
7
25
|
<meta charset="utf-8" />
|
|
8
26
|
<meta
|
|
9
27
|
name="viewport"
|
|
10
28
|
content="width=device-width, initial-scale=1" />
|
|
11
29
|
<style>
|
|
12
|
-
${
|
|
30
|
+
${e.theme ? "" : t}
|
|
13
31
|
</style>
|
|
14
32
|
</head>
|
|
15
33
|
<body>
|
|
16
|
-
${r
|
|
34
|
+
${l(p, r.cdn)}
|
|
17
35
|
</body>
|
|
18
36
|
</html>
|
|
19
37
|
`;
|
|
20
|
-
}
|
|
21
|
-
function
|
|
38
|
+
};
|
|
39
|
+
function l(e, t) {
|
|
22
40
|
return `
|
|
23
41
|
<script
|
|
24
42
|
id="api-reference"
|
|
25
43
|
type="application/json"
|
|
26
|
-
data-configuration="${
|
|
27
|
-
<script src="${
|
|
44
|
+
data-configuration="${d(e)}">${f(e)}<\/script>
|
|
45
|
+
<script src="${t}"><\/script>
|
|
28
46
|
`;
|
|
29
47
|
}
|
|
30
|
-
|
|
48
|
+
const d = (e) => {
|
|
31
49
|
var n, c, i;
|
|
32
|
-
const
|
|
33
|
-
...
|
|
50
|
+
const t = {
|
|
51
|
+
...e
|
|
34
52
|
};
|
|
35
|
-
return (n =
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
function l(t) {
|
|
42
|
-
return t.cdn || "https://cdn.jsdelivr.net/npm/@scalar/api-reference";
|
|
43
|
-
}
|
|
44
|
-
function a(t) {
|
|
45
|
-
return t.pageTitle || "Scalar API Reference";
|
|
46
|
-
}
|
|
53
|
+
return (n = t.spec) != null && n.url ? (c = t.spec) != null && c.content && ((i = t.spec) == null || delete i.content) : delete t.spec, JSON.stringify(t).split('"').join(""");
|
|
54
|
+
}, f = (e) => {
|
|
55
|
+
var t, n, c, i;
|
|
56
|
+
return (t = e.spec) != null && t.content ? typeof ((n = e.spec) == null ? void 0 : n.content) == "function" ? JSON.stringify((c = e.spec) == null ? void 0 : c.content()) : JSON.stringify((i = e.spec) == null ? void 0 : i.content) : "";
|
|
57
|
+
};
|
|
47
58
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
r as getScriptTags
|
|
59
|
+
d as getConfiguration,
|
|
60
|
+
h as getHtmlDocument,
|
|
61
|
+
f as getScriptTagContent,
|
|
62
|
+
l as getScriptTags,
|
|
63
|
+
a as htmlRenderingOptionsSchema
|
|
54
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHttpClientStore.d.ts","sourceRoot":"","sources":["../../src/stores/useHttpClientStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,KAAK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