@scalar/api-client 2.10.0 → 2.11.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 (156) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -1
  3. package/dist/components/ImportCollection/IntegrationLogo.vue.js +1 -0
  4. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
  5. package/dist/components/Server/ServerVariablesForm.vue.js +6 -6
  6. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  7. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
  8. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +14 -13
  9. package/dist/hooks/useClientConfig.d.ts +3 -3
  10. package/dist/layouts/App/create-api-client-app.d.ts +1 -1
  11. package/dist/layouts/Web/create-api-client-web.d.ts +1 -1
  12. package/dist/libs/create-client.d.ts +1 -1
  13. package/dist/store/store.d.ts +1 -1
  14. package/dist/style.css +1 -1
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -6
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +24 -27
  18. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +3 -6
  19. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  20. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  21. package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -12
  22. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +11 -10
  24. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -5
  25. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  26. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  27. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +45 -47
  28. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +11 -9
  29. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +179 -5
  31. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +2 -179
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +201 -198
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +11 -6
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +82 -5
  36. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +2 -85
  37. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +3 -13
  38. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +16 -18
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +133 -142
  41. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  42. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  43. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -1
  44. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts +2 -16
  45. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts.map +1 -1
  46. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.js +2 -2
  47. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue2.js +202 -229
  48. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts +3 -5
  49. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts.map +1 -1
  50. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.js +2 -2
  51. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue2.js +81 -85
  52. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts +2 -5
  53. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts.map +1 -1
  54. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.js +32 -34
  55. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts +2 -5
  56. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts.map +1 -1
  57. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.js +2 -2
  58. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue2.js +31 -33
  59. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts +2 -5
  60. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts.map +1 -1
  61. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.js +42 -45
  62. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts +2 -2
  63. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts.map +1 -1
  64. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.js +9 -9
  65. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.d.ts.map +1 -1
  66. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.js +2 -2
  67. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue2.js +18 -18
  68. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  69. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.js +14 -14
  70. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
  71. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.js +12 -12
  72. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.d.ts.map +1 -1
  73. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.js +13 -13
  74. package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -1
  75. package/dist/v2/components/data-table/DataTable.vue.js +4 -4
  76. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +5 -7
  77. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  78. package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
  79. package/dist/v2/components/data-table/DataTableInput.vue2.js +32 -36
  80. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +25 -0
  81. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -0
  82. package/dist/v2/components/forms/ConfirmationForm.vue.js +7 -0
  83. package/dist/v2/components/forms/ConfirmationForm.vue2.js +45 -0
  84. package/dist/v2/components/forms/index.d.ts +2 -0
  85. package/dist/v2/components/forms/index.d.ts.map +1 -0
  86. package/dist/v2/components/forms/index.js +4 -0
  87. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts +43 -0
  88. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -0
  89. package/dist/v2/components/layout/CollapsibleSection.vue.js +89 -0
  90. package/dist/v2/components/layout/CollapsibleSection.vue2.js +4 -0
  91. package/dist/v2/components/layout/ValueEmitter.vue.d.ts +23 -0
  92. package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -0
  93. package/dist/v2/components/layout/ValueEmitter.vue.js +21 -0
  94. package/dist/v2/components/layout/ValueEmitter.vue2.js +4 -0
  95. package/dist/v2/components/layout/index.d.ts +2 -0
  96. package/dist/v2/components/layout/index.d.ts.map +1 -0
  97. package/dist/v2/components/layout/index.js +4 -0
  98. package/dist/v2/components/modals/DeleteModal.vue.d.ts +15 -0
  99. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -0
  100. package/dist/v2/components/modals/DeleteModal.vue.js +31 -0
  101. package/dist/v2/components/modals/DeleteModal.vue2.js +4 -0
  102. package/dist/v2/components/modals/index.d.ts +2 -0
  103. package/dist/v2/components/modals/index.d.ts.map +1 -0
  104. package/dist/v2/components/modals/index.js +4 -0
  105. package/dist/v2/components/server/ServerDropdown.vue.d.ts +4 -2
  106. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  107. package/dist/v2/components/server/ServerDropdown.vue.js +31 -31
  108. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts +2 -6
  109. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
  110. package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
  111. package/dist/v2/components/server/ServerDropdownItem.vue2.js +16 -16
  112. package/dist/v2/components/server/index.d.ts.map +1 -1
  113. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +6 -2
  114. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  115. package/dist/v2/components/sidebar/Sidebar.vue.js +45 -55
  116. package/dist/v2/features/app/App.vue.d.ts +2 -2
  117. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  118. package/dist/v2/features/app/App.vue.js +89 -74
  119. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -2
  120. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  121. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  122. package/dist/v2/features/app/components/AppSidebar.vue2.js +50 -47
  123. package/dist/v2/features/app/helpers/routes.d.ts +0 -10
  124. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  125. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  126. package/dist/v2/features/collection/DocumentCollection.vue2.js +75 -73
  127. package/dist/v2/features/collection/components/Authentication.vue.d.ts +13 -25
  128. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  129. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  130. package/dist/v2/features/collection/components/Authentication.vue2.js +47 -35
  131. package/dist/v2/features/collection/components/Form.vue.d.ts +3 -7
  132. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  133. package/dist/v2/features/collection/components/Form.vue.js +28 -33
  134. package/dist/v2/features/collection/components/Servers.vue.d.ts +13 -31
  135. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  136. package/dist/v2/features/collection/components/Servers.vue2.js +103 -82
  137. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  138. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +3 -3
  139. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  140. package/dist/v2/features/modal/Modal.vue.js +3 -3
  141. package/dist/v2/features/modal/Modal.vue2.js +40 -32
  142. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  143. package/dist/v2/features/operation/Operation.vue.js +22 -28
  144. package/dist/v2/hooks/use-sidebar-state.d.ts +47 -0
  145. package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -0
  146. package/dist/v2/hooks/use-sidebar-state.js +112 -0
  147. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  148. package/dist/v2/hooks/use-workspace-client-events.js +75 -107
  149. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  150. package/package.json +17 -17
  151. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +0 -45
  152. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +0 -1
  153. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +0 -29
  154. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +0 -1
  155. package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts +0 -29
  156. package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts.map +0 -1
@@ -1,240 +1,243 @@
1
- import { defineComponent as C, computed as T, createElementBlock as v, openBlock as u, Fragment as x, createBlock as y, createCommentVNode as f, createVNode as r, unref as o, withCtx as l, mergeProps as p, createTextVNode as d, createElementVNode as S } from "vue";
2
- import { useLoadingState as z, ScalarButton as g } from "@scalar/components";
3
- import { pkceOptions as P } from "@scalar/oas-utils/entities/spec";
4
- import { useToasts as I } from "@scalar/use-toasts";
1
+ import { defineComponent as z, computed as C, createElementBlock as k, openBlock as i, Fragment as V, createVNode as o, unref as r, withCtx as l, createTextVNode as u, createElementVNode as x, createBlock as v, createCommentVNode as f } from "vue";
2
+ import { useLoadingState as T, ScalarButton as U } from "@scalar/components";
3
+ import { pkceOptions as b } from "@scalar/oas-utils/entities/spec";
4
+ import { useToasts as B } from "@scalar/use-toasts";
5
5
  import L from "./OAuthScopesInput.vue.js";
6
- import { authorizeOauth2 as R } from "../helpers/oauth.js";
7
- import c from "./RequestAuthDataTableInput.vue.js";
8
- import n from "../../../../components/DataTable/DataTableRow.vue.js";
9
- const B = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { class: "flex h-8 w-full items-center justify-end border-t" }, M = /* @__PURE__ */ C({
6
+ import { authorizeOauth2 as P } from "../helpers/oauth.js";
7
+ import m from "./RequestAuthDataTableInput.vue.js";
8
+ import d from "../../../../components/DataTable/DataTableRow.vue.js";
9
+ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { class: "flex h-8 w-full items-center justify-end border-t" }, M = /* @__PURE__ */ z({
10
10
  __name: "OAuth2",
11
11
  props: {
12
12
  environment: {},
13
- envVariables: {},
14
13
  flows: {},
15
14
  type: {},
16
15
  selectedScopes: {},
17
16
  server: {},
18
17
  proxyUrl: {}
19
18
  },
20
- emits: ["update:selectedScopes", "update:securityScheme"],
21
- setup(i, { emit: w }) {
22
- const s = w, V = z(), { toast: U } = I(), b = async () => {
23
- if (V.isLoading)
24
- return;
25
- if (!i.server) {
26
- U("No server selected", "error");
27
- return;
19
+ emits: ["update:securityScheme", "update:selectedScopes"],
20
+ setup(p, { emit: w }) {
21
+ const y = w, c = T(), { toast: g } = B(), t = C(() => p.flows[p.type]), s = (a) => y("update:securityScheme", {
22
+ type: "oauth2",
23
+ flows: {
24
+ [p.type]: a
28
25
  }
29
- V.startLoading();
30
- const [k, e] = await R(
31
- i.flows,
32
- i.type,
33
- i.selectedScopes,
34
- i.server,
35
- i.proxyUrl
36
- ).finally(() => V.stopLoading());
37
- e ? s("update:securityScheme", { token: e }) : (console.error(k), U(k?.message ?? "Failed to authorize", "error"));
38
- }, m = {
39
- environment: i.environment,
40
- envVariables: i.envVariables
41
- }, t = T(() => i.flows[i.type]);
42
- return (k, e) => (u(), v(x, null, [
43
- t.value["x-scalar-secret-token"] ? (u(), v(x, { key: 0 }, [
44
- r(o(n), null, {
45
- default: l(() => [
46
- r(c, p(m, {
47
- class: "border-r-transparent",
48
- modelValue: t.value["x-scalar-secret-token"],
49
- placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
50
- type: "password",
51
- "onUpdate:modelValue": e[0] || (e[0] = (a) => s("update:securityScheme", { token: a }))
52
- }), {
53
- default: l(() => [...e[11] || (e[11] = [
54
- d(" Access Token ", -1)
55
- ])]),
56
- _: 1
57
- }, 16, ["modelValue"])
58
- ]),
59
- _: 1
60
- }),
61
- r(o(n), { class: "min-w-full" }, {
62
- default: l(() => [
63
- S("div", B, [
64
- r(o(g), {
65
- class: "mr-1 p-0 px-2 py-0.5",
66
- loading: o(V),
67
- size: "sm",
68
- variant: "outlined",
69
- onClick: e[1] || (e[1] = (a) => s("update:securityScheme", { token: "" }))
70
- }, {
71
- default: l(() => [...e[12] || (e[12] = [
72
- d(" Clear ", -1)
73
- ])]),
74
- _: 1
75
- }, 8, ["loading"])
76
- ])
77
- ]),
78
- _: 1
79
- })
80
- ], 64)) : (u(), v(x, { key: 1 }, [
81
- r(o(n), null, {
82
- default: l(() => [
83
- "authorizationUrl" in t.value ? (u(), y(c, p({ key: 0 }, m, {
84
- containerClass: "border-r-0",
85
- modelValue: t.value.authorizationUrl,
86
- placeholder: "https://galaxy.scalar.com/authorize",
87
- "onUpdate:modelValue": e[2] || (e[2] = (a) => s("update:securityScheme", { authUrl: a }))
88
- }), {
89
- default: l(() => [...e[13] || (e[13] = [
90
- d(" Auth URL ", -1)
91
- ])]),
92
- _: 1
93
- }, 16, ["modelValue"])) : f("", !0),
94
- "tokenUrl" in t.value ? (u(), y(c, p({ key: 1 }, m, {
95
- modelValue: t.value.tokenUrl,
96
- placeholder: "https://galaxy.scalar.com/token",
97
- "onUpdate:modelValue": e[3] || (e[3] = (a) => s("update:securityScheme", { tokenUrl: a }))
98
- }), {
99
- default: l(() => [...e[14] || (e[14] = [
100
- d(" Token URL ", -1)
101
- ])]),
102
- _: 1
103
- }, 16, ["modelValue"])) : f("", !0)
104
- ]),
105
- _: 1
106
- }),
107
- "x-scalar-secret-redirect-uri" in t.value ? (u(), y(o(n), { key: 0 }, {
108
- default: l(() => [
109
- r(c, p(m, {
110
- modelValue: t.value["x-scalar-secret-redirect-uri"],
111
- placeholder: "https://galaxy.scalar.com/callback",
112
- "onUpdate:modelValue": e[4] || (e[4] = (a) => s("update:securityScheme", { redirectUrl: a }))
113
- }), {
114
- default: l(() => [...e[15] || (e[15] = [
115
- d(" Redirect URL ", -1)
26
+ }), S = async () => {
27
+ if (c.isLoading)
28
+ return;
29
+ c.startLoading();
30
+ const [a, e] = await P(
31
+ p.flows,
32
+ p.type,
33
+ p.selectedScopes,
34
+ p.server,
35
+ p.proxyUrl
36
+ ).finally(() => c.stopLoading());
37
+ e ? s({ "x-scalar-secret-token": e }) : (console.error(a), g(a?.message ?? "Failed to authorize", "error"));
38
+ };
39
+ return (a, e) => t.value["x-scalar-secret-token"] ? (i(), k(V, { key: 0 }, [
40
+ o(r(d), null, {
41
+ default: l(() => [
42
+ o(m, {
43
+ class: "border-r-transparent",
44
+ environment: a.environment,
45
+ modelValue: t.value["x-scalar-secret-token"],
46
+ placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
47
+ type: "password",
48
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => s({ "x-scalar-secret-token": n }))
49
+ }, {
50
+ default: l(() => [...e[11] || (e[11] = [
51
+ u(" Access Token ", -1)
52
+ ])]),
53
+ _: 1
54
+ }, 8, ["environment", "modelValue"])
55
+ ]),
56
+ _: 1
57
+ }),
58
+ o(r(d), { class: "min-w-full" }, {
59
+ default: l(() => [
60
+ x("div", R, [
61
+ o(r(U), {
62
+ class: "mr-1 p-0 px-2 py-0.5",
63
+ loading: r(c),
64
+ size: "sm",
65
+ variant: "outlined",
66
+ onClick: e[1] || (e[1] = () => s({ "x-scalar-secret-token": "" }))
67
+ }, {
68
+ default: l(() => [...e[12] || (e[12] = [
69
+ u(" Clear ", -1)
116
70
  ])]),
117
71
  _: 1
118
- }, 16, ["modelValue"])
119
- ]),
120
- _: 1
121
- })) : f("", !0),
122
- "x-scalar-secret-username" in t.value && "x-scalar-secret-password" in t.value ? (u(), v(x, { key: 1 }, [
123
- r(o(n), null, {
124
- default: l(() => [
125
- r(c, p(m, {
126
- class: "text-c-2",
127
- modelValue: t.value["x-scalar-secret-username"],
128
- placeholder: "janedoe",
129
- "onUpdate:modelValue": e[5] || (e[5] = (a) => s("update:securityScheme", { username: a }))
130
- }), {
131
- default: l(() => [...e[16] || (e[16] = [
132
- d(" Username ", -1)
133
- ])]),
134
- _: 1
135
- }, 16, ["modelValue"])
136
- ]),
72
+ }, 8, ["loading"])
73
+ ])
74
+ ]),
75
+ _: 1
76
+ })
77
+ ], 64)) : (i(), k(V, { key: 1 }, [
78
+ o(r(d), null, {
79
+ default: l(() => [
80
+ "authorizationUrl" in t.value ? (i(), v(m, {
81
+ key: 0,
82
+ containerClass: "border-r-0",
83
+ environment: a.environment,
84
+ modelValue: t.value.authorizationUrl,
85
+ placeholder: "https://galaxy.scalar.com/authorize",
86
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => s({ authorizationUrl: n }))
87
+ }, {
88
+ default: l(() => [...e[13] || (e[13] = [
89
+ u(" Auth URL ", -1)
90
+ ])]),
137
91
  _: 1
138
- }),
139
- r(o(n), null, {
140
- default: l(() => [
141
- r(c, p(m, {
142
- modelValue: t.value["x-scalar-secret-password"],
143
- placeholder: "********",
144
- type: "password",
145
- "onUpdate:modelValue": e[6] || (e[6] = (a) => s("update:securityScheme", { password: a }))
146
- }), {
147
- default: l(() => [...e[17] || (e[17] = [
148
- d(" Password ", -1)
149
- ])]),
150
- _: 1
151
- }, 16, ["modelValue"])
152
- ]),
92
+ }, 8, ["environment", "modelValue"])) : f("", !0),
93
+ "tokenUrl" in t.value ? (i(), v(m, {
94
+ key: 1,
95
+ environment: a.environment,
96
+ modelValue: t.value.tokenUrl,
97
+ placeholder: "https://galaxy.scalar.com/token",
98
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => s({ tokenUrl: n }))
99
+ }, {
100
+ default: l(() => [...e[14] || (e[14] = [
101
+ u(" Token URL ", -1)
102
+ ])]),
153
103
  _: 1
154
- })
155
- ], 64)) : f("", !0),
156
- r(o(n), null, {
104
+ }, 8, ["environment", "modelValue"])) : f("", !0)
105
+ ]),
106
+ _: 1
107
+ }),
108
+ "x-scalar-secret-redirect-uri" in t.value ? (i(), v(r(d), { key: 0 }, {
109
+ default: l(() => [
110
+ o(m, {
111
+ environment: a.environment,
112
+ modelValue: t.value["x-scalar-secret-redirect-uri"],
113
+ placeholder: "https://galaxy.scalar.com/callback",
114
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => s({ "x-scalar-secret-redirect-uri": n }))
115
+ }, {
116
+ default: l(() => [...e[15] || (e[15] = [
117
+ u(" Redirect URL ", -1)
118
+ ])]),
119
+ _: 1
120
+ }, 8, ["environment", "modelValue"])
121
+ ]),
122
+ _: 1
123
+ })) : f("", !0),
124
+ "x-scalar-secret-username" in t.value && "x-scalar-secret-password" in t.value ? (i(), k(V, { key: 1 }, [
125
+ o(r(d), null, {
157
126
  default: l(() => [
158
- r(c, p(m, {
159
- modelValue: t.value["x-scalar-secret-client-id"],
160
- placeholder: "12345",
161
- "onUpdate:modelValue": e[7] || (e[7] = (a) => s("update:securityScheme", { clientId: a }))
162
- }), {
163
- default: l(() => [...e[18] || (e[18] = [
164
- d(" Client ID ", -1)
127
+ o(m, {
128
+ class: "text-c-2",
129
+ environment: a.environment,
130
+ modelValue: t.value["x-scalar-secret-username"],
131
+ placeholder: "janedoe",
132
+ "onUpdate:modelValue": e[5] || (e[5] = (n) => s({ "x-scalar-secret-username": n }))
133
+ }, {
134
+ default: l(() => [...e[16] || (e[16] = [
135
+ u(" Username ", -1)
165
136
  ])]),
166
137
  _: 1
167
- }, 16, ["modelValue"])
138
+ }, 8, ["environment", "modelValue"])
168
139
  ]),
169
140
  _: 1
170
141
  }),
171
- "x-scalar-secret-client-secret" in t.value ? (u(), y(o(n), { key: 2 }, {
142
+ o(r(d), null, {
172
143
  default: l(() => [
173
- r(c, p(m, {
174
- modelValue: t.value["x-scalar-secret-client-secret"],
175
- placeholder: "XYZ123",
144
+ o(m, {
145
+ environment: a.environment,
146
+ modelValue: t.value["x-scalar-secret-password"],
147
+ placeholder: "********",
176
148
  type: "password",
177
- "onUpdate:modelValue": e[8] || (e[8] = (a) => s("update:securityScheme", { clientSecret: a }))
178
- }), {
179
- default: l(() => [...e[19] || (e[19] = [
180
- d(" Client Secret ", -1)
181
- ])]),
182
- _: 1
183
- }, 16, ["modelValue"])
184
- ]),
185
- _: 1
186
- })) : f("", !0),
187
- "x-usePkce" in t.value ? (u(), y(o(n), { key: 3 }, {
188
- default: l(() => [
189
- r(c, p(m, {
190
- enum: o(P),
191
- modelValue: t.value["x-usePkce"],
192
- readOnly: "",
193
- "onUpdate:modelValue": e[9] || (e[9] = (a) => s("update:securityScheme", {
194
- usePkce: a
195
- }))
196
- }), {
197
- default: l(() => [...e[20] || (e[20] = [
198
- d(" Use PKCE ", -1)
149
+ "onUpdate:modelValue": e[6] || (e[6] = (n) => s({ "x-scalar-secret-password": n }))
150
+ }, {
151
+ default: l(() => [...e[17] || (e[17] = [
152
+ u(" Password ", -1)
199
153
  ])]),
200
154
  _: 1
201
- }, 16, ["enum", "modelValue"])
155
+ }, 8, ["environment", "modelValue"])
202
156
  ]),
203
157
  _: 1
204
- })) : f("", !0),
205
- Object.keys(t.value.scopes ?? {}).length ? (u(), y(o(n), { key: 4 }, {
206
- default: l(() => [
207
- r(L, {
208
- flow: t.value,
209
- selectedScopes: k.selectedScopes,
210
- "onUpdate:selectedScopes": e[10] || (e[10] = (a) => s("update:selectedScopes", a))
211
- }, null, 8, ["flow", "selectedScopes"])
212
- ]),
213
- _: 1
214
- })) : f("", !0)
215
- ], 64)),
216
- t.value["x-scalar-secret-token"] ? f("", !0) : (u(), y(o(n), {
217
- key: 2,
218
- class: "min-w-full"
219
- }, {
158
+ })
159
+ ], 64)) : f("", !0),
160
+ o(r(d), null, {
161
+ default: l(() => [
162
+ o(m, {
163
+ environment: a.environment,
164
+ modelValue: t.value["x-scalar-secret-client-id"],
165
+ placeholder: "12345",
166
+ "onUpdate:modelValue": e[7] || (e[7] = (n) => s({ "x-scalar-secret-client-id": n }))
167
+ }, {
168
+ default: l(() => [...e[18] || (e[18] = [
169
+ u(" Client ID ", -1)
170
+ ])]),
171
+ _: 1
172
+ }, 8, ["environment", "modelValue"])
173
+ ]),
174
+ _: 1
175
+ }),
176
+ "x-scalar-secret-client-secret" in t.value ? (i(), v(r(d), { key: 2 }, {
177
+ default: l(() => [
178
+ o(m, {
179
+ environment: a.environment,
180
+ modelValue: t.value["x-scalar-secret-client-secret"],
181
+ placeholder: "XYZ123",
182
+ type: "password",
183
+ "onUpdate:modelValue": e[8] || (e[8] = (n) => s({ "x-scalar-secret-client-secret": n }))
184
+ }, {
185
+ default: l(() => [...e[19] || (e[19] = [
186
+ u(" Client Secret ", -1)
187
+ ])]),
188
+ _: 1
189
+ }, 8, ["environment", "modelValue"])
190
+ ]),
191
+ _: 1
192
+ })) : f("", !0),
193
+ "x-usePkce" in t.value ? (i(), v(r(d), { key: 3 }, {
194
+ default: l(() => [
195
+ o(m, {
196
+ enum: r(b),
197
+ environment: a.environment,
198
+ modelValue: t.value["x-usePkce"],
199
+ readOnly: "",
200
+ "onUpdate:modelValue": e[9] || (e[9] = (n) => s({
201
+ "x-usePkce": n
202
+ }))
203
+ }, {
204
+ default: l(() => [...e[20] || (e[20] = [
205
+ u(" Use PKCE ", -1)
206
+ ])]),
207
+ _: 1
208
+ }, 8, ["enum", "environment", "modelValue"])
209
+ ]),
210
+ _: 1
211
+ })) : f("", !0),
212
+ Object.keys(t.value.scopes ?? {}).length ? (i(), v(r(d), { key: 4 }, {
213
+ default: l(() => [
214
+ o(L, {
215
+ flow: t.value,
216
+ selectedScopes: a.selectedScopes,
217
+ "onUpdate:selectedScopes": e[10] || (e[10] = (n) => y("update:selectedScopes", n))
218
+ }, null, 8, ["flow", "selectedScopes"])
219
+ ]),
220
+ _: 1
221
+ })) : f("", !0),
222
+ o(r(d), { class: "min-w-full" }, {
220
223
  default: l(() => [
221
- S("div", F, [
222
- r(o(g), {
224
+ x("div", F, [
225
+ o(r(U), {
223
226
  class: "mr-0.75 p-0 px-2 py-0.5",
224
- loading: o(V),
227
+ loading: r(c),
225
228
  size: "sm",
226
229
  variant: "outlined",
227
- onClick: b
230
+ onClick: S
228
231
  }, {
229
232
  default: l(() => [...e[21] || (e[21] = [
230
- d(" Authorize ", -1)
233
+ u(" Authorize ", -1)
231
234
  ])]),
232
235
  _: 1
233
236
  }, 8, ["loading"])
234
237
  ])
235
238
  ]),
236
239
  _: 1
237
- }))
240
+ })
238
241
  ], 64));
239
242
  }
240
243
  });
@@ -1,22 +1,27 @@
1
- import type { Environment } from '@scalar/oas-utils/entities/environment';
2
1
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
3
2
  import type { AuthMeta } from '@scalar/workspace-store/mutators';
3
+ import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
4
4
  import type { ComponentsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
5
- import type { EnvVariable } from '../../../../store/index.js';
6
5
  import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
7
6
  type __VLS_Props = {
8
- environment: Environment;
9
- envVariables: EnvVariable[];
10
- layout: 'client' | 'reference';
7
+ /** The current environment configuration */
8
+ environment: XScalarEnvironment;
9
+ /** Controls border display for static (non-collapsible) layouts */
10
+ isStatic: boolean;
11
+ /** Available authentication scheme options */
11
12
  selectedSchemeOptions: SecuritySchemeOption[];
13
+ /** Index of the currently active authentication tab */
12
14
  activeAuthIndex: number;
15
+ /** OpenAPI security scheme definitions */
13
16
  securitySchemes: ComponentsObject['securitySchemes'];
17
+ /** Current server configuration */
14
18
  server: ServerObject | undefined;
19
+ /** Event bus for authentication updates */
15
20
  eventBus: WorkspaceEventBus;
21
+ /** Metadata for authentication context */
16
22
  meta: AuthMeta;
17
23
  };
18
24
  declare const _default: import("vue").DefineComponent<__VLS_Props, {
19
- activeAuthIndex: number;
20
25
  activeScheme: import("vue").ComputedRef<SecuritySchemeOption | undefined>;
21
26
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
27
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AA+KA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAI1G,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;;AAqNF,wBAOG"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAoJA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAwOF,wBAOG"}
@@ -1,7 +1,84 @@
1
- import t from "./RequestAuthDataTable.vue2.js";
2
- /* empty css */
3
- import a from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ a(t, [["__scopeId", "data-v-3ae5eb41"]]);
1
+ import { defineComponent as p, computed as d, createElementBlock as s, openBlock as a, withModifiers as y, createCommentVNode as m, createBlock as x, normalizeClass as r, Fragment as g, renderList as k, createElementVNode as u, toDisplayString as w, unref as B, withCtx as C, createVNode as A } from "vue";
2
+ import z from "./RequestAuthTab.vue.js";
3
+ import N from "../../../components/data-table/DataTable.vue.js";
4
+ const O = ["onClick"], T = { class: "relative z-10 font-medium whitespace-nowrap" }, U = {
5
+ key: 0,
6
+ class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
7
+ }, E = /* @__PURE__ */ p({
8
+ __name: "RequestAuthDataTable",
9
+ props: {
10
+ environment: {},
11
+ isStatic: { type: Boolean },
12
+ selectedSchemeOptions: {},
13
+ activeAuthIndex: {},
14
+ securitySchemes: { default: () => ({}) },
15
+ server: {},
16
+ eventBus: {},
17
+ meta: {}
18
+ },
19
+ setup(t, { expose: h }) {
20
+ const n = d(
21
+ () => t.selectedSchemeOptions[t.activeAuthIndex]
22
+ ), v = d(() => t.selectedSchemeOptions.length > 1), b = (e) => t.eventBus.emit("auth:update:active-index", {
23
+ index: e,
24
+ meta: t.meta
25
+ }), S = (e) => t.eventBus.emit("auth:update:security-scheme", {
26
+ payload: e,
27
+ name: n.value?.id ?? ""
28
+ }), f = (e) => t.eventBus.emit("auth:update:selected-scopes", {
29
+ ...e,
30
+ meta: t.meta
31
+ }), c = (e) => t.activeAuthIndex === e;
32
+ return h({
33
+ activeScheme: n
34
+ }), (e, o) => (a(), s("form", {
35
+ onSubmit: o[0] || (o[0] = y(() => {
36
+ }, ["prevent"]))
37
+ }, [
38
+ v.value ? (a(), s("div", {
39
+ key: 0,
40
+ class: r(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", { "border-x-0": !e.isStatic }]),
41
+ "data-testid": "auth-tabs"
42
+ }, [
43
+ (a(!0), s(g, null, k(e.selectedSchemeOptions, (l, i) => (a(), s("div", {
44
+ key: l.id,
45
+ class: "relative z-1 -mb-[var(--scalar-border-width)] flex h-8"
46
+ }, [
47
+ u("button", {
48
+ class: r(["floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors", c(i) ? "text-c-1" : "text-c-3"]),
49
+ type: "button",
50
+ onClick: (I) => b(i)
51
+ }, [
52
+ u("span", T, w(l.label), 1)
53
+ ], 10, O),
54
+ c(i) ? (a(), s("div", U)) : m("", !0)
55
+ ]))), 128))
56
+ ], 2)) : m("", !0),
57
+ n.value ? (a(), x(B(N), {
58
+ key: 1,
59
+ class: r(["flex-1", { "bg-b-1 rounded-b-lg border border-t-0": e.isStatic }]),
60
+ columns: [""],
61
+ presentational: ""
62
+ }, {
63
+ default: C(() => [
64
+ A(z, {
65
+ environment: e.environment,
66
+ isStatic: e.isStatic,
67
+ securitySchemes: e.securitySchemes,
68
+ selectedSecuritySchemas: n.value.value,
69
+ server: e.server,
70
+ "onUpdate:securityScheme": S,
71
+ "onUpdate:selectedScopes": f
72
+ }, null, 8, ["environment", "isStatic", "securitySchemes", "selectedSecuritySchemas", "server"])
73
+ ]),
74
+ _: 1
75
+ }, 8, ["class"])) : (a(), s("div", {
76
+ key: 2,
77
+ class: r(["bg-b-1 text-c-3 flex min-h-16 items-center justify-center border-t px-4 text-sm", { "min-h-[calc(4rem+0.5px)] rounded-b-lg border": e.isStatic }])
78
+ }, " No authentication selected ", 2))
79
+ ], 32));
80
+ }
81
+ });
5
82
  export {
6
- m as default
83
+ E as default
7
84
  };