@scalar/api-client 2.23.2 → 2.23.4

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 (24) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +54 -53
  5. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +78 -78
  7. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  8. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +63 -51
  9. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  10. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -2
  11. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +5 -1
  12. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  13. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +61 -61
  14. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  15. package/dist/v2/features/modal/Modal.vue.js +2 -2
  16. package/dist/v2/features/modal/Modal.vue2.js +15 -17
  17. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  18. package/dist/v2/features/modal/helpers/create-api-client-modal.js +58 -41
  19. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts +18 -0
  20. package/dist/v2/features/modal/helpers/restore-workspace-state.d.ts.map +1 -0
  21. package/dist/v2/features/modal/helpers/restore-workspace-state.js +36 -0
  22. package/dist/v2/features/operation/Operation.vue.js +1 -1
  23. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  24. package/package.json +11 -11
@@ -1,18 +1,19 @@
1
- import { defineComponent as q, ref as x, watch as y, computed as o, createBlock as m, openBlock as d, unref as t, normalizeClass as E, withCtx as s, createVNode as u, createCommentVNode as f, createElementBlock as R, Fragment as N, createElementVNode as h, toDisplayString as P } from "vue";
1
+ import { defineComponent as q, ref as x, watch as g, computed as o, createBlock as s, openBlock as d, unref as n, normalizeClass as E, withCtx as m, createVNode as u, createCommentVNode as f, createElementBlock as R, Fragment as N, createElementVNode as h, toDisplayString as P } from "vue";
2
2
  import { ScalarButton as C, ScalarIconButton as j, ScalarIcon as G } from "@scalar/components";
3
3
  import { ScalarIconTrash as K, ScalarIconGlobe as O } from "@scalar/icons";
4
4
  import { unpackProxyObject as B } from "@scalar/workspace-store/helpers/unpack-proxy";
5
- import { getFileName as W } from "../helpers/files.js";
6
- import { validateParameter as A } from "../helpers/validate-parameter.js";
5
+ import { resolve as W } from "@scalar/workspace-store/resolve";
6
+ import { getFileName as A } from "../helpers/files.js";
7
+ import { validateParameter as H } from "../helpers/validate-parameter.js";
7
8
  import D from "./RequestTableTooltip.vue.js";
8
- import H from "../../../components/data-table/DataTableRow.vue.js";
9
- import J from "../../../components/data-table/DataTableCheckbox.vue.js";
10
- import g from "../../../components/data-table/DataTableCell.vue.js";
11
- import F from "../../../components/code-input/CodeInput.vue.js";
12
- const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1" }, M = {
9
+ import J from "../../../components/data-table/DataTableRow.vue.js";
10
+ import L from "../../../components/data-table/DataTableCheckbox.vue.js";
11
+ import y from "../../../components/data-table/DataTableCell.vue.js";
12
+ import S from "../../../components/code-input/CodeInput.vue.js";
13
+ const M = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1" }, Q = {
13
14
  key: 1,
14
15
  class: "p-0.5"
15
- }, ne = /* @__PURE__ */ q({
16
+ }, de = /* @__PURE__ */ q({
16
17
  __name: "RequestTableRow",
17
18
  props: {
18
19
  data: {},
@@ -23,52 +24,63 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
23
24
  showUploadButton: { type: Boolean }
24
25
  },
25
26
  emits: ["upsertRow", "deleteRow", "uploadFile", "removeFile", "navigate"],
26
- setup(e, { emit: S }) {
27
- const r = S, c = x(e.data.name ?? ""), n = x(B(e.data.value) ?? ""), v = x(e.data.isDisabled ?? !1);
28
- y(
27
+ setup(e, { emit: F }) {
28
+ const r = F, c = x(e.data.name ?? ""), i = x(B(e.data.value) ?? ""), v = x(e.data.isDisabled ?? !1);
29
+ g(
29
30
  () => e.data.name,
30
- (i) => c.value = i ?? ""
31
- ), y(
31
+ (t) => c.value = t ?? ""
32
+ ), g(
32
33
  () => e.data.value,
33
- (i) => n.value = B(i) ?? ""
34
- ), y(
34
+ (t) => i.value = B(t) ?? ""
35
+ ), g(
35
36
  () => e.data.isDisabled,
36
- (i) => v.value = i ?? !1
37
+ (t) => v.value = t ?? !1
37
38
  );
38
- const k = o(() => n.value instanceof File), w = o(
39
- () => (k.value ? W(n.value) : n.value) ?? ""
40
- ), z = o(() => e.data.schema?.default), I = o(() => e.data.schema?.enum), T = o(
39
+ const k = o(() => i.value instanceof File), w = o(
40
+ () => (k.value ? A(i.value) : i.value) ?? ""
41
+ ), z = o(() => e.data.schema?.default), I = o(() => {
42
+ if (!e.data.schema)
43
+ return [];
44
+ if (e.data.schema.enum)
45
+ return e.data.schema.enum.map((t) => String(t));
46
+ if ("items" in e.data.schema) {
47
+ const t = W.schema(e.data.schema.items);
48
+ if (t?.enum)
49
+ return t.enum.map((a) => String(a));
50
+ }
51
+ return [];
52
+ }), T = o(
41
53
  () => e.data.schema && "minimum" in e.data.schema ? e.data.schema.minimum : void 0
42
54
  ), $ = o(
43
55
  () => e.data.schema && "maximum" in e.data.schema ? e.data.schema.maximum : void 0
44
56
  ), U = o(
45
57
  () => e.data.schema && "type" in e.data.schema ? e.data.schema.type : void 0
46
58
  ), V = o(
47
- () => A(e.data.schema, n.value)
48
- ), b = (i) => {
49
- i.name !== void 0 && (c.value = i.name), i.value !== void 0 && (n.value = i.value), v.value = i.isDisabled ?? !1, r("upsertRow", {
59
+ () => H(e.data.schema, i.value)
60
+ ), b = (t) => {
61
+ t.name !== void 0 && (c.value = t.name), t.value !== void 0 && (i.value = t.value), v.value = t.isDisabled ?? !1, r("upsertRow", {
50
62
  name: c.value,
51
- value: n.value,
63
+ value: i.value,
52
64
  isDisabled: v.value
53
65
  });
54
66
  };
55
- return (i, a) => (d(), m(t(H), {
67
+ return (t, a) => (d(), s(n(J), {
56
68
  id: e.data.name,
57
69
  class: E({
58
70
  alert: V.value.ok === !1,
59
71
  error: V.value.ok === !1 && e.invalidParams?.has(e.data.name)
60
72
  })
61
73
  }, {
62
- default: s(() => [
63
- u(t(J), {
74
+ default: m(() => [
75
+ u(n(L), {
64
76
  class: "!border-r",
65
77
  disabled: e.hasCheckboxDisabled ?? !1,
66
78
  modelValue: !v.value,
67
79
  "onUpdate:modelValue": a[0] || (a[0] = (l) => b({ isDisabled: !l }))
68
80
  }, null, 8, ["disabled", "modelValue"]),
69
- u(t(g), null, {
70
- default: s(() => [
71
- u(t(F), {
81
+ u(n(y), null, {
82
+ default: m(() => [
83
+ u(n(S), {
72
84
  "aria-label": `${e.label} Key`,
73
85
  disableCloseBrackets: "",
74
86
  disabled: e.data.isReadonly,
@@ -85,9 +97,9 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
85
97
  ]),
86
98
  _: 1
87
99
  }),
88
- u(t(g), null, {
89
- default: s(() => [
90
- u(t(F), {
100
+ u(n(y), null, {
101
+ default: m(() => [
102
+ u(n(S), {
91
103
  "aria-label": `${e.label} Value`,
92
104
  class: "pr-6 group-hover:pr-10 group-has-[.cm-focused]:pr-10",
93
105
  default: z.value,
@@ -95,7 +107,7 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
95
107
  disabled: e.data.isReadonly,
96
108
  disableEnter: "",
97
109
  disableTabIndent: "",
98
- enum: I.value ?? [],
110
+ enum: I.value,
99
111
  environment: e.environment,
100
112
  examples: e.data.schema?.examples?.map((l) => String(l)) ?? [],
101
113
  linethrough: e.data.isOverridden,
@@ -107,38 +119,38 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
107
119
  type: U.value,
108
120
  "onUpdate:modelValue": a[5] || (a[5] = (l) => b({ value: l }))
109
121
  }, {
110
- icon: s(() => [
111
- (e.data.name || n.value) && !e.data.isRequired && e.data.isReadonly !== !0 ? (d(), m(t(C), {
122
+ icon: m(() => [
123
+ (e.data.name || i.value) && !e.data.isRequired && e.data.isReadonly !== !0 ? (d(), s(n(C), {
112
124
  key: 0,
113
125
  class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.cm-focused]:flex",
114
126
  size: "sm",
115
127
  variant: "ghost",
116
128
  onClick: a[3] || (a[3] = (l) => r("deleteRow"))
117
129
  }, {
118
- default: s(() => [
119
- u(t(K), { class: "size-3.5" })
130
+ default: m(() => [
131
+ u(n(K), { class: "size-3.5" })
120
132
  ]),
121
133
  _: 1
122
134
  })) : f("", !0),
123
- e.data.globalRoute !== void 0 ? (d(), m(t(j), {
135
+ e.data.globalRoute !== void 0 ? (d(), s(n(j), {
124
136
  key: 1,
125
137
  class: "text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit",
126
- icon: t(O),
138
+ icon: n(O),
127
139
  label: "Global cookies are shared across the whole workspace. Click to navigate.",
128
140
  size: "xs",
129
141
  tooltip: "top",
130
142
  variant: "ghost",
131
143
  onClick: a[4] || (a[4] = (l) => r("navigate", e.data.globalRoute))
132
144
  }, null, 8, ["icon"])) : f("", !0),
133
- e.data.isReadonly ? (d(), m(D, {
145
+ e.data.isReadonly ? (d(), s(D, {
134
146
  key: 2,
135
147
  description: "This is a readonly property and you can not modify it! If you want to change it you have to override it or disable it using the checkbox",
136
148
  value: null
137
- })) : e.data.schema ? (d(), m(D, {
149
+ })) : e.data.schema ? (d(), s(D, {
138
150
  key: 3,
139
151
  description: e.data.description,
140
152
  schema: e.data.schema,
141
- value: n.value
153
+ value: i.value
142
154
  }, null, 8, ["description", "schema", "value"])) : f("", !0)
143
155
  ]),
144
156
  _: 1
@@ -146,13 +158,13 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
146
158
  ]),
147
159
  _: 1
148
160
  }),
149
- e.showUploadButton ? (d(), m(t(g), {
161
+ e.showUploadButton ? (d(), s(n(y), {
150
162
  key: 0,
151
163
  class: "group/upload flex items-center justify-center whitespace-nowrap"
152
164
  }, {
153
- default: s(() => [
165
+ default: m(() => [
154
166
  k.value ? (d(), R(N, { key: 0 }, [
155
- h("div", L, [
167
+ h("div", M, [
156
168
  h("span", null, P(w.value), 1)
157
169
  ]),
158
170
  h("button", {
@@ -160,16 +172,16 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
160
172
  type: "button",
161
173
  onClick: a[6] || (a[6] = (l) => r("removeFile"))
162
174
  }, " Delete ")
163
- ], 64)) : (d(), R("div", M, [
164
- u(t(C), {
175
+ ], 64)) : (d(), R("div", Q, [
176
+ u(n(C), {
165
177
  class: "bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",
166
178
  size: "sm",
167
179
  variant: "outlined",
168
180
  onClick: a[7] || (a[7] = (l) => r("uploadFile"))
169
181
  }, {
170
- default: s(() => [
182
+ default: m(() => [
171
183
  a[8] || (a[8] = h("span", null, "Select File", -1)),
172
- u(t(G), {
184
+ u(n(G), {
173
185
  class: "ml-1",
174
186
  icon: "Upload",
175
187
  size: "xs",
@@ -188,5 +200,5 @@ const L = { class: "text-c-2 filemask flex w-full max-w-[100%] items-center just
188
200
  }
189
201
  });
190
202
  export {
191
- ne as default
203
+ de as default
192
204
  };
@@ -1,7 +1,7 @@
1
1
  import { canMethodHaveBody as p } from "@scalar/helpers/http/can-method-have-body";
2
2
  import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isElectron as u } from "../../../../libs/electron.js";
4
- const i = "2.23.2", m = "application/json", h = "*/*", c = (r, t, o) => ({
4
+ const i = "2.23.4", m = "application/json", h = "*/*", c = (r, t, o) => ({
5
5
  name: r,
6
6
  defaultValue: t,
7
7
  isOverridden: o.has(r.toLowerCase())
@@ -1,7 +1,7 @@
1
1
  import o from "./ResponseBody.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-32d6d6ca"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8ae4f555"]]);
5
5
  export {
6
- a as default
6
+ s as default
7
7
  };
@@ -1,6 +1,10 @@
1
+ import type { SecurityScheme } from '@scalar/types/entities';
1
2
  import type { AuthStore } from '@scalar/workspace-store/entities/auth';
3
+ import type { DeepPartial } from '@scalar/workspace-store/helpers/overrides-proxy';
2
4
  import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
5
  import type { SecuritySchemeObjectSecret } from './secret-types';
6
+ /** A combined scheme that includes both the auth store secrets and a deep partial of the config auth */
7
+ export type ConfigAuthScheme = SecuritySchemeObject & DeepPartial<SecurityScheme>;
4
8
  /** Extract the secrets from the config and the auth store */
5
- export declare const extractSecuritySchemeSecrets: (scheme: SecuritySchemeObject, authStore: AuthStore, name: string, documentSlug: string) => SecuritySchemeObjectSecret;
9
+ export declare const extractSecuritySchemeSecrets: (scheme: SecuritySchemeObject & DeepPartial<SecurityScheme>, authStore: AuthStore, name: string, documentSlug: string) => SecuritySchemeObjectSecret;
6
10
  //# sourceMappingURL=extract-security-scheme-secrets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,uCAAuC,CAAA;AAOnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,gBAAgB,CAAA;AA+CvB,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,EAC5B,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BA0GF,CAAA"}
1
+ {"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAOlF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,gBAAgB,CAAA;AAEvB,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAoCjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BAgHF,CAAA"}
@@ -1,81 +1,81 @@
1
- import { objectEntries as d } from "@scalar/helpers/object/object-entries";
2
- const o = ({
3
- schemeName: e,
4
- authStore: s,
5
- documentSlug: c,
6
- type: a
7
- }) => {
8
- const r = s.getAuthSecrets(c, e);
9
- if (r?.type === a)
10
- return r;
11
- }, u = {
12
- clientSecret: "x-scalar-secret-client-secret",
13
- password: "x-scalar-secret-password",
14
- token: "x-scalar-secret-token",
15
- username: "x-scalar-secret-username",
16
- value: "x-scalar-secret-token",
17
- "x-scalar-client-id": "x-scalar-secret-client-id",
18
- "x-scalar-redirect-uri": "x-scalar-secret-redirect-uri"
19
- }, l = (e) => d(u).reduce((s, [c, a]) => {
20
- const r = e[c];
21
- return r !== void 0 && typeof r == "string" && (s[a] = r), s;
22
- }, {}), f = (e, s, c, a) => {
1
+ import { objectEntries as p } from "@scalar/helpers/object/object-entries";
2
+ const u = {
3
+ "x-scalar-secret-client-id": "x-scalar-client-id",
4
+ "x-scalar-secret-client-secret": "clientSecret",
5
+ "x-scalar-secret-password": "password",
6
+ "x-scalar-secret-redirect-uri": "x-scalar-redirect-uri",
7
+ "x-scalar-secret-token": "token",
8
+ "x-scalar-secret-username": "username"
9
+ }, o = (e, l, d = {}) => {
10
+ const i = {};
11
+ for (const s of e) {
12
+ const r = d[s], n = l[u[s]];
13
+ i[s] = r || n || "";
14
+ }
15
+ return i;
16
+ }, f = (e, l, d, i) => {
17
+ const s = l.getAuthSecrets(i, d);
23
18
  if (e.type === "apiKey") {
24
- const r = o({ schemeName: c, type: "apiKey", authStore: s, documentSlug: a });
19
+ const r = s?.type === "apiKey" ? s : void 0;
25
20
  return {
26
21
  ...e,
27
- "x-scalar-secret-token": "",
28
- ...l(e),
29
- ...r
22
+ "x-scalar-secret-token": r?.["x-scalar-secret-token"] || e.value || ""
30
23
  };
31
24
  }
32
25
  if (e.type === "http") {
33
- const r = o({ schemeName: c, type: "http", authStore: s, documentSlug: a });
26
+ const r = s?.type === "http" ? s : void 0;
34
27
  return {
35
28
  ...e,
36
- "x-scalar-secret-password": "",
37
- "x-scalar-secret-token": "",
38
- "x-scalar-secret-username": "",
39
- ...l(e),
40
- ...r
29
+ "x-scalar-secret-token": r?.["x-scalar-secret-token"] || e.token || "",
30
+ "x-scalar-secret-username": r?.["x-scalar-secret-username"] || e.username || "",
31
+ "x-scalar-secret-password": r?.["x-scalar-secret-password"] || e.password || ""
41
32
  };
42
33
  }
43
34
  if (e.type === "oauth2") {
44
- const r = o({ schemeName: c, type: "oauth2", authStore: s, documentSlug: a }), x = /* @__PURE__ */ new Set();
35
+ const r = s?.type === "oauth2" ? s : void 0, n = /* @__PURE__ */ new Set();
45
36
  return {
46
37
  ...e,
47
- flows: d(e?.flows ?? {}).reduce((n, [i, t]) => (t && ("selectedScopes" in t && Array.isArray(t.selectedScopes) && t.selectedScopes?.forEach((p) => x.add(p)), i === "implicit" && (n.implicit = {
38
+ flows: p(e?.flows ?? {}).reduce((a, [c, t]) => (t && ("selectedScopes" in t && Array.isArray(t.selectedScopes) && t.selectedScopes?.forEach((x) => x && n.add(x)), c === "implicit" && (a.implicit = {
48
39
  ...t,
49
- "x-scalar-secret-client-id": "",
50
- "x-scalar-secret-redirect-uri": "",
51
- "x-scalar-secret-token": "",
52
- ...l(t),
53
- ...r?.implicit
54
- }), i === "password" && (n[i] = {
40
+ ...o(
41
+ ["x-scalar-secret-client-id", "x-scalar-secret-redirect-uri", "x-scalar-secret-token"],
42
+ t,
43
+ r?.implicit
44
+ )
45
+ }), c === "password" && (a[c] = {
55
46
  ...t,
56
- "x-scalar-secret-client-id": "",
57
- "x-scalar-secret-client-secret": "",
58
- "x-scalar-secret-username": "",
59
- "x-scalar-secret-password": "",
60
- "x-scalar-secret-token": "",
61
- ...l(t),
62
- ...r?.password
63
- }), i === "clientCredentials" && (n[i] = {
47
+ ...o(
48
+ [
49
+ "x-scalar-secret-client-id",
50
+ "x-scalar-secret-client-secret",
51
+ "x-scalar-secret-username",
52
+ "x-scalar-secret-password",
53
+ "x-scalar-secret-token"
54
+ ],
55
+ t,
56
+ r?.password
57
+ )
58
+ }), c === "clientCredentials" && (a[c] = {
64
59
  ...t,
65
- "x-scalar-secret-client-id": "",
66
- "x-scalar-secret-client-secret": "",
67
- "x-scalar-secret-token": "",
68
- ...l(t),
69
- ...r?.clientCredentials
70
- }), i === "authorizationCode" && (n[i] = {
60
+ ...o(
61
+ ["x-scalar-secret-client-id", "x-scalar-secret-client-secret", "x-scalar-secret-token"],
62
+ t,
63
+ r?.clientCredentials
64
+ )
65
+ }), c === "authorizationCode" && (a[c] = {
71
66
  ...t,
72
- "x-scalar-secret-client-id": "",
73
- "x-scalar-secret-client-secret": "",
74
- "x-scalar-secret-redirect-uri": "",
75
- "x-scalar-secret-token": "",
76
- ...r?.authorizationCode
77
- })), n), {}),
78
- "x-default-scopes": Array.from(x)
67
+ ...o(
68
+ [
69
+ "x-scalar-secret-client-id",
70
+ "x-scalar-secret-client-secret",
71
+ "x-scalar-secret-redirect-uri",
72
+ "x-scalar-secret-token"
73
+ ],
74
+ t,
75
+ r?.authorizationCode
76
+ )
77
+ })), a), {}),
78
+ "x-default-scopes": Array.from(n)
79
79
  };
80
80
  }
81
81
  return e.type === "openIdConnect", e;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAoZA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,SAAS,CACZ,CACF,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBA4WC"}
1
+ {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AA+YA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,SAAS,CACZ,CACF,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBAuWC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Modal.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dbc80a57"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-6027a07f"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as W, ref as w, useId as D, watch as I, nextTick as N, onBeforeMount as E, onBeforeUnmount as F, computed as u, toValue as U, withDirectives as k, createElementBlock as d, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as b } from "vue";
1
+ import { defineComponent as C, ref as w, useId as I, watch as N, nextTick as D, onBeforeMount as E, onBeforeUnmount as F, computed as d, toValue as U, withDirectives as k, createElementBlock as u, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as b } from "vue";
2
2
  import { addScalarClassesToHeadless as $, ScalarTeleportRoot as A } from "@scalar/components";
3
3
  import { ScalarToasts as z } from "@scalar/use-toasts";
4
4
  import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
@@ -16,7 +16,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
16
16
  }, Y = {
17
17
  key: 1,
18
18
  class: "flex h-full w-full items-center justify-center"
19
- }, Z = {}, me = /* @__PURE__ */ W({
19
+ }, Z = {}, me = /* @__PURE__ */ C({
20
20
  ...Z,
21
21
  __name: "Modal",
22
22
  props: {
@@ -44,25 +44,23 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
44
44
  modalState: e.modalState,
45
45
  store: e.workspaceStore
46
46
  }), j(e.eventBus, "modal");
47
- const v = w(null), f = D(), { activate: y, deactivate: B } = H(v, {
47
+ const v = w(null), f = I(), { activate: y, deactivate: B } = H(v, {
48
48
  allowOutsideClick: !0,
49
49
  fallbackFocus: `#${f}`
50
50
  }), S = () => {
51
- B(), e.eventBus.emit("operation:cancel:request"), e.workspaceStore.revertDocumentChanges(
52
- e.document.value?.["x-scalar-navigation"]?.name ?? ""
53
- );
54
- }, g = q(() => typeof window < "u" ? window.document.body : null);
55
- I(
51
+ B(), e.eventBus.emit("operation:cancel:request");
52
+ }, p = q(() => typeof window < "u" ? window.document.body : null);
53
+ N(
56
54
  () => e.modalState.open,
57
55
  (a) => {
58
- g.value = a, a ? y({ checkCanFocusTrap: () => N() }) : S();
56
+ p.value = a, a ? y({ checkCanFocusTrap: () => D() }) : S();
59
57
  }
60
58
  ), E(() => $()), F(() => S());
61
- const p = 288, c = u(
62
- () => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? p
63
- ), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = u(
59
+ const g = 288, c = d(
60
+ () => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? g
61
+ ), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = d(
64
62
  () => R(e.workspaceStore, e.document.value)
65
- ), C = u(
63
+ ), W = d(
66
64
  () => L(
67
65
  e.document.value?.components?.securitySchemes,
68
66
  U(e.options)?.authentication?.securitySchemes,
@@ -73,7 +71,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
73
71
  return x({
74
72
  sidebarWidth: c,
75
73
  environment: h
76
- }), (a, t) => k((m(), d("div", P, [
74
+ }), (a, t) => k((m(), u("div", P, [
77
75
  s("div", J, [
78
76
  s("div", {
79
77
  id: o(f),
@@ -88,7 +86,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
88
86
  l(o(A), null, {
89
87
  default: V(() => [
90
88
  l(o(z)),
91
- e.document.value && e.path?.value && e.method?.value ? (m(), d("main", X, [
89
+ e.document.value && e.path?.value && e.method?.value ? (m(), u("main", X, [
92
90
  l(o(G), {
93
91
  modelValue: n.value,
94
92
  "onUpdate:modelValue": t[0] || (t[0] = (i) => n.value = i),
@@ -125,10 +123,10 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
125
123
  options: e.options,
126
124
  path: e.path?.value,
127
125
  plugins: e.plugins,
128
- securitySchemes: C.value,
126
+ securitySchemes: W.value,
129
127
  workspaceStore: e.workspaceStore
130
128
  }, null, 8, ["document", "documentSlug", "environment", "eventBus", "exampleName", "method", "options", "path", "plugins", "securitySchemes", "workspaceStore"])
131
- ])) : (m(), d("div", Y, [...t[3] || (t[3] = [
129
+ ])) : (m(), u("div", Y, [...t[3] || (t[3] = [
132
130
  s("span", { class: "text-c-3" }, "No document selected", -1)
133
131
  ])]))
134
132
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"create-api-client-modal.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/helpers/create-api-client-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,gCAAgC,CAAA;AAChG,OAAO,EAAE,KAAK,GAAG,EAAiC,MAAM,KAAK,CAAA;AAE7D,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,sDAAsD,CAAA;AAE7D,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,KAAK,2BAA2B,GAAG;IACjC,4CAA4C;IAC5C,EAAE,EAAE,WAAW,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,cAAc,CAAA;IAC9B,iDAAiD;IACjD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,wGAAwG;IACxG,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/C,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,wEASlC,2BAA2B,KAAG,cAsFhC,CAAA"}
1
+ {"version":3,"file":"create-api-client-modal.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/modal/helpers/create-api-client-modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,gCAAgC,CAAA;AAEhG,OAAO,EAAE,KAAK,GAAG,EAA6C,MAAM,KAAK,CAAA;AAEzE,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,sDAAsD,CAAA;AAG7D,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,KAAK,2BAA2B,GAAG;IACjC,4CAA4C;IAC5C,EAAE,EAAE,WAAW,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,kFAAkF;IAClF,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,6DAA6D;IAC7D,cAAc,EAAE,cAAc,CAAA;IAC9B,iDAAiD;IACjD,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,wGAAwG;IACxG,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,GAAG,CAAA;IACR,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,IAAI,CAAA;IACtC,KAAK,EAAE,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IAC/C,KAAK,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAA;IACtC,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,wEASlC,2BAA2B,KAAG,cAqHhC,CAAA"}