@scalar/api-client 2.29.4 → 2.31.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 (80) 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 +9 -69
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +74 -76
  6. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +15 -8
  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 +29 -28
  10. package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts +1 -1
  11. package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.d.ts.map +1 -1
  12. package/dist/v2/blocks/operation-code-sample/helpers/get-resolved-ref-deep.js +18 -21
  13. package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
  14. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +2 -2
  15. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +12 -0
  16. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +12 -0
  18. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  19. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  20. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +13 -8
  21. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  23. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +97 -85
  24. package/dist/v2/components/server/ServerDropdown.vue.d.ts +16 -5
  25. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  26. package/dist/v2/components/server/ServerDropdown.vue.js +27 -24
  27. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  28. package/dist/v2/features/app/app-events.js +29 -14
  29. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  30. package/dist/v2/features/app/app-state.js +57 -57
  31. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  32. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  33. package/dist/v2/features/app/components/AppSidebar.vue2.js +171 -148
  34. package/dist/v2/features/app/helpers/routes.d.ts +42 -12
  35. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  36. package/dist/v2/features/app/helpers/routes.js +57 -26
  37. package/dist/v2/features/collection/OperationCollection.vue.d.ts +6 -0
  38. package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -0
  39. package/dist/v2/features/collection/OperationCollection.vue.js +83 -0
  40. package/dist/v2/features/collection/OperationCollection.vue2.js +4 -0
  41. package/dist/v2/features/collection/components/Authentication.vue.d.ts +2 -2
  42. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  43. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  44. package/dist/v2/features/collection/components/Authentication.vue2.js +99 -49
  45. package/dist/v2/features/collection/components/Cookies.vue.d.ts +9 -4
  46. package/dist/v2/features/collection/components/Cookies.vue.d.ts.map +1 -1
  47. package/dist/v2/features/collection/components/Cookies.vue.js +12 -10
  48. package/dist/v2/features/collection/components/Environment.vue.d.ts +9 -4
  49. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  50. package/dist/v2/features/collection/components/Environment.vue.js +18 -16
  51. package/dist/v2/features/collection/components/LabelInput.vue.d.ts +6 -2
  52. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  53. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  54. package/dist/v2/features/collection/components/LabelInput.vue2.js +20 -18
  55. package/dist/v2/features/collection/components/Overview.vue.d.ts +2 -2
  56. package/dist/v2/features/collection/components/Overview.vue.d.ts.map +1 -1
  57. package/dist/v2/features/collection/components/Overview.vue.js +1 -1
  58. package/dist/v2/features/collection/components/Overview.vue2.js +177 -75
  59. package/dist/v2/features/collection/components/Servers.vue.d.ts +2 -2
  60. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  61. package/dist/v2/features/collection/components/Servers.vue.js +154 -98
  62. package/dist/v2/features/collection/components/Settings.vue.d.ts +2 -2
  63. package/dist/v2/features/collection/components/Tabs.vue.d.ts +2 -1
  64. package/dist/v2/features/collection/components/Tabs.vue.d.ts.map +1 -1
  65. package/dist/v2/features/collection/components/Tabs.vue.js +25 -27
  66. package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts +12 -0
  67. package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.d.ts.map +1 -0
  68. package/dist/v2/features/collection/helpers/get-default-operation-security-toggle.js +13 -0
  69. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  70. package/dist/v2/features/operation/Operation.vue.js +61 -63
  71. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +5 -3
  72. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
  73. package/dist/v2/features/operation/helpers/get-selected-security.js +7 -8
  74. package/dist/v2/features/operation/helpers/get-selected-server.d.ts +8 -6
  75. package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +1 -1
  76. package/dist/v2/features/operation/helpers/get-selected-server.js +2 -2
  77. package/dist/v2/workspace-events.d.ts.map +1 -1
  78. package/dist/v2/workspace-events.js +25 -15
  79. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  80. package/package.json +12 -12
@@ -1,15 +1,16 @@
1
- import { mergeSearchParams as i } from "@scalar/helpers/url/merge-urls";
2
- import s from "../../collection/components/Authentication.vue.js";
3
- import o from "../../collection/components/Cookies.vue.js";
4
- import n from "../../collection/components/Environment.vue.js";
5
- import h from "../../collection/components/Overview.vue.js";
6
- import d from "../../collection/components/Servers.vue.js";
7
- import m from "../../collection/components/Settings.vue.js";
1
+ import { mergeSearchParams as d } from "@scalar/helpers/url/merge-urls";
2
+ import o from "../../collection/components/Authentication.vue.js";
3
+ import n from "../../collection/components/Cookies.vue.js";
4
+ import a from "../../collection/components/Environment.vue.js";
5
+ import m from "../../collection/components/Overview.vue.js";
6
+ import r from "../../collection/components/Servers.vue.js";
7
+ import c from "../../collection/components/Settings.vue.js";
8
8
  import u from "../../collection/DocumentCollection.vue.js";
9
+ import v from "../../collection/OperationCollection.vue.js";
9
10
  import f from "../../collection/WorkspaceCollection.vue.js";
11
+ import { workspaceStorage as p } from "../../../helpers/storage.js";
10
12
  import l from "../../operation/Operation.vue.js";
11
- import { workspaceStorage as a } from "../../../helpers/storage.js";
12
- const A = [
13
+ const R = [
13
14
  {
14
15
  path: "/@:namespace/:workspaceSlug",
15
16
  children: [
@@ -18,9 +19,39 @@ const A = [
18
19
  children: [
19
20
  // Example page
20
21
  {
21
- name: "example",
22
- path: "path/:pathEncoded/method/:method/example/:exampleName",
23
- component: l
22
+ path: "path/:pathEncoded/method/:method",
23
+ children: [
24
+ {
25
+ name: "example",
26
+ path: "example/:exampleName",
27
+ component: l
28
+ },
29
+ {
30
+ name: "operation",
31
+ path: "",
32
+ component: v,
33
+ redirect: {
34
+ name: "operation.overview"
35
+ },
36
+ children: [
37
+ {
38
+ name: "operation.overview",
39
+ path: "overview",
40
+ component: m
41
+ },
42
+ {
43
+ name: "operation.servers",
44
+ path: "servers",
45
+ component: r
46
+ },
47
+ {
48
+ name: "operation.authentication",
49
+ path: "authentication",
50
+ component: o
51
+ }
52
+ ]
53
+ }
54
+ ]
24
55
  },
25
56
  // Document Page
26
57
  {
@@ -40,37 +71,37 @@ const A = [
40
71
  {
41
72
  name: "document.overview",
42
73
  path: "overview",
43
- component: h
74
+ component: m
44
75
  },
45
76
  // Document servers
46
77
  {
47
78
  name: "document.servers",
48
79
  path: "servers",
49
- component: d
80
+ component: r
50
81
  },
51
82
  // Document environment
52
83
  {
53
84
  name: "document.environment",
54
85
  path: "environment",
55
- component: n
86
+ component: a
56
87
  },
57
88
  // Document authentication
58
89
  {
59
90
  name: "document.authentication",
60
91
  path: "authentication",
61
- component: s
92
+ component: o
62
93
  },
63
94
  // Document cookies
64
95
  {
65
96
  name: "document.cookies",
66
97
  path: "cookies",
67
- component: o
98
+ component: n
68
99
  },
69
100
  // Document settings
70
101
  {
71
102
  name: "document.settings",
72
103
  path: "settings",
73
- component: m
104
+ component: c
74
105
  }
75
106
  ]
76
107
  }
@@ -86,19 +117,19 @@ const A = [
86
117
  {
87
118
  name: "workspace.environment",
88
119
  path: "environment",
89
- component: n
120
+ component: a
90
121
  },
91
122
  // Workspace cookies
92
123
  {
93
124
  name: "workspace.cookies",
94
125
  path: "cookies",
95
- component: o
126
+ component: n
96
127
  },
97
128
  // Workspace settings
98
129
  {
99
130
  name: "workspace.settings",
100
131
  path: "settings",
101
- component: m
132
+ component: c
102
133
  }
103
134
  ]
104
135
  }
@@ -107,13 +138,13 @@ const A = [
107
138
  {
108
139
  path: "/:pathMatch(.*)*",
109
140
  redirect: () => {
110
- const e = "/@local/default/document/drafts/overview", r = a.getLastPath() ?? e;
111
- a.setCurrentPath(e);
112
- const t = new URL(r, "http://example.com"), c = new URLSearchParams(window.location.search), p = i(t.searchParams, c);
113
- return `${t.pathname}?${p.toString()}`;
141
+ const e = "/@local/default/document/drafts/overview", i = p.getLastPath() ?? e;
142
+ p.setCurrentPath(e);
143
+ const t = new URL(i, "http://example.com"), s = new URLSearchParams(window.location.search), h = d(t.searchParams, s);
144
+ return `${t.pathname}?${h.toString()}`;
114
145
  }
115
146
  }
116
147
  ];
117
148
  export {
118
- A as ROUTES
149
+ R as ROUTES
119
150
  };
@@ -0,0 +1,6 @@
1
+ import type { RouteProps } from '../../../v2/features/app/helpers/routes.js';
2
+ /** Document collection page — tabs for Overview, Servers, Auth, Environment, Cookies, and Settings. */
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: import("vue").DefineComponent<RouteProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<RouteProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ //# sourceMappingURL=OperationCollection.vue.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,83 @@
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";
2
+ import { isHttpMethod as y } from "@scalar/helpers/http/is-http-method";
3
+ import { getResolvedRef as w } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
+ import { RouterView as g } from "vue-router";
5
+ import k from "./components/LabelInput.vue.js";
6
+ import b from "./components/Tabs.vue.js";
7
+ const S = {
8
+ key: 0,
9
+ class: "custom-scroll h-full"
10
+ }, V = { class: "w-full md:mx-auto md:max-w-180" }, B = ["aria-label"], U = { class: "group relative ml-1.25" }, $ = { class: "px-1.5 py-8" }, C = {
11
+ key: 1,
12
+ class: "flex w-full flex-1 items-center justify-center"
13
+ }, N = {}, P = /* @__PURE__ */ f({
14
+ ...N,
15
+ __name: "OperationCollection",
16
+ props: {
17
+ documentSlug: {},
18
+ document: {},
19
+ eventBus: {},
20
+ layout: {},
21
+ path: {},
22
+ method: {},
23
+ exampleName: {},
24
+ environment: {},
25
+ securitySchemes: {},
26
+ workspaceStore: {},
27
+ activeWorkspace: {},
28
+ plugins: {},
29
+ customThemes: {}
30
+ },
31
+ setup(p) {
32
+ const e = p, n = m(() => {
33
+ if (!(!e.path || !e.method))
34
+ return w(e.document?.paths?.[e.path]?.[e.method]);
35
+ }), l = h(n.value?.summary ?? "");
36
+ v(
37
+ () => n.value?.summary,
38
+ (r) => {
39
+ l.value = r ?? "";
40
+ }
41
+ );
42
+ const d = (r) => {
43
+ const { path: t, method: a } = e;
44
+ !t || !a || !y(a) || e.eventBus.emit("operation:update:meta", {
45
+ meta: { path: t, method: a },
46
+ payload: {
47
+ summary: r.trim()
48
+ }
49
+ });
50
+ }, c = m(() => !e.path || !e.method ? "Untitled Operation" : `${e.method.toUpperCase()} ${e.path}`);
51
+ return (r, t) => n.value !== void 0 ? (u(), i("div", S, [
52
+ o("div", V, [
53
+ o("div", {
54
+ "aria-label": `title: ${l.value}`,
55
+ class: "mx-auto flex h-fit w-full flex-row items-center gap-2 pt-8 pb-3 md:max-w-180"
56
+ }, [
57
+ o("div", U, [
58
+ s(k, {
59
+ modelValue: l.value,
60
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => l.value = a),
61
+ class: "text-xl font-bold",
62
+ inputId: "operationSummary",
63
+ placeholder: c.value,
64
+ onBlur: d
65
+ }, null, 8, ["modelValue", "placeholder"])
66
+ ])
67
+ ], 8, B),
68
+ s(b, { type: "operation" }),
69
+ o("div", $, [
70
+ s(x(g), _(e, { collectionType: "operation" }), null, 16)
71
+ ])
72
+ ])
73
+ ])) : (u(), i("div", C, [...t[1] || (t[1] = [
74
+ o("div", { class: "flex h-full flex-col items-center justify-center" }, [
75
+ o("h1", { class: "text-2xl font-bold" }, "Operation not found"),
76
+ o("p", { class: "text-gray-500" }, " The operation you are looking for does not exist. ")
77
+ ], -1)
78
+ ])]));
79
+ }
80
+ });
81
+ export {
82
+ P as default
83
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./OperationCollection.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,11 +1,11 @@
1
1
  declare const __VLS_export: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
2
- collectionType: "document";
2
+ collectionType: "document" | "operation";
3
3
  document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
4
4
  }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
5
5
  collectionType: "workspace";
6
6
  document: null;
7
7
  }), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
8
- collectionType: "document";
8
+ collectionType: "document" | "operation";
9
9
  document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
10
10
  }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
11
11
  collectionType: "workspace";
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":"AA6PA,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":"AA6gBA,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-ac90d255"]]);
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-b34c7f32"]]);
5
5
  export {
6
- i as default
6
+ f as default
7
7
  };
@@ -1,9 +1,13 @@
1
- import { defineComponent as d, computed as i, createBlock as v, openBlock as y, withCtx as n, createElementVNode as a, normalizeClass as r, createVNode as s, unref as l, createTextVNode as u } from "vue";
2
- import { ScalarToggle as h } from "@scalar/components";
3
- import f from "../../settings/components/Section.vue.js";
4
- import { getActiveProxyUrl as S } from "../../../helpers/get-active-proxy-url.js";
5
- import p from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
6
- const x = { class: "flex h-8 items-center" }, V = /* @__PURE__ */ d({
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 i } 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 P from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
10
+ const $ = { class: "flex h-8 items-center" }, K = /* @__PURE__ */ B({
7
11
  __name: "Authentication",
8
12
  props: {
9
13
  documentSlug: {},
@@ -22,61 +26,107 @@ const x = { class: "flex h-8 items-center" }, V = /* @__PURE__ */ d({
22
26
  collectionType: {}
23
27
  },
24
28
  setup(e) {
25
- const o = i(
26
- () => e.document?.["x-scalar-set-operation-security"] ?? !1
27
- ), m = i(
28
- () => e.document?.servers?.find(
29
- ({ url: c }) => c === e.document?.["x-scalar-selected-server"]
30
- ) ?? null
31
- );
32
- return (c, t) => (y(), v(f, null, {
33
- title: n(() => [...t[1] || (t[1] = [
34
- u("Authentication", -1)
35
- ])]),
36
- description: n(() => [...t[2] || (t[2] = [
37
- u(" If enabled, all selected authentication will apply to all operations in this document. You can override this by disabling the toggle and authentication will then be applied at the operation level. ", -1)
38
- ])]),
39
- actions: n(() => [
40
- a("div", x, [
41
- s(l(h), {
42
- class: "w-4",
43
- modelValue: o.value,
44
- "onUpdate:modelValue": t[0] || (t[0] = () => e.eventBus.emit("document:toggle:security"))
45
- }, null, 8, ["modelValue"])
46
- ])
29
+ const r = o(() => e.collectionType === "operation" ? {
30
+ type: "operation",
31
+ path: e.path ?? "",
32
+ method: e.method ?? "get"
33
+ } : { type: "document" }), u = o(() => e.collectionType === "operation" ? !e.path || !R(e.method) ? null : V(e.document?.paths?.[e.path]?.[e.method]) : null), a = A(!1);
34
+ N(() => {
35
+ a.value = q({
36
+ authStore: e.workspaceStore.auth,
37
+ documentName: e.documentSlug,
38
+ ...r.value
39
+ });
40
+ });
41
+ const S = o(() => e.collectionType === "operation" ? e.workspaceStore.auth.getAuthSelectedSchemas({
42
+ type: "operation",
43
+ documentName: e.documentSlug,
44
+ path: e.path ?? "",
45
+ method: e.method ?? "get"
46
+ }) : e.workspaceStore.auth.getAuthSelectedSchemas({
47
+ type: "document",
48
+ documentName: e.documentSlug
49
+ })), g = o(() => e.collectionType === "operation" ? u.value?.security ?? [] : e.document?.security ?? []), p = o(
50
+ () => E(
51
+ e.workspaceStore.workspace["x-scalar-active-proxy"],
52
+ e.layout
53
+ ) ?? ""
54
+ ), m = o(() => M(u.value?.servers ?? e.document?.servers, {
55
+ documentUrl: e.document?.["x-scalar-original-source-url"]
56
+ })), k = o(() => {
57
+ const l = e.document?.["x-scalar-selected-server"], T = u.value?.["x-scalar-selected-server"] ?? l;
58
+ return m.value.find(({ url: w }) => w === T) ?? m.value[0] ?? null;
59
+ }), x = (l) => {
60
+ if (r.value.type === "operation")
61
+ return a.value = l, l ? e.eventBus.emit("auth:update:selected-security-schemes", {
62
+ selectedRequirements: [],
63
+ newSchemes: [],
64
+ meta: r.value
65
+ }) : e.eventBus.emit("auth:clear:selected-security-schemes", {
66
+ meta: r.value
67
+ });
68
+ };
69
+ return (l, t) => (s(), O(C, null, U({
70
+ title: c(() => [
71
+ t[0] || (t[0] = i("Authentication", -1))
47
72
  ]),
48
- default: n(() => [
49
- a("div", {
50
- class: r(!o.value && "cursor-not-allowed")
73
+ description: c(() => [
74
+ e.collectionType === "operation" ? (s(), y(f, { key: 0 }, [
75
+ t[1] || (t[1] = n("span", { class: "block" }, " Override authentication for this operation with the toggle. ", -1)),
76
+ t[2] || (t[2] = n("span", { class: "mt-1 block" }, [
77
+ n("strong", null, "On"),
78
+ i(" — Authentication below applies only to this operation. ")
79
+ ], -1)),
80
+ t[3] || (t[3] = n("span", { class: "mt-1 block" }, [
81
+ n("strong", null, "Off"),
82
+ i(" — This operation uses document-level authentication from the OpenAPI spec. ")
83
+ ], -1))
84
+ ], 64)) : (s(), y(f, { key: 1 }, [
85
+ i(" Configure authentication for this document. Selected authentication applies to all operations unless overridden at the operation level. ")
86
+ ], 64))
87
+ ]),
88
+ default: c(() => [
89
+ n("div", {
90
+ class: d(
91
+ e.collectionType === "operation" && !a.value && "cursor-not-allowed"
92
+ )
51
93
  }, [
52
- s(l(p), {
53
- class: r([
94
+ v(h(P), {
95
+ class: d([
54
96
  "scalar-collection-auth border-none!",
55
- !o.value && "pointer-events-none opacity-50 mix-blend-luminosity"
97
+ e.collectionType === "operation" && !a.value && "pointer-events-none opacity-50 mix-blend-luminosity"
56
98
  ]),
57
99
  environment: e.environment,
58
100
  eventBus: e.eventBus,
59
101
  isStatic: "",
60
- meta: { type: "document" },
61
- proxyUrl: l(S)(
62
- e.workspaceStore.workspace["x-scalar-active-proxy"],
63
- e.layout
64
- ) ?? "",
65
- securityRequirements: e.document?.security ?? [],
102
+ meta: r.value,
103
+ proxyUrl: p.value,
104
+ securityRequirements: g.value,
66
105
  securitySchemes: e.securitySchemes,
67
- selectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
68
- type: "document",
69
- documentName: e.documentSlug
70
- }),
71
- server: m.value,
106
+ selectedSecurity: S.value,
107
+ server: k.value,
72
108
  title: "Authentication"
73
- }, null, 8, ["class", "environment", "eventBus", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])
109
+ }, null, 8, ["class", "environment", "eventBus", "meta", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])
74
110
  ], 2)
75
111
  ]),
76
- _: 1
77
- }));
112
+ _: 2
113
+ }, [
114
+ e.collectionType === "operation" ? {
115
+ name: "actions",
116
+ fn: c(() => [
117
+ n("div", $, [
118
+ v(h(b), {
119
+ class: "w-4",
120
+ modelValue: a.value,
121
+ "onUpdate:modelValue": x
122
+ }, null, 8, ["modelValue"])
123
+ ])
124
+ ]),
125
+ key: "0"
126
+ } : void 0
127
+ ]), 1024));
78
128
  }
79
129
  });
80
130
  export {
81
- V as default
131
+ K as default
82
132
  };
@@ -1,16 +1,21 @@
1
+ /**
2
+ * Cookies section for the collection.
3
+ * Renders document or workspace cookies and lets users manage key-value data
4
+ * sent with API requests (e.g. session tokens, auth, preferences).
5
+ */
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
1
8
  declare const __VLS_export: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
2
- collectionType: "document";
9
+ collectionType: "document" | "operation";
3
10
  document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
4
11
  }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
5
12
  collectionType: "workspace";
6
13
  document: null;
7
14
  }), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
8
- collectionType: "document";
15
+ collectionType: "document" | "operation";
9
16
  document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
10
17
  }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
11
18
  collectionType: "workspace";
12
19
  document: null;
13
20
  })> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
- declare const _default: typeof __VLS_export;
15
- export default _default;
16
21
  //# sourceMappingURL=Cookies.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Cookies.vue"],"names":[],"mappings":"AAgHA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Cookies.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Cookies.vue"],"names":[],"mappings":"AAqDA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;;;;;;;;;;;;kGA4Ed,CAAC"}
@@ -1,8 +1,10 @@
1
- import { defineComponent as c, computed as i, createBlock as r, openBlock as u, withCtx as t, createVNode as a, unref as m, createTextVNode as n, createElementVNode as s } from "vue";
1
+ import { defineComponent as s, computed as i, createBlock as r, createCommentVNode as u, openBlock as a, withCtx as t, createVNode as m, unref as d, createTextVNode as n, createElementVNode as c } from "vue";
2
2
  import k from "../../settings/components/Section.vue.js";
3
- import d from "../../global-cookies/components/CookiesTable.vue.js";
4
- const T = /* @__PURE__ */ c({
5
- __name: "Cookies",
3
+ import p from "../../global-cookies/components/CookiesTable.vue.js";
4
+ const f = {
5
+ name: "Cookies"
6
+ }, C = /* @__PURE__ */ s({
7
+ ...f,
6
8
  props: {
7
9
  documentSlug: {},
8
10
  document: {},
@@ -21,27 +23,27 @@ const T = /* @__PURE__ */ c({
21
23
  },
22
24
  setup(e) {
23
25
  const l = i(() => (e.collectionType === "document" ? e.document["x-scalar-cookies"] : e.workspaceStore.workspace["x-scalar-cookies"]) ?? []);
24
- return (p, o) => (u(), r(k, null, {
26
+ return (y, o) => e.collectionType !== "operation" ? (a(), r(k, { key: 0 }, {
25
27
  title: t(() => [...o[0] || (o[0] = [
26
28
  n("Cookies", -1)
27
29
  ])]),
28
30
  description: t(() => [...o[1] || (o[1] = [
29
31
  n(" Manage your collection's cookies here.", -1),
30
- s("br", null, null, -1),
32
+ c("br", null, null, -1),
31
33
  n("Cookies allow you to store and send key-value data with your API requests—often used for things like session tokens, authentication, and saving user preferences.", -1),
32
- s("br", null, null, -1)
34
+ c("br", null, null, -1)
33
35
  ])]),
34
36
  default: t(() => [
35
- a(m(d), {
37
+ m(d(p), {
36
38
  collectionType: e.collectionType,
37
39
  cookies: l.value,
38
40
  eventBus: e.eventBus
39
41
  }, null, 8, ["collectionType", "cookies", "eventBus"])
40
42
  ]),
41
43
  _: 1
42
- }));
44
+ })) : u("", !0);
43
45
  }
44
46
  });
45
47
  export {
46
- T as default
48
+ C as default
47
49
  };
@@ -1,16 +1,21 @@
1
+ /**
2
+ * Environment variables section for the collection.
3
+ * Renders document or workspace environments and lets users set variables
4
+ * that can be referenced in request inputs via {{ variable }}.
5
+ */
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
1
8
  declare const __VLS_export: import("vue").DefineComponent<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
2
- collectionType: "document";
9
+ collectionType: "document" | "operation";
3
10
  document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
4
11
  }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
5
12
  collectionType: "workspace";
6
13
  document: null;
7
14
  }), {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<(import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
8
- collectionType: "document";
15
+ collectionType: "document" | "operation";
9
16
  document: import("@scalar/workspace-store/schemas").WorkspaceDocument;
10
17
  }) | (import("../../../../v2/features/app/helpers/routes.js").RouteProps & {
11
18
  collectionType: "workspace";
12
19
  document: null;
13
20
  })> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
- declare const _default: typeof __VLS_export;
15
- export default _default;
16
21
  //# sourceMappingURL=Environment.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Environment.vue"],"names":[],"mappings":"AAkIA,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Environment.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Environment.vue"],"names":[],"mappings":"AAgEA;;;;GAIG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;;;;;;;;;;;;kGAoFd,CAAC"}
@@ -1,8 +1,10 @@
1
- import { defineComponent as i, computed as r, createBlock as l, openBlock as s, withCtx as t, createVNode as m, unref as u, createTextVNode as o, createElementVNode as v } from "vue";
2
- import d from "../../settings/components/Section.vue.js";
3
- import p from "../../environments/EnvironmentsList.vue.js";
4
- const T = /* @__PURE__ */ i({
5
- __name: "Environment",
1
+ import { defineComponent as i, computed as c, createBlock as l, createCommentVNode as m, openBlock as s, withCtx as n, createVNode as u, unref as v, createTextVNode as o, createElementVNode as d } from "vue";
2
+ import p from "../../settings/components/Section.vue.js";
3
+ import f from "../../environments/EnvironmentsList.vue.js";
4
+ const y = {
5
+ name: "Environment"
6
+ }, B = /* @__PURE__ */ i({
7
+ ...y,
6
8
  props: {
7
9
  documentSlug: {},
8
10
  document: {},
@@ -20,30 +22,30 @@ const T = /* @__PURE__ */ i({
20
22
  collectionType: {}
21
23
  },
22
24
  setup(e) {
23
- const c = r(
25
+ const r = c(
24
26
  () => (e.collectionType === "document" ? e.document["x-scalar-environments"] : e.workspaceStore.workspace["x-scalar-environments"]) ?? {}
25
- ), a = r(() => e.workspaceStore.workspace["x-scalar-active-environment"]);
26
- return (f, n) => (s(), l(d, null, {
27
- title: t(() => [...n[0] || (n[0] = [
27
+ ), a = c(() => e.workspaceStore.workspace["x-scalar-active-environment"]);
28
+ return (k, t) => e.collectionType !== "operation" ? (s(), l(p, { key: 0 }, {
29
+ title: n(() => [...t[0] || (t[0] = [
28
30
  o("Environment Variables", -1)
29
31
  ])]),
30
- description: t(() => [...n[1] || (n[1] = [
32
+ description: n(() => [...t[1] || (t[1] = [
31
33
  o(" Set environment variables at your collection level. Use ", -1),
32
- v("code", { class: "font-code text-c-2" }, " {{ variable }} ", -1),
34
+ d("code", { class: "font-code text-c-2" }, " {{ variable }} ", -1),
33
35
  o(" to add / search among the selected environment's variables in your request inputs. ", -1)
34
36
  ])]),
35
- default: t(() => [
36
- m(u(p), {
37
+ default: n(() => [
38
+ u(v(f), {
37
39
  activeEnvironment: a.value,
38
40
  collectionType: e.collectionType,
39
- environments: c.value,
41
+ environments: r.value,
40
42
  eventBus: e.eventBus
41
43
  }, null, 8, ["activeEnvironment", "collectionType", "environments", "eventBus"])
42
44
  ]),
43
45
  _: 1
44
- }));
46
+ })) : m("", !0);
45
47
  }
46
48
  });
47
49
  export {
48
- T as default
50
+ B as default
49
51
  };