@scalar/api-reference 1.25.103 → 1.25.104
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 +33 -0
- package/dist/blocks/constants.d.ts +9 -0
- package/dist/blocks/constants.d.ts.map +1 -0
- package/dist/blocks/constants.js +8 -0
- package/dist/blocks/helpers/getPointer.d.ts +22 -0
- package/dist/blocks/helpers/getPointer.d.ts.map +1 -0
- package/dist/blocks/helpers/getPointer.js +12 -0
- package/dist/blocks/hooks/useBlockProps.d.ts +32 -0
- package/dist/blocks/hooks/useBlockProps.d.ts.map +1 -0
- package/dist/blocks/hooks/useBlockProps.js +28 -0
- package/dist/browser/standalone.js +12830 -12727
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReference.vue.js +31 -31
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +2 -1
- package/dist/components/Content/Introduction/Introduction.vue.d.ts.map +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue2.js +84 -70
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +94 -89
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +3 -3
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +91 -77
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts +9 -0
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.js +20 -0
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -1
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ClassicLayout.vue.js +30 -27
- package/dist/components/Layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/components/Layouts/ModernLayout.vue.js +2 -2
- package/dist/components/Layouts/ModernLayout.vue2.js +55 -50
- package/dist/features/ApiClientModal/useApiClient.d.ts +336 -254
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.d.ts.map +1 -1
- package/dist/features/DownloadLink/DownloadLink.vue.js +2 -2
- package/dist/features/DownloadLink/DownloadLink.vue2.js +10 -3
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +37 -26
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +3 -0
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +108 -101
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +3 -0
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +54 -50
- package/dist/helpers/get-request.d.ts +2 -0
- package/dist/helpers/get-request.d.ts.map +1 -1
- package/dist/helpers/parse.d.ts.map +1 -1
- package/dist/helpers/parse.js +88 -68
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -83
- package/dist/style.css +1 -1
- package/package.json +12 -13
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts +0 -10
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.d.ts.map +0 -1
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue.js +0 -7
- package/dist/components/DarkModeToggle/DarkModeIconToggle.vue2.js +0 -30
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts +0 -11
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.d.ts.map +0 -1
- package/dist/components/DarkModeToggle/DarkModeToggle.vue.js +0 -7
- package/dist/components/DarkModeToggle/DarkModeToggle.vue2.js +0 -31
- package/dist/components/DarkModeToggle/index.d.ts +0 -3
- package/dist/components/DarkModeToggle/index.d.ts.map +0 -1
- package/dist/embeds/ExampleRequest/ExampleRequest.vue.d.ts +0 -10
- package/dist/embeds/ExampleRequest/ExampleRequest.vue.d.ts.map +0 -1
- package/dist/embeds/ExampleRequest/index.d.ts +0 -2
- package/dist/embeds/ExampleRequest/index.d.ts.map +0 -1
- package/dist/embeds/ExampleResponses/ExampleResponses.vue.d.ts +0 -7
- package/dist/embeds/ExampleResponses/ExampleResponses.vue.d.ts.map +0 -1
- package/dist/embeds/ExampleResponses/index.d.ts +0 -2
- package/dist/embeds/ExampleResponses/index.d.ts.map +0 -1
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts +0 -782
- package/dist/embeds/OpenApiDocument/OpenApiDocument.vue.d.ts.map +0 -1
- package/dist/embeds/OpenApiDocument/index.d.ts +0 -3
- package/dist/embeds/OpenApiDocument/index.d.ts.map +0 -1
- package/dist/embeds/OpenApiDocument/types.d.ts +0 -3
- package/dist/embeds/OpenApiDocument/types.d.ts.map +0 -1
- package/dist/embeds/index.d.ts +0 -4
- package/dist/embeds/index.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @scalar/api-reference
|
|
2
2
|
|
|
3
|
+
## 1.25.104
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ace02fe: fix: favors configuration integration in open client modal button
|
|
8
|
+
- 60cd6f1: feat: render the operation description from the new store
|
|
9
|
+
- 39df543: feat: flatten discriminators containing null
|
|
10
|
+
- e866487: feat(components): create dark light toggle components
|
|
11
|
+
- d2b1525: feat: version prefix
|
|
12
|
+
- Updated dependencies [2ad0407]
|
|
13
|
+
- Updated dependencies [ace02fe]
|
|
14
|
+
- Updated dependencies [60cd6f1]
|
|
15
|
+
- Updated dependencies [60cd6f1]
|
|
16
|
+
- Updated dependencies [e866487]
|
|
17
|
+
- Updated dependencies [6d03777]
|
|
18
|
+
- Updated dependencies [6d03777]
|
|
19
|
+
- Updated dependencies [7df4472]
|
|
20
|
+
- Updated dependencies [13333e6]
|
|
21
|
+
- Updated dependencies [64df4fc]
|
|
22
|
+
- Updated dependencies [08ac264]
|
|
23
|
+
- Updated dependencies [aff72f7]
|
|
24
|
+
- Updated dependencies [cb09e76]
|
|
25
|
+
- Updated dependencies [2ad0407]
|
|
26
|
+
- @scalar/api-client@2.2.33
|
|
27
|
+
- @scalar/components@0.13.14
|
|
28
|
+
- @scalar/types@0.0.26
|
|
29
|
+
- @scalar/use-hooks@0.1.14
|
|
30
|
+
- @scalar/themes@0.9.60
|
|
31
|
+
- @scalar/oas-utils@0.2.97
|
|
32
|
+
- @scalar/openapi-types@0.1.6
|
|
33
|
+
- @scalar/openapi-parser@0.10.4
|
|
34
|
+
- @scalar/code-highlight@0.0.19
|
|
35
|
+
|
|
3
36
|
## 1.25.103
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/blocks/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;CAOlB,CAAA;AAED,eAAO,MAAM,QAAQ;;CAGpB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
NO_ELEMENT_PROVIDED: "Scalar Blocks: No HTML element provided to mount operation block. Please provide an HTML element to mount the operation block into.",
|
|
3
|
+
NO_URL_PROVIDED: "Scalar Blocks: No URL provided to import an OpenAPI document from. Please provide a URL to import an OpenAPI document from.",
|
|
4
|
+
EMPTY_PATH: "Path cannot be empty. Please provide a path to the operation you want to display."
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
o as ERRORS
|
|
8
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OpenAPI } from '@scalar/openapi-types';
|
|
2
|
+
/**
|
|
3
|
+
* Pass an array of strings to get a valid OpenAPI pointer.
|
|
4
|
+
*
|
|
5
|
+
* Works with any path, but is typed to allow the paths that we support.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ['paths', '/planets/{foo}', 'get'] > '#/paths/~1planets~1{foo}/get'
|
|
9
|
+
* ['components', 'schemas', 'Planet] > '#/components/schemas/Planet'
|
|
10
|
+
*/
|
|
11
|
+
type ValidOpenApiPaths = ['paths', string, Lowercase<OpenAPI.HttpMethod> | string] | ['components', 'schemas', string];
|
|
12
|
+
/**
|
|
13
|
+
* Encodes a location string with paths
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* getPointer(['paths', '/planets/{foo}', 'get'])
|
|
17
|
+
*
|
|
18
|
+
* '#/paths/~1planets~1{foo}/get'
|
|
19
|
+
*/
|
|
20
|
+
export declare function getPointer(path: ValidOpenApiPaths): `#/${string}`;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=getPointer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPointer.d.ts","sourceRoot":"","sources":["../../../src/blocks/helpers/getPointer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD;;;;;;;;GAQG;AACH,KAAK,iBAAiB,GAClB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,GACzD,CAAC,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;AAErC;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAY9B,KAAK,MAAM,EAAE,CAChC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ERRORS as n } from "../constants.js";
|
|
2
|
+
import { escapeJsonPointer as e } from "@scalar/openapi-parser";
|
|
3
|
+
function m(o) {
|
|
4
|
+
o.unshift("#");
|
|
5
|
+
const r = o.map((t) => e(t.trim())).filter(Boolean).join("/");
|
|
6
|
+
if (r === "#")
|
|
7
|
+
throw new Error(n.EMPTY_PATH);
|
|
8
|
+
return r;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
m as getPointer
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { createWorkspaceStore } from '@scalar/api-client/store';
|
|
2
|
+
import type { Request as RequestEntity } from '@scalar/oas-utils/entities/spec';
|
|
3
|
+
import { type ComputedRef } from 'vue';
|
|
4
|
+
export type StoreContext = ReturnType<typeof createWorkspaceStore>;
|
|
5
|
+
export type BlockProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The store created by `createStore`
|
|
8
|
+
*/
|
|
9
|
+
store: StoreContext | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The JSON pointer to the operation to use
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```
|
|
15
|
+
* #/paths/test/get
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
location: `#/${string}`;
|
|
19
|
+
/**
|
|
20
|
+
* The name of the collection to use
|
|
21
|
+
*
|
|
22
|
+
* @default 'default'
|
|
23
|
+
*/
|
|
24
|
+
collection?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Provides computed properties for the block, based on the standardized interface of the `createStore` function.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useBlockProps({ store, location }: BlockProps): {
|
|
30
|
+
operation: ComputedRef<RequestEntity | undefined>;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=useBlockProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBlockProps.d.ts","sourceRoot":"","sources":["../../../src/blocks/hooks/useBlockProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,KAAK,EAEV,OAAO,IAAI,aAAa,EACzB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,KAAK,CAAA;AAGhD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAElE,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,YAAY,GAAG,SAAS,CAAA;IAC/B;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAA;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAG;IAC9D,SAAS,EAAE,WAAW,CAAC,aAAa,GAAG,SAAS,CAAC,CAAA;CAClD,CA8CA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { unescapeJsonPointer as r } from "@scalar/openapi-parser";
|
|
2
|
+
import { computed as i } from "vue";
|
|
3
|
+
function h({ store: e, location: o }) {
|
|
4
|
+
const s = i(() => Object.values((e == null ? void 0 : e.collections) ?? {})[0]);
|
|
5
|
+
return {
|
|
6
|
+
operation: i(() => {
|
|
7
|
+
if (!(e != null && e.collections) || !e.requests)
|
|
8
|
+
return;
|
|
9
|
+
const c = Object.values(e.requests).filter(
|
|
10
|
+
(t) => {
|
|
11
|
+
var n;
|
|
12
|
+
return (n = s.value) == null ? void 0 : n.requests.includes(t.uid);
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
if (!o.startsWith("#/paths/"))
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Invalid location, try using #/paths/$YOUR_ENDPOINT/$HTTP_METHOD. You can use the getPointer helper to generate a valid location: getPointer(['paths', '/planets/{planetId}', 'get'])"
|
|
18
|
+
);
|
|
19
|
+
return c.find((t) => {
|
|
20
|
+
const n = r(o.split("/")[2]), l = o.split("/")[3].toLocaleLowerCase();
|
|
21
|
+
return t.method === l && t.path === n;
|
|
22
|
+
});
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
h as useBlockProps
|
|
28
|
+
};
|