@scalar/api-client 3.23.0 → 3.23.2
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 +15 -0
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.js.map +1 -1
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js +2 -2
- package/dist/components/ScalarAsciiArt/ScalarAsciiArt.vue.script.js.map +1 -1
- package/dist/style.css +162 -122
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
- 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.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestParams.vue.script.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTable.vue.script.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.js.map +1 -1
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.vue.script.js +4 -4
- package/dist/v2/blocks/response-block/components/ResponseBodyRaw.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 +2 -4
- 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/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js.map +1 -1
- 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 +2 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.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 +4 -4
- package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.d.ts.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.js.map +1 -1
- package/dist/v2/components/code-input/CodeInputLite.vue.script.js.map +1 -1
- package/dist/v2/constants.js +1 -1
- 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 +1 -0
- package/dist/v2/features/modal/Modal.vue.script.js.map +1 -1
- package/dist/v2/features/modal/modal-events.d.ts +3 -1
- package/dist/v2/features/modal/modal-events.d.ts.map +1 -1
- package/dist/v2/features/modal/modal-events.js +2 -1
- package/dist/v2/features/modal/modal-events.js.map +1 -1
- package/dist/v2/workspace-events.d.ts +4 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +2 -2
- package/dist/v2/workspace-events.js.map +1 -1
- package/dist/vue-styles.css +45 -45
- package/package.json +13 -13
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +0 -10
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts +0 -3
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js +0 -8
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.js.map +0 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { ModalState } from '@scalar/components/modal';
|
|
2
|
+
import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
|
|
2
3
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
4
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
5
|
import { type Ref } from 'vue';
|
|
5
6
|
import type { UseModalSidebarReturn } from '../../../v2/features/modal/hooks/use-modal-sidebar.js';
|
|
6
|
-
export declare function initializeModalEvents({ eventBus, isSidebarOpen, requestBodyCompositionSelection, sidebarState, modalState, store, }: {
|
|
7
|
+
export declare function initializeModalEvents({ eventBus, isSidebarOpen, requestBodyCompositionSelection, sidebarState, modalState, store, getConfiguredSecuritySchemes, }: {
|
|
7
8
|
eventBus: WorkspaceEventBus;
|
|
8
9
|
isSidebarOpen: Ref<boolean>;
|
|
9
10
|
requestBodyCompositionSelection: Ref<Record<string, number>>;
|
|
10
11
|
sidebarState: UseModalSidebarReturn;
|
|
11
12
|
modalState: ModalState;
|
|
12
13
|
store: WorkspaceStore;
|
|
14
|
+
getConfiguredSecuritySchemes?: () => AuthenticationConfiguration['securitySchemes'];
|
|
13
15
|
}): void;
|
|
14
16
|
//# sourceMappingURL=modal-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/modal-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAOxF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,aAAa,EACb,+BAA+B,EAC/B,YAAY,EACZ,UAAU,EACV,KAAK,
|
|
1
|
+
{"version":3,"file":"modal-events.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/modal-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAGvE,OAAO,EAAE,KAAK,GAAG,EAAO,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAOxF,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,aAAa,EACb,+BAA+B,EAC/B,YAAY,EACZ,UAAU,EACV,KAAK,EACL,4BAA4B,GAC7B,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,+BAA+B,EAAE,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5D,YAAY,EAAE,qBAAqB,CAAA;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,cAAc,CAAA;IACrB,4BAA4B,CAAC,EAAE,MAAM,2BAA2B,CAAC,iBAAiB,CAAC,CAAA;CACpF,QAkGA"}
|
|
@@ -3,9 +3,10 @@ import { ref } from "vue";
|
|
|
3
3
|
import { isOpenApiDocument } from "@scalar/workspace-store/schemas/type-guards";
|
|
4
4
|
//#region src/v2/features/modal/modal-events.ts
|
|
5
5
|
var EMPTY_REQUEST_BODY_COMPOSITION_SELECTION = Object.freeze({});
|
|
6
|
-
function initializeModalEvents({ eventBus, isSidebarOpen, requestBodyCompositionSelection, sidebarState, modalState, store }) {
|
|
6
|
+
function initializeModalEvents({ eventBus, isSidebarOpen, requestBodyCompositionSelection, sidebarState, modalState, store, getConfiguredSecuritySchemes }) {
|
|
7
7
|
/** Initialize workspace event handlers */
|
|
8
8
|
initializeWorkspaceEventHandlers({
|
|
9
|
+
getConfiguredSecuritySchemes,
|
|
9
10
|
eventBus,
|
|
10
11
|
store: ref(store),
|
|
11
12
|
hooks: { "operation:create:draft-example": { onAfterExecute: ({ documentName, meta: { path, method }, exampleName }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-events.js","names":[],"sources":["../../../../src/v2/features/modal/modal-events.ts"],"sourcesContent":["import type { ModalState } from '@scalar/components/modal'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type Ref, ref } from 'vue'\n\nimport type { UseModalSidebarReturn } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport { initializeWorkspaceEventHandlers } from '@/v2/workspace-events'\n\n// Frozen so this shared fallback cannot be mutated in place, which would leak a stale selection into\n// every future open that falls back to empty. Callers only ever reassign the ref, never mutate it.\nconst EMPTY_REQUEST_BODY_COMPOSITION_SELECTION: Record<string, number> = Object.freeze({})\n\nexport function initializeModalEvents({\n eventBus,\n isSidebarOpen,\n requestBodyCompositionSelection,\n sidebarState,\n modalState,\n store,\n}: {\n eventBus: WorkspaceEventBus\n isSidebarOpen: Ref<boolean>\n requestBodyCompositionSelection: Ref<Record<string, number>>\n sidebarState: UseModalSidebarReturn\n modalState: ModalState\n store: WorkspaceStore\n}) {\n /** Initialize workspace event handlers */\n initializeWorkspaceEventHandlers({\n eventBus,\n store: ref(store),\n hooks: {\n 'operation:create:draft-example': {\n onAfterExecute: ({ documentName, meta: { path, method }, exampleName }): void => {\n // The new example must be in the sidebar before its location can be selected.\n store.buildSidebar(documentName)\n const entry = sidebarState.getEntryByLocation({\n document: documentName,\n path,\n method,\n example: exampleName,\n })\n if (entry) {\n sidebarState.handleSelectItem(entry.id)\n }\n },\n },\n },\n })\n\n //------------------------------------------------------------------------------------\n // Navigation Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('scroll-to:nav-item', ({ id }) => sidebarState.handleSelectItem(id))\n\n //------------------------------------------------------------------------------------\n // UI Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('ui:toggle:sidebar', () => (isSidebarOpen.value = !isSidebarOpen.value))\n eventBus.on('ui:close:client-modal', () => modalState.hide())\n eventBus.on('ui:open:client-modal', (payload) => {\n // Every open re-establishes the selection (falling back to empty), so the modal no longer needs\n // to reset it on close.\n const nextRequestBodyCompositionSelection: Record<string, number> =\n payload && 'requestBodyCompositionSelection' in payload && payload.requestBodyCompositionSelection\n ? payload.requestBodyCompositionSelection\n : EMPTY_REQUEST_BODY_COMPOSITION_SELECTION\n\n // Just open the modal\n if (!payload) {\n requestBodyCompositionSelection.value = nextRequestBodyCompositionSelection\n modalState.show()\n return\n }\n\n const previousSelectedId = sidebarState.state.selectedItem.value\n\n // We route to the exact ID\n if ('id' in payload && payload.id) {\n let targetId = payload.id\n\n // If exampleName is provided, try to find the specific example entry\n if ('exampleName' in payload && payload.exampleName) {\n const operationEntry = sidebarState.state.getEntryById(payload.id)\n\n // Try to find the specific example in the operation's children\n if (operationEntry && 'children' in operationEntry && operationEntry.children) {\n const exampleEntry = operationEntry.children.find(\n (child: TraversedEntry) => child.type === 'example' && child.name === payload.exampleName,\n )\n if (exampleEntry) {\n targetId = exampleEntry.id\n }\n }\n }\n\n sidebarState.handleSelectItem(targetId)\n }\n // We must find the ID first from the entries\n else if ('method' in payload && 'path' in payload) {\n const activeDoc = store.workspace.activeDocument\n sidebarState.handleSelectItem(\n sidebarState.getEntryByLocation({\n document: isOpenApiDocument(activeDoc) ? (activeDoc['x-scalar-navigation']?.id ?? '') : '',\n path: payload.path,\n method: payload.method,\n example: payload.exampleName,\n })?.id ?? '',\n )\n }\n\n // Apply the selection after routing so the request body compares it with the selection used\n // for this operation, rather than briefly resetting the operation that was previously open.\n // Reopening the entry already on screen routes nowhere, so a new selection would read as a\n // manual branch switch and discard the edited body.\n const isReopeningVisibleEntry = modalState.open && sidebarState.state.selectedItem.value === previousSelectedId\n\n if (!isReopeningVisibleEntry) {\n requestBodyCompositionSelection.value = nextRequestBodyCompositionSelection\n }\n\n modalState.show()\n })\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"modal-events.js","names":[],"sources":["../../../../src/v2/features/modal/modal-events.ts"],"sourcesContent":["import type { ModalState } from '@scalar/components/modal'\nimport type { AuthenticationConfiguration } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation'\nimport { isOpenApiDocument } from '@scalar/workspace-store/schemas/type-guards'\nimport { type Ref, ref } from 'vue'\n\nimport type { UseModalSidebarReturn } from '@/v2/features/modal/hooks/use-modal-sidebar'\nimport { initializeWorkspaceEventHandlers } from '@/v2/workspace-events'\n\n// Frozen so this shared fallback cannot be mutated in place, which would leak a stale selection into\n// every future open that falls back to empty. Callers only ever reassign the ref, never mutate it.\nconst EMPTY_REQUEST_BODY_COMPOSITION_SELECTION: Record<string, number> = Object.freeze({})\n\nexport function initializeModalEvents({\n eventBus,\n isSidebarOpen,\n requestBodyCompositionSelection,\n sidebarState,\n modalState,\n store,\n getConfiguredSecuritySchemes,\n}: {\n eventBus: WorkspaceEventBus\n isSidebarOpen: Ref<boolean>\n requestBodyCompositionSelection: Ref<Record<string, number>>\n sidebarState: UseModalSidebarReturn\n modalState: ModalState\n store: WorkspaceStore\n getConfiguredSecuritySchemes?: () => AuthenticationConfiguration['securitySchemes']\n}) {\n /** Initialize workspace event handlers */\n initializeWorkspaceEventHandlers({\n getConfiguredSecuritySchemes,\n eventBus,\n store: ref(store),\n hooks: {\n 'operation:create:draft-example': {\n onAfterExecute: ({ documentName, meta: { path, method }, exampleName }): void => {\n // The new example must be in the sidebar before its location can be selected.\n store.buildSidebar(documentName)\n const entry = sidebarState.getEntryByLocation({\n document: documentName,\n path,\n method,\n example: exampleName,\n })\n if (entry) {\n sidebarState.handleSelectItem(entry.id)\n }\n },\n },\n },\n })\n\n //------------------------------------------------------------------------------------\n // Navigation Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('scroll-to:nav-item', ({ id }) => sidebarState.handleSelectItem(id))\n\n //------------------------------------------------------------------------------------\n // UI Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('ui:toggle:sidebar', () => (isSidebarOpen.value = !isSidebarOpen.value))\n eventBus.on('ui:close:client-modal', () => modalState.hide())\n eventBus.on('ui:open:client-modal', (payload) => {\n // Every open re-establishes the selection (falling back to empty), so the modal no longer needs\n // to reset it on close.\n const nextRequestBodyCompositionSelection: Record<string, number> =\n payload && 'requestBodyCompositionSelection' in payload && payload.requestBodyCompositionSelection\n ? payload.requestBodyCompositionSelection\n : EMPTY_REQUEST_BODY_COMPOSITION_SELECTION\n\n // Just open the modal\n if (!payload) {\n requestBodyCompositionSelection.value = nextRequestBodyCompositionSelection\n modalState.show()\n return\n }\n\n const previousSelectedId = sidebarState.state.selectedItem.value\n\n // We route to the exact ID\n if ('id' in payload && payload.id) {\n let targetId = payload.id\n\n // If exampleName is provided, try to find the specific example entry\n if ('exampleName' in payload && payload.exampleName) {\n const operationEntry = sidebarState.state.getEntryById(payload.id)\n\n // Try to find the specific example in the operation's children\n if (operationEntry && 'children' in operationEntry && operationEntry.children) {\n const exampleEntry = operationEntry.children.find(\n (child: TraversedEntry) => child.type === 'example' && child.name === payload.exampleName,\n )\n if (exampleEntry) {\n targetId = exampleEntry.id\n }\n }\n }\n\n sidebarState.handleSelectItem(targetId)\n }\n // We must find the ID first from the entries\n else if ('method' in payload && 'path' in payload) {\n const activeDoc = store.workspace.activeDocument\n sidebarState.handleSelectItem(\n sidebarState.getEntryByLocation({\n document: isOpenApiDocument(activeDoc) ? (activeDoc['x-scalar-navigation']?.id ?? '') : '',\n path: payload.path,\n method: payload.method,\n example: payload.exampleName,\n })?.id ?? '',\n )\n }\n\n // Apply the selection after routing so the request body compares it with the selection used\n // for this operation, rather than briefly resetting the operation that was previously open.\n // Reopening the entry already on screen routes nowhere, so a new selection would read as a\n // manual branch switch and discard the edited body.\n const isReopeningVisibleEntry = modalState.open && sidebarState.state.selectedItem.value === previousSelectedId\n\n if (!isReopeningVisibleEntry) {\n requestBodyCompositionSelection.value = nextRequestBodyCompositionSelection\n }\n\n modalState.show()\n })\n}\n"],"mappings":";;;;AAaA,IAAM,2CAAmE,OAAO,OAAO,CAAC,CAAC;AAEzF,SAAgB,sBAAsB,EACpC,UACA,eACA,iCACA,cACA,YACA,OACA,gCASC;;CAED,iCAAiC;EAC/B;EACA;EACA,OAAO,IAAI,KAAK;EAChB,OAAO,EACL,kCAAkC,EAChC,iBAAiB,EAAE,cAAc,MAAM,EAAE,MAAM,UAAU,kBAAwB;GAE/E,MAAM,aAAa,YAAY;GAC/B,MAAM,QAAQ,aAAa,mBAAmB;IAC5C,UAAU;IACV;IACA;IACA,SAAS;GACX,CAAC;GACD,IAAI,OACF,aAAa,iBAAiB,MAAM,EAAE;EAE1C,EACF,EACF;CACF,CAAC;CAKD,SAAS,GAAG,uBAAuB,EAAE,SAAS,aAAa,iBAAiB,EAAE,CAAC;CAK/E,SAAS,GAAG,2BAA4B,cAAc,QAAQ,CAAC,cAAc,KAAM;CACnF,SAAS,GAAG,+BAA+B,WAAW,KAAK,CAAC;CAC5D,SAAS,GAAG,yBAAyB,YAAY;EAG/C,MAAM,sCACJ,WAAW,qCAAqC,WAAW,QAAQ,kCAC/D,QAAQ,kCACR;EAGN,IAAI,CAAC,SAAS;GACZ,gCAAgC,QAAQ;GACxC,WAAW,KAAK;GAChB;EACF;EAEA,MAAM,qBAAqB,aAAa,MAAM,aAAa;EAG3D,IAAI,QAAQ,WAAW,QAAQ,IAAI;GACjC,IAAI,WAAW,QAAQ;GAGvB,IAAI,iBAAiB,WAAW,QAAQ,aAAa;IACnD,MAAM,iBAAiB,aAAa,MAAM,aAAa,QAAQ,EAAE;IAGjE,IAAI,kBAAkB,cAAc,kBAAkB,eAAe,UAAU;KAC7E,MAAM,eAAe,eAAe,SAAS,MAC1C,UAA0B,MAAM,SAAS,aAAa,MAAM,SAAS,QAAQ,WAChF;KACA,IAAI,cACF,WAAW,aAAa;IAE5B;GACF;GAEA,aAAa,iBAAiB,QAAQ;EACxC,OAEK,IAAI,YAAY,WAAW,UAAU,SAAS;GACjD,MAAM,YAAY,MAAM,UAAU;GAClC,aAAa,iBACX,aAAa,mBAAmB;IAC9B,UAAU,kBAAkB,SAAS,IAAK,UAAU,sBAAsB,EAAE,MAAM,KAAM;IACxF,MAAM,QAAQ;IACd,QAAQ,QAAQ;IAChB,SAAS,QAAQ;GACnB,CAAC,CAAC,EAAE,MAAM,EACZ;EACF;EAQA,IAAI,EAF4B,WAAW,QAAQ,aAAa,MAAM,aAAa,UAAU,qBAG3F,gCAAgC,QAAQ;EAG1C,WAAW,KAAK;CAClB,CAAC;AACH"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
|
|
1
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
2
3
|
import type { ApiReferenceEvents, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
4
|
import { type Ref } from 'vue';
|
|
@@ -16,10 +17,12 @@ type Hooks = {
|
|
|
16
17
|
* @param store The WorkspaceStore instance
|
|
17
18
|
* @param hooks Object containing optional before/after hooks for each event
|
|
18
19
|
*/
|
|
19
|
-
export declare function initializeWorkspaceEventHandlers({ eventBus: bus, store, hooks, }: {
|
|
20
|
+
export declare function initializeWorkspaceEventHandlers({ eventBus: bus, store, hooks, getConfiguredSecuritySchemes, }: {
|
|
20
21
|
eventBus: WorkspaceEventBus;
|
|
21
22
|
store: Ref<WorkspaceStore | null>;
|
|
22
23
|
hooks: Hooks;
|
|
24
|
+
/** Read current defaults when a name is edited, including after a configuration change. */
|
|
25
|
+
getConfiguredSecuritySchemes?: () => AuthenticationConfiguration['securitySchemes'];
|
|
23
26
|
}): () => void;
|
|
24
27
|
export {};
|
|
25
28
|
//# sourceMappingURL=workspace-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EAAE,GAAG,EACb,KAAK,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzE,CAAC,CAAA;AAEF,KAAK,KAAK,GAAG;KACV,GAAG,IAAI,MAAM,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC;CAC9C,CAAA;AA6BD;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EAAE,GAAG,EACb,KAAK,EACL,KAAK,EACL,4BAA4B,GAC7B,EAAE;IACD,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,KAAK,EAAE,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IACjC,KAAK,EAAE,KAAK,CAAA;IACZ,2FAA2F;IAC3F,4BAA4B,CAAC,EAAE,MAAM,2BAA2B,CAAC,iBAAiB,CAAC,CAAA;CACpF,GAAG,MAAM,IAAI,CA0Vb"}
|
|
@@ -28,7 +28,7 @@ var withHook = (event, fn, hooks) => {
|
|
|
28
28
|
* @param store The WorkspaceStore instance
|
|
29
29
|
* @param hooks Object containing optional before/after hooks for each event
|
|
30
30
|
*/
|
|
31
|
-
function initializeWorkspaceEventHandlers({ eventBus: bus, store, hooks }) {
|
|
31
|
+
function initializeWorkspaceEventHandlers({ eventBus: bus, store, hooks, getConfiguredSecuritySchemes }) {
|
|
32
32
|
const subscriptions = [];
|
|
33
33
|
const eventBus = { on: (event, listener) => {
|
|
34
34
|
const unsubscribe = bus.on(event, listener);
|
|
@@ -69,7 +69,7 @@ function initializeWorkspaceEventHandlers({ eventBus: bus, store, hooks }) {
|
|
|
69
69
|
});
|
|
70
70
|
eventBus.on("auth:delete:security-scheme", (payload) => withHook("auth:delete:security-scheme", mutators.value.active().auth.deleteSecurityScheme, hooks)(payload));
|
|
71
71
|
eventBus.on("auth:update:active-index", (payload) => withHook("auth:update:active-index", mutators.value.active().auth.updateSelectedAuthTab, hooks)(payload));
|
|
72
|
-
eventBus.on("auth:update:security-scheme", (payload) => withHook("auth:update:security-scheme", mutators.value.active().auth.updateSecurityScheme, hooks)(payload));
|
|
72
|
+
eventBus.on("auth:update:security-scheme", (payload) => withHook("auth:update:security-scheme", (data) => mutators.value.active().auth.updateSecurityScheme(data, getConfiguredSecuritySchemes?.()), hooks)(payload));
|
|
73
73
|
eventBus.on("auth:update:selected-scopes", (payload) => withHook("auth:update:selected-scopes", mutators.value.active().auth.updateSelectedScopes, hooks)(payload));
|
|
74
74
|
eventBus.on("auth:upsert:scopes", (payload) => withHook("auth:upsert:scopes", mutators.value.active().auth.upsertScope, hooks)(payload));
|
|
75
75
|
eventBus.on("auth:delete:scopes", (payload) => withHook("auth:delete:scopes", mutators.value.active().auth.deleteScope, hooks)(payload));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-events.js","names":[],"sources":["../../src/v2/workspace-events.ts"],"sourcesContent":["import type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { ApiReferenceEvents, CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport { type Ref, computed } from 'vue'\n\ntype Hook<T extends keyof ApiReferenceEvents> = Partial<{\n onBeforeExecute: (\n payload: ApiReferenceEvents[T],\n ) => void | Promise<void> | ApiReferenceEvents[T] | Promise<ApiReferenceEvents[T]>\n onAfterExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void>\n}>\n\ntype Hooks = {\n [key in keyof ApiReferenceEvents]?: Hook<key>\n}\n\n/**\n * Wraps a given function with optional before/after execution hooks for a specific event.\n * - Calls onBeforeExecute hook before executing the main function.\n * - Calls onAfterExecute hook after executing the main function.\n *\n * @template T The event key from ApiReferenceEvents\n * @param event The event name\n * @param fn The main function to execute\n * @param hooks The hooks object containing before/after hooks for events\n * @returns An async function that runs hooks around the main function\n */\nconst withHook = <T extends keyof ApiReferenceEvents>(\n event: T,\n fn: (args: ApiReferenceEvents[T]) => unknown | Promise<unknown>,\n hooks: Hooks,\n) => {\n return async (args: ApiReferenceEvents[T]) => {\n // Call the before execution hook for this event, if any\n const result = (await hooks[event]?.onBeforeExecute?.(args)) ?? args\n // Execute the main function\n await fn(result)\n // Call the after execution hook for this event, if any\n await hooks[event]?.onAfterExecute?.(result)\n return result\n }\n}\n\n/**\n * Initializes all Workspace Event Handlers by subscribing eventBus listeners\n * to each relevant mutator operation. Hooks are used for before/after execution.\n *\n * @param eventBus The WorkspaceEventBus to subscribe to\n * @param store The WorkspaceStore instance\n * @param hooks Object containing optional before/after hooks for each event\n */\nexport function initializeWorkspaceEventHandlers({\n eventBus: bus,\n store,\n hooks,\n}: {\n eventBus: WorkspaceEventBus\n store: Ref<WorkspaceStore | null>\n hooks: Hooks\n}): () => void {\n const subscriptions: (() => void)[] = []\n const eventBus: Pick<WorkspaceEventBus, 'on'> = {\n on: (event, listener) => {\n const unsubscribe = bus.on(event, listener)\n subscriptions.push(unsubscribe)\n return unsubscribe\n },\n }\n // Generate all client mutators for the current workspace store\n const mutators = computed(() => generateClientMutators(store.value))\n\n /**\n * Returns the appropriate mutators depending on the collectionType.\n * If collectionType is 'document', gets the active document mutator,\n * otherwise, gets the workspace mutator.\n */\n const getMutators = ({ collectionType }: CollectionType) => {\n if (collectionType === 'document') {\n return mutators.value.active()\n }\n return mutators.value.workspace()\n }\n\n //------------------------------------------------------------------------------------\n // Workspace Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('workspace:update:active-proxy', (payload) =>\n withHook('workspace:update:active-proxy', mutators.value.workspace().workspace.updateActiveProxy, hooks)(payload),\n )\n eventBus.on('workspace:update:color-mode', (payload) =>\n withHook('workspace:update:color-mode', mutators.value.workspace().workspace.updateColorMode, hooks)(payload),\n )\n eventBus.on('workspace:update:theme', (payload) =>\n withHook('workspace:update:theme', mutators.value.workspace().workspace.updateTheme, hooks)(payload),\n )\n eventBus.on('workspace:update:selected-client', (payload) =>\n withHook(\n 'workspace:update:selected-client',\n mutators.value.workspace().workspace.updateSelectedClient,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:selected-example', (payload) =>\n withHook(\n 'workspace:update:selected-example',\n mutators.value.workspace().workspace.updateSelectedExample,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:active-environment', (payload) =>\n withHook(\n 'workspace:update:active-environment',\n mutators.value.workspace().workspace.updateActiveEnvironment,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Document Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('document:update:extension', (payload) =>\n withHook('document:update:extension', mutators.value.active().document.updateDocumentExtension, hooks)(payload),\n )\n eventBus.on('document:update:icon', (payload) =>\n withHook('document:update:icon', mutators.value.active().document.updateDocumentIcon, hooks)(payload),\n )\n eventBus.on('document:update:info', (payload) =>\n withHook('document:update:info', mutators.value.active().document.updateDocumentInfo, hooks)(payload),\n )\n eventBus.on('document:update:watch-mode', (payload) =>\n withHook('document:update:watch-mode', mutators.value.active().document.updateWatchMode, hooks)(payload),\n )\n eventBus.on('document:create:empty-document', (payload) =>\n withHook('document:create:empty-document', mutators.value.active().document.createEmptyDocument, hooks)(payload),\n )\n eventBus.on('document:delete:document', (payload) =>\n withHook('document:delete:document', mutators.value.active().document.deleteDocument, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Environment Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('environment:upsert:environment', (payload) =>\n withHook('environment:upsert:environment', getMutators(payload).environment.upsertEnvironment, hooks)(payload),\n )\n eventBus.on('environment:delete:environment', (payload) =>\n withHook('environment:delete:environment', getMutators(payload).environment.deleteEnvironment, hooks)(payload),\n )\n eventBus.on('environment:upsert:environment-variable', (payload) =>\n withHook(\n 'environment:upsert:environment-variable',\n getMutators(payload).environment.upsertEnvironmentVariable,\n hooks,\n )(payload),\n )\n eventBus.on('environment:delete:environment-variable', (payload) =>\n withHook(\n 'environment:delete:environment-variable',\n getMutators(payload).environment.deleteEnvironmentVariable,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Cookie Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('cookie:upsert:cookie', async (payload) => {\n await withHook('cookie:upsert:cookie', getMutators(payload).cookie.upsertCookie, hooks)(payload)\n })\n eventBus.on('cookie:delete:cookie', async (payload) => {\n await withHook('cookie:delete:cookie', getMutators(payload).cookie.deleteCookie, hooks)(payload)\n })\n\n //------------------------------------------------------------------------------------\n // Auth Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('auth:delete:security-scheme', (payload) =>\n withHook('auth:delete:security-scheme', mutators.value.active().auth.deleteSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:active-index', (payload) =>\n withHook('auth:update:active-index', mutators.value.active().auth.updateSelectedAuthTab, hooks)(payload),\n )\n eventBus.on('auth:update:security-scheme', (payload) =>\n withHook('auth:update:security-scheme', mutators.value.active().auth.updateSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:selected-scopes', (payload) =>\n withHook('auth:update:selected-scopes', mutators.value.active().auth.updateSelectedScopes, hooks)(payload),\n )\n eventBus.on('auth:upsert:scopes', (payload) =>\n withHook('auth:upsert:scopes', mutators.value.active().auth.upsertScope, hooks)(payload),\n )\n eventBus.on('auth:delete:scopes', (payload) =>\n withHook('auth:delete:scopes', mutators.value.active().auth.deleteScope, hooks)(payload),\n )\n eventBus.on('auth:update:selected-security-schemes', (payload) =>\n withHook(\n 'auth:update:selected-security-schemes',\n mutators.value.active().auth.updateSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:selected-security-schemes', (payload) =>\n withHook(\n 'auth:clear:selected-security-schemes',\n mutators.value.active().auth.clearSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:update:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:update:security-scheme-secrets',\n mutators.value.active().auth.updateSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n eventBus.on('auth:reset:security-scheme-secret', (payload) =>\n withHook(\n 'auth:reset:security-scheme-secret',\n mutators.value.active().auth.resetSecuritySchemeSecret,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:clear:security-scheme-secrets',\n mutators.value.active().auth.clearSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Server Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('server:initialize:servers', (payload) =>\n withHook('server:initialize:servers', mutators.value.active().server.initializeServers, hooks)(payload),\n )\n eventBus.on('server:add:server', (payload) =>\n withHook('server:add:server', mutators.value.active().server.addServer, hooks)(payload),\n )\n eventBus.on('server:update:server', (payload) =>\n withHook('server:update:server', mutators.value.active().server.updateServer, hooks)(payload),\n )\n eventBus.on('server:delete:server', (payload) =>\n withHook('server:delete:server', mutators.value.active().server.deleteServer, hooks)(payload),\n )\n eventBus.on('server:clear:servers', (payload) =>\n withHook('server:clear:servers', mutators.value.active().server.clearServers, hooks)(payload),\n )\n eventBus.on('server:update:variables', (payload) =>\n withHook('server:update:variables', mutators.value.active().server.updateServerVariables, hooks)(payload),\n )\n eventBus.on('server:update:selected', (payload) =>\n withHook('server:update:selected', mutators.value.active().server.updateSelectedServer, hooks)(payload),\n )\n eventBus.on('asyncapi-server:update:selected', (payload) =>\n withHook(\n 'asyncapi-server:update:selected',\n mutators.value.active().server.updateSelectedAsyncApiServer,\n hooks,\n )(payload),\n )\n eventBus.on('asyncapi-server:update:variables', (payload) =>\n withHook(\n 'asyncapi-server:update:variables',\n mutators.value.active().server.updateAsyncApiServerVariables,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:create:operation', (payload) =>\n withHook('operation:create:operation', mutators.value.active().operation.createOperation, hooks)(payload),\n )\n eventBus.on('operation:update:pathMethod', (payload) =>\n withHook(\n 'operation:update:pathMethod',\n mutators.value.active().operation.updateOperationPathMethod,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:meta', (payload) =>\n withHook('operation:update:meta', mutators.value.active().operation.updateOperationMeta, hooks)(payload),\n )\n eventBus.on('operation:delete:operation', (payload) =>\n withHook('operation:delete:operation', mutators.value.active().operation.deleteOperation, hooks)(payload),\n )\n eventBus.on('operation:create:draft-example', (payload) =>\n withHook(\n 'operation:create:draft-example',\n mutators.value.active().operation.createOperationDraftExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:example', (payload) =>\n withHook('operation:delete:example', mutators.value.active().operation.deleteOperationExample, hooks)(payload),\n )\n eventBus.on('operation:rename:example', (payload) =>\n withHook('operation:rename:example', mutators.value.active().operation.renameOperationExample, hooks)(payload),\n )\n eventBus.on('operation:upsert:parameter', (payload) =>\n withHook('operation:upsert:parameter', mutators.value.active().operation.upsertOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:update:extra-parameters', (payload) =>\n withHook(\n 'operation:update:extra-parameters',\n mutators.value.active().operation.updateOperationExtraParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:parameter', (payload) =>\n withHook('operation:delete:parameter', mutators.value.active().operation.deleteOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:delete-all:parameters', (payload) =>\n withHook(\n 'operation:delete-all:parameters',\n mutators.value.active().operation.deleteAllOperationParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:extension', (payload) =>\n withHook('operation:update:extension', mutators.value.active().operation.updateOperationExtension, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:update:requestBody:contentType', (payload) =>\n withHook(\n 'operation:update:requestBody:contentType',\n mutators.value.active().operation.updateOperationRequestBodyContentType,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:value', (payload) =>\n withHook(\n 'operation:update:requestBody:value',\n mutators.value.active().operation.updateOperationRequestBodyExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:formValue', (payload) =>\n withHook(\n 'operation:update:requestBody:formValue',\n mutators.value.active().operation.updateOperationRequestBodyFormValue,\n hooks,\n )(payload),\n )\n eventBus.on('operation:reload:history', (payload) =>\n withHook('operation:reload:history', mutators.value.active().operation.reloadOperationHistory, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tag Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tag:create:tag', (payload) =>\n withHook('tag:create:tag', mutators.value.active().tag.createTag, hooks)(payload),\n )\n eventBus.on('tag:edit:tag', (payload) =>\n withHook('tag:edit:tag', mutators.value.active().tag.editTag, hooks)(payload),\n )\n eventBus.on('tag:delete:tag', (payload) =>\n withHook('tag:delete:tag', mutators.value.active().tag.deleteTag, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:add:tab', (payload) =>\n withHook('tabs:add:tab', mutators.value.workspace().tabs.addTab, hooks)(payload),\n )\n eventBus.on('tabs:close:tab', (payload) =>\n withHook('tabs:close:tab', mutators.value.workspace().tabs.closeTab, hooks)(payload),\n )\n eventBus.on('tabs:close:other-tabs', (payload) =>\n withHook('tabs:close:other-tabs', mutators.value.workspace().tabs.closeOtherTabs, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab', (payload) =>\n withHook('tabs:focus:tab', mutators.value.workspace().tabs.focusTab, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab-last', (payload) =>\n withHook('tabs:focus:tab-last', mutators.value.workspace().tabs.focusLastTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:previous', (payload) =>\n withHook('tabs:navigate:previous', mutators.value.workspace().tabs.navigatePreviousTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:next', (payload) =>\n withHook('tabs:navigate:next', mutators.value.workspace().tabs.navigateNextTab, hooks)(payload),\n )\n eventBus.on('tabs:update:tabs', (payload) =>\n withHook('tabs:update:tabs', mutators.value.workspace().tabs.updateTabs, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Hooks Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('hooks:on:request:complete', (payload) =>\n withHook('hooks:on:request:complete', mutators.value.active().operation.addResponseToHistory, hooks)(payload),\n )\n return () => subscriptions.splice(0).forEach((unsubscribe) => unsubscribe())\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,IAAM,YACJ,OACA,IACA,UACG;CACH,OAAO,OAAO,SAAgC;EAE5C,MAAM,SAAU,MAAM,MAAM,MAAM,EAAE,kBAAkB,IAAI,KAAM;EAEhE,MAAM,GAAG,MAAM;EAEf,MAAM,MAAM,MAAM,EAAE,iBAAiB,MAAM;EAC3C,OAAO;CACT;AACF;;;;;;;;;AAUA,SAAgB,iCAAiC,EAC/C,UAAU,KACV,OACA,SAKa;CACb,MAAM,gBAAgC,CAAC;CACvC,MAAM,WAA0C,EAC9C,KAAK,OAAO,aAAa;EACvB,MAAM,cAAc,IAAI,GAAG,OAAO,QAAQ;EAC1C,cAAc,KAAK,WAAW;EAC9B,OAAO;CACT,EACF;CAEA,MAAM,WAAW,eAAe,uBAAuB,MAAM,KAAK,CAAC;;;;;;CAOnE,MAAM,eAAe,EAAE,qBAAqC;EAC1D,IAAI,mBAAmB,YACrB,OAAO,SAAS,MAAM,OAAO;EAE/B,OAAO,SAAS,MAAM,UAAU;CAClC;CAKA,SAAS,GAAG,kCAAkC,YAC5C,SAAS,iCAAiC,SAAS,MA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qB,KAAK,CAAC,CAAC,OAAO,CACxG;CACA,SAAS,GAAG,uBAAuB,YACjC,SAAS,sBAAsB,SAAS,MAAM,UAAU,CAAC,CAAC,KAAK,iBAAiB,KAAK,CAAC,CAAC,OAAO,CAChG;CACA,SAAS,GAAG,qBAAqB,YAC/B,SAAS,oBAAoB,SAAS,MAAM,UAAU,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,OAAO,CACzF;CAKA,SAAS,GAAG,8BAA8B,YACxC,SAAS,6BAA6B,SAAS,MAAM,OAAO,CAAC,CAAC,UAAU,sBAAsB,KAAK,CAAC,CAAC,OAAO,CAC9G;CACA,aAAa,cAAc,OAAO,CAAC,CAAC,CAAC,SAAS,gBAAgB,YAAY,CAAC;AAC7E"}
|
|
1
|
+
{"version":3,"file":"workspace-events.js","names":[],"sources":["../../src/v2/workspace-events.ts"],"sourcesContent":["import type { AuthenticationConfiguration } from '@scalar/types/api-reference'\nimport type { WorkspaceStore } from '@scalar/workspace-store/client'\nimport type { ApiReferenceEvents, CollectionType, WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport { generateClientMutators } from '@scalar/workspace-store/mutators'\nimport { type Ref, computed } from 'vue'\n\ntype Hook<T extends keyof ApiReferenceEvents> = Partial<{\n onBeforeExecute: (\n payload: ApiReferenceEvents[T],\n ) => void | Promise<void> | ApiReferenceEvents[T] | Promise<ApiReferenceEvents[T]>\n onAfterExecute: (payload: ApiReferenceEvents[T]) => void | Promise<void>\n}>\n\ntype Hooks = {\n [key in keyof ApiReferenceEvents]?: Hook<key>\n}\n\n/**\n * Wraps a given function with optional before/after execution hooks for a specific event.\n * - Calls onBeforeExecute hook before executing the main function.\n * - Calls onAfterExecute hook after executing the main function.\n *\n * @template T The event key from ApiReferenceEvents\n * @param event The event name\n * @param fn The main function to execute\n * @param hooks The hooks object containing before/after hooks for events\n * @returns An async function that runs hooks around the main function\n */\nconst withHook = <T extends keyof ApiReferenceEvents>(\n event: T,\n fn: (args: ApiReferenceEvents[T]) => unknown | Promise<unknown>,\n hooks: Hooks,\n) => {\n return async (args: ApiReferenceEvents[T]) => {\n // Call the before execution hook for this event, if any\n const result = (await hooks[event]?.onBeforeExecute?.(args)) ?? args\n // Execute the main function\n await fn(result)\n // Call the after execution hook for this event, if any\n await hooks[event]?.onAfterExecute?.(result)\n return result\n }\n}\n\n/**\n * Initializes all Workspace Event Handlers by subscribing eventBus listeners\n * to each relevant mutator operation. Hooks are used for before/after execution.\n *\n * @param eventBus The WorkspaceEventBus to subscribe to\n * @param store The WorkspaceStore instance\n * @param hooks Object containing optional before/after hooks for each event\n */\nexport function initializeWorkspaceEventHandlers({\n eventBus: bus,\n store,\n hooks,\n getConfiguredSecuritySchemes,\n}: {\n eventBus: WorkspaceEventBus\n store: Ref<WorkspaceStore | null>\n hooks: Hooks\n /** Read current defaults when a name is edited, including after a configuration change. */\n getConfiguredSecuritySchemes?: () => AuthenticationConfiguration['securitySchemes']\n}): () => void {\n const subscriptions: (() => void)[] = []\n const eventBus: Pick<WorkspaceEventBus, 'on'> = {\n on: (event, listener) => {\n const unsubscribe = bus.on(event, listener)\n subscriptions.push(unsubscribe)\n return unsubscribe\n },\n }\n // Generate all client mutators for the current workspace store\n const mutators = computed(() => generateClientMutators(store.value))\n\n /**\n * Returns the appropriate mutators depending on the collectionType.\n * If collectionType is 'document', gets the active document mutator,\n * otherwise, gets the workspace mutator.\n */\n const getMutators = ({ collectionType }: CollectionType) => {\n if (collectionType === 'document') {\n return mutators.value.active()\n }\n return mutators.value.workspace()\n }\n\n //------------------------------------------------------------------------------------\n // Workspace Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('workspace:update:active-proxy', (payload) =>\n withHook('workspace:update:active-proxy', mutators.value.workspace().workspace.updateActiveProxy, hooks)(payload),\n )\n eventBus.on('workspace:update:color-mode', (payload) =>\n withHook('workspace:update:color-mode', mutators.value.workspace().workspace.updateColorMode, hooks)(payload),\n )\n eventBus.on('workspace:update:theme', (payload) =>\n withHook('workspace:update:theme', mutators.value.workspace().workspace.updateTheme, hooks)(payload),\n )\n eventBus.on('workspace:update:selected-client', (payload) =>\n withHook(\n 'workspace:update:selected-client',\n mutators.value.workspace().workspace.updateSelectedClient,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:selected-example', (payload) =>\n withHook(\n 'workspace:update:selected-example',\n mutators.value.workspace().workspace.updateSelectedExample,\n hooks,\n )(payload),\n )\n eventBus.on('workspace:update:active-environment', (payload) =>\n withHook(\n 'workspace:update:active-environment',\n mutators.value.workspace().workspace.updateActiveEnvironment,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Document Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('document:update:extension', (payload) =>\n withHook('document:update:extension', mutators.value.active().document.updateDocumentExtension, hooks)(payload),\n )\n eventBus.on('document:update:icon', (payload) =>\n withHook('document:update:icon', mutators.value.active().document.updateDocumentIcon, hooks)(payload),\n )\n eventBus.on('document:update:info', (payload) =>\n withHook('document:update:info', mutators.value.active().document.updateDocumentInfo, hooks)(payload),\n )\n eventBus.on('document:update:watch-mode', (payload) =>\n withHook('document:update:watch-mode', mutators.value.active().document.updateWatchMode, hooks)(payload),\n )\n eventBus.on('document:create:empty-document', (payload) =>\n withHook('document:create:empty-document', mutators.value.active().document.createEmptyDocument, hooks)(payload),\n )\n eventBus.on('document:delete:document', (payload) =>\n withHook('document:delete:document', mutators.value.active().document.deleteDocument, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Environment Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('environment:upsert:environment', (payload) =>\n withHook('environment:upsert:environment', getMutators(payload).environment.upsertEnvironment, hooks)(payload),\n )\n eventBus.on('environment:delete:environment', (payload) =>\n withHook('environment:delete:environment', getMutators(payload).environment.deleteEnvironment, hooks)(payload),\n )\n eventBus.on('environment:upsert:environment-variable', (payload) =>\n withHook(\n 'environment:upsert:environment-variable',\n getMutators(payload).environment.upsertEnvironmentVariable,\n hooks,\n )(payload),\n )\n eventBus.on('environment:delete:environment-variable', (payload) =>\n withHook(\n 'environment:delete:environment-variable',\n getMutators(payload).environment.deleteEnvironmentVariable,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Cookie Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('cookie:upsert:cookie', async (payload) => {\n await withHook('cookie:upsert:cookie', getMutators(payload).cookie.upsertCookie, hooks)(payload)\n })\n eventBus.on('cookie:delete:cookie', async (payload) => {\n await withHook('cookie:delete:cookie', getMutators(payload).cookie.deleteCookie, hooks)(payload)\n })\n\n //------------------------------------------------------------------------------------\n // Auth Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('auth:delete:security-scheme', (payload) =>\n withHook('auth:delete:security-scheme', mutators.value.active().auth.deleteSecurityScheme, hooks)(payload),\n )\n eventBus.on('auth:update:active-index', (payload) =>\n withHook('auth:update:active-index', mutators.value.active().auth.updateSelectedAuthTab, hooks)(payload),\n )\n eventBus.on('auth:update:security-scheme', (payload) =>\n withHook(\n 'auth:update:security-scheme',\n (data) => mutators.value.active().auth.updateSecurityScheme(data, getConfiguredSecuritySchemes?.()),\n hooks,\n )(payload),\n )\n eventBus.on('auth:update:selected-scopes', (payload) =>\n withHook('auth:update:selected-scopes', mutators.value.active().auth.updateSelectedScopes, hooks)(payload),\n )\n eventBus.on('auth:upsert:scopes', (payload) =>\n withHook('auth:upsert:scopes', mutators.value.active().auth.upsertScope, hooks)(payload),\n )\n eventBus.on('auth:delete:scopes', (payload) =>\n withHook('auth:delete:scopes', mutators.value.active().auth.deleteScope, hooks)(payload),\n )\n eventBus.on('auth:update:selected-security-schemes', (payload) =>\n withHook(\n 'auth:update:selected-security-schemes',\n mutators.value.active().auth.updateSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:selected-security-schemes', (payload) =>\n withHook(\n 'auth:clear:selected-security-schemes',\n mutators.value.active().auth.clearSelectedSecuritySchemes,\n hooks,\n )(payload),\n )\n eventBus.on('auth:update:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:update:security-scheme-secrets',\n mutators.value.active().auth.updateSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n eventBus.on('auth:reset:security-scheme-secret', (payload) =>\n withHook(\n 'auth:reset:security-scheme-secret',\n mutators.value.active().auth.resetSecuritySchemeSecret,\n hooks,\n )(payload),\n )\n eventBus.on('auth:clear:security-scheme-secrets', (payload) =>\n withHook(\n 'auth:clear:security-scheme-secrets',\n mutators.value.active().auth.clearSecuritySchemeSecrets,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Server Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('server:initialize:servers', (payload) =>\n withHook('server:initialize:servers', mutators.value.active().server.initializeServers, hooks)(payload),\n )\n eventBus.on('server:add:server', (payload) =>\n withHook('server:add:server', mutators.value.active().server.addServer, hooks)(payload),\n )\n eventBus.on('server:update:server', (payload) =>\n withHook('server:update:server', mutators.value.active().server.updateServer, hooks)(payload),\n )\n eventBus.on('server:delete:server', (payload) =>\n withHook('server:delete:server', mutators.value.active().server.deleteServer, hooks)(payload),\n )\n eventBus.on('server:clear:servers', (payload) =>\n withHook('server:clear:servers', mutators.value.active().server.clearServers, hooks)(payload),\n )\n eventBus.on('server:update:variables', (payload) =>\n withHook('server:update:variables', mutators.value.active().server.updateServerVariables, hooks)(payload),\n )\n eventBus.on('server:update:selected', (payload) =>\n withHook('server:update:selected', mutators.value.active().server.updateSelectedServer, hooks)(payload),\n )\n eventBus.on('asyncapi-server:update:selected', (payload) =>\n withHook(\n 'asyncapi-server:update:selected',\n mutators.value.active().server.updateSelectedAsyncApiServer,\n hooks,\n )(payload),\n )\n eventBus.on('asyncapi-server:update:variables', (payload) =>\n withHook(\n 'asyncapi-server:update:variables',\n mutators.value.active().server.updateAsyncApiServerVariables,\n hooks,\n )(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:create:operation', (payload) =>\n withHook('operation:create:operation', mutators.value.active().operation.createOperation, hooks)(payload),\n )\n eventBus.on('operation:update:pathMethod', (payload) =>\n withHook(\n 'operation:update:pathMethod',\n mutators.value.active().operation.updateOperationPathMethod,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:meta', (payload) =>\n withHook('operation:update:meta', mutators.value.active().operation.updateOperationMeta, hooks)(payload),\n )\n eventBus.on('operation:delete:operation', (payload) =>\n withHook('operation:delete:operation', mutators.value.active().operation.deleteOperation, hooks)(payload),\n )\n eventBus.on('operation:create:draft-example', (payload) =>\n withHook(\n 'operation:create:draft-example',\n mutators.value.active().operation.createOperationDraftExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:example', (payload) =>\n withHook('operation:delete:example', mutators.value.active().operation.deleteOperationExample, hooks)(payload),\n )\n eventBus.on('operation:rename:example', (payload) =>\n withHook('operation:rename:example', mutators.value.active().operation.renameOperationExample, hooks)(payload),\n )\n eventBus.on('operation:upsert:parameter', (payload) =>\n withHook('operation:upsert:parameter', mutators.value.active().operation.upsertOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:update:extra-parameters', (payload) =>\n withHook(\n 'operation:update:extra-parameters',\n mutators.value.active().operation.updateOperationExtraParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:delete:parameter', (payload) =>\n withHook('operation:delete:parameter', mutators.value.active().operation.deleteOperationParameter, hooks)(payload),\n )\n eventBus.on('operation:delete-all:parameters', (payload) =>\n withHook(\n 'operation:delete-all:parameters',\n mutators.value.active().operation.deleteAllOperationParameters,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:extension', (payload) =>\n withHook('operation:update:extension', mutators.value.active().operation.updateOperationExtension, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Operation Request Body Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('operation:update:requestBody:contentType', (payload) =>\n withHook(\n 'operation:update:requestBody:contentType',\n mutators.value.active().operation.updateOperationRequestBodyContentType,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:value', (payload) =>\n withHook(\n 'operation:update:requestBody:value',\n mutators.value.active().operation.updateOperationRequestBodyExample,\n hooks,\n )(payload),\n )\n eventBus.on('operation:update:requestBody:formValue', (payload) =>\n withHook(\n 'operation:update:requestBody:formValue',\n mutators.value.active().operation.updateOperationRequestBodyFormValue,\n hooks,\n )(payload),\n )\n eventBus.on('operation:reload:history', (payload) =>\n withHook('operation:reload:history', mutators.value.active().operation.reloadOperationHistory, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tag Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tag:create:tag', (payload) =>\n withHook('tag:create:tag', mutators.value.active().tag.createTag, hooks)(payload),\n )\n eventBus.on('tag:edit:tag', (payload) =>\n withHook('tag:edit:tag', mutators.value.active().tag.editTag, hooks)(payload),\n )\n eventBus.on('tag:delete:tag', (payload) =>\n withHook('tag:delete:tag', mutators.value.active().tag.deleteTag, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Tabs Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('tabs:add:tab', (payload) =>\n withHook('tabs:add:tab', mutators.value.workspace().tabs.addTab, hooks)(payload),\n )\n eventBus.on('tabs:close:tab', (payload) =>\n withHook('tabs:close:tab', mutators.value.workspace().tabs.closeTab, hooks)(payload),\n )\n eventBus.on('tabs:close:other-tabs', (payload) =>\n withHook('tabs:close:other-tabs', mutators.value.workspace().tabs.closeOtherTabs, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab', (payload) =>\n withHook('tabs:focus:tab', mutators.value.workspace().tabs.focusTab, hooks)(payload),\n )\n eventBus.on('tabs:focus:tab-last', (payload) =>\n withHook('tabs:focus:tab-last', mutators.value.workspace().tabs.focusLastTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:previous', (payload) =>\n withHook('tabs:navigate:previous', mutators.value.workspace().tabs.navigatePreviousTab, hooks)(payload),\n )\n eventBus.on('tabs:navigate:next', (payload) =>\n withHook('tabs:navigate:next', mutators.value.workspace().tabs.navigateNextTab, hooks)(payload),\n )\n eventBus.on('tabs:update:tabs', (payload) =>\n withHook('tabs:update:tabs', mutators.value.workspace().tabs.updateTabs, hooks)(payload),\n )\n\n //------------------------------------------------------------------------------------\n // Hooks Related Event Handlers\n //------------------------------------------------------------------------------------\n eventBus.on('hooks:on:request:complete', (payload) =>\n withHook('hooks:on:request:complete', mutators.value.active().operation.addResponseToHistory, hooks)(payload),\n )\n return () => subscriptions.splice(0).forEach((unsubscribe) => unsubscribe())\n}\n"],"mappings":";;;;;;;;;;;;;;AA4BA,IAAM,YACJ,OACA,IACA,UACG;CACH,OAAO,OAAO,SAAgC;EAE5C,MAAM,SAAU,MAAM,MAAM,MAAM,EAAE,kBAAkB,IAAI,KAAM;EAEhE,MAAM,GAAG,MAAM;EAEf,MAAM,MAAM,MAAM,EAAE,iBAAiB,MAAM;EAC3C,OAAO;CACT;AACF;;;;;;;;;AAUA,SAAgB,iCAAiC,EAC/C,UAAU,KACV,OACA,OACA,gCAOa;CACb,MAAM,gBAAgC,CAAC;CACvC,MAAM,WAA0C,EAC9C,KAAK,OAAO,aAAa;EACvB,MAAM,cAAc,IAAI,GAAG,OAAO,QAAQ;EAC1C,cAAc,KAAK,WAAW;EAC9B,OAAO;CACT,EACF;CAEA,MAAM,WAAW,eAAe,uBAAuB,MAAM,KAAK,CAAC;;;;;;CAOnE,MAAM,eAAe,EAAE,qBAAqC;EAC1D,IAAI,mBAAmB,YACrB,OAAO,SAAS,MAAM,OAAO;EAE/B,OAAO,SAAS,MAAM,UAAU;CAClC;CAKA,SAAS,GAAG,kCAAkC,YAC5C,SAAS,iCAAiC,SAAS,MAAM,UAAU,CAAC,CAAC,UAAU,mBAAmB,KAAK,CAAC,CAAC,OAAO,CAClH;CACA,SAAS,GAAG,gCAAgC,YAC1C,SAAS,+BAA+B,SAAS,MAAM,UAAU,CAAC,CAAC,UAAU,iBAAi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CAAC,CAAC,OAAO,CAChG;CACA,SAAS,GAAG,qBAAqB,YAC/B,SAAS,oBAAoB,SAAS,MAAM,UAAU,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,OAAO,CACzF;CAKA,SAAS,GAAG,8BAA8B,YACxC,SAAS,6BAA6B,SAAS,MAAM,OAAO,CAAC,CAAC,UAAU,sBAAsB,KAAK,CAAC,CAAC,OAAO,CAC9G;CACA,aAAa,cAAc,OAAO,CAAC,CAAC,CAAC,SAAS,gBAAgB,YAAY,CAAC;AAC7E"}
|
package/dist/vue-styles.css
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.035));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.ascii-art-animate .ascii-art-line[data-v-
|
|
15
|
+
.ascii-art-animate .ascii-art-line[data-v-4f827089] {
|
|
16
16
|
border-right: 1ch solid transparent;
|
|
17
17
|
animation:
|
|
18
|
-
typewriter-
|
|
18
|
+
typewriter-4f827089 4s steps(1) 1s 1 normal both,blinkTextCursor-4f827089 500ms steps(1) infinite normal;
|
|
19
19
|
}
|
|
20
|
-
@keyframes typewriter-
|
|
20
|
+
@keyframes typewriter-4f827089 {
|
|
21
21
|
from {
|
|
22
22
|
width: 0;
|
|
23
23
|
}
|
|
@@ -25,7 +25,7 @@ to {
|
|
|
25
25
|
width: 100%;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
@keyframes blinkTextCursor-
|
|
28
|
+
@keyframes blinkTextCursor-4f827089 {
|
|
29
29
|
0% {
|
|
30
30
|
border-right-color: currentColor;
|
|
31
31
|
}
|
|
@@ -159,22 +159,22 @@ to {
|
|
|
159
159
|
/*
|
|
160
160
|
Deep styling for customizing Codemirror
|
|
161
161
|
*/
|
|
162
|
-
[data-v-
|
|
162
|
+
[data-v-fce866d6] .cm-editor {
|
|
163
163
|
height: 100%;
|
|
164
164
|
outline: none;
|
|
165
165
|
padding: 0;
|
|
166
166
|
background: transparent;
|
|
167
167
|
}
|
|
168
|
-
[data-v-
|
|
168
|
+
[data-v-fce866d6] .cm-placeholder {
|
|
169
169
|
color: var(--scalar-color-3);
|
|
170
170
|
}
|
|
171
|
-
[data-v-
|
|
171
|
+
[data-v-fce866d6] .cm-content {
|
|
172
172
|
font-family: var(--scalar-font-code);
|
|
173
173
|
font-size: var(--scalar-small);
|
|
174
174
|
padding: 8px 0;
|
|
175
175
|
}
|
|
176
176
|
/* Tooltip helper */
|
|
177
|
-
[data-v-
|
|
177
|
+
[data-v-fce866d6] .cm-tooltip {
|
|
178
178
|
background: var(--scalar-background-1) !important;
|
|
179
179
|
border-radius: var(--scalar-radius);
|
|
180
180
|
box-shadow: var(--scalar-shadow-2);
|
|
@@ -182,43 +182,43 @@ to {
|
|
|
182
182
|
outline: none !important;
|
|
183
183
|
overflow: hidden !important;
|
|
184
184
|
}
|
|
185
|
-
[data-v-
|
|
185
|
+
[data-v-fce866d6] .cm-tooltip-autocomplete ul li {
|
|
186
186
|
padding: 3px 6px !important;
|
|
187
187
|
}
|
|
188
|
-
[data-v-
|
|
188
|
+
[data-v-fce866d6] .cm-completionIcon-type:after {
|
|
189
189
|
color: var(--scalar-color-3) !important;
|
|
190
190
|
}
|
|
191
|
-
[data-v-
|
|
191
|
+
[data-v-fce866d6] .cm-tooltip-autocomplete ul li[aria-selected] {
|
|
192
192
|
background: var(--scalar-background-2) !important;
|
|
193
193
|
color: var(--scalar-color-1) !important;
|
|
194
194
|
}
|
|
195
|
-
[data-v-
|
|
195
|
+
[data-v-fce866d6] .cm-tooltip-autocomplete ul {
|
|
196
196
|
padding: 6px !important;
|
|
197
197
|
position: relative;
|
|
198
198
|
}
|
|
199
|
-
[data-v-
|
|
199
|
+
[data-v-fce866d6] .cm-tooltip-autocomplete ul li:hover {
|
|
200
200
|
border-radius: 3px;
|
|
201
201
|
color: var(--scalar-color-1) !important;
|
|
202
202
|
background: var(--scalar-background-3) !important;
|
|
203
203
|
}
|
|
204
204
|
/* Disable active line highlighting */
|
|
205
|
-
[data-v-
|
|
205
|
+
[data-v-fce866d6] .cm-activeLine,[data-v-fce866d6] .cm-activeLineGutter {
|
|
206
206
|
background-color: transparent;
|
|
207
207
|
}
|
|
208
208
|
/* Color selection matching */
|
|
209
|
-
[data-v-
|
|
209
|
+
[data-v-fce866d6] .cm-selectionMatch,[data-v-fce866d6] .cm-matchingBracket {
|
|
210
210
|
border-radius: var(--scalar-radius);
|
|
211
211
|
background: var(--scalar-background-4) !important;
|
|
212
212
|
}
|
|
213
213
|
/* Color Picker Swatches */
|
|
214
|
-
[data-v-
|
|
214
|
+
[data-v-fce866d6] .cm-css-color-picker-wrapper {
|
|
215
215
|
display: inline-flex;
|
|
216
216
|
outline: 1px solid var(--scalar-background-3);
|
|
217
217
|
border-radius: 3px;
|
|
218
218
|
overflow: hidden;
|
|
219
219
|
}
|
|
220
220
|
/* Number gutter */
|
|
221
|
-
[data-v-
|
|
221
|
+
[data-v-fce866d6] .cm-gutters {
|
|
222
222
|
background-color: transparent;
|
|
223
223
|
border-right: none;
|
|
224
224
|
color: var(--scalar-color-3);
|
|
@@ -226,7 +226,7 @@ to {
|
|
|
226
226
|
line-height: 22px;
|
|
227
227
|
border-radius: 0 0 0 3px;
|
|
228
228
|
}
|
|
229
|
-
[data-v-
|
|
229
|
+
[data-v-fce866d6] .cm-gutters:before {
|
|
230
230
|
content: '';
|
|
231
231
|
position: absolute;
|
|
232
232
|
top: 2px;
|
|
@@ -236,7 +236,7 @@ to {
|
|
|
236
236
|
border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);
|
|
237
237
|
background-color: var(--scalar-background-1);
|
|
238
238
|
}
|
|
239
|
-
[data-v-
|
|
239
|
+
[data-v-fce866d6] .cm-gutterElement {
|
|
240
240
|
font-family: var(--scalar-font-code) !important;
|
|
241
241
|
padding-left: 0px !important;
|
|
242
242
|
padding-right: 6px !important;
|
|
@@ -245,22 +245,22 @@ to {
|
|
|
245
245
|
justify-content: flex-end;
|
|
246
246
|
position: relative;
|
|
247
247
|
}
|
|
248
|
-
[data-v-
|
|
248
|
+
[data-v-fce866d6] .cm-lineNumbers .cm-gutterElement {
|
|
249
249
|
min-width: fit-content;
|
|
250
250
|
}
|
|
251
|
-
[data-v-
|
|
251
|
+
[data-v-fce866d6] .cm-gutter + .cm-gutter :not(.cm-foldGutter) .cm-gutterElement {
|
|
252
252
|
padding-left: 0 !important;
|
|
253
253
|
}
|
|
254
|
-
[data-v-
|
|
254
|
+
[data-v-fce866d6] .cm-scroller {
|
|
255
255
|
overflow: auto;
|
|
256
256
|
}
|
|
257
|
-
[data-v-
|
|
257
|
+
[data-v-fce866d6] .cm-lineWrapping .cm-line {
|
|
258
258
|
word-break: break-all;
|
|
259
259
|
}
|
|
260
|
-
[data-v-
|
|
260
|
+
[data-v-fce866d6] .cm-content.cm-lineWrapping {
|
|
261
261
|
white-space: pre-wrap;
|
|
262
262
|
}
|
|
263
|
-
.line-wrapping[data-v-
|
|
263
|
+
.line-wrapping[data-v-fce866d6]:focus-within .cm-content {
|
|
264
264
|
display: inline-table;
|
|
265
265
|
min-height: fit-content;
|
|
266
266
|
padding: 3px 6px;
|
|
@@ -325,13 +325,13 @@ to {
|
|
|
325
325
|
color: var(--scalar-color-1);
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
.code-input-lite[data-v-
|
|
328
|
+
.code-input-lite[data-v-5e6007a2] {
|
|
329
329
|
/* Flex so the editor centres vertically in whatever height the cell gives us.
|
|
330
330
|
Font properties inherit so we adopt the surrounding typography. */
|
|
331
331
|
display: flex;
|
|
332
332
|
align-items: center;
|
|
333
333
|
}
|
|
334
|
-
.code-input-lite__editor[data-v-
|
|
334
|
+
.code-input-lite__editor[data-v-5e6007a2] {
|
|
335
335
|
/* Everything font-related inherits from the surrounding context. */
|
|
336
336
|
font: inherit;
|
|
337
337
|
letter-spacing: inherit;
|
|
@@ -353,7 +353,7 @@ to {
|
|
|
353
353
|
/* Positioning context for the absolutely positioned placeholder. */
|
|
354
354
|
position: relative;
|
|
355
355
|
}
|
|
356
|
-
.code-input-lite__editor[data-v-
|
|
356
|
+
.code-input-lite__editor[data-v-5e6007a2]::-webkit-scrollbar {
|
|
357
357
|
display: none;
|
|
358
358
|
}
|
|
359
359
|
|
|
@@ -361,7 +361,7 @@ to {
|
|
|
361
361
|
contenteditable; otherwise the caret would land after it on focus.
|
|
362
362
|
`pointer-events: none` lets clicks fall through to focus the editor.
|
|
363
363
|
Hidden on focus so it never renders on top of the text caret. */
|
|
364
|
-
.code-input-lite--empty .code-input-lite__editor[data-v-
|
|
364
|
+
.code-input-lite--empty .code-input-lite__editor[data-v-5e6007a2]:not(:focus)::before {
|
|
365
365
|
content: attr(data-placeholder);
|
|
366
366
|
color: var(--scalar-color-3);
|
|
367
367
|
pointer-events: none;
|
|
@@ -372,7 +372,7 @@ to {
|
|
|
372
372
|
display: flex;
|
|
373
373
|
align-items: center;
|
|
374
374
|
}
|
|
375
|
-
.code-input-lite--error .code-input-lite__editor[data-v-
|
|
375
|
+
.code-input-lite--error .code-input-lite__editor[data-v-5e6007a2] {
|
|
376
376
|
outline: 1px solid var(--scalar-color-red);
|
|
377
377
|
}
|
|
378
378
|
|
|
@@ -416,16 +416,16 @@ to {
|
|
|
416
416
|
background: color-mix(in srgb, var(--scalar-background-3), transparent 40%);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
[data-v-
|
|
419
|
+
[data-v-09f26d90] .code-input-lite__editor {
|
|
420
420
|
background-color: transparent;
|
|
421
421
|
font-family: var(--scalar-font);
|
|
422
422
|
font-size: var(--scalar-small);
|
|
423
423
|
padding: 5px 8px;
|
|
424
424
|
}
|
|
425
|
-
[data-v-
|
|
425
|
+
[data-v-09f26d90] .scalar-pill:not(:last-of-type) {
|
|
426
426
|
margin-right: 0.15em;
|
|
427
427
|
}
|
|
428
|
-
[data-v-
|
|
428
|
+
[data-v-09f26d90] .scalar-pill:not(:first-of-type) {
|
|
429
429
|
margin-left: 0.5px;
|
|
430
430
|
}
|
|
431
431
|
|
|
@@ -478,20 +478,20 @@ input[data-v-029a43f5]::placeholder {
|
|
|
478
478
|
scrollbar-width: none;
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
.request-section-content[data-v-
|
|
481
|
+
.request-section-content[data-v-f9196c85] {
|
|
482
482
|
--scalar-border-width: 0.5px;
|
|
483
483
|
}
|
|
484
|
-
.request-section-content-filter[data-v-
|
|
484
|
+
.request-section-content-filter[data-v-f9196c85] {
|
|
485
485
|
box-shadow: 0 -10px 0 10px var(--scalar-background-1);
|
|
486
486
|
}
|
|
487
|
-
.request-item:focus-within .request-meta-buttons[data-v-
|
|
487
|
+
.request-item:focus-within .request-meta-buttons[data-v-f9196c85] {
|
|
488
488
|
opacity: 1;
|
|
489
489
|
}
|
|
490
|
-
.group-hover-input[data-v-
|
|
490
|
+
.group-hover-input[data-v-f9196c85] {
|
|
491
491
|
border-width: var(--scalar-border-width);
|
|
492
492
|
border-color: transparent;
|
|
493
493
|
}
|
|
494
|
-
.group:hover .group-hover-input[data-v-
|
|
494
|
+
.group:hover .group-hover-input[data-v-f9196c85] {
|
|
495
495
|
background: color-mix(
|
|
496
496
|
in srgb,
|
|
497
497
|
var(--scalar-background-1),
|
|
@@ -499,25 +499,25 @@ input[data-v-029a43f5]::placeholder {
|
|
|
499
499
|
);
|
|
500
500
|
border-color: var(--scalar-border-color);
|
|
501
501
|
}
|
|
502
|
-
.group-hover-input[data-v-
|
|
502
|
+
.group-hover-input[data-v-f9196c85]:focus {
|
|
503
503
|
background: transparent !important;
|
|
504
504
|
border-color: var(--scalar-border-color) !important;
|
|
505
505
|
}
|
|
506
506
|
|
|
507
|
-
[data-v-
|
|
507
|
+
[data-v-973d48ca] .cm-editor {
|
|
508
508
|
background-color: transparent;
|
|
509
509
|
font-size: var(--scalar-small);
|
|
510
510
|
outline: none;
|
|
511
511
|
}
|
|
512
|
-
[data-v-
|
|
512
|
+
[data-v-973d48ca] .cm-gutters {
|
|
513
513
|
background-color: var(--scalar-background-1);
|
|
514
514
|
border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);
|
|
515
515
|
}
|
|
516
|
-
[data-v-
|
|
516
|
+
[data-v-973d48ca] .cm-scroller {
|
|
517
517
|
overflow: auto;
|
|
518
518
|
min-width: 100%;
|
|
519
519
|
}
|
|
520
|
-
[data-v-
|
|
520
|
+
[data-v-973d48ca] .cm-lineWrapping .cm-line {
|
|
521
521
|
word-break: break-all;
|
|
522
522
|
}
|
|
523
523
|
|
|
@@ -703,11 +703,11 @@ to {
|
|
|
703
703
|
--scalar-address-bar-bg: var(--scalar-background-1);
|
|
704
704
|
}
|
|
705
705
|
|
|
706
|
-
.app-exit-button[data-v-
|
|
706
|
+
.app-exit-button[data-v-3a29d7a0] {
|
|
707
707
|
color: white;
|
|
708
708
|
background: rgba(0, 0, 0, 0.1);
|
|
709
709
|
}
|
|
710
|
-
.app-exit-button[data-v-
|
|
710
|
+
.app-exit-button[data-v-3a29d7a0]:hover {
|
|
711
711
|
background: rgba(255, 255, 255, 0.1);
|
|
712
712
|
}
|
|
713
713
|
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"testing"
|
|
20
20
|
],
|
|
21
|
-
"version": "3.23.
|
|
21
|
+
"version": "3.23.2",
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=22"
|
|
24
24
|
},
|
|
@@ -305,22 +305,22 @@
|
|
|
305
305
|
"dependencies": {
|
|
306
306
|
"@headlessui/tailwindcss": "^0.2.2",
|
|
307
307
|
"@headlessui/vue": "1.7.23",
|
|
308
|
-
"@scalar/blocks": "0.5.
|
|
309
|
-
"@scalar/components": "0.
|
|
310
|
-
"@scalar/helpers": "0.16.
|
|
311
|
-
"@scalar/icons": "0.7.
|
|
312
|
-
"@scalar/localization": "0.2.
|
|
313
|
-
"@scalar/oas-utils": "0.20.
|
|
308
|
+
"@scalar/blocks": "0.5.4",
|
|
309
|
+
"@scalar/components": "0.32.1",
|
|
310
|
+
"@scalar/helpers": "0.16.4",
|
|
311
|
+
"@scalar/icons": "0.7.7",
|
|
312
|
+
"@scalar/localization": "0.2.8",
|
|
313
|
+
"@scalar/oas-utils": "0.20.14",
|
|
314
314
|
"@scalar/openapi-types": "0.9.8",
|
|
315
|
-
"@scalar/sidebar": "0.12.
|
|
316
|
-
"@scalar/snippetz": "0.10.
|
|
317
|
-
"@scalar/themes": "0.19.
|
|
315
|
+
"@scalar/sidebar": "0.12.2",
|
|
316
|
+
"@scalar/snippetz": "0.10.10",
|
|
317
|
+
"@scalar/themes": "0.19.2",
|
|
318
318
|
"@scalar/typebox": "^0.1.3",
|
|
319
|
-
"@scalar/types": "0.
|
|
319
|
+
"@scalar/types": "0.24.0",
|
|
320
320
|
"@scalar/use-codemirror": "0.14.15",
|
|
321
|
-
"@scalar/use-hooks": "0.4.
|
|
321
|
+
"@scalar/use-hooks": "0.4.21",
|
|
322
322
|
"@scalar/use-toasts": "0.10.5",
|
|
323
|
-
"@scalar/workspace-store": "0.68.
|
|
323
|
+
"@scalar/workspace-store": "0.68.5",
|
|
324
324
|
"@vueuse/core": "13.9.0",
|
|
325
325
|
"@vueuse/integrations": "13.9.0",
|
|
326
326
|
"focus-trap": "^7.8.0",
|
package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { SecurityScheme } from '@scalar/types/entities';
|
|
2
|
-
import type { AuthStore } from '@scalar/workspace-store/entities/auth';
|
|
3
|
-
import type { DeepPartial } from '@scalar/workspace-store/helpers/overrides-proxy';
|
|
4
|
-
import type { SecuritySchemeObjectSecret } from '@scalar/workspace-store/request-example';
|
|
5
|
-
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document';
|
|
6
|
-
/** A combined scheme that includes both the auth store secrets and a deep partial of the config auth */
|
|
7
|
-
export type ConfigAuthScheme = SecuritySchemeObject & DeepPartial<SecurityScheme>;
|
|
8
|
-
/** Extract the secrets from the config and the auth store */
|
|
9
|
-
export declare const extractSecuritySchemeSecrets: (scheme: SecuritySchemeObject & DeepPartial<SecurityScheme>, authStore: AuthStore, name: string, documentSlug: string) => SecuritySchemeObjectSecret;
|
|
10
|
-
//# sourceMappingURL=extract-security-scheme-secrets.d.ts.map
|
package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extract-security-scheme-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAA2C,MAAM,uCAAuC,CAAA;AAC/G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAClF,OAAO,KAAK,EAUV,0BAA0B,EAC3B,MAAM,yCAAyC,CAAA;AAShD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8DAA8D,CAAA;AAExG,wGAAwG;AACxG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAqMjF,6DAA6D;AAC7D,eAAO,MAAM,4BAA4B,GAEvC,QAAQ,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,EAC1D,WAAW,SAAS,EACpB,MAAM,MAAM,EACZ,cAAc,MAAM,KACnB,0BA4DF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-allowed-oauth-url.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,GAAI,KAAK,GAAG,KAAG,OACoC,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { isLocalUrl } from "@scalar/helpers/url/is-local-url";
|
|
2
|
-
//#region src/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.ts
|
|
3
|
-
/** Allows HTTPS, with HTTP reserved for local development hosts and reserved test domains. */
|
|
4
|
-
var isAllowedOAuthUrl = (url) => url.protocol === "https:" || url.protocol === "http:" && isLocalUrl(url.href);
|
|
5
|
-
//#endregion
|
|
6
|
-
export { isAllowedOAuthUrl };
|
|
7
|
-
|
|
8
|
-
//# sourceMappingURL=is-allowed-oauth-url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-allowed-oauth-url.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/is-allowed-oauth-url.ts"],"sourcesContent":["import { isLocalUrl } from '@scalar/helpers/url/is-local-url'\n\n/** Allows HTTPS, with HTTP reserved for local development hosts and reserved test domains. */\nexport const isAllowedOAuthUrl = (url: URL): boolean =>\n url.protocol === 'https:' || (url.protocol === 'http:' && isLocalUrl(url.href))\n"],"mappings":";;;AAGA,IAAa,qBAAqB,QAChC,IAAI,aAAa,YAAa,IAAI,aAAa,WAAW,WAAW,IAAI,IAAI"}
|