@scalar/api-client 3.3.0 → 3.4.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 +21 -0
- package/dist/monacoeditorwork/yaml.worker.bundle.js +92 -79
- package/dist/style.css +107 -73
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +2 -0
- 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 +5 -0
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +4 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/components/Header.vue.script.js +6 -0
- package/dist/v2/blocks/operation-block/components/Header.vue.script.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 +9 -2
- package/dist/v2/blocks/operation-block/helpers/response-cache.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +2 -2
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +2 -2
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +4 -0
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js +84 -71
- package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.d.ts +13 -0
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js +28 -0
- package/dist/v2/blocks/scalar-address-bar-block/helpers/is-placeholder-path.js.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.d.ts +16 -0
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js +28 -0
- package/dist/v2/blocks/scalar-address-bar-block/helpers/refocus-blur-target.js.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.d.ts +31 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js +18 -0
- package/dist/v2/blocks/scalar-address-bar-block/hooks/use-path-masking.js.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.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 +1 -1
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.d.ts +2 -2
- package/dist/v2/components/modals/ModalClientContainer.vue.d.ts.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.js.map +1 -1
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js +17 -24
- package/dist/v2/components/modals/ModalClientContainer.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- package/dist/v2/features/app/App.vue.d.ts +25 -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 +54 -39
- package/dist/v2/features/app/App.vue.script.js.map +1 -1
- package/dist/v2/features/app/app-events.js +4 -4
- package/dist/v2/features/app/app-events.js.map +1 -1
- package/dist/v2/features/app/app-state.d.ts +20 -14
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +89 -55
- package/dist/v2/features/app/app-state.js.map +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.d.ts +26 -3
- package/dist/v2/features/app/components/AppHeader.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.js.map +1 -1
- package/dist/v2/features/app/components/AppHeader.vue.script.js +15 -6
- package/dist/v2/features/app/components/AppHeader.vue.script.js.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts +2 -2
- package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.js.map +1 -1
- package/dist/v2/features/app/components/AppSidebar.vue.script.js +86 -108
- package/dist/v2/features/app/components/AppSidebar.vue.script.js.map +1 -1
- package/dist/v2/features/app/components/CreateVersionModal.vue.d.ts +28 -0
- package/dist/v2/features/app/components/CreateVersionModal.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/CreateVersionModal.vue.js +7 -0
- package/dist/v2/features/app/components/CreateVersionModal.vue.js.map +1 -0
- package/dist/v2/features/app/components/CreateVersionModal.vue.script.js +84 -0
- package/dist/v2/features/app/components/CreateVersionModal.vue.script.js.map +1 -0
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts +26 -0
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js +9 -0
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.js.map +1 -0
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js +376 -0
- package/dist/v2/features/app/components/DocumentBreadcrumb.vue.script.js.map +1 -0
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts +16 -0
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js +7 -0
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.js.map +1 -0
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js +51 -0
- package/dist/v2/features/app/components/DocumentSyncIndicator.vue.script.js.map +1 -0
- package/dist/v2/features/app/components/SidebarDocument.vue.d.ts +45 -0
- package/dist/v2/features/app/components/SidebarDocument.vue.d.ts.map +1 -0
- package/dist/v2/features/app/components/SidebarDocument.vue.js +7 -0
- package/dist/v2/features/app/components/SidebarDocument.vue.js.map +1 -0
- package/dist/v2/features/app/components/SidebarDocument.vue.script.js +137 -0
- package/dist/v2/features/app/components/SidebarDocument.vue.script.js.map +1 -0
- package/dist/v2/features/app/helpers/check-version-conflict.d.ts +51 -0
- package/dist/v2/features/app/helpers/check-version-conflict.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/check-version-conflict.js +79 -0
- package/dist/v2/features/app/helpers/check-version-conflict.js.map +1 -0
- package/dist/v2/features/app/helpers/compute-version-status.d.ts +45 -0
- package/dist/v2/features/app/helpers/compute-version-status.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/compute-version-status.js +18 -0
- package/dist/v2/features/app/helpers/compute-version-status.js.map +1 -0
- package/dist/v2/features/app/helpers/create-draft-registry-document.d.ts +39 -0
- package/dist/v2/features/app/helpers/create-draft-registry-document.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/create-draft-registry-document.js +64 -0
- package/dist/v2/features/app/helpers/create-draft-registry-document.js.map +1 -0
- package/dist/v2/features/app/helpers/create-temp-operation.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/create-temp-operation.js +5 -8
- package/dist/v2/features/app/helpers/create-temp-operation.js.map +1 -1
- package/dist/v2/features/app/helpers/detect-document-conflicts.d.ts +26 -0
- package/dist/v2/features/app/helpers/detect-document-conflicts.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/detect-document-conflicts.js +27 -0
- package/dist/v2/features/app/helpers/detect-document-conflicts.js.map +1 -0
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts +14 -14
- package/dist/v2/features/app/helpers/filter-workspaces.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/filter-workspaces.js +15 -15
- package/dist/v2/features/app/helpers/filter-workspaces.js.map +1 -1
- package/dist/v2/features/app/helpers/group-workspaces.d.ts +23 -3
- package/dist/v2/features/app/helpers/group-workspaces.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/group-workspaces.js +22 -7
- package/dist/v2/features/app/helpers/group-workspaces.js.map +1 -1
- package/dist/v2/features/app/helpers/load-registry-document.d.ts +16 -1
- package/dist/v2/features/app/helpers/load-registry-document.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/load-registry-document.js +7 -6
- package/dist/v2/features/app/helpers/load-registry-document.js.map +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts +5 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +1 -1
- package/dist/v2/features/app/helpers/routes.js.map +1 -1
- package/dist/v2/features/app/helpers/version-status-presentation.d.ts +24 -0
- package/dist/v2/features/app/helpers/version-status-presentation.d.ts.map +1 -0
- package/dist/v2/features/app/helpers/version-status-presentation.js +43 -0
- package/dist/v2/features/app/helpers/version-status-presentation.js.map +1 -0
- package/dist/v2/features/app/hooks/use-active-document-version.d.ts +41 -0
- package/dist/v2/features/app/hooks/use-active-document-version.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-active-document-version.js +60 -0
- package/dist/v2/features/app/hooks/use-active-document-version.js.map +1 -0
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts +71 -23
- package/dist/v2/features/app/hooks/use-sidebar-documents.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-sidebar-documents.js +167 -45
- package/dist/v2/features/app/hooks/use-sidebar-documents.js.map +1 -1
- package/dist/v2/features/app/hooks/use-version-conflict-check.d.ts +35 -0
- package/dist/v2/features/app/hooks/use-version-conflict-check.d.ts.map +1 -0
- package/dist/v2/features/app/hooks/use-version-conflict-check.js +62 -0
- package/dist/v2/features/app/hooks/use-version-conflict-check.js.map +1 -0
- package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.js.map +1 -1
- package/dist/v2/features/collection/DocumentCollection.vue.script.js +6 -1
- package/dist/v2/features/collection/DocumentCollection.vue.script.js.map +1 -1
- package/dist/v2/features/collection/OperationCollection.vue.script.js +1 -0
- package/dist/v2/features/collection/OperationCollection.vue.script.js.map +1 -1
- package/dist/v2/features/collection/WorkspaceCollection.vue.script.js +1 -0
- package/dist/v2/features/collection/WorkspaceCollection.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.script.js +1 -0
- 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/GetStarted.vue.d.ts +12 -4
- package/dist/v2/features/collection/components/GetStarted.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/GetStarted.vue.js.map +1 -1
- package/dist/v2/features/collection/components/GetStarted.vue.script.js +56 -13
- package/dist/v2/features/collection/components/GetStarted.vue.script.js.map +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.script.js +1 -0
- package/dist/v2/features/collection/components/Runner/components/Runner.vue.script.js.map +1 -1
- package/dist/v2/features/collection/components/Runner/hooks/use-runner-execution.js +2 -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.script.js +1 -0
- 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/editor/hooks/use-three-way-merge-editor.js +1 -1
- 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 +3 -0
- package/dist/v2/features/operation/Operation.vue.script.js.map +1 -1
- package/dist/v2/helpers/safe-run.d.ts +25 -1
- package/dist/v2/helpers/safe-run.d.ts.map +1 -1
- package/dist/v2/helpers/safe-run.js +26 -2
- package/dist/v2/helpers/safe-run.js.map +1 -1
- package/package.json +17 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getActiveProxyUrl } from '@scalar/workspace-store/request-example'\nimport type { ColorMode } from '@scalar/workspace-store/schemas/workspace'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport { CollectionSettings, DocumentSettings } from '@/v2/features/settings'\n\nconst {\n eventBus,\n documentSlug,\n document,\n workspaceStore,\n collectionType,\n layout,\n telemetry,\n onUpdateTelemetry,\n} = defineProps<CollectionProps>()\n\nconst handleUpdateWatchMode = (watchMode: boolean) => {\n eventBus.emit('document:update:watch-mode', watchMode)\n}\n\nconst handleUpdateThemeSlug = (themeSlug?: string) => {\n eventBus.emit('workspace:update:theme', themeSlug)\n}\nconst handleUpdateActiveProxy = (proxy: string | null) => {\n eventBus.emit('workspace:update:active-proxy', proxy)\n}\n\nconst handleUpdateColorMode = (colorMode: ColorMode) => {\n eventBus.emit('workspace:update:color-mode', colorMode)\n}\n</script>\n<template>\n <DocumentSettings\n v-if=\"collectionType === 'document'\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :isDraftDocument=\"documentSlug === 'drafts'\"\n :title=\"document?.info.title ?? ''\"\n :watchMode=\"document?.['x-scalar-watch-mode']\"\n @delete:document=\"\n eventBus.emit('document:delete:document', { name: documentSlug })\n \"\n @update:watchMode=\"handleUpdateWatchMode\" />\n <CollectionSettings\n v-else\n :activeProxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n )\n \"\n :activeThemeSlug=\"workspaceStore.workspace['x-scalar-theme'] ?? 'none'\"\n :colorMode=\"workspaceStore.workspace['x-scalar-color-mode'] ?? 'system'\"\n :customThemes=\"customThemes\"\n :telemetry=\"telemetry\"\n @update:colorMode=\"handleUpdateColorMode\"\n @update:proxyUrl=\"handleUpdateActiveProxy\"\n @update:telemetry=\"(value) => onUpdateTelemetry?.(value)\"\n @update:themeSlug=\"handleUpdateThemeSlug\" />\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Settings.vue.script.js","names":[],"sources":["../../../../../src/v2/features/collection/components/Settings.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { getActiveProxyUrl } from '@scalar/workspace-store/request-example'\nimport type { ColorMode } from '@scalar/workspace-store/schemas/workspace'\n\nimport type { CollectionProps } from '@/v2/features/app/helpers/routes'\nimport { CollectionSettings, DocumentSettings } from '@/v2/features/settings'\n\nconst {\n eventBus,\n documentSlug,\n document,\n workspaceStore,\n collectionType,\n layout,\n telemetry,\n onUpdateTelemetry,\n} = defineProps<CollectionProps>()\n\nconst handleUpdateWatchMode = (watchMode: boolean) => {\n eventBus.emit('document:update:watch-mode', watchMode)\n}\n\nconst handleUpdateThemeSlug = (themeSlug?: string) => {\n eventBus.emit('workspace:update:theme', themeSlug)\n}\nconst handleUpdateActiveProxy = (proxy: string | null) => {\n eventBus.emit('workspace:update:active-proxy', proxy)\n}\n\nconst handleUpdateColorMode = (colorMode: ColorMode) => {\n eventBus.emit('workspace:update:color-mode', colorMode)\n}\n</script>\n<template>\n <DocumentSettings\n v-if=\"collectionType === 'document'\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :isDraftDocument=\"documentSlug === 'drafts'\"\n :title=\"document?.info.title ?? ''\"\n :watchMode=\"document?.['x-scalar-watch-mode']\"\n @delete:document=\"\n eventBus.emit('document:delete:document', { name: documentSlug })\n \"\n @update:watchMode=\"handleUpdateWatchMode\" />\n <CollectionSettings\n v-else\n :activeProxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n )\n \"\n :activeThemeSlug=\"workspaceStore.workspace['x-scalar-theme'] ?? 'none'\"\n :colorMode=\"workspaceStore.workspace['x-scalar-color-mode'] ?? 'system'\"\n :customThemes=\"customThemes\"\n :telemetry=\"telemetry\"\n @update:colorMode=\"handleUpdateColorMode\"\n @update:proxyUrl=\"handleUpdateActiveProxy\"\n @update:telemetry=\"(value) => onUpdateTelemetry?.(value)\"\n @update:themeSlug=\"handleUpdateThemeSlug\" />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA,MAAM,yBAAyB,cAAuB;AACpD,WAAA,SAAS,KAAK,8BAA8B,UAAS;;EAGvD,MAAM,yBAAyB,cAAuB;AACpD,WAAA,SAAS,KAAK,0BAA0B,UAAS;;EAEnD,MAAM,2BAA2B,UAAyB;AACxD,WAAA,SAAS,KAAK,iCAAiC,MAAK;;EAGtD,MAAM,yBAAyB,cAAyB;AACtD,WAAA,SAAS,KAAK,+BAA+B,UAAS;;;UAK9C,QAAA,mBAAc,cAAA,WAAA,EADtB,YAS8C,MAAA,yBAAA,EAAA;;IAP3C,aAAa,QAAA,WAAQ;IACrB,iBAAiB,QAAA,iBAAY;IAC7B,OAAO,QAAA,UAAU,KAAK,SAAK;IAC3B,WAAW,QAAA,WAAQ;IACnB,qBAAe,OAAA,OAAA,OAAA,MAAA,WAAS,QAAA,SAAS,KAAI,4BAAA,EAAA,MAAqC,QAAA,cAAY,CAAA;IAGtF,sBAAkB;;;;;;uBACrB,YAe8C,MAAA,2BAAA,EAAA;;IAb3C,gBAAuB,MAAA,kBAAiB,CAAU,QAAA,eAAe,UAAS,0BAAmC,QAAA,WAAM,QAAA,QAAA,QAAA;IAMnH,iBAAiB,QAAA,eAAe,UAAS,qBAAA;IACzC,WAAW,QAAA,eAAe,UAAS,0BAAA;IACnC,cAAc,QAAA;IACd,WAAW,QAAA;IACX,sBAAkB;IAClB,qBAAiB;IACjB,sBAAgB,OAAA,OAAA,OAAA,MAAG,UAAU,QAAA,oBAAoB,MAAK;IACtD,sBAAkB"}
|
|
@@ -3,8 +3,8 @@ import { parseJsonPointerPath } from "../helpers/json/json-pointer-path.js";
|
|
|
3
3
|
import { ensureJsonPointerLinkSupport } from "../helpers/json/json-pointer-links.js";
|
|
4
4
|
import { createJsonModel } from "../helpers/json/create-json-model.js";
|
|
5
5
|
import { computed, markRaw, ref, shallowRef, toValue, watch } from "vue";
|
|
6
|
-
import * as monaco from "monaco-editor";
|
|
7
6
|
import { apply } from "@scalar/json-magic/diff";
|
|
7
|
+
import * as monaco from "monaco-editor";
|
|
8
8
|
import { deepClone } from "@scalar/workspace-store/helpers/deep-clone";
|
|
9
9
|
//#region src/v2/features/editor/hooks/use-three-way-merge-editor.ts
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAkMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAIlE;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;IADxD,sEAAsE;sCACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;iGA2PxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Operation.vue.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -22,6 +22,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
22
22
|
environment: {},
|
|
23
23
|
workspaceStore: {},
|
|
24
24
|
activeWorkspace: {},
|
|
25
|
+
isTeamWorkspace: { type: Boolean },
|
|
25
26
|
plugins: {},
|
|
26
27
|
customThemes: {},
|
|
27
28
|
currentTheme: {},
|
|
@@ -88,6 +89,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
88
89
|
document: __props.document,
|
|
89
90
|
documentCookies: documentCookies.value,
|
|
90
91
|
documentSecurity: __props.document?.security ?? [],
|
|
92
|
+
documentSlug: __props.documentSlug,
|
|
91
93
|
documentUrl: __props.document?.["x-scalar-original-source-url"],
|
|
92
94
|
environment: __props.environment,
|
|
93
95
|
environments: environments.value,
|
|
@@ -121,6 +123,7 @@ var Operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defi
|
|
|
121
123
|
"document",
|
|
122
124
|
"documentCookies",
|
|
123
125
|
"documentSecurity",
|
|
126
|
+
"documentSlug",
|
|
124
127
|
"documentUrl",
|
|
125
128
|
"environment",
|
|
126
129
|
"environments",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Operation.vue.script.js","names":[],"sources":["../../../../src/v2/features/operation/Operation.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Operation example page\n *\n * Displays an operation with a specific example selected\n * - View example request data\n * - Modify example request data\n * - Send example request\n */\nexport default {}\n</script>\n\n<script setup lang=\"ts\">\nimport { isElectron } from '@scalar/helpers/general/is-electron'\nimport {\n getActiveProxyUrl,\n getRequestExampleContext,\n} from '@scalar/workspace-store/request-example'\nimport { computed, toValue } from 'vue'\n\nimport { OperationBlock } from '@/v2/blocks/operation-block'\nimport { APP_VERSION } from '@/v2/constants'\nimport type { RouteProps } from '@/v2/features/app/helpers/routes'\nimport { mapHiddenClientsConfig } from '@/v2/features/modal/helpers/map-hidden-clients-config'\n\nconst {\n document,\n layout,\n eventBus,\n path,\n method,\n environment,\n exampleName,\n options,\n workspaceStore,\n plugins,\n documentSlug,\n} = defineProps<\n RouteProps & {\n /** Selected anyOf/oneOf request-body variants keyed by schema path */\n requestBodyCompositionSelection?: Record<string, number>\n }\n>()\n\n/**\n * Shared request-example context (operation, servers, auth scope, cookies). Recomputed when any\n * underlying workspace or route input changes — same reactivity as the previous local computeds.\n */\nconst requestExample = computed(() => {\n if (!path || !method || !exampleName || !document) {\n return null\n }\n\n const result = getRequestExampleContext(\n workspaceStore,\n documentSlug,\n { path, method, exampleName },\n {\n baseServerUrl: toValue(options)?.baseServerURL,\n fallbackDocument: document,\n isElectron: isElectron(),\n layout: layout === 'web' ? 'web' : 'other',\n servers: toValue(options)?.servers,\n appVersion: APP_VERSION,\n authentication: toValue(options)?.authentication,\n },\n )\n\n return result.ok ? result.data : null\n})\n\nconst operation = computed(() => requestExample.value?.operation ?? null)\nconst workspaceCookies = computed(\n () => requestExample.value?.cookies.workspace ?? [],\n)\nconst documentCookies = computed(\n () => requestExample.value?.cookies.document ?? [],\n)\nconst servers = computed(() => requestExample.value?.servers.list ?? [])\nconst selectedServer = computed(\n () => requestExample.value?.servers.selected ?? null,\n)\nconst serverMeta = computed(\n () => requestExample.value?.servers.meta ?? { type: 'document' as const },\n)\n\nconst securitySchemes = computed(\n () => requestExample.value?.security.schemes ?? {},\n)\n\nconst selectedSecurity = computed(\n () =>\n requestExample.value?.security.selected ?? {\n selectedIndex: -1,\n selectedSchemes: [],\n },\n)\nconst selectedSecuritySchemes = computed(\n () => requestExample.value?.security.selectedSchemes ?? [],\n)\nconst securityRequirements = computed(\n () => requestExample.value?.security.requirements ?? [],\n)\nconst authMeta = computed(\n () => requestExample.value?.security.meta ?? { type: 'document' as const },\n)\n\nconst defaultHeaders = computed(\n () => requestExample.value?.headers.default ?? {},\n)\n\n/** Combine environments from document and workspace into a unique array of environment names */\nconst environments = computed(() => {\n return Array.from(\n new Set(\n Object.keys({\n ...document?.['x-scalar-environments'],\n ...workspaceStore.workspace['x-scalar-environments'],\n }),\n ),\n )\n})\n\n/** Temporarily use the old config.hiddenClients until we migrate to the new httpClients config */\nconst httpClients = computed(() =>\n mapHiddenClientsConfig(toValue(options)?.hiddenClients),\n)\n</script>\n\n<template>\n <!-- Operation exists -->\n <template v-if=\"path && method && exampleName && operation && document\">\n <OperationBlock\n :activeEnvironment=\"\n workspaceStore.workspace['x-scalar-active-environment']\n \"\n :appVersion=\"APP_VERSION\"\n :authMeta\n :defaultHeaders\n :document\n :documentCookies\n :documentSecurity=\"document?.security ?? []\"\n :documentSlug\n :documentUrl=\"document?.['x-scalar-original-source-url']\"\n :environment\n :environments\n :eventBus\n :exampleKey=\"exampleName\"\n :hideClientButton=\"toValue(options)?.hideClientButton ?? false\"\n :history=\"workspaceStore.history.getHistory(documentSlug, path, method)\"\n :httpClients\n :layout\n :method\n :operation\n :options\n :path\n :plugins=\"plugins\"\n :proxyUrl=\"\n getActiveProxyUrl(\n workspaceStore.workspace['x-scalar-active-proxy'],\n layout === 'web' ? 'web' : 'other',\n ) ?? ''\n \"\n :requestBodyCompositionSelection\n :securityRequirements=\"securityRequirements\"\n :securitySchemes\n :selectedClient=\"workspaceStore.workspace['x-scalar-default-client']\"\n :selectedSecurity=\"selectedSecurity\"\n :selectedSecuritySchemes=\"selectedSecuritySchemes\"\n :server=\"selectedServer\"\n :serverMeta\n :servers\n :workspaceCookies />\n </template>\n\n <!-- Empty state -->\n <div\n v-else\n class=\"flex h-full w-full items-center justify-center\">\n <span class=\"text-c-3\">Select an operation to view details</span>\n </div>\n</template>\n"],"mappings":"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"}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Run a function and capture any thrown error as a tagged result so callers
|
|
3
|
+
* never have to write `try/catch` themselves.
|
|
4
|
+
*
|
|
5
|
+
* Resolves to `{ ok: true, data }` when `fn` returns (or its promise
|
|
6
|
+
* resolves) and to `{ ok: false, error }` when it throws synchronously or
|
|
7
|
+
* the returned promise rejects. The error is also logged via `console.error`
|
|
8
|
+
* so unexpected failures still surface in the devtools console while the
|
|
9
|
+
* caller decides how to present them to the user.
|
|
10
|
+
*
|
|
11
|
+
* Useful for guarding `await`s where a rejection would otherwise leave UI
|
|
12
|
+
* state inconsistent (e.g. a loading flag that is reset only on the success
|
|
13
|
+
* path). Because `safeRun` itself never rejects, the post-await cleanup can
|
|
14
|
+
* run on the next line without a `try/finally` block.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const outcome = await safeRun(() => fetcher())
|
|
18
|
+
* isLoading.value = false
|
|
19
|
+
* if (!outcome.ok) {
|
|
20
|
+
* toast(outcome.error, 'error')
|
|
21
|
+
* return
|
|
22
|
+
* }
|
|
23
|
+
* useData(outcome.data)
|
|
24
|
+
*/
|
|
25
|
+
export declare const safeRun: <T>(fn: () => Promise<T> | T) => Promise<{
|
|
2
26
|
readonly ok: true;
|
|
3
27
|
readonly data: Awaited<T>;
|
|
4
28
|
readonly error?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-run.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/safe-run.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"safe-run.d.ts","sourceRoot":"","sources":["../../../src/v2/helpers/safe-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,OAAO,GAAU,CAAC,EAAE,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;;;;;;;;EAaxD,CAAA"}
|
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
//#region src/v2/helpers/safe-run.ts
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Run a function and capture any thrown error as a tagged result so callers
|
|
4
|
+
* never have to write `try/catch` themselves.
|
|
5
|
+
*
|
|
6
|
+
* Resolves to `{ ok: true, data }` when `fn` returns (or its promise
|
|
7
|
+
* resolves) and to `{ ok: false, error }` when it throws synchronously or
|
|
8
|
+
* the returned promise rejects. The error is also logged via `console.error`
|
|
9
|
+
* so unexpected failures still surface in the devtools console while the
|
|
10
|
+
* caller decides how to present them to the user.
|
|
11
|
+
*
|
|
12
|
+
* Useful for guarding `await`s where a rejection would otherwise leave UI
|
|
13
|
+
* state inconsistent (e.g. a loading flag that is reset only on the success
|
|
14
|
+
* path). Because `safeRun` itself never rejects, the post-await cleanup can
|
|
15
|
+
* run on the next line without a `try/finally` block.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* const outcome = await safeRun(() => fetcher())
|
|
19
|
+
* isLoading.value = false
|
|
20
|
+
* if (!outcome.ok) {
|
|
21
|
+
* toast(outcome.error, 'error')
|
|
22
|
+
* return
|
|
23
|
+
* }
|
|
24
|
+
* useData(outcome.data)
|
|
25
|
+
*/
|
|
26
|
+
var safeRun = async (fn) => {
|
|
3
27
|
try {
|
|
4
28
|
return {
|
|
5
29
|
ok: true,
|
|
@@ -14,6 +38,6 @@ var tryCatch = async (fn) => {
|
|
|
14
38
|
}
|
|
15
39
|
};
|
|
16
40
|
//#endregion
|
|
17
|
-
export {
|
|
41
|
+
export { safeRun };
|
|
18
42
|
|
|
19
43
|
//# sourceMappingURL=safe-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-run.js","names":[],"sources":["../../../src/v2/helpers/safe-run.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"safe-run.js","names":[],"sources":["../../../src/v2/helpers/safe-run.ts"],"sourcesContent":["/**\n * Run a function and capture any thrown error as a tagged result so callers\n * never have to write `try/catch` themselves.\n *\n * Resolves to `{ ok: true, data }` when `fn` returns (or its promise\n * resolves) and to `{ ok: false, error }` when it throws synchronously or\n * the returned promise rejects. The error is also logged via `console.error`\n * so unexpected failures still surface in the devtools console while the\n * caller decides how to present them to the user.\n *\n * Useful for guarding `await`s where a rejection would otherwise leave UI\n * state inconsistent (e.g. a loading flag that is reset only on the success\n * path). Because `safeRun` itself never rejects, the post-await cleanup can\n * run on the next line without a `try/finally` block.\n *\n * @example\n * const outcome = await safeRun(() => fetcher())\n * isLoading.value = false\n * if (!outcome.ok) {\n * toast(outcome.error, 'error')\n * return\n * }\n * useData(outcome.data)\n */\nexport const safeRun = async <T>(fn: () => Promise<T> | T) => {\n try {\n return {\n ok: true,\n data: await fn(),\n } as const\n } catch (error) {\n console.error(error)\n return {\n ok: false,\n error: error instanceof Error ? error.message : String(error),\n } as const\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,IAAa,UAAU,OAAU,OAA6B;AAC5D,KAAI;AACF,SAAO;GACL,IAAI;GACJ,MAAM,MAAM,IAAI;GACjB;UACM,OAAO;AACd,UAAQ,MAAM,MAAM;AACpB,SAAO;GACL,IAAI;GACJ,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAC9D"}
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "3.
|
|
21
|
+
"version": "3.4.0",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=22"
|
|
24
24
|
},
|
|
@@ -330,24 +330,24 @@
|
|
|
330
330
|
"vite-plugin-monaco-editor": "^1.1.0",
|
|
331
331
|
"vue": "^3.5.30",
|
|
332
332
|
"vue-router": "5.0.4",
|
|
333
|
-
"yaml": "^2.8.
|
|
333
|
+
"yaml": "^2.8.3",
|
|
334
334
|
"zod": "^4.3.5",
|
|
335
|
-
"@scalar/components": "0.
|
|
336
|
-
"@scalar/helpers": "0.5.
|
|
337
|
-
"@scalar/oas-utils": "0.
|
|
338
|
-
"@scalar/
|
|
339
|
-
"@scalar/json-magic": "0.12.
|
|
335
|
+
"@scalar/components": "0.23.0",
|
|
336
|
+
"@scalar/helpers": "0.5.3",
|
|
337
|
+
"@scalar/oas-utils": "0.14.0",
|
|
338
|
+
"@scalar/postman-to-openapi": "0.7.2",
|
|
339
|
+
"@scalar/json-magic": "0.12.9",
|
|
340
340
|
"@scalar/openapi-types": "0.8.0",
|
|
341
|
-
"@scalar/
|
|
342
|
-
"@scalar/
|
|
343
|
-
"@scalar/
|
|
344
|
-
"@scalar/types": "0.9.2",
|
|
345
|
-
"@scalar/use-codemirror": "0.14.11",
|
|
341
|
+
"@scalar/snippetz": "0.9.3",
|
|
342
|
+
"@scalar/icons": "0.7.2",
|
|
343
|
+
"@scalar/sidebar": "0.9.7",
|
|
346
344
|
"@scalar/themes": "0.15.3",
|
|
347
|
-
"@scalar/
|
|
345
|
+
"@scalar/types": "0.9.3",
|
|
346
|
+
"@scalar/use-codemirror": "0.14.11",
|
|
348
347
|
"@scalar/use-hooks": "0.4.3",
|
|
349
|
-
"@scalar/
|
|
350
|
-
"@scalar/validation": "0.3.
|
|
348
|
+
"@scalar/use-toasts": "0.10.2",
|
|
349
|
+
"@scalar/validation": "0.3.1",
|
|
350
|
+
"@scalar/workspace-store": "0.48.0"
|
|
351
351
|
},
|
|
352
352
|
"devDependencies": {
|
|
353
353
|
"@tailwindcss/vite": "^4.2.0",
|
|
@@ -362,12 +362,13 @@
|
|
|
362
362
|
"vite": "8.0.0",
|
|
363
363
|
"vite-svg-loader": "5.1.1",
|
|
364
364
|
"vitest": "4.1.0",
|
|
365
|
-
"@scalar/pre-post-request-scripts": "0.4.
|
|
365
|
+
"@scalar/pre-post-request-scripts": "0.4.8"
|
|
366
366
|
},
|
|
367
367
|
"scripts": {
|
|
368
368
|
"build": "vite build && vue-tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
369
369
|
"dev": "pnpm playground:web",
|
|
370
370
|
"playground:app": "vite ./playground/app -c ./vite.config.ts",
|
|
371
|
+
"playground:app:build": "vite build ./playground/app -c ./vite.previews.config.ts",
|
|
371
372
|
"playground:modal": "vite ./playground/modal -c ./vite.config.ts",
|
|
372
373
|
"playground:web": "vite ./playground/web -c ./vite.config.ts",
|
|
373
374
|
"preview": "vite preview",
|