@scalar/api-client 2.27.1 → 2.29.2

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 (87) hide show
  1. package/CHANGELOG.md +166 -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/libs/local-storage.js +3 -3
  5. package/dist/style.css +1 -1
  6. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  7. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +21 -21
  8. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  10. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +67 -75
  11. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -0
  12. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  13. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -0
  14. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts +1 -1
  16. package/dist/v2/blocks/request-block/helpers/get-default-headers.d.ts.map +1 -1
  17. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +20 -19
  18. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +2 -0
  19. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  20. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +42 -40
  21. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +5 -5
  23. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +3 -1
  24. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  25. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +35 -35
  26. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  27. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  28. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  29. package/dist/v2/components/sidebar/Sidebar.vue.js +1 -1
  30. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  31. package/dist/v2/features/app/App.vue.js +70 -70
  32. package/dist/v2/features/app/app-events.d.ts +2 -1
  33. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  34. package/dist/v2/features/app/app-events.js +89 -64
  35. package/dist/v2/features/app/app-state.d.ts +4 -2
  36. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  37. package/dist/v2/features/app/app-state.js +185 -156
  38. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  39. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  40. package/dist/v2/features/app/components/AppSidebar.vue2.js +48 -47
  41. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  42. package/dist/v2/features/app/components/DesktopTabs.vue.js +4 -4
  43. package/dist/v2/features/app/components/DownloadAppButton.vue.d.ts.map +1 -1
  44. package/dist/v2/features/app/components/DownloadAppButton.vue.js +1 -1
  45. package/dist/v2/features/app/components/DownloadAppButton.vue2.js +9 -9
  46. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  47. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +71 -43
  48. package/dist/v2/features/app/helpers/routes.js +11 -11
  49. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts +1 -6
  50. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  51. package/dist/v2/features/collection/WorkspaceCollection.vue.js +38 -20
  52. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  53. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  54. package/dist/v2/features/collection/components/Authentication.vue2.js +20 -16
  55. package/dist/v2/features/collection/components/LabelInput.vue.d.ts +3 -0
  56. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  57. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  58. package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -16
  59. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  60. package/dist/v2/features/collection/components/Settings.vue.js +18 -14
  61. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +7 -2
  62. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  63. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +70 -71
  64. package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.d.ts → CommandPaletteOpenApiDocument.vue.d.ts} +3 -3
  65. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue.d.ts.map +1 -0
  66. package/dist/v2/features/command-palette/components/{CommandPaletteDocument.vue.js → CommandPaletteOpenApiDocument.vue.js} +15 -15
  67. package/dist/v2/features/command-palette/components/CommandPaletteOpenApiDocument.vue2.js +4 -0
  68. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +2 -2
  69. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -1
  70. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +10 -10
  71. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +27 -5
  72. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -1
  73. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +80 -53
  74. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +34 -9
  75. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  76. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +50 -44
  77. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  78. package/dist/v2/features/operation/Operation.vue.js +19 -15
  79. package/dist/v2/helpers/get-active-proxy-url.d.ts +18 -0
  80. package/dist/v2/helpers/get-active-proxy-url.d.ts.map +1 -0
  81. package/dist/v2/helpers/get-active-proxy-url.js +5 -0
  82. package/dist/v2/workspace-events.d.ts.map +1 -1
  83. package/dist/v2/workspace-events.js +123 -113
  84. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  85. package/package.json +18 -18
  86. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +0 -1
  87. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +0 -4
@@ -1,43 +1,43 @@
1
- import { useModal as k } from "@scalar/components";
2
- import { ScalarIconArrowSquareIn as y, ScalarIconPackage as _, ScalarIconFolder as P, ScalarIconArrowUpRight as A, ScalarIconPuzzlePiece as R, ScalarIconBracketsCurly as b, ScalarIconCookie as q, ScalarIconSlidersHorizontal as L } from "@scalar/icons";
1
+ import { useModal as y } from "@scalar/components";
2
+ import { ScalarIconArrowSquareIn as P, ScalarIconPackage as _, ScalarIconFolder as A, ScalarIconArrowUpRight as R, ScalarIconPuzzlePiece as b, ScalarIconBracketsCurly as q, ScalarIconCookie as L, ScalarIconSlidersHorizontal as $ } from "@scalar/icons";
3
3
  import d from "fuse.js";
4
- import { ref as p, shallowRef as $, computed as o, toValue as a } from "vue";
5
- import x from "../components/CommandPaletteDocument.vue.js";
4
+ import { ref as p, shallowRef as x, computed as o, toValue as a } from "vue";
6
5
  import z from "../components/CommandPaletteExample.vue.js";
7
- import F from "../components/CommandPaletteImport.vue.js";
8
- import U from "../components/CommandPaletteImportCurl.vue.js";
9
- import E from "../components/CommandPaletteRequest.vue.js";
10
- import O from "../components/CommandPaletteTag.vue.js";
11
- const W = (m = B, l = Q) => {
12
- const c = k(), n = p(""), s = $(null), i = p(null), f = o(() => c.open), v = o(
6
+ import E from "../components/CommandPaletteImport.vue.js";
7
+ import F from "../components/CommandPaletteImportCurl.vue.js";
8
+ import O from "../components/CommandPaletteOpenApiDocument.vue.js";
9
+ import U from "../components/CommandPaletteRequest.vue.js";
10
+ import f from "../components/CommandPaletteTag.vue.js";
11
+ const W = (m = T, l = Q) => {
12
+ const c = y(), n = p(""), i = x(null), s = p(null), v = o(() => c.open), C = o(
13
13
  () => new d(a(m), {
14
14
  keys: ["name"],
15
- threshold: 0.1
15
+ threshold: 0.2
16
16
  })
17
- ), C = o(
17
+ ), g = o(
18
18
  () => new d(a(l), {
19
19
  keys: ["name"],
20
- threshold: 0.1
20
+ threshold: 0.2
21
21
  })
22
22
  ), S = o(() => {
23
23
  const e = n.value.toLowerCase().trim();
24
- return (e ? v.value.search(e).map((t) => t.item) : a(m)).filter((t) => !t.hidden);
25
- }), w = o(() => {
24
+ return (e ? C.value.search(e).map((t) => t.item) : a(m)).filter((t) => !t.hidden);
25
+ }), h = o(() => {
26
26
  const e = n.value.toLowerCase().trim();
27
- return e ? C.value.search(e).map((r) => r.item) : a(l);
28
- }), g = (e, ...r) => {
29
- e && (s.value = a(m).find((t) => t.id === e) ?? null, i.value = r[0] ?? null), c.show();
30
- }, h = () => {
27
+ return e ? g.value.search(e).map((r) => r.item) : a(l);
28
+ }), w = (e, ...r) => {
29
+ e && (i.value = a(m).find((t) => t.id === e) ?? null, s.value = r[0] ?? null), c.show();
30
+ }, I = () => {
31
31
  c.hide(), u();
32
- }, I = (e) => {
32
+ }, k = (e) => {
33
33
  n.value = e;
34
34
  }, u = () => {
35
- n.value = "", s.value = null, i.value = null;
35
+ n.value = "", i.value = null, s.value = null;
36
36
  };
37
37
  return {
38
- isOpen: f,
39
- activeCommand: s,
40
- activeCommandProps: i,
38
+ isOpen: v,
39
+ activeCommand: i,
40
+ activeCommandProps: s,
41
41
  filterQuery: n,
42
42
  filteredCommands: o(() => [
43
43
  {
@@ -46,12 +46,12 @@ const W = (m = B, l = Q) => {
46
46
  },
47
47
  {
48
48
  label: "Pages",
49
- commands: w.value
49
+ commands: h.value
50
50
  }
51
51
  ]),
52
- open: g,
53
- close: h,
54
- setFilterQuery: I,
52
+ open: w,
53
+ close: I,
54
+ setFilterQuery: k,
55
55
  reset: u
56
56
  };
57
57
  }, Q = [
@@ -59,7 +59,7 @@ const W = (m = B, l = Q) => {
59
59
  type: "route",
60
60
  id: "environment",
61
61
  name: "Environment",
62
- icon: b,
62
+ icon: q,
63
63
  to: {
64
64
  name: "workspace.environment"
65
65
  }
@@ -68,7 +68,7 @@ const W = (m = B, l = Q) => {
68
68
  type: "route",
69
69
  id: "cookies",
70
70
  name: "Cookies",
71
- icon: q,
71
+ icon: L,
72
72
  to: {
73
73
  name: "workspace.cookies"
74
74
  }
@@ -77,51 +77,57 @@ const W = (m = B, l = Q) => {
77
77
  type: "route",
78
78
  id: "settings",
79
79
  name: "Settings",
80
- icon: L,
80
+ icon: $,
81
81
  to: {
82
82
  name: "workspace.settings"
83
83
  }
84
84
  }
85
- ], B = [
85
+ ], T = [
86
86
  {
87
87
  id: "import-from-openapi-swagger-postman-curl",
88
88
  name: "Import from OpenAPI/Swagger/Postman/cURL",
89
- component: F,
90
- icon: y
89
+ component: E,
90
+ icon: P
91
91
  },
92
92
  {
93
- id: "create-document",
94
- name: "Create Document",
95
- component: x,
93
+ id: "create-openapi-document",
94
+ name: "Create OpenAPI Document",
95
+ component: O,
96
96
  icon: _
97
97
  },
98
98
  {
99
99
  id: "add-tag",
100
100
  name: "Add Tag",
101
- component: O,
102
- icon: P
101
+ component: f,
102
+ icon: A
103
103
  },
104
104
  {
105
105
  id: "create-request",
106
106
  name: "Create Request",
107
- component: E,
108
- icon: A
107
+ component: U,
108
+ icon: R
109
109
  },
110
110
  {
111
111
  id: "add-example",
112
112
  name: "Add Example",
113
113
  component: z,
114
- icon: R
114
+ icon: b
115
115
  },
116
116
  {
117
117
  id: "import-curl-command",
118
118
  name: "Import cURL Command",
119
119
  hidden: !0,
120
- component: U
120
+ component: F
121
+ },
122
+ {
123
+ id: "edit-tag",
124
+ name: "Edit Tag",
125
+ hidden: !0,
126
+ component: f
121
127
  }
122
128
  ];
123
129
  export {
124
- B as baseClientActions,
130
+ T as baseClientActions,
125
131
  Q as baseRoutes,
126
132
  W as useCommandPaletteState
127
133
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAqNA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM/D;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;iGAqR/B,CAAC"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA2NA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAO/D;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;iGAgS/B,CAAC"}
@@ -1,14 +1,15 @@
1
- import { defineComponent as f, computed as n, toValue as o, createBlock as k, createElementBlock as g, openBlock as i, unref as l, createElementVNode as x } from "vue";
1
+ import { defineComponent as f, computed as n, toValue as o, createBlock as k, createElementBlock as g, openBlock as l, unref as u, createElementVNode as x } from "vue";
2
2
  import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { mapHiddenClientsConfig as w } from "../modal/helpers/map-hidden-clients-config.js";
4
4
  import { combineParams as C } from "./helpers/combine-params.js";
5
5
  import { getSelectedServer as B } from "./helpers/get-selected-server.js";
6
- import { getServers as U } from "../../helpers/get-servers.js";
7
- import b from "../../blocks/operation-block/OperationBlock.vue.js";
8
- const N = {
6
+ import { getActiveProxyUrl as U } from "../../helpers/get-active-proxy-url.js";
7
+ import { getServers as b } from "../../helpers/get-servers.js";
8
+ import N from "../../blocks/operation-block/OperationBlock.vue.js";
9
+ const A = {
9
10
  key: 1,
10
11
  class: "flex h-full w-full items-center justify-center"
11
- }, E = {}, I = /* @__PURE__ */ f({
12
+ }, E = {}, $ = /* @__PURE__ */ f({
12
13
  ...E,
13
14
  __name: "Operation",
14
15
  props: {
@@ -50,14 +51,14 @@ const N = {
50
51
  ...t,
51
52
  location: "document"
52
53
  }))
53
- ]), u = n(() => {
54
+ ]), i = n(() => {
54
55
  const t = o(e.options)?.servers ?? c.value?.servers ?? r.value?.servers ?? e.document?.servers;
55
- return U(t, {
56
+ return b(t, {
56
57
  baseServerUrl: o(e.options)?.baseServerURL,
57
58
  documentUrl: e.document?.["x-scalar-original-source-url"]
58
59
  });
59
60
  }), d = n(
60
- () => B(e.document, u.value)
61
+ () => B(e.document, i.value)
61
62
  ), v = n(() => e.document?.["x-scalar-set-operation-security"] ? {
62
63
  type: "operation",
63
64
  path: e.path ?? "",
@@ -73,11 +74,11 @@ const N = {
73
74
  )
74
75
  )), S = n(
75
76
  () => w(o(e.options)?.hiddenClients)
76
- ), y = "2.27.1";
77
- return (t, a) => e.path && e.method && e.exampleName && c.value ? (i(), k(l(b), {
77
+ ), y = "2.29.2";
78
+ return (t, a) => e.path && e.method && e.exampleName && c.value ? (l(), k(u(N), {
78
79
  key: 0,
79
80
  activeEnvironment: e.workspaceStore.workspace["x-scalar-active-environment"],
80
- appVersion: l(y),
81
+ appVersion: u(y),
81
82
  authMeta: v.value,
82
83
  documentSecurity: e.document?.security ?? [],
83
84
  documentSelectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
@@ -104,18 +105,21 @@ const N = {
104
105
  }),
105
106
  path: e.path,
106
107
  plugins: e.plugins,
107
- proxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
108
+ proxyUrl: u(U)(
109
+ e.workspaceStore.workspace["x-scalar-active-proxy"],
110
+ e.layout
111
+ ) ?? "",
108
112
  securitySchemes: e.securitySchemes,
109
113
  selectedClient: e.workspaceStore.workspace["x-scalar-default-client"],
110
114
  server: d.value,
111
- servers: u.value,
115
+ servers: i.value,
112
116
  setOperationSecurity: e.document?.["x-scalar-set-operation-security"] ?? !1,
113
117
  "onUpdate:servers": a[0] || (a[0] = (O) => e.eventBus.emit("ui:navigate", { page: "document", path: "servers" }))
114
- }, null, 8, ["activeEnvironment", "appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "environments", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "history", "httpClients", "layout", "method", "operation", "operationSelectedSecurity", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (i(), g("div", N, [...a[1] || (a[1] = [
118
+ }, null, 8, ["activeEnvironment", "appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "environments", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "history", "httpClients", "layout", "method", "operation", "operationSelectedSecurity", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (l(), g("div", A, [...a[1] || (a[1] = [
115
119
  x("span", { class: "text-c-3" }, "Select an operation to view details", -1)
116
120
  ])]));
117
121
  }
118
122
  });
119
123
  export {
120
- I as default
124
+ $ as default
121
125
  };
@@ -0,0 +1,18 @@
1
+ import type { Workspace } from '@scalar/workspace-store/schemas';
2
+ import type { ClientLayout } from '../../v2/types/layout';
3
+ /**
4
+ * Returns the default proxy URL for web layout.
5
+ * For the 'web' layout, this ensures requests use Scalar's hosted proxy unless overridden,
6
+ * which is important for browser environments with CORS or network restrictions.
7
+ * For 'desktop' or 'modal' layouts, returns null to indicate no proxy by default.
8
+ */
9
+ export declare const getDefaultProxyUrl: (layout: ClientLayout) => "https://proxy.scalar.com" | null;
10
+ /**
11
+ * Returns the active proxy URL for the workspace.
12
+ *
13
+ * Logic:
14
+ * - If the active proxy url is not set, use the default proxy url.
15
+ * - Otherwise, use the active proxy url.
16
+ */
17
+ export declare const getActiveProxyUrl: (activeProxyUrl: Workspace["x-scalar-active-proxy"], layout: ClientLayout) => string | null;
18
+ //# sourceMappingURL=get-active-proxy-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-active-proxy-url.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/get-active-proxy-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY,sCAKtD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,gBAAgB,SAAS,CAAC,uBAAuB,CAAC,EAAE,QAAQ,YAAY,kBAMzG,CAAA"}
@@ -0,0 +1,5 @@
1
+ const e = (r) => r === "web" ? "https://proxy.scalar.com" : null, n = (r, t) => r === void 0 ? e(t) : r;
2
+ export {
3
+ n as getActiveProxyUrl,
4
+ e as getDefaultProxyUrl
5
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,QAiRA"}
1
+ {"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;CACb,QA2RA"}
@@ -1,227 +1,237 @@
1
1
  import { generateClientMutators as i } from "@scalar/workspace-store/mutators";
2
2
  import { computed as p } from "vue";
3
- const r = (t, c, a) => async (o) => {
4
- const n = await a[t]?.onBeforeExecute?.(o) ?? o;
5
- return await c(n), await a[t]?.onAfterExecute?.(n), n;
3
+ const r = (a, c, t) => async (o) => {
4
+ const n = await t[a]?.onBeforeExecute?.(o) ?? o;
5
+ return await c(n), await t[a]?.onAfterExecute?.(n), n;
6
6
  };
7
7
  function l({
8
- eventBus: t,
8
+ eventBus: a,
9
9
  store: c,
10
- hooks: a
10
+ hooks: t
11
11
  }) {
12
12
  const o = p(() => i(c.value)), n = ({ collectionType: e }) => e === "document" ? o.value.active() : o.value.workspace();
13
- t.on(
13
+ a.on(
14
14
  "workspace:update:active-proxy",
15
- (e) => r("workspace:update:active-proxy", o.value.workspace().workspace.updateActiveProxy, a)(e)
16
- ), t.on(
15
+ (e) => r("workspace:update:active-proxy", o.value.workspace().workspace.updateActiveProxy, t)(e)
16
+ ), a.on(
17
17
  "workspace:update:color-mode",
18
- (e) => r("workspace:update:color-mode", o.value.workspace().workspace.updateColorMode, a)(e)
19
- ), t.on(
18
+ (e) => r("workspace:update:color-mode", o.value.workspace().workspace.updateColorMode, t)(e)
19
+ ), a.on(
20
20
  "workspace:update:theme",
21
- (e) => r("workspace:update:theme", o.value.workspace().workspace.updateTheme, a)(e)
22
- ), t.on(
21
+ (e) => r("workspace:update:theme", o.value.workspace().workspace.updateTheme, t)(e)
22
+ ), a.on(
23
23
  "workspace:update:selected-client",
24
24
  (e) => r(
25
25
  "workspace:update:selected-client",
26
26
  o.value.workspace().workspace.updateSelectedClient,
27
- a
27
+ t
28
28
  )(e)
29
- ), t.on(
29
+ ), a.on(
30
30
  "workspace:update:active-environment",
31
31
  (e) => r(
32
32
  "workspace:update:active-environment",
33
33
  o.value.workspace().workspace.updateActiveEnvironment,
34
- a
34
+ t
35
35
  )(e)
36
- ), t.on(
36
+ ), a.on(
37
37
  "document:update:icon",
38
- (e) => r("document:update:icon", o.value.active().document.updateDocumentIcon, a)(e)
39
- ), t.on(
38
+ (e) => r("document:update:icon", o.value.active().document.updateDocumentIcon, t)(e)
39
+ ), a.on(
40
40
  "document:update:info",
41
- (e) => r("document:update:info", o.value.active().document.updateDocumentInfo, a)(e)
42
- ), t.on(
41
+ (e) => r("document:update:info", o.value.active().document.updateDocumentInfo, t)(e)
42
+ ), a.on(
43
43
  "document:toggle:security",
44
- (e) => r("document:toggle:security", o.value.active().document.toggleSecurity, a)(e)
45
- ), t.on(
44
+ (e) => r("document:toggle:security", o.value.active().document.toggleSecurity, t)(e)
45
+ ), a.on(
46
46
  "document:update:watch-mode",
47
- (e) => r("document:update:watch-mode", o.value.active().document.updateWatchMode, a)(e)
48
- ), t.on(
47
+ (e) => r("document:update:watch-mode", o.value.active().document.updateWatchMode, t)(e)
48
+ ), a.on(
49
49
  "document:create:empty-document",
50
- (e) => r("document:create:empty-document", o.value.active().document.createEmptyDocument, a)(e)
51
- ), t.on(
50
+ (e) => r("document:create:empty-document", o.value.active().document.createEmptyDocument, t)(e)
51
+ ), a.on(
52
52
  "document:delete:document",
53
- (e) => r("document:delete:document", o.value.active().document.deleteDocument, a)(e)
54
- ), t.on(
53
+ (e) => r("document:delete:document", o.value.active().document.deleteDocument, t)(e)
54
+ ), a.on(
55
55
  "environment:upsert:environment",
56
- (e) => r("environment:upsert:environment", n(e).environment.upsertEnvironment, a)(e)
57
- ), t.on(
56
+ (e) => r("environment:upsert:environment", n(e).environment.upsertEnvironment, t)(e)
57
+ ), a.on(
58
58
  "environment:delete:environment",
59
- (e) => r("environment:delete:environment", n(e).environment.deleteEnvironment, a)(e)
60
- ), t.on(
59
+ (e) => r("environment:delete:environment", n(e).environment.deleteEnvironment, t)(e)
60
+ ), a.on(
61
61
  "environment:upsert:environment-variable",
62
62
  (e) => r(
63
63
  "environment:upsert:environment-variable",
64
64
  n(e).environment.upsertEnvironmentVariable,
65
- a
65
+ t
66
66
  )(e)
67
- ), t.on(
67
+ ), a.on(
68
68
  "environment:delete:environment-variable",
69
69
  (e) => r(
70
70
  "environment:delete:environment-variable",
71
71
  n(e).environment.deleteEnvironmentVariable,
72
- a
72
+ t
73
73
  )(e)
74
- ), t.on("cookie:upsert:cookie", async (e) => {
75
- await r("cookie:upsert:cookie", n(e).cookie.upsertCookie, a)(e);
76
- }), t.on("cookie:delete:cookie", async (e) => {
77
- await r("cookie:delete:cookie", n(e).cookie.deleteCookie, a)(e);
78
- }), t.on(
74
+ ), a.on("cookie:upsert:cookie", async (e) => {
75
+ await r("cookie:upsert:cookie", n(e).cookie.upsertCookie, t)(e);
76
+ }), a.on("cookie:delete:cookie", async (e) => {
77
+ await r("cookie:delete:cookie", n(e).cookie.deleteCookie, t)(e);
78
+ }), a.on(
79
79
  "auth:delete:security-scheme",
80
- (e) => r("auth:delete:security-scheme", o.value.active().auth.deleteSecurityScheme, a)(e)
81
- ), t.on(
80
+ (e) => r("auth:delete:security-scheme", o.value.active().auth.deleteSecurityScheme, t)(e)
81
+ ), a.on(
82
82
  "auth:update:active-index",
83
- (e) => r("auth:update:active-index", o.value.active().auth.updateSelectedAuthTab, a)(e)
84
- ), t.on(
83
+ (e) => r("auth:update:active-index", o.value.active().auth.updateSelectedAuthTab, t)(e)
84
+ ), a.on(
85
85
  "auth:update:security-scheme",
86
- (e) => r("auth:update:security-scheme", o.value.active().auth.updateSecurityScheme, a)(e)
87
- ), t.on(
86
+ (e) => r("auth:update:security-scheme", o.value.active().auth.updateSecurityScheme, t)(e)
87
+ ), a.on(
88
88
  "auth:update:selected-scopes",
89
- (e) => r("auth:update:selected-scopes", o.value.active().auth.updateSelectedScopes, a)(e)
90
- ), t.on(
89
+ (e) => r("auth:update:selected-scopes", o.value.active().auth.updateSelectedScopes, t)(e)
90
+ ), a.on(
91
91
  "auth:update:selected-security-schemes",
92
92
  (e) => r(
93
93
  "auth:update:selected-security-schemes",
94
94
  o.value.active().auth.updateSelectedSecuritySchemes,
95
- a
95
+ t
96
96
  )(e)
97
- ), t.on(
97
+ ), a.on(
98
98
  "auth:update:security-scheme-secrets",
99
99
  (e) => r(
100
100
  "auth:update:security-scheme-secrets",
101
101
  o.value.active().auth.updateSecuritySchemeSecrets,
102
- a
102
+ t
103
103
  )(e)
104
- ), t.on(
104
+ ), a.on(
105
105
  "auth:clear:security-scheme-secrets",
106
106
  (e) => r(
107
107
  "auth:clear:security-scheme-secrets",
108
108
  o.value.active().auth.clearSecuritySchemeSecrets,
109
- a
109
+ t
110
110
  )(e)
111
- ), t.on(
111
+ ), a.on(
112
112
  "server:add:server",
113
- (e) => r("server:add:server", o.value.active().server.addServer, a)(e)
114
- ), t.on(
113
+ (e) => r("server:add:server", o.value.active().server.addServer, t)(e)
114
+ ), a.on(
115
115
  "server:update:server",
116
- (e) => r("server:update:server", o.value.active().server.updateServer, a)(e)
117
- ), t.on(
116
+ (e) => r("server:update:server", o.value.active().server.updateServer, t)(e)
117
+ ), a.on(
118
118
  "server:delete:server",
119
- (e) => r("server:delete:server", o.value.active().server.deleteServer, a)(e)
120
- ), t.on(
119
+ (e) => r("server:delete:server", o.value.active().server.deleteServer, t)(e)
120
+ ), a.on(
121
121
  "server:update:variables",
122
- (e) => r("server:update:variables", o.value.active().server.updateServerVariables, a)(e)
123
- ), t.on(
122
+ (e) => r("server:update:variables", o.value.active().server.updateServerVariables, t)(e)
123
+ ), a.on(
124
124
  "server:update:selected",
125
- (e) => r("server:update:selected", o.value.active().server.updateSelectedServer, a)(e)
126
- ), t.on(
125
+ (e) => r("server:update:selected", o.value.active().server.updateSelectedServer, t)(e)
126
+ ), a.on(
127
127
  "operation:create:operation",
128
- (e) => r("operation:create:operation", o.value.active().operation.createOperation, a)(e)
129
- ), t.on(
128
+ (e) => r("operation:create:operation", o.value.active().operation.createOperation, t)(e)
129
+ ), a.on(
130
130
  "operation:update:pathMethod",
131
131
  (e) => r(
132
132
  "operation:update:pathMethod",
133
133
  o.value.active().operation.updateOperationPathMethod,
134
- a
134
+ t
135
135
  )(e)
136
- ), t.on(
136
+ ), a.on(
137
137
  "operation:update:summary",
138
- (e) => r("operation:update:summary", o.value.active().operation.updateOperationSummary, a)(e)
139
- ), t.on(
138
+ (e) => r("operation:update:summary", o.value.active().operation.updateOperationSummary, t)(e)
139
+ ), a.on(
140
140
  "operation:delete:operation",
141
- (e) => r("operation:delete:operation", o.value.active().operation.deleteOperation, a)(e)
142
- ), t.on(
141
+ (e) => r("operation:delete:operation", o.value.active().operation.deleteOperation, t)(e)
142
+ ), a.on(
143
+ "operation:create:draft-example",
144
+ (e) => r(
145
+ "operation:create:draft-example",
146
+ o.value.active().operation.createOperationDraftExample,
147
+ t
148
+ )(e)
149
+ ), a.on(
143
150
  "operation:delete:example",
144
- (e) => r("operation:delete:example", o.value.active().operation.deleteOperationExample, a)(e)
145
- ), t.on(
151
+ (e) => r("operation:delete:example", o.value.active().operation.deleteOperationExample, t)(e)
152
+ ), a.on(
146
153
  "operation:upsert:parameter",
147
- (e) => r("operation:upsert:parameter", o.value.active().operation.upsertOperationParameter, a)(e)
148
- ), t.on(
154
+ (e) => r("operation:upsert:parameter", o.value.active().operation.upsertOperationParameter, t)(e)
155
+ ), a.on(
149
156
  "operation:update:extra-parameters",
150
157
  (e) => r(
151
158
  "operation:update:extra-parameters",
152
159
  o.value.active().operation.updateOperationExtraParameters,
153
- a
160
+ t
154
161
  )(e)
155
- ), t.on(
162
+ ), a.on(
156
163
  "operation:delete:parameter",
157
- (e) => r("operation:delete:parameter", o.value.active().operation.deleteOperationParameter, a)(e)
158
- ), t.on(
164
+ (e) => r("operation:delete:parameter", o.value.active().operation.deleteOperationParameter, t)(e)
165
+ ), a.on(
159
166
  "operation:delete-all:parameters",
160
167
  (e) => r(
161
168
  "operation:delete-all:parameters",
162
169
  o.value.active().operation.deleteAllOperationParameters,
163
- a
170
+ t
164
171
  )(e)
165
- ), t.on(
172
+ ), a.on(
166
173
  "operation:update:extension",
167
- (e) => r("operation:update:extension", o.value.active().operation.updateOperationExtension, a)(e)
168
- ), t.on(
174
+ (e) => r("operation:update:extension", o.value.active().operation.updateOperationExtension, t)(e)
175
+ ), a.on(
169
176
  "operation:update:requestBody:contentType",
170
177
  (e) => r(
171
178
  "operation:update:requestBody:contentType",
172
179
  o.value.active().operation.updateOperationRequestBodyContentType,
173
- a
180
+ t
174
181
  )(e)
175
- ), t.on(
182
+ ), a.on(
176
183
  "operation:update:requestBody:value",
177
184
  (e) => r(
178
185
  "operation:update:requestBody:value",
179
186
  o.value.active().operation.updateOperationRequestBodyExample,
180
- a
187
+ t
181
188
  )(e)
182
- ), t.on(
189
+ ), a.on(
183
190
  "operation:update:requestBody:formValue",
184
191
  (e) => r(
185
192
  "operation:update:requestBody:formValue",
186
193
  o.value.active().operation.updateOperationRequestBodyFormValue,
187
- a
194
+ t
188
195
  )(e)
189
- ), t.on(
196
+ ), a.on(
190
197
  "operation:reload:history",
191
- (e) => r("operation:reload:history", o.value.active().operation.reloadOperationHistory, a)(e)
192
- ), t.on(
198
+ (e) => r("operation:reload:history", o.value.active().operation.reloadOperationHistory, t)(e)
199
+ ), a.on(
193
200
  "tag:create:tag",
194
- (e) => r("tag:create:tag", o.value.active().tag.createTag, a)(e)
195
- ), t.on(
201
+ (e) => r("tag:create:tag", o.value.active().tag.createTag, t)(e)
202
+ ), a.on(
203
+ "tag:edit:tag",
204
+ (e) => r("tag:edit:tag", o.value.active().tag.editTag, t)(e)
205
+ ), a.on(
196
206
  "tag:delete:tag",
197
- (e) => r("tag:delete:tag", o.value.active().tag.deleteTag, a)(e)
198
- ), t.on(
207
+ (e) => r("tag:delete:tag", o.value.active().tag.deleteTag, t)(e)
208
+ ), a.on(
199
209
  "tabs:add:tab",
200
- (e) => r("tabs:add:tab", o.value.workspace().tabs.addTab, a)(e)
201
- ), t.on(
210
+ (e) => r("tabs:add:tab", o.value.workspace().tabs.addTab, t)(e)
211
+ ), a.on(
202
212
  "tabs:close:tab",
203
- (e) => r("tabs:close:tab", o.value.workspace().tabs.closeTab, a)(e)
204
- ), t.on(
213
+ (e) => r("tabs:close:tab", o.value.workspace().tabs.closeTab, t)(e)
214
+ ), a.on(
205
215
  "tabs:close:other-tabs",
206
- (e) => r("tabs:close:other-tabs", o.value.workspace().tabs.closeOtherTabs, a)(e)
207
- ), t.on(
216
+ (e) => r("tabs:close:other-tabs", o.value.workspace().tabs.closeOtherTabs, t)(e)
217
+ ), a.on(
208
218
  "tabs:focus:tab",
209
- (e) => r("tabs:focus:tab", o.value.workspace().tabs.focusTab, a)(e)
210
- ), t.on(
219
+ (e) => r("tabs:focus:tab", o.value.workspace().tabs.focusTab, t)(e)
220
+ ), a.on(
211
221
  "tabs:focus:tab-last",
212
- (e) => r("tabs:focus:tab-last", o.value.workspace().tabs.focusLastTab, a)(e)
213
- ), t.on(
222
+ (e) => r("tabs:focus:tab-last", o.value.workspace().tabs.focusLastTab, t)(e)
223
+ ), a.on(
214
224
  "tabs:navigate:previous",
215
- (e) => r("tabs:navigate:previous", o.value.workspace().tabs.navigatePreviousTab, a)(e)
216
- ), t.on(
225
+ (e) => r("tabs:navigate:previous", o.value.workspace().tabs.navigatePreviousTab, t)(e)
226
+ ), a.on(
217
227
  "tabs:navigate:next",
218
- (e) => r("tabs:navigate:next", o.value.workspace().tabs.navigateNextTab, a)(e)
219
- ), t.on(
228
+ (e) => r("tabs:navigate:next", o.value.workspace().tabs.navigateNextTab, t)(e)
229
+ ), a.on(
220
230
  "tabs:update:tabs",
221
- (e) => r("tabs:update:tabs", o.value.workspace().tabs.updateTabs, a)(e)
222
- ), t.on(
231
+ (e) => r("tabs:update:tabs", o.value.workspace().tabs.updateTabs, t)(e)
232
+ ), a.on(
223
233
  "hooks:on:request:complete",
224
- (e) => r("hooks:on:request:complete", o.value.active().operation.addResponseToHistory, a)(e)
234
+ (e) => r("hooks:on:request:complete", o.value.active().operation.addResponseToHistory, t)(e)
225
235
  );
226
236
  }
227
237
  export {