@scalar/workspace-store 0.20.0 → 0.22.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 +58 -0
- package/README.md +2 -2
- package/dist/client.d.ts +54 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +66 -29
- package/dist/client.js.map +2 -2
- package/dist/events/bus.d.ts +14 -2
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +46 -10
- package/dist/events/bus.js.map +3 -3
- package/dist/events/definitions/auth.d.ts +2 -1
- package/dist/events/definitions/auth.d.ts.map +1 -1
- package/dist/events/definitions/cookie.d.ts +20 -0
- package/dist/events/definitions/cookie.d.ts.map +1 -0
- package/dist/events/definitions/cookie.js +1 -0
- package/dist/events/definitions/cookie.js.map +7 -0
- package/dist/events/definitions/document.d.ts +19 -2
- package/dist/events/definitions/document.d.ts.map +1 -1
- package/dist/events/definitions/index.d.ts +6 -1
- package/dist/events/definitions/index.d.ts.map +1 -1
- package/dist/events/definitions/operation.d.ts +20 -14
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/server.d.ts +2 -2
- package/dist/events/definitions/server.d.ts.map +1 -1
- package/dist/events/definitions/tabs.d.ts +55 -0
- package/dist/events/definitions/tabs.d.ts.map +1 -0
- package/dist/events/definitions/tabs.js +1 -0
- package/dist/events/definitions/tabs.js.map +7 -0
- package/dist/events/definitions/tag.d.ts +15 -0
- package/dist/events/definitions/tag.d.ts.map +1 -0
- package/dist/events/definitions/tag.js +1 -0
- package/dist/events/definitions/tag.js.map +7 -0
- package/dist/events/definitions/ui.d.ts +131 -39
- package/dist/events/definitions/ui.d.ts.map +1 -1
- package/dist/events/definitions/workspace.d.ts +18 -0
- package/dist/events/definitions/workspace.d.ts.map +1 -0
- package/dist/events/definitions/workspace.js +1 -0
- package/dist/events/definitions/workspace.js.map +7 -0
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js.map +2 -2
- package/dist/helpers/generate-unique-value.d.ts +19 -6
- package/dist/helpers/generate-unique-value.d.ts.map +1 -1
- package/dist/helpers/generate-unique-value.js +12 -7
- package/dist/helpers/generate-unique-value.js.map +2 -2
- package/dist/helpers/unpack-proxy.d.ts +14 -1
- package/dist/helpers/unpack-proxy.d.ts.map +1 -1
- package/dist/helpers/unpack-proxy.js +51 -1
- package/dist/helpers/unpack-proxy.js.map +3 -3
- package/dist/mutators/auth.d.ts +7 -2
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +24 -21
- package/dist/mutators/auth.js.map +2 -2
- package/dist/mutators/cookie.d.ts +21 -13
- package/dist/mutators/cookie.d.ts.map +1 -1
- package/dist/mutators/cookie.js +34 -26
- package/dist/mutators/cookie.js.map +3 -3
- package/dist/mutators/document.d.ts +12 -2
- package/dist/mutators/document.d.ts.map +1 -1
- package/dist/mutators/document.js +42 -3
- package/dist/mutators/document.js.map +2 -2
- package/dist/mutators/index.d.ts +30 -20
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/index.js +38 -9
- package/dist/mutators/index.js.map +2 -2
- package/dist/mutators/operation.d.ts +49 -108
- package/dist/mutators/operation.d.ts.map +1 -1
- package/dist/mutators/operation.js +198 -94
- package/dist/mutators/operation.js.map +2 -2
- package/dist/mutators/request.d.ts +2 -1
- package/dist/mutators/request.d.ts.map +1 -1
- package/dist/mutators/request.js.map +1 -1
- package/dist/mutators/server.d.ts +1 -1
- package/dist/mutators/server.d.ts.map +1 -1
- package/dist/mutators/server.js +6 -5
- package/dist/mutators/server.js.map +2 -2
- package/dist/mutators/tabs.d.ts +44 -0
- package/dist/mutators/tabs.d.ts.map +1 -0
- package/dist/mutators/tabs.js +133 -0
- package/dist/mutators/tabs.js.map +7 -0
- package/dist/mutators/tag.d.ts +12 -0
- package/dist/mutators/tag.d.ts.map +1 -0
- package/dist/mutators/tag.js +19 -0
- package/dist/mutators/tag.js.map +7 -0
- package/dist/mutators/workspace.d.ts +6 -0
- package/dist/mutators/workspace.d.ts.map +1 -0
- package/dist/mutators/workspace.js +24 -0
- package/dist/mutators/workspace.js.map +7 -0
- package/dist/navigation/get-navigation-options.d.ts.map +1 -1
- package/dist/navigation/get-navigation-options.js +4 -4
- package/dist/navigation/get-navigation-options.js.map +2 -2
- package/dist/navigation/helpers/get-openapi-object.d.ts +35 -0
- package/dist/navigation/helpers/get-openapi-object.d.ts.map +1 -0
- package/dist/navigation/helpers/get-openapi-object.js +31 -0
- package/dist/navigation/helpers/get-openapi-object.js.map +7 -0
- package/dist/navigation/helpers/get-operation-entries.d.ts +24 -0
- package/dist/navigation/helpers/get-operation-entries.d.ts.map +1 -0
- package/dist/navigation/helpers/get-operation-entries.js +33 -0
- package/dist/navigation/helpers/get-operation-entries.js.map +7 -0
- package/dist/navigation/helpers/get-parent-entry.d.ts +15 -0
- package/dist/navigation/helpers/get-parent-entry.d.ts.map +1 -0
- package/dist/navigation/helpers/get-parent-entry.js +13 -0
- package/dist/navigation/helpers/get-parent-entry.js.map +7 -0
- package/dist/navigation/helpers/traverse-description.d.ts +0 -1
- package/dist/navigation/helpers/traverse-description.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-description.js +0 -1
- package/dist/navigation/helpers/traverse-description.js.map +2 -2
- package/dist/navigation/helpers/traverse-document.d.ts +1 -0
- package/dist/navigation/helpers/traverse-document.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-document.js +16 -2
- package/dist/navigation/helpers/traverse-document.js.map +2 -2
- package/dist/navigation/helpers/traverse-examples.js +2 -2
- package/dist/navigation/helpers/traverse-examples.js.map +2 -2
- package/dist/navigation/helpers/traverse-paths.d.ts +6 -3
- package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-paths.js +5 -10
- package/dist/navigation/helpers/traverse-paths.js.map +2 -2
- package/dist/navigation/helpers/traverse-tags.d.ts +0 -1
- package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-tags.js +57 -49
- package/dist/navigation/helpers/traverse-tags.js.map +3 -3
- package/dist/navigation/helpers/utils.d.ts +2 -1
- package/dist/navigation/helpers/utils.d.ts.map +1 -1
- package/dist/navigation/helpers/utils.js.map +1 -1
- package/dist/navigation/index.d.ts +2 -1
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +5 -3
- package/dist/navigation/index.js.map +2 -2
- package/dist/persistence/index.d.ts +6 -0
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +18 -0
- package/dist/persistence/index.js.map +2 -2
- package/dist/persistence/indexdb.d.ts +1 -0
- package/dist/persistence/indexdb.d.ts.map +1 -1
- package/dist/persistence/indexdb.js +6 -1
- package/dist/persistence/indexdb.js.map +2 -2
- package/dist/plugins/client/persistence.d.ts.map +1 -1
- package/dist/plugins/client/persistence.js +6 -0
- package/dist/plugins/client/persistence.js.map +2 -2
- package/dist/schemas/extensions/document/x-scalar-environments.d.ts +1 -0
- package/dist/schemas/extensions/document/x-scalar-environments.d.ts.map +1 -1
- package/dist/schemas/extensions/document/x-scalar-environments.js.map +2 -2
- package/dist/schemas/extensions/document/x-scalar-set-operation-security.d.ts +13 -0
- package/dist/schemas/extensions/document/x-scalar-set-operation-security.d.ts.map +1 -0
- package/dist/schemas/extensions/document/x-scalar-set-operation-security.js +8 -0
- package/dist/schemas/extensions/document/x-scalar-set-operation-security.js.map +7 -0
- package/dist/schemas/extensions/general/x-scalar-cookies.d.ts +36 -0
- package/dist/schemas/extensions/general/x-scalar-cookies.d.ts.map +1 -0
- package/dist/schemas/extensions/general/x-scalar-cookies.js +15 -0
- package/dist/schemas/extensions/general/x-scalar-cookies.js.map +7 -0
- package/dist/schemas/extensions/general/x-scalar-order.d.ts +12 -0
- package/dist/schemas/extensions/general/x-scalar-order.d.ts.map +1 -0
- package/dist/schemas/extensions/general/x-scalar-order.js +8 -0
- package/dist/schemas/extensions/general/x-scalar-order.js.map +7 -0
- package/dist/schemas/extensions/operation/index.d.ts +4 -1
- package/dist/schemas/extensions/operation/index.d.ts.map +1 -1
- package/dist/schemas/extensions/operation/index.js +22 -0
- package/dist/schemas/extensions/operation/index.js.map +3 -3
- package/dist/schemas/extensions/operation/x-code-samples.d.ts +0 -5
- package/dist/schemas/extensions/operation/x-code-samples.d.ts.map +1 -1
- package/dist/schemas/extensions/operation/x-code-samples.js +0 -1
- package/dist/schemas/extensions/operation/x-code-samples.js.map +2 -2
- package/dist/schemas/extensions/operation/x-post-response.d.ts +0 -18
- package/dist/schemas/extensions/operation/x-post-response.d.ts.map +1 -1
- package/dist/schemas/extensions/operation/x-post-response.js.map +1 -1
- package/dist/schemas/extensions/tag/x-tag-groups.d.ts +8 -14
- package/dist/schemas/extensions/tag/x-tag-groups.d.ts.map +1 -1
- package/dist/schemas/extensions/tag/x-tag-groups.js +15 -11
- package/dist/schemas/extensions/tag/x-tag-groups.js.map +2 -2
- package/dist/schemas/extensions/workspace/index.d.ts +4 -0
- package/dist/schemas/extensions/workspace/index.d.ts.map +1 -0
- package/dist/schemas/extensions/workspace/index.js +15 -0
- package/dist/schemas/extensions/workspace/index.js.map +7 -0
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.d.ts +18 -0
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.d.ts.map +1 -0
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js +8 -0
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js.map +7 -0
- package/dist/schemas/extensions/workspace/x-scalar-tabs.d.ts +36 -0
- package/dist/schemas/extensions/workspace/x-scalar-tabs.d.ts.map +1 -0
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js +16 -0
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js.map +7 -0
- package/dist/schemas/extensions.d.ts +1 -1
- package/dist/schemas/extensions.js +1 -1
- package/dist/schemas/extensions.js.map +2 -2
- package/dist/schemas/inmemory-workspace.d.ts +46 -33
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/navigation.d.ts +12 -1
- package/dist/schemas/navigation.d.ts.map +1 -1
- package/dist/schemas/navigation.js +2 -1
- package/dist/schemas/navigation.js.map +2 -2
- package/dist/schemas/reference-config/index.d.ts +22 -16
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +22 -16
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.js +2 -0
- package/dist/schemas/reference-config/settings.js.map +2 -2
- package/dist/schemas/v3.1/strict/header.d.ts +0 -45
- package/dist/schemas/v3.1/strict/header.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/header.js +1 -3
- package/dist/schemas/v3.1/strict/header.js.map +2 -2
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts +0 -99
- package/dist/schemas/v3.1/strict/oauth-flow.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/oauth-flow.js +0 -7
- package/dist/schemas/v3.1/strict/oauth-flow.js.map +2 -2
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +756 -552
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +10 -11
- package/dist/schemas/v3.1/strict/openapi-document.js.map +2 -2
- package/dist/schemas/v3.1/strict/operation.d.ts +1 -5
- package/dist/schemas/v3.1/strict/operation.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/operation.js +1 -5
- package/dist/schemas/v3.1/strict/operation.js.map +2 -2
- package/dist/schemas/v3.1/strict/parameter.d.ts +1 -101
- package/dist/schemas/v3.1/strict/parameter.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/parameter.js +1 -4
- package/dist/schemas/v3.1/strict/parameter.js.map +2 -2
- package/dist/schemas/v3.1/strict/ref-definitions.d.ts +0 -1
- package/dist/schemas/v3.1/strict/ref-definitions.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/ref-definitions.js +0 -2
- package/dist/schemas/v3.1/strict/ref-definitions.js.map +2 -2
- package/dist/schemas/v3.1/strict/schema.d.ts +28 -11
- package/dist/schemas/v3.1/strict/schema.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/schema.js +2 -2
- package/dist/schemas/v3.1/strict/schema.js.map +2 -2
- package/dist/schemas/v3.1/strict/security-scheme.d.ts +1 -54
- package/dist/schemas/v3.1/strict/security-scheme.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/security-scheme.js +0 -5
- package/dist/schemas/v3.1/strict/security-scheme.js.map +2 -2
- package/dist/schemas/v3.1/strict/tag.d.ts +4 -1
- package/dist/schemas/v3.1/strict/tag.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/tag.js +3 -1
- package/dist/schemas/v3.1/strict/tag.js.map +2 -2
- package/dist/schemas/v3.1/strict/type-guards.d.ts +6 -0
- package/dist/schemas/v3.1/strict/type-guards.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/type-guards.js +4 -0
- package/dist/schemas/v3.1/strict/type-guards.js.map +2 -2
- package/dist/schemas/workspace-specification/config.d.ts +22 -16
- package/dist/schemas/workspace-specification/config.d.ts.map +1 -1
- package/dist/schemas/workspace-specification/index.d.ts +23 -17
- package/dist/schemas/workspace-specification/index.d.ts.map +1 -1
- package/dist/schemas/workspace.d.ts +204 -130
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/schemas/workspace.js +18 -11
- package/dist/schemas/workspace.js.map +2 -2
- package/dist/server.d.ts +1 -1
- package/dist/workspace-plugin.d.ts +3 -0
- package/dist/workspace-plugin.d.ts.map +1 -1
- package/package.json +50 -35
- package/dist/schemas/extensions/document/x-scalar-document-security.d.ts +0 -13
- package/dist/schemas/extensions/document/x-scalar-document-security.d.ts.map +0 -1
- package/dist/schemas/extensions/document/x-scalar-document-security.js +0 -8
- package/dist/schemas/extensions/document/x-scalar-document-security.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.d.ts +0 -13
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.d.ts.map +0 -1
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.js +0 -9
- package/dist/schemas/extensions/operation/x-scalar-operation-identifiers.js.map +0 -7
- package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.d.ts +0 -32
- package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.d.ts.map +0 -1
- package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.js +0 -13
- package/dist/schemas/v3.1/strict/client-config-extensions/x-scalar-client-config-cookies.js.map +0 -7
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { EnvironmentEvents } from '../../events/definitions/environment.js';
|
|
2
|
+
import type { TabEvents } from '../../events/definitions/tabs.js';
|
|
3
|
+
import type { TagEvents } from '../../events/definitions/tag.js';
|
|
4
|
+
import type { WorkspaceEvents } from '../../events/definitions/workspace.js';
|
|
2
5
|
import type { AnalyticsEvents } from './analytics.js';
|
|
3
6
|
import type { AuthEvents } from './auth.js';
|
|
7
|
+
import type { CookieEvents } from './cookie.js';
|
|
4
8
|
import type { DocumentEvents } from './document.js';
|
|
5
9
|
import type { MetaEvents } from './meta.js';
|
|
6
10
|
import type { OperationEvents } from './operation.js';
|
|
7
11
|
import type { ServerEvents } from './server.js';
|
|
8
12
|
import type { UIEvents } from './ui.js';
|
|
9
|
-
export type ApiReferenceEvents = AuthEvents & AnalyticsEvents & DocumentEvents & EnvironmentEvents & MetaEvents & OperationEvents & ServerEvents & UIEvents;
|
|
13
|
+
export type ApiReferenceEvents = AuthEvents & AnalyticsEvents & CookieEvents & WorkspaceEvents & DocumentEvents & EnvironmentEvents & MetaEvents & OperationEvents & ServerEvents & TabEvents & UIEvents & TagEvents;
|
|
10
14
|
export type { CollectionType } from './common.js';
|
|
15
|
+
export type { CommandPaletteAction } from './ui.js';
|
|
11
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GACzC,eAAe,GACf,YAAY,GACZ,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,UAAU,GACV,eAAe,GACf,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,SAAS,CAAA;AAEX,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,YAAY,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAA"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { OperationExampleMeta, OperationMeta } from '../../mutators/index.js';
|
|
3
|
+
import type { OperationObject } from '../../schemas/v3.1/strict/operation.js';
|
|
3
4
|
/** Event definitions for the operation */
|
|
4
5
|
export type OperationEvents = {
|
|
5
|
-
/**
|
|
6
|
-
* Update the selected example for the operation
|
|
7
|
-
*/
|
|
8
|
-
'update:selected-example': {
|
|
9
|
-
/** The name of the example to select */
|
|
10
|
-
name: string;
|
|
11
|
-
};
|
|
12
|
-
/** ------------------------------------------------------------------------------------------------
|
|
13
|
-
* Operation Actions
|
|
14
|
-
* ------------------------------------------------------------------------------------------------ */
|
|
15
6
|
/**
|
|
16
7
|
* Fires when the user requests to send the operation (e.g., triggers "Try It" or sends a request).
|
|
17
8
|
* Contains the OperationExampleMeta, which identifies the operation and the example variant to use.
|
|
@@ -19,9 +10,24 @@ export type OperationEvents = {
|
|
|
19
10
|
'operation:send:request': {
|
|
20
11
|
meta: OperationExampleMeta;
|
|
21
12
|
};
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
13
|
+
/**
|
|
14
|
+
* Create a new operation at a specific path and method in the document.
|
|
15
|
+
* Triggers when the user creates a new endpoint via the command palette or other UI.
|
|
16
|
+
*/
|
|
17
|
+
'operation:create:operation': {
|
|
18
|
+
/** The document name where the operation should be created */
|
|
19
|
+
documentName: string;
|
|
20
|
+
/** The example key for the new operation */
|
|
21
|
+
exampleKey?: string;
|
|
22
|
+
/** The path for the new operation (will be normalized to start with /) */
|
|
23
|
+
path: string;
|
|
24
|
+
/** The HTTP method for the operation */
|
|
25
|
+
method: HttpMethod;
|
|
26
|
+
/** The operation object to create */
|
|
27
|
+
operation: OperationObject;
|
|
28
|
+
/** The callback to call when the operation is created */
|
|
29
|
+
callback?: (success: boolean) => void;
|
|
30
|
+
};
|
|
25
31
|
/**
|
|
26
32
|
* Update the summary for the operation.
|
|
27
33
|
* Triggers when the user edits the summary/description for an endpoint.
|
|
@@ -45,7 +51,7 @@ export type OperationEvents = {
|
|
|
45
51
|
method: HttpMethod;
|
|
46
52
|
};
|
|
47
53
|
/** Identifies the target operation by original method and path */
|
|
48
|
-
meta:
|
|
54
|
+
meta: OperationExampleMeta;
|
|
49
55
|
};
|
|
50
56
|
/**
|
|
51
57
|
* Update the path for the operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEtE,0CAA0C;AAC1C,MAAM,MAAM,eAAe,GAAG;IAK5B;;;OAGG;IACH,wBAAwB,EAAE;QACxB,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAMD;;;OAGG;IACH,4BAA4B,EAAE;QAC5B,8DAA8D;QAC9D,YAAY,EAAE,MAAM,CAAA;QACpB,4CAA4C;QAC5C,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,0EAA0E;QAC1E,IAAI,EAAE,MAAM,CAAA;QACZ,wCAAwC;QACxC,MAAM,EAAE,UAAU,CAAA;QAClB,qCAAqC;QACrC,SAAS,EAAE,eAAe,CAAA;QAC1B,yDAAyD;QACzD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;KACtC,CAAA;IAED;;;;OAIG;IACH,0BAA0B,EAAE;QAC1B,uDAAuD;QACvD,OAAO,EAAE;YACP,OAAO,EAAE,MAAM,CAAA;SAChB,CAAA;QACD,kFAAkF;QAClF,IAAI,EAAE,aAAa,CAAA;KACpB,CAAA;IAED;;;OAGG;IACH,yBAAyB,EAAE;QACzB,OAAO,EAAE;YACP,uCAAuC;YACvC,MAAM,EAAE,UAAU,CAAA;SACnB,CAAA;QACD,kEAAkE;QAClE,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;;;OAKG;IACH,uBAAuB,EAAE;QACvB,OAAO,EAAE;YACP,qCAAqC;YACrC,IAAI,EAAE,MAAM,CAAA;SACb,CAAA;QACD,kEAAkE;QAClE,IAAI,EAAE,aAAa,CAAA;KACpB,CAAA;IAED;;0GAEsG;IACtG;;OAEG;IACH,yBAAyB,EAAE;QACzB;;WAEG;QACH,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAC5C;;WAEG;QACH,OAAO,EAAE;YACP,uCAAuC;YACvC,GAAG,EAAE,MAAM,CAAA;YACX,iDAAiD;YACjD,KAAK,EAAE,MAAM,CAAA;YACb,uCAAuC;YACvC,SAAS,EAAE,OAAO,CAAA;SACnB,CAAA;QACD,kFAAkF;QAClF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,4BAA4B,EAAE;QAC5B;;WAEG;QACH,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAC5C;;WAEG;QACH,KAAK,EAAE,MAAM,CAAA;QACb;;;;;WAKG;QACH,OAAO,EAAE,OAAO,CAAC;YACf,GAAG,EAAE,MAAM,CAAA;YACX,KAAK,EAAE,MAAM,CAAA;YACb,SAAS,EAAE,OAAO,CAAA;SACnB,CAAC,CAAA;QACF;;WAEG;QACH,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,4BAA4B,EAAE;QAC5B,0FAA0F;QAC1F,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAC5C,kGAAkG;QAClG,KAAK,EAAE,MAAM,CAAA;QACb,qFAAqF;QACrF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,iCAAiC,EAAE;QACjC,2FAA2F;QAC3F,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;QAC5C,kEAAkE;QAClE,IAAI,EAAE,aAAa,CAAA;KACpB,CAAA;IAKD;;;OAGG;IACH,0CAA0C,EAAE;QAC1C,OAAO,EAAE;YACP,gDAAgD;YAChD,WAAW,EAAE,MAAM,CAAA;SACpB,CAAA;QACD,uFAAuF;QACvF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,oCAAoC,EAAE;QACpC,OAAO,EAAE;YACP,iDAAiD;YACjD,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;SACjC,CAAA;QACD,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,6FAA6F;QAC7F,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,mCAAmC,EAAE;QACnC,qEAAqE;QACrE,OAAO,EAAE,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC,CAAA;QACvD,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,sFAAsF;QACtF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,sCAAsC,EAAE;QACtC,gFAAgF;QAChF,KAAK,EAAE,MAAM,CAAA;QACb,wEAAwE;QACxE,OAAO,EAAE,OAAO,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;SAAE,CAAC,CAAA;QAC/D,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,wFAAwF;QACxF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;IAED;;;OAGG;IACH,sCAAsC,EAAE;QACtC,gFAAgF;QAChF,KAAK,EAAE,MAAM,CAAA;QACb,2CAA2C;QAC3C,WAAW,EAAE,MAAM,CAAA;QACnB,wFAAwF;QACxF,IAAI,EAAE,oBAAoB,CAAA;KAC3B,CAAA;CACF,CAAA"}
|
|
@@ -35,8 +35,8 @@ export type ServerEvents = {
|
|
|
35
35
|
* Update the selected server for the document
|
|
36
36
|
*/
|
|
37
37
|
'server:update:selected': {
|
|
38
|
-
/** The
|
|
39
|
-
|
|
38
|
+
/** The URL of the server to select */
|
|
39
|
+
url: string;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAE1E,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,mBAAmB,EAAE,SAAS,CAAA;IAC9B;;OAEG;IACH,sBAAsB,EAAE;QACtB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;QACb,uCAAuC;QACvC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;KAC9B,CAAA;IACD;;OAEG;IACH,sBAAsB,EAAE;QACtB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;OAEG;IACH,yBAAyB,EAAE;QACzB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;QACb,wCAAwC;QACxC,GAAG,EAAE,MAAM,CAAA;QACX,oCAAoC;QACpC,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;OAEG;IACH,wBAAwB,EAAE;QACxB,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAE1E,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,mBAAmB,EAAE,SAAS,CAAA;IAC9B;;OAEG;IACH,sBAAsB,EAAE;QACtB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;QACb,uCAAuC;QACvC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;KAC9B,CAAA;IACD;;OAEG;IACH,sBAAsB,EAAE;QACtB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;OAEG;IACH,yBAAyB,EAAE;QACzB,wCAAwC;QACxC,KAAK,EAAE,MAAM,CAAA;QACb,wCAAwC;QACxC,GAAG,EAAE,MAAM,CAAA;QACX,oCAAoC;QACpC,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD;;OAEG;IACH,wBAAwB,EAAE;QACxB,sCAAsC;QACtC,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { XScalarTabs } from '../../schemas/extensions/workspace/x-scalar-tabs.js';
|
|
2
|
+
/** Event definitions to control the tabs */
|
|
3
|
+
export type TabEvents = {
|
|
4
|
+
/**
|
|
5
|
+
* Update the tabs of the workspace
|
|
6
|
+
*/
|
|
7
|
+
'tabs:update:tabs': XScalarTabs;
|
|
8
|
+
/**
|
|
9
|
+
* Add a new tab
|
|
10
|
+
*/
|
|
11
|
+
'tabs:add:tab': {
|
|
12
|
+
event: KeyboardEvent;
|
|
13
|
+
} | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Closes the current tab
|
|
16
|
+
*/
|
|
17
|
+
'tabs:close:tab': {
|
|
18
|
+
event: KeyboardEvent;
|
|
19
|
+
} | {
|
|
20
|
+
index: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Closes all other tabs except the one at the given index
|
|
24
|
+
*/
|
|
25
|
+
'tabs:close:other-tabs': {
|
|
26
|
+
index: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Navigates to the previous tab
|
|
30
|
+
*/
|
|
31
|
+
'tabs:navigate:previous': {
|
|
32
|
+
event: KeyboardEvent;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Navigates to the next tab
|
|
36
|
+
*/
|
|
37
|
+
'tabs:navigate:next': {
|
|
38
|
+
event: KeyboardEvent;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Jumps to a specific tab, we can grab the number from the keyboard event
|
|
42
|
+
*/
|
|
43
|
+
'tabs:focus:tab': {
|
|
44
|
+
event: KeyboardEvent;
|
|
45
|
+
} | {
|
|
46
|
+
index: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Focuses the last tab
|
|
50
|
+
*/
|
|
51
|
+
'tabs:focus:tab-last': {
|
|
52
|
+
event: KeyboardEvent;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAA;AAE/E,4CAA4C;AAC5C,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,kBAAkB,EAAE,WAAW,CAAA;IAC/B;;OAEG;IACH,cAAc,EACV;QACE,KAAK,EAAE,aAAa,CAAA;KACrB,GACD,SAAS,CAAA;IACb;;OAEG;IACH,gBAAgB,EAAE;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9D;;OAEG;IACH,uBAAuB,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC1C;;OAEG;IACH,wBAAwB,EAAE;QACxB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,oBAAoB,EAAE;QACpB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;IACD;;OAEG;IACH,gBAAgB,EAAE;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9D;;OAEG;IACH,qBAAqB,EAAE;QACrB,KAAK,EAAE,aAAa,CAAA;KACrB,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Event definitions for all things tag related */
|
|
2
|
+
export type TagEvents = {
|
|
3
|
+
/**
|
|
4
|
+
* Create a tag
|
|
5
|
+
*/
|
|
6
|
+
'tag:create:tag': {
|
|
7
|
+
/** The name of the tag to create */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The name of the document to add the tag to */
|
|
10
|
+
documentName: string;
|
|
11
|
+
/** The callback to call when the tag is created */
|
|
12
|
+
callback?: (success: boolean) => void;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/tag.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,gBAAgB,EAAE;QAChB,oCAAoC;QACpC,IAAI,EAAE,MAAM,CAAA;QACZ,iDAAiD;QACjD,YAAY,EAAE,MAAM,CAAA;QACpB,mDAAmD;QACnD,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;KACtC,CAAA;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -1,57 +1,149 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Available actions that can be triggered from the command palette.
|
|
4
|
+
* Each action may have an associated payload type.
|
|
5
|
+
*/
|
|
6
|
+
type CommandPalettePayload = {
|
|
7
|
+
/** Trigger the import flow for OpenAPI, Swagger, Postman, or cURL */
|
|
8
|
+
'import-from-openapi-swagger-postman-curl': undefined;
|
|
9
|
+
/** Create a new document in the workspace */
|
|
10
|
+
'create-document': undefined;
|
|
11
|
+
/** Add a new tag to organize requests */
|
|
12
|
+
'add-tag': undefined;
|
|
13
|
+
/** Create a new HTTP request */
|
|
14
|
+
'create-request': undefined;
|
|
15
|
+
/** Add a new example to an existing request */
|
|
16
|
+
'add-example': undefined;
|
|
17
|
+
/** Import a request from a cURL command string */
|
|
18
|
+
'import-curl-command': {
|
|
19
|
+
/** The cURL command string to parse and import */
|
|
20
|
+
curl: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Type-safe command palette action with correlated action and payload.
|
|
25
|
+
* This ensures that when an action is dispatched, it must include the correct payload type.
|
|
26
|
+
*
|
|
27
|
+
* Example:
|
|
28
|
+
* - { action: 'create-document', payload: undefined }
|
|
29
|
+
* - { action: 'import-curl-command', payload: { curl: 'curl ...' } }
|
|
30
|
+
*/
|
|
31
|
+
export type CommandPaletteAction<K extends keyof CommandPalettePayload = keyof CommandPalettePayload> = {
|
|
32
|
+
/** The action to perform */
|
|
33
|
+
action: K;
|
|
34
|
+
/** The payload for this action, typed based on the action */
|
|
35
|
+
payload: CommandPalettePayload[K];
|
|
36
|
+
/** Optional keyboard event that triggered this action */
|
|
37
|
+
event?: KeyboardEvent;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Common payload for keyboard-triggered events.
|
|
41
|
+
* Used when we need to track the original keyboard event for things like
|
|
42
|
+
* preventing default behavior or stopping propagation.
|
|
43
|
+
*/
|
|
44
|
+
type KeyboardEventPayload = {
|
|
45
|
+
/** The keyboard event that triggered this action */
|
|
46
|
+
event: KeyboardEvent;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Common payload for navigation item operations.
|
|
50
|
+
* Navigation items include tags, operations, folders, etc. in the sidebar.
|
|
51
|
+
*/
|
|
52
|
+
type NavigationItemPayload = {
|
|
53
|
+
/** The unique identifier of the navigation item */
|
|
54
|
+
id: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Event definitions for controlling the UI.
|
|
58
|
+
* These events are dispatched through the event bus to trigger UI actions
|
|
59
|
+
* across different components without tight coupling.
|
|
60
|
+
*/
|
|
3
61
|
export type UIEvents = {
|
|
4
62
|
/**
|
|
5
|
-
* Download the document from the store
|
|
63
|
+
* Download the OpenAPI document from the store.
|
|
64
|
+
* Supports multiple export formats for different use cases.
|
|
6
65
|
*/
|
|
7
|
-
'download:document': {
|
|
66
|
+
'ui:download:document': {
|
|
8
67
|
/** Format to download the document in */
|
|
9
68
|
format: 'json' | 'yaml' | 'direct';
|
|
10
69
|
};
|
|
11
70
|
/**
|
|
12
|
-
*
|
|
71
|
+
* Focus the address bar input field.
|
|
72
|
+
* Typically triggered by keyboard shortcuts for quick navigation.
|
|
73
|
+
*/
|
|
74
|
+
'ui:focus:address-bar': KeyboardEventPayload;
|
|
75
|
+
/**
|
|
76
|
+
* Focus the send button to execute a request.
|
|
77
|
+
* Useful for keyboard-driven workflows.
|
|
78
|
+
*/
|
|
79
|
+
'ui:focus:send-button': KeyboardEventPayload;
|
|
80
|
+
/**
|
|
81
|
+
* Focus the search input in the sidebar.
|
|
82
|
+
* Allows quick filtering of requests and tags.
|
|
13
83
|
*/
|
|
14
|
-
'
|
|
15
|
-
|
|
84
|
+
'ui:focus:search': KeyboardEventPayload;
|
|
85
|
+
/**
|
|
86
|
+
* Toggle the sidebar visibility.
|
|
87
|
+
* Useful for maximizing content area on smaller screens.
|
|
88
|
+
*/
|
|
89
|
+
'ui:toggle:sidebar': KeyboardEventPayload;
|
|
90
|
+
/**
|
|
91
|
+
* Open the API Client modal to a specific operation.
|
|
92
|
+
* This allows deep linking into specific endpoints from external sources.
|
|
93
|
+
*/
|
|
94
|
+
'ui:open:client-modal': {
|
|
95
|
+
/** The HTTP method of the operation to load (e.g., GET, POST) */
|
|
16
96
|
method: HttpMethod;
|
|
17
|
-
/** The path of the operation to load */
|
|
97
|
+
/** The path of the operation to load (e.g., /users/{id}) */
|
|
18
98
|
path: string;
|
|
99
|
+
/** Optional example name to load for this operation */
|
|
100
|
+
exampleName?: string;
|
|
19
101
|
};
|
|
20
102
|
/**
|
|
21
|
-
*
|
|
103
|
+
* Close the API Client modal.
|
|
104
|
+
* Typically triggered by escape key or clicking outside the modal.
|
|
105
|
+
*/
|
|
106
|
+
'ui:close:client-modal': KeyboardEventPayload;
|
|
107
|
+
/**
|
|
108
|
+
* Hide the modal in modal mode.
|
|
109
|
+
* Generic close action for modal display contexts.
|
|
22
110
|
*/
|
|
23
|
-
'open:command-palette': 'import' | 'addServer' | 'addCollection' | 'addTag' | 'addExample' | 'addOperation' | undefined;
|
|
24
|
-
/** Set a navigation item's (such as a tag or operation) expanded state */
|
|
25
|
-
'toggle:nav-item': {
|
|
26
|
-
/** The name of the nav item to toggle */
|
|
27
|
-
id: string;
|
|
28
|
-
/** Optional defined state for the nav item. */
|
|
29
|
-
open?: boolean;
|
|
30
|
-
};
|
|
31
|
-
/** Select a navigation item. Run on sidebar clicks where a scroll handler would typically be expected */
|
|
32
|
-
'select:nav-item': {
|
|
33
|
-
/** The id of the nav item to select */
|
|
34
|
-
id: string;
|
|
35
|
-
};
|
|
36
|
-
/** Fired when a navigation item intersects with the viewport */
|
|
37
|
-
'intersecting:nav-item': {
|
|
38
|
-
/** The id of the nav item that is intersecting */
|
|
39
|
-
id: string;
|
|
40
|
-
};
|
|
41
|
-
/** Explicity scroll to a navigation item */
|
|
42
|
-
'scroll-to:nav-item': {
|
|
43
|
-
/** The id of the nav item to scroll to */
|
|
44
|
-
id: string;
|
|
45
|
-
};
|
|
46
|
-
/** Copy the url including anchor details for a navigation item */
|
|
47
|
-
'copy-url:nav-item': {
|
|
48
|
-
/** The id of the nav item to copy the anchor url for */
|
|
49
|
-
id: string;
|
|
50
|
-
};
|
|
51
|
-
/** On modal mode hide the modal */
|
|
52
111
|
'hide:modal': undefined;
|
|
53
|
-
|
|
54
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Open the command palette.
|
|
114
|
+
* Can optionally pre-fill with a specific action to execute.
|
|
115
|
+
* If undefined is passed, opens the palette without a pre-selected action.
|
|
116
|
+
*/
|
|
117
|
+
'ui:open:command-palette': CommandPaletteAction | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Toggle a navigation item's expanded state.
|
|
120
|
+
* Used for collapsible items like tags, folders, or operation groups.
|
|
121
|
+
*/
|
|
122
|
+
'toggle:nav-item': NavigationItemPayload & {
|
|
123
|
+
/** If provided, sets the state explicitly instead of toggling */
|
|
124
|
+
open?: boolean;
|
|
55
125
|
};
|
|
126
|
+
/**
|
|
127
|
+
* Select a navigation item.
|
|
128
|
+
* Fired when clicking on a sidebar item where a scroll handler would typically be expected.
|
|
129
|
+
* This does not automatically scroll to the item.
|
|
130
|
+
*/
|
|
131
|
+
'select:nav-item': NavigationItemPayload;
|
|
132
|
+
/**
|
|
133
|
+
* Fired when a navigation item intersects with the viewport.
|
|
134
|
+
* Used for highlighting active sections in the sidebar during scrolling.
|
|
135
|
+
*/
|
|
136
|
+
'intersecting:nav-item': NavigationItemPayload;
|
|
137
|
+
/**
|
|
138
|
+
* Explicitly scroll to a navigation item in the content area.
|
|
139
|
+
* This will move the viewport to show the corresponding content.
|
|
140
|
+
*/
|
|
141
|
+
'scroll-to:nav-item': NavigationItemPayload;
|
|
142
|
+
/**
|
|
143
|
+
* Copy the URL with anchor details for a navigation item.
|
|
144
|
+
* Useful for sharing direct links to specific sections.
|
|
145
|
+
*/
|
|
146
|
+
'copy-url:nav-item': NavigationItemPayload;
|
|
56
147
|
};
|
|
148
|
+
export {};
|
|
57
149
|
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE;;;GAGG;AACH,KAAK,qBAAqB,GAAG;IAC3B,qEAAqE;IACrE,0CAA0C,EAAE,SAAS,CAAA;IACrD,6CAA6C;IAC7C,iBAAiB,EAAE,SAAS,CAAA;IAC5B,yCAAyC;IACzC,SAAS,EAAE,SAAS,CAAA;IACpB,gCAAgC;IAChC,gBAAgB,EAAE,SAAS,CAAA;IAC3B,+CAA+C;IAC/C,aAAa,EAAE,SAAS,CAAA;IACxB,kDAAkD;IAClD,qBAAqB,EAAE;QACrB,kDAAkD;QAClD,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;CACF,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,qBAAqB,GAAG,MAAM,qBAAqB,IAAI;IACtG,4BAA4B;IAC5B,MAAM,EAAE,CAAC,CAAA;IACT,6DAA6D;IAC7D,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAA;IACjC,yDAAyD;IACzD,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,KAAK,oBAAoB,GAAG;IAC1B,oDAAoD;IACpD,KAAK,EAAE,aAAa,CAAA;CACrB,CAAA;AAED;;;GAGG;AACH,KAAK,qBAAqB,GAAG;IAC3B,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG;IAKrB;;;OAGG;IACH,sBAAsB,EAAE;QACtB,yCAAyC;QACzC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAA;KACnC,CAAA;IAMD;;;OAGG;IACH,sBAAsB,EAAE,oBAAoB,CAAA;IAE5C;;;OAGG;IACH,sBAAsB,EAAE,oBAAoB,CAAA;IAE5C;;;OAGG;IACH,iBAAiB,EAAE,oBAAoB,CAAA;IAMvC;;;OAGG;IACH,mBAAmB,EAAE,oBAAoB,CAAA;IAMzC;;;OAGG;IACH,sBAAsB,EAAE;QACtB,iEAAiE;QACjE,MAAM,EAAE,UAAU,CAAA;QAClB,4DAA4D;QAC5D,IAAI,EAAE,MAAM,CAAA;QACZ,uDAAuD;QACvD,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IAED;;;OAGG;IACH,uBAAuB,EAAE,oBAAoB,CAAA;IAE7C;;;OAGG;IACH,YAAY,EAAE,SAAS,CAAA;IAMvB;;;;OAIG;IACH,yBAAyB,EAAE,oBAAoB,GAAG,SAAS,CAAA;IAM3D;;;OAGG;IACH,iBAAiB,EAAE,qBAAqB,GAAG;QACzC,iEAAiE;QACjE,IAAI,CAAC,EAAE,OAAO,CAAA;KACf,CAAA;IAED;;;;OAIG;IACH,iBAAiB,EAAE,qBAAqB,CAAA;IAExC;;;OAGG;IACH,uBAAuB,EAAE,qBAAqB,CAAA;IAE9C;;;OAGG;IACH,oBAAoB,EAAE,qBAAqB,CAAA;IAE3C;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB,CAAA;CAC3C,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ThemeId } from '@scalar/themes';
|
|
2
|
+
import type { ColorMode } from '../../schemas/workspace.js';
|
|
3
|
+
/** Event definitions for the openapi document */
|
|
4
|
+
export type WorkspaceEvents = {
|
|
5
|
+
/**
|
|
6
|
+
* Update the active proxy
|
|
7
|
+
*/
|
|
8
|
+
'workspace:update:active-proxy': string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Update the color mode of the workspace
|
|
11
|
+
*/
|
|
12
|
+
'workspace:update:color-mode': ColorMode;
|
|
13
|
+
/**
|
|
14
|
+
* Update the theme of the workspace
|
|
15
|
+
*/
|
|
16
|
+
'workspace:update:theme': ThemeId;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAEpD,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9C;;OAEG;IACH,6BAA6B,EAAE,SAAS,CAAA;IACxC;;OAEG;IACH,wBAAwB,EAAE,OAAO,CAAA;CAClC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=workspace.js.map
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type WorkspaceEventBus, createWorkspaceEventBus } from './bus.js';
|
|
2
|
-
export type { ApiReferenceEvents, CollectionType } from './definitions/index.js';
|
|
2
|
+
export type { ApiReferenceEvents, CollectionType, CommandPaletteAction } from './definitions/index.js';
|
|
3
3
|
export { onCustomEvent } from './listeners.js';
|
|
4
4
|
export { emitCustomEvent } from './old-definitions.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAA;AACvE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/events/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/events/index.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { type WorkspaceEventBus, createWorkspaceEventBus } from './bus'\nexport type { ApiReferenceEvents, CollectionType, CommandPaletteAction } from './definitions'\nexport { onCustomEvent } from './listeners'\nexport { emitCustomEvent } from './old-definitions'\n"],
|
|
5
|
+
"mappings": "AAAA,SAAiC,+BAA+B;AAEhE,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -25,16 +25,29 @@ export declare function generateUniqueValue({ defaultValue,
|
|
|
25
25
|
/** Check function to verify the uniqueness of the value */
|
|
26
26
|
validation,
|
|
27
27
|
/** Transformation function to transform the default value (such as into a slug) */
|
|
28
|
-
transformation,
|
|
28
|
+
transformation,
|
|
29
|
+
/** The maximum number of attempts to create a unique value by incrementing. */
|
|
30
|
+
maxRetries, }: {
|
|
29
31
|
/**
|
|
30
|
-
*
|
|
32
|
+
* The original value to base the unique generation upon.
|
|
33
|
+
* Example: "workspace", which may end up producing "workspace 2", "workspace 3", etc.
|
|
31
34
|
*/
|
|
32
35
|
defaultValue: string;
|
|
33
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Validation function that determines if a generated value is unique.
|
|
38
|
+
* Should return true if the value is unique; false if not.
|
|
39
|
+
* Can be asynchronous or synchronous.
|
|
40
|
+
*/
|
|
34
41
|
validation: (value: string) => Promise<boolean> | boolean;
|
|
35
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Optional function to transform the default value before attempting uniqueness.
|
|
44
|
+
* Example: Transform "Workspace A" into "workspace-a" to follow a slug schema.
|
|
45
|
+
*/
|
|
36
46
|
transformation?: (value: string) => string;
|
|
37
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* The maximum number of attempts to create a unique value by incrementing.
|
|
49
|
+
* For example, if set to 5: "foo", "foo 1", "foo 2", "foo 3", "foo 4" will be attempted.
|
|
50
|
+
*/
|
|
38
51
|
maxRetries: number;
|
|
39
|
-
}): string | undefined
|
|
52
|
+
}): Promise<string | undefined>;
|
|
40
53
|
//# sourceMappingURL=generate-unique-value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-unique-value.d.ts","sourceRoot":"","sources":["../../src/helpers/generate-unique-value.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,
|
|
1
|
+
{"version":3,"file":"generate-unique-value.d.ts","sourceRoot":"","sources":["../../src/helpers/generate-unique-value.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,YAAY;AACZ,2DAA2D;AAC3D,UAAU;AACV,mFAAmF;AACnF,cAAc;AACd,+EAA+E;AAC/E,UAAc,GACf,EAAE;IACD;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;;;OAIG;IACH,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;IAEzD;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAE1C;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,+BAaA"}
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
function generateUniqueValue({
|
|
1
|
+
async function generateUniqueValue({
|
|
2
2
|
defaultValue,
|
|
3
3
|
/** Check function to verify the uniqueness of the value */
|
|
4
4
|
validation,
|
|
5
5
|
/** Transformation function to transform the default value (such as into a slug) */
|
|
6
6
|
transformation,
|
|
7
|
+
/** The maximum number of attempts to create a unique value by incrementing. */
|
|
7
8
|
maxRetries = 5
|
|
8
9
|
}) {
|
|
9
10
|
const transformed = transformation?.(defaultValue) ?? defaultValue;
|
|
10
|
-
if (validation(transformed)) {
|
|
11
|
+
if (await validation(transformed)) {
|
|
11
12
|
return transformed;
|
|
12
13
|
}
|
|
13
14
|
return incrementValue({
|
|
14
15
|
value: [transformed, 1],
|
|
15
16
|
validation,
|
|
16
|
-
maxRetries
|
|
17
|
+
maxRetries,
|
|
18
|
+
transformation
|
|
17
19
|
});
|
|
18
20
|
}
|
|
19
|
-
function incrementValue({
|
|
21
|
+
async function incrementValue({
|
|
20
22
|
value,
|
|
21
23
|
validation,
|
|
22
24
|
maxRetries,
|
|
23
|
-
attempts = 0
|
|
25
|
+
attempts = 0,
|
|
26
|
+
transformation
|
|
24
27
|
}) {
|
|
25
28
|
if (attempts >= maxRetries) {
|
|
26
29
|
return;
|
|
27
30
|
}
|
|
28
31
|
const incremented = value.join(" ");
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
const transformed = transformation?.(incremented) ?? incremented;
|
|
33
|
+
if (await validation(transformed)) {
|
|
34
|
+
return transformed;
|
|
31
35
|
}
|
|
32
36
|
return incrementValue({
|
|
33
37
|
value: [value[0], value[1] + 1],
|
|
34
38
|
validation,
|
|
35
39
|
maxRetries,
|
|
40
|
+
transformation,
|
|
36
41
|
attempts: attempts + 1
|
|
37
42
|
});
|
|
38
43
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers/generate-unique-value.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Generates a unique value based on a given default value and a validation function.\n *\n * The process works as follows:\n * 1. Optionally transform (e.g., slugify) the default value using a transformation function.\n * 2. Check if this value is unique by executing the provided validation function.\n * 3. If not unique, repeatedly append an incrementing integer (e.g., \"my-name 1\", \"my-name 2\", ...) and re-check uniqueness,\n * up to a maximum number of attempts (maxRetries).\n * 4. Returns the first unique value found or undefined if a unique value cannot be generated within the maximum retries.\n *\n * Example:\n * ```ts\n * // Existing names in use\n * const existing = new Set(['foo', 'foo 1', 'foo 2']);\n * const uniqueName = generateUniqueValue({\n * defaultValue: 'foo',\n * validation: (value) => !existing.has(value),\n * // transformation is optional, e.g. (val) => val.toLowerCase().replace(/[^\\w]+/g, '-'),\n * maxRetries: 10,\n * });\n * // uniqueName === 'foo 3'\n * ```\n */\nexport function generateUniqueValue({\n defaultValue,\n /** Check function to verify the uniqueness of the value */\n validation,\n /** Transformation function to transform the default value (such as into a slug) */\n transformation,\n maxRetries = 5,\n}: {\n /**\n *
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/**\n * Generates a unique value based on a given default value and a validation function.\n *\n * The process works as follows:\n * 1. Optionally transform (e.g., slugify) the default value using a transformation function.\n * 2. Check if this value is unique by executing the provided validation function.\n * 3. If not unique, repeatedly append an incrementing integer (e.g., \"my-name 1\", \"my-name 2\", ...) and re-check uniqueness,\n * up to a maximum number of attempts (maxRetries).\n * 4. Returns the first unique value found or undefined if a unique value cannot be generated within the maximum retries.\n *\n * Example:\n * ```ts\n * // Existing names in use\n * const existing = new Set(['foo', 'foo 1', 'foo 2']);\n * const uniqueName = generateUniqueValue({\n * defaultValue: 'foo',\n * validation: (value) => !existing.has(value),\n * // transformation is optional, e.g. (val) => val.toLowerCase().replace(/[^\\w]+/g, '-'),\n * maxRetries: 10,\n * });\n * // uniqueName === 'foo 3'\n * ```\n */\nexport async function generateUniqueValue({\n defaultValue,\n /** Check function to verify the uniqueness of the value */\n validation,\n /** Transformation function to transform the default value (such as into a slug) */\n transformation,\n /** The maximum number of attempts to create a unique value by incrementing. */\n maxRetries = 5,\n}: {\n /**\n * The original value to base the unique generation upon.\n * Example: \"workspace\", which may end up producing \"workspace 2\", \"workspace 3\", etc.\n */\n defaultValue: string\n\n /**\n * Validation function that determines if a generated value is unique.\n * Should return true if the value is unique; false if not.\n * Can be asynchronous or synchronous.\n */\n validation: (value: string) => Promise<boolean> | boolean\n\n /**\n * Optional function to transform the default value before attempting uniqueness.\n * Example: Transform \"Workspace A\" into \"workspace-a\" to follow a slug schema.\n */\n transformation?: (value: string) => string\n\n /**\n * The maximum number of attempts to create a unique value by incrementing.\n * For example, if set to 5: \"foo\", \"foo 1\", \"foo 2\", \"foo 3\", \"foo 4\" will be attempted.\n */\n maxRetries: number\n}) {\n const transformed = transformation?.(defaultValue) ?? defaultValue\n\n if (await validation(transformed)) {\n return transformed\n }\n\n return incrementValue({\n value: [transformed, 1],\n validation,\n maxRetries,\n transformation,\n })\n}\n\n/**\n * Attempts to generate a unique value by appending and incrementing a counter to a base string.\n *\n * On each attempt, appends the next incrementing integer (e.g. \"foo 1\", \"foo 2\", etc.) to the original value,\n * and checks with the validation function whether the candidate value is unique.\n *\n * Continues until a unique value is found, or the maximum number of attempts is reached.\n *\n * Returns the first unique value found, or undefined if a unique value cannot be generated within maxRetries.\n *\n * Example:\n * ```ts\n * const existing = new Set(['bar', 'bar 1']);\n * const result = incrementValue({\n * value: ['bar', 1],\n * validation: (val) => !existing.has(val),\n * maxRetries: 5,\n * });\n * // result === \"bar 2\"\n * ```\n */\nasync function incrementValue({\n value,\n validation,\n maxRetries,\n attempts = 0,\n transformation,\n}: {\n /**\n * Tuple containing the base value and the starting increment number.\n * Example: [\"workspace\", 1] will try \"workspace 1\", \"workspace 2\", etc.\n */\n value: [string, number] // [base value, next increment]\n\n /**\n * Function to validate if the generated value is unique.\n * Should return true if the value is unique, otherwise false.\n * Supports both synchronous and asynchronous operation.\n */\n validation: (value: string) => Promise<boolean> | boolean\n\n /**\n * The maximum number of retry attempts to generate a unique value.\n * Generation will stop and return undefined if this number is exceeded.\n */\n maxRetries: number\n\n /**\n * The current attempt count.\n * Used internally for recursion; users should generally omit this field.\n */\n attempts?: number\n\n /**\n * Optional function to transform the value before passing it to validation.\n * E.g., for slugifying a value for URLs.\n */\n transformation?: (value: string) => string\n}) {\n if (attempts >= maxRetries) {\n return\n }\n\n const incremented = value.join(' ')\n const transformed = transformation?.(incremented) ?? incremented\n\n if (await validation(transformed)) {\n return transformed\n }\n\n return incrementValue({\n value: [value[0], value[1] + 1],\n validation,\n maxRetries,\n transformation,\n attempts: attempts + 1,\n })\n}\n"],
|
|
5
|
+
"mappings": "AAuBA,eAAsB,oBAAoB;AAAA,EACxC;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA,aAAa;AACf,GAyBG;AACD,QAAM,cAAc,iBAAiB,YAAY,KAAK;AAEtD,MAAI,MAAM,WAAW,WAAW,GAAG;AACjC,WAAO;AAAA,EACT;AAEA,SAAO,eAAe;AAAA,IACpB,OAAO,CAAC,aAAa,CAAC;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAuBA,eAAe,eAAe;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACF,GA+BG;AACD,MAAI,YAAY,YAAY;AAC1B;AAAA,EACF;AAEA,QAAM,cAAc,MAAM,KAAK,GAAG;AAClC,QAAM,cAAc,iBAAiB,WAAW,KAAK;AAErD,MAAI,MAAM,WAAW,WAAW,GAAG;AACjC,WAAO;AAAA,EACT;AAEA,SAAO,eAAe;AAAA,IACpB,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,WAAW;AAAA,EACvB,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Unpacks special vue reactivity & override & detect-changes & magic proxy from an input object or array,
|
|
3
3
|
* returning the "raw" plain object or array.
|
|
4
|
+
*
|
|
5
|
+
* This function recursively traverses the input object or array, removing any proxies
|
|
6
|
+
* (e.g. Vue reactivity proxies, magic proxies, override proxies, detect-changes proxies)
|
|
7
|
+
* to obtain and return the underlying "raw" plain object or array.
|
|
8
|
+
*
|
|
9
|
+
* The recursion is controlled by the `depth` parameter. If `depth` is `null`, unlimited depth is allowed.
|
|
10
|
+
* If a proxied object is detected and unwrapped at non-root level, a warning is logged.
|
|
11
|
+
*
|
|
12
|
+
* @param input - The object or array (possibly deeply nested or proxied) to recursively unwrap.
|
|
13
|
+
* @param depth - Optional, limits recursion depth. `null` means unlimited depth (default is 1).
|
|
14
|
+
* @returns - A plain object or array with all proxies removed up to the specified depth.
|
|
4
15
|
*/
|
|
5
|
-
export declare const unpackProxyObject: <T>(input: T
|
|
16
|
+
export declare const unpackProxyObject: <T>(input: T, { depth }?: {
|
|
17
|
+
depth?: number | null;
|
|
18
|
+
}) => T;
|
|
6
19
|
//# sourceMappingURL=unpack-proxy.d.ts.map
|