@scalar/workspace-store 0.49.2 → 0.51.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 +114 -0
- package/dist/client.d.ts +2 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +38 -15
- package/dist/entities/auth/schema.d.ts +10 -5
- package/dist/entities/auth/schema.d.ts.map +1 -1
- package/dist/events/bus.d.ts +70 -0
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +48 -11
- package/dist/events/definitions/analytics.d.ts +0 -12
- package/dist/events/definitions/analytics.d.ts.map +1 -1
- package/dist/events/definitions/auth.d.ts +44 -6
- package/dist/events/definitions/auth.d.ts.map +1 -1
- package/dist/events/definitions/index.d.ts +3 -2
- package/dist/events/definitions/index.d.ts.map +1 -1
- package/dist/events/definitions/log.d.ts +18 -0
- package/dist/events/definitions/log.d.ts.map +1 -0
- package/dist/events/definitions/log.js +1 -0
- package/dist/events/definitions/operation.d.ts +1 -1
- package/dist/events/definitions/operation.d.ts.map +1 -1
- package/dist/events/definitions/ui.d.ts +18 -1
- package/dist/events/definitions/ui.d.ts.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.d.ts +6 -0
- package/dist/helpers/get-resolved-ref.d.ts.map +1 -1
- package/dist/helpers/get-resolved-ref.js +9 -0
- package/dist/helpers/is-hidden.d.ts +8 -0
- package/dist/helpers/is-hidden.d.ts.map +1 -0
- package/dist/helpers/is-hidden.js +5 -0
- package/dist/mutators/auth.d.ts +22 -3
- package/dist/mutators/auth.d.ts.map +1 -1
- package/dist/mutators/auth.js +213 -37
- package/dist/mutators/cookie.d.ts.map +1 -1
- package/dist/mutators/cookie.js +3 -2
- package/dist/mutators/document.d.ts.map +1 -1
- package/dist/mutators/document.js +5 -4
- package/dist/mutators/environment.d.ts.map +1 -1
- package/dist/mutators/environment.js +12 -5
- package/dist/mutators/index.d.ts +4 -0
- package/dist/mutators/index.d.ts.map +1 -1
- package/dist/mutators/operation/body.d.ts.map +1 -1
- package/dist/mutators/operation/body.js +6 -2
- package/dist/mutators/operation/extensions.d.ts.map +1 -1
- package/dist/mutators/operation/extensions.js +5 -1
- package/dist/mutators/operation/history.d.ts.map +1 -1
- package/dist/mutators/operation/history.js +7 -3
- package/dist/mutators/operation/operation.d.ts.map +1 -1
- package/dist/mutators/operation/operation.js +15 -10
- package/dist/mutators/operation/parameters.d.ts.map +1 -1
- package/dist/mutators/operation/parameters.js +12 -5
- package/dist/mutators/server.d.ts.map +1 -1
- package/dist/mutators/server.js +2 -1
- package/dist/mutators/tag.d.ts.map +1 -1
- package/dist/mutators/tag.js +9 -4
- package/dist/navigation/helpers/get-openapi-object.d.ts.map +1 -1
- package/dist/navigation/helpers/get-openapi-object.js +5 -0
- package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-paths.js +4 -3
- package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-schemas.js +9 -4
- package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-tags.js +2 -1
- package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
- package/dist/navigation/helpers/traverse-webhooks.js +4 -3
- package/dist/navigation/helpers/update-order-ids.d.ts.map +1 -1
- package/dist/navigation/helpers/update-order-ids.js +4 -1
- package/dist/persistence/index.d.ts +123 -80
- package/dist/persistence/index.d.ts.map +1 -1
- package/dist/persistence/index.js +233 -167
- package/dist/persistence/migrations/v2-team-to-local.d.ts +22 -5
- package/dist/persistence/migrations/v2-team-to-local.d.ts.map +1 -1
- package/dist/persistence/migrations/v2-team-to-local.js +195 -137
- package/dist/request-example/builder/body/build-request-body.d.ts.map +1 -1
- package/dist/request-example/builder/body/build-request-body.js +48 -5
- package/dist/request-example/builder/build-request.d.ts +24 -3
- package/dist/request-example/builder/build-request.d.ts.map +1 -1
- package/dist/request-example/builder/build-request.js +89 -18
- package/dist/request-example/builder/index.d.ts +2 -1
- package/dist/request-example/builder/index.d.ts.map +1 -1
- package/dist/request-example/builder/index.js +2 -1
- package/dist/request-example/builder/request-factory.d.ts.map +1 -1
- package/dist/request-example/builder/request-factory.js +5 -8
- package/dist/request-example/builder/resolve-request-factory-url.d.ts +18 -1
- package/dist/request-example/builder/resolve-request-factory-url.d.ts.map +1 -1
- package/dist/request-example/builder/resolve-request-factory-url.js +29 -4
- package/dist/request-example/context/environment.d.ts.map +1 -1
- package/dist/request-example/context/environment.js +2 -1
- package/dist/request-example/context/get-request-example-context.d.ts.map +1 -1
- package/dist/request-example/context/get-request-example-context.js +7 -0
- package/dist/request-example/context/headers.d.ts +28 -13
- package/dist/request-example/context/headers.d.ts.map +1 -1
- package/dist/request-example/context/headers.js +84 -19
- package/dist/request-example/context/index.d.ts +1 -0
- package/dist/request-example/context/index.d.ts.map +1 -1
- package/dist/request-example/context/index.js +1 -0
- package/dist/request-example/context/security/get-selected-security.d.ts.map +1 -1
- package/dist/request-example/context/security/get-selected-security.js +3 -6
- package/dist/request-example/context/servers.d.ts.map +1 -1
- package/dist/request-example/context/servers.js +3 -3
- package/dist/request-example/index.d.ts +3 -3
- package/dist/request-example/index.d.ts.map +1 -1
- package/dist/request-example/index.js +2 -2
- package/dist/resolve.d.ts.map +1 -1
- package/dist/resolve.js +1 -8
- package/dist/schemas/asyncapi/asyncapi-document.d.ts +79 -0
- package/dist/schemas/asyncapi/asyncapi-document.d.ts.map +1 -0
- package/dist/schemas/asyncapi/asyncapi-document.js +58 -0
- package/dist/schemas/extensions/document/workspace-managed-extensions.d.ts +25 -0
- package/dist/schemas/extensions/document/workspace-managed-extensions.d.ts.map +1 -0
- package/dist/schemas/extensions/document/workspace-managed-extensions.js +26 -0
- package/dist/schemas/inmemory-workspace.d.ts +3 -4631
- package/dist/schemas/inmemory-workspace.d.ts.map +1 -1
- package/dist/schemas/inmemory-workspace.js +1 -15
- package/dist/schemas/reference-config/index.d.ts +3 -2
- package/dist/schemas/reference-config/index.d.ts.map +1 -1
- package/dist/schemas/reference-config/settings.d.ts +2 -1
- package/dist/schemas/reference-config/settings.d.ts.map +1 -1
- package/dist/schemas/type-guards.d.ts +24 -0
- package/dist/schemas/type-guards.d.ts.map +1 -0
- package/dist/schemas/type-guards.js +35 -0
- package/dist/schemas/v3.1/openapi/index.d.ts +2 -1
- package/dist/schemas/v3.1/openapi/index.d.ts.map +1 -1
- package/dist/schemas/v3.1/openapi/index.js +3 -3
- package/dist/schemas/v3.1/strict/openapi-document.d.ts +74 -39
- package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
- package/dist/schemas/v3.1/strict/openapi-document.js +6 -2
- package/dist/schemas/workspace-specification/index.d.ts +1 -1
- package/dist/schemas/workspace.d.ts +15 -4377
- package/dist/schemas/workspace.d.ts.map +1 -1
- package/dist/schemas/workspace.js +13 -8
- package/dist/schemas.d.ts +3 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +3 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,119 @@
|
|
|
1
1
|
# @scalar/workspace-store
|
|
2
2
|
|
|
3
|
+
## 0.51.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): feat: UID-based workspaces and local-team migration
|
|
8
|
+
|
|
9
|
+
IndexedDB v2 migrates existing data into the new shape, collapses all workspaces into the local team (aligned with a single team workspace on the client for now), resolves slug collisions deterministically, re-keys chunk stores by workspaceUid, and strips x-scalar-tabs and x-scalar-active-tab from meta chunks so routing does not follow stale paths after migration or slug changes.
|
|
10
|
+
|
|
11
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): feat: make `WorkspaceDocument` an union of OpenApiDocument and AsyncApiDocument
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): feat: add Cmd/Ctrl+S for `ui:save:local-document` so hosts (e.g. scalar-app) can match the header Save control for local workspaces
|
|
16
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix: stop coercing rebased documents against the strict OpenAPI schema so AsyncAPI documents survive a rebase without having OpenAPI fields injected
|
|
17
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix(api-client): block invalid request URLs before send and surface `buildRequest` failures as results
|
|
18
|
+
|
|
19
|
+
Request construction now treats a bad merged URL as a first-class failure instead of throwing deep inside helpers. After `mergeUrls`, `resolveRequestFactoryUrl` rejects incomplete targets when strict mode applies: relative URLs, an empty server base, or path strings that still contain unresolved `{{variable}}` placeholders. Callers may set `allowMissingRequestServerBase` where a full absolute URL is intentionally optional (for example the embedded modal layout in `OperationBlock`, or API Reference `onBeforeRequest` hooks that build against the document origin).
|
|
20
|
+
|
|
21
|
+
`buildRequest` returns a `Result` (`ok` / `err`) with stable error codes such as `MISSING_REQUEST_SERVER_BASE`, `INVALID_REQUEST_FACTORY_URL`, and `BUILD_REQUEST_FAILED` for unexpected synchronous failures. Those failures are wrapped with `safeRun` from `@scalar/helpers`, which logs to `console.error` and maps throws to a string message on the result. The API Reference plugin path logs and skips `onBeforeRequest` when a preview request cannot be built, so user hooks never run against a half-built fetch payload.
|
|
22
|
+
|
|
23
|
+
Downstream packages (`api-client`, `api-reference`, `scalar-app` where applicable) unwrap the result, show toasts or logs, and avoid calling `sendRequest` until the URL is valid.
|
|
24
|
+
|
|
25
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): remove outdated Biome suppression in schema traversal loop
|
|
26
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix urlencoded request body serialization for nested object and array values
|
|
27
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix: OAuth scope CRUD mutators
|
|
28
|
+
- New mutators **`upsertScope`** and **`deleteScope`** backed by new `AuthEvents` entries; **`updateSelectedScopes`** only updates selection state.
|
|
29
|
+
- **Rename**: `upsertScope` rewrites the scope key in the flow and mirrors the new key in every document- and operation-level selected requirement for that scheme.
|
|
30
|
+
- **Delete**: `deleteScope` removes the scope from the flow and drops it from matching selections.
|
|
31
|
+
|
|
32
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix(workspace-store): respect x-internal and x-scalar-ignore on $ref wrapper schemas, operations, and webhooks in the sidebar
|
|
33
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix: initialize selection when updating OAuth2 scopes with preferredSecurityScheme
|
|
34
|
+
|
|
35
|
+
When preferredSecurityScheme is used, the selection is computed on-the-fly by getSelectedSecurity but not persisted to the auth store. This caused updateSelectedScopes to fail silently when users tried to select scopes, as it couldn't find a stored selection to update.
|
|
36
|
+
|
|
37
|
+
The fix initializes the selection in the auth store when it doesn't exist, allowing scope updates to work correctly with preferredSecurityScheme.
|
|
38
|
+
|
|
39
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix: share executable URL build for copy and buildRequest
|
|
40
|
+
|
|
41
|
+
Copy URL from the operation address bar now matches the URL that is actually sent: path parameters, operation query string, environment substitution, and security schemes that use in: query are all applied the same way as Send.
|
|
42
|
+
|
|
43
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): feat(workspace-store): add `getDocumentType` helper to identify OpenAPI vs AsyncAPI documents
|
|
44
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): feat: add more analytics events
|
|
45
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix(api-client): expand object query parameters in the request UI
|
|
46
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix: omit disabled default headers when building requests
|
|
47
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix(api-client): request body content types — OpenAPI extras, MIME labels, and "Other" without auto Content-Type
|
|
48
|
+
|
|
49
|
+
The request body dropdown lists built-in types first, then any additional media types from the OpenAPI operation. Labels use the MIME essence (no `charset` in the label). The **Other** option is available again for a raw body: it does **not** add an automatic `Content-Type` header (users can set one manually). Code snippets avoid injecting `Content-Type: other`.
|
|
50
|
+
|
|
51
|
+
`getDefaultHeaders` and `filterDisabledDefaultHeaders` are exported from `@scalar/workspace-store/request-example`; the API client uses them for code snippets instead of a duplicate helper.
|
|
52
|
+
|
|
53
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): fix: forward selected forbidden headers via `X-Scalar-*` when proxying
|
|
54
|
+
|
|
55
|
+
Browsers strip selected forbidden headers from outgoing requests. When using the Scalar proxy (or running in Electron), we now rewrite a small allowlist (`Date`, `DNT`, and `Referer`) to `X-Scalar-*` headers so the proxy can forward the intended upstream headers without opening support for the full forbidden-header set.
|
|
56
|
+
|
|
57
|
+
## 0.50.0
|
|
58
|
+
|
|
59
|
+
### Minor Changes
|
|
60
|
+
|
|
61
|
+
- [#9195](https://github.com/scalar/scalar/pull/9195): feat: UID-based workspaces and local-team migration
|
|
62
|
+
|
|
63
|
+
IndexedDB v2 migrates existing data into the new shape, collapses all workspaces into the local team (aligned with a single team workspace on the client for now), resolves slug collisions deterministically, re-keys chunk stores by workspaceUid, and strips x-scalar-tabs and x-scalar-active-tab from meta chunks so routing does not follow stale paths after migration or slug changes.
|
|
64
|
+
|
|
65
|
+
- [#9018](https://github.com/scalar/scalar/pull/9018): feat: make `WorkspaceDocument` an union of OpenApiDocument and AsyncApiDocument
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- [#9185](https://github.com/scalar/scalar/pull/9185): feat: add Cmd/Ctrl+S for `ui:save:local-document` so hosts (e.g. scalar-app) can match the header Save control for local workspaces
|
|
70
|
+
- [#9018](https://github.com/scalar/scalar/pull/9018): fix: stop coercing rebased documents against the strict OpenAPI schema so AsyncAPI documents survive a rebase without having OpenAPI fields injected
|
|
71
|
+
- [#9184](https://github.com/scalar/scalar/pull/9184): fix(api-client): block invalid request URLs before send and surface `buildRequest` failures as results
|
|
72
|
+
|
|
73
|
+
Request construction now treats a bad merged URL as a first-class failure instead of throwing deep inside helpers. After `mergeUrls`, `resolveRequestFactoryUrl` rejects incomplete targets when strict mode applies: relative URLs, an empty server base, or path strings that still contain unresolved `{{variable}}` placeholders. Callers may set `allowMissingRequestServerBase` where a full absolute URL is intentionally optional (for example the embedded modal layout in `OperationBlock`, or API Reference `onBeforeRequest` hooks that build against the document origin).
|
|
74
|
+
|
|
75
|
+
`buildRequest` returns a `Result` (`ok` / `err`) with stable error codes such as `MISSING_REQUEST_SERVER_BASE`, `INVALID_REQUEST_FACTORY_URL`, and `BUILD_REQUEST_FAILED` for unexpected synchronous failures. Those failures are wrapped with `safeRun` from `@scalar/helpers`, which logs to `console.error` and maps throws to a string message on the result. The API Reference plugin path logs and skips `onBeforeRequest` when a preview request cannot be built, so user hooks never run against a half-built fetch payload.
|
|
76
|
+
|
|
77
|
+
Downstream packages (`api-client`, `api-reference`, `scalar-app` where applicable) unwrap the result, show toasts or logs, and avoid calling `sendRequest` until the URL is valid.
|
|
78
|
+
|
|
79
|
+
- [#9142](https://github.com/scalar/scalar/pull/9142): remove outdated Biome suppression in schema traversal loop
|
|
80
|
+
- [#9098](https://github.com/scalar/scalar/pull/9098): fix urlencoded request body serialization for nested object and array values
|
|
81
|
+
- [#9168](https://github.com/scalar/scalar/pull/9168): fix: OAuth scope CRUD mutators
|
|
82
|
+
- New mutators **`upsertScope`** and **`deleteScope`** backed by new `AuthEvents` entries; **`updateSelectedScopes`** only updates selection state.
|
|
83
|
+
- **Rename**: `upsertScope` rewrites the scope key in the flow and mirrors the new key in every document- and operation-level selected requirement for that scheme.
|
|
84
|
+
- **Delete**: `deleteScope` removes the scope from the flow and drops it from matching selections.
|
|
85
|
+
|
|
86
|
+
- [#9142](https://github.com/scalar/scalar/pull/9142): fix(workspace-store): respect x-internal and x-scalar-ignore on $ref wrapper schemas, operations, and webhooks in the sidebar
|
|
87
|
+
- [#8984](https://github.com/scalar/scalar/pull/8984): fix: initialize selection when updating OAuth2 scopes with preferredSecurityScheme
|
|
88
|
+
|
|
89
|
+
When preferredSecurityScheme is used, the selection is computed on-the-fly by getSelectedSecurity but not persisted to the auth store. This caused updateSelectedScopes to fail silently when users tried to select scopes, as it couldn't find a stored selection to update.
|
|
90
|
+
|
|
91
|
+
The fix initializes the selection in the auth store when it doesn't exist, allowing scope updates to work correctly with preferredSecurityScheme.
|
|
92
|
+
|
|
93
|
+
- [#9150](https://github.com/scalar/scalar/pull/9150): fix: share executable URL build for copy and buildRequest
|
|
94
|
+
|
|
95
|
+
Copy URL from the operation address bar now matches the URL that is actually sent: path parameters, operation query string, environment substitution, and security schemes that use in: query are all applied the same way as Send.
|
|
96
|
+
|
|
97
|
+
- [#9159](https://github.com/scalar/scalar/pull/9159): feat(workspace-store): add `getDocumentType` helper to identify OpenAPI vs AsyncAPI documents
|
|
98
|
+
- [#9125](https://github.com/scalar/scalar/pull/9125): feat: add more analytics events
|
|
99
|
+
- [#9055](https://github.com/scalar/scalar/pull/9055): fix(api-client): expand object query parameters in the request UI
|
|
100
|
+
- [#9127](https://github.com/scalar/scalar/pull/9127): fix: omit disabled default headers when building requests
|
|
101
|
+
- [#9134](https://github.com/scalar/scalar/pull/9134): fix(api-client): request body content types — OpenAPI extras, MIME labels, and "Other" without auto Content-Type
|
|
102
|
+
|
|
103
|
+
The request body dropdown lists built-in types first, then any additional media types from the OpenAPI operation. Labels use the MIME essence (no `charset` in the label). The **Other** option is available again for a raw body: it does **not** add an automatic `Content-Type` header (users can set one manually). Code snippets avoid injecting `Content-Type: other`.
|
|
104
|
+
|
|
105
|
+
`getDefaultHeaders` and `filterDisabledDefaultHeaders` are exported from `@scalar/workspace-store/request-example`; the API client uses them for code snippets instead of a duplicate helper.
|
|
106
|
+
|
|
107
|
+
- [#9035](https://github.com/scalar/scalar/pull/9035): fix: forward selected forbidden headers via `X-Scalar-*` when proxying
|
|
108
|
+
|
|
109
|
+
Browsers strip selected forbidden headers from outgoing requests. When using the Scalar proxy (or running in Electron), we now rewrite a small allowlist (`Date`, `DNT`, and `Referer`) to `X-Scalar-*` headers so the proxy can forward the intended upstream headers without opening support for the full forbidden-header set.
|
|
110
|
+
|
|
111
|
+
## 0.49.3
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- [#9054](https://github.com/scalar/scalar/pull/9054): fix multipart/form-data request body generation for schema-derived object examples
|
|
116
|
+
|
|
3
117
|
## 0.49.2
|
|
4
118
|
|
|
5
119
|
### Patch Changes
|
package/dist/client.d.ts
CHANGED
|
@@ -363,9 +363,8 @@ export type WorkspaceStore = {
|
|
|
363
363
|
/**
|
|
364
364
|
* Imports a workspace from a serialized JSON string.
|
|
365
365
|
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
* and configuration, with the imported values.
|
|
366
|
+
* Replaces the current workspace state — documents, metadata, and
|
|
367
|
+
* configuration — with the imported values.
|
|
369
368
|
*
|
|
370
369
|
* @param input - The serialized workspace JSON string to import.
|
|
371
370
|
*/
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,2BAA2B,CAAA;AAErE,OAAO,EAAE,KAAK,UAAU,EAAe,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAM7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAI5C,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,iBAAiB,CAAA;AACjE,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAA;AAS1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,YAAY,EAAU,MAAM,2BAA2B,CAAA;AAErE,OAAO,EAAE,KAAK,UAAU,EAAe,KAAK,EAAE,MAAM,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;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,iBAAiB,cAAc,KAAG,cAu9BtE,CAAA;AAGD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/client.js
CHANGED
|
@@ -24,7 +24,7 @@ import { unpackProxyObject } from './helpers/unpack-proxy.js';
|
|
|
24
24
|
import { createNavigation } from './navigation/index.js';
|
|
25
25
|
import { externalValueResolver, loadingStatus, normalizeAuthSchemes, normalizeRefs, refsEverywhere, removeExtraScalarKeys, restoreOriginalRefs, syncPathParameters, } from './plugins/bundler/index.js';
|
|
26
26
|
import { extensions } from './schemas/extensions.js';
|
|
27
|
-
import {
|
|
27
|
+
import { isAsyncApiDocument, isOpenApiDocument } from './schemas/type-guards.js';
|
|
28
28
|
import { generateSchema } from './schemas/v3.1/openapi/index.js';
|
|
29
29
|
import { recursiveRef } from './schemas/v3.1/openapi/reference.js';
|
|
30
30
|
import { OpenAPIDocumentSchema as OpenAPIDocumentSchemaStrict, } from './schemas/v3.1/strict/openapi-document.js';
|
|
@@ -422,7 +422,7 @@ export const createWorkspaceStore = (workspaceProps) => {
|
|
|
422
422
|
activeDocument['x-scalar-is-dirty'] = false;
|
|
423
423
|
return true;
|
|
424
424
|
};
|
|
425
|
-
// Add a document to the store synchronously from an in-memory OpenAPI document
|
|
425
|
+
// Add a document to the store synchronously from an in-memory OpenAPI or AsyncAPI document
|
|
426
426
|
async function addInMemoryDocument(input, navigationOptions) {
|
|
427
427
|
const { name } = input;
|
|
428
428
|
const meta = deepClone(input.meta);
|
|
@@ -445,6 +445,26 @@ export const createWorkspaceStore = (workspaceProps) => {
|
|
|
445
445
|
extraDocumentConfigurations[name] = { fetch: input.fetch };
|
|
446
446
|
}
|
|
447
447
|
});
|
|
448
|
+
// AsyncAPI ingestion: skip the OpenAPI-specific upgrade, bundle, coerce,
|
|
449
|
+
// validate, and navigation pipeline. The OpenAPI `coerce` step would
|
|
450
|
+
// otherwise inject an empty `openapi: ''` field and break the type
|
|
451
|
+
// discriminator. Reference resolution and navigation generation for
|
|
452
|
+
// AsyncAPI are out of scope for the MVP — only the workspace-store
|
|
453
|
+
// managed metadata (source url, document hash, spec version) is set so
|
|
454
|
+
// change detection on rebase can compare hashes correctly.
|
|
455
|
+
if (isAsyncApiDocument(clonedRawInputDocument)) {
|
|
456
|
+
const asyncApiDocument = {
|
|
457
|
+
...clonedRawInputDocument,
|
|
458
|
+
...meta,
|
|
459
|
+
'x-original-aas-version': clonedRawInputDocument.asyncapi,
|
|
460
|
+
'x-scalar-original-document-hash': input.documentHash,
|
|
461
|
+
'x-scalar-original-source-url': input.documentSource,
|
|
462
|
+
};
|
|
463
|
+
workspace.documents[name] = createOverridesProxy(createMagicProxy(asyncApiDocument), {
|
|
464
|
+
overrides: unpackProxyObject(overrides[name]),
|
|
465
|
+
});
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
448
468
|
const inputDocument = withMeasurementSync('upgrade', () => upgrade(deepClone(clonedRawInputDocument), '3.1'));
|
|
449
469
|
const strictDocument = createMagicProxy({
|
|
450
470
|
...inputDocument,
|
|
@@ -626,6 +646,10 @@ export const createWorkspaceStore = (workspaceProps) => {
|
|
|
626
646
|
console.error(`Document '${documentName}' does not exist in the workspace.`);
|
|
627
647
|
return false;
|
|
628
648
|
}
|
|
649
|
+
// Sidebar navigation is OpenAPI-only for now.
|
|
650
|
+
if (!isOpenApiDocument(document)) {
|
|
651
|
+
return false;
|
|
652
|
+
}
|
|
629
653
|
// Generate the navigation structure for the sidebar.
|
|
630
654
|
const navigation = createNavigation(documentName, document);
|
|
631
655
|
// Set the computed navigation structure on the document metadata.
|
|
@@ -671,7 +695,9 @@ export const createWorkspaceStore = (workspaceProps) => {
|
|
|
671
695
|
await addInMemoryDocument({
|
|
672
696
|
name: documentName,
|
|
673
697
|
document: input,
|
|
674
|
-
// Preserve the current metadata
|
|
698
|
+
// Preserve the current metadata. Source url, document hash, and
|
|
699
|
+
// registry meta are typed identically on the OpenAPI and AsyncAPI
|
|
700
|
+
// document shapes, so the union access does not need narrowing.
|
|
675
701
|
documentSource: currentDocument['x-scalar-original-source-url'],
|
|
676
702
|
documentHash: currentDocument['x-scalar-original-document-hash'],
|
|
677
703
|
meta: {
|
|
@@ -895,7 +921,6 @@ export const createWorkspaceStore = (workspaceProps) => {
|
|
|
895
921
|
return applyChangesInput.resolvedDocument;
|
|
896
922
|
};
|
|
897
923
|
const mergedDocument = getNewActiveDocument();
|
|
898
|
-
const newActiveDocument = coerceValue(OpenAPIDocumentSchemaStrict, mergedDocument);
|
|
899
924
|
// Detect whether the rebase folded in any local edits. When the
|
|
900
925
|
// merged result matches the upstream snapshot the pull was
|
|
901
926
|
// effectively a fast-forward (no unsaved local work to carry
|
|
@@ -904,26 +929,24 @@ export const createWorkspaceStore = (workspaceProps) => {
|
|
|
904
929
|
// the document as dirty so the push flow can surface them, the
|
|
905
930
|
// same way `git pull --rebase` leaves you "ahead of origin"
|
|
906
931
|
// once your local commits get replayed on top.
|
|
907
|
-
//
|
|
908
|
-
// We compare the pre-coerce merged document against upstream
|
|
909
|
-
// because `coerceValue` normalises the merged result against
|
|
910
|
-
// the strict schema and that normalisation can introduce diffs
|
|
911
|
-
// even for pure fast-forwards. The merged document is what the
|
|
912
|
-
// two-way merge actually produced, so its byte-for-byte equality
|
|
913
|
-
// with upstream is the real fast-forward signal.
|
|
914
932
|
const hasLocalChangesAgainstUpstream = diff(newDocumentOrigin, mergedDocument).length > 0;
|
|
915
933
|
// The merged result becomes the new saved baseline so a subsequent
|
|
916
934
|
// revert restores to the post-rebase state, not to the
|
|
917
935
|
// pre-rebase original. Mirror the same content into the
|
|
918
936
|
// deprecated intermediate map so any lingering consumer reads
|
|
919
|
-
// the post-rebase state too.
|
|
920
|
-
|
|
921
|
-
|
|
937
|
+
// the post-rebase state too. We do not coerce against the strict
|
|
938
|
+
// OpenAPI schema here — `addInMemoryDocument` re-runs the full
|
|
939
|
+
// ingestion pipeline (which handles AsyncAPI vs OpenAPI separately
|
|
940
|
+
// and coerces OpenAPI documents internally), and pre-coercing
|
|
941
|
+
// would inject OpenAPI fields into AsyncAPI documents and break
|
|
942
|
+
// the document type discriminator.
|
|
943
|
+
originalDocuments[name] = mergedDocument;
|
|
944
|
+
intermediateDocuments[name] = deepClone(mergedDocument);
|
|
922
945
|
// add the new active document to the workspace but don't re-initialize
|
|
923
946
|
await addInMemoryDocument({
|
|
924
947
|
...input,
|
|
925
948
|
document: {
|
|
926
|
-
...
|
|
949
|
+
...mergedDocument,
|
|
927
950
|
// force regeneration of navigation
|
|
928
951
|
// when we are rebasing, we want to ensure that the navigation is always up to date
|
|
929
952
|
[extensions.document.navigation]: undefined,
|
|
@@ -1865,8 +1865,9 @@ declare const SelectedSecuritySchema: import("@scalar/typebox").TObject<{
|
|
|
1865
1865
|
externalDocs: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ExternalDocumentationObject">>;
|
|
1866
1866
|
}>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
1867
1867
|
'x-original-oas-version': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1868
|
-
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1869
1868
|
"x-scalar-navigation": import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"TraversedDocumentObject">>;
|
|
1869
|
+
}>, import("@scalar/typebox").TObject<{
|
|
1870
|
+
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
1870
1871
|
}>, import("@scalar/typebox").TObject<{
|
|
1871
1872
|
'x-tagGroups': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
1872
1873
|
name: import("@scalar/typebox").TString;
|
|
@@ -3495,8 +3496,9 @@ export declare const AuthSchema: import("@scalar/typebox").TObject<{
|
|
|
3495
3496
|
externalDocs: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ExternalDocumentationObject">>;
|
|
3496
3497
|
}>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
3497
3498
|
'x-original-oas-version': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
3498
|
-
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
3499
3499
|
"x-scalar-navigation": import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"TraversedDocumentObject">>;
|
|
3500
|
+
}>, import("@scalar/typebox").TObject<{
|
|
3501
|
+
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
3500
3502
|
}>, import("@scalar/typebox").TObject<{
|
|
3501
3503
|
'x-tagGroups': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
3502
3504
|
name: import("@scalar/typebox").TString;
|
|
@@ -4942,8 +4944,9 @@ export declare const AuthSchema: import("@scalar/typebox").TObject<{
|
|
|
4942
4944
|
externalDocs: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ExternalDocumentationObject">>;
|
|
4943
4945
|
}>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
4944
4946
|
'x-original-oas-version': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
4945
|
-
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
4946
4947
|
"x-scalar-navigation": import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"TraversedDocumentObject">>;
|
|
4948
|
+
}>, import("@scalar/typebox").TObject<{
|
|
4949
|
+
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
4947
4950
|
}>, import("@scalar/typebox").TObject<{
|
|
4948
4951
|
'x-tagGroups': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
4949
4952
|
name: import("@scalar/typebox").TString;
|
|
@@ -6574,8 +6577,9 @@ export declare const DocumentAuthSchema: import("@scalar/typebox").TRecord<impor
|
|
|
6574
6577
|
externalDocs: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ExternalDocumentationObject">>;
|
|
6575
6578
|
}>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
6576
6579
|
'x-original-oas-version': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
6577
|
-
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
6578
6580
|
"x-scalar-navigation": import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"TraversedDocumentObject">>;
|
|
6581
|
+
}>, import("@scalar/typebox").TObject<{
|
|
6582
|
+
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
6579
6583
|
}>, import("@scalar/typebox").TObject<{
|
|
6580
6584
|
'x-tagGroups': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
6581
6585
|
name: import("@scalar/typebox").TString;
|
|
@@ -8021,8 +8025,9 @@ export declare const DocumentAuthSchema: import("@scalar/typebox").TRecord<impor
|
|
|
8021
8025
|
externalDocs: import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"ExternalDocumentationObject">>;
|
|
8022
8026
|
}>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
8023
8027
|
'x-original-oas-version': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
8024
|
-
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
8025
8028
|
"x-scalar-navigation": import("@scalar/typebox").TOptional<import("@scalar/typebox").TRef<"TraversedDocumentObject">>;
|
|
8029
|
+
}>, import("@scalar/typebox").TObject<{
|
|
8030
|
+
'x-scalar-original-source-url': import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
|
|
8026
8031
|
}>, import("@scalar/typebox").TObject<{
|
|
8027
8032
|
'x-tagGroups': import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{
|
|
8028
8033
|
name: import("@scalar/typebox").TString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/entities/auth/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,iBAAiB,CAAA;AAoBnD,QAAA,MAAM,mBAAmB;;;;IAKxB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE9D,QAAA,MAAM,iBAAiB;;;;;;;IAMtB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAQ1D,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB3B,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEtE,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;AAErD,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B9B,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;A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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyC,CAAA;AACxE,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA"}
|
package/dist/events/bus.d.ts
CHANGED
|
@@ -5,6 +5,37 @@ type Unsubscribe = () => void;
|
|
|
5
5
|
* if the event allows undefined, otherwise requires it.
|
|
6
6
|
*/
|
|
7
7
|
type EventListener<E extends keyof ApiReferenceEvents> = undefined extends ApiReferenceEvents[E] ? (payload?: ApiReferenceEvents[E]) => void : (payload: ApiReferenceEvents[E]) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Tagged-union representation of every event — one branch per event key, each
|
|
10
|
+
* pairing the event name with its specific payload type.
|
|
11
|
+
*
|
|
12
|
+
* Because `event` acts as the discriminant, TypeScript narrows `payload` to
|
|
13
|
+
* the exact type of the matched event when you check `event === '...'` inside
|
|
14
|
+
* a listener (including when the argument is destructured).
|
|
15
|
+
*/
|
|
16
|
+
export type AnyEvent = {
|
|
17
|
+
[E in keyof ApiReferenceEvents]: {
|
|
18
|
+
event: E;
|
|
19
|
+
payload: ApiReferenceEvents[E];
|
|
20
|
+
};
|
|
21
|
+
}[keyof ApiReferenceEvents];
|
|
22
|
+
/**
|
|
23
|
+
* Listener type for `onAny` subscriptions.
|
|
24
|
+
*
|
|
25
|
+
* Receives a single tagged-union object containing the concrete `event` name
|
|
26
|
+
* and its `payload`. Narrowing on `event` narrows `payload` to the exact type
|
|
27
|
+
* for that event — no manual casting or runtime payload checks required just
|
|
28
|
+
* to satisfy types.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* bus.onAny(({ event, payload }) => {
|
|
32
|
+
* if (event === 'log:user-login') {
|
|
33
|
+
* // payload is { uid: string; email?: string; teamUid: string }
|
|
34
|
+
* posthog.identify(payload.uid)
|
|
35
|
+
* }
|
|
36
|
+
* })
|
|
37
|
+
*/
|
|
38
|
+
export type AnyEventListener = (event: AnyEvent) => void;
|
|
8
39
|
/**
|
|
9
40
|
* Helper type for emit parameters that uses rest parameters
|
|
10
41
|
* for a cleaner API surface.
|
|
@@ -24,6 +55,7 @@ type EmitParameters<E extends keyof ApiReferenceEvents> = undefined extends ApiR
|
|
|
24
55
|
*
|
|
25
56
|
* - Full type safety for event names and payloads
|
|
26
57
|
* - Debug mode for development
|
|
58
|
+
* - Listen to every event via `onAny` / `offAny`
|
|
27
59
|
*/
|
|
28
60
|
export type WorkspaceEventBus = {
|
|
29
61
|
/**
|
|
@@ -68,6 +100,44 @@ export type WorkspaceEventBus = {
|
|
|
68
100
|
* })
|
|
69
101
|
*/
|
|
70
102
|
once<E extends keyof ApiReferenceEvents>(event: E, listener: EventListener<E>): Unsubscribe;
|
|
103
|
+
/**
|
|
104
|
+
* Subscribe to every event emitted on the bus.
|
|
105
|
+
*
|
|
106
|
+
* The listener receives the concrete event name as the first argument and
|
|
107
|
+
* the (proxy-unpacked) payload as the second. Use this on the consumer side
|
|
108
|
+
* when you need to handle every event generically — for example, analytics,
|
|
109
|
+
* logging, or forwarding events across a boundary.
|
|
110
|
+
*
|
|
111
|
+
* Because the listener type is a discriminated union over every event key,
|
|
112
|
+
* narrowing on `event` inside the listener body also narrows `payload` to
|
|
113
|
+
* its exact type.
|
|
114
|
+
*
|
|
115
|
+
* @param listener - Callback invoked for every emitted event
|
|
116
|
+
* @returns Unsubscribe function to remove the listener
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* const off = bus.onAny((event, payload) => {
|
|
120
|
+
* if (event === 'log:user-login') {
|
|
121
|
+
* // payload is narrowed to the login payload type
|
|
122
|
+
* posthog.identify(payload.uid)
|
|
123
|
+
* }
|
|
124
|
+
* })
|
|
125
|
+
*
|
|
126
|
+
* // Clean up
|
|
127
|
+
* off()
|
|
128
|
+
*/
|
|
129
|
+
onAny(listener: AnyEventListener): Unsubscribe;
|
|
130
|
+
/**
|
|
131
|
+
* Remove a wildcard listener previously registered with `onAny`.
|
|
132
|
+
*
|
|
133
|
+
* @param listener - The listener function to remove
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* const handler = (event, payload) => console.log(event, payload)
|
|
137
|
+
* bus.onAny(handler)
|
|
138
|
+
* bus.offAny(handler)
|
|
139
|
+
*/
|
|
140
|
+
offAny(listener: AnyEventListener): void;
|
|
71
141
|
/**
|
|
72
142
|
* Emit an event with its payload
|
|
73
143
|
*
|
package/dist/events/bus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bus.d.ts","sourceRoot":"","sources":["../../src/events/bus.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD,KAAK,WAAW,GAAG,MAAM,IAAI,CAAA;AAE7B;;;GAGG;AACH,KAAK,aAAa,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,SAAS,SAAS,kBAAkB,CAAC,CAAC,CAAC,GAC5F,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,IAAI,GACzC,CAAC,OAAO,EA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AAG,IAAI,CAAA;IAExC;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,EAAE,GAAG,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IAE1E;;OAEG;IACH,mBAAmB,CAAC,IAAI,IAAI,CAAA;CAC7B,CAAA;AAED;;GAEG;AACH,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAS,eAAoB,KAAG,iBAwNvE,CAAA"}
|
package/dist/events/bus.js
CHANGED
|
@@ -28,6 +28,11 @@ import { unpackProxyObject } from '../helpers/unpack-proxy.js';
|
|
|
28
28
|
export const createWorkspaceEventBus = (options = {}) => {
|
|
29
29
|
const { debug = false } = options;
|
|
30
30
|
const events = new Map();
|
|
31
|
+
/**
|
|
32
|
+
* Set of wildcard listeners that receive every emitted event.
|
|
33
|
+
* Using a Set keeps add/remove O(1) and iteration order stable.
|
|
34
|
+
*/
|
|
35
|
+
const anyListeners = new Set();
|
|
31
36
|
const pendingLogs = [];
|
|
32
37
|
let logTimeout = null;
|
|
33
38
|
/**
|
|
@@ -111,6 +116,15 @@ export const createWorkspaceEventBus = (options = {}) => {
|
|
|
111
116
|
events.delete(event);
|
|
112
117
|
}
|
|
113
118
|
};
|
|
119
|
+
const onAny = (listener) => {
|
|
120
|
+
anyListeners.add(listener);
|
|
121
|
+
log(`Added wildcard listener (${anyListeners.size} total)`);
|
|
122
|
+
return () => offAny(listener);
|
|
123
|
+
};
|
|
124
|
+
const offAny = (listener) => {
|
|
125
|
+
anyListeners.delete(listener);
|
|
126
|
+
log(`Removed wildcard listener (${anyListeners.size} remaining)`);
|
|
127
|
+
};
|
|
114
128
|
/**
|
|
115
129
|
* Internal function that performs the actual emission logic
|
|
116
130
|
* This is extracted so it can be wrapped with debouncing
|
|
@@ -120,21 +134,42 @@ export const createWorkspaceEventBus = (options = {}) => {
|
|
|
120
134
|
// but are always assigning plain objects 5 level depth.
|
|
121
135
|
const unpackedPayload = options?.skipUnpackProxy ? payload : unpackProxyObject(payload, { depth: 5 });
|
|
122
136
|
const listeners = events.get(event);
|
|
123
|
-
|
|
137
|
+
const hasExactListeners = listeners !== undefined && listeners.size > 0;
|
|
138
|
+
if (!hasExactListeners && anyListeners.size === 0) {
|
|
124
139
|
log(`🛑 No listeners for "${String(event)}"`);
|
|
125
140
|
return;
|
|
126
141
|
}
|
|
127
|
-
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
142
|
+
// Execute exact-match listeners first so the deterministic, type-specific
|
|
143
|
+
// handlers see the event before any generic/wildcard observers.
|
|
144
|
+
if (hasExactListeners && listeners) {
|
|
145
|
+
log(`Emitting "${String(event)}" to ${listeners.size} listener(s)`, payload);
|
|
146
|
+
// Convert to array to avoid issues if listeners modify the set during iteration
|
|
147
|
+
const listenersArray = Array.from(listeners);
|
|
148
|
+
for (const listener of listenersArray) {
|
|
149
|
+
try {
|
|
150
|
+
listener(unpackedPayload);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
// Do not let one listener error break other listeners
|
|
154
|
+
console.error(`[EventBus] Error in listener for "${String(event)}":`, error);
|
|
155
|
+
}
|
|
134
156
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
157
|
+
}
|
|
158
|
+
// Notify wildcard listeners after specific ones have run.
|
|
159
|
+
if (anyListeners.size > 0) {
|
|
160
|
+
log(`Emitting "${String(event)}" to ${anyListeners.size} wildcard listener(s)`, payload);
|
|
161
|
+
// Build the tagged-union argument once and reuse it across listeners.
|
|
162
|
+
// The cast bridges from the loose internal `(event, payload)` pair to
|
|
163
|
+
// the discriminated-union shape exposed to consumers.
|
|
164
|
+
const anyEvent = { event, payload: unpackedPayload };
|
|
165
|
+
const anyListenersArray = Array.from(anyListeners);
|
|
166
|
+
for (const listener of anyListenersArray) {
|
|
167
|
+
try {
|
|
168
|
+
listener(anyEvent);
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
console.error(`[EventBus] Error in wildcard listener for "${String(event)}":`, error);
|
|
172
|
+
}
|
|
138
173
|
}
|
|
139
174
|
}
|
|
140
175
|
};
|
|
@@ -157,6 +192,8 @@ export const createWorkspaceEventBus = (options = {}) => {
|
|
|
157
192
|
on,
|
|
158
193
|
once,
|
|
159
194
|
off,
|
|
195
|
+
onAny,
|
|
196
|
+
offAny,
|
|
160
197
|
emit,
|
|
161
198
|
flushDebouncedEmits,
|
|
162
199
|
};
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
1
|
/** Event definitions for analytics/callbacks/hooks */
|
|
3
2
|
export type AnalyticsEvents = {
|
|
4
|
-
/**
|
|
5
|
-
* Fired when a request is sent through the API client
|
|
6
|
-
*/
|
|
7
|
-
'analytics:on:send-request': {
|
|
8
|
-
/** The HTTP method of the request */
|
|
9
|
-
method: HttpMethod;
|
|
10
|
-
/** The path of the request */
|
|
11
|
-
path: string;
|
|
12
|
-
/** The body of the request */
|
|
13
|
-
body: any;
|
|
14
|
-
};
|
|
15
3
|
/**
|
|
16
4
|
* Fired when the user clicks the "Show more" button on the references
|
|
17
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/analytics.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/events/definitions/analytics.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,wBAAwB,EAAE;QACxB,wCAAwC;QACxC,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IACD;;OAEG;IACH,qBAAqB,EAAE,SAAS,CAAA;CACjC,CAAA"}
|