@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.
Files changed (77) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/blocks/constants.js +6 -0
  3. package/dist/blocks/helpers/getPointer.js +12 -0
  4. package/dist/blocks/hooks/useBlockProps.d.ts +31 -0
  5. package/dist/blocks/hooks/useBlockProps.d.ts.map +1 -0
  6. package/dist/blocks/hooks/useBlockProps.js +24 -0
  7. package/dist/browser/standalone.js +14550 -14647
  8. package/dist/browser/webpack-stats.json +1 -1
  9. package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
  10. package/dist/components/ApiReferenceLayout.vue.js +2 -2
  11. package/dist/components/ApiReferenceLayout.vue2.js +176 -164
  12. package/dist/components/Content/Content.vue.js +2 -2
  13. package/dist/components/Content/Content.vue2.js +5 -5
  14. package/dist/features/Operation/Operation.vue.d.ts +6 -6
  15. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  16. package/dist/features/Operation/Operation.vue.js +49 -50
  17. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +6 -8
  18. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  19. package/dist/features/Operation/components/callbacks/Callback.vue.js +3 -3
  20. package/dist/features/Operation/components/callbacks/Callback.vue2.js +28 -21
  21. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +3 -5
  22. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  23. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +18 -33
  24. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +12 -11
  25. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  26. package/dist/features/Operation/layouts/ClassicLayout.vue.js +2 -2
  27. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +162 -164
  28. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +13 -12
  29. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  30. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  31. package/dist/features/Operation/layouts/ModernLayout.vue2.js +117 -111
  32. package/dist/features/api-client-modal/useApiClient.d.ts +5795 -5795
  33. package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
  34. package/dist/features/example-request/ExamplePicker.vue.d.ts +13 -0
  35. package/dist/features/example-request/ExamplePicker.vue.d.ts.map +1 -0
  36. package/dist/features/example-request/ExamplePicker.vue.js +7 -0
  37. package/dist/features/example-request/ExamplePicker.vue2.js +57 -0
  38. package/dist/features/example-request/ExampleRequest.vue.d.ts +85 -0
  39. package/dist/features/example-request/ExampleRequest.vue.d.ts.map +1 -0
  40. package/dist/features/example-request/ExampleRequest.vue.js +7 -0
  41. package/dist/features/example-request/ExampleRequest.vue2.js +348 -0
  42. package/dist/features/example-request/TextSelect.vue.d.ts +34 -0
  43. package/dist/features/example-request/TextSelect.vue.d.ts.map +1 -0
  44. package/dist/features/example-request/TextSelect.vue.js +48 -0
  45. package/dist/features/example-request/TextSelect.vue3.js +5 -0
  46. package/dist/features/example-request/index.d.ts +3 -0
  47. package/dist/features/example-request/index.d.ts.map +1 -0
  48. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  49. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  50. package/dist/features/example-responses/ExampleResponses.vue2.js +50 -51
  51. package/dist/features/test-request-button/TestRequestButton.vue.d.ts +2 -3
  52. package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
  53. package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
  54. package/dist/features/test-request-button/TestRequestButton.vue2.js +19 -21
  55. package/dist/index.d.ts +1 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +15 -13
  58. package/dist/style.css +1 -1
  59. package/dist/v2/ApiReferenceWorkspace.vue.d.ts +1 -3
  60. package/dist/v2/ApiReferenceWorkspace.vue.d.ts.map +1 -1
  61. package/dist/v2/ApiReferenceWorkspace.vue.js +86 -113
  62. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts.map +1 -1
  63. package/dist/v2/blocks/scalar-request-example-block/helpers/find-client.js +3 -20
  64. package/dist/v2/blocks/scalar-request-example-block/index.d.ts +2 -2
  65. package/dist/v2/events/index.d.ts +1 -1
  66. package/dist/v2/events/listeners.d.ts +1 -1
  67. package/package.json +10 -10
  68. package/dist/helpers/convert-security-scheme.js +0 -23
  69. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue.js +0 -4
  70. package/dist/v2/blocks/scalar-request-example-block/components/ExamplePicker.vue2.js +0 -64
  71. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.js +0 -7
  72. package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue2.js +0 -212
  73. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-client-options.js +0 -35
  74. package/dist/v2/blocks/scalar-request-example-block/helpers/generate-code-snippet.js +0 -29
  75. package/dist/v2/blocks/scalar-request-example-block/helpers/get-secrets.js +0 -10
  76. package/dist/v2/events/definitions.js +0 -7
  77. package/dist/v2/hooks/useStore.js +0 -14
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/api-reference
2
2
 
3
+ ## 1.32.9
4
+
5
+ ### Patch Changes
6
+
7
+ - 8c6f6fe: fix: rollback workspace store
8
+
3
9
  ## 1.32.8
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,6 @@
1
+ const t = {
2
+ EMPTY_PATH: "Path cannot be empty. Please provide a path to the operation you want to display."
3
+ };
4
+ export {
5
+ t as ERRORS
6
+ };
@@ -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
+ };