@scalar/api-client 2.17.7 → 2.18.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 (120) hide show
  1. package/CHANGELOG.md +74 -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 +46 -51
  12. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts +9 -0
  13. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.d.ts.map +1 -0
  14. package/dist/v2/blocks/operation-block/helpers/get-environment-variables.js +7 -0
  15. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  16. package/dist/v2/blocks/operation-block/helpers/get-example.js +12 -10
  17. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts +3 -0
  18. package/dist/v2/blocks/operation-block/helpers/get-server-url.d.ts.map +1 -0
  19. package/dist/v2/blocks/operation-block/helpers/get-server-url.js +12 -0
  20. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
  22. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +87 -65
  23. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -10
  24. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +149 -126
  26. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +20 -0
  27. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -0
  28. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.js +7 -0
  29. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue2.js +76 -0
  30. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +22 -5
  31. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +79 -64
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +16 -8
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +2 -2
  36. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  37. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +84 -82
  38. package/dist/v2/components/code-input/CodeInput.vue.d.ts +115 -144
  39. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  40. package/dist/v2/components/code-input/CodeInput.vue.js +2 -2
  41. package/dist/v2/components/code-input/CodeInput.vue2.js +120 -107
  42. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -3
  43. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  44. package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
  45. package/dist/v2/components/data-table/DataTableInput.vue2.js +27 -27
  46. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts +3 -2
  47. package/dist/v2/components/data-table/DataTableInputSelect.vue.d.ts.map +1 -1
  48. package/dist/v2/components/data-table/DataTableInputSelect.vue.js +42 -39
  49. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -1
  50. package/dist/v2/components/forms/ConfirmationForm.vue.js +43 -5
  51. package/dist/v2/components/forms/ConfirmationForm.vue2.js +2 -43
  52. package/dist/v2/components/modals/DeleteModal.vue.js +11 -11
  53. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +5 -3
  54. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  55. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts +5 -3
  56. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  57. package/dist/v2/components/sidebar/SidebarMenu.vue.js +25 -30
  58. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  59. package/dist/v2/features/app/App.vue.js +89 -141
  60. package/dist/v2/features/app/app-events.d.ts +22 -0
  61. package/dist/v2/features/app/app-events.d.ts.map +1 -0
  62. package/dist/v2/features/app/app-events.js +136 -0
  63. package/dist/v2/features/app/app-state.d.ts +135 -0
  64. package/dist/v2/features/app/app-state.d.ts.map +1 -0
  65. package/dist/v2/features/app/app-state.js +316 -0
  66. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -3
  67. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  68. package/dist/v2/features/app/components/AppSidebar.vue.js +3 -3
  69. package/dist/v2/features/app/components/AppSidebar.vue2.js +4 -4
  70. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +4 -2
  71. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  72. package/dist/v2/features/app/components/DesktopTabs.vue.js +25 -22
  73. package/dist/v2/features/app/components/WebTopNav.vue.d.ts +9 -5
  74. package/dist/v2/features/app/components/WebTopNav.vue.d.ts.map +1 -1
  75. package/dist/v2/features/app/helpers/create-api-client-app.d.ts +62 -1
  76. package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
  77. package/dist/v2/features/app/helpers/create-api-client-app.js +14 -10
  78. package/dist/v2/features/app/helpers/routes.d.ts +5 -2
  79. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  80. package/dist/v2/features/collection/WorkspaceCollection.vue.js +7 -7
  81. package/dist/v2/features/collection/components/Form.vue.d.ts +1 -1
  82. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  83. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  84. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  85. package/dist/v2/features/modal/Modal.vue.js +2 -2
  86. package/dist/v2/features/modal/Modal.vue2.js +40 -41
  87. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  88. package/dist/v2/features/operation/Operation.vue.js +38 -28
  89. package/dist/v2/features/operation/helpers/combine-params.d.ts +4 -0
  90. package/dist/v2/features/operation/helpers/combine-params.d.ts.map +1 -0
  91. package/dist/v2/features/operation/helpers/combine-params.js +13 -0
  92. package/dist/v2/features/operation/index.d.ts +1 -0
  93. package/dist/v2/features/operation/index.d.ts.map +1 -1
  94. package/dist/v2/features/operation/index.js +10 -8
  95. package/dist/v2/features/settings/DocumentSettings.vue.d.ts.map +1 -1
  96. package/dist/v2/features/settings/DocumentSettings.vue.js +104 -5
  97. package/dist/v2/features/settings/DocumentSettings.vue2.js +2 -104
  98. package/dist/v2/helpers/get-tab-details.d.ts +2 -2
  99. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -1
  100. package/dist/views/Collection/CollectionSettings.vue.d.ts.map +1 -1
  101. package/dist/views/Collection/CollectionSettings.vue.js +1 -4
  102. package/dist/views/Collection/CollectionSettings.vue2.js +5 -5
  103. package/dist/views/Environment/EnvironmentColorModal.vue.js +6 -6
  104. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  105. package/package.json +17 -17
  106. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts +0 -40
  107. package/dist/v2/features/app/hooks/use-app-sidebar.d.ts.map +0 -1
  108. package/dist/v2/features/app/hooks/use-app-sidebar.js +0 -134
  109. package/dist/v2/features/app/hooks/use-sync-path.d.ts +0 -11
  110. package/dist/v2/features/app/hooks/use-sync-path.d.ts.map +0 -1
  111. package/dist/v2/features/app/hooks/use-sync-path.js +0 -52
  112. package/dist/v2/features/app/hooks/use-tabs.d.ts +0 -31
  113. package/dist/v2/features/app/hooks/use-tabs.d.ts.map +0 -1
  114. package/dist/v2/features/app/hooks/use-tabs.js +0 -44
  115. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts +0 -18
  116. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +0 -1
  117. package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +0 -156
  118. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts +0 -28
  119. package/dist/v2/features/app/hooks/use-workspace-selector.d.ts.map +0 -1
  120. package/dist/v2/features/app/hooks/use-workspace-selector.js +0 -81
@@ -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"}
@@ -0,0 +1,7 @@
1
+ import o from "./OAuthScopesAddModal.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-43df1726"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,76 @@
1
+ import { defineComponent as c, ref as v, watch as V, createBlock as b, openBlock as x, unref as S, withCtx as o, createVNode as l, createElementVNode as m, createTextVNode as n } from "vue";
2
+ import { ScalarModal as A } from "@scalar/components";
3
+ import { useToasts as N } from "@scalar/use-toasts";
4
+ import g from "../../../../components/CommandPalette/CommandActionForm.vue.js";
5
+ import r from "../../../../components/CommandPalette/CommandActionInput.vue.js";
6
+ const C = { class: "flex h-8 items-start gap-2 text-sm" }, $ = { class: "flex h-8 items-start gap-2 text-sm" }, T = /* @__PURE__ */ c({
7
+ __name: "OAuthScopesAddModal",
8
+ props: {
9
+ state: {},
10
+ scopes: {}
11
+ },
12
+ emits: ["cancel", "submit"],
13
+ setup(d, { emit: u }) {
14
+ const i = u, t = v({
15
+ name: "",
16
+ description: ""
17
+ }), { toast: p } = N(), f = () => {
18
+ if (!t.value.name) {
19
+ p("Please fill in the name before adding a scope.", "error");
20
+ return;
21
+ }
22
+ i("submit", t.value), d.state.hide();
23
+ };
24
+ return V(
25
+ () => d.state.open,
26
+ (a) => {
27
+ a && (t.value = {
28
+ name: "",
29
+ description: ""
30
+ });
31
+ }
32
+ ), (a, e) => (x(), b(S(A), {
33
+ size: "xs",
34
+ state: a.state,
35
+ title: "Add Scope"
36
+ }, {
37
+ default: o(() => [
38
+ l(g, {
39
+ disabled: !t.value.name || a.scopes.includes(t.value.name),
40
+ onCancel: e[2] || (e[2] = (s) => i("cancel")),
41
+ onSubmit: f
42
+ }, {
43
+ submit: o(() => [...e[5] || (e[5] = [
44
+ n("Add Scope", -1)
45
+ ])]),
46
+ default: o(() => [
47
+ m("div", C, [
48
+ e[3] || (e[3] = n(" Name: ", -1)),
49
+ l(r, {
50
+ modelValue: t.value.name,
51
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => t.value.name = s),
52
+ autofocus: "",
53
+ class: "!p-0",
54
+ placeholder: "read:user"
55
+ }, null, 8, ["modelValue"])
56
+ ]),
57
+ m("div", $, [
58
+ e[4] || (e[4] = n(" Description: ", -1)),
59
+ l(r, {
60
+ modelValue: t.value.description,
61
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => t.value.description = s),
62
+ class: "!p-0",
63
+ placeholder: "Read user data"
64
+ }, null, 8, ["modelValue"])
65
+ ])
66
+ ]),
67
+ _: 1
68
+ }, 8, ["disabled"])
69
+ ]),
70
+ _: 1
71
+ }, 8, ["state"]));
72
+ }
73
+ });
74
+ export {
75
+ T as default
76
+ };
@@ -1,16 +1,33 @@
1
- import type { OAuthFlow } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { OAuthFlow, OAuthFlowsObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
2
  type __VLS_Props = {
3
+ flowType: keyof OAuthFlowsObject;
3
4
  flow: OAuthFlow;
4
5
  selectedScopes: string[];
5
6
  };
6
7
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
- "update:selectedScopes": (payload: {
8
+ "update:selectedScopes": (payload: Pick<{
9
+ id: string[];
10
+ name: string;
8
11
  scopes: string[];
9
- }) => any;
12
+ newScopePayload?: {
13
+ name: string;
14
+ description: string;
15
+ flowType: keyof OAuthFlowsObject;
16
+ };
17
+ meta: import("@scalar/workspace-store/mutators").AuthMeta;
18
+ }, "scopes" | "newScopePayload">) => any;
10
19
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- "onUpdate:selectedScopes"?: ((payload: {
20
+ "onUpdate:selectedScopes"?: ((payload: Pick<{
21
+ id: string[];
22
+ name: string;
12
23
  scopes: string[];
13
- }) => any) | undefined;
24
+ newScopePayload?: {
25
+ name: string;
26
+ description: string;
27
+ flowType: keyof OAuthFlowsObject;
28
+ };
29
+ meta: import("@scalar/workspace-store/mutators").AuthMeta;
30
+ }, "scopes" | "newScopePayload">) => any) | undefined;
14
31
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
32
  export default _default;
16
33
  //# sourceMappingURL=OAuthScopesInput.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AAuIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAA;AAS7F,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;;;gBAIgD,MAAM,EAAE;;;;gBAAR,MAAM,EAAE;;;AA0U1D,wBAOG"}
1
+ {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AA2KA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EACjB,MAAM,8DAA8D,CAAA;AAWrE,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,gBAAgB,CAAA;IAChC,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AAyYF,wBAOG"}