@scalar/api-client 2.19.3 → 2.20.1

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 (62) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +0 -9
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +126 -67
  6. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +6 -0
  7. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  9. package/dist/v2/blocks/operation-block/components/Header.vue2.js +25 -24
  10. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.d.ts.map +1 -1
  12. package/dist/v2/blocks/operation-block/helpers/build-request-cookie-header.js +1 -1
  13. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  14. package/dist/v2/blocks/operation-block/helpers/build-request.js +44 -41
  15. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts +42 -0
  16. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts.map +1 -0
  17. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +31 -0
  18. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts +66 -0
  19. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.d.ts.map +1 -0
  20. package/dist/v2/blocks/operation-block/helpers/har-to-fetch-response.js +43 -0
  21. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +1 -0
  22. package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-block/helpers/send-request.js +40 -38
  24. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  26. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +34 -33
  27. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +3 -1
  28. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  29. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +28 -28
  30. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
  31. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +31 -22
  32. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  33. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +6 -0
  34. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  36. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +24 -23
  37. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts +2 -3
  38. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +2 -2
  40. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue2.js +20 -20
  41. package/dist/v2/components/data-table/DataTableCheckbox.vue.js +2 -2
  42. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -0
  43. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  44. package/dist/v2/components/sidebar/Sidebar.vue.js +60 -54
  45. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  46. package/dist/v2/features/app/app-events.js +53 -42
  47. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  48. package/dist/v2/features/app/app-state.js +72 -72
  49. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  50. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  51. package/dist/v2/features/app/components/AppSidebar.vue2.js +84 -76
  52. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  53. package/dist/v2/features/collection/DocumentCollection.vue.js +82 -43
  54. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  55. package/dist/v2/features/operation/Operation.vue.js +2 -3
  56. package/dist/v2/features/operation/helpers/combine-params.d.ts +2 -2
  57. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +1 -1
  58. package/dist/v2/features/operation/helpers/combine-params.js +11 -10
  59. package/dist/v2/workspace-events.d.ts.map +1 -1
  60. package/dist/v2/workspace-events.js +12 -6
  61. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  62. package/package.json +11 -11
@@ -1,13 +1,13 @@
1
- import { defineComponent as y, mergeModels as f, useSlots as g, ref as B, useModel as x, createBlock as n, openBlock as r, unref as i, withCtx as s, createVNode as W, createSlots as $, renderSlot as l, normalizeProps as b, guardReactiveProps as p, createElementVNode as k, createCommentVNode as u, createElementBlock as D } from "vue";
2
- import { ScalarIconButton as M } from "@scalar/components";
3
- import { ScalarIconMagnifyingGlass as C } from "@scalar/icons";
4
- import { ScalarSidebar as E } from "@scalar/sidebar";
5
- import I from "./SidebarMenu.vue.js";
6
- import h from "../resize/Resize.vue.js";
7
- import V from "../../features/search/components/SearchButton.vue.js";
8
- const z = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, N = { class: "flex items-center justify-between" }, R = { key: 1 }, H = /* @__PURE__ */ y({
1
+ import { defineComponent as B, mergeModels as v, useSlots as $, ref as x, useModel as W, createBlock as n, openBlock as r, unref as i, withCtx as a, createVNode as D, createSlots as I, renderSlot as l, createElementBlock as y, createCommentVNode as d, Fragment as M, normalizeProps as m, guardReactiveProps as f, createElementVNode as S } from "vue";
2
+ import { ScalarIconButton as h } from "@scalar/components";
3
+ import { ScalarIconFileDashed as C, ScalarIconMagnifyingGlass as E } from "@scalar/icons";
4
+ import { ScalarSidebar as V } from "@scalar/sidebar";
5
+ import z from "./SidebarMenu.vue.js";
6
+ import F from "../resize/Resize.vue.js";
7
+ import N from "../../features/search/components/SearchButton.vue.js";
8
+ const R = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, A = { class: "flex items-center justify-between" }, j = { key: 1 }, O = /* @__PURE__ */ B({
9
9
  __name: "Sidebar",
10
- props: /* @__PURE__ */ f({
10
+ props: /* @__PURE__ */ v({
11
11
  sidebarState: {},
12
12
  layout: {},
13
13
  activeWorkspace: {},
@@ -22,71 +22,77 @@ const z = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, N =
22
22
  },
23
23
  sidebarWidthModifiers: {}
24
24
  }),
25
- emits: /* @__PURE__ */ f(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
26
- setup(e, { emit: v }) {
27
- const d = v, w = g(), c = B(!1), m = x(e, "sidebarWidth");
28
- return (a, o) => (r(), n(i(h), {
29
- width: m.value,
30
- "onUpdate:width": o[5] || (o[5] = (t) => m.value = t),
25
+ emits: /* @__PURE__ */ v(["selectItem", "select:workspace", "create:workspace", "reorder"], ["update:sidebarWidth"]),
26
+ setup(t, { emit: w }) {
27
+ const c = w, b = $(), u = x(!1), k = W(t, "sidebarWidth"), p = (s) => s.type === "example" && s.title === "draft";
28
+ return (s, o) => (r(), n(i(F), {
29
+ width: k.value,
30
+ "onUpdate:width": o[5] || (o[5] = (e) => k.value = e),
31
31
  class: "flex flex-col"
32
32
  }, {
33
- default: s(() => [
34
- W(i(E), {
33
+ default: a(() => [
34
+ D(i(V), {
35
35
  class: "flex w-auto flex-1 pt-2",
36
36
  indent: 15,
37
- isDraggable: e.layout !== "modal",
38
- isDroppable: e.isDroppable,
39
- isExpanded: e.sidebarState.isExpanded,
40
- isSelected: e.sidebarState.isSelected,
41
- items: e.sidebarState.items.value,
37
+ isDraggable: t.layout !== "modal",
38
+ isDroppable: t.isDroppable,
39
+ isExpanded: t.sidebarState.isExpanded,
40
+ isSelected: t.sidebarState.isSelected,
41
+ items: t.sidebarState.items.value,
42
42
  layout: "client",
43
- onReorder: o[3] || (o[3] = (t, S) => d("reorder", t, S)),
44
- onSelectItem: o[4] || (o[4] = (t) => d("selectItem", t))
45
- }, $({
46
- header: s(() => [
47
- k("div", z, [
48
- k("div", N, [
49
- e.layout === "desktop" ? (r(), n(I, {
43
+ onReorder: o[3] || (o[3] = (e, g) => c("reorder", e, g)),
44
+ onSelectItem: o[4] || (o[4] = (e) => c("selectItem", e))
45
+ }, I({
46
+ header: a(() => [
47
+ S("div", R, [
48
+ S("div", A, [
49
+ t.layout === "desktop" ? (r(), n(z, {
50
50
  key: 0,
51
- activeWorkspace: e.activeWorkspace,
52
- workspaces: e.workspaces,
53
- "onCreate:workspace": o[0] || (o[0] = (t) => d("create:workspace")),
54
- "onSelect:workspace": o[1] || (o[1] = (t) => d("select:workspace", t))
51
+ activeWorkspace: t.activeWorkspace,
52
+ workspaces: t.workspaces,
53
+ "onCreate:workspace": o[0] || (o[0] = (e) => c("create:workspace")),
54
+ "onSelect:workspace": o[1] || (o[1] = (e) => c("select:workspace", e))
55
55
  }, {
56
- sidebarMenuActions: s(() => [
57
- l(a.$slots, "sidebarMenuActions")
56
+ sidebarMenuActions: a(() => [
57
+ l(s.$slots, "sidebarMenuActions")
58
58
  ]),
59
59
  _: 3
60
- }, 8, ["activeWorkspace", "workspaces"])) : e.layout === "modal" ? (r(), D("div", R)) : u("", !0),
61
- e.layout !== "web" ? (r(), n(i(M), {
60
+ }, 8, ["activeWorkspace", "workspaces"])) : t.layout === "modal" ? (r(), y("div", j)) : d("", !0),
61
+ t.layout !== "web" ? (r(), n(i(h), {
62
62
  key: 2,
63
- icon: i(C),
63
+ icon: i(E),
64
64
  label: "Search",
65
- onClick: o[2] || (o[2] = (t) => c.value = !c.value)
66
- }, null, 8, ["icon"])) : u("", !0)
65
+ onClick: o[2] || (o[2] = (e) => u.value = !u.value)
66
+ }, null, 8, ["icon"])) : d("", !0)
67
67
  ]),
68
- c.value || e.layout === "web" ? (r(), n(i(V), {
68
+ u.value || t.layout === "web" ? (r(), n(i(N), {
69
69
  key: 0,
70
- documents: e.documents,
71
- eventBus: e.eventBus
72
- }, null, 8, ["documents", "eventBus"])) : u("", !0)
70
+ documents: t.documents,
71
+ eventBus: t.eventBus
72
+ }, null, 8, ["documents", "eventBus"])) : d("", !0)
73
73
  ])
74
74
  ]),
75
- decorator: s((t) => [
76
- l(a.$slots, "decorator", b(p(t)))
75
+ decorator: a((e) => [
76
+ l(s.$slots, "decorator", m(f(e)))
77
77
  ]),
78
- before: s(() => [
79
- l(a.$slots, "workspaceButton")
78
+ icon: a((e) => [
79
+ b.icon || p(e.item) ? (r(), y(M, { key: 0 }, [
80
+ p(e.item) ? (r(), n(i(C), { key: 0 })) : d("", !0),
81
+ l(s.$slots, "icon", m(f(e)))
82
+ ], 64)) : d("", !0)
80
83
  ]),
81
- footer: s(() => [
82
- l(a.$slots, "footer")
84
+ before: a(() => [
85
+ l(s.$slots, "workspaceButton")
86
+ ]),
87
+ footer: a(() => [
88
+ l(s.$slots, "footer")
83
89
  ]),
84
90
  _: 2
85
91
  }, [
86
- w.empty ? {
92
+ b.empty ? {
87
93
  name: "empty",
88
- fn: s((t) => [
89
- l(a.$slots, "empty", b(p(t)))
94
+ fn: a((e) => [
95
+ l(s.$slots, "empty", m(f(e)))
90
96
  ]),
91
97
  key: "0"
92
98
  } : void 0
@@ -97,5 +103,5 @@ const z = { class: "bg-sidebar-b-1 z-1 flex flex-col gap-1.5 px-3 pb-1.5" }, N =
97
103
  }
98
104
  });
99
105
  export {
100
- H as default
106
+ O as default
101
107
  };
@@ -1 +1 @@
1
- {"version":3,"file":"app-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,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;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAIxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAA;AAErF,wBAAgB,0BAA0B,CAAC,EACzC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ,eAAe,GAChB,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,UAAU,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACxC,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACjC,cAAc,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACzC,sBAAsB,EAAE,CAAC,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAA;IACzD,oBAAoB,EAAE,WAAW,CAAA;IACjC,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B,QA2NA"}
@@ -1,33 +1,33 @@
1
1
  import { computed as E } from "vue";
2
2
  import { initializeWorkspaceEventHandlers as h } from "../../workspace-events.js";
3
3
  function g({
4
- eventBus: n,
5
- store: l,
6
- router: m,
4
+ eventBus: o,
5
+ store: r,
6
+ router: c,
7
7
  rebuildSidebar: p,
8
- navigateToCurrentTab: a,
8
+ navigateToCurrentTab: n,
9
9
  onSelectSidebarItem: i,
10
10
  onAfterExampleCreation: s,
11
- onOpenCommandPalette: r,
11
+ onOpenCommandPalette: l,
12
12
  onCopyTabUrl: f,
13
13
  onToggleSidebar: x
14
14
  }) {
15
- const u = E(() => m.value?.currentRoute?.value), d = ({
15
+ const u = E(() => c.value?.currentRoute?.value), d = ({
16
16
  documentName: e,
17
- path: t,
18
- method: o,
19
- exampleName: c
20
- }) => !(e !== void 0 && e !== u.value?.params.documentSlug || t !== void 0 && encodeURIComponent(t) !== u.value?.params.pathEncoded || o !== void 0 && o !== u.value?.params.method || c !== void 0 && c !== u.value?.params.exampleName);
17
+ path: a,
18
+ method: t,
19
+ exampleName: m
20
+ }) => !(e !== void 0 && e !== u.value?.params.documentSlug || a !== void 0 && encodeURIComponent(a) !== u.value?.params.pathEncoded || t !== void 0 && t !== u.value?.params.method || m !== void 0 && m !== u.value?.params.exampleName);
21
21
  h({
22
- eventBus: n,
23
- store: l,
22
+ eventBus: o,
23
+ store: r,
24
24
  hooks: {
25
25
  //------------------------------------------------------------------------------------
26
26
  // Document Related Hooks
27
27
  //------------------------------------------------------------------------------------
28
28
  "document:delete:document": {
29
29
  onAfterExecute: async (e) => {
30
- u?.value?.params.documentSlug === e.name && await m.value?.push({
30
+ u?.value?.params.documentSlug === e.name && await c.value?.push({
31
31
  name: "workspace.environment"
32
32
  });
33
33
  }
@@ -38,15 +38,15 @@ function g({
38
38
  "operation:update:pathMethod": {
39
39
  onBeforeExecute: (e) => ({
40
40
  ...e,
41
- callback: async (t) => {
42
- t === "success" && (await m.value?.replace({
41
+ callback: async (a) => {
42
+ a === "success" && (await c.value?.replace({
43
43
  name: "example",
44
44
  params: {
45
45
  method: e.payload.method,
46
46
  pathEncoded: encodeURIComponent(e.payload.path),
47
47
  exampleName: u.value?.params.exampleName
48
48
  }
49
- }), p(l.value?.workspace.activeDocument?.["x-scalar-navigation"]?.name)), e.callback(t);
49
+ }), p(r.value?.workspace.activeDocument?.["x-scalar-navigation"]?.name)), e.callback(a);
50
50
  }
51
51
  })
52
52
  },
@@ -56,21 +56,24 @@ function g({
56
56
  "operation:update:extra-parameters": {
57
57
  onAfterExecute: (e) => s(e.meta)
58
58
  },
59
+ "operation:reload:history": {
60
+ onAfterExecute: (e) => s({ ...e.meta, exampleKey: "draft" })
61
+ },
59
62
  "operation:delete:operation": {
60
63
  onAfterExecute: async (e) => {
61
64
  p(e.documentName);
62
65
  const {
63
- documentName: t,
64
- meta: { path: o, method: c }
66
+ documentName: a,
67
+ meta: { path: t, method: m }
65
68
  } = e;
66
69
  d({
67
- documentName: t,
68
- path: o,
69
- method: c
70
- }) && await m.value?.replace({
70
+ documentName: a,
71
+ path: t,
72
+ method: m
73
+ }) && await c.value?.replace({
71
74
  name: "document.overview",
72
75
  params: {
73
- documentSlug: t
76
+ documentSlug: a
74
77
  }
75
78
  });
76
79
  }
@@ -79,20 +82,20 @@ function g({
79
82
  onAfterExecute: async (e) => {
80
83
  p(e.documentName);
81
84
  const {
82
- documentName: t,
83
- meta: { path: o, method: c, exampleKey: v }
85
+ documentName: a,
86
+ meta: { path: t, method: m, exampleKey: v }
84
87
  } = e;
85
88
  d({
86
- documentName: t,
87
- path: o,
88
- method: c,
89
+ documentName: a,
90
+ path: t,
91
+ method: m,
89
92
  exampleName: v
90
- }) && await m.value?.replace({
93
+ }) && await c.value?.replace({
91
94
  name: "example",
92
95
  params: {
93
- pathEncoded: encodeURIComponent(o),
94
- method: c,
95
- documentSlug: t,
96
+ pathEncoded: encodeURIComponent(t),
97
+ method: m,
98
+ documentSlug: a,
96
99
  exampleName: "default"
97
100
  }
98
101
  });
@@ -120,33 +123,41 @@ function g({
120
123
  // Tabs Related Event Hooks
121
124
  //------------------------------------------------------------------------------------
122
125
  "tabs:add:tab": {
123
- onAfterExecute: a
126
+ onAfterExecute: n
124
127
  },
125
128
  "tabs:close:tab": {
126
- onAfterExecute: a
129
+ onAfterExecute: n
127
130
  },
128
131
  "tabs:focus:tab": {
129
- onAfterExecute: a
132
+ onAfterExecute: n
130
133
  },
131
134
  "tabs:focus:tab-last": {
132
- onAfterExecute: a
135
+ onAfterExecute: n
133
136
  },
134
137
  "tabs:navigate:previous": {
135
- onAfterExecute: a
138
+ onAfterExecute: n
136
139
  },
137
140
  "tabs:navigate:next": {
138
- onAfterExecute: a
141
+ onAfterExecute: n
139
142
  },
140
143
  "tabs:update:tabs": {
141
- onAfterExecute: a
144
+ onAfterExecute: n
142
145
  }
143
146
  }
144
- }), n.on("scroll-to:nav-item", ({ id: e }) => i(e)), n.on("ui:toggle:sidebar", x), n.on(
147
+ }), o.on("scroll-to:nav-item", ({ id: e }) => i(e)), o.on("ui:toggle:sidebar", x), o.on(
145
148
  "ui:open:command-palette",
146
149
  (e) => {
147
- e ? r(e.action, e.payload) : r();
150
+ e ? l(e.action, e.payload) : l();
148
151
  }
149
- ), n.on("ui:route:page", ({ name: e }) => m.value?.push({ name: e })), n.on("tabs:copy:url", (e) => f(e.index));
152
+ ), o.on("ui:route:page", ({ name: e }) => c.value?.push({ name: e })), o.on("ui:route:example", async ({ exampleName: e, callback: a }) => {
153
+ const t = await c.value?.replace({
154
+ name: "example",
155
+ params: {
156
+ exampleName: e
157
+ }
158
+ });
159
+ a(t ? "error" : "success");
160
+ }), o.on("tabs:copy:url", (e) => f(e.index));
150
161
  }
151
162
  export {
152
163
  g as initializeAppEventHandlers
@@ -1 +1 @@
1
- {"version":3,"file":"app-state.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/app-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oEAAoE,CAAA;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4C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EAAE,MAAM,GAAG,QAAQ,CA0CrD"}
@@ -1,49 +1,49 @@
1
1
  import { isDefined as C } from "@scalar/helpers/array/is-defined";
2
- import { sortByOrder as $ } from "@scalar/helpers/array/sort-by-order";
3
- import { isHttpMethod as H } from "@scalar/helpers/http/is-http-method";
4
- import { createSidebarState as V, generateReverseIndex as Y } from "@scalar/sidebar";
2
+ import { sortByOrder as H } from "@scalar/helpers/array/sort-by-order";
3
+ import { isHttpMethod as V } from "@scalar/helpers/http/is-http-method";
4
+ import { createSidebarState as Y, generateReverseIndex as j } from "@scalar/sidebar";
5
5
  import { createWorkspaceStore as D } from "@scalar/workspace-store/client";
6
- import { createWorkspaceEventBus as j } from "@scalar/workspace-store/events";
7
- import { generateUniqueValue as q } from "@scalar/workspace-store/helpers/generate-unique-value";
6
+ import { createWorkspaceEventBus as q } from "@scalar/workspace-store/events";
7
+ import { generateUniqueValue as z } from "@scalar/workspace-store/helpers/generate-unique-value";
8
8
  import { getParentEntry as p } from "@scalar/workspace-store/navigation";
9
- import { createWorkspaceStorePersistence as z } from "@scalar/workspace-store/persistence";
10
- import { persistencePlugin as J } from "@scalar/workspace-store/plugins/client";
11
- import { extensions as M } from "@scalar/workspace-store/schemas/extensions";
12
- import { shallowRef as g, computed as i, ref as u, watch as G } from "vue";
13
- import { getActiveEnvironment as Q } from "../../helpers/get-active-environment.js";
14
- import { getTabDetails as X } from "../../helpers/get-tab-details.js";
15
- import { slugify as Z } from "../../helpers/slugify.js";
16
- import { workspaceStorage as ee } from "../../helpers/storage.js";
17
- import { useCommandPaletteState as te } from "../command-palette/hooks/use-command-palette-state.js";
18
- import { initializeAppEventHandlers as ae } from "./app-events.js";
19
- const ne = 1e3, m = j({
9
+ import { createWorkspaceStorePersistence as J } from "@scalar/workspace-store/persistence";
10
+ import { persistencePlugin as M } from "@scalar/workspace-store/plugins/client";
11
+ import { extensions as G } from "@scalar/workspace-store/schemas/extensions";
12
+ import { shallowRef as g, computed as i, ref as u, watch as Q } from "vue";
13
+ import { getActiveEnvironment as X } from "../../helpers/get-active-environment.js";
14
+ import { getTabDetails as Z } from "../../helpers/get-tab-details.js";
15
+ import { slugify as ee } from "../../helpers/slugify.js";
16
+ import { workspaceStorage as te } from "../../helpers/storage.js";
17
+ import { useCommandPaletteState as ae } from "../command-palette/hooks/use-command-palette-state.js";
18
+ import { initializeAppEventHandlers as ne } from "./app-events.js";
19
+ const re = 1e3, v = q({
20
20
  debug: !1
21
- }), x = u(void 0), v = u(void 0), R = u(void 0), A = u(void 0), U = u(void 0), d = u(!1), c = g(null);
22
- G(c, (e) => {
23
- e && e.afterEach((t) => we(t));
21
+ }), x = u(void 0), f = u(void 0), R = u(void 0), A = u(void 0), U = u(void 0), m = u(!1), c = g(null);
22
+ Q(c, (e) => {
23
+ e && e.afterEach((t) => xe(t));
24
24
  });
25
- const f = i(() => c.value?.currentRoute.value ?? null);
25
+ const d = i(() => c.value?.currentRoute.value ?? null);
26
26
  function s(e, t) {
27
27
  const a = t?.params[e];
28
28
  if (typeof a == "string")
29
- return e === "method" ? a && H(a) ? a : void 0 : decodeURIComponent(a);
29
+ return e === "method" ? a && V(a) ? a : void 0 : decodeURIComponent(a);
30
30
  }
31
- const S = g(null), y = u([]), n = g(null), E = i(() => n.value?.workspace.documents[v.value ?? ""] || null), re = i(() => Q(n.value, E.value)), { workspace: h } = await z();
31
+ const S = g(null), y = u([]), n = g(null), E = i(() => n.value?.workspace.documents[f.value ?? ""] || null), oe = i(() => X(n.value, E.value)), { workspace: h } = await J();
32
32
  y.value = await h.getAll().then((e) => e.map(({ id: t, name: a }) => ({ id: t, label: a })));
33
- const oe = async ({ workspaceId: e }) => D({
34
- plugins: [await J({ workspaceId: e, debounceDelay: ne })]
35
- }), se = async (e) => {
33
+ const se = async ({ workspaceId: e }) => D({
34
+ plugins: [await M({ workspaceId: e, debounceDelay: re })]
35
+ }), ce = async (e) => {
36
36
  const t = await h.getItem(e);
37
37
  if (!t)
38
38
  return {
39
39
  success: !1
40
40
  };
41
- const a = await oe({ workspaceId: e });
41
+ const a = await se({ workspaceId: e });
42
42
  return a.loadWorkspace(t.workspace), S.value = { id: e, label: t.name }, n.value = a, {
43
43
  success: !0,
44
44
  workspace: a.workspace
45
45
  };
46
- }, ce = async ({ id: e, name: t }) => {
46
+ }, ie = async ({ id: e, name: t }) => {
47
47
  const a = D();
48
48
  await a.addDocument({
49
49
  name: "drafts",
@@ -75,35 +75,35 @@ const oe = async ({ workspaceId: e }) => D({
75
75
  name: t
76
76
  }) => {
77
77
  n.value = null;
78
- const a = await q({
78
+ const a = await z({
79
79
  defaultValue: e ?? t,
80
80
  // Use the provided id if it exists, otherwise use the name
81
81
  validation: async (l) => !await h.has(l),
82
82
  maxRetries: 100,
83
- transformation: Z
83
+ transformation: ee
84
84
  });
85
85
  if (!a)
86
86
  return;
87
87
  const o = { id: a, name: t };
88
- return await ce(o), await B(a), o;
89
- }, ie = async (e) => {
90
- n.value = null, d.value = !0;
91
- const t = await se(e);
88
+ return await ie(o), await B(a), o;
89
+ }, le = async (e) => {
90
+ n.value = null, m.value = !0;
91
+ const t = await ce(e);
92
92
  if (t.success) {
93
93
  const o = t.workspace["x-scalar-active-tab"] ?? 0, l = t.workspace["x-scalar-tabs"], W = l?.[o];
94
- W && await c.value?.replace(W.path), l && o >= l.length && m.emit("tabs:update:tabs", {
94
+ W && await c.value?.replace(W.path), l && o >= l.length && v.emit("tabs:update:tabs", {
95
95
  "x-scalar-active-tab": 0
96
- }), l || m.emit("tabs:update:tabs", {
97
- "x-scalar-tabs": [I(f.value)],
96
+ }), l || v.emit("tabs:update:tabs", {
97
+ "x-scalar-tabs": [I(d.value)],
98
98
  "x-scalar-active-tab": 0
99
- }), d.value = !1;
99
+ }), m.value = !1;
100
100
  return;
101
101
  }
102
102
  const a = await P({
103
103
  name: "Default Workspace",
104
104
  id: "default"
105
105
  });
106
- if (d.value = !1, !a)
106
+ if (m.value = !1, !a)
107
107
  return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
108
108
  r.reset();
109
109
  }, O = i(() => {
@@ -111,14 +111,14 @@ const oe = async ({ workspaceId: e }) => D({
111
111
  if (!e)
112
112
  return [];
113
113
  const t = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
114
- return $(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(C);
115
- }), r = V(O), b = ({
114
+ return H(Object.keys(e.workspace.documents), t, (a) => a).map((a) => e.workspace.documents[a]?.["x-scalar-navigation"]).filter(C);
115
+ }), r = Y(O), b = ({
116
116
  document: e,
117
117
  path: t,
118
118
  method: a,
119
119
  example: o
120
120
  }) => JSON.stringify([e, t, a, o].filter(C)), T = i(
121
- () => Y({
121
+ () => j({
122
122
  items: O.value,
123
123
  nestedKey: "children",
124
124
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
@@ -189,14 +189,14 @@ const oe = async ({ workspaceId: e }) => D({
189
189
  }
190
190
  });
191
191
  r.setExpanded(e, !r.isExpanded(e));
192
- }, le = async () => {
192
+ }, ue = async () => {
193
193
  if (!n.value)
194
194
  return;
195
195
  const e = n.value.workspace["x-scalar-active-tab"] ?? 0, t = n.value.workspace["x-scalar-tabs"]?.[e];
196
196
  t && await c.value?.replace(t.path);
197
197
  }, N = (e) => {
198
198
  e && n.value?.buildSidebar(e);
199
- }, ue = (e) => {
199
+ }, pe = (e) => {
200
200
  const t = E.value?.["x-scalar-navigation"]?.name;
201
201
  if (!t)
202
202
  return;
@@ -206,20 +206,20 @@ const oe = async ({ workspaceId: e }) => D({
206
206
  method: e.method,
207
207
  example: e.exampleKey
208
208
  });
209
- (!a || a.type !== "example") && N(t);
210
- }, pe = 288, de = i(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? pe), me = (e) => n.value?.update("x-scalar-sidebar-width", e), k = u(!0), ve = "x-scalar-tabs", fe = "x-scalar-active-tab", I = (e) => {
209
+ (!a || a.type !== "example") && (N(t), d.value && K(d.value));
210
+ }, de = 288, me = i(() => n.value?.workspace?.["x-scalar-sidebar-width"] ?? de), ve = (e) => n.value?.update("x-scalar-sidebar-width", e), k = u(!0), fe = "x-scalar-tabs", he = "x-scalar-active-tab", I = (e) => {
211
211
  const t = s("method", e), a = s("pathEncoded", e), o = s("documentSlug", e), l = s("workspaceSlug", e);
212
212
  return {
213
- ...X({
213
+ ...Z({
214
214
  workspace: l,
215
215
  document: o,
216
216
  path: a,
217
217
  method: t,
218
218
  getEntryByLocation: w
219
219
  }),
220
- path: f.value?.path ?? ""
220
+ path: d.value?.path ?? ""
221
221
  };
222
- }, _ = i(() => n.value?.workspace[ve] ?? [I(f.value)]), he = i(() => n.value?.workspace[fe] ?? 0), F = async (e) => {
222
+ }, _ = i(() => n.value?.workspace[fe] ?? [I(d.value)]), we = i(() => n.value?.workspace[he] ?? 0), F = async (e) => {
223
223
  const t = _.value[e];
224
224
  if (!t) {
225
225
  console.warn(`Cannot copy URL: tab at index ${e} does not exist`);
@@ -231,19 +231,19 @@ const oe = async ({ workspaceId: e }) => D({
231
231
  } catch (o) {
232
232
  console.error("Failed to copy URL to clipboard:", o);
233
233
  }
234
- }, we = (e) => {
234
+ }, xe = (e) => {
235
235
  const t = s("workspaceSlug", e), a = s("documentSlug", e);
236
- if (x.value = t, v.value = a, R.value = s("method", e), A.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
237
- if (e.path !== "" && ee.setCurrentPath(e.path), t !== S.value?.id)
238
- return ie(t);
239
- if (a && a !== n.value?.workspace[M.workspace.activeDocument])
236
+ if (x.value = t, f.value = a, R.value = s("method", e), A.value = s("pathEncoded", e), U.value = s("exampleName", e), !!t) {
237
+ if (e.path !== "" && te.setCurrentPath(e.path), t !== S.value?.id)
238
+ return le(t);
239
+ if (a && a !== n.value?.workspace[G.workspace.activeDocument])
240
240
  return n?.value?.update("x-scalar-active-document", a);
241
- xe(e), be(e);
241
+ be(e), K(e);
242
242
  }
243
- }, xe = (e) => {
243
+ }, be = (e) => {
244
244
  const t = n.value?.workspace["x-scalar-tabs"] ?? [], a = n.value?.workspace["x-scalar-active-tab"] ?? 0, o = t[a];
245
245
  !o || o.path === e.path || (t[a] = I(e));
246
- }, be = (e) => {
246
+ }, K = (e) => {
247
247
  const t = s("documentSlug", e);
248
248
  if (!t) {
249
249
  r.setSelected(null);
@@ -256,15 +256,15 @@ const oe = async ({ workspaceId: e }) => D({
256
256
  example: s("exampleName", e)
257
257
  });
258
258
  a && (r.setSelected(a.id), r.setExpanded(a.id, !0));
259
- }, K = te();
260
- ae({
261
- eventBus: m,
259
+ }, $ = ae();
260
+ ne({
261
+ eventBus: v,
262
262
  router: c,
263
263
  store: n,
264
- navigateToCurrentTab: le,
264
+ navigateToCurrentTab: ue,
265
265
  rebuildSidebar: N,
266
- onAfterExampleCreation: ue,
267
- onOpenCommandPalette: K.open,
266
+ onAfterExampleCreation: pe,
267
+ onOpenCommandPalette: $.open,
268
268
  onSelectSidebarItem: L,
269
269
  onCopyTabUrl: (e) => F(e),
270
270
  onToggleSidebar: () => k.value = !k.value
@@ -275,15 +275,15 @@ function _e(e) {
275
275
  store: n,
276
276
  sidebar: {
277
277
  state: r,
278
- width: de,
278
+ width: me,
279
279
  isOpen: k,
280
280
  handleSelectItem: L,
281
- handleSidebarWidthUpdate: me,
281
+ handleSidebarWidthUpdate: ve,
282
282
  getEntryByLocation: w
283
283
  },
284
284
  tabs: {
285
285
  state: _,
286
- activeTabIndex: he,
286
+ activeTabIndex: we,
287
287
  copyTabUrl: F
288
288
  },
289
289
  workspace: {
@@ -291,21 +291,21 @@ function _e(e) {
291
291
  workspaceList: y,
292
292
  activeWorkspace: S,
293
293
  setId: B,
294
- isOpen: i(() => !!(x.value && !v.value))
294
+ isOpen: i(() => !!(x.value && !f.value))
295
295
  },
296
- commandPalette: K,
297
- eventBus: m,
296
+ commandPalette: $,
297
+ eventBus: v,
298
298
  router: c,
299
- currentRoute: f,
300
- loading: d,
299
+ currentRoute: d,
300
+ loading: m,
301
301
  activeEntities: {
302
302
  workspaceSlug: x,
303
- documentSlug: v,
303
+ documentSlug: f,
304
304
  path: A,
305
305
  method: R,
306
306
  exampleName: U
307
307
  },
308
- environment: re,
308
+ environment: oe,
309
309
  document: E
310
310
  };
311
311
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/components/AppSidebar.vue"],"names":[],"mappings":"AAwcA,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAA;AAM3B,OAAO,KAAK,EAA6B,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,KAAK,WAAW,GAAG;IACf;;OAEG;IACH,MAAM,EAAE,YAAY,CAAA;IAEpB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAE1C;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,eAAe,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C;;;OAGG;IACH,UAAU,EAAE,mBAAmB,EAAE,CAAA;IACjC;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;;OAGG;IACH,KAAK,EAAE,cAAc,CAAA;CACtB,CAAC;AAgBJ,KAAK,WAAW,GAAG;IACjB,oEAAoE;IACpE,kBAAkB,CAAC,IAAI,OAAO,CAAA;CAC/B,CAAC;AAmLF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,6CAA6C;IAC7C,eAAe,EAAE,OAAO,CAAC;IACzB,wCA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