@scalar/api-client 2.17.6 → 2.17.8

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 (40) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/components/CommandPalette/CommandActionInput.vue.js +1 -1
  3. package/dist/components/Sidebar/Actions/DeleteSidebarListElement.vue.js +5 -5
  4. package/dist/components/Sidebar/Actions/EditSidebarListCollection.vue.js +18 -18
  5. package/dist/components/Sidebar/Actions/EditSidebarListElement.vue.js +7 -7
  6. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  7. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +44 -5
  8. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +2 -44
  9. package/dist/style.css +1 -1
  10. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/build-request.js +22 -17
  12. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -10
  13. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +149 -126
  15. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +20 -0
  16. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -0
  17. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +7 -0
  18. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue2.js +76 -0
  19. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +22 -5
  20. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +79 -64
  22. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +16 -8
  23. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  24. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
  25. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  26. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +84 -82
  27. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  28. package/dist/v2/components/forms/ConfirmationForm.vue.js +43 -5
  29. package/dist/v2/components/forms/ConfirmationForm.vue2.js +2 -43
  30. package/dist/v2/components/modals/DeleteModal.vue.js +11 -11
  31. package/dist/v2/features/operation/Operation.vue.js +1 -1
  32. package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
  33. package/dist/v2/features/settings/DocumentSettings.vue.js +104 -5
  34. package/dist/v2/features/settings/DocumentSettings.vue2.js +2 -104
  35. package/dist/views/Collection/CollectionSettings.vue.d.ts.map +1 -1
  36. package/dist/views/Collection/CollectionSettings.vue.js +1 -4
  37. package/dist/views/Collection/CollectionSettings.vue2.js +5 -5
  38. package/dist/views/Environment/EnvironmentColorModal.vue.js +6 -6
  39. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  40. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"build-request.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAKnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACtH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAI5F,OAAO,EAAU,KAAK,aAAa,EAAkB,MAAM,eAAe,CAAA;AAO1E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,iHAU1B;IACD,8CAA8C;IAC9C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,aAAa,EAAE,aAAa,EAAE,CAAA;IAC9B,uCAAuC;IACvC,MAAM,EAAE,UAAU,CAAA;IAClB,2BAA2B;IAC3B,SAAS,EAAE,eAAe,CAAA;IAC1B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,8DAA8D;IAC9D,uBAAuB,EAAE,oBAAoB,EAAE,CAAA;CAChD,KAAG,aAAa,CAAC;IAChB,UAAU,EAAE,eAAe,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;CACtB,CAwFA,CAAA"}
1
+ {"version":3,"file":"build-request.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAKnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACtH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAI5F,OAAO,EAAU,KAAK,aAAa,EAAkB,MAAM,eAAe,CAAA;AAO1E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,iHAU1B;IACD,8CAA8C;IAC9C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,aAAa,EAAE,aAAa,EAAE,CAAA;IAC9B,uCAAuC;IACvC,MAAM,EAAE,UAAU,CAAA;IAClB,2BAA2B;IAC3B,SAAS,EAAE,eAAe,CAAA;IAC1B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,8DAA8D;IAC9D,uBAAuB,EAAE,oBAAoB,EAAE,CAAA;CAChD,KAAG,aAAa,CAAC;IAChB,UAAU,EAAE,eAAe,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;CACtB,CA6FA,CAAA"}
@@ -1,49 +1,54 @@
1
- import { replaceVariables as U } from "@scalar/helpers/regex/replace-variables";
1
+ import { replaceVariables as P } from "@scalar/helpers/regex/replace-variables";
2
2
  import { mergeUrls as L } from "@scalar/helpers/url/merge-urls";
3
3
  import { shouldUseProxy as x, redirectToProxy as I } from "@scalar/oas-utils/helpers";
4
4
  import { getResolvedRef as T } from "@scalar/workspace-store/helpers/get-resolved-ref";
5
5
  import { objectEntries as V } from "@vueuse/core";
6
- import { isElectron as k } from "../../../../libs/electron.js";
7
- import { ERRORS as q, normalizeError as _ } from "../../../../libs/errors.js";
6
+ import { isElectron as h } from "../../../../libs/electron.js";
7
+ import { ERRORS as k, normalizeError as _ } from "../../../../libs/errors.js";
8
8
  import { buildRequestBody as D } from "./build-request-body.js";
9
9
  import { buildRequestCookieHeader as j } from "./build-request-cookie-header.js";
10
10
  import { buildRequestParameters as z } from "./build-request-parameters.js";
11
11
  import { buildRequestSecurity as F } from "./build-request-security.js";
12
12
  const K = ({
13
- environment: y,
13
+ environment: q,
14
14
  exampleKey: u = "default",
15
- globalCookies: h,
15
+ globalCookies: y,
16
16
  method: v,
17
17
  operation: m,
18
18
  path: a,
19
19
  proxyUrl: c,
20
20
  server: d,
21
- selectedSecuritySchemes: E
21
+ selectedSecuritySchemes: C
22
22
  }) => {
23
23
  try {
24
- const e = y.variables.reduce(
24
+ const e = q.variables.reduce(
25
25
  (t, o) => (t[o.name] = typeof o.value == "string" ? o.value : o.value.default, t),
26
26
  {}
27
- ), C = V(d?.variables ?? {}).reduce(
28
- (t, [o, P]) => (P.default && (t[o] = P.default), t),
27
+ ), E = V(d?.variables ?? {}).reduce(
28
+ (t, [o, U]) => (U.default && (t[o] = U.default), t),
29
29
  {}
30
- ), i = U(d?.url ?? "", { ...e, ...C }), A = T(m.requestBody);
30
+ ), i = P(d?.url ?? "", { ...e, ...E }), A = T(m.requestBody);
31
31
  if (!i && !a)
32
- throw q.URL_EMPTY;
33
- const s = z(m.parameters ?? [], e, u), H = D(A, e, u), n = F(E, e), r = { ...s.headers, ...n.headers }, S = new URLSearchParams([...s.urlParams, ...n.urlParams]), f = U(a, { ...e, ...s.pathVariables }), p = L(i, f, S), R = x(c, p), w = I(c, p), b = r["User-Agent"] || r["user-agent"];
34
- k() && b && (r["X-Scalar-User-Agent"] = b);
32
+ throw k.URL_EMPTY;
33
+ const s = z(m.parameters ?? [], e, u), H = D(A, e, u), n = F(C, e), r = { ...s.headers, ...n.headers }, S = new URLSearchParams([...s.urlParams, ...n.urlParams]), f = P(a, { ...e, ...s.pathVariables }), p = L(i, f, S), R = x(c, p), w = I(c, p), b = r["User-Agent"] || r["user-agent"];
34
+ h() && b && (r["X-Scalar-User-Agent"] = b);
35
35
  const l = j({
36
36
  paramCookies: [...s.cookies, ...n.cookies],
37
- globalCookies: h,
37
+ globalCookies: y,
38
38
  env: e,
39
39
  path: f,
40
40
  originalCookieHeader: r.Cookie || r.cookie,
41
41
  url: i || a,
42
- useCustomCookieHeader: k() || R
42
+ useCustomCookieHeader: h() || R
43
43
  });
44
44
  l && (r[l.name] = l.value);
45
45
  const g = new AbortController(), B = new Request(w, {
46
- method: v,
46
+ /**
47
+ * Ensure that all methods are uppercased (though only needed for patch)
48
+ *
49
+ * @see https://github.com/whatwg/fetch/issues/50
50
+ */
51
+ method: v.toUpperCase(),
47
52
  headers: r,
48
53
  signal: g.signal,
49
54
  body: H
@@ -57,7 +62,7 @@ const K = ({
57
62
  }
58
63
  ];
59
64
  } catch (e) {
60
- return [_(e, q.BUILDING_REQUEST_FAILED), null];
65
+ return [_(e, k.BUILDING_REQUEST_FAILED), null];
61
66
  }
62
67
  };
63
68
  export {
@@ -13,8 +13,13 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
13
13
  id: string[];
14
14
  name: string;
15
15
  scopes: string[];
16
+ newScopePayload?: {
17
+ name: string;
18
+ description: string;
19
+ flowType: keyof OAuthFlowsObject;
20
+ };
16
21
  meta: import("@scalar/workspace-store/mutators").AuthMeta;
17
- }, "scopes">) => any;
22
+ }, "scopes" | "newScopePayload">) => any;
18
23
  "update:securityScheme": (payload: ({
19
24
  type: "http";
20
25
  } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").HttpObject, "type">>) | ({
@@ -39,7 +44,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
39
44
  [x: string]: string | undefined;
40
45
  } | undefined;
41
46
  'x-tokenName'?: string | undefined;
42
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
43
47
  authorizationUrl?: string | undefined;
44
48
  'x-scalar-secret-redirect-uri'?: string | undefined;
45
49
  } | undefined;
@@ -57,11 +61,11 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
57
61
  [x: string]: string | undefined;
58
62
  } | undefined;
59
63
  'x-tokenName'?: string | undefined;
60
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
61
64
  tokenUrl?: string | undefined;
62
65
  'x-scalar-secret-username'?: string | undefined;
63
66
  'x-scalar-secret-password'?: string | undefined;
64
67
  'x-scalar-secret-client-secret'?: string | undefined;
68
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
65
69
  } | undefined;
66
70
  clientCredentials?: {
67
71
  refreshUrl?: string | undefined;
@@ -77,9 +81,9 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
77
81
  [x: string]: string | undefined;
78
82
  } | undefined;
79
83
  'x-tokenName'?: string | undefined;
80
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
81
84
  tokenUrl?: string | undefined;
82
85
  'x-scalar-secret-client-secret'?: string | undefined;
86
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
83
87
  } | undefined;
84
88
  authorizationCode?: {
85
89
  refreshUrl?: string | undefined;
@@ -95,12 +99,12 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
95
99
  [x: string]: string | undefined;
96
100
  } | undefined;
97
101
  'x-tokenName'?: string | undefined;
98
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
99
102
  authorizationUrl?: string | undefined;
100
103
  tokenUrl?: string | undefined;
101
104
  'x-scalar-secret-client-secret'?: string | undefined;
102
105
  'x-scalar-secret-redirect-uri'?: string | undefined;
103
106
  'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
107
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
104
108
  } | undefined;
105
109
  } | undefined;
106
110
  })) => any;
@@ -109,8 +113,13 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
109
113
  id: string[];
110
114
  name: string;
111
115
  scopes: string[];
116
+ newScopePayload?: {
117
+ name: string;
118
+ description: string;
119
+ flowType: keyof OAuthFlowsObject;
120
+ };
112
121
  meta: import("@scalar/workspace-store/mutators").AuthMeta;
113
- }, "scopes">) => any) | undefined;
122
+ }, "scopes" | "newScopePayload">) => any) | undefined;
114
123
  "onUpdate:securityScheme"?: ((payload: ({
115
124
  type: "http";
116
125
  } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").HttpObject, "type">>) | ({
@@ -135,7 +144,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
135
144
  [x: string]: string | undefined;
136
145
  } | undefined;
137
146
  'x-tokenName'?: string | undefined;
138
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
139
147
  authorizationUrl?: string | undefined;
140
148
  'x-scalar-secret-redirect-uri'?: string | undefined;
141
149
  } | undefined;
@@ -153,11 +161,11 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
153
161
  [x: string]: string | undefined;
154
162
  } | undefined;
155
163
  'x-tokenName'?: string | undefined;
156
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
157
164
  tokenUrl?: string | undefined;
158
165
  'x-scalar-secret-username'?: string | undefined;
159
166
  'x-scalar-secret-password'?: string | undefined;
160
167
  'x-scalar-secret-client-secret'?: string | undefined;
168
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
161
169
  } | undefined;
162
170
  clientCredentials?: {
163
171
  refreshUrl?: string | undefined;
@@ -173,9 +181,9 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
173
181
  [x: string]: string | undefined;
174
182
  } | undefined;
175
183
  'x-tokenName'?: string | undefined;
176
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
177
184
  tokenUrl?: string | undefined;
178
185
  'x-scalar-secret-client-secret'?: string | undefined;
186
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
179
187
  } | undefined;
180
188
  authorizationCode?: {
181
189
  refreshUrl?: string | undefined;
@@ -191,12 +199,12 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
191
199
  [x: string]: string | undefined;
192
200
  } | undefined;
193
201
  'x-tokenName'?: string | undefined;
194
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
195
202
  authorizationUrl?: string | undefined;
196
203
  tokenUrl?: string | undefined;
197
204
  'x-scalar-secret-client-secret'?: string | undefined;
198
205
  'x-scalar-secret-redirect-uri'?: string | undefined;
199
206
  'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
207
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
200
208
  } | undefined;
201
209
  } | undefined;
202
210
  })) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AA4QA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAEV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,MAAM,gBAAgB,CAAA;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwiBJ,wBAOG"}
1
+ {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AAgUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAQnH,OAAO,KAAK,EAEV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,KAAK,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,MAAM,gBAAgB,CAAA;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgnBF,wBAOG"}
@@ -1,12 +1,12 @@
1
- import { defineComponent as z, computed as C, watch as T, createElementBlock as k, openBlock as i, Fragment as V, createVNode as o, unref as a, withCtx as t, createTextVNode as u, createElementVNode as x, createBlock as v, createCommentVNode as f } from "vue";
2
- import { useLoadingState as b, ScalarButton as w } from "@scalar/components";
3
- import { pkceOptions as B } from "@scalar/oas-utils/entities/spec";
4
- import { useToasts as P } from "@scalar/use-toasts";
5
- import R from "./OAuthScopesInput.vue.js";
6
- import { authorizeOauth2 as F } from "../helpers/oauth.js";
7
- import m from "./RequestAuthDataTableInput.vue.js";
8
- import d from "../../../../components/DataTable/DataTableRow.vue.js";
9
- const O = { class: "flex h-8 items-center justify-end gap-2 border-t" }, A = { class: "flex h-8 w-full items-center justify-end border-t" }, $ = /* @__PURE__ */ z({
1
+ import { defineComponent as b, computed as x, watch as B, createElementBlock as y, openBlock as m, Fragment as V, createVNode as a, unref as o, withCtx as l, createTextVNode as d, createElementVNode as U, createBlock as f, createCommentVNode as v } from "vue";
2
+ import { useLoadingState as L, ScalarButton as S } from "@scalar/components";
3
+ import { pkceOptions as P } from "@scalar/oas-utils/entities/spec";
4
+ import { useToasts as R } from "@scalar/use-toasts";
5
+ import F from "./OAuthScopesInput.vue.js";
6
+ import { authorizeOauth2 as O } from "../helpers/oauth.js";
7
+ import i from "./RequestAuthDataTableInput.vue.js";
8
+ import u from "../../../../components/DataTable/DataTableRow.vue.js";
9
+ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { class: "flex h-8 w-full items-center justify-end border-t" }, K = /* @__PURE__ */ b({
10
10
  __name: "OAuth2",
11
11
  props: {
12
12
  environment: {},
@@ -17,66 +17,70 @@ const O = { class: "flex h-8 items-center justify-end gap-2 border-t" }, A = { c
17
17
  proxyUrl: {}
18
18
  },
19
19
  emits: ["update:securityScheme", "update:selectedScopes"],
20
- setup(p, { emit: U }) {
21
- const y = U, c = b(), { toast: S } = P(), l = C(() => p.flows[p.type]), s = (n) => y("update:securityScheme", {
20
+ setup(p, { emit: g }) {
21
+ const k = g, c = L(), { toast: C } = R(), r = x(() => p.flows[p.type]), w = x(
22
+ () => p.selectedScopes.filter((t) => t in (r.value.scopes ?? {}))
23
+ ), s = (t) => k("update:securityScheme", {
22
24
  type: "oauth2",
23
25
  flows: {
24
- [p.type]: n
26
+ [p.type]: t
25
27
  }
26
28
  });
27
- T(
28
- () => l.value["x-scalar-secret-redirect-uri"],
29
- (n) => {
30
- n || typeof window > "u" || s({
29
+ B(
30
+ () => r.value["x-scalar-secret-redirect-uri"],
31
+ (t) => {
32
+ t || typeof window > "u" || !("x-scalar-secret-redirect-uri" in r.value) || s({
31
33
  "x-scalar-secret-redirect-uri": window.location.origin + window.location.pathname
32
34
  });
33
35
  },
34
36
  { immediate: !0 }
35
37
  );
36
- const g = async () => {
38
+ const T = async () => {
37
39
  if (c.isLoading)
38
40
  return;
39
41
  c.start();
40
- const [n, e] = await F(
42
+ const [t, e] = await O(
41
43
  p.flows,
42
44
  p.type,
43
- p.selectedScopes,
45
+ w.value,
44
46
  p.server,
45
47
  p.proxyUrl
46
48
  );
47
- await c.clear(), e ? s({ "x-scalar-secret-token": e }) : (console.error(n), S(n?.message ?? "Failed to authorize", "error"));
48
- };
49
- return (n, e) => l.value["x-scalar-secret-token"] ? (i(), k(V, { key: 0 }, [
50
- o(a(d), null, {
51
- default: t(() => [
52
- o(m, {
49
+ await c.clear(), e ? s({ "x-scalar-secret-token": e }) : (console.error(t), C(t?.message ?? "Failed to authorize", "error"));
50
+ }, z = (t) => s({
51
+ "x-scalar-credentials-location": t === "body" ? "body" : "header"
52
+ });
53
+ return (t, e) => r.value["x-scalar-secret-token"] ? (m(), y(V, { key: 0 }, [
54
+ a(o(u), null, {
55
+ default: l(() => [
56
+ a(i, {
53
57
  class: "border-r-transparent",
54
- environment: n.environment,
55
- modelValue: l.value["x-scalar-secret-token"],
58
+ environment: t.environment,
59
+ modelValue: r.value["x-scalar-secret-token"],
56
60
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
57
61
  type: "password",
58
- "onUpdate:modelValue": e[0] || (e[0] = (r) => s({ "x-scalar-secret-token": r }))
62
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => s({ "x-scalar-secret-token": n }))
59
63
  }, {
60
- default: t(() => [...e[11] || (e[11] = [
61
- u(" Access Token ", -1)
64
+ default: l(() => [...e[12] || (e[12] = [
65
+ d(" Access Token ", -1)
62
66
  ])]),
63
67
  _: 1
64
68
  }, 8, ["environment", "modelValue"])
65
69
  ]),
66
70
  _: 1
67
71
  }),
68
- o(a(d), { class: "min-w-full" }, {
69
- default: t(() => [
70
- x("div", O, [
71
- o(a(w), {
72
+ a(o(u), { class: "min-w-full" }, {
73
+ default: l(() => [
74
+ U("div", A, [
75
+ a(o(S), {
72
76
  class: "mr-1 p-0 px-2 py-0.5",
73
- loader: a(c),
77
+ loader: o(c),
74
78
  size: "sm",
75
79
  variant: "outlined",
76
80
  onClick: e[1] || (e[1] = () => s({ "x-scalar-secret-token": "" }))
77
81
  }, {
78
- default: t(() => [...e[12] || (e[12] = [
79
- u(" Clear ", -1)
82
+ default: l(() => [...e[13] || (e[13] = [
83
+ d(" Clear ", -1)
80
84
  ])]),
81
85
  _: 1
82
86
  }, 8, ["loader"])
@@ -84,163 +88,182 @@ const O = { class: "flex h-8 items-center justify-end gap-2 border-t" }, A = { c
84
88
  ]),
85
89
  _: 1
86
90
  })
87
- ], 64)) : (i(), k(V, { key: 1 }, [
88
- o(a(d), null, {
89
- default: t(() => [
90
- "authorizationUrl" in l.value ? (i(), v(m, {
91
+ ], 64)) : (m(), y(V, { key: 1 }, [
92
+ a(o(u), null, {
93
+ default: l(() => [
94
+ "authorizationUrl" in r.value ? (m(), f(i, {
91
95
  key: 0,
92
96
  containerClass: "border-r-0",
93
- environment: n.environment,
94
- modelValue: l.value.authorizationUrl,
97
+ environment: t.environment,
98
+ modelValue: r.value.authorizationUrl,
95
99
  placeholder: "https://galaxy.scalar.com/authorize",
96
- "onUpdate:modelValue": e[2] || (e[2] = (r) => s({ authorizationUrl: r }))
100
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => s({ authorizationUrl: n }))
97
101
  }, {
98
- default: t(() => [...e[13] || (e[13] = [
99
- u(" Auth URL ", -1)
102
+ default: l(() => [...e[14] || (e[14] = [
103
+ d(" Auth URL ", -1)
100
104
  ])]),
101
105
  _: 1
102
- }, 8, ["environment", "modelValue"])) : f("", !0),
103
- "tokenUrl" in l.value ? (i(), v(m, {
106
+ }, 8, ["environment", "modelValue"])) : v("", !0),
107
+ "tokenUrl" in r.value ? (m(), f(i, {
104
108
  key: 1,
105
- environment: n.environment,
106
- modelValue: l.value.tokenUrl,
109
+ environment: t.environment,
110
+ modelValue: r.value.tokenUrl,
107
111
  placeholder: "https://galaxy.scalar.com/token",
108
- "onUpdate:modelValue": e[3] || (e[3] = (r) => s({ tokenUrl: r }))
112
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => s({ tokenUrl: n }))
109
113
  }, {
110
- default: t(() => [...e[14] || (e[14] = [
111
- u(" Token URL ", -1)
114
+ default: l(() => [...e[15] || (e[15] = [
115
+ d(" Token URL ", -1)
112
116
  ])]),
113
117
  _: 1
114
- }, 8, ["environment", "modelValue"])) : f("", !0)
118
+ }, 8, ["environment", "modelValue"])) : v("", !0)
115
119
  ]),
116
120
  _: 1
117
121
  }),
118
- "x-scalar-secret-redirect-uri" in l.value ? (i(), v(a(d), { key: 0 }, {
119
- default: t(() => [
120
- o(m, {
121
- environment: n.environment,
122
- modelValue: l.value["x-scalar-secret-redirect-uri"],
122
+ "x-scalar-secret-redirect-uri" in r.value ? (m(), f(o(u), { key: 0 }, {
123
+ default: l(() => [
124
+ a(i, {
125
+ environment: t.environment,
126
+ modelValue: r.value["x-scalar-secret-redirect-uri"],
123
127
  placeholder: "https://galaxy.scalar.com/callback",
124
- "onUpdate:modelValue": e[4] || (e[4] = (r) => s({ "x-scalar-secret-redirect-uri": r }))
128
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => s({ "x-scalar-secret-redirect-uri": n }))
125
129
  }, {
126
- default: t(() => [...e[15] || (e[15] = [
127
- u(" Redirect URL ", -1)
130
+ default: l(() => [...e[16] || (e[16] = [
131
+ d(" Redirect URL ", -1)
128
132
  ])]),
129
133
  _: 1
130
134
  }, 8, ["environment", "modelValue"])
131
135
  ]),
132
136
  _: 1
133
- })) : f("", !0),
134
- "x-scalar-secret-username" in l.value && "x-scalar-secret-password" in l.value ? (i(), k(V, { key: 1 }, [
135
- o(a(d), null, {
136
- default: t(() => [
137
- o(m, {
137
+ })) : v("", !0),
138
+ "x-scalar-secret-username" in r.value && "x-scalar-secret-password" in r.value ? (m(), y(V, { key: 1 }, [
139
+ a(o(u), null, {
140
+ default: l(() => [
141
+ a(i, {
138
142
  class: "text-c-2",
139
- environment: n.environment,
140
- modelValue: l.value["x-scalar-secret-username"],
143
+ environment: t.environment,
144
+ modelValue: r.value["x-scalar-secret-username"],
141
145
  placeholder: "janedoe",
142
- "onUpdate:modelValue": e[5] || (e[5] = (r) => s({ "x-scalar-secret-username": r }))
146
+ "onUpdate:modelValue": e[5] || (e[5] = (n) => s({ "x-scalar-secret-username": n }))
143
147
  }, {
144
- default: t(() => [...e[16] || (e[16] = [
145
- u(" Username ", -1)
148
+ default: l(() => [...e[17] || (e[17] = [
149
+ d(" Username ", -1)
146
150
  ])]),
147
151
  _: 1
148
152
  }, 8, ["environment", "modelValue"])
149
153
  ]),
150
154
  _: 1
151
155
  }),
152
- o(a(d), null, {
153
- default: t(() => [
154
- o(m, {
155
- environment: n.environment,
156
- modelValue: l.value["x-scalar-secret-password"],
156
+ a(o(u), null, {
157
+ default: l(() => [
158
+ a(i, {
159
+ environment: t.environment,
160
+ modelValue: r.value["x-scalar-secret-password"],
157
161
  placeholder: "********",
158
162
  type: "password",
159
- "onUpdate:modelValue": e[6] || (e[6] = (r) => s({ "x-scalar-secret-password": r }))
163
+ "onUpdate:modelValue": e[6] || (e[6] = (n) => s({ "x-scalar-secret-password": n }))
160
164
  }, {
161
- default: t(() => [...e[17] || (e[17] = [
162
- u(" Password ", -1)
165
+ default: l(() => [...e[18] || (e[18] = [
166
+ d(" Password ", -1)
163
167
  ])]),
164
168
  _: 1
165
169
  }, 8, ["environment", "modelValue"])
166
170
  ]),
167
171
  _: 1
168
172
  })
169
- ], 64)) : f("", !0),
170
- o(a(d), null, {
171
- default: t(() => [
172
- o(m, {
173
- environment: n.environment,
174
- modelValue: l.value["x-scalar-secret-client-id"],
173
+ ], 64)) : v("", !0),
174
+ a(o(u), null, {
175
+ default: l(() => [
176
+ a(i, {
177
+ environment: t.environment,
178
+ modelValue: r.value["x-scalar-secret-client-id"],
175
179
  placeholder: "12345",
176
- "onUpdate:modelValue": e[7] || (e[7] = (r) => s({ "x-scalar-secret-client-id": r }))
180
+ "onUpdate:modelValue": e[7] || (e[7] = (n) => s({ "x-scalar-secret-client-id": n }))
177
181
  }, {
178
- default: t(() => [...e[18] || (e[18] = [
179
- u(" Client ID ", -1)
182
+ default: l(() => [...e[19] || (e[19] = [
183
+ d(" Client ID ", -1)
180
184
  ])]),
181
185
  _: 1
182
186
  }, 8, ["environment", "modelValue"])
183
187
  ]),
184
188
  _: 1
185
189
  }),
186
- "x-scalar-secret-client-secret" in l.value ? (i(), v(a(d), { key: 2 }, {
187
- default: t(() => [
188
- o(m, {
189
- environment: n.environment,
190
- modelValue: l.value["x-scalar-secret-client-secret"],
190
+ "x-scalar-secret-client-secret" in r.value ? (m(), f(o(u), { key: 2 }, {
191
+ default: l(() => [
192
+ a(i, {
193
+ environment: t.environment,
194
+ modelValue: r.value["x-scalar-secret-client-secret"],
191
195
  placeholder: "XYZ123",
192
196
  type: "password",
193
- "onUpdate:modelValue": e[8] || (e[8] = (r) => s({ "x-scalar-secret-client-secret": r }))
197
+ "onUpdate:modelValue": e[8] || (e[8] = (n) => s({ "x-scalar-secret-client-secret": n }))
194
198
  }, {
195
- default: t(() => [...e[19] || (e[19] = [
196
- u(" Client Secret ", -1)
199
+ default: l(() => [...e[20] || (e[20] = [
200
+ d(" Client Secret ", -1)
197
201
  ])]),
198
202
  _: 1
199
203
  }, 8, ["environment", "modelValue"])
200
204
  ]),
201
205
  _: 1
202
- })) : f("", !0),
203
- "x-usePkce" in l.value ? (i(), v(a(d), { key: 3 }, {
204
- default: t(() => [
205
- o(m, {
206
- enum: a(B),
207
- environment: n.environment,
208
- modelValue: l.value["x-usePkce"],
206
+ })) : v("", !0),
207
+ "x-usePkce" in r.value ? (m(), f(o(u), { key: 3 }, {
208
+ default: l(() => [
209
+ a(i, {
210
+ enum: o(P),
211
+ environment: t.environment,
212
+ modelValue: r.value["x-usePkce"],
209
213
  readOnly: "",
210
- "onUpdate:modelValue": e[9] || (e[9] = (r) => s({
211
- "x-usePkce": r
214
+ "onUpdate:modelValue": e[9] || (e[9] = (n) => s({
215
+ "x-usePkce": n
212
216
  }))
213
217
  }, {
214
- default: t(() => [...e[20] || (e[20] = [
215
- u(" Use PKCE ", -1)
218
+ default: l(() => [...e[21] || (e[21] = [
219
+ d(" Use PKCE ", -1)
216
220
  ])]),
217
221
  _: 1
218
222
  }, 8, ["enum", "environment", "modelValue"])
219
223
  ]),
220
224
  _: 1
221
- })) : f("", !0),
222
- Object.keys(l.value.scopes ?? {}).length ? (i(), v(a(d), { key: 4 }, {
223
- default: t(() => [
224
- o(R, {
225
- flow: l.value,
226
- selectedScopes: n.selectedScopes,
227
- "onUpdate:selectedScopes": e[10] || (e[10] = (r) => y("update:selectedScopes", r))
228
- }, null, 8, ["flow", "selectedScopes"])
225
+ })) : v("", !0),
226
+ t.type !== "implicit" ? (m(), f(o(u), { key: 4 }, {
227
+ default: l(() => [
228
+ a(i, {
229
+ enum: ["header", "body"],
230
+ environment: t.environment,
231
+ modelValue: r.value["x-scalar-credentials-location"] || "header",
232
+ placeholder: "header",
233
+ readOnly: "",
234
+ "onUpdate:modelValue": e[10] || (e[10] = (n) => z(n))
235
+ }, {
236
+ default: l(() => [...e[22] || (e[22] = [
237
+ d(" Credentials Location ", -1)
238
+ ])]),
239
+ _: 1
240
+ }, 8, ["environment", "modelValue"])
241
+ ]),
242
+ _: 1
243
+ })) : v("", !0),
244
+ a(o(u), null, {
245
+ default: l(() => [
246
+ a(F, {
247
+ flow: r.value,
248
+ flowType: t.type,
249
+ selectedScopes: w.value,
250
+ "onUpdate:selectedScopes": e[11] || (e[11] = (n) => k("update:selectedScopes", n))
251
+ }, null, 8, ["flow", "flowType", "selectedScopes"])
229
252
  ]),
230
253
  _: 1
231
- })) : f("", !0),
232
- o(a(d), { class: "min-w-full" }, {
233
- default: t(() => [
234
- x("div", A, [
235
- o(a(w), {
254
+ }),
255
+ a(o(u), { class: "min-w-full" }, {
256
+ default: l(() => [
257
+ U("div", I, [
258
+ a(o(S), {
236
259
  class: "mr-0.75 p-0 px-2 py-0.5",
237
- loader: a(c),
260
+ loader: o(c),
238
261
  size: "sm",
239
262
  variant: "outlined",
240
- onClick: g
263
+ onClick: T
241
264
  }, {
242
- default: t(() => [...e[21] || (e[21] = [
243
- u(" Authorize ", -1)
265
+ default: l(() => [...e[23] || (e[23] = [
266
+ d(" Authorize ", -1)
244
267
  ])]),
245
268
  _: 1
246
269
  }, 8, ["loader"])
@@ -252,5 +275,5 @@ const O = { class: "flex h-8 items-center justify-end gap-2 border-t" }, A = { c
252
275
  }
253
276
  });
254
277
  export {
255
- $ as default
278
+ K as default
256
279
  };
@@ -0,0 +1,20 @@
1
+ import { type ModalState } from '@scalar/components';
2
+ type __VLS_Props = {
3
+ state: ModalState;
4
+ scopes: string[];
5
+ };
6
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
+ submit: (scopeData: {
8
+ name: string;
9
+ description: string;
10
+ }) => any;
11
+ cancel: () => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onSubmit?: ((scopeData: {
14
+ name: string;
15
+ description: string;
16
+ }) => any) | undefined;
17
+ onCancel?: (() => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ export default _default;
20
+ //# sourceMappingURL=OAuthScopesAddModal.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OAuthScopesAddModal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue"],"names":[],"mappings":"AAoGA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAOjE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,UAAU,CAAA;IACjB,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB,CAAC;;;cAQU,MAAM;qBACC,MAAM;;;;;cADb,MAAM;qBACC,MAAM;;;;AAiKzB,wBAOG"}