@scalar/api-client 3.0.0 → 3.2.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.
- package/CHANGELOG.md +29 -0
- package/README.md +41 -0
- package/dist/components/HttpMethod/HttpMethod.vue.d.ts +2 -2
- package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts +2 -2
- package/dist/plugins/posthog/index.d.ts +23 -0
- package/dist/plugins/posthog/index.d.ts.map +1 -0
- package/dist/plugins/posthog/index.js +58 -0
- package/dist/plugins/posthog/index.js.map +1 -0
- package/dist/style.css +121 -61
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +15 -12
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts +5 -2
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js +5 -2
- package/dist/v2/blocks/operation-block/helpers/decode-buffer.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts +8 -9
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js +8 -10
- package/dist/v2/blocks/operation-block/helpers/har-to-fetch-request.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts +2 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts +11 -3
- package/dist/v2/blocks/operation-block/helpers/send-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/send-request.js +19 -12
- package/dist/v2/blocks/operation-block/helpers/send-request.js.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js +4 -0
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -0
- package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js +1 -0
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts +3 -2
- package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js +12 -6
- package/dist/v2/blocks/response-block/ResponseBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts +2 -0
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js +34 -14
- package/dist/v2/blocks/response-block/components/ResponseBody.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/process-response-body.d.ts +1 -1
- package/dist/v2/blocks/response-block/helpers/process-response-body.js +2 -3
- package/dist/v2/blocks/response-block/helpers/process-response-body.js.map +1 -1
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts +11 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js +44 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-body-handler.js.map +1 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts +14 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.d.ts.map +1 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js +13 -0
- package/dist/v2/blocks/response-block/helpers/resolve-response-content-type.js.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js +3 -3
- package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +131 -48
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesAddModal.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +16 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +43 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.d.ts +6 -2
- package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js +9 -4
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts +3 -0
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js +7 -1
- package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
- package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +2 -2
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js.map +1 -1
- package/dist/v2/features/app/App.vue.script.js +17 -4
- package/dist/v2/features/app/App.vue.script.js.map +1 -1
- package/dist/v2/features/app/app-state.d.ts +6 -1
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +5 -3
- package/dist/v2/features/app/app-state.js.map +1 -1
- package/dist/v2/features/app/components/DesktopTab.vue.d.ts +2 -2
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts +9 -1
- package/dist/v2/features/app/helpers/create-api-client-app.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-api-client-app.js +3 -2
- package/dist/v2/features/app/helpers/create-api-client-app.js.map +1 -1
- package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-temp-operation.js +4 -1
- package/dist/v2/features/app/helpers/create-temp-operation.js.map +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +4 -2
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.script.js +2 -1
- package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.script.js +2 -1
- package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +2 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.script.js +10 -1
- package/dist/v2/features/collection/components/Authentication.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Cookies.vue.script.js +1 -0
- package/dist/v2/features/collection/components/Cookies.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Editor/Editor.vue.script.js +1 -0
- package/dist/v2/features/collection/components/Editor/Editor.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Environment.vue.script.js +1 -0
- package/dist/v2/features/collection/components/Environment.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Form.vue.d.ts +2 -0
- package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Form.vue.js.map +1 -1
- package/dist/v2/features/collection/components/Form.vue.script.js +4 -1
- package/dist/v2/features/collection/components/Form.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/LabelInput.vue.d.ts +1 -1
- package/dist/v2/features/collection/components/Overview.vue.script.js +1 -0
- package/dist/v2/features/collection/components/Overview.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.js.map +1 -1
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js +4 -2
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Runner/components/RunnerTree.vue.d.ts +2 -2
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts +4 -2
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js +3 -2
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js.map +1 -1
- package/dist/v2/features/collection/components/Scripts.vue.script.js +1 -0
- package/dist/v2/features/collection/components/Scripts.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.js.map +1 -1
- package/dist/v2/features/collection/components/Servers.vue.script.js +3 -1
- package/dist/v2/features/collection/components/Servers.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Settings.vue.script.js +1 -0
- package/dist/v2/features/collection/components/Settings.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts +2 -2
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.d.ts.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js +26 -21
- package/dist/v2/features/command-palette/components/CommandPaletteImportPostman.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.js.map +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js +1 -1
- package/dist/v2/features/command-palette/components/PostmanImportPreview.vue.script.js.map +1 -1
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts +14 -0
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.d.ts.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js +19 -0
- package/dist/v2/features/command-palette/helpers/get-postman-convert-options.js.map +1 -0
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +1 -1
- package/dist/v2/features/command-palette/helpers/get-postman-document-details.js.map +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js +1 -1
- package/dist/v2/features/command-palette/helpers/load-document-from-source.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentDeleteModal.vue.d.ts +2 -2
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.d.ts.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.js.map +1 -1
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js +2 -2
- package/dist/v2/features/environments/components/EnvironmentVariablesDropdown.vue.script.js.map +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.d.ts.map +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.js.map +1 -1
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js +2 -0
- package/dist/v2/features/global-cookies/components/CookiesTable.vue.script.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.d.ts +7 -6
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js.map +1 -1
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +5 -5
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +11 -0
- package/dist/v2/features/modal/helpers/create-api-client-modal.js.map +1 -1
- package/dist/v2/features/modal/helpers/types.d.ts +1 -7
- package/dist/v2/features/modal/helpers/types.d.ts.map +1 -1
- package/dist/v2/features/modal/index.d.ts +1 -1
- package/dist/v2/features/modal/index.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.d.ts +0 -5
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js.map +1 -1
- package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
- package/dist/v2/types/options.d.ts +15 -0
- package/dist/v2/types/options.d.ts.map +1 -0
- package/package.json +21 -16
- package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts +0 -11
- package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts.map +0 -1
- package/dist/v2/features/command-palette/helpers/is-postman-collection.js +0 -24
- package/dist/v2/features/command-palette/helpers/is-postman-collection.js.map +0 -1
- package/dist/v2/posthog.d.ts +0 -3
- package/dist/v2/posthog.d.ts.map +0 -1
- package/dist/v2/posthog.js +0 -20
- package/dist/v2/posthog.js.map +0 -1
package/dist/style.css
CHANGED
|
@@ -1010,8 +1010,8 @@
|
|
|
1010
1010
|
background-color: var(--scalar-sidebar-indent-border-hover, var(--scalar-border-color));
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
-
.scalar-app .group-hover\/button\:text-c-1:is(:where(.group\/button):hover *) {
|
|
1014
|
-
color: var(--scalar-color-1);
|
|
1013
|
+
.scalar-app .group-hover\/button\:text-c-header-1:is(:where(.group\/button):hover *) {
|
|
1014
|
+
color: var(--scalar-header-color-1, var(--scalar-color-1));
|
|
1015
1015
|
}
|
|
1016
1016
|
|
|
1017
1017
|
.scalar-app .hover\:bg-b-2:hover {
|
|
@@ -1022,10 +1022,24 @@
|
|
|
1022
1022
|
background-color: var(--scalar-background-3);
|
|
1023
1023
|
}
|
|
1024
1024
|
|
|
1025
|
+
.scalar-app .hover\:bg-b-header-2:hover {
|
|
1026
|
+
background-color: var(--scalar-header-background-2, var(--scalar-background-2));
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1025
1029
|
.scalar-app .hover\:bg-h-btn:hover {
|
|
1026
1030
|
background-color: var(--scalar-button-1-hover);
|
|
1027
1031
|
}
|
|
1028
1032
|
|
|
1033
|
+
.scalar-app .hover\:bg-h-header-cta:hover {
|
|
1034
|
+
background-color: var(--scalar-header-call-to-action-color, var(--scalar-button-1));
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1038
|
+
.scalar-app .hover\:bg-h-header-cta:hover {
|
|
1039
|
+
background-color: color-mix(in srgb, var(--scalar-header-call-to-action-color, var(--scalar-button-1)), var(--scalar-header-background-1, var(--scalar-background-1)) 15%);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1029
1043
|
.scalar-app .hover\:bg-sidebar-b-1:hover {
|
|
1030
1044
|
background-color: var(--scalar-sidebar-background-1, var(--scalar-background-1));
|
|
1031
1045
|
}
|
|
@@ -1066,6 +1080,10 @@
|
|
|
1066
1080
|
color: var(--scalar-color-1);
|
|
1067
1081
|
}
|
|
1068
1082
|
|
|
1083
|
+
.scalar-app .hover\:text-c-header-1:hover {
|
|
1084
|
+
color: var(--scalar-header-color-1, var(--scalar-color-1));
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1069
1087
|
.scalar-app .hover\:text-sidebar-c-1:hover {
|
|
1070
1088
|
color: var(--scalar-sidebar-color-1, var(--scalar-color-1));
|
|
1071
1089
|
}
|
|
@@ -3441,6 +3459,10 @@
|
|
|
3441
3459
|
border-width: 1px;
|
|
3442
3460
|
}
|
|
3443
3461
|
|
|
3462
|
+
.scalar-app .border-border-header {
|
|
3463
|
+
border-color: var(--scalar-header-border-color, var(--scalar-border-color));
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3444
3466
|
.scalar-app .border-c-alert {
|
|
3445
3467
|
border-color: var(--scalar-color-alert);
|
|
3446
3468
|
}
|
|
@@ -3483,6 +3505,14 @@
|
|
|
3483
3505
|
background-color: var(--scalar-button-1);
|
|
3484
3506
|
}
|
|
3485
3507
|
|
|
3508
|
+
.scalar-app .bg-b-header-1 {
|
|
3509
|
+
background-color: var(--scalar-header-background-1, var(--scalar-background-1));
|
|
3510
|
+
}
|
|
3511
|
+
|
|
3512
|
+
.scalar-app .bg-b-header-cta {
|
|
3513
|
+
background-color: var(--scalar-header-call-to-action-color, var(--scalar-button-1));
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3486
3516
|
.scalar-app .bg-b-tooltip {
|
|
3487
3517
|
background-color: var(--scalar-tooltip-background);
|
|
3488
3518
|
}
|
|
@@ -3666,6 +3696,18 @@
|
|
|
3666
3696
|
overflow-wrap: break-word;
|
|
3667
3697
|
}
|
|
3668
3698
|
|
|
3699
|
+
.scalar-app .text-c-header-1 {
|
|
3700
|
+
color: var(--scalar-header-color-1, var(--scalar-color-1));
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
.scalar-app .text-c-header-2 {
|
|
3704
|
+
color: var(--scalar-header-color-2, var(--scalar-color-2));
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3707
|
+
.scalar-app .text-c-header-cta {
|
|
3708
|
+
color: var(--scalar-button-1-color);
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3669
3711
|
.scalar-app .text-c-tooltip {
|
|
3670
3712
|
color: var(--scalar-tooltip-color);
|
|
3671
3713
|
}
|
|
@@ -3764,8 +3806,8 @@
|
|
|
3764
3806
|
justify-content: center;
|
|
3765
3807
|
}
|
|
3766
3808
|
|
|
3767
|
-
:is(.scalar-app .\*\:gap-
|
|
3768
|
-
gap:
|
|
3809
|
+
:is(.scalar-app .\*\:gap-1 > *) {
|
|
3810
|
+
gap: 4px;
|
|
3769
3811
|
}
|
|
3770
3812
|
|
|
3771
3813
|
:is(.scalar-app .\*\:rounded > *) {
|
|
@@ -3804,8 +3846,8 @@
|
|
|
3804
3846
|
background-color: var(--scalar-sidebar-indent-border-hover, var(--scalar-border-color));
|
|
3805
3847
|
}
|
|
3806
3848
|
|
|
3807
|
-
.scalar-app .group-hover\/button\:text-c-1:is(:where(.group\/button):hover *) {
|
|
3808
|
-
color: var(--scalar-color-1);
|
|
3849
|
+
.scalar-app .group-hover\/button\:text-c-header-1:is(:where(.group\/button):hover *) {
|
|
3850
|
+
color: var(--scalar-header-color-1, var(--scalar-color-1));
|
|
3809
3851
|
}
|
|
3810
3852
|
}
|
|
3811
3853
|
|
|
@@ -3881,10 +3923,24 @@
|
|
|
3881
3923
|
background-color: var(--scalar-background-3);
|
|
3882
3924
|
}
|
|
3883
3925
|
|
|
3926
|
+
.scalar-app .hover\:bg-b-header-2:hover {
|
|
3927
|
+
background-color: var(--scalar-header-background-2, var(--scalar-background-2));
|
|
3928
|
+
}
|
|
3929
|
+
|
|
3884
3930
|
.scalar-app .hover\:bg-h-btn:hover {
|
|
3885
3931
|
background-color: var(--scalar-button-1-hover);
|
|
3886
3932
|
}
|
|
3887
3933
|
|
|
3934
|
+
.scalar-app .hover\:bg-h-header-cta:hover {
|
|
3935
|
+
background-color: var(--scalar-header-call-to-action-color, var(--scalar-button-1));
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3939
|
+
.scalar-app .hover\:bg-h-header-cta:hover {
|
|
3940
|
+
background-color: color-mix(in srgb, var(--scalar-header-call-to-action-color, var(--scalar-button-1)), var(--scalar-header-background-1, var(--scalar-background-1)) 15%);
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3888
3944
|
.scalar-app .hover\:bg-sidebar-b-1:hover {
|
|
3889
3945
|
background-color: var(--scalar-sidebar-background-1, var(--scalar-background-1));
|
|
3890
3946
|
}
|
|
@@ -3925,6 +3981,10 @@
|
|
|
3925
3981
|
color: var(--scalar-color-1);
|
|
3926
3982
|
}
|
|
3927
3983
|
|
|
3984
|
+
.scalar-app .hover\:text-c-header-1:hover {
|
|
3985
|
+
color: var(--scalar-header-color-1, var(--scalar-color-1));
|
|
3986
|
+
}
|
|
3987
|
+
|
|
3928
3988
|
.scalar-app .hover\:text-sidebar-c-1:hover {
|
|
3929
3989
|
color: var(--scalar-sidebar-color-1, var(--scalar-color-1));
|
|
3930
3990
|
}
|
|
@@ -4711,6 +4771,10 @@
|
|
|
4711
4771
|
height: 68px;
|
|
4712
4772
|
}
|
|
4713
4773
|
|
|
4774
|
+
.scalar-app .h-\[300px\] {
|
|
4775
|
+
height: 300px;
|
|
4776
|
+
}
|
|
4777
|
+
|
|
4714
4778
|
.scalar-app .h-\[calc\(100\%_-_50px\)\] {
|
|
4715
4779
|
height: calc(100% - 50px);
|
|
4716
4780
|
}
|
|
@@ -4779,10 +4843,6 @@
|
|
|
4779
4843
|
max-height: 60svh;
|
|
4780
4844
|
}
|
|
4781
4845
|
|
|
4782
|
-
.scalar-app .max-h-\[300px\] {
|
|
4783
|
-
max-height: 300px;
|
|
4784
|
-
}
|
|
4785
|
-
|
|
4786
4846
|
.scalar-app .max-h-\[auto\] {
|
|
4787
4847
|
max-height: auto;
|
|
4788
4848
|
}
|
|
@@ -7562,23 +7622,23 @@
|
|
|
7562
7622
|
/*
|
|
7563
7623
|
Deep styling for customizing Codemirror
|
|
7564
7624
|
*/
|
|
7565
|
-
[data-v-
|
|
7625
|
+
[data-v-6499ec1f] .cm-editor {
|
|
7566
7626
|
height: 100%;
|
|
7567
7627
|
outline: none;
|
|
7568
7628
|
padding: 0;
|
|
7569
7629
|
background: transparent;
|
|
7570
7630
|
}
|
|
7571
|
-
[data-v-
|
|
7631
|
+
[data-v-6499ec1f] .cm-placeholder {
|
|
7572
7632
|
color: var(--scalar-color-3);
|
|
7573
7633
|
}
|
|
7574
|
-
[data-v-
|
|
7634
|
+
[data-v-6499ec1f] .cm-content {
|
|
7575
7635
|
font-family: var(--scalar-font-code);
|
|
7576
7636
|
font-size: var(--scalar-small);
|
|
7577
7637
|
max-height: 20px;
|
|
7578
7638
|
padding: 8px 0;
|
|
7579
7639
|
}
|
|
7580
7640
|
/* Tooltip helper */
|
|
7581
|
-
[data-v-
|
|
7641
|
+
[data-v-6499ec1f] .cm-tooltip {
|
|
7582
7642
|
background: transparent !important;
|
|
7583
7643
|
filter: brightness(var(--scalar-lifted-brightness));
|
|
7584
7644
|
border-radius: var(--scalar-radius);
|
|
@@ -7587,43 +7647,43 @@
|
|
|
7587
7647
|
outline: none !important;
|
|
7588
7648
|
overflow: hidden !important;
|
|
7589
7649
|
}
|
|
7590
|
-
[data-v-
|
|
7650
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul li {
|
|
7591
7651
|
padding: 3px 6px !important;
|
|
7592
7652
|
}
|
|
7593
|
-
[data-v-
|
|
7653
|
+
[data-v-6499ec1f] .cm-completionIcon-type:after {
|
|
7594
7654
|
color: var(--scalar-color-3) !important;
|
|
7595
7655
|
}
|
|
7596
|
-
[data-v-
|
|
7656
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul li[aria-selected] {
|
|
7597
7657
|
background: var(--scalar-background-2) !important;
|
|
7598
7658
|
color: var(--scalar-color-1) !important;
|
|
7599
7659
|
}
|
|
7600
|
-
[data-v-
|
|
7660
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul {
|
|
7601
7661
|
padding: 6px !important;
|
|
7602
7662
|
position: relative;
|
|
7603
7663
|
}
|
|
7604
|
-
[data-v-
|
|
7664
|
+
[data-v-6499ec1f] .cm-tooltip-autocomplete ul li:hover {
|
|
7605
7665
|
border-radius: 3px;
|
|
7606
7666
|
color: var(--scalar-color-1) !important;
|
|
7607
7667
|
background: var(--scalar-background-3) !important;
|
|
7608
7668
|
}
|
|
7609
7669
|
/* Disable active line highlighting */
|
|
7610
|
-
[data-v-
|
|
7670
|
+
[data-v-6499ec1f] .cm-activeLine,[data-v-6499ec1f] .cm-activeLineGutter {
|
|
7611
7671
|
background-color: transparent;
|
|
7612
7672
|
}
|
|
7613
7673
|
/* Color selection matching */
|
|
7614
|
-
[data-v-
|
|
7674
|
+
[data-v-6499ec1f] .cm-selectionMatch,[data-v-6499ec1f] .cm-matchingBracket {
|
|
7615
7675
|
border-radius: var(--scalar-radius);
|
|
7616
7676
|
background: var(--scalar-background-4) !important;
|
|
7617
7677
|
}
|
|
7618
7678
|
/* Color Picker Swatches */
|
|
7619
|
-
[data-v-
|
|
7679
|
+
[data-v-6499ec1f] .cm-css-color-picker-wrapper {
|
|
7620
7680
|
display: inline-flex;
|
|
7621
7681
|
outline: 1px solid var(--scalar-background-3);
|
|
7622
7682
|
border-radius: 3px;
|
|
7623
7683
|
overflow: hidden;
|
|
7624
7684
|
}
|
|
7625
7685
|
/* Number gutter */
|
|
7626
|
-
[data-v-
|
|
7686
|
+
[data-v-6499ec1f] .cm-gutters {
|
|
7627
7687
|
background-color: transparent;
|
|
7628
7688
|
border-right: none;
|
|
7629
7689
|
color: var(--scalar-color-3);
|
|
@@ -7631,7 +7691,7 @@
|
|
|
7631
7691
|
line-height: 22px;
|
|
7632
7692
|
border-radius: 0 0 0 3px;
|
|
7633
7693
|
}
|
|
7634
|
-
[data-v-
|
|
7694
|
+
[data-v-6499ec1f] .cm-gutters:before {
|
|
7635
7695
|
content: '';
|
|
7636
7696
|
position: absolute;
|
|
7637
7697
|
top: 2px;
|
|
@@ -7641,7 +7701,7 @@
|
|
|
7641
7701
|
border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);
|
|
7642
7702
|
background-color: var(--scalar-background-1);
|
|
7643
7703
|
}
|
|
7644
|
-
[data-v-
|
|
7704
|
+
[data-v-6499ec1f] .cm-gutterElement {
|
|
7645
7705
|
font-family: var(--scalar-font-code) !important;
|
|
7646
7706
|
padding-left: 0px !important;
|
|
7647
7707
|
padding-right: 6px !important;
|
|
@@ -7650,16 +7710,16 @@
|
|
|
7650
7710
|
justify-content: flex-end;
|
|
7651
7711
|
position: relative;
|
|
7652
7712
|
}
|
|
7653
|
-
[data-v-
|
|
7713
|
+
[data-v-6499ec1f] .cm-lineNumbers .cm-gutterElement {
|
|
7654
7714
|
min-width: fit-content;
|
|
7655
7715
|
}
|
|
7656
|
-
[data-v-
|
|
7716
|
+
[data-v-6499ec1f] .cm-gutter + .cm-gutter :not(.cm-foldGutter) .cm-gutterElement {
|
|
7657
7717
|
padding-left: 0 !important;
|
|
7658
7718
|
}
|
|
7659
|
-
[data-v-
|
|
7719
|
+
[data-v-6499ec1f] .cm-scroller {
|
|
7660
7720
|
overflow: auto;
|
|
7661
7721
|
}
|
|
7662
|
-
.line-wrapping[data-v-
|
|
7722
|
+
.line-wrapping[data-v-6499ec1f]:focus-within .cm-content {
|
|
7663
7723
|
display: inline-table;
|
|
7664
7724
|
min-height: fit-content;
|
|
7665
7725
|
padding: 3px 6px;
|
|
@@ -7983,7 +8043,7 @@
|
|
|
7983
8043
|
);
|
|
7984
8044
|
}
|
|
7985
8045
|
|
|
7986
|
-
[data-v-
|
|
8046
|
+
[data-v-06778e40] .cm-content {
|
|
7987
8047
|
font-size: var(--scalar-small);
|
|
7988
8048
|
}
|
|
7989
8049
|
|
|
@@ -8004,10 +8064,10 @@
|
|
|
8004
8064
|
scrollbar-width: none;
|
|
8005
8065
|
}
|
|
8006
8066
|
|
|
8007
|
-
[data-v-
|
|
8067
|
+
[data-v-819cea32] .cm-editor {
|
|
8008
8068
|
padding: 0;
|
|
8009
8069
|
}
|
|
8010
|
-
[data-v-
|
|
8070
|
+
[data-v-819cea32] .cm-content {
|
|
8011
8071
|
align-items: center;
|
|
8012
8072
|
background-color: transparent;
|
|
8013
8073
|
display: flex;
|
|
@@ -8016,30 +8076,30 @@
|
|
|
8016
8076
|
padding: 5px 8px;
|
|
8017
8077
|
width: 100%;
|
|
8018
8078
|
}
|
|
8019
|
-
[data-v-
|
|
8079
|
+
[data-v-819cea32] .cm-content:has(.cm-pill) {
|
|
8020
8080
|
padding: 5px 8px;
|
|
8021
8081
|
}
|
|
8022
|
-
[data-v-
|
|
8082
|
+
[data-v-819cea32] .cm-content .cm-pill:not(:last-of-type) {
|
|
8023
8083
|
margin-right: 0.5px;
|
|
8024
8084
|
}
|
|
8025
|
-
[data-v-
|
|
8085
|
+
[data-v-819cea32] .cm-content .cm-pill:not(:first-of-type) {
|
|
8026
8086
|
margin-left: 0.5px;
|
|
8027
8087
|
}
|
|
8028
|
-
[data-v-
|
|
8088
|
+
[data-v-819cea32] .cm-line {
|
|
8029
8089
|
overflow: hidden;
|
|
8030
8090
|
padding: 0;
|
|
8031
8091
|
text-overflow: ellipsis;
|
|
8032
8092
|
word-break: break-word;
|
|
8033
8093
|
}
|
|
8034
|
-
.required[data-v-
|
|
8094
|
+
.required[data-v-819cea32]::after {
|
|
8035
8095
|
content: 'Required';
|
|
8036
8096
|
}
|
|
8037
8097
|
/* Tailwind placeholder is busted */
|
|
8038
|
-
input[data-v-
|
|
8098
|
+
input[data-v-819cea32]::placeholder {
|
|
8039
8099
|
color: var(--scalar-color-3);
|
|
8040
8100
|
}
|
|
8041
8101
|
/* we want our inputs to look like a password input but not be one */
|
|
8042
|
-
.scalar-password-input[data-v-
|
|
8102
|
+
.scalar-password-input[data-v-819cea32] {
|
|
8043
8103
|
text-security: disc;
|
|
8044
8104
|
-webkit-text-security: disc;
|
|
8045
8105
|
-moz-text-security: disc;
|
|
@@ -8092,7 +8152,7 @@ input[data-v-3157c3c7]::placeholder {
|
|
|
8092
8152
|
min-width: 100%;
|
|
8093
8153
|
}
|
|
8094
8154
|
|
|
8095
|
-
.scalar-code-block[data-v-
|
|
8155
|
+
.scalar-code-block[data-v-30c34ea4] .hljs * {
|
|
8096
8156
|
font-size: var(--scalar-small);
|
|
8097
8157
|
}
|
|
8098
8158
|
|
|
@@ -8165,11 +8225,11 @@ to {
|
|
|
8165
8225
|
opacity: 0;
|
|
8166
8226
|
}
|
|
8167
8227
|
|
|
8168
|
-
.animate-response-heading .response-heading[data-v-
|
|
8169
|
-
animation: push-response-
|
|
8228
|
+
.animate-response-heading .response-heading[data-v-82f4df98] {
|
|
8229
|
+
animation: push-response-82f4df98 0.2s ease-in-out forwards;
|
|
8170
8230
|
opacity: 1;
|
|
8171
8231
|
}
|
|
8172
|
-
@keyframes push-response-
|
|
8232
|
+
@keyframes push-response-82f4df98 {
|
|
8173
8233
|
from {
|
|
8174
8234
|
opacity: 1;
|
|
8175
8235
|
transform: translateY(0);
|
|
@@ -8179,11 +8239,11 @@ to {
|
|
|
8179
8239
|
transform: translateY(-4px);
|
|
8180
8240
|
}
|
|
8181
8241
|
}
|
|
8182
|
-
.animate-response-heading .animate-response-children[data-v-
|
|
8183
|
-
animation: response-spans-
|
|
8242
|
+
.animate-response-heading .animate-response-children[data-v-82f4df98] {
|
|
8243
|
+
animation: response-spans-82f4df98 0.2s ease-in-out forwards 0.05s;
|
|
8184
8244
|
opacity: 0;
|
|
8185
8245
|
}
|
|
8186
|
-
@keyframes response-spans-
|
|
8246
|
+
@keyframes response-spans-82f4df98 {
|
|
8187
8247
|
from {
|
|
8188
8248
|
opacity: 0;
|
|
8189
8249
|
transform: translateY(4px);
|
|
@@ -8194,33 +8254,33 @@ to {
|
|
|
8194
8254
|
}
|
|
8195
8255
|
}
|
|
8196
8256
|
|
|
8197
|
-
.request-card[data-v-
|
|
8257
|
+
.request-card[data-v-59da314d] {
|
|
8198
8258
|
font-size: var(--scalar-font-size-3);
|
|
8199
8259
|
}
|
|
8200
|
-
.request-method[data-v-
|
|
8260
|
+
.request-method[data-v-59da314d] {
|
|
8201
8261
|
font-family: var(--scalar-font-code);
|
|
8202
8262
|
text-transform: uppercase;
|
|
8203
8263
|
margin-right: 6px;
|
|
8204
8264
|
}
|
|
8205
|
-
.request-card-footer[data-v-
|
|
8265
|
+
.request-card-footer[data-v-59da314d] {
|
|
8206
8266
|
display: flex;
|
|
8207
8267
|
justify-content: flex-end;
|
|
8208
8268
|
padding: 6px;
|
|
8209
8269
|
flex-shrink: 0;
|
|
8210
8270
|
position: relative;
|
|
8211
8271
|
}
|
|
8212
|
-
.request-card-footer-addon[data-v-
|
|
8272
|
+
.request-card-footer-addon[data-v-59da314d] {
|
|
8213
8273
|
display: flex;
|
|
8214
8274
|
align-items: center;
|
|
8215
8275
|
|
|
8216
8276
|
flex: 1;
|
|
8217
8277
|
min-width: 0;
|
|
8218
8278
|
}
|
|
8219
|
-
.request-editor-section[data-v-
|
|
8279
|
+
.request-editor-section[data-v-59da314d] {
|
|
8220
8280
|
display: flex;
|
|
8221
8281
|
flex: 1;
|
|
8222
8282
|
}
|
|
8223
|
-
.request-card-simple[data-v-
|
|
8283
|
+
.request-card-simple[data-v-59da314d] {
|
|
8224
8284
|
display: flex;
|
|
8225
8285
|
align-items: center;
|
|
8226
8286
|
justify-content: space-between;
|
|
@@ -8229,7 +8289,7 @@ to {
|
|
|
8229
8289
|
|
|
8230
8290
|
font-size: var(--scalar-small);
|
|
8231
8291
|
}
|
|
8232
|
-
.code-snippet[data-v-
|
|
8292
|
+
.code-snippet[data-v-59da314d] {
|
|
8233
8293
|
display: flex;
|
|
8234
8294
|
flex-direction: column;
|
|
8235
8295
|
width: 100%;
|
|
@@ -8706,16 +8766,16 @@ to {
|
|
|
8706
8766
|
display: none;
|
|
8707
8767
|
}
|
|
8708
8768
|
|
|
8709
|
-
.scalar-collection-auth[data-v-
|
|
8769
|
+
.scalar-collection-auth[data-v-d3bc49bd] {
|
|
8710
8770
|
border: var(--scalar-border-width) solid var(--scalar-border-color);
|
|
8711
8771
|
border-radius: var(--scalar-radius-lg);
|
|
8712
8772
|
overflow: hidden;
|
|
8713
8773
|
}
|
|
8714
8774
|
|
|
8715
|
-
[data-v-
|
|
8775
|
+
[data-v-2f13118d] .cm-editor {
|
|
8716
8776
|
padding: 0;
|
|
8717
8777
|
}
|
|
8718
|
-
[data-v-
|
|
8778
|
+
[data-v-2f13118d] .cm-content {
|
|
8719
8779
|
align-items: center;
|
|
8720
8780
|
background-color: transparent;
|
|
8721
8781
|
display: flex;
|
|
@@ -8724,16 +8784,16 @@ to {
|
|
|
8724
8784
|
padding: 5px 8px;
|
|
8725
8785
|
width: 100%;
|
|
8726
8786
|
}
|
|
8727
|
-
[data-v-
|
|
8787
|
+
[data-v-2f13118d] .cm-content:has(.cm-pill) {
|
|
8728
8788
|
padding: 5px 8px;
|
|
8729
8789
|
}
|
|
8730
|
-
[data-v-
|
|
8790
|
+
[data-v-2f13118d] .cm-content .cm-pill:not(:last-of-type) {
|
|
8731
8791
|
margin-right: 0.5px;
|
|
8732
8792
|
}
|
|
8733
|
-
[data-v-
|
|
8793
|
+
[data-v-2f13118d] .cm-content .cm-pill:not(:first-of-type) {
|
|
8734
8794
|
margin-left: 0.5px;
|
|
8735
8795
|
}
|
|
8736
|
-
[data-v-
|
|
8796
|
+
[data-v-2f13118d] .cm-line {
|
|
8737
8797
|
overflow: hidden;
|
|
8738
8798
|
padding: 0;
|
|
8739
8799
|
text-overflow: ellipsis;
|
|
@@ -8812,7 +8872,7 @@ to {
|
|
|
8812
8872
|
display: none;
|
|
8813
8873
|
}
|
|
8814
8874
|
|
|
8815
|
-
.postman-import-path-conflict-callout[data-v-
|
|
8875
|
+
.postman-import-path-conflict-callout[data-v-cc4f666d] {
|
|
8816
8876
|
border-color: var(--scalar-color-red);
|
|
8817
8877
|
background-color: var(--scalar-background-danger);
|
|
8818
8878
|
color: var(--scalar-color-1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"AA8fA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AACrF,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAA;AACnF,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAKL,KAAK,qBAAqB,EAE1B,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAqB5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKrD;;;;;;;;;;;;GAYG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAMzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,uBAAuB;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,wBAAwB;IACxB,gBAAgB,EAAE,aAAa,EAAE,CAAA;IACjC,uBAAuB;IACvB,eAAe,EAAE,aAAa,EAAE,CAAA;IAChC,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,cAAc,CAAA;IACtB,mBAAmB;IACnB,WAAW,EAAE,gBAAgB,CAAA;IAC7B,oCAAoC;IACpC,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,gCAAgC;IAChC,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,sCAAsC;IACtC,UAAU,EAAE,UAAU,CAAA;IACtB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,uBAAuB;IACvB,SAAS,EAAE,eAAe,CAAA;IAC1B,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,CAAA;IAClB,wCAAwC;IACxC,eAAe,EAAE,qBAAqB,CAAA;IACtC,qBAAqB;IACrB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,0CAA0C;IAC1C,uBAAuB,EAAE,0BAA0B,EAAE,CAAA;IACrD,4BAA4B;IAC5B,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,sBAAsB;IACtB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,sEAAsE;IACtE,+BAA+B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxD,6CAA6C;IAC7C,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAChC,CAAA;AACD,QAAA,MAAM,YAAY,kTA8ed,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue.js","names":[],"sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * OperationBlock\n *\n * Orchestrates the operation view by wiring together the Header, OperationBlock,\n * and ResponseBlock. Forwards user interactions to the workspace event bus and\n * passes through configuration such as auth, servers, plugins, and environment.\n * This component keeps the Operation page lean by centralizing event emission\n * and prop wiring between the blocks.\n *\n * Notable behavior:\n * - Uses operation['x-scalar-method'] and operation['x-scalar-path'] to provide\n * draft overrides for the UI when present.\n */\nexport default {\n name: 'OperationBlock',\n}\n\nexport type OperationBlockProps = {\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Workspace cookies */\n workspaceCookies: XScalarCookie[]\n /** Document cookies */\n documentCookies: XScalarCookie[]\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** HTTP clients */\n httpClients: AvailableClients\n /** The history for the operation */\n history?: HistoryEntry[]\n /** Client layout */\n layout: ClientLayout\n /** Currently selected server */\n server: ServerObject | null\n /** Currently selected client */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** Meta information for the server */\n serverMeta: ServerMeta\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Operation object */\n operation: OperationObject\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Meta information for the auth update */\n authMeta: AuthMeta\n /** Document defined security schemes */\n securitySchemes: MergedSecuritySchemes\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** For environment variables in the inputs */\n environment: XScalarEnvironment\n /** The proxy URL for sending requests */\n proxyUrl: string\n /** Currently selected security */\n selectedSecurity: SelectedSecurity\n /** Currently selected security schemes */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n /** Security requirements */\n securityRequirements: OpenApiDocument['security']\n /** Default headers */\n defaultHeaders: Record<string, string>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n}\n</script>\n<script setup lang=\"ts\">\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { executeHook, type ClientPlugin } from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type { HistoryEntry } from '@scalar/workspace-store/entities/history/schema'\nimport type {\n AuthMeta,\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n requestFactory,\n type MergedSecuritySchemes,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation'\nimport { computed, onBeforeUnmount, onMounted, ref, toValue, watch } from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport { harToFetchRequest } from '@/v2/blocks/operation-block/helpers/har-to-fetch-request'\nimport { harToFetchResponse } from '@/v2/blocks/operation-block/helpers/har-to-fetch-response'\nimport {\n getOperationExampleKey,\n isStreamingResponse,\n responseCache,\n} from '@/v2/blocks/operation-block/helpers/response-cache'\nimport {\n sendRequest,\n type ResponseInstance,\n} from '@/v2/blocks/operation-block/helpers/send-request'\nimport { validatePathParameters } from '@/v2/blocks/operation-block/helpers/validate-path-parameters'\nimport { generateClientOptions } from '@/v2/blocks/operation-code-sample'\nimport { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport Header from './components/Header.vue'\n\nconst {\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n method,\n operation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\n/** Hoist up client generation so it doesn't get re-generated on every operation */\nconst clientOptions = computed(() => generateClientOptions(httpClients))\n\nconst { toast } = useToasts()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst request = ref<Request | null>(null)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast('Path parameters must have values.', 'error')\n return\n }\n\n const globalCookies = [...workspaceCookies, ...documentCookies]\n\n const { request: requestBuilder } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies,\n method,\n operation,\n path,\n proxyUrl,\n server,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n requestBodyCompositionSelection,\n })\n\n // Stop any previous streaming response\n if (response.value && 'reader' in response.value) {\n response.value.reader.cancel()\n }\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Execute the beforeRequest hook (plugins receive RequestFactory, not fetch Request)\n await executeHook(\n {\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'beforeRequest',\n plugins,\n )\n\n const envVariables = {\n ...getEnvironmentVariables(environment),\n ...variablesStore.getVariables(),\n }\n\n // Build the fetch Request after hooks may have mutated the factory\n const requestResult = (() => {\n try {\n return {\n ok: true,\n result: buildRequest(requestBuilder, {\n envVariables,\n }),\n } as const\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n return {\n ok: false,\n error: message,\n } as const\n }\n })()\n\n if (requestResult.ok === false) {\n toast(requestResult.error, 'error')\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = requestResult.result.controller\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:sent', {\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n /** Execute the request */\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.result.isUsingProxy,\n request: requestResult.result.request,\n })\n\n if (sendResult) {\n // Execute the responseReceived hook\n await executeHook(\n {\n response: sendResult.originalResponse.clone(),\n requestBuilder,\n request: sendResult.request.clone(),\n document,\n operation,\n variablesStore,\n },\n 'responseReceived',\n plugins,\n )\n }\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:complete', {\n payload: sendResult\n ? {\n response: sendResult.originalResponse.clone(),\n request: sendResult.request.clone(),\n duration: sendResult.response.duration,\n timestamp: sendResult.timestamp,\n }\n : undefined,\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n if (sendError) {\n // clean up the response and request\n response.value = null\n request.value = null\n abortController.value = null\n\n toast(sendError.message, 'error')\n return\n }\n\n // Store the response\n response.value = sendResult.response\n request.value = sendResult.request\n\n // Cache non-streaming responses so they can be restored when navigating back\n if (!isStreamingResponse(sendResult.response)) {\n responseCache.set(getOperationExampleKey(method, path, exampleKey), {\n response: sendResult.response,\n request: sendResult.request,\n })\n }\n}\n\nonMounted(() => {\n eventBus.on('operation:send:request:hotkey', handleExecute)\n eventBus.on('operation:cancel:request', cancelRequest)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as HttpMethodType,\n path: entry.request.url,\n duration: entry.time,\n status: entry.response.status,\n }))\n .reverse(),\n)\n\nconst handleSelectHistoryItem = ({ index }: { index: number }) => {\n const transformedIndex = (history.length ?? 0) - index - 1\n const historyItem = history[transformedIndex]\n if (!historyItem) {\n return\n }\n\n const navigate = () =>\n eventBus.emit('ui:navigate', {\n page: 'example',\n method,\n path,\n exampleName: 'draft',\n callback: (status) => {\n // Do not replace the response if the navigation was not successful\n if (status !== 'success') {\n return\n }\n // Reconstruct the response\n const fetchResponse = harToFetchResponse({\n harResponse: historyItem.response,\n url: historyItem.request.url,\n method,\n path,\n duration: historyItem.time,\n })\n\n // Reconstruct the request\n const fetchRequest = harToFetchRequest({\n harRequest: historyItem.request,\n })\n\n // Update the response and request\n response.value = fetchResponse\n request.value = fetchRequest\n },\n })\n\n eventBus.emit('operation:reload:history', {\n meta: {\n path,\n method,\n },\n index: transformedIndex,\n callback: navigate,\n })\n}\n\n/**\n * When the path, method, or example key changes: save current response to\n * cache (so it can be restored when navigating back), then restore from cache\n * for the new operation or clear if no cached response. Response is only\n * cleared on page refresh or when making a new request for that operation.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n const newKey = getOperationExampleKey(newMethod, newPath, newExampleKey)\n const cached = responseCache.get(newKey)\n if (cached) {\n response.value = cached.response\n request.value = cached.request\n } else {\n response.value = null\n request.value = null\n }\n\n // Cancel any in-flight request\n cancelRequest()\n },\n { immediate: true },\n)\n\nonBeforeUnmount(() => {\n // We cancel the request if the component is unmounted\n cancelRequest()\n})\n</script>\n<template>\n <div class=\"bg-b-1 flex h-full flex-col\">\n <div\n class=\"lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0\">\n <!-- Address Bar -->\n <Header\n :activeEnvironment\n :documentUrl\n :environment\n :environments\n :eventBus\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @select:history:item=\"handleSelectHistoryItem\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <RequestBlock\n :authMeta\n :clientOptions\n :defaultHeaders\n :documentCookies\n :environment\n :eventBus\n :exampleKey\n :layout\n :method\n :operation\n :options=\"toValue(options)\"\n :path\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :layout\n :plugins\n :request\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue.js","names":[],"sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * OperationBlock\n *\n * Orchestrates the operation view by wiring together the Header, OperationBlock,\n * and ResponseBlock. Forwards user interactions to the workspace event bus and\n * passes through configuration such as auth, servers, plugins, and environment.\n * This component keeps the Operation page lean by centralizing event emission\n * and prop wiring between the blocks.\n *\n * Notable behavior:\n * - Uses operation['x-scalar-method'] and operation['x-scalar-path'] to provide\n * draft overrides for the UI when present.\n */\nexport default {\n name: 'OperationBlock',\n}\n\nexport type OperationBlockProps = {\n /** Event bus */\n eventBus: WorkspaceEventBus\n /** Application version */\n appVersion: string\n /** Openapi document */\n document: OpenApiDocument\n /** Workspace cookies */\n workspaceCookies: XScalarCookie[]\n /** Document cookies */\n documentCookies: XScalarCookie[]\n /** Current request path */\n path: string\n /** Current request method */\n method: HttpMethodType\n /** HTTP clients */\n httpClients: AvailableClients\n /** The history for the operation */\n history?: HistoryEntry[]\n /** Client layout */\n layout: ClientLayout\n /** Currently selected server */\n server: ServerObject | null\n /** Currently selected client */\n selectedClient: WorkspaceStore['workspace']['x-scalar-default-client']\n /** Server list available for operation/document */\n servers: ServerObject[]\n /** Meta information for the server */\n serverMeta: ServerMeta\n /** Hides the client button on the header */\n hideClientButton?: boolean\n /** Client integration */\n integration?: string | null\n /** Openapi document url for `modal` mode to open the client app */\n documentUrl?: string\n /** Client source */\n source?: 'gitbook' | 'api-reference'\n /** Operation object */\n operation: OperationObject\n /** Currently selected example key for the current operation */\n exampleKey: string\n /** Meta information for the auth update */\n authMeta: AuthMeta\n /** Document defined security schemes */\n securitySchemes: MergedSecuritySchemes\n /** Client plugins */\n plugins: ClientPlugin[]\n /** Environment list */\n environments?: string[]\n /** Currently selected environment */\n activeEnvironment?: string\n /** For environment variables in the inputs */\n environment: XScalarEnvironment\n /** The proxy URL for sending requests */\n proxyUrl: string\n /** Currently selected security */\n selectedSecurity: SelectedSecurity\n /** Currently selected security schemes */\n selectedSecuritySchemes: SecuritySchemeObjectSecret[]\n /** Security requirements */\n securityRequirements: OpenApiDocument['security']\n /** Default headers */\n defaultHeaders: Record<string, string>\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n /** Subset of config options for the modal */\n options?: ModalProps['options']\n}\n</script>\n<script setup lang=\"ts\">\nimport { ERRORS } from '@scalar/helpers/errors/normalize-error'\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport { buildSafeBodyRequest } from '@scalar/helpers/http/can-method-have-body'\nimport type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods'\nimport { executeHook, type ClientPlugin } from '@scalar/oas-utils/helpers'\nimport {\n AVAILABLE_CLIENTS,\n type AvailableClients,\n} from '@scalar/types/snippetz'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { SelectedSecurity } from '@scalar/workspace-store/entities/auth'\nimport type { HistoryEntry } from '@scalar/workspace-store/entities/history/schema'\nimport type {\n AuthMeta,\n ServerMeta,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n buildRequest,\n createVariablesStoreForRequest,\n getEnvironmentVariables,\n requestFactory,\n type MergedSecuritySchemes,\n type RequestPayload,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies'\nimport type {\n OpenApiDocument,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation'\nimport { computed, onBeforeUnmount, onMounted, ref, toValue, watch } from 'vue'\n\nimport ViewLayout from '@/components/ViewLayout/ViewLayout.vue'\nimport ViewLayoutContent from '@/components/ViewLayout/ViewLayoutContent.vue'\nimport { harToFetchRequest } from '@/v2/blocks/operation-block/helpers/har-to-fetch-request'\nimport { harToFetchResponse } from '@/v2/blocks/operation-block/helpers/har-to-fetch-response'\nimport {\n getOperationExampleKey,\n isStreamingResponse,\n responseCache,\n} from '@/v2/blocks/operation-block/helpers/response-cache'\nimport {\n sendRequest,\n type ResponseInstance,\n} from '@/v2/blocks/operation-block/helpers/send-request'\nimport { validatePathParameters } from '@/v2/blocks/operation-block/helpers/validate-path-parameters'\nimport { generateClientOptions } from '@/v2/blocks/operation-code-sample'\nimport { RequestBlock } from '@/v2/blocks/request-block'\nimport { ResponseBlock } from '@/v2/blocks/response-block'\nimport { type History } from '@/v2/blocks/scalar-address-bar-block'\nimport type { ModalProps } from '@/v2/features/modal/Modal.vue'\nimport type { ClientLayout } from '@/v2/types/layout'\n\nimport Header from './components/Header.vue'\n\nconst {\n authMeta,\n environment,\n eventBus,\n exampleKey,\n document,\n workspaceCookies = [],\n documentCookies = [],\n hideClientButton,\n httpClients = AVAILABLE_CLIENTS,\n history = [],\n method,\n operation,\n path,\n plugins = [],\n proxyUrl,\n requestBodyCompositionSelection,\n securitySchemes,\n selectedClient,\n server,\n environments,\n options,\n activeEnvironment,\n serverMeta,\n selectedSecurity,\n selectedSecuritySchemes,\n securityRequirements,\n defaultHeaders,\n} = defineProps<OperationBlockProps>()\n\n/** Hoist up client generation so it doesn't get re-generated on every operation */\nconst clientOptions = computed(() => generateClientOptions(httpClients))\n\nconst { toast } = useToasts()\n\n// Refs\nconst abortController = ref<AbortController | null>(null)\nconst response = ref<ResponseInstance | null>(null)\nconst requestPayload = ref<RequestPayload | null>(null)\n\n/** Cancel the request */\nconst cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED)\n\n/** Execute the current operation example */\nconst handleExecute = async () => {\n const pathValidation = validatePathParameters(\n operation.parameters ?? [],\n exampleKey,\n )\n if (pathValidation.ok === false) {\n toast('Path parameters must have values.', 'error')\n return\n }\n\n const globalCookies = [...workspaceCookies, ...documentCookies]\n\n const { request: requestBuilder } = requestFactory({\n defaultHeaders,\n environment,\n exampleName: exampleKey,\n globalCookies,\n method,\n operation,\n path,\n proxyUrl,\n server,\n selectedSecuritySchemes,\n isElectron: isElectron(),\n requestBodyCompositionSelection,\n })\n\n // Stop any previous streaming response\n if (response.value && 'reader' in response.value) {\n response.value.reader.cancel()\n }\n\n const variablesStore = createVariablesStoreForRequest()\n\n // Execute the beforeRequest hook (plugins receive RequestFactory, not fetch Request)\n await executeHook(\n {\n requestBuilder,\n document,\n operation,\n variablesStore,\n },\n 'beforeRequest',\n plugins,\n )\n\n const envVariables = {\n ...getEnvironmentVariables(environment),\n ...variablesStore.getVariables(),\n }\n\n // Build the fetch Request after hooks may have mutated the factory\n const requestResult = (() => {\n try {\n return {\n ok: true,\n result: buildRequest(requestBuilder, {\n envVariables,\n }),\n } as const\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n return {\n ok: false,\n error: message,\n } as const\n }\n })()\n\n if (requestResult.ok === false) {\n toast(requestResult.error, 'error')\n return\n }\n\n // Store the abort controller for cancellation\n abortController.value = requestResult.result.controller\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:sent', {\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n /** Execute the request */\n const [sendError, sendResult] = await sendRequest({\n isUsingProxy: requestResult.result.isUsingProxy,\n requestPayload: requestResult.result.requestPayload,\n plugins,\n customFetch: toValue(options)?.customFetch,\n })\n\n if (sendResult) {\n // Execute the responseReceived hook\n await executeHook(\n {\n response: sendResult.originalResponse.clone(),\n requestBuilder,\n request: buildSafeBodyRequest(...sendResult.requestPayload),\n document,\n operation,\n variablesStore,\n },\n 'responseReceived',\n plugins,\n )\n }\n\n // Execute the hooks\n eventBus.emit('hooks:on:request:complete', {\n payload: sendResult\n ? {\n response: sendResult.originalResponse.clone(),\n requestPayload: sendResult.requestPayload,\n duration: sendResult.response.duration,\n timestamp: sendResult.timestamp,\n }\n : undefined,\n meta: {\n method,\n path,\n exampleKey,\n },\n })\n\n if (sendError) {\n // clean up the response and request\n response.value = null\n requestPayload.value = null\n abortController.value = null\n\n toast(sendError.message, 'error')\n return\n }\n\n // Store the response\n response.value = sendResult.response\n requestPayload.value = sendResult.requestPayload\n\n // Cache non-streaming responses so they can be restored when navigating back\n if (!isStreamingResponse(sendResult.response)) {\n responseCache.set(getOperationExampleKey(method, path, exampleKey), {\n response: sendResult.response,\n requestPayload: sendResult.requestPayload,\n })\n }\n}\n\nonMounted(() => {\n eventBus.on('operation:send:request:hotkey', handleExecute)\n eventBus.on('operation:cancel:request', cancelRequest)\n})\nonBeforeUnmount(() => {\n eventBus.off('operation:send:request:hotkey', handleExecute)\n eventBus.off('operation:cancel:request', cancelRequest)\n})\n\nconst operationHistory = computed<History[]>(() =>\n history\n .map((entry) => ({\n method: entry.request.method as HttpMethodType,\n path: entry.request.url,\n duration: entry.time,\n status: entry.response.status,\n }))\n .reverse(),\n)\n\nconst handleSelectHistoryItem = ({ index }: { index: number }) => {\n const transformedIndex = (history.length ?? 0) - index - 1\n const historyItem = history[transformedIndex]\n if (!historyItem) {\n return\n }\n\n const navigate = () =>\n eventBus.emit('ui:navigate', {\n page: 'example',\n method,\n path,\n exampleName: 'draft',\n callback: (status) => {\n // Do not replace the response if the navigation was not successful\n if (status !== 'success') {\n return\n }\n // Reconstruct the response\n const fetchResponse = harToFetchResponse({\n harResponse: historyItem.response,\n url: historyItem.request.url,\n method,\n path,\n duration: historyItem.time,\n })\n\n // Reconstruct the request\n const fetchRequest = harToFetchRequest({\n harRequest: historyItem.request,\n })\n\n // Update the response and request\n response.value = fetchResponse\n requestPayload.value = fetchRequest\n },\n })\n\n eventBus.emit('operation:reload:history', {\n meta: {\n path,\n method,\n },\n index: transformedIndex,\n callback: navigate,\n })\n}\n\n/**\n * When the path, method, or example key changes: save current response to\n * cache (so it can be restored when navigating back), then restore from cache\n * for the new operation or clear if no cached response. Response is only\n * cleared on page refresh or when making a new request for that operation.\n */\nwatch(\n [() => path, () => method, () => exampleKey],\n ([newPath, newMethod, newExampleKey]) => {\n const newKey = getOperationExampleKey(newMethod, newPath, newExampleKey)\n const cached = responseCache.get(newKey)\n if (cached) {\n response.value = cached.response\n requestPayload.value = cached.requestPayload\n } else {\n response.value = null\n requestPayload.value = null\n }\n\n // Cancel any in-flight request\n cancelRequest()\n },\n { immediate: true },\n)\n\nonBeforeUnmount(() => {\n // We cancel the request if the component is unmounted\n cancelRequest()\n})\n</script>\n<template>\n <div class=\"bg-b-1 flex h-full flex-col\">\n <div\n class=\"lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0\">\n <!-- Address Bar -->\n <Header\n :activeEnvironment\n :documentUrl\n :environment\n :environments\n :eventBus\n :hideClientButton\n :history=\"operationHistory\"\n :integration\n :layout\n :method\n :path\n :server\n :serverMeta\n :servers\n :source\n @execute=\"handleExecute\"\n @select:history:item=\"handleSelectHistoryItem\" />\n </div>\n\n <ViewLayout class=\"border-t\">\n <ViewLayoutContent class=\"flex-1\">\n <!-- Request Section -->\n <RequestBlock\n :authMeta\n :clientOptions\n :defaultHeaders\n :documentCookies\n :environment\n :eventBus\n :exampleKey\n :layout\n :method\n :operation\n :options=\"toValue(options)\"\n :path\n :plugins\n :proxyUrl\n :requestBodyCompositionSelection\n :securityRequirements\n :securitySchemes\n :selectedClient\n :selectedSecurity\n :selectedSecuritySchemes\n :server\n :workspaceCookies />\n\n <!-- Response Section -->\n <ResponseBlock\n :appVersion\n :eventBus\n :layout\n :plugins\n :requestPayload\n :response\n :totalPerformedRequests=\"operationHistory.length\" />\n </ViewLayoutContent>\n </ViewLayout>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -12,6 +12,7 @@ import Header_default from "./components/Header.vue.js";
|
|
|
12
12
|
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, onBeforeUnmount, onMounted, openBlock, ref, toValue, unref, watch, withCtx } from "vue";
|
|
13
13
|
import { ERRORS } from "@scalar/helpers/errors/normalize-error";
|
|
14
14
|
import { isElectron } from "@scalar/helpers/general/is-electron";
|
|
15
|
+
import { buildSafeBodyRequest } from "@scalar/helpers/http/can-method-have-body";
|
|
15
16
|
import { executeHook } from "@scalar/oas-utils/helpers";
|
|
16
17
|
import { AVAILABLE_CLIENTS } from "@scalar/types/snippetz";
|
|
17
18
|
import { useToasts } from "@scalar/use-toasts";
|
|
@@ -62,7 +63,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
62
63
|
const { toast } = useToasts();
|
|
63
64
|
const abortController = ref(null);
|
|
64
65
|
const response = ref(null);
|
|
65
|
-
const
|
|
66
|
+
const requestPayload = ref(null);
|
|
66
67
|
/** Cancel the request */
|
|
67
68
|
const cancelRequest = () => abortController.value?.abort(ERRORS.REQUEST_ABORTED);
|
|
68
69
|
/** Execute the current operation example */
|
|
@@ -124,12 +125,14 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
124
125
|
/** Execute the request */
|
|
125
126
|
const [sendError, sendResult] = await sendRequest({
|
|
126
127
|
isUsingProxy: requestResult.result.isUsingProxy,
|
|
127
|
-
|
|
128
|
+
requestPayload: requestResult.result.requestPayload,
|
|
129
|
+
plugins: __props.plugins,
|
|
130
|
+
customFetch: toValue(__props.options)?.customFetch
|
|
128
131
|
});
|
|
129
132
|
if (sendResult) await executeHook({
|
|
130
133
|
response: sendResult.originalResponse.clone(),
|
|
131
134
|
requestBuilder,
|
|
132
|
-
request: sendResult.
|
|
135
|
+
request: buildSafeBodyRequest(...sendResult.requestPayload),
|
|
133
136
|
document: __props.document,
|
|
134
137
|
operation: __props.operation,
|
|
135
138
|
variablesStore
|
|
@@ -137,7 +140,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
137
140
|
__props.eventBus.emit("hooks:on:request:complete", {
|
|
138
141
|
payload: sendResult ? {
|
|
139
142
|
response: sendResult.originalResponse.clone(),
|
|
140
|
-
|
|
143
|
+
requestPayload: sendResult.requestPayload,
|
|
141
144
|
duration: sendResult.response.duration,
|
|
142
145
|
timestamp: sendResult.timestamp
|
|
143
146
|
} : void 0,
|
|
@@ -149,16 +152,16 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
149
152
|
});
|
|
150
153
|
if (sendError) {
|
|
151
154
|
response.value = null;
|
|
152
|
-
|
|
155
|
+
requestPayload.value = null;
|
|
153
156
|
abortController.value = null;
|
|
154
157
|
toast(sendError.message, "error");
|
|
155
158
|
return;
|
|
156
159
|
}
|
|
157
160
|
response.value = sendResult.response;
|
|
158
|
-
|
|
161
|
+
requestPayload.value = sendResult.requestPayload;
|
|
159
162
|
if (!isStreamingResponse(sendResult.response)) responseCache.set(getOperationExampleKey(__props.method, __props.path, __props.exampleKey), {
|
|
160
163
|
response: sendResult.response,
|
|
161
|
-
|
|
164
|
+
requestPayload: sendResult.requestPayload
|
|
162
165
|
});
|
|
163
166
|
};
|
|
164
167
|
onMounted(() => {
|
|
@@ -195,7 +198,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
195
198
|
});
|
|
196
199
|
const fetchRequest = harToFetchRequest({ harRequest: historyItem.request });
|
|
197
200
|
response.value = fetchResponse;
|
|
198
|
-
|
|
201
|
+
requestPayload.value = fetchRequest;
|
|
199
202
|
}
|
|
200
203
|
});
|
|
201
204
|
__props.eventBus.emit("operation:reload:history", {
|
|
@@ -222,10 +225,10 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
222
225
|
const cached = responseCache.get(newKey);
|
|
223
226
|
if (cached) {
|
|
224
227
|
response.value = cached.response;
|
|
225
|
-
|
|
228
|
+
requestPayload.value = cached.requestPayload;
|
|
226
229
|
} else {
|
|
227
230
|
response.value = null;
|
|
228
|
-
|
|
231
|
+
requestPayload.value = null;
|
|
229
232
|
}
|
|
230
233
|
cancelRequest();
|
|
231
234
|
}, { immediate: true });
|
|
@@ -320,7 +323,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
320
323
|
eventBus: __props.eventBus,
|
|
321
324
|
layout: __props.layout,
|
|
322
325
|
plugins: __props.plugins,
|
|
323
|
-
|
|
326
|
+
requestPayload: requestPayload.value,
|
|
324
327
|
response: response.value,
|
|
325
328
|
totalPerformedRequests: operationHistory.value.length
|
|
326
329
|
}, null, 8, [
|
|
@@ -328,7 +331,7 @@ var OperationBlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
328
331
|
"eventBus",
|
|
329
332
|
"layout",
|
|
330
333
|
"plugins",
|
|
331
|
-
"
|
|
334
|
+
"requestPayload",
|
|
332
335
|
"response",
|
|
333
336
|
"totalPerformedRequests"
|
|
334
337
|
])]),
|