@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 @@
1
+ {"version":3,"file":"group-by.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/helpers/group-by.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,GAClB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,MAAM,CAAC,EACjB,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAE5E,KAAK,CAAC,EAAE,EACR,KAAK,CAAC,mBAQL,CAAA"}
@@ -0,0 +1,7 @@
1
+ const t = (u, p) => u.reduce(
2
+ (r, e) => ((r[e[p]] ??= []).push(e), r),
3
+ {}
4
+ );
5
+ export {
6
+ t as groupBy
7
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=group-by.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-by.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/helpers/group-by.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { SchemaObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ /**
3
+ * Checks if the value of a example parameter is the expected type or format
4
+ */
5
+ export declare const validateParameter: (schema?: SchemaObject, value?: string | File | null) => {
6
+ ok: true;
7
+ } | {
8
+ ok: false;
9
+ message: string;
10
+ };
11
+ //# sourceMappingURL=validate-parameter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-parameter.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/helpers/validate-parameter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAEhG;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,SAAS,YAAY,EACrB,QAAQ,MAAM,GAAG,IAAI,GAAG,IAAI,KAC3B;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAgD7C,CAAA"}
@@ -0,0 +1,32 @@
1
+ const a = (e, t) => {
2
+ if (!e || !("type" in e) || typeof t != "string")
3
+ return { ok: !0 };
4
+ if (e.type === "integer" || e.type === "number") {
5
+ const r = Number(t);
6
+ if (isNaN(r))
7
+ return { ok: !1, message: "Value must be a number (e.g., 42.5)" };
8
+ if (e.type === "integer" && !Number.isInteger(r))
9
+ return { ok: !1, message: "Value must be a whole number (e.g., 42)" };
10
+ if (e.minimum !== void 0 && r < e.minimum)
11
+ return { ok: !1, message: `Value must be ${e.minimum} or greater` };
12
+ if (e.maximum !== void 0 && r > e.maximum)
13
+ return { ok: !1, message: `Value must be ${e.maximum} or less` };
14
+ }
15
+ if (e.type === "string" && e.format) {
16
+ if (e.format === "date" && !/^\d{4}-\d{2}-\d{2}$/.test(t ?? ""))
17
+ return { ok: !1, message: "Please enter a valid date in YYYY-MM-DD format (e.g., 2024-03-20)" };
18
+ if (e.format === "date-time" && !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/.test(t ?? ""))
19
+ return {
20
+ ok: !1,
21
+ message: "Please enter a valid date and time in RFC 3339 format (e.g., 2024-03-20T13:45:30Z)"
22
+ };
23
+ if (e.format === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t ?? ""))
24
+ return { ok: !1, message: "Please enter a valid email address (e.g., user@example.com)" };
25
+ if (e.format === "uri" && !/^[a-zA-Z][a-zA-Z0-9+.-]*:.+$/.test(t ?? ""))
26
+ return { ok: !1, message: "Please enter a valid URI (e.g., https://example.com)" };
27
+ }
28
+ return { ok: !0 };
29
+ };
30
+ export {
31
+ a as validateParameter
32
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=validate-parameter.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-parameter.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-operation-block/helpers/validate-parameter.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { default as OperationBlock } from './components/OperationBlock.vue.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-operation-block/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { default as e } from "./components/OperationBlock.vue.js";
2
+ export {
3
+ e as OperationBlock
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Headers.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Headers.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-response-block/components/Headers.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ type Header = {
2
+ name: string;
3
+ value: string;
4
+ };
5
+ type __VLS_Props = {
6
+ headers: Header[];
7
+ };
8
+ declare var __VLS_5: {};
9
+ type __VLS_Slots = {} & {
10
+ title?: (props: typeof __VLS_5) => any;
11
+ };
12
+ declare const __VLS_component: 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>;
13
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
20
+ //# sourceMappingURL=Headers.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Headers.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-response-block/components/Headers.vue"],"names":[],"mappings":"AA8EA,KAAK,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAC;AAsKF,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA0B7C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { defineComponent as x, createBlock as f, openBlock as t, withCtx as e, createElementBlock as s, createVNode as n, unref as d, createTextVNode as l, Fragment as u, renderList as y, toDisplayString as i, renderSlot as h } from "vue";
2
+ import b from "../../../../components/DataTable/DataTable.vue.js";
3
+ import c from "../../../../components/DataTable/DataTableRow.vue.js";
4
+ import _ from "../../../../components/DataTable/DataTableText.vue.js";
5
+ import g from "../../../../components/HelpfulLink.vue.js";
6
+ import k from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
+ import { httpHeaders as w } from "../../../../data/httpHeaders.js";
8
+ import p from "../../../../components/DataTable/DataTableHeader.vue.js";
9
+ const C = {
10
+ key: 0,
11
+ class: "max-h-[calc(100%-32px)] overflow-y-auto"
12
+ }, H = {
13
+ key: 1,
14
+ class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-base"
15
+ }, T = /* @__PURE__ */ x({
16
+ __name: "Headers",
17
+ props: {
18
+ headers: {}
19
+ },
20
+ setup($) {
21
+ const m = (r) => w.find(
22
+ (o) => o.name.toLowerCase() === r.toLowerCase()
23
+ );
24
+ return (r, o) => (t(), f(k, {
25
+ class: "overflow-auto",
26
+ defaultOpen: !1,
27
+ itemCount: r.headers.length
28
+ }, {
29
+ title: e(() => [
30
+ h(r.$slots, "title")
31
+ ]),
32
+ default: e(() => [
33
+ r.headers.length ? (t(), s("div", C, [
34
+ n(b, {
35
+ columns: ["minmax(auto, min-content)", "minmax(50%, 1fr)"],
36
+ scroll: ""
37
+ }, {
38
+ default: e(() => [
39
+ n(c, { class: "sr-only !block" }, {
40
+ default: e(() => [
41
+ n(d(p), null, {
42
+ default: e(() => o[0] || (o[0] = [
43
+ l("Header Key")
44
+ ])),
45
+ _: 1,
46
+ __: [0]
47
+ }),
48
+ n(d(p), null, {
49
+ default: e(() => o[1] || (o[1] = [
50
+ l("Header Value")
51
+ ])),
52
+ _: 1,
53
+ __: [1]
54
+ })
55
+ ]),
56
+ _: 1
57
+ }),
58
+ (t(!0), s(u, null, y(r.headers, (a) => (t(), f(c, {
59
+ key: a.name,
60
+ class: "group/row text-c-1"
61
+ }, {
62
+ default: e(() => [
63
+ n(_, { class: "bg-b-1 sticky left-0 z-1 max-w-full group-first/row:border-t-0" }, {
64
+ default: e(() => [
65
+ typeof m(a.name)?.url == "string" ? (t(), f(g, {
66
+ key: 0,
67
+ class: "decoration-c-3",
68
+ href: m(a.name).url
69
+ }, {
70
+ default: e(() => [
71
+ l(i(a.name), 1)
72
+ ]),
73
+ _: 2
74
+ }, 1032, ["href"])) : (t(), s(u, { key: 1 }, [
75
+ l(i(a.name), 1)
76
+ ], 64))
77
+ ]),
78
+ _: 2
79
+ }, 1024),
80
+ n(_, {
81
+ class: "z-0 group-first/row:border-t-0",
82
+ text: a.value
83
+ }, null, 8, ["text"])
84
+ ]),
85
+ _: 2
86
+ }, 1024))), 128))
87
+ ]),
88
+ _: 1
89
+ })
90
+ ])) : (t(), s("div", H, " No Headers "))
91
+ ]),
92
+ _: 3
93
+ }, 8, ["itemCount"]));
94
+ }
95
+ });
96
+ export {
97
+ T as default
98
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Headers.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ResponseBlock.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBlock.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-response-block/components/ResponseBlock.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
2
+ import type { ClientLayout } from '../../../../hooks/index.js';
3
+ import type { createStoreEvents } from '../../../../store/events.js';
4
+ type __VLS_Props = {
5
+ /** Preprocessed response */
6
+ response?: ResponseInstance;
7
+ /** Original request instance */
8
+ request?: Request;
9
+ /** Client layout */
10
+ layout: ClientLayout;
11
+ /** Total number of performed requests */
12
+ totalPerformedRequests: number;
13
+ /** Application version */
14
+ appVersion: string;
15
+ /** Event bus */
16
+ events: ReturnType<typeof createStoreEvents>;
17
+ };
18
+ declare const responseSections: readonly ["Cookies", "Headers", "Body"];
19
+ type Filter = 'All' | (typeof responseSections)[number];
20
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {
21
+ responseHeaders: import("vue").ComputedRef<{
22
+ name: string;
23
+ value: string;
24
+ }[]>;
25
+ responseCookies: import("vue").ComputedRef<{
26
+ name: string;
27
+ value: string;
28
+ }[]>;
29
+ requestHeaders: import("vue").ComputedRef<{
30
+ name: string;
31
+ value: string;
32
+ required: boolean;
33
+ }[]>;
34
+ shouldVirtualize: import("vue").ComputedRef<boolean>;
35
+ activeFilter: import("vue").Ref<Filter, Filter>;
36
+ filters: import("vue").ComputedRef<Filter[]>;
37
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
38
+ openCommandPalette: () => any;
39
+ sendRequest: () => any;
40
+ addRequest: () => any;
41
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
42
+ onOpenCommandPalette?: (() => any) | undefined;
43
+ onSendRequest?: (() => any) | undefined;
44
+ onAddRequest?: (() => any) | undefined;
45
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
46
+ export default _default;
47
+ //# sourceMappingURL=ResponseBlock.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBlock.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-response-block/components/ResponseBlock.vue"],"names":[],"mappings":"AA+RA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAKvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAYvD,KAAK,WAAW,GAAG;IACjB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,yCAAyC;IACzC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB;IAChB,MAAM,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;CAC7C,CAAC;AAwCF,QAAA,MAAM,gBAAgB,yCAA0C,CAAA;AAChE,KAAK,MAAM,GAAG,KAAK,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyYvD,wBAQG"}
@@ -0,0 +1,7 @@
1
+ import o from "./ResponseBlock.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-0b01684f"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,182 @@
1
+ import { defineComponent as S, computed as i, ref as I, useId as E, createBlock as a, openBlock as o, withCtx as d, createElementVNode as m, normalizeClass as V, createElementBlock as y, createVNode as A, Fragment as k, createCommentVNode as u, createTextVNode as g, renderList as O, unref as B, withDirectives as z, resolveDynamicComponent as M, mergeProps as N, vShow as L } from "vue";
2
+ import { ScalarErrorBoundary as j } from "@scalar/components";
3
+ import D from "../../../../components/SectionFilter.vue.js";
4
+ import F from "../../../../components/ViewLayout/ViewLayoutSection.vue.js";
5
+ import C from "./Headers.vue.js";
6
+ import { textMediaTypes as w } from "../helpers/media-types.js";
7
+ import U from "./ResponseBody.vue.js";
8
+ import K from "./ResponseBodyStreaming.vue.js";
9
+ import Z from "./ResponseBodyVirtual.vue.js";
10
+ /* empty css */
11
+ import G from "./ResponseCookies.vue.js";
12
+ import J from "./ResponseEmpty.vue.js";
13
+ import Q from "./ResponseLoadingOverlay.vue.js";
14
+ import W from "./ResponseMetaInformation.vue.js";
15
+ import { usePluginManager as X } from "../../../../plugins/hooks/usePluginManager.js";
16
+ const Y = { class: "flex h-8 flex-1 items-center" }, x = ["id", "role"], b = 2e5, ce = /* @__PURE__ */ S({
17
+ __name: "ResponseBlock",
18
+ props: {
19
+ response: {},
20
+ request: {},
21
+ layout: {},
22
+ totalPerformedRequests: {},
23
+ appVersion: {},
24
+ events: {}
25
+ },
26
+ emits: ["addRequest", "sendRequest", "openCommandPalette"],
27
+ setup(t, { expose: H, emit: P }) {
28
+ const f = P, T = X().getViewComponents("response.section"), p = i(() => {
29
+ const e = t.response?.headers;
30
+ return e ? Object.keys(e).map((s) => ({
31
+ name: s,
32
+ value: e[s] ?? ""
33
+ })) : [];
34
+ }), R = i(
35
+ () => t.response?.cookieHeaderKeys.flatMap((e) => {
36
+ const s = t.response?.headers?.[e];
37
+ return s ? {
38
+ name: e,
39
+ value: s
40
+ } : [];
41
+ }) ?? []
42
+ ), $ = ["Cookies", "Headers", "Body"], n = I("All"), v = i(() => ["All", ...$]), l = i(
43
+ () => Object.fromEntries(
44
+ v.value.map((e) => [e, E()])
45
+ )
46
+ ), h = i(() => {
47
+ if (!t.response || !("size" in t.response))
48
+ return !1;
49
+ const e = t.response.headers?.["content-type"] || t.response.headers?.["Content-Type"];
50
+ return !e || (t.response.size ?? 0) <= b || e.includes("text/html") ? !1 : w.some((r) => e.includes(r)) && (t.response.size ?? 0) > b;
51
+ }), q = i(
52
+ () => t.request?.headers ? [...t.request.headers].map((e) => ({
53
+ name: e[0],
54
+ value: e[1],
55
+ required: !1
56
+ })) : []
57
+ ), c = (e) => e === "All" || n.value === e;
58
+ return H({
59
+ responseHeaders: p,
60
+ responseCookies: R,
61
+ requestHeaders: q,
62
+ shouldVirtualize: h,
63
+ activeFilter: n,
64
+ filters: v
65
+ }), (e, s) => (o(), a(F, { "aria-label": "Response" }, {
66
+ title: d(() => [
67
+ m("div", Y, [
68
+ m("div", {
69
+ "aria-live": "polite",
70
+ class: V(["flex items-center", { "animate-response-heading": e.response }])
71
+ }, [
72
+ s[4] || (s[4] = m("span", { class: "response-heading pointer-events-none absolute" }, " Response ", -1)),
73
+ e.response ? (o(), a(W, {
74
+ key: 0,
75
+ class: "animate-response-children",
76
+ events: e.events,
77
+ response: e.response
78
+ }, null, 8, ["events", "response"])) : u("", !0)
79
+ ], 2),
80
+ A(D, {
81
+ modelValue: n.value,
82
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => n.value = r),
83
+ filterIds: l.value,
84
+ filters: v.value
85
+ }, null, 8, ["modelValue", "filterIds", "filters"])
86
+ ])
87
+ ]),
88
+ default: d(() => [
89
+ m("div", {
90
+ id: l.value.All,
91
+ class: V(["custom-scroll response-section-content relative grid h-full justify-stretch", {
92
+ "content-start": e.response
93
+ }]),
94
+ role: n.value === "All" && e.response ? "tabpanel" : "none"
95
+ }, [
96
+ e.response ? (o(), y(k, { key: 1 }, [
97
+ c("Cookies") ? (o(), a(G, {
98
+ key: 0,
99
+ id: l.value.Cookies,
100
+ class: "response-section-content-cookies",
101
+ cookies: R.value,
102
+ role: n.value === "All" ? "none" : "tabpanel"
103
+ }, null, 8, ["id", "cookies", "role"])) : u("", !0),
104
+ c("Headers") ? (o(), a(C, {
105
+ key: 1,
106
+ id: l.value.Headers,
107
+ class: "response-section-content-headers",
108
+ headers: q.value,
109
+ role: n.value === "All" ? "none" : "tabpanel"
110
+ }, {
111
+ title: d(() => s[5] || (s[5] = [
112
+ g("Request Headers")
113
+ ])),
114
+ _: 1
115
+ }, 8, ["id", "headers", "role"])) : u("", !0),
116
+ c("Headers") ? (o(), a(C, {
117
+ key: 2,
118
+ id: l.value.Headers,
119
+ class: "response-section-content-headers",
120
+ headers: p.value,
121
+ role: n.value === "All" ? "none" : "tabpanel"
122
+ }, {
123
+ title: d(() => s[6] || (s[6] = [
124
+ g("Response Headers")
125
+ ])),
126
+ _: 1
127
+ }, 8, ["id", "headers", "role"])) : u("", !0),
128
+ (o(!0), y(k, null, O(B(T), (r) => (o(), a(B(j), {
129
+ key: r.component
130
+ }, {
131
+ default: d(() => [
132
+ z((o(), a(M(r.component), N({ ref_for: !0 }, r.props ?? {}), null, 16)), [
133
+ [L, n.value === "All" || n.value === r.title]
134
+ ])
135
+ ]),
136
+ _: 2
137
+ }, 1024))), 128)),
138
+ n.value === "All" || n.value === "Body" ? (o(), y(k, { key: 3 }, [
139
+ "reader" in e.response ? (o(), a(K, {
140
+ key: 0,
141
+ id: l.value.Body,
142
+ class: "response-section-content-body",
143
+ reader: e.response.reader
144
+ }, null, 8, ["id", "reader"])) : h.value && typeof e.response?.data == "string" ? (o(), a(Z, {
145
+ key: 1,
146
+ id: l.value.Body,
147
+ content: e.response.data,
148
+ data: e.response?.data,
149
+ headers: p.value,
150
+ role: n.value === "All" ? "none" : "tabpanel"
151
+ }, null, 8, ["id", "content", "data", "headers", "role"])) : (o(), a(U, {
152
+ key: 2,
153
+ id: l.value.Body,
154
+ active: !0,
155
+ class: "response-section-content-body",
156
+ data: e.response?.data,
157
+ headers: p.value,
158
+ layout: "client",
159
+ role: n.value === "All" ? "none" : "tabpanel",
160
+ title: "Body"
161
+ }, null, 8, ["id", "data", "headers", "role"]))
162
+ ], 64)) : u("", !0)
163
+ ], 64)) : (o(), a(J, {
164
+ key: 0,
165
+ appVersion: e.appVersion,
166
+ events: e.events,
167
+ layout: e.layout,
168
+ totalPerformedRequests: e.totalPerformedRequests,
169
+ onAddRequest: s[1] || (s[1] = (r) => f("addRequest")),
170
+ onOpenCommandPalette: s[2] || (s[2] = (r) => f("openCommandPalette")),
171
+ onSendRequest: s[3] || (s[3] = (r) => f("sendRequest"))
172
+ }, null, 8, ["appVersion", "events", "layout", "totalPerformedRequests"])),
173
+ A(Q, { events: e.events }, null, 8, ["events"])
174
+ ], 10, x)
175
+ ]),
176
+ _: 1
177
+ }));
178
+ }
179
+ });
180
+ export {
181
+ ce as default
182
+ };
@@ -0,0 +1,12 @@
1
+ type __VLS_Props = {
2
+ title: string;
3
+ layout: 'client' | 'reference';
4
+ data: unknown;
5
+ headers: {
6
+ name: string;
7
+ value: string;
8
+ }[];
9
+ };
10
+ 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>;
11
+ export default _default;
12
+ //# sourceMappingURL=ResponseBody.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBody.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-response-block/components/ResponseBody.vue"],"names":[],"mappings":"AAuGA,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC3C,CAAC;;AAuLF,wBAMG"}
@@ -0,0 +1,7 @@
1
+ import o from "./ResponseBody.vue2.js";
2
+ /* empty css */
3
+ import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-493b6549"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,88 @@
1
+ import { defineComponent as w, ref as g, computed as l, createBlock as n, openBlock as t, createSlots as _, withCtx as i, createElementBlock as x, createCommentVNode as r, createElementVNode as p, toDisplayString as v, createTextVNode as c, createVNode as B } from "vue";
2
+ import k from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
3
+ import { processResponseBody as R } from "../helpers/process-response-body.js";
4
+ import { getMediaTypeConfig as T } from "../helpers/media-types.js";
5
+ import V from "./ResponseBodyDownload.vue.js";
6
+ import U from "./ResponseBodyInfo.vue.js";
7
+ import b from "./ResponseBodyPreview.vue.js";
8
+ import C from "./ResponseBodyRaw.vue.js";
9
+ import N from "./ResponseBodyToggle.vue.js";
10
+ const $ = {
11
+ key: 0,
12
+ class: "bg-b-1 flex max-h-[calc(100%-32px)] flex-col overflow-hidden"
13
+ }, E = { class: "box-content flex min-h-8 items-center justify-between border-y px-3" }, P = { class: "text-xxs font-code leading-3" }, G = /* @__PURE__ */ w({
14
+ __name: "ResponseBody",
15
+ props: {
16
+ title: {},
17
+ layout: {},
18
+ data: {},
19
+ headers: {}
20
+ },
21
+ setup(d) {
22
+ const s = g(!0), m = l(
23
+ () => !!(a.value?.raw && a.value.preview)
24
+ ), f = l(() => s.value || !m.value), y = l(() => !s.value || !m.value), e = l(
25
+ () => R({
26
+ data: d.data,
27
+ headers: d.headers
28
+ })
29
+ ), a = l(
30
+ () => T(e.value.mimeType?.essence ?? "")
31
+ );
32
+ return (o, u) => (t(), n(k, {
33
+ class: "max-h-content overflow-y-hidden",
34
+ layout: o.layout
35
+ }, _({
36
+ title: i(() => [
37
+ c(v(o.title), 1)
38
+ ]),
39
+ default: i(() => [
40
+ o.data ? (t(), x("div", $, [
41
+ p("div", E, [
42
+ p("span", P, v(e.value.mimeType?.essence), 1),
43
+ m.value ? (t(), n(N, {
44
+ key: 0,
45
+ modelValue: s.value,
46
+ "onUpdate:modelValue": u[0] || (u[0] = (h) => s.value = h)
47
+ }, null, 8, ["modelValue"])) : r("", !0)
48
+ ]),
49
+ a.value?.raw && y.value ? (t(), n(C, {
50
+ key: e.value.dataUrl,
51
+ content: o.data,
52
+ language: a.value.language
53
+ }, null, 8, ["content", "language"])) : r("", !0),
54
+ a.value?.preview && f.value ? (t(), n(b, {
55
+ key: e.value.dataUrl,
56
+ alpha: a.value.alpha,
57
+ mode: a.value.preview,
58
+ src: e.value.dataUrl,
59
+ type: e.value.mimeType?.essence ?? ""
60
+ }, null, 8, ["alpha", "mode", "src", "type"])) : r("", !0),
61
+ !a.value?.raw && !a.value?.preview ? (t(), n(U, { key: 2 }, {
62
+ default: i(() => u[1] || (u[1] = [
63
+ c(" Binary file ")
64
+ ])),
65
+ _: 1,
66
+ __: [1]
67
+ })) : r("", !0)
68
+ ])) : r("", !0)
69
+ ]),
70
+ _: 2
71
+ }, [
72
+ o.data && e.value.dataUrl ? {
73
+ name: "actions",
74
+ fn: i(() => [
75
+ B(V, {
76
+ filename: e.value.attachmentFilename,
77
+ href: e.value.dataUrl,
78
+ type: e.value.mimeType?.essence
79
+ }, null, 8, ["filename", "href", "type"])
80
+ ]),
81
+ key: "0"
82
+ } : void 0
83
+ ]), 1032, ["layout"]));
84
+ }
85
+ });
86
+ export {
87
+ G as default
88
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ResponseBodyDownload.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBodyDownload.test.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-response-block/components/ResponseBodyDownload.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ type __VLS_Props = {
2
+ href: string;
3
+ type?: string;
4
+ filename?: string;
5
+ };
6
+ 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>;
7
+ export default _default;
8
+ //# sourceMappingURL=ResponseBodyDownload.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseBodyDownload.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-response-block/components/ResponseBodyDownload.vue"],"names":[],"mappings":"AAwCA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC;;AAyEF,wBAMG"}