@scalar/api-reference 1.41.1 → 1.43.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 (202) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/dist/blocks/index.d.ts +0 -1
  3. package/dist/blocks/index.d.ts.map +1 -1
  4. package/dist/blocks/index.js +4 -6
  5. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts +4 -1
  6. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.d.ts.map +1 -1
  7. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue.js +1 -1
  8. package/dist/blocks/scalar-client-selector-block/components/ClientDropdown.vue2.js +9 -13
  9. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts +4 -1
  10. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.d.ts.map +1 -1
  11. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue.js +1 -1
  12. package/dist/blocks/scalar-client-selector-block/components/ClientSelector.vue2.js +10 -9
  13. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts +4 -0
  14. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.d.ts.map +1 -1
  15. package/dist/blocks/scalar-info-block/components/DownloadLink.vue.js +1 -1
  16. package/dist/blocks/scalar-info-block/components/DownloadLink.vue2.js +4 -7
  17. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts +7 -9
  18. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.d.ts.map +1 -1
  19. package/dist/blocks/scalar-info-block/components/InfoBlock.vue.js +9 -6
  20. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts +2 -9
  21. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.d.ts.map +1 -1
  22. package/dist/blocks/scalar-server-selector-block/components/Selector.vue.js +13 -25
  23. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts +8 -4
  24. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.d.ts.map +1 -1
  25. package/dist/blocks/scalar-server-selector-block/components/ServerSelector.vue.js +18 -41
  26. package/dist/browser/standalone.js +20335 -23246
  27. package/dist/browser/webpack-stats.json +1 -1
  28. package/dist/components/ApiReference.vue.d.ts +2 -254
  29. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  30. package/dist/components/ApiReference.vue.js +1 -1
  31. package/dist/components/ApiReference.vue2.js +71 -83
  32. package/dist/components/Content/Auth/Auth.vue.d.ts +17 -0
  33. package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -0
  34. package/dist/components/Content/Auth/Auth.vue.js +70 -0
  35. package/dist/components/Content/Auth/Auth.vue2.js +4 -0
  36. package/dist/components/Content/Auth/helpers/get-default-security.d.ts +18 -0
  37. package/dist/components/Content/Auth/helpers/get-default-security.d.ts.map +1 -0
  38. package/dist/components/Content/Auth/helpers/get-default-security.js +43 -0
  39. package/dist/components/Content/Auth/index.d.ts +2 -0
  40. package/dist/components/Content/Auth/index.d.ts.map +1 -0
  41. package/dist/components/Content/Content.vue.d.ts +9 -19
  42. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  43. package/dist/components/Content/Content.vue.js +46 -47
  44. package/dist/components/Content/Models/Model.vue.d.ts +3 -6
  45. package/dist/components/Content/Models/Model.vue.d.ts.map +1 -1
  46. package/dist/components/Content/Models/Model.vue.js +2 -2
  47. package/dist/components/Content/Models/ModelTag.vue.d.ts +2 -7
  48. package/dist/components/Content/Models/ModelTag.vue.d.ts.map +1 -1
  49. package/dist/components/Content/Models/ModelTag.vue.js +3 -3
  50. package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts +3 -5
  51. package/dist/components/Content/Models/components/ClassicLayout.vue.d.ts.map +1 -1
  52. package/dist/components/Content/Models/components/ClassicLayout.vue.js +1 -1
  53. package/dist/components/Content/Models/components/ClassicLayout.vue2.js +2 -8
  54. package/dist/components/Content/Models/components/ModernLayout.vue.d.ts +1 -1
  55. package/dist/components/Content/Models/components/ModernLayout.vue.d.ts.map +1 -1
  56. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +20 -25
  57. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  58. package/dist/components/Content/Operations/TraversedEntry.vue.js +38 -56
  59. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +1 -1
  60. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  61. package/dist/components/Content/index.d.ts +0 -1
  62. package/dist/components/Content/index.d.ts.map +1 -1
  63. package/dist/components/ShowMoreButton.vue.d.ts +1 -4
  64. package/dist/components/ShowMoreButton.vue.d.ts.map +1 -1
  65. package/dist/components/ShowMoreButton.vue.js +1 -1
  66. package/dist/components/ShowMoreButton.vue2.js +7 -17
  67. package/dist/components/index.d.ts +1 -1
  68. package/dist/components/index.d.ts.map +1 -1
  69. package/dist/components/index.js +12 -14
  70. package/dist/features/Operation/Operation.vue.d.ts +23 -25
  71. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  72. package/dist/features/Operation/Operation.vue.js +28 -19
  73. package/dist/features/Operation/components/OperationParameters.vue.d.ts +2 -4
  74. package/dist/features/Operation/components/OperationParameters.vue.d.ts.map +1 -1
  75. package/dist/features/Operation/components/OperationParameters.vue.js +17 -6
  76. package/dist/features/Operation/components/OperationResponses.vue.d.ts +3 -5
  77. package/dist/features/Operation/components/OperationResponses.vue.d.ts.map +1 -1
  78. package/dist/features/Operation/components/OperationResponses.vue.js +3 -1
  79. package/dist/features/Operation/components/ParameterList.vue.d.ts +3 -6
  80. package/dist/features/Operation/components/ParameterList.vue.d.ts.map +1 -1
  81. package/dist/features/Operation/components/ParameterList.vue.js +6 -8
  82. package/dist/features/Operation/components/ParameterListItem.vue.d.ts +3 -6
  83. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  84. package/dist/features/Operation/components/ParameterListItem.vue.js +1 -1
  85. package/dist/features/Operation/components/ParameterListItem.vue2.js +6 -8
  86. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts +2 -4
  87. package/dist/features/Operation/components/callbacks/Callback.vue.d.ts.map +1 -1
  88. package/dist/features/Operation/components/callbacks/Callback.vue.js +1 -1
  89. package/dist/features/Operation/components/callbacks/Callback.vue2.js +1 -5
  90. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts +2 -8
  91. package/dist/features/Operation/components/callbacks/Callbacks.vue.d.ts.map +1 -1
  92. package/dist/features/Operation/components/callbacks/Callbacks.vue.js +35 -24
  93. package/dist/features/Operation/helpers/filter-selected-security.d.ts +9 -0
  94. package/dist/features/Operation/helpers/filter-selected-security.d.ts.map +1 -0
  95. package/dist/features/Operation/helpers/filter-selected-security.js +27 -0
  96. package/dist/features/Operation/helpers/get-first-server.d.ts +1 -1
  97. package/dist/features/Operation/helpers/get-first-server.d.ts.map +1 -1
  98. package/dist/features/Operation/helpers/get-first-server.js +3 -3
  99. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +7 -23
  100. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  101. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  102. package/dist/features/Operation/layouts/ClassicLayout.vue2.js +24 -23
  103. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +7 -23
  104. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  105. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  106. package/dist/features/Operation/layouts/ModernLayout.vue2.js +25 -27
  107. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  108. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  109. package/dist/features/example-responses/ExampleResponse.vue2.js +1 -2
  110. package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
  111. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  112. package/dist/features/example-responses/ExampleResponses.vue2.js +1 -2
  113. package/dist/features/test-request-button/TestRequestButton.vue.d.ts +3 -0
  114. package/dist/features/test-request-button/TestRequestButton.vue.d.ts.map +1 -1
  115. package/dist/features/test-request-button/TestRequestButton.vue.js +1 -1
  116. package/dist/features/test-request-button/TestRequestButton.vue2.js +5 -9
  117. package/dist/helpers/index.d.ts +0 -4
  118. package/dist/helpers/index.d.ts.map +1 -1
  119. package/dist/helpers/index.js +1 -9
  120. package/dist/helpers/map-config-plugins.d.ts +5 -0
  121. package/dist/helpers/map-config-plugins.d.ts.map +1 -0
  122. package/dist/helpers/map-config-plugins.js +29 -0
  123. package/dist/helpers/map-config-to-workspace-store.d.ts.map +1 -1
  124. package/dist/helpers/map-config-to-workspace-store.js +5 -0
  125. package/dist/helpers/map-configuration.d.ts +2 -2
  126. package/dist/helpers/storage.d.ts +347 -0
  127. package/dist/helpers/storage.d.ts.map +1 -0
  128. package/dist/helpers/storage.js +61 -0
  129. package/dist/hooks/index.d.ts +0 -2
  130. package/dist/hooks/index.d.ts.map +1 -1
  131. package/dist/hooks/index.js +1 -5
  132. package/dist/index.d.ts +0 -1
  133. package/dist/index.d.ts.map +1 -1
  134. package/dist/index.js +1 -3
  135. package/dist/plugins/persistance-plugin.d.ts +16 -0
  136. package/dist/plugins/persistance-plugin.d.ts.map +1 -0
  137. package/dist/plugins/persistance-plugin.js +54 -0
  138. package/dist/style.css +220 -542
  139. package/package.json +17 -17
  140. package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +0 -11
  141. package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +0 -1
  142. package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +0 -7
  143. package/dist/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +0 -259
  144. package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts +0 -21
  145. package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.d.ts.map +0 -1
  146. package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue.js +0 -66
  147. package/dist/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue2.js +0 -4
  148. package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +0 -17
  149. package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +0 -1
  150. package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +0 -273
  151. package/dist/blocks/scalar-auth-selector-block/components/OAuth2.vue2.js +0 -4
  152. package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +0 -9
  153. package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +0 -1
  154. package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.js +0 -150
  155. package/dist/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue2.js +0 -4
  156. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +0 -20
  157. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +0 -1
  158. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +0 -7
  159. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +0 -116
  160. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +0 -50
  161. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +0 -1
  162. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +0 -55
  163. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue2.js +0 -4
  164. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +0 -17
  165. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +0 -1
  166. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +0 -288
  167. package/dist/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue2.js +0 -4
  168. package/dist/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.d.ts +0 -6
  169. package/dist/blocks/scalar-auth-selector-block/helpers/filter-security-requirements.d.ts.map +0 -1
  170. package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.d.ts +0 -8
  171. package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.d.ts.map +0 -1
  172. package/dist/blocks/scalar-auth-selector-block/helpers/update-scheme.js +0 -26
  173. package/dist/blocks/scalar-auth-selector-block/index.d.ts +0 -2
  174. package/dist/blocks/scalar-auth-selector-block/index.d.ts.map +0 -1
  175. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts +0 -16
  176. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.d.ts.map +0 -1
  177. package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +0 -7
  178. package/dist/components/Content/ClientLibraries/ClientLibraries.vue2.js +0 -142
  179. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts +0 -13
  180. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +0 -1
  181. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +0 -7
  182. package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +0 -125
  183. package/dist/components/Content/ClientLibraries/featured-clients.d.ts +0 -11
  184. package/dist/components/Content/ClientLibraries/featured-clients.d.ts.map +0 -1
  185. package/dist/components/Content/ClientLibraries/featured-clients.js +0 -24
  186. package/dist/components/Content/ClientLibraries/index.d.ts +0 -2
  187. package/dist/components/Content/ClientLibraries/index.d.ts.map +0 -1
  188. package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts +0 -26
  189. package/dist/features/example-responses/helpers/get-resolved-ref-deep.d.ts.map +0 -1
  190. package/dist/features/example-responses/helpers/get-resolved-ref-deep.js +0 -39
  191. package/dist/helpers/convert-security-scheme.d.ts +0 -9
  192. package/dist/helpers/convert-security-scheme.d.ts.map +0 -1
  193. package/dist/helpers/convert-security-scheme.js +0 -34
  194. package/dist/helpers/map-config-to-client-store.d.ts +0 -72
  195. package/dist/helpers/map-config-to-client-store.d.ts.map +0 -1
  196. package/dist/helpers/map-config-to-client-store.js +0 -146
  197. package/dist/hooks/use-legacy-store-events.d.ts +0 -14
  198. package/dist/hooks/use-legacy-store-events.d.ts.map +0 -1
  199. package/dist/hooks/use-legacy-store-events.js +0 -91
  200. package/dist/hooks/use-workspace-store-events.d.ts +0 -4
  201. package/dist/hooks/use-workspace-store-events.d.ts.map +0 -1
  202. package/dist/hooks/use-workspace-store-events.js +0 -68
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "vue",
21
21
  "vue3"
22
22
  ],
23
- "version": "1.41.1",
23
+ "version": "1.43.0",
24
24
  "engines": {
25
25
  "node": ">=20"
26
26
  },
@@ -89,24 +89,24 @@
89
89
  "type-fest": "5.0.0",
90
90
  "vue": "^3.5.21",
91
91
  "zod": "^4.1.11",
92
+ "@scalar/api-client": "2.17.5",
92
93
  "@scalar/code-highlight": "0.2.2",
93
- "@scalar/api-client": "2.17.3",
94
- "@scalar/components": "0.16.14",
95
- "@scalar/helpers": "0.2.4",
96
- "@scalar/json-magic": "0.8.8",
94
+ "@scalar/components": "0.16.16",
97
95
  "@scalar/icons": "0.5.2",
98
- "@scalar/oas-utils": "0.6.12",
99
- "@scalar/object-utils": "1.2.18",
100
- "@scalar/openapi-types": "0.5.3",
101
- "@scalar/openapi-parser": "0.23.9",
96
+ "@scalar/helpers": "0.2.6",
97
+ "@scalar/json-magic": "0.8.10",
98
+ "@scalar/oas-utils": "0.6.14",
99
+ "@scalar/object-utils": "1.2.20",
100
+ "@scalar/openapi-parser": "0.23.11",
102
101
  "@scalar/openapi-upgrader": "0.1.6",
103
- "@scalar/snippetz": "0.6.1",
104
- "@scalar/sidebar": "0.7.4",
102
+ "@scalar/sidebar": "0.7.6",
103
+ "@scalar/openapi-types": "0.5.3",
104
+ "@scalar/snippetz": "0.6.3",
105
105
  "@scalar/themes": "0.13.26",
106
- "@scalar/types": "0.5.4",
107
- "@scalar/use-hooks": "0.3.3",
106
+ "@scalar/types": "0.5.6",
108
107
  "@scalar/use-toasts": "0.9.1",
109
- "@scalar/workspace-store": "0.24.2"
108
+ "@scalar/workspace-store": "0.24.4",
109
+ "@scalar/use-hooks": "0.3.5"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@hono/node-server": "1.19.5",
@@ -127,9 +127,9 @@
127
127
  "vite-plugin-css-injected-by-js": "^3.4.0",
128
128
  "vitest": "3.2.4",
129
129
  "@scalar/build-tooling": "0.4.1",
130
- "@scalar/core": "0.3.28",
131
- "@scalar/galaxy": "0.5.12",
132
- "@scalar/react-renderer": "0.3.0"
130
+ "@scalar/core": "0.3.30",
131
+ "@scalar/react-renderer": "0.3.0",
132
+ "@scalar/galaxy": "0.5.12"
133
133
  },
134
134
  "scripts": {
135
135
  "build": "pnpm build:default && pnpm build:standalone && pnpm types:build",
@@ -1,11 +0,0 @@
1
- import type { Operation, Server } from '@scalar/oas-utils/entities/spec';
2
- type __VLS_Props = {
3
- layout: 'client' | 'reference';
4
- operation?: Operation | undefined;
5
- persistAuth?: boolean;
6
- server: Server | undefined;
7
- title: string;
8
- };
9
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
- export default _default;
11
- //# sourceMappingURL=AuthSelector.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AuthSelector.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/components/AuthSelector.vue"],"names":[],"mappings":"AAoaA,OAAO,KAAK,EACV,SAAS,EAET,MAAM,EACP,MAAM,iCAAiC,CAAA;AAQxC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;CACd,CAAC;;AA0iBF,wBAMG"}
@@ -1,7 +0,0 @@
1
- import _sfc_main from "./AuthSelector.vue2.js";
2
- /* empty css */
3
- import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const AuthSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-43114fd7"]]);
5
- export {
6
- AuthSelector as default
7
- };
@@ -1,259 +0,0 @@
1
- import { defineComponent, computed, useId, ref, useTemplateRef, createBlock, createCommentVNode, unref, openBlock, withCtx, createVNode, createElementVNode, createElementBlock, Fragment, createTextVNode, toDisplayString, withModifiers, normalizeClass } from "vue";
2
- import { ViewLayoutCollapse } from "@scalar/api-client/components/ViewLayout";
3
- import { useLayout } from "@scalar/api-client/hooks";
4
- import { useWorkspace, useActiveEntities } from "@scalar/api-client/store";
5
- import { getSecurityRequirements, formatComplexScheme, formatScheme, getSchemeOptions } from "@scalar/api-client/views/Request/libs";
6
- import { useModal, ScalarComboboxMultiselect, ScalarButton, ScalarListboxCheckbox, ScalarIconButton } from "@scalar/components";
7
- import { safeLocalStorage, CLIENT_LS_KEYS } from "@scalar/helpers/object/local-storage";
8
- import { ScalarIconCaretDown, ScalarIconTrash } from "@scalar/icons";
9
- import { isDefined } from "@scalar/oas-utils/helpers";
10
- import { emitCustomEvent } from "@scalar/workspace-store/events";
11
- import _sfc_main$1 from "./DeleteRequestAuthModal.vue.js";
12
- import RequestAuthDataTable from "./RequestAuthDataTable.vue.js";
13
- const _hoisted_1 = ["id"];
14
- const _hoisted_2 = { class: "flex flex-1" };
15
- const _hoisted_3 = { class: "min-w-0 flex-1 truncate" };
16
- const _sfc_main = /* @__PURE__ */ defineComponent({
17
- __name: "AuthSelector",
18
- props: {
19
- layout: {},
20
- operation: {},
21
- persistAuth: { type: Boolean, default: false },
22
- server: {},
23
- title: {}
24
- },
25
- setup(__props) {
26
- const { layout: clientLayout } = useLayout();
27
- const { securitySchemes } = useWorkspace();
28
- const {
29
- activeWorkspace: workspace,
30
- activeCollection: collection,
31
- activeEnvVariables: envVariables,
32
- activeEnvironment: environment
33
- } = useActiveEntities();
34
- const selectedSecuritySchemeUids = computed(
35
- () => collection.value?.selectedSecuritySchemeUids ?? []
36
- );
37
- const titleId = useId();
38
- const comboboxButtonRef = ref(null);
39
- const deleteSchemeModal = useModal();
40
- const selectedScheme = ref(
41
- null
42
- );
43
- const isViewLayoutOpen = ref(false);
44
- const securityRequirements = computed(() => {
45
- const requirements = getSecurityRequirements(__props.operation, collection.value);
46
- const filteredRequirements = requirements.filter((r) => Object.keys(r).length);
47
- return { filteredRequirements, requirements };
48
- });
49
- const authIndicator = computed(() => {
50
- const { filteredRequirements, requirements } = securityRequirements.value;
51
- if (!requirements.length) {
52
- return null;
53
- }
54
- const hasComplexRequirement = requirements.some(
55
- (req) => Object.keys(req).length > 1
56
- );
57
- const isOptional = !hasComplexRequirement && filteredRequirements.length < requirements.length;
58
- const icon = isOptional ? "Unlock" : "Lock";
59
- const text = isOptional ? "Optional" : "Required";
60
- return { icon, text };
61
- });
62
- const selectedSchemeOptions = computed(
63
- () => selectedSecuritySchemeUids.value.map((s) => {
64
- if (Array.isArray(s)) {
65
- return formatComplexScheme(s, securitySchemes);
66
- }
67
- const scheme = securitySchemes[s ?? ""];
68
- if (!scheme) {
69
- return void 0;
70
- }
71
- return formatScheme(scheme);
72
- }).filter(isDefined)
73
- );
74
- function updateSelectedAuth(entries) {
75
- const addNewOption = entries.find((e) => e.payload);
76
- const _entries = entries.filter((e) => !e.payload).map(({ id }) => {
77
- const arr = id.split(",");
78
- return arr.length > 1 ? arr : id;
79
- });
80
- if (addNewOption?.payload) {
81
- emitCustomEvent(wrapperRef.value?.$el, "scalar-add-auth-option", {
82
- payload: addNewOption.payload
83
- });
84
- if (addNewOption.payload.uid) {
85
- _entries.push(addNewOption.payload.uid);
86
- }
87
- }
88
- editSelectedSchemeUids(_entries);
89
- }
90
- const editSelectedSchemeUids = (uids) => {
91
- if (collection.value?.useCollectionSecurity) {
92
- emitCustomEvent(wrapperRef.value?.$el, "scalar-select-security-schemes", {
93
- uids
94
- });
95
- if (!__props.persistAuth) {
96
- return;
97
- }
98
- const nameKeys = uids.map((u) => {
99
- if (Array.isArray(u)) {
100
- return u.map((uid) => securitySchemes[uid]?.nameKey);
101
- }
102
- return securitySchemes[u]?.nameKey;
103
- });
104
- safeLocalStorage().setItem(
105
- CLIENT_LS_KEYS.SELECTED_SECURITY_SCHEMES,
106
- JSON.stringify(nameKeys)
107
- );
108
- } else if (__props.operation?.uid) {
109
- emitCustomEvent(
110
- wrapperRef.value?.$el,
111
- "scalar-select-operation-security-schemes",
112
- {
113
- operationUid: __props.operation.uid,
114
- uids
115
- }
116
- );
117
- }
118
- };
119
- function handleDeleteScheme({ id, label }) {
120
- selectedScheme.value = { id, label };
121
- deleteSchemeModal.show();
122
- }
123
- const unselectAuth = (unSelectUid) => {
124
- if (!unSelectUid) {
125
- return;
126
- }
127
- const newUids = selectedSecuritySchemeUids.value.filter((uid) => {
128
- const arr = unSelectUid.split(",");
129
- if (arr.length > 1 && Array.isArray(uid) && arr.length === uid.length) {
130
- return uid.every((u) => !arr.includes(u));
131
- }
132
- return uid !== unSelectUid;
133
- });
134
- editSelectedSchemeUids(newUids);
135
- comboboxButtonRef.value?.$el.focus();
136
- deleteSchemeModal.hide();
137
- };
138
- const schemeOptions = computed(
139
- () => getSchemeOptions(
140
- securityRequirements.value.filteredRequirements,
141
- collection.value?.securitySchemes ?? [],
142
- securitySchemes,
143
- clientLayout === "modal" || __props.layout === "reference"
144
- )
145
- );
146
- const openAuthCombobox = (event) => {
147
- if (isViewLayoutOpen.value) {
148
- event.stopPropagation();
149
- }
150
- comboboxButtonRef.value?.$el.click();
151
- };
152
- const wrapperRef = useTemplateRef("wrapperRef");
153
- return (_ctx, _cache) => {
154
- return unref(collection) && unref(workspace) ? (openBlock(), createBlock(unref(ViewLayoutCollapse), {
155
- key: 0,
156
- ref_key: "wrapperRef",
157
- ref: wrapperRef,
158
- class: "group/params relative",
159
- itemCount: selectedSchemeOptions.value.length,
160
- layout: _ctx.layout,
161
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isViewLayoutOpen.value = $event)
162
- }, {
163
- title: withCtx(() => [
164
- createElementVNode("div", {
165
- id: unref(titleId),
166
- class: "inline-flex items-center gap-0.5 leading-[20px]"
167
- }, [
168
- createElementVNode("span", null, toDisplayString(_ctx.title), 1),
169
- authIndicator.value ? (openBlock(), createElementBlock("span", {
170
- key: 0,
171
- class: normalizeClass(["text-c-3 hover:bg-b-3 hover:text-c-1 -mr-1 cursor-pointer rounded px-1 py-0.5 text-xs leading-[normal]", { "text-c-1": authIndicator.value.text === "Required" }]),
172
- onClick: openAuthCombobox
173
- }, toDisplayString(authIndicator.value.text), 3)) : createCommentVNode("", true)
174
- ], 8, _hoisted_1)
175
- ]),
176
- actions: withCtx(() => [
177
- createElementVNode("div", _hoisted_2, [
178
- createVNode(unref(ScalarComboboxMultiselect), {
179
- class: "w-72 text-xs",
180
- modelValue: selectedSchemeOptions.value,
181
- multiple: "",
182
- options: schemeOptions.value,
183
- placement: "bottom-end",
184
- teleport: "",
185
- onDelete: handleDeleteScheme,
186
- "onUpdate:modelValue": updateSelectedAuth
187
- }, {
188
- option: withCtx(({ option, selected }) => [
189
- createVNode(unref(ScalarListboxCheckbox), {
190
- multiselect: "",
191
- selected
192
- }, null, 8, ["selected"]),
193
- createElementVNode("div", _hoisted_3, toDisplayString(option.label), 1),
194
- option.isDeletable ?? (unref(clientLayout) !== "modal" && _ctx.layout !== "reference") ? (openBlock(), createBlock(unref(ScalarIconButton), {
195
- key: 0,
196
- class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
197
- icon: unref(ScalarIconTrash),
198
- label: `Delete ${option.label}`,
199
- size: "xs",
200
- onClick: withModifiers(($event) => handleDeleteScheme(option), ["stop"])
201
- }, null, 8, ["icon", "label", "onClick"])) : createCommentVNode("", true)
202
- ]),
203
- default: withCtx(() => [
204
- createVNode(unref(ScalarButton), {
205
- ref_key: "comboboxButtonRef",
206
- ref: comboboxButtonRef,
207
- "aria-describedby": unref(titleId),
208
- class: "group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal transition-transform",
209
- variant: "ghost"
210
- }, {
211
- default: withCtx(() => [
212
- selectedSchemeOptions.value.length === 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
213
- _cache[3] || (_cache[3] = createElementVNode("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
214
- createTextVNode(" " + toDisplayString(selectedSchemeOptions.value[0]?.label), 1)
215
- ], 64)) : selectedSchemeOptions.value.length > 1 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
216
- _cache[4] || (_cache[4] = createTextVNode(" Multiple ", -1)),
217
- _cache[5] || (_cache[5] = createElementVNode("span", { class: "sr-only" }, "Auth Types Selected", -1))
218
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
219
- _cache[6] || (_cache[6] = createElementVNode("span", { class: "sr-only" }, "Select", -1)),
220
- _cache[7] || (_cache[7] = createTextVNode(" Auth Type ", -1))
221
- ], 64)),
222
- createVNode(unref(ScalarIconCaretDown), {
223
- class: "size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180",
224
- weight: "bold"
225
- })
226
- ]),
227
- _: 1
228
- }, 8, ["aria-describedby"])
229
- ]),
230
- _: 1
231
- }, 8, ["modelValue", "options"])
232
- ])
233
- ]),
234
- default: withCtx(() => [
235
- createVNode(RequestAuthDataTable, {
236
- collection: unref(collection),
237
- envVariables: unref(envVariables),
238
- environment: unref(environment),
239
- layout: _ctx.layout,
240
- persistAuth: _ctx.persistAuth,
241
- selectedSchemeOptions: selectedSchemeOptions.value,
242
- server: _ctx.server,
243
- workspace: unref(workspace)
244
- }, null, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "selectedSchemeOptions", "server", "workspace"]),
245
- createVNode(_sfc_main$1, {
246
- scheme: selectedScheme.value,
247
- state: unref(deleteSchemeModal),
248
- onClose: _cache[0] || (_cache[0] = ($event) => unref(deleteSchemeModal).hide()),
249
- onDelete: _cache[1] || (_cache[1] = ($event) => unselectAuth(selectedScheme.value?.id))
250
- }, null, 8, ["scheme", "state"])
251
- ]),
252
- _: 1
253
- }, 8, ["itemCount", "layout"])) : createCommentVNode("", true);
254
- };
255
- }
256
- });
257
- export {
258
- _sfc_main as default
259
- };
@@ -1,21 +0,0 @@
1
- import type { SecurityScheme } from '@scalar/oas-utils/entities/spec';
2
- type __VLS_Props = {
3
- state: {
4
- open: boolean;
5
- show: () => void;
6
- hide: () => void;
7
- };
8
- scheme: {
9
- id: SecurityScheme['uid'];
10
- label: string;
11
- } | null;
12
- };
13
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
- close: () => any;
15
- delete: () => any;
16
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- onClose?: (() => any) | undefined;
18
- onDelete?: (() => any) | undefined;
19
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
- export default _default;
21
- //# sourceMappingURL=DeleteRequestAuthModal.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteRequestAuthModal.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/components/DeleteRequestAuthModal.vue"],"names":[],"mappings":"AAyDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIrE,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;IAC5D,MAAM,EAAE;QAAE,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAC5D,CAAC;;;;;;;;AAqJF,wBAOG"}
@@ -1,66 +0,0 @@
1
- import { defineComponent, useTemplateRef, createBlock, openBlock, unref, withCtx, createElementVNode, toDisplayString, createVNode, createTextVNode } from "vue";
2
- import { ScalarModal, ScalarButton } from "@scalar/components";
3
- import { emitCustomEvent } from "@scalar/workspace-store/events";
4
- const _hoisted_1 = { class: "text-c-2 mb-4 text-sm leading-normal" };
5
- const _hoisted_2 = { class: "flex justify-between gap-2" };
6
- const _sfc_main = /* @__PURE__ */ defineComponent({
7
- __name: "DeleteRequestAuthModal",
8
- props: {
9
- state: {},
10
- scheme: {}
11
- },
12
- emits: ["close", "delete"],
13
- setup(__props, { emit: __emit }) {
14
- const props = __props;
15
- const emit = __emit;
16
- const deleteScheme = () => {
17
- if (props.scheme?.id) {
18
- emitCustomEvent(wrapperRef.value?.$el, "scalar-delete-security-scheme", {
19
- uid: props.scheme.id
20
- });
21
- }
22
- emit("delete");
23
- };
24
- const wrapperRef = useTemplateRef("wrapperRef");
25
- return (_ctx, _cache) => {
26
- return openBlock(), createBlock(unref(ScalarModal), {
27
- ref_key: "wrapperRef",
28
- ref: wrapperRef,
29
- size: "xxs",
30
- state: _ctx.state,
31
- title: "Delete Security Scheme"
32
- }, {
33
- default: withCtx(() => [
34
- createElementVNode("p", _hoisted_1, " This cannot be undone. You're about to delete the " + toDisplayString(_ctx.scheme?.label) + " security scheme from the collection. ", 1),
35
- createElementVNode("div", _hoisted_2, [
36
- createVNode(unref(ScalarButton), {
37
- class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
38
- type: "button",
39
- variant: "outlined",
40
- onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
41
- }, {
42
- default: withCtx(() => [..._cache[1] || (_cache[1] = [
43
- createTextVNode(" Cancel ", -1)
44
- ])]),
45
- _: 1
46
- }),
47
- createVNode(unref(ScalarButton), {
48
- class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
49
- type: "submit",
50
- onClick: deleteScheme
51
- }, {
52
- default: withCtx(() => [
53
- createTextVNode(" Delete " + toDisplayString(_ctx.scheme?.label), 1)
54
- ]),
55
- _: 1
56
- })
57
- ])
58
- ]),
59
- _: 1
60
- }, 8, ["state"]);
61
- };
62
- }
63
- });
64
- export {
65
- _sfc_main as default
66
- };
@@ -1,4 +0,0 @@
1
- import _sfc_main from "./DeleteRequestAuthModal.vue.js";
2
- export {
3
- _sfc_main as default
4
- };
@@ -1,17 +0,0 @@
1
- import { type EnvVariable } from '@scalar/api-client/store';
2
- import type { Environment } from '@scalar/oas-utils/entities/environment';
3
- import { type Collection, type Oauth2Flow, type SecuritySchemeOauth2, type Server } from '@scalar/oas-utils/entities/spec';
4
- import type { Workspace } from '@scalar/oas-utils/entities/workspace';
5
- type __VLS_Props = {
6
- collection: Collection;
7
- environment: Environment;
8
- envVariables: EnvVariable[];
9
- flow: Oauth2Flow;
10
- persistAuth: boolean;
11
- scheme: SecuritySchemeOauth2;
12
- server: Server | undefined;
13
- workspace: Workspace;
14
- };
15
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
- export default _default;
17
- //# sourceMappingURL=OAuth2.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../src/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AAuRA,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,MAAM,EACZ,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAQrE,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA4hBF,wBAMG"}