@scalar/api-client 2.7.0 → 2.8.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 (209) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +1 -1
  3. package/dist/components/DataTable/DataTableInputSelect.vue.d.ts.map +1 -1
  4. package/dist/components/DataTable/DataTableInputSelect.vue.js +21 -22
  5. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  6. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +4 -5
  7. package/dist/components/ImportCollection/WorkspaceSelector.vue.d.ts.map +1 -1
  8. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +13 -14
  9. package/dist/components/Sidebar/SidebarButton.vue.d.ts.map +1 -1
  10. package/dist/components/Sidebar/SidebarButton.vue.js +0 -1
  11. package/dist/hooks/useClientConfig.d.ts +30 -36
  12. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  13. package/dist/hooks/useResponseBody.js +6 -6
  14. package/dist/layouts/App/create-api-client-app.d.ts +16 -16
  15. package/dist/layouts/Modal/create-api-client-modal.d.ts +32 -32
  16. package/dist/layouts/Web/create-api-client-web.d.ts +16 -16
  17. package/dist/libs/create-client.d.ts +16 -16
  18. package/dist/libs/hot-keys.d.ts +1 -1
  19. package/dist/libs/send-request/create-request-operation.d.ts +2 -2
  20. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  21. package/dist/libs/send-request/create-request-operation.js +19 -19
  22. package/dist/plugins/plugin-manager.d.ts +2 -2
  23. package/dist/plugins/plugin-manager.d.ts.map +1 -1
  24. package/dist/store/active-entities.d.ts +1 -1
  25. package/dist/store/store.d.ts +16 -16
  26. package/dist/store/workspace.d.ts +12 -12
  27. package/dist/style.css +1 -1
  28. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  29. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +2 -3
  30. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  31. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  32. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +70 -71
  33. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +1 -1
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +1 -1
  36. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +31 -32
  37. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.test.d.ts +2 -0
  38. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.test.d.ts.map +1 -0
  39. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts +39 -0
  40. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts.map +1 -0
  41. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.js +7 -0
  42. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue2.js +226 -0
  43. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts +66 -0
  44. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts.map +1 -0
  45. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.js +7 -0
  46. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue2.js +200 -0
  47. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.test.d.ts +2 -0
  48. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.test.d.ts.map +1 -0
  49. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts +51 -0
  50. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts.map +1 -0
  51. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.js +89 -0
  52. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue2.js +4 -0
  53. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.test.d.ts +2 -0
  54. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.test.d.ts.map +1 -0
  55. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts +46 -0
  56. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts.map +1 -0
  57. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.js +7 -0
  58. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue2.js +85 -0
  59. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.test.d.ts +2 -0
  60. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.test.d.ts.map +1 -0
  61. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts +43 -0
  62. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts.map +1 -0
  63. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.js +193 -0
  64. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue2.js +4 -0
  65. package/dist/v2/blocks/scalar-operation-block/components/OperationTableTooltip.test.d.ts +2 -0
  66. package/dist/v2/blocks/scalar-operation-block/components/OperationTableTooltip.test.d.ts.map +1 -0
  67. package/dist/v2/blocks/scalar-operation-block/components/OperationTableTooltip.vue.d.ts +8 -0
  68. package/dist/v2/blocks/scalar-operation-block/components/OperationTableTooltip.vue.d.ts.map +1 -0
  69. package/dist/v2/blocks/scalar-operation-block/components/OperationTableTooltip.vue.js +7 -0
  70. package/dist/v2/blocks/scalar-operation-block/components/OperationTableTooltip.vue2.js +62 -0
  71. package/dist/v2/blocks/scalar-operation-block/helpers/file.test.d.ts +2 -0
  72. package/dist/v2/blocks/scalar-operation-block/helpers/file.test.d.ts.map +1 -0
  73. package/dist/v2/blocks/scalar-operation-block/helpers/files.d.ts +5 -0
  74. package/dist/v2/blocks/scalar-operation-block/helpers/files.d.ts.map +1 -0
  75. package/dist/v2/blocks/scalar-operation-block/helpers/files.js +7 -0
  76. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-content.d.ts +8 -0
  77. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-content.d.ts.map +1 -0
  78. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-content.js +9 -0
  79. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-content.test.d.ts +2 -0
  80. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-content.test.d.ts.map +1 -0
  81. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-example.d.ts +6 -0
  82. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-example.d.ts.map +1 -0
  83. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-example.js +12 -0
  84. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-example.test.d.ts +2 -0
  85. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-example.test.d.ts.map +1 -0
  86. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-schema.d.ts +6 -0
  87. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-schema.d.ts.map +1 -0
  88. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-schema.js +6 -0
  89. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-schema.test.d.ts +2 -0
  90. package/dist/v2/blocks/scalar-operation-block/helpers/get-parameter-schema.test.d.ts.map +1 -0
  91. package/dist/v2/blocks/scalar-operation-block/helpers/get-request-body-example.d.ts +3 -0
  92. package/dist/v2/blocks/scalar-operation-block/helpers/get-request-body-example.d.ts.map +1 -0
  93. package/dist/v2/blocks/scalar-operation-block/helpers/get-request-body-example.js +5 -0
  94. package/dist/v2/blocks/scalar-operation-block/helpers/group-by.d.ts +5 -0
  95. package/dist/v2/blocks/scalar-operation-block/helpers/group-by.d.ts.map +1 -0
  96. package/dist/v2/blocks/scalar-operation-block/helpers/group-by.js +7 -0
  97. package/dist/v2/blocks/scalar-operation-block/helpers/group-by.test.d.ts +2 -0
  98. package/dist/v2/blocks/scalar-operation-block/helpers/group-by.test.d.ts.map +1 -0
  99. package/dist/v2/blocks/scalar-operation-block/helpers/validate-parameter.d.ts +11 -0
  100. package/dist/v2/blocks/scalar-operation-block/helpers/validate-parameter.d.ts.map +1 -0
  101. package/dist/v2/blocks/scalar-operation-block/helpers/validate-parameter.js +32 -0
  102. package/dist/v2/blocks/scalar-operation-block/helpers/validate-parameter.test.d.ts +2 -0
  103. package/dist/v2/blocks/scalar-operation-block/helpers/validate-parameter.test.d.ts.map +1 -0
  104. package/dist/v2/blocks/scalar-operation-block/index.d.ts +2 -0
  105. package/dist/v2/blocks/scalar-operation-block/index.d.ts.map +1 -0
  106. package/dist/v2/blocks/scalar-operation-block/index.js +4 -0
  107. package/dist/v2/blocks/scalar-response-block/components/Headers.test.d.ts +2 -0
  108. package/dist/v2/blocks/scalar-response-block/components/Headers.test.d.ts.map +1 -0
  109. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts +20 -0
  110. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts.map +1 -0
  111. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.js +98 -0
  112. package/dist/v2/blocks/scalar-response-block/components/Headers.vue2.js +4 -0
  113. package/dist/v2/blocks/scalar-response-block/components/ResponseBlock.test.d.ts +2 -0
  114. package/dist/v2/blocks/scalar-response-block/components/ResponseBlock.test.d.ts.map +1 -0
  115. package/dist/v2/blocks/scalar-response-block/components/ResponseBlock.vue.d.ts +47 -0
  116. package/dist/v2/blocks/scalar-response-block/components/ResponseBlock.vue.d.ts.map +1 -0
  117. package/dist/v2/blocks/scalar-response-block/components/ResponseBlock.vue.js +7 -0
  118. package/dist/v2/blocks/scalar-response-block/components/ResponseBlock.vue2.js +182 -0
  119. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.d.ts +12 -0
  120. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.d.ts.map +1 -0
  121. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.js +7 -0
  122. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue2.js +88 -0
  123. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyDownload.test.d.ts +2 -0
  124. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyDownload.test.d.ts.map +1 -0
  125. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyDownload.vue.d.ts +8 -0
  126. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyDownload.vue.d.ts.map +1 -0
  127. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyDownload.vue.js +36 -0
  128. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyDownload.vue2.js +4 -0
  129. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyInfo.vue.d.ts +13 -0
  130. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyInfo.vue.d.ts.map +1 -0
  131. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyInfo.vue.js +14 -0
  132. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyPreview.test.d.ts +2 -0
  133. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyPreview.test.d.ts.map +1 -0
  134. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyPreview.vue.d.ts +10 -0
  135. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyPreview.vue.d.ts.map +1 -0
  136. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyPreview.vue.js +7 -0
  137. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyPreview.vue2.js +64 -0
  138. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyRaw.vue.d.ts +8 -0
  139. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyRaw.vue.d.ts.map +1 -0
  140. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyRaw.vue.js +7 -0
  141. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyRaw.vue2.js +41 -0
  142. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.test.d.ts +2 -0
  143. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.test.d.ts.map +1 -0
  144. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.d.ts +6 -0
  145. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -0
  146. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.js +74 -0
  147. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue2.js +4 -0
  148. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyToggle.vue.d.ts +10 -0
  149. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyToggle.vue.d.ts.map +1 -0
  150. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyToggle.vue.js +25 -0
  151. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyToggle.vue2.js +4 -0
  152. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.d.ts +11 -0
  153. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -0
  154. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.js +52 -0
  155. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue3.js +5 -0
  156. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.test.d.ts +2 -0
  157. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.test.d.ts.map +1 -0
  158. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.d.ts +9 -0
  159. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.d.ts.map +1 -0
  160. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.js +54 -0
  161. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue2.js +4 -0
  162. package/dist/v2/blocks/scalar-response-block/components/ResponseEmpty.vue.d.ts +23 -0
  163. package/dist/v2/blocks/scalar-response-block/components/ResponseEmpty.vue.d.ts.map +1 -0
  164. package/dist/v2/blocks/scalar-response-block/components/ResponseEmpty.vue.js +7 -0
  165. package/dist/v2/blocks/scalar-response-block/components/ResponseEmpty.vue2.js +88 -0
  166. package/dist/v2/blocks/scalar-response-block/components/ResponseLoadingOverlay.vue.d.ts +8 -0
  167. package/dist/v2/blocks/scalar-response-block/components/ResponseLoadingOverlay.vue.d.ts.map +1 -0
  168. package/dist/v2/blocks/scalar-response-block/components/ResponseLoadingOverlay.vue.js +7 -0
  169. package/dist/v2/blocks/scalar-response-block/components/ResponseLoadingOverlay.vue2.js +41 -0
  170. package/dist/v2/blocks/scalar-response-block/components/ResponseMetaInformation.vue.d.ts +10 -0
  171. package/dist/v2/blocks/scalar-response-block/components/ResponseMetaInformation.vue.d.ts.map +1 -0
  172. package/dist/v2/blocks/scalar-response-block/components/ResponseMetaInformation.vue.js +61 -0
  173. package/dist/v2/blocks/scalar-response-block/components/ResponseMetaInformation.vue2.js +4 -0
  174. package/dist/v2/blocks/scalar-response-block/helpers/extract-filename.d.ts +5 -0
  175. package/dist/v2/blocks/scalar-response-block/helpers/extract-filename.d.ts.map +1 -0
  176. package/dist/v2/blocks/scalar-response-block/helpers/extract-filename.js +18 -0
  177. package/dist/v2/blocks/scalar-response-block/helpers/extract-filename.test.d.ts +2 -0
  178. package/dist/v2/blocks/scalar-response-block/helpers/extract-filename.test.d.ts.map +1 -0
  179. package/dist/v2/blocks/scalar-response-block/helpers/get-content-length.d.ts +4 -0
  180. package/dist/v2/blocks/scalar-response-block/helpers/get-content-length.d.ts.map +1 -0
  181. package/dist/v2/blocks/scalar-response-block/helpers/get-content-length.js +12 -0
  182. package/dist/v2/blocks/scalar-response-block/helpers/get-content-length.test.d.ts +2 -0
  183. package/dist/v2/blocks/scalar-response-block/helpers/get-content-length.test.d.ts.map +1 -0
  184. package/dist/v2/blocks/scalar-response-block/helpers/media-types.d.ts +20 -0
  185. package/dist/v2/blocks/scalar-response-block/helpers/media-types.d.ts.map +1 -0
  186. package/dist/v2/blocks/scalar-response-block/helpers/media-types.js +127 -0
  187. package/dist/v2/blocks/scalar-response-block/helpers/media-types.test.d.ts +2 -0
  188. package/dist/v2/blocks/scalar-response-block/helpers/media-types.test.d.ts.map +1 -0
  189. package/dist/v2/blocks/scalar-response-block/helpers/process-response-body.d.ts +17 -0
  190. package/dist/v2/blocks/scalar-response-block/helpers/process-response-body.d.ts.map +1 -0
  191. package/dist/v2/blocks/scalar-response-block/helpers/process-response-body.js +16 -0
  192. package/dist/v2/blocks/scalar-response-block/helpers/process-response-body.test.d.ts +2 -0
  193. package/dist/v2/blocks/scalar-response-block/helpers/process-response-body.test.d.ts.map +1 -0
  194. package/dist/v2/blocks/scalar-response-block/index.d.ts +2 -0
  195. package/dist/v2/blocks/scalar-response-block/index.d.ts.map +1 -0
  196. package/dist/v2/blocks/scalar-response-block/index.js +4 -0
  197. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  198. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  199. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +31 -32
  200. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  201. package/dist/views/Request/RequestSection/RequestBody.vue.js +2 -2
  202. package/dist/views/Request/RequestSection/RequestBody.vue2.js +0 -1
  203. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  204. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  205. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +13 -14
  206. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  207. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  208. package/dist/views/Request/components/WorkspaceDropdown.vue.js +5 -6
  209. package/package.json +17 -17
@@ -0,0 +1,226 @@
1
+ import { defineComponent as g, ref as D, computed as f, useId as q, watch as O, createBlock as U, openBlock as y, withCtx as k, withDirectives as p, createVNode as s, unref as o, vShow as m, createElementVNode as T, createElementBlock as b, createCommentVNode as N, toDisplayString as H } from "vue";
2
+ import { canMethodHaveBody as V, REGEX as K } from "@scalar/oas-utils/helpers";
3
+ import { getResolvedRef as R } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
+ import I from "../../../../components/SectionFilter.vue.js";
5
+ import E from "../../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
+ import P from "./OperationBody.vue.js";
7
+ import v from "./OperationParams.vue.js";
8
+ import { groupBy as Q } from "../helpers/group-by.js";
9
+ import $ from "../../scalar-auth-selector-block/components/AuthSelector.vue.js";
10
+ const j = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24" }, z = ["for"], F = ["id", "placeholder", "value"], L = {
11
+ key: 2,
12
+ class: "text-c-1 flex h-8 items-center"
13
+ }, _ = /* @__PURE__ */ g({
14
+ __name: "OperationBlock",
15
+ props: {
16
+ method: {},
17
+ path: {},
18
+ operation: {},
19
+ exampleKey: {},
20
+ selectedContentType: {},
21
+ securitySchemes: {},
22
+ selectedSecurity: {},
23
+ security: {},
24
+ server: {},
25
+ layout: {},
26
+ environment: {},
27
+ envVariables: {}
28
+ },
29
+ emits: ["operation:update:requestName", "auth:delete", "auth:update:securityScheme", "auth:update:selectedScopes", "auth:update:selectedSecurity", "parameters:add", "parameters:update", "parameters:delete", "parameters:deleteAll", "requestBody:update:contentType", "requestBody:update:value", "requestBody:add:formRow", "requestBody:update:formRow"],
30
+ setup(l, { emit: h }) {
31
+ const a = h, i = Q(
32
+ l.operation.parameters?.map((r) => R(r)) ?? [],
33
+ "in"
34
+ ), w = [
35
+ "Auth",
36
+ "Variables",
37
+ "Cookies",
38
+ "Headers",
39
+ "Query",
40
+ "Body"
41
+ ], d = D("All"), A = f(() => {
42
+ const r = /* @__PURE__ */ new Set(["All", ...w]);
43
+ return i.path?.length || r.delete("Variables"), V(l.method) || r.delete("Body"), S.value && r.delete("Auth"), [...r];
44
+ }), n = f(
45
+ () => Object.fromEntries(
46
+ A.value.map((r) => [r, q()])
47
+ )
48
+ );
49
+ O(
50
+ () => l.method,
51
+ (r) => {
52
+ d.value === "Body" && !V(r) && (d.value = "All");
53
+ }
54
+ );
55
+ const S = f(
56
+ () => l.layout === "modal" && !l.operation.security && !Object.keys(l.securitySchemes ?? {}).length
57
+ ), C = () => l.operation.summary ? l.operation.summary : l.path.replace(K.PROTOCOL, "") ? l.path.replace(K.PROTOCOL, "") : "Request Name", u = (r) => d.value === "All" || d.value === r, B = q();
58
+ return (r, e) => (y(), U(E, {
59
+ "aria-label": `Request: ${r.operation.summary}`
60
+ }, {
61
+ title: k(() => [
62
+ T("div", j, [
63
+ r.layout !== "modal" ? (y(), b("label", {
64
+ key: 0,
65
+ class: "pointer-events-auto absolute top-0 left-0 h-full w-full cursor-text opacity-0",
66
+ for: o(B)
67
+ }, null, 8, z)) : N("", !0),
68
+ r.layout !== "modal" ? (y(), b("input", {
69
+ key: 1,
70
+ id: o(B),
71
+ class: "text-c-1 group-hover-input pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded pl-1.25 has-[:focus-visible]:outline md:-ml-1.25",
72
+ placeholder: C(),
73
+ value: r.operation.summary,
74
+ onInput: e[0] || (e[0] = (t) => a("operation:update:requestName", {
75
+ name: t.target.value
76
+ }))
77
+ }, null, 40, F)) : (y(), b("span", L, H(r.operation.summary), 1))
78
+ ]),
79
+ s(I, {
80
+ modelValue: d.value,
81
+ "onUpdate:modelValue": e[1] || (e[1] = (t) => d.value = t),
82
+ filterIds: n.value,
83
+ filters: A.value
84
+ }, null, 8, ["modelValue", "filterIds", "filters"])
85
+ ]),
86
+ default: k(() => [
87
+ p(s(o($), {
88
+ id: n.value.Auth,
89
+ envVariables: r.envVariables,
90
+ environment: r.environment,
91
+ layout: "client",
92
+ security: r.security,
93
+ securitySchemes: r.securitySchemes,
94
+ selectedSecurity: r.selectedSecurity,
95
+ server: r.server,
96
+ title: "Authorization",
97
+ onDeleteOperationAuth: e[2] || (e[2] = (t) => a("auth:delete", t)),
98
+ "onUpdate:securityScheme": e[3] || (e[3] = (t) => a("auth:update:securityScheme", t)),
99
+ "onUpdate:selectedScopes": e[4] || (e[4] = (t) => a("auth:update:selectedScopes", t)),
100
+ "onUpdate:selectedSecurity": e[5] || (e[5] = (t) => a("auth:update:selectedSecurity", t))
101
+ }, null, 8, ["id", "envVariables", "environment", "security", "securitySchemes", "selectedSecurity", "server"]), [
102
+ [m, u("Auth") && !S.value]
103
+ ]),
104
+ p(s(v, {
105
+ id: n.value.Variables,
106
+ envVariables: r.envVariables,
107
+ environment: r.environment,
108
+ exampleKey: r.exampleKey,
109
+ parameters: o(i).path ?? [],
110
+ title: "Variables",
111
+ onAdd: e[6] || (e[6] = (t) => a("parameters:add", {
112
+ type: "path",
113
+ payload: t
114
+ })),
115
+ onDelete: e[7] || (e[7] = (t) => a("parameters:delete", {
116
+ type: "path",
117
+ ...t
118
+ })),
119
+ onDeleteAll: e[8] || (e[8] = () => a("parameters:deleteAll", {
120
+ type: "path"
121
+ })),
122
+ onUpdate: e[9] || (e[9] = (t) => a("parameters:update", {
123
+ type: "path",
124
+ ...t
125
+ }))
126
+ }, null, 8, ["id", "envVariables", "environment", "exampleKey", "parameters"]), [
127
+ [m, u("Variables") && o(i).path?.length]
128
+ ]),
129
+ p(s(v, {
130
+ id: n.value.Cookies,
131
+ envVariables: r.envVariables,
132
+ environment: r.environment,
133
+ exampleKey: r.exampleKey,
134
+ parameters: o(i).cookie ?? [],
135
+ title: "Cookies",
136
+ onAdd: e[10] || (e[10] = (t) => a("parameters:add", {
137
+ type: "cookie",
138
+ payload: t
139
+ })),
140
+ onDelete: e[11] || (e[11] = (t) => a("parameters:delete", {
141
+ type: "cookie",
142
+ ...t
143
+ })),
144
+ onDeleteAll: e[12] || (e[12] = () => a("parameters:deleteAll", {
145
+ type: "cookie"
146
+ })),
147
+ onUpdate: e[13] || (e[13] = (t) => a("parameters:update", {
148
+ type: "cookie",
149
+ ...t
150
+ }))
151
+ }, null, 8, ["id", "envVariables", "environment", "exampleKey", "parameters"]), [
152
+ [m, u("Cookies")]
153
+ ]),
154
+ p(s(v, {
155
+ id: n.value.Headers,
156
+ envVariables: r.envVariables,
157
+ environment: r.environment,
158
+ exampleKey: r.exampleKey,
159
+ parameters: o(i).header ?? [],
160
+ title: "Headers",
161
+ onAdd: e[14] || (e[14] = (t) => a("parameters:add", {
162
+ type: "header",
163
+ payload: t
164
+ })),
165
+ onDelete: e[15] || (e[15] = (t) => a("parameters:delete", {
166
+ type: "header",
167
+ ...t
168
+ })),
169
+ onDeleteAll: e[16] || (e[16] = () => a("parameters:deleteAll", {
170
+ type: "header"
171
+ })),
172
+ onUpdate: e[17] || (e[17] = (t) => a("parameters:update", {
173
+ type: "header",
174
+ ...t
175
+ }))
176
+ }, null, 8, ["id", "envVariables", "environment", "exampleKey", "parameters"]), [
177
+ [m, u("Headers")]
178
+ ]),
179
+ p(s(v, {
180
+ id: n.value.Query,
181
+ envVariables: r.envVariables,
182
+ environment: r.environment,
183
+ exampleKey: r.exampleKey,
184
+ parameters: o(i).query ?? [],
185
+ title: "Query Parameters",
186
+ onAdd: e[18] || (e[18] = (t) => a("parameters:add", {
187
+ type: "query",
188
+ payload: t
189
+ })),
190
+ onDelete: e[19] || (e[19] = (t) => a("parameters:delete", {
191
+ type: "query",
192
+ ...t
193
+ })),
194
+ onDeleteAll: e[20] || (e[20] = () => a("parameters:deleteAll", {
195
+ type: "query"
196
+ })),
197
+ onUpdate: e[21] || (e[21] = (t) => a("parameters:update", {
198
+ type: "query",
199
+ ...t
200
+ }))
201
+ }, null, 8, ["id", "envVariables", "environment", "exampleKey", "parameters"]), [
202
+ [m, u("Query")]
203
+ ]),
204
+ p(s(P, {
205
+ id: n.value.Body,
206
+ envVariables: r.envVariables,
207
+ environment: r.environment,
208
+ exampleKey: r.exampleKey,
209
+ requestBody: o(R)(r.operation.requestBody),
210
+ selectedContentType: r.selectedContentType ?? "other",
211
+ title: "Request Body",
212
+ "onAdd:formRow": e[22] || (e[22] = (t) => a("requestBody:add:formRow", t)),
213
+ "onUpdate:contentType": e[23] || (e[23] = (t) => a("requestBody:update:contentType", t)),
214
+ "onUpdate:formRow": e[24] || (e[24] = (t) => a("requestBody:update:formRow", t)),
215
+ "onUpdate:value": e[25] || (e[25] = (t) => a("requestBody:update:value", t))
216
+ }, null, 8, ["id", "envVariables", "environment", "exampleKey", "requestBody", "selectedContentType"]), [
217
+ [m, u("Body") && o(V)(r.method)]
218
+ ])
219
+ ]),
220
+ _: 1
221
+ }, 8, ["aria-label"]));
222
+ }
223
+ });
224
+ export {
225
+ _ as default
226
+ };
@@ -0,0 +1,66 @@
1
+ import type { Environment } from '@scalar/oas-utils/entities/environment';
2
+ import type { RequestBodyObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ import type { EnvVariable } from '../../../../store/active-entities.js';
4
+ type __VLS_Props = {
5
+ /** Request body */
6
+ requestBody?: RequestBodyObject;
7
+ /** Currently selected content type for the current operation */
8
+ selectedContentType: keyof typeof contentTypes | (string & {});
9
+ /** Currently selected example key for the current operation */
10
+ exampleKey: string;
11
+ /** Display title */
12
+ title: string;
13
+ /** TODO: remove when we do the migration */
14
+ environment: Environment;
15
+ envVariables: EnvVariable[];
16
+ };
17
+ declare const contentTypes: {
18
+ readonly 'multipart/form-data': "Multipart Form";
19
+ readonly 'application/x-www-form-urlencoded': "Form URL Encoded";
20
+ readonly 'application/octet-stream': "Binary File";
21
+ readonly 'application/json': "JSON";
22
+ readonly 'application/xml': "XML";
23
+ readonly 'application/yaml': "YAML";
24
+ readonly 'application/edn': "EDN";
25
+ readonly other: "Other";
26
+ readonly none: "None";
27
+ };
28
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
+ "update:contentType": (payload: {
30
+ value: string;
31
+ }) => any;
32
+ "update:value": (payload: {
33
+ value?: string | File;
34
+ }) => any;
35
+ "add:formRow": (payload: Partial<{
36
+ key: string;
37
+ value?: string | File;
38
+ }>) => any;
39
+ "update:formRow": (payload: {
40
+ index: number;
41
+ payload: Partial<{
42
+ key: string;
43
+ value?: string | File;
44
+ }>;
45
+ }) => any;
46
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
47
+ "onUpdate:contentType"?: ((payload: {
48
+ value: string;
49
+ }) => any) | undefined;
50
+ "onUpdate:value"?: ((payload: {
51
+ value?: string | File;
52
+ }) => any) | undefined;
53
+ "onAdd:formRow"?: ((payload: Partial<{
54
+ key: string;
55
+ value?: string | File;
56
+ }>) => any) | undefined;
57
+ "onUpdate:formRow"?: ((payload: {
58
+ index: number;
59
+ payload: Partial<{
60
+ key: string;
61
+ value?: string | File;
62
+ }>;
63
+ }) => any) | undefined;
64
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
65
+ export default _default;
66
+ //# sourceMappingURL=OperationBody.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationBody.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/components/OperationBody.vue"],"names":[],"mappings":"AA6PA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8DAA8D,CAAA;AAUrG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK1D,KAAK,WAAW,GAAG;IACjB,mBAAmB;IACnB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,gEAAgE;IAChE,mBAAmB,EAAE,MAAM,OAAO,YAAY,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IAC9D,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAA;IAEb,4CAA4C;IAC5C,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;AAoCF,QAAA,MAAM,YAAY;;;;;;;;;;CAUR,CAAA;;;eAnCoC,MAAM;;;gBAEX,MAAM,GAAG,IAAI;;;aAI1B,MAAM;gBAAU,MAAM,GAAG,IAAI;;;eAK5C,MAAM;iBACJ,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;;;;eAZhB,MAAM;;;gBAEX,MAAM,GAAG,IAAI;;;aAI1B,MAAM;gBAAU,MAAM,GAAG,IAAI;;;eAK5C,MAAM;iBACJ,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;;;AA+c9D,wBAOG"}
@@ -0,0 +1,7 @@
1
+ import o from "./OperationBody.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-24f1e4f2"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,200 @@
1
+ import { defineComponent as j, computed as g, createBlock as u, openBlock as i, withCtx as a, createVNode as r, unref as l, createElementVNode as m, toDisplayString as f, createElementBlock as c, Fragment as F, createTextVNode as T } from "vue";
2
+ import { ScalarListbox as h, ScalarButton as y, ScalarIcon as x } from "@scalar/components";
3
+ import N from "../../../../components/CodeInput/CodeInput.vue.js";
4
+ import O from "../../../../components/DataTable/DataTable.vue.js";
5
+ import U from "../../../../components/DataTable/DataTableHeader.vue.js";
6
+ import D from "../../../../components/DataTable/DataTableRow.vue.js";
7
+ import R from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
8
+ import V from "./OperationTable.vue.js";
9
+ import { getFileName as C } from "../helpers/files.js";
10
+ import { getExampleFromBody as S } from "../helpers/get-request-body-example.js";
11
+ import { useFileDialog as E } from "../../../../hooks/useFileDialog.js";
12
+ const L = {
13
+ key: 0,
14
+ class: "text-c-3 flex min-h-10 w-full items-center justify-center border-t p-2 text-sm"
15
+ }, M = {
16
+ key: 1,
17
+ class: "flex items-center justify-center overflow-hidden border-t p-1.5"
18
+ }, z = { class: "text-c-2 w-full max-w-full overflow-hidden rounded border px-1.5 py-1 text-xs whitespace-nowrap" }, Q = /* @__PURE__ */ j({
19
+ __name: "OperationBody",
20
+ props: {
21
+ requestBody: {},
22
+ selectedContentType: {},
23
+ exampleKey: {},
24
+ title: {},
25
+ environment: {},
26
+ envVariables: {}
27
+ },
28
+ emits: ["update:contentType", "update:value", "add:formRow", "update:formRow"],
29
+ setup(d, { emit: k }) {
30
+ const p = k, B = {
31
+ "application/json": "json",
32
+ "application/xml": "xml",
33
+ "application/yaml": "yaml"
34
+ }, v = Object.entries({
35
+ "multipart/form-data": "Multipart Form",
36
+ "application/x-www-form-urlencoded": "Form URL Encoded",
37
+ "application/octet-stream": "Binary File",
38
+ "application/json": "JSON",
39
+ "application/xml": "XML",
40
+ "application/yaml": "YAML",
41
+ "application/edn": "EDN",
42
+ other: "Other",
43
+ none: "None"
44
+ }).map(([t, e]) => ({
45
+ id: t,
46
+ label: e
47
+ })), b = g({
48
+ get: () => v.find((e) => e.id === d.selectedContentType) ?? v.at(-1),
49
+ set: (t) => {
50
+ p("update:contentType", { value: t.id });
51
+ }
52
+ });
53
+ function w(t) {
54
+ const { open: e } = E({
55
+ onChange: async (n) => {
56
+ const o = n?.[0];
57
+ o && t(o);
58
+ },
59
+ multiple: !1,
60
+ accept: "*/*"
61
+ });
62
+ e();
63
+ }
64
+ const s = g(
65
+ () => d.requestBody && S(d.requestBody, d.selectedContentType, d.exampleKey)
66
+ );
67
+ return (t, e) => (i(), u(R, null, {
68
+ title: a(() => [
69
+ T(f(t.title), 1)
70
+ ]),
71
+ default: a(() => [
72
+ r(O, {
73
+ columns: [""],
74
+ presentational: ""
75
+ }, {
76
+ default: a(() => [
77
+ r(U, { class: "relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0" }, {
78
+ default: a(() => [
79
+ r(l(h), {
80
+ modelValue: b.value,
81
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => b.value = n),
82
+ options: l(v),
83
+ teleport: ""
84
+ }, {
85
+ default: a(() => [
86
+ r(l(y), {
87
+ class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-3 font-normal",
88
+ fullWidth: "",
89
+ variant: "ghost"
90
+ }, {
91
+ default: a(() => [
92
+ m("span", null, f(t.selectedContentType), 1),
93
+ r(l(x), {
94
+ icon: "ChevronDown",
95
+ size: "md"
96
+ })
97
+ ]),
98
+ _: 1
99
+ })
100
+ ]),
101
+ _: 1
102
+ }, 8, ["modelValue", "options"])
103
+ ]),
104
+ _: 1
105
+ }),
106
+ r(D, null, {
107
+ default: a(() => [
108
+ t.selectedContentType === "none" ? (i(), c("div", L, e[5] || (e[5] = [
109
+ m("span", null, "No Body", -1)
110
+ ]))) : t.selectedContentType === "application/octet-stream" ? (i(), c("div", M, [
111
+ l(C)(s.value?.value) !== void 0 ? (i(), c(F, { key: 0 }, [
112
+ m("span", z, f(l(C)(s.value?.value)), 1),
113
+ r(l(y), {
114
+ class: "bg-b-2 hover:bg-b-3 text-c-2 ml-1 border-0 shadow-none",
115
+ size: "sm",
116
+ variant: "outlined",
117
+ onClick: e[1] || (e[1] = (n) => p("update:value", { value: void 0 }))
118
+ }, {
119
+ default: a(() => e[6] || (e[6] = [
120
+ T(" Delete ")
121
+ ])),
122
+ _: 1,
123
+ __: [6]
124
+ })
125
+ ], 64)) : (i(), u(l(y), {
126
+ key: 1,
127
+ class: "bg-b-2 hover:bg-b-3 text-c-2 border-0 shadow-none",
128
+ size: "sm",
129
+ variant: "outlined",
130
+ onClick: e[2] || (e[2] = () => w(
131
+ (n) => p("update:value", { value: n })
132
+ ))
133
+ }, {
134
+ default: a(() => [
135
+ e[7] || (e[7] = m("span", null, "Upload File", -1)),
136
+ r(l(x), {
137
+ class: "ml-1",
138
+ icon: "Upload",
139
+ size: "xs",
140
+ thickness: "2.5"
141
+ })
142
+ ]),
143
+ _: 1,
144
+ __: [7]
145
+ }))
146
+ ])) : t.selectedContentType === "multipart/form-data" ? (i(), u(V, {
147
+ key: 2,
148
+ data: Object.entries(
149
+ typeof s.value?.value == "object" ? s.value.value ?? {} : {}
150
+ ).map(([n, o]) => ({
151
+ name: n,
152
+ value: o
153
+ })),
154
+ envVariables: t.envVariables,
155
+ environment: t.environment,
156
+ showUploadButton: "",
157
+ onUploadFile: e[3] || (e[3] = (n) => w((o) => {
158
+ if (n !== void 0)
159
+ return p("update:formRow", {
160
+ index: n,
161
+ payload: { value: o ?? void 0 }
162
+ });
163
+ p("add:formRow", { value: o ?? void 0 });
164
+ }))
165
+ }, null, 8, ["data", "envVariables", "environment"])) : t.selectedContentType === "application/x-www-form-urlencoded" ? (i(), u(V, {
166
+ key: 3,
167
+ data: Object.entries(
168
+ typeof s.value?.value == "object" ? s.value.value : {}
169
+ ).map(([n, o]) => ({
170
+ name: n,
171
+ value: String(o)
172
+ })),
173
+ envVariables: t.envVariables,
174
+ environment: t.environment
175
+ }, null, 8, ["data", "envVariables", "environment"])) : (i(), u(N, {
176
+ key: 4,
177
+ class: "border-t px-3",
178
+ content: "",
179
+ envVariables: t.envVariables,
180
+ environment: t.environment,
181
+ language: B[t.selectedContentType] ?? "plaintext",
182
+ lineNumbers: "",
183
+ lint: "",
184
+ modelValue: s.value?.value ?? "",
185
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => p("update:value", { value: n }))
186
+ }, null, 8, ["envVariables", "environment", "language", "modelValue"]))
187
+ ]),
188
+ _: 1
189
+ })
190
+ ]),
191
+ _: 1
192
+ })
193
+ ]),
194
+ _: 1
195
+ }));
196
+ }
197
+ });
198
+ export {
199
+ Q as default
200
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=OperationParams.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationParams.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/components/OperationParams.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import type { Environment } from '@scalar/oas-utils/entities/environment';
2
+ import type { ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ import type { EnvVariable } from '../../../../store/active-entities.js';
4
+ type __VLS_Props = {
5
+ parameters: ParameterObject[];
6
+ exampleKey: string;
7
+ title: string;
8
+ label?: string;
9
+ invalidParams?: Set<string>;
10
+ globalRoute?: string;
11
+ /** TODO: remove as soon as we migrate to everything to the new store */
12
+ environment: Environment;
13
+ envVariables: EnvVariable[];
14
+ };
15
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
+ delete: (payload: {
17
+ index: number;
18
+ }) => any;
19
+ add: (payload: Partial<{
20
+ key: string;
21
+ value: string;
22
+ }>) => any;
23
+ update: (payload: {
24
+ index: number;
25
+ payload: Partial<{
26
+ key: string;
27
+ value: string;
28
+ isEnabled: boolean;
29
+ }>;
30
+ }) => any;
31
+ deleteAll: () => any;
32
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
33
+ onDelete?: ((payload: {
34
+ index: number;
35
+ }) => any) | undefined;
36
+ onAdd?: ((payload: Partial<{
37
+ key: string;
38
+ value: string;
39
+ }>) => any) | undefined;
40
+ onUpdate?: ((payload: {
41
+ index: number;
42
+ payload: Partial<{
43
+ key: string;
44
+ value: string;
45
+ isEnabled: boolean;
46
+ }>;
47
+ }) => any) | undefined;
48
+ onDeleteAll?: (() => any) | undefined;
49
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
+ export default _default;
51
+ //# sourceMappingURL=OperationParams.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationParams.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/components/OperationParams.vue"],"names":[],"mappings":"AAuGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAInG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAM1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,eAAe,EAAE,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wEAAwE;IACxE,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAC;;;eAmBgC,MAAM;;;aARH,MAAM;eAAS,MAAM;;;eAI7C,MAAM;iBACJ,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,OAAO,CAAA;SAAE,CAAC;;;;;eAGxC,MAAM;;;aARH,MAAM;eAAS,MAAM;;;eAI7C,MAAM;iBACJ,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,OAAO,CAAA;SAAE,CAAC;;;;AAoL1E,wBAOG"}
@@ -0,0 +1,89 @@
1
+ import { defineComponent as y, computed as r, createBlock as i, openBlock as s, withCtx as l, createVNode as m, createElementVNode as p, createCommentVNode as R, unref as d, withModifiers as w, createTextVNode as u, toDisplayString as v } from "vue";
2
+ import { ScalarTooltip as C, ScalarButton as V } from "@scalar/components";
3
+ import x from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
4
+ import P from "./OperationTable.vue.js";
5
+ import { getParameterExample as K } from "../helpers/get-parameter-example.js";
6
+ import { getParameterSchema as h } from "../helpers/get-parameter-schema.js";
7
+ const k = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, A = { class: "sr-only" }, E = /* @__PURE__ */ y({
8
+ __name: "OperationParams",
9
+ props: {
10
+ parameters: {},
11
+ exampleKey: {},
12
+ title: {},
13
+ label: {},
14
+ invalidParams: {},
15
+ globalRoute: {},
16
+ environment: {},
17
+ envVariables: {}
18
+ },
19
+ emits: ["add", "update", "delete", "deleteAll"],
20
+ setup(o, { emit: b }) {
21
+ const n = b, f = r(
22
+ () => o.parameters.map((e) => {
23
+ const t = K(e, o.exampleKey);
24
+ return {
25
+ name: e.name,
26
+ value: t?.value ?? "",
27
+ globalRoute: o.globalRoute,
28
+ schema: h(e),
29
+ isRequired: e.required,
30
+ isDisabled: t?.["x-disabled"] ?? !1
31
+ };
32
+ })
33
+ ), g = r(() => o.parameters.length > 1);
34
+ return (e, t) => (s(), i(x, {
35
+ class: "group/params",
36
+ itemCount: e.parameters.length
37
+ }, {
38
+ title: l(() => [
39
+ u(v(e.title), 1)
40
+ ]),
41
+ actions: l(() => [
42
+ p("div", k, [
43
+ g.value ? (s(), i(d(C), {
44
+ key: 0,
45
+ content: "Clear optional parameters",
46
+ placement: "left"
47
+ }, {
48
+ default: l(() => [
49
+ m(d(V), {
50
+ class: "pr-0.75 pl-1 transition-none",
51
+ size: "sm",
52
+ variant: "ghost",
53
+ onClick: t[0] || (t[0] = w((a) => n("deleteAll"), ["stop"]))
54
+ }, {
55
+ default: l(() => [
56
+ t[4] || (t[4] = u(" Clear ")),
57
+ p("span", A, "All " + v(e.title), 1)
58
+ ]),
59
+ _: 1,
60
+ __: [4]
61
+ })
62
+ ]),
63
+ _: 1
64
+ })) : R("", !0)
65
+ ])
66
+ ]),
67
+ default: l(() => [
68
+ m(P, {
69
+ class: "flex-1",
70
+ columns: ["32px", "", ""],
71
+ data: f.value,
72
+ envVariables: e.envVariables,
73
+ environment: e.environment,
74
+ exampleKey: e.exampleKey,
75
+ globalRoute: e.globalRoute,
76
+ invalidParams: e.invalidParams,
77
+ label: e.label,
78
+ onAddRow: t[1] || (t[1] = (a) => n("add", a)),
79
+ onDeleteRow: t[2] || (t[2] = (a) => n("delete", { index: a })),
80
+ onUpdateRow: t[3] || (t[3] = (a, c) => n("update", { index: a, payload: c }))
81
+ }, null, 8, ["data", "envVariables", "environment", "exampleKey", "globalRoute", "invalidParams", "label"])
82
+ ]),
83
+ _: 1
84
+ }, 8, ["itemCount"]));
85
+ }
86
+ });
87
+ export {
88
+ E as default
89
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./OperationParams.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=OperationTable.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OperationTable.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/components/OperationTable.test.ts"],"names":[],"mappings":""}