@scalar/api-client 2.22.3 → 2.23.2

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 (121) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +13 -3
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +68 -68
  6. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +5 -3
  7. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +1 -1
  9. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +3 -2
  10. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/index.d.ts +2 -1
  12. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  13. package/dist/v2/blocks/operation-block/index.js +7 -4
  14. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +3 -2
  15. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  16. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +2 -2
  17. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +3 -2
  18. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  19. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +2 -2
  20. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
  21. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +3 -2
  22. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +2 -2
  24. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  25. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +8 -5
  26. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  27. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  28. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +4 -4
  29. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +49 -45
  31. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +4 -2
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -181
  35. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +118 -107
  37. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -2
  38. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +30 -33
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +11 -178
  41. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -110
  43. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
  44. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +5 -29
  45. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +6 -0
  46. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -0
  47. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +85 -0
  48. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +9 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -0
  50. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +15 -0
  51. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +3 -2
  52. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  53. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +23 -0
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -0
  55. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +2 -2
  56. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  57. package/dist/v2/blocks/scalar-auth-selector-block/index.js +4 -6
  58. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  59. package/dist/v2/features/app/App.vue.js +127 -92
  60. package/dist/v2/features/app/app-state.d.ts +1 -1
  61. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  62. package/dist/v2/features/app/app-state.js +145 -142
  63. package/dist/v2/features/app/helpers/routes.d.ts +1 -1
  64. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  65. package/dist/v2/features/app/helpers/routes.js +31 -25
  66. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  67. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  68. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -11
  69. package/dist/v2/features/import-listener/ImportListener.vue.d.ts +52 -0
  70. package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +1 -0
  71. package/dist/v2/features/import-listener/ImportListener.vue.js +91 -0
  72. package/dist/v2/features/import-listener/ImportListener.vue2.js +4 -0
  73. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +7 -0
  74. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +1 -0
  75. package/dist/v2/features/import-listener/components/DropEventListener.vue.js +81 -0
  76. package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +4 -0
  77. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +40 -0
  78. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +1 -0
  79. package/dist/v2/features/import-listener/components/ImportModal.vue.js +170 -0
  80. package/dist/v2/features/import-listener/components/ImportModal.vue3.js +5 -0
  81. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +29 -0
  82. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +1 -0
  83. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +83 -0
  84. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +4 -0
  85. package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts +16 -0
  86. package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts.map +1 -0
  87. package/dist/v2/features/import-listener/helpers/generate-unique-slug.js +11 -0
  88. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +8 -0
  89. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +1 -0
  90. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +4 -0
  91. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts +30 -0
  92. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -0
  93. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +33 -0
  94. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +15 -0
  95. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +1 -0
  96. package/dist/v2/features/import-listener/helpers/load-document-from-source.js +28 -0
  97. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +15 -0
  98. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +1 -0
  99. package/dist/v2/features/import-listener/helpers/wait-for-condition.js +16 -0
  100. package/dist/v2/features/import-listener/index.d.ts +2 -0
  101. package/dist/v2/features/import-listener/index.d.ts.map +1 -0
  102. package/dist/v2/features/import-listener/index.js +4 -0
  103. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  104. package/dist/v2/features/modal/Modal.vue.js +1 -1
  105. package/dist/v2/features/modal/Modal.vue2.js +14 -12
  106. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  107. package/dist/v2/features/operation/Operation.vue.js +44 -35
  108. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +3 -5
  109. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
  110. package/dist/v2/workspace-events.d.ts.map +1 -1
  111. package/dist/v2/workspace-events.js +116 -109
  112. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  113. package/package.json +19 -14
  114. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts +0 -2
  115. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts.map +0 -1
  116. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +0 -8
  117. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +0 -1
  118. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +0 -33
  119. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +0 -7
  120. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +0 -1
  121. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +0 -13
@@ -1,13 +1,13 @@
1
- import { defineComponent as b, computed as w, watch as B, createElementBlock as x, openBlock as c, Fragment as y, createVNode as r, unref as o, withCtx as t, createTextVNode as s, createElementVNode as U, createBlock as f, createCommentVNode as v } from "vue";
2
- import { useLoadingState as L, ScalarButton as S } from "@scalar/components";
1
+ import { defineComponent as b, computed as w, watch as L, createElementBlock as x, openBlock as c, Fragment as V, createVNode as r, unref as o, withCtx as l, createTextVNode as s, createElementVNode as U, createBlock as f, createCommentVNode as v } from "vue";
2
+ import { useLoadingState as O, ScalarButton as S } from "@scalar/components";
3
3
  import { pkceOptions as P } from "@scalar/oas-utils/entities/spec";
4
4
  import { useToasts as R } from "@scalar/use-toasts";
5
5
  import F from "./OAuthScopesInput.vue.js";
6
6
  /* empty css */
7
- import { authorizeOauth2 as O } from "../helpers/oauth.js";
8
- import m from "./RequestAuthDataTableInput.vue.js";
7
+ import { authorizeOauth2 as A } from "../helpers/oauth.js";
8
+ import i from "./RequestAuthDataTableInput.vue.js";
9
9
  import u from "../../../../components/DataTable/DataTableRow.vue.js";
10
- 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" }, X = /* @__PURE__ */ b({
10
+ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { class: "flex h-8 w-full items-center justify-end border-t" }, Y = /* @__PURE__ */ b({
11
11
  __name: "OAuth2",
12
12
  props: {
13
13
  environment: {},
@@ -15,54 +15,65 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
15
15
  type: {},
16
16
  selectedScopes: {},
17
17
  server: {},
18
- proxyUrl: {}
18
+ proxyUrl: {},
19
+ name: {},
20
+ eventBus: {}
19
21
  },
20
- emits: ["update:securityScheme", "update:selectedScopes"],
21
- setup(a, { emit: g }) {
22
- const V = g, p = L(), { toast: C } = R(), l = w(() => a.flows[a.type]), k = w(
23
- () => a.selectedScopes.filter((i) => i in (l.value.scopes ?? {}))
24
- ), d = (i) => V("update:securityScheme", {
25
- type: "oauth2",
26
- flows: {
27
- [a.type]: i
28
- }
22
+ emits: ["update:selectedScopes"],
23
+ setup(t, { emit: g }) {
24
+ const C = g, p = O(), { toast: T } = R(), a = w(() => t.flows[t.type]), k = w(
25
+ () => t.selectedScopes.filter((d) => d in (a.value.scopes ?? {}))
26
+ ), y = (d) => t.eventBus.emit("auth:update:security-scheme", {
27
+ payload: {
28
+ type: "oauth2",
29
+ flows: {
30
+ [t.type]: d
31
+ }
32
+ },
33
+ name: t.name
34
+ }), m = (d) => t.eventBus.emit("auth:update:security-scheme-secrets", {
35
+ payload: {
36
+ type: "oauth2",
37
+ [t.type]: d
38
+ },
39
+ name: t.name
29
40
  });
30
- B(
31
- () => l.value["x-scalar-secret-redirect-uri"],
32
- (i) => {
33
- i || typeof window > "u" || !("x-scalar-secret-redirect-uri" in l.value) || d({
41
+ L(
42
+ () => a.value["x-scalar-secret-redirect-uri"],
43
+ (d) => {
44
+ d || typeof window > "u" || !("x-scalar-secret-redirect-uri" in a.value) || m({
34
45
  "x-scalar-secret-redirect-uri": window.location.origin + window.location.pathname
35
46
  });
36
47
  },
37
48
  { immediate: !0 }
38
49
  );
39
- const T = async () => {
50
+ const z = async () => {
40
51
  if (p.isLoading)
41
52
  return;
42
53
  p.start();
43
- const [i, e] = await O(
44
- a.flows,
45
- a.type,
54
+ const [d, e] = await A(
55
+ t.flows,
56
+ t.type,
46
57
  k.value,
47
- a.server,
48
- a.proxyUrl
58
+ t.server,
59
+ t.proxyUrl
49
60
  );
50
- await p.clear(), e ? d({ "x-scalar-secret-token": e }) : (console.error(i), C(i?.message ?? "Failed to authorize", "error"));
51
- }, z = (i) => d({
52
- "x-scalar-credentials-location": i === "body" ? "body" : "header"
61
+ await p.clear(), e ? m({ "x-scalar-secret-token": e }) : (console.error(d), T(d?.message ?? "Failed to authorize", "error"));
62
+ }, B = (d) => y({
63
+ "x-scalar-credentials-location": d === "body" ? "body" : "header"
53
64
  });
54
- return (i, e) => l.value["x-scalar-secret-token"] ? (c(), x(y, { key: 0 }, [
65
+ return (d, e) => a.value["x-scalar-secret-token"] ? (c(), x(V, { key: 0 }, [
55
66
  r(o(u), null, {
56
- default: t(() => [
57
- r(m, {
67
+ default: l(() => [
68
+ r(i, {
58
69
  class: "border-r-transparent",
59
- environment: a.environment,
60
- modelValue: l.value["x-scalar-secret-token"],
70
+ environment: t.environment,
71
+ modelValue: a.value["x-scalar-secret-token"],
61
72
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
62
73
  type: "password",
63
- "onUpdate:modelValue": e[0] || (e[0] = (n) => d({ "x-scalar-secret-token": n }))
74
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => m({ "x-scalar-secret-token": n }))
64
75
  }, {
65
- default: t(() => [...e[12] || (e[12] = [
76
+ default: l(() => [...e[12] || (e[12] = [
66
77
  s(" Access Token ", -1)
67
78
  ])]),
68
79
  _: 1
@@ -71,16 +82,16 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
71
82
  _: 1
72
83
  }),
73
84
  r(o(u), { class: "min-w-full" }, {
74
- default: t(() => [
75
- U("div", A, [
85
+ default: l(() => [
86
+ U("div", I, [
76
87
  r(o(S), {
77
88
  class: "mr-1 p-0 px-2 py-0.5",
78
89
  loader: o(p),
79
90
  size: "sm",
80
91
  variant: "outlined",
81
- onClick: e[1] || (e[1] = () => d({ "x-scalar-secret-token": "" }))
92
+ onClick: e[1] || (e[1] = () => m({ "x-scalar-secret-token": "" }))
82
93
  }, {
83
- default: t(() => [...e[13] || (e[13] = [
94
+ default: l(() => [...e[13] || (e[13] = [
84
95
  s(" Clear ", -1)
85
96
  ])]),
86
97
  _: 1
@@ -89,30 +100,30 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
89
100
  ]),
90
101
  _: 1
91
102
  })
92
- ], 64)) : (c(), x(y, { key: 1 }, [
103
+ ], 64)) : (c(), x(V, { key: 1 }, [
93
104
  r(o(u), null, {
94
- default: t(() => [
95
- "authorizationUrl" in l.value ? (c(), f(m, {
105
+ default: l(() => [
106
+ "authorizationUrl" in a.value ? (c(), f(i, {
96
107
  key: 0,
97
108
  containerClass: "border-r-0",
98
- environment: a.environment,
99
- modelValue: l.value.authorizationUrl,
109
+ environment: t.environment,
110
+ modelValue: a.value.authorizationUrl,
100
111
  placeholder: "https://galaxy.scalar.com/authorize",
101
- "onUpdate:modelValue": e[2] || (e[2] = (n) => d({ authorizationUrl: n }))
112
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => y({ authorizationUrl: n }))
102
113
  }, {
103
- default: t(() => [...e[14] || (e[14] = [
114
+ default: l(() => [...e[14] || (e[14] = [
104
115
  s(" Auth URL ", -1)
105
116
  ])]),
106
117
  _: 1
107
118
  }, 8, ["environment", "modelValue"])) : v("", !0),
108
- "tokenUrl" in l.value ? (c(), f(m, {
119
+ "tokenUrl" in a.value ? (c(), f(i, {
109
120
  key: 1,
110
- environment: a.environment,
111
- modelValue: l.value.tokenUrl,
121
+ environment: t.environment,
122
+ modelValue: a.value.tokenUrl,
112
123
  placeholder: "https://galaxy.scalar.com/token",
113
- "onUpdate:modelValue": e[3] || (e[3] = (n) => d({ tokenUrl: n }))
124
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => y({ tokenUrl: n }))
114
125
  }, {
115
- default: t(() => [...e[15] || (e[15] = [
126
+ default: l(() => [...e[15] || (e[15] = [
116
127
  s(" Token URL ", -1)
117
128
  ])]),
118
129
  _: 1
@@ -120,15 +131,15 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
120
131
  ]),
121
132
  _: 1
122
133
  }),
123
- "x-scalar-secret-redirect-uri" in l.value ? (c(), f(o(u), { key: 0 }, {
124
- default: t(() => [
125
- r(m, {
126
- environment: a.environment,
127
- modelValue: l.value["x-scalar-secret-redirect-uri"],
134
+ "x-scalar-secret-redirect-uri" in a.value ? (c(), f(o(u), { key: 0 }, {
135
+ default: l(() => [
136
+ r(i, {
137
+ environment: t.environment,
138
+ modelValue: a.value["x-scalar-secret-redirect-uri"],
128
139
  placeholder: "https://galaxy.scalar.com/callback",
129
- "onUpdate:modelValue": e[4] || (e[4] = (n) => d({ "x-scalar-secret-redirect-uri": n }))
140
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => m({ "x-scalar-secret-redirect-uri": n }))
130
141
  }, {
131
- default: t(() => [...e[16] || (e[16] = [
142
+ default: l(() => [...e[16] || (e[16] = [
132
143
  s(" Redirect URL ", -1)
133
144
  ])]),
134
145
  _: 1
@@ -136,17 +147,17 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
136
147
  ]),
137
148
  _: 1
138
149
  })) : v("", !0),
139
- "x-scalar-secret-username" in l.value && "x-scalar-secret-password" in l.value ? (c(), x(y, { key: 1 }, [
150
+ "x-scalar-secret-username" in a.value && "x-scalar-secret-password" in a.value ? (c(), x(V, { key: 1 }, [
140
151
  r(o(u), null, {
141
- default: t(() => [
142
- r(m, {
152
+ default: l(() => [
153
+ r(i, {
143
154
  class: "text-c-2",
144
- environment: a.environment,
145
- modelValue: l.value["x-scalar-secret-username"],
155
+ environment: t.environment,
156
+ modelValue: a.value["x-scalar-secret-username"],
146
157
  placeholder: "janedoe",
147
- "onUpdate:modelValue": e[5] || (e[5] = (n) => d({ "x-scalar-secret-username": n }))
158
+ "onUpdate:modelValue": e[5] || (e[5] = (n) => m({ "x-scalar-secret-username": n }))
148
159
  }, {
149
- default: t(() => [...e[17] || (e[17] = [
160
+ default: l(() => [...e[17] || (e[17] = [
150
161
  s(" Username ", -1)
151
162
  ])]),
152
163
  _: 1
@@ -155,15 +166,15 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
155
166
  _: 1
156
167
  }),
157
168
  r(o(u), null, {
158
- default: t(() => [
159
- r(m, {
160
- environment: a.environment,
161
- modelValue: l.value["x-scalar-secret-password"],
169
+ default: l(() => [
170
+ r(i, {
171
+ environment: t.environment,
172
+ modelValue: a.value["x-scalar-secret-password"],
162
173
  placeholder: "********",
163
174
  type: "password",
164
- "onUpdate:modelValue": e[6] || (e[6] = (n) => d({ "x-scalar-secret-password": n }))
175
+ "onUpdate:modelValue": e[6] || (e[6] = (n) => m({ "x-scalar-secret-password": n }))
165
176
  }, {
166
- default: t(() => [...e[18] || (e[18] = [
177
+ default: l(() => [...e[18] || (e[18] = [
167
178
  s(" Password ", -1)
168
179
  ])]),
169
180
  _: 1
@@ -173,14 +184,14 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
173
184
  })
174
185
  ], 64)) : v("", !0),
175
186
  r(o(u), null, {
176
- default: t(() => [
177
- r(m, {
178
- environment: a.environment,
179
- modelValue: l.value["x-scalar-secret-client-id"],
187
+ default: l(() => [
188
+ r(i, {
189
+ environment: t.environment,
190
+ modelValue: a.value["x-scalar-secret-client-id"],
180
191
  placeholder: "12345",
181
- "onUpdate:modelValue": e[7] || (e[7] = (n) => d({ "x-scalar-secret-client-id": n }))
192
+ "onUpdate:modelValue": e[7] || (e[7] = (n) => m({ "x-scalar-secret-client-id": n }))
182
193
  }, {
183
- default: t(() => [...e[19] || (e[19] = [
194
+ default: l(() => [...e[19] || (e[19] = [
184
195
  s(" Client ID ", -1)
185
196
  ])]),
186
197
  _: 1
@@ -188,16 +199,16 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
188
199
  ]),
189
200
  _: 1
190
201
  }),
191
- "x-scalar-secret-client-secret" in l.value ? (c(), f(o(u), { key: 2 }, {
192
- default: t(() => [
193
- r(m, {
194
- environment: a.environment,
195
- modelValue: l.value["x-scalar-secret-client-secret"],
202
+ "x-scalar-secret-client-secret" in a.value ? (c(), f(o(u), { key: 2 }, {
203
+ default: l(() => [
204
+ r(i, {
205
+ environment: t.environment,
206
+ modelValue: a.value["x-scalar-secret-client-secret"],
196
207
  placeholder: "XYZ123",
197
208
  type: "password",
198
- "onUpdate:modelValue": e[8] || (e[8] = (n) => d({ "x-scalar-secret-client-secret": n }))
209
+ "onUpdate:modelValue": e[8] || (e[8] = (n) => m({ "x-scalar-secret-client-secret": n }))
199
210
  }, {
200
- default: t(() => [...e[20] || (e[20] = [
211
+ default: l(() => [...e[20] || (e[20] = [
201
212
  s(" Client Secret ", -1)
202
213
  ])]),
203
214
  _: 1
@@ -205,18 +216,18 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
205
216
  ]),
206
217
  _: 1
207
218
  })) : v("", !0),
208
- "x-usePkce" in l.value ? (c(), f(o(u), { key: 3 }, {
209
- default: t(() => [
210
- r(m, {
219
+ "x-usePkce" in a.value ? (c(), f(o(u), { key: 3 }, {
220
+ default: l(() => [
221
+ r(i, {
211
222
  enum: o(P),
212
- environment: a.environment,
213
- modelValue: l.value["x-usePkce"],
223
+ environment: t.environment,
224
+ modelValue: a.value["x-usePkce"],
214
225
  readOnly: "",
215
- "onUpdate:modelValue": e[9] || (e[9] = (n) => d({
226
+ "onUpdate:modelValue": e[9] || (e[9] = (n) => y({
216
227
  "x-usePkce": n
217
228
  }))
218
229
  }, {
219
- default: t(() => [...e[21] || (e[21] = [
230
+ default: l(() => [...e[21] || (e[21] = [
220
231
  s(" Use PKCE ", -1)
221
232
  ])]),
222
233
  _: 1
@@ -224,17 +235,17 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
224
235
  ]),
225
236
  _: 1
226
237
  })) : v("", !0),
227
- a.type !== "implicit" ? (c(), f(o(u), { key: 4 }, {
228
- default: t(() => [
229
- r(m, {
238
+ t.type !== "implicit" ? (c(), f(o(u), { key: 4 }, {
239
+ default: l(() => [
240
+ r(i, {
230
241
  enum: ["header", "body"],
231
- environment: a.environment,
232
- modelValue: l.value["x-scalar-credentials-location"] || "header",
242
+ environment: t.environment,
243
+ modelValue: a.value["x-scalar-credentials-location"] || "header",
233
244
  placeholder: "header",
234
245
  readOnly: "",
235
- "onUpdate:modelValue": e[10] || (e[10] = (n) => z(n))
246
+ "onUpdate:modelValue": e[10] || (e[10] = (n) => B(n))
236
247
  }, {
237
- default: t(() => [...e[22] || (e[22] = [
248
+ default: l(() => [...e[22] || (e[22] = [
238
249
  s(" Credentials Location ", -1)
239
250
  ])]),
240
251
  _: 1
@@ -243,27 +254,27 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
243
254
  _: 1
244
255
  })) : v("", !0),
245
256
  r(o(u), null, {
246
- default: t(() => [
257
+ default: l(() => [
247
258
  r(F, {
248
- flow: l.value,
249
- flowType: a.type,
259
+ flow: a.value,
260
+ flowType: t.type,
250
261
  selectedScopes: k.value,
251
- "onUpdate:selectedScopes": e[11] || (e[11] = (n) => V("update:selectedScopes", n))
262
+ "onUpdate:selectedScopes": e[11] || (e[11] = (n) => C("update:selectedScopes", n))
252
263
  }, null, 8, ["flow", "flowType", "selectedScopes"])
253
264
  ]),
254
265
  _: 1
255
266
  }),
256
267
  r(o(u), { class: "min-w-full" }, {
257
- default: t(() => [
258
- U("div", I, [
268
+ default: l(() => [
269
+ U("div", N, [
259
270
  r(o(S), {
260
271
  class: "mr-0.75 p-0 px-2 py-0.5",
261
272
  loader: o(p),
262
273
  size: "sm",
263
274
  variant: "outlined",
264
- onClick: T
275
+ onClick: z
265
276
  }, {
266
- default: t(() => [...e[23] || (e[23] = [
277
+ default: l(() => [...e[23] || (e[23] = [
267
278
  s(" Authorize ", -1)
268
279
  ])]),
269
280
  _: 1
@@ -276,5 +287,5 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
276
287
  }
277
288
  });
278
289
  export {
279
- X as default
290
+ Y as default
280
291
  };
@@ -1,6 +1,7 @@
1
1
  import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
2
2
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
3
- import type { ComponentsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
+ import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/index.js';
4
5
  import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
5
6
  type __VLS_Props = {
6
7
  /** The current environment configuration */
@@ -14,7 +15,7 @@ type __VLS_Props = {
14
15
  /** Proxy URL */
15
16
  proxyUrl: string;
16
17
  /** OpenAPI security scheme definitions */
17
- securitySchemes: ComponentsObject['securitySchemes'];
18
+ securitySchemes: MergedSecuritySchemes;
18
19
  /** Current server configuration */
19
20
  server: ServerObject | null;
20
21
  /** Event bus for authentication updates */
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,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,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAmOF,wBAOG"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AA4IA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACnF,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,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAsNF,wBAOG"}
@@ -1,10 +1,10 @@
1
- import { defineComponent as f, computed as d, createElementBlock as c, openBlock as a, withModifiers as y, createCommentVNode as m, createBlock as g, normalizeClass as s, Fragment as p, renderList as k, createElementVNode as u, toDisplayString as w, unref as B, withCtx as U, createVNode as C } from "vue";
2
- import A from "./RequestAuthTab.vue.js";
3
- import z from "../../../components/data-table/DataTable.vue.js";
4
- const N = ["onClick"], O = { class: "relative z-10 font-medium whitespace-nowrap" }, T = {
1
+ import { defineComponent as f, computed as d, createElementBlock as n, openBlock as t, withModifiers as S, createCommentVNode as m, createBlock as y, normalizeClass as s, Fragment as g, renderList as k, createElementVNode as u, toDisplayString as w, unref as B, withCtx as p, createVNode as C } from "vue";
2
+ import U from "./RequestAuthTab.vue.js";
3
+ import A from "../../../components/data-table/DataTable.vue.js";
4
+ const z = ["onClick"], N = { class: "relative z-10 font-medium whitespace-nowrap" }, O = {
5
5
  key: 0,
6
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__ */ f({
7
+ }, D = /* @__PURE__ */ f({
8
8
  __name: "RequestAuthDataTable",
9
9
  props: {
10
10
  environment: {},
@@ -18,63 +18,60 @@ const N = ["onClick"], O = { class: "relative z-10 font-medium whitespace-nowrap
18
18
  meta: {}
19
19
  },
20
20
  setup(e, { expose: h }) {
21
- const r = d(
21
+ const c = d(
22
22
  () => e.selectedSchemeOptions[e.activeAuthIndex]
23
- ), b = d(() => e.selectedSchemeOptions.length > 1), v = (t) => e.eventBus.emit("auth:update:active-index", {
24
- index: t,
23
+ ), v = d(() => e.selectedSchemeOptions.length > 1), b = (a) => e.eventBus.emit("auth:update:active-index", {
24
+ index: a,
25
25
  meta: e.meta
26
- }), x = (t, n) => e.eventBus.emit("auth:update:security-scheme", {
27
- payload: t,
28
- name: n
29
- }), S = (t) => e.eventBus.emit("auth:update:selected-scopes", {
30
- ...t,
26
+ }), x = (a) => e.eventBus.emit("auth:update:selected-scopes", {
27
+ ...a,
31
28
  meta: e.meta
32
- }), o = (t) => e.activeAuthIndex === t;
29
+ }), i = (a) => e.activeAuthIndex === a;
33
30
  return h({
34
- activeScheme: r
35
- }), (t, n) => (a(), c("form", {
36
- onSubmit: n[0] || (n[0] = y(() => {
31
+ activeScheme: c
32
+ }), (a, o) => (t(), n("form", {
33
+ onSubmit: o[0] || (o[0] = S(() => {
37
34
  }, ["prevent"]))
38
35
  }, [
39
- b.value ? (a(), c("div", {
36
+ v.value ? (t(), n("div", {
40
37
  key: 0,
41
38
  class: s(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", { "border-x-0": !e.isStatic }]),
42
39
  "data-testid": "auth-tabs"
43
40
  }, [
44
- (a(!0), c(p, null, k(e.selectedSchemeOptions, (l, i) => (a(), c("div", {
41
+ (t(!0), n(g, null, k(e.selectedSchemeOptions, (l, r) => (t(), n("div", {
45
42
  key: l.id,
46
43
  class: "relative z-1 -mb-[var(--scalar-border-width)] flex h-8"
47
44
  }, [
48
45
  u("button", {
49
- class: s(["floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors", o(i) ? "text-c-1" : "text-c-3"]),
46
+ class: s(["floating-bg relative cursor-pointer border-b border-transparent py-1 text-sm font-medium transition-colors", i(r) ? "text-c-1" : "text-c-3"]),
50
47
  type: "button",
51
- onClick: (I) => v(i)
48
+ onClick: (T) => b(r)
52
49
  }, [
53
- u("span", O, w(l.label), 1)
54
- ], 10, N),
55
- o(i) ? (a(), c("div", T)) : m("", !0)
50
+ u("span", N, w(l.label), 1)
51
+ ], 10, z),
52
+ i(r) ? (t(), n("div", O)) : m("", !0)
56
53
  ]))), 128))
57
54
  ], 2)) : m("", !0),
58
- r.value ? (a(), g(B(z), {
55
+ c.value ? (t(), y(B(A), {
59
56
  key: 1,
60
57
  class: s(["flex-1", { "bg-b-1 rounded-b-lg border border-t-0": e.isStatic }]),
61
58
  columns: [""],
62
59
  presentational: ""
63
60
  }, {
64
- default: U(() => [
65
- C(A, {
61
+ default: p(() => [
62
+ C(U, {
66
63
  environment: e.environment,
64
+ eventBus: e.eventBus,
67
65
  isStatic: e.isStatic,
68
66
  proxyUrl: e.proxyUrl,
69
67
  securitySchemes: e.securitySchemes,
70
- selectedSecuritySchemas: r.value.value,
68
+ selectedSecuritySchemas: c.value.value,
71
69
  server: e.server,
72
- "onUpdate:securityScheme": x,
73
- "onUpdate:selectedScopes": S
74
- }, null, 8, ["environment", "isStatic", "proxyUrl", "securitySchemes", "selectedSecuritySchemas", "server"])
70
+ "onUpdate:selectedScopes": x
71
+ }, null, 8, ["environment", "eventBus", "isStatic", "proxyUrl", "securitySchemes", "selectedSecuritySchemas", "server"])
75
72
  ]),
76
73
  _: 1
77
- }, 8, ["class"])) : (a(), c("div", {
74
+ }, 8, ["class"])) : (t(), n("div", {
78
75
  key: 2,
79
76
  class: s(["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 }])
80
77
  }, " No authentication selected ", 2))
@@ -82,5 +79,5 @@ const N = ["onClick"], O = { class: "relative z-10 font-medium whitespace-nowrap
82
79
  }
83
80
  });
84
81
  export {
85
- E as default
82
+ D as default
86
83
  };