@scalar/api-reference 1.32.8 → 1.32.9
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 +6 -0
- package/dist/blocks/constants.js +6 -0
- package/dist/blocks/helpers/getPointer.js +12 -0
- package/dist/blocks/hooks/useBlockProps.d.ts +31 -0
- package/dist/blocks/hooks/useBlockProps.d.ts.map +1 -0
- package/dist/blocks/hooks/useBlockProps.js +24 -0
- package/dist/browser/standalone.js +14550 -14647
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +176 -164
- package/dist/components/Content/Content.vue.js +2 -2
- package/dist/components/Content/Content.vue2.js +5 -5
- package/dist/features/Operation/Operation.vue.d.ts +6 -6
- package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
- package/dist/features/Operation/Operation.vue.js +49 -50
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +6 -8
- package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
- package/dist/features/Operation/components/callbacks/Callback.vue2.js +28 -21
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +3 -5
- package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
- package/dist/features/Operation/components/callbacks/Callbacks.vue.js +18 -33
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +12 -11
- package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ClassicLayout.vue2.js +162 -164
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +13 -12
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +117 -111
- package/dist/features/api-client-modal/useApiClient.d.ts +5795 -5795
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/example-request/ExamplePicker.vue.d.ts +13 -0
- package/dist/features/example-request/ExamplePicker.vue.d.ts.map +1 -0
- package/dist/features/example-request/ExamplePicker.vue.js +7 -0
- package/dist/features/example-request/ExamplePicker.vue2.js +57 -0
- package/dist/features/example-request/ExampleRequest.vue.d.ts +85 -0
- package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -0
- package/dist/features/example-request/ExampleRequest.vue.js +7 -0
- package/dist/features/example-request/ExampleRequest.vue2.js +348 -0
- package/dist/features/example-request/TextSelect.vue.d.ts +34 -0
- package/dist/features/example-request/TextSelect.vue.d.ts.map +1 -0
- package/dist/features/example-request/TextSelect.vue.js +48 -0
- package/dist/features/example-request/TextSelect.vue3.js +5 -0
- package/dist/features/example-request/index.d.ts +3 -0
- package/dist/features/example-request/index.d.ts.map +1 -0
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponses.vue2.js +50 -51
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts +2 -3
- package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
- package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
- package/dist/features/test-request-button/TestRequestButton.vue2.js +19 -21
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -13
- package/dist/style.css +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts +1 -3
- package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
- package/dist/v2/ApiReferenceWorkspace.vue.js +86 -113
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +3 -20
- package/dist/v2/blocks/scalar-request-example-block/index.d.ts +2 -2
- package/dist/v2/events/index.d.ts +1 -1
- package/dist/v2/events/listeners.d.ts +1 -1
- package/package.json +10 -10
- package/dist/helpers/convert-security-scheme.js +0 -23
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.js +0 -4
- package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +0 -64
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +0 -7
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +0 -212
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.js +0 -35
- package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.js +0 -29
- package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +0 -10
- package/dist/v2/events/definitions.js +0 -7
- package/dist/v2/hooks/useStore.js +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -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,31 @@
|
|
|
1
|
+
import type { createWorkspaceStore } from '@scalar/api-client/store';
|
|
2
|
+
import type { Collection } from '@scalar/oas-utils/entities/spec';
|
|
3
|
+
import type { Request as RequestEntity } from '@scalar/oas-utils/entities/spec';
|
|
4
|
+
import { type ComputedRef } from 'vue';
|
|
5
|
+
export type StoreContext = ReturnType<typeof createWorkspaceStore>;
|
|
6
|
+
export type BlockProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The store created by `createStore`
|
|
9
|
+
*/
|
|
10
|
+
store: StoreContext | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The JSON pointer to the operation to use
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```
|
|
16
|
+
* #/paths/test/get
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
location: `#/${string}`;
|
|
20
|
+
/**
|
|
21
|
+
* The collection to use
|
|
22
|
+
*/
|
|
23
|
+
collection: Collection;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Provides computed properties for the block, based on the standardized interface of the `createStore` function.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useBlockProps({ store, location, collection }: BlockProps): {
|
|
29
|
+
operation: ComputedRef<RequestEntity | undefined>;
|
|
30
|
+
};
|
|
31
|
+
//# 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,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAE/E,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;;OAEG;IACH,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,UAAU,GAAG;IAC1E,SAAS,EAAE,WAAW,CAAC,aAAa,GAAG,SAAS,CAAC,CAAA;CAClD,CAgCA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { unescapeJsonPointer as a } from "@scalar/openapi-parser";
|
|
2
|
+
import { computed as p } from "vue";
|
|
3
|
+
function d({ store: t, location: e, collection: o }) {
|
|
4
|
+
return {
|
|
5
|
+
operation: p(() => {
|
|
6
|
+
if (!(t != null && t.collections) || !t.requests)
|
|
7
|
+
return;
|
|
8
|
+
const n = Object.values(t.requests).filter(
|
|
9
|
+
(s) => o.requests.includes(s.uid)
|
|
10
|
+
);
|
|
11
|
+
if (!e.startsWith("#/paths/") && !e.startsWith("#/webhooks/"))
|
|
12
|
+
throw new Error(
|
|
13
|
+
"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'])"
|
|
14
|
+
);
|
|
15
|
+
return n.find((s) => {
|
|
16
|
+
const r = a(e.split("/")[2]), i = e.split("/")[3].toLocaleLowerCase();
|
|
17
|
+
return s.method === i && s.path === r;
|
|
18
|
+
});
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
d as useBlockProps
|
|
24
|
+
};
|