@scalar/api-client 2.34.0 → 2.36.0

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 (52) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  3. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +88 -80
  7. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
  8. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
  9. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
  10. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
  11. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  12. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +90 -84
  13. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
  16. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  17. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -23
  18. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  19. package/dist/v2/features/app/App.vue.js +41 -35
  20. package/dist/v2/features/app/app-events.d.ts +5 -2
  21. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  22. package/dist/v2/features/app/app-events.js +58 -44
  23. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  24. package/dist/v2/features/app/app-state.js +82 -80
  25. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  26. package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
  27. package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
  28. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  29. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
  30. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  31. package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
  32. package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
  33. package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
  34. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  35. package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
  36. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  37. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  38. package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
  39. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  40. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  41. package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
  42. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
  43. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  44. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
  45. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
  46. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  47. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
  48. package/dist/v2/features/operation/Operation.vue.js +1 -1
  49. package/dist/v2/workspace-events.d.ts.map +1 -1
  50. package/dist/v2/workspace-events.js +8 -5
  51. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  52. package/package.json +17 -17
@@ -1,4 +1,4 @@
1
- import { defineComponent as h, computed as p, createElementBlock as c, openBlock as u, createElementVNode as t, createVNode as o, createBlock as f, createCommentVNode as y, withCtx as l, unref as s, resolveDynamicComponent as g, mergeProps as k } from "vue";
1
+ import { defineComponent as h, computed as p, createElementBlock as c, openBlock as u, createElementVNode as t, createVNode as o, createBlock as f, createCommentVNode as y, withCtx as n, unref as s, resolveDynamicComponent as g, mergeProps as k } from "vue";
2
2
  import { ScalarButton as i } from "@scalar/components";
3
3
  import { ScalarIconFloppyDisk as b } from "@scalar/icons";
4
4
  import { LibraryIcon as w } from "@scalar/icons/library";
@@ -9,8 +9,8 @@ import V from "./components/LabelInput.vue.js";
9
9
  import B from "./components/Tabs.vue.js";
10
10
  const D = { class: "custom-scroll h-full" }, N = {
11
11
  key: 0,
12
- class: "w-full md:mx-auto md:max-w-180"
13
- }, z = ["aria-label"], I = { class: "flex flex-row items-center gap-2" }, T = { class: "group relative ml-1.25" }, U = { class: "px-1.5 py-8" }, $ = {
12
+ class: "w-full px-3 md:mx-auto md:max-w-180"
13
+ }, z = ["aria-label"], I = { class: "flex flex-row items-center gap-2" }, T = { class: "group relative ml-1.25 flex-1" }, U = { class: "px-1.5 py-8" }, $ = {
14
14
  key: 1,
15
15
  class: "flex w-full flex-1 items-center justify-center"
16
16
  }, j = {
@@ -35,33 +35,33 @@ const D = { class: "custom-scroll h-full" }, N = {
35
35
  isDarkMode: { type: Boolean }
36
36
  },
37
37
  setup(a) {
38
- const n = a, m = p(() => n.document?.info?.title || "Untitled Document"), d = p(
39
- () => n.document?.["x-scalar-icon"] || "interface-content-folder"
40
- ), v = () => {
41
- n.workspaceStore.revertDocumentChanges(n.documentSlug);
42
- }, x = () => {
43
- n.workspaceStore.saveDocument(n.documentSlug);
38
+ const l = a, m = p(() => l.document?.info?.title ?? ""), d = p(
39
+ () => l.document?.["x-scalar-icon"] || "interface-content-folder"
40
+ ), x = () => {
41
+ l.workspaceStore.revertDocumentChanges(l.documentSlug);
42
+ }, v = () => {
43
+ l.workspaceStore.saveDocument(l.documentSlug);
44
44
  };
45
45
  return (E, e) => (u(), c("div", D, [
46
46
  a.document ? (u(), c("div", N, [
47
47
  t("div", {
48
48
  "aria-label": `title: ${m.value}`,
49
- class: "mx-auto flex h-fit w-full flex-col gap-2 pt-6 pb-3 md:max-w-180"
49
+ class: "mx-auto flex h-fit w-full flex-col gap-2 pt-14 pb-3 md:max-w-180 md:pt-6"
50
50
  }, [
51
51
  a.document?.["x-scalar-is-dirty"] ? (u(), f(S, {
52
52
  key: 0,
53
53
  class: "mb-5",
54
54
  type: "warning"
55
55
  }, {
56
- actions: l(() => [
56
+ actions: n(() => [
57
57
  o(s(i), {
58
58
  class: "text-c-2 hover:text-c-1 flex items-center gap-2",
59
59
  size: "xs",
60
60
  type: "button",
61
61
  variant: "outlined",
62
- onClick: v
62
+ onClick: x
63
63
  }, {
64
- default: l(() => [...e[2] || (e[2] = [
64
+ default: n(() => [...e[2] || (e[2] = [
65
65
  t("span", null, "Undo", -1)
66
66
  ])]),
67
67
  _: 1
@@ -71,9 +71,9 @@ const D = { class: "custom-scroll h-full" }, N = {
71
71
  size: "xs",
72
72
  type: "button",
73
73
  variant: "solid",
74
- onClick: x
74
+ onClick: v
75
75
  }, {
76
- default: l(() => [
76
+ default: n(() => [
77
77
  o(s(b), {
78
78
  size: "sm",
79
79
  thickness: "1.5"
@@ -83,7 +83,7 @@ const D = { class: "custom-scroll h-full" }, N = {
83
83
  _: 1
84
84
  })
85
85
  ]),
86
- default: l(() => [
86
+ default: n(() => [
87
87
  e[4] || (e[4] = t("p", null, " You have unsaved changes. Save your work to keep your changes, or undo to revert them. ", -1))
88
88
  ]),
89
89
  _: 1
@@ -94,12 +94,12 @@ const D = { class: "custom-scroll h-full" }, N = {
94
94
  placement: "bottom-start",
95
95
  "onUpdate:modelValue": e[0] || (e[0] = (r) => a.eventBus.emit("document:update:icon", r))
96
96
  }, {
97
- default: l(() => [
97
+ default: n(() => [
98
98
  o(s(i), {
99
99
  class: "hover:bg-b-2 aspect-square h-7 w-7 cursor-pointer rounded border border-transparent p-0 hover:border-inherit",
100
100
  variant: "ghost"
101
101
  }, {
102
- default: l(() => [
102
+ default: n(() => [
103
103
  o(s(w), {
104
104
  class: "text-c-2 size-5",
105
105
  src: d.value,
@@ -124,8 +124,8 @@ const D = { class: "custom-scroll h-full" }, N = {
124
124
  o(B, { type: "document" }),
125
125
  t("div", U, [
126
126
  o(s(_), null, {
127
- default: l(({ Component: r }) => [
128
- (u(), f(g(r), k(n, { collectionType: "document" }), null, 16))
127
+ default: n(({ Component: r }) => [
128
+ (u(), f(g(r), k(l, { collectionType: "document" }), null, 16))
129
129
  ]),
130
130
  _: 1
131
131
  })
@@ -1 +1 @@
1
- {"version":3,"file":"OperationCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/OperationCollection.vue"],"names":[],"mappings":"AAkHA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE,uGAAuG;wBAClF,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSAyLd,CAAC"}
1
+ {"version":3,"file":"OperationCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/OperationCollection.vue"],"names":[],"mappings":"AAkHA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE,uGAAuG;wBAClF,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSA2Ld,CAAC"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as f, computed as m, ref as h, watch as v, createElementBlock as i, openBlock as u, createElementVNode as o, createVNode as s, unref as x, mergeProps as _ } from "vue";
1
+ import { defineComponent as f, computed as m, ref as h, watch as v, createElementBlock as i, openBlock as p, createElementVNode as o, createVNode as s, unref as x, mergeProps as _ } from "vue";
2
2
  import { isHttpMethod as y } from "@scalar/helpers/http/is-http-method";
3
3
  import { getResolvedRef as w } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
4
  import { RouterView as g } from "vue-router";
@@ -7,7 +7,7 @@ import b from "./components/Tabs.vue.js";
7
7
  const B = {
8
8
  key: 0,
9
9
  class: "custom-scroll h-full"
10
- }, S = { class: "w-full md:mx-auto md:max-w-180" }, V = ["aria-label"], T = { class: "group relative ml-1.25" }, U = { class: "px-1.5 py-8" }, $ = {
10
+ }, S = { class: "w-full px-3 md:mx-auto md:max-w-180" }, V = ["aria-label"], T = { class: "group relative ml-1.25" }, U = { class: "px-1.5 py-8" }, $ = {
11
11
  key: 1,
12
12
  class: "flex w-full flex-1 items-center justify-center"
13
13
  }, C = {}, M = /* @__PURE__ */ f({
@@ -30,8 +30,8 @@ const B = {
30
30
  currentTheme: {},
31
31
  isDarkMode: { type: Boolean }
32
32
  },
33
- setup(p) {
34
- const e = p, n = m(() => {
33
+ setup(u) {
34
+ const e = u, n = m(() => {
35
35
  if (!(!e.path || !e.method))
36
36
  return w(e.document?.paths?.[e.path]?.[e.method]);
37
37
  }), l = h(n.value?.summary ?? "");
@@ -50,11 +50,11 @@ const B = {
50
50
  }
51
51
  });
52
52
  }, c = m(() => !e.path || !e.method ? "Untitled Operation" : `${e.method.toUpperCase()} ${e.path}`);
53
- return (r, t) => n.value !== void 0 ? (u(), i("div", B, [
53
+ return (r, t) => n.value !== void 0 ? (p(), i("div", B, [
54
54
  o("div", S, [
55
55
  o("div", {
56
56
  "aria-label": `title: ${l.value}`,
57
- class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-8 pb-3 md:max-w-180"
57
+ class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-14 pb-3 md:max-w-180 md:pt-8"
58
58
  }, [
59
59
  o("div", T, [
60
60
  s(k, {
@@ -72,7 +72,7 @@ const B = {
72
72
  s(x(g), _(e, { collectionType: "operation" }), null, 16)
73
73
  ])
74
74
  ])
75
- ])) : (u(), i("div", $, [...t[1] || (t[1] = [
75
+ ])) : (p(), i("div", $, [...t[1] || (t[1] = [
76
76
  o("div", { class: "flex h-full flex-col items-center justify-center" }, [
77
77
  o("h1", { class: "text-2xl font-bold" }, "Operation not found"),
78
78
  o("p", { class: "text-gray-500" }, " The operation you are looking for does not exist. ")
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/WorkspaceCollection.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE,uGAAuG;wBAClF,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSAmId,CAAC"}
1
+ {"version":3,"file":"WorkspaceCollection.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/collection/WorkspaceCollection.vue"],"names":[],"mappings":"AA2EA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAMlE,uGAAuG;wBAClF,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY,gSAuId,CAAC"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as m, ref as p, watch as i, createElementBlock as u, openBlock as d, createElementVNode as a, createVNode as l, unref as f, mergeProps as v } from "vue";
1
+ import { defineComponent as p, ref as m, watch as i, createElementBlock as u, openBlock as d, createElementVNode as a, createVNode as l, unref as f, mergeProps as v } from "vue";
2
2
  import { RouterView as _ } from "vue-router";
3
3
  import k from "./components/LabelInput.vue.js";
4
4
  import h from "./components/Tabs.vue.js";
5
- const w = { class: "custom-scroll h-full" }, x = { class: "w-full md:mx-auto md:max-w-180" }, b = ["aria-label"], W = { class: "group relative ml-1.25" }, y = { class: "px-1.5 py-8" }, B = {}, S = /* @__PURE__ */ m({
5
+ const w = { class: "custom-scroll h-full" }, x = { class: "w-full px-3 md:mx-auto md:max-w-180" }, b = ["aria-label"], W = { class: "group relative ml-1.25" }, y = { class: "px-1.5 py-8" }, B = {}, S = /* @__PURE__ */ p({
6
6
  ...B,
7
7
  __name: "WorkspaceCollection",
8
8
  props: {
@@ -23,7 +23,7 @@ const w = { class: "custom-scroll h-full" }, x = { class: "w-full md:mx-auto md:
23
23
  isDarkMode: { type: Boolean }
24
24
  },
25
25
  setup(s) {
26
- const e = s, o = p(e.activeWorkspace.label);
26
+ const e = s, o = m(e.activeWorkspace.label);
27
27
  i(
28
28
  () => e.activeWorkspace.label,
29
29
  (t) => {
@@ -41,7 +41,7 @@ const w = { class: "custom-scroll h-full" }, x = { class: "w-full md:mx-auto md:
41
41
  a("div", x, [
42
42
  a("div", {
43
43
  "aria-label": `title: ${s.activeWorkspace.label}`,
44
- class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-8 pb-3 md:max-w-180"
44
+ class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-14 pb-3 md:max-w-180 md:pt-6"
45
45
  }, [
46
46
  a("div", W, [
47
47
  l(k, {
@@ -49,6 +49,7 @@ const w = { class: "custom-scroll h-full" }, x = { class: "w-full md:mx-auto md:
49
49
  "onUpdate:modelValue": c[0] || (c[0] = (n) => o.value = n),
50
50
  class: "text-xl font-bold",
51
51
  inputId: "workspaceName",
52
+ placeholder: "Untitled Workspace",
52
53
  onBlur: r
53
54
  }, null, 8, ["modelValue"])
54
55
  ])
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AAghBA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AA4hBA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import t from "./Authentication.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-60f72663"]]);
4
+ const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1550f6bf"]]);
5
5
  export {
6
6
  i as default
7
7
  };
@@ -1,13 +1,15 @@
1
- import { defineComponent as B, computed as o, ref as A, watchEffect as N, createBlock as O, openBlock as s, createSlots as U, withCtx as c, createElementVNode as n, normalizeClass as d, createVNode as v, unref as h, createElementBlock as y, Fragment as f, createTextVNode as u } from "vue";
2
- import { ScalarToggle as b } from "@scalar/components";
3
- import { isHttpMethod as R } from "@scalar/helpers/http/is-http-method";
4
- import { getResolvedRef as V } from "@scalar/workspace-store/helpers/get-resolved-ref";
5
- import { getDefaultOperationSecurityToggle as q } from "../helpers/get-default-operation-security-toggle.js";
6
- import C from "../../settings/components/Section.vue.js";
7
- import { getActiveProxyUrl as E } from "../../../helpers/get-active-proxy-url.js";
8
- import { getServers as M } from "../../../helpers/get-servers.js";
9
- import D from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
10
- const P = { class: "flex h-8 items-center" }, K = /* @__PURE__ */ B({
1
+ import { defineComponent as A, computed as n, ref as O, watchEffect as b, createBlock as N, openBlock as s, createSlots as U, withCtx as u, createElementVNode as r, normalizeClass as v, createVNode as h, unref as y, createElementBlock as f, Fragment as S, createTextVNode as i } from "vue";
2
+ import { ScalarToggle as R } from "@scalar/components";
3
+ import { isHttpMethod as V } from "@scalar/helpers/http/is-http-method";
4
+ import { getResolvedRef as q } from "@scalar/workspace-store/helpers/get-resolved-ref";
5
+ import { unpackProxyObject as C } from "@scalar/workspace-store/helpers/unpack-proxy";
6
+ import { getDefaultOperationSecurityToggle as E } from "../helpers/get-default-operation-security-toggle.js";
7
+ import M from "../../settings/components/Section.vue.js";
8
+ import { getActiveProxyUrl as P } from "../../../helpers/get-active-proxy-url.js";
9
+ import { getSelectedSecurity as g } from "../../operation/helpers/get-selected-security.js";
10
+ import { getServers as D } from "../../../helpers/get-servers.js";
11
+ import $ from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
12
+ const j = { class: "flex h-8 items-center" }, Y = /* @__PURE__ */ A({
11
13
  __name: "Authentication",
12
14
  props: {
13
15
  documentSlug: {},
@@ -28,73 +30,89 @@ const P = { class: "flex h-8 items-center" }, K = /* @__PURE__ */ B({
28
30
  collectionType: {}
29
31
  },
30
32
  setup(e) {
31
- const r = o(() => e.collectionType === "operation" ? {
33
+ const c = n(() => e.collectionType === "operation" ? {
32
34
  type: "operation",
33
35
  path: e.path ?? "",
34
36
  method: e.method ?? "get"
35
- } : { type: "document" }), i = o(() => e.collectionType === "operation" ? !e.path || !R(e.method) ? null : V(e.document?.paths?.[e.path]?.[e.method]) : null), a = A(!1);
36
- N(() => {
37
- a.value = q({
37
+ } : { type: "document" }), l = n(() => e.collectionType === "operation" ? !e.path || !V(e.method) ? null : q(e.document?.paths?.[e.path]?.[e.method]) : null), a = O(!1);
38
+ b(() => {
39
+ a.value = E({
38
40
  authStore: e.workspaceStore.auth,
39
41
  documentName: e.documentSlug,
40
- ...r.value
42
+ ...c.value
41
43
  });
42
44
  });
43
- const S = o(() => e.collectionType === "operation" ? e.workspaceStore.auth.getAuthSelectedSchemas({
44
- type: "operation",
45
- documentName: e.documentSlug,
46
- path: e.path ?? "",
47
- method: e.method ?? "get"
48
- }) : e.workspaceStore.auth.getAuthSelectedSchemas({
49
- type: "document",
50
- documentName: e.documentSlug
51
- })), g = o(() => e.collectionType === "operation" ? i.value?.security ?? [] : e.document?.security ?? []), p = o(
52
- () => E(
45
+ const m = n(() => {
46
+ if (e.collectionType === "operation") {
47
+ const t = e.workspaceStore.auth.getAuthSelectedSchemas({
48
+ type: "operation",
49
+ documentName: e.documentSlug,
50
+ path: e.path ?? "",
51
+ method: e.method ?? "get"
52
+ });
53
+ return g(
54
+ void 0,
55
+ t,
56
+ l.value?.security ?? []
57
+ );
58
+ }
59
+ const o = e.workspaceStore.auth.getAuthSelectedSchemas({
60
+ type: "document",
61
+ documentName: e.documentSlug
62
+ });
63
+ return g(o, void 0, e.document?.security ?? []);
64
+ }), p = n(() => e.collectionType === "operation" ? l.value?.security ?? [] : e.document?.security ?? []), k = n(
65
+ () => P(
53
66
  e.workspaceStore.workspace["x-scalar-active-proxy"],
54
67
  e.layout
55
68
  ) ?? ""
56
- ), m = o(() => M(i.value?.servers ?? e.document?.servers, {
69
+ ), d = n(() => D(l.value?.servers ?? e.document?.servers, {
57
70
  documentUrl: e.document?.["x-scalar-original-source-url"]
58
- })), k = o(() => {
59
- const l = e.document?.["x-scalar-selected-server"], T = i.value?.["x-scalar-selected-server"] ?? l;
60
- return m.value.find(({ url: w }) => w === T) ?? m.value[0] ?? null;
61
- }), x = (l) => {
62
- if (r.value.type === "operation")
63
- return a.value = l, l ? e.eventBus.emit("auth:update:selected-security-schemes", {
64
- selectedRequirements: [],
65
- newSchemes: [],
66
- meta: r.value
67
- }) : e.eventBus.emit("auth:clear:selected-security-schemes", {
68
- meta: r.value
71
+ })), x = n(() => {
72
+ const o = e.document?.["x-scalar-selected-server"], w = l.value?.["x-scalar-selected-server"] ?? o;
73
+ return d.value.find(({ url: B }) => B === w) ?? d.value[0] ?? null;
74
+ }), T = (o) => {
75
+ if (c.value.type === "operation") {
76
+ if (a.value = o, o) {
77
+ const { selectedSchemes: t } = m.value;
78
+ return e.eventBus.emit("auth:update:selected-security-schemes", {
79
+ selectedRequirements: C(t, { depth: 1 }),
80
+ newSchemes: [],
81
+ meta: c.value
82
+ });
83
+ }
84
+ return e.eventBus.emit("auth:clear:selected-security-schemes", {
85
+ meta: c.value
69
86
  });
87
+ }
70
88
  };
71
- return (l, t) => (s(), O(C, null, U({
72
- title: c(() => [
73
- t[0] || (t[0] = u("Authentication", -1))
89
+ return (o, t) => (s(), N(M, null, U({
90
+ title: u(() => [
91
+ t[0] || (t[0] = i("Authentication", -1))
74
92
  ]),
75
- description: c(() => [
76
- e.collectionType === "operation" ? (s(), y(f, { key: 0 }, [
77
- t[1] || (t[1] = n("span", { class: "block" }, " Override authentication for this operation with the toggle. ", -1)),
78
- t[2] || (t[2] = n("span", { class: "mt-1 block" }, [
79
- n("strong", null, "On"),
80
- u(" — Authentication below applies only to this operation. ")
93
+ description: u(() => [
94
+ e.collectionType === "operation" ? (s(), f(S, { key: 0 }, [
95
+ t[1] || (t[1] = r("span", { class: "block" }, " Override authentication for this operation with the toggle. ", -1)),
96
+ t[2] || (t[2] = r("span", { class: "mt-1 block" }, [
97
+ r("strong", null, "On"),
98
+ i(" — Authentication below applies only to this operation. ")
81
99
  ], -1)),
82
- t[3] || (t[3] = n("span", { class: "mt-1 block" }, [
83
- n("strong", null, "Off"),
84
- u(" — This operation uses document-level authentication from the OpenAPI spec. ")
100
+ t[3] || (t[3] = r("span", { class: "mt-1 block" }, [
101
+ r("strong", null, "Off"),
102
+ i(" — This operation uses document-level authentication from the OpenAPI spec. ")
85
103
  ], -1))
86
- ], 64)) : (s(), y(f, { key: 1 }, [
87
- u(" Configure authentication for this document. Selected authentication applies to all operations unless overridden at the operation level. ")
104
+ ], 64)) : (s(), f(S, { key: 1 }, [
105
+ i(" Configure authentication for this document. Selected authentication applies to all operations unless overridden at the operation level. ")
88
106
  ], 64))
89
107
  ]),
90
- default: c(() => [
91
- n("div", {
92
- class: d(
108
+ default: u(() => [
109
+ r("div", {
110
+ class: v(
93
111
  e.collectionType === "operation" && !a.value && "cursor-not-allowed"
94
112
  )
95
113
  }, [
96
- v(h(D), {
97
- class: d([
114
+ h(y($), {
115
+ class: v([
98
116
  "scalar-collection-auth border-none!",
99
117
  e.collectionType === "operation" && !a.value && "pointer-events-none opacity-50 mix-blend-luminosity"
100
118
  ]),
@@ -102,12 +120,12 @@ const P = { class: "flex h-8 items-center" }, K = /* @__PURE__ */ B({
102
120
  environment: e.environment,
103
121
  eventBus: e.eventBus,
104
122
  isStatic: "",
105
- meta: r.value,
106
- proxyUrl: p.value,
107
- securityRequirements: g.value,
123
+ meta: c.value,
124
+ proxyUrl: k.value,
125
+ securityRequirements: p.value,
108
126
  securitySchemes: e.securitySchemes,
109
- selectedSecurity: S.value,
110
- server: k.value,
127
+ selectedSecurity: m.value,
128
+ server: x.value,
111
129
  title: "Authentication"
112
130
  }, null, 8, ["class", "environment", "eventBus", "meta", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])
113
131
  ], 2)
@@ -116,12 +134,12 @@ const P = { class: "flex h-8 items-center" }, K = /* @__PURE__ */ B({
116
134
  }, [
117
135
  e.collectionType === "operation" ? {
118
136
  name: "actions",
119
- fn: c(() => [
120
- n("div", P, [
121
- v(h(b), {
137
+ fn: u(() => [
138
+ r("div", j, [
139
+ h(y(R), {
122
140
  class: "w-4",
123
141
  modelValue: a.value,
124
- "onUpdate:modelValue": x
142
+ "onUpdate:modelValue": T
125
143
  }, null, 8, ["modelValue"])
126
144
  ])
127
145
  ]),
@@ -131,5 +149,5 @@ const P = { class: "flex h-8 items-center" }, K = /* @__PURE__ */ B({
131
149
  }
132
150
  });
133
151
  export {
134
- K as default
152
+ Y as default
135
153
  };
@@ -1 +1 @@
1
- {"version":3,"file":"LabelInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/LabelInput.vue"],"names":[],"mappings":"AAuDA,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAiBF,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA2ExD,QAAA,MAAM,YAAY;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"LabelInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/LabelInput.vue"],"names":[],"mappings":"AAuDA,KAAK,WAAW,GAAG;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AAiBF,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA0ExD,QAAA,MAAM,YAAY;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./LabelInput.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-242ff9a6"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2f09f15e"]]);
5
5
  export {
6
- r as default
6
+ a as default
7
7
  };
@@ -20,7 +20,7 @@ const _ = { class: "group pointer-events-none flex flex-1 items-center gap-1" },
20
20
  h(u("input", {
21
21
  id: s(n),
22
22
  "onUpdate:modelValue": e[0] || (e[0] = (t) => l.value = t),
23
- class: "text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full flex-1 rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
23
+ class: "text-c-1 group-hover-input pointer-events-auto relative -ml-0.5 h-8 w-full flex-1 rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
24
24
  placeholder: o.placeholder ?? "Untitled Document",
25
25
  onBlur: a,
26
26
  onKeydown: e[1] || (e[1] = x((t) => t.target?.blur(), ["enter"]))
@@ -1,5 +1,6 @@
1
1
  import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
2
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
+ import type { TraversedExample } from '@scalar/workspace-store/schemas/navigation';
3
4
  /**
4
5
  * Command Palette Example Component
5
6
  *
@@ -25,6 +26,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
25
26
  documentName?: string;
26
27
  /** Preselected path and method to create the example for */
27
28
  operationId?: string;
29
+ /** Existing example for edit mode */
30
+ example?: TraversedExample;
28
31
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
32
  close: () => any;
30
33
  back: (keyboardEvent: KeyboardEvent) => any;
@@ -37,6 +40,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
37
40
  documentName?: string;
38
41
  /** Preselected path and method to create the example for */
39
42
  operationId?: string;
43
+ /** Existing example for edit mode */
44
+ example?: TraversedExample;
40
45
  }> & Readonly<{
41
46
  onClose?: (() => any) | undefined;
42
47
  onBack?: ((keyboardEvent: KeyboardEvent) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAoSA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAavE;;;;;;;;;;;;;GAaG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEhB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;;IAPpB,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;;;;kFAyclB,CAAC"}
1
+ {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/command-palette/components/CommandPaletteExample.vue"],"names":[],"mappings":"AAgWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,4CAA4C,CAAA;AASnD;;;;;;;;;;;;;GAaG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IAEd,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;IACpB,qCAAqC;cAC3B,gBAAgB;;;;;IAT1B,iEAAiE;oBACjD,cAAc;IAC9B,uDAAuD;cAC7C,iBAAiB;IAC3B,4CAA4C;mBAC7B,MAAM;IACrB,4DAA4D;kBAC9C,MAAM;IACpB,qCAAqC;cAC3B,gBAAgB;;;;kFA0hB1B,CAAC"}