@scalar/workspace-store 0.40.2 → 0.40.3
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 +7 -0
- package/dist/client.d.ts +7 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +820 -681
- package/dist/entities/auth/index.js +96 -101
- package/dist/entities/auth/schema.js +42 -116
- package/dist/entities/history/index.js +80 -60
- package/dist/entities/history/schema.js +94 -88
- package/dist/events/bus.js +146 -93
- package/dist/events/definitions/analytics.js +1 -1
- package/dist/events/definitions/auth.js +1 -1
- package/dist/events/definitions/common.js +1 -1
- package/dist/events/definitions/cookie.js +1 -1
- package/dist/events/definitions/document.js +1 -1
- package/dist/events/definitions/environment.js +1 -1
- package/dist/events/definitions/hooks.js +1 -1
- package/dist/events/definitions/index.js +1 -1
- package/dist/events/definitions/meta.js +1 -1
- package/dist/events/definitions/operation.js +1 -1
- package/dist/events/definitions/server.js +1 -1
- package/dist/events/definitions/tabs.js +1 -1
- package/dist/events/definitions/tag.js +1 -1
- package/dist/events/definitions/ui.js +1 -1
- package/dist/events/definitions/workspace.js +1 -1
- package/dist/events/index.js +3 -9
- package/dist/events/listeners.js +20 -22
- package/dist/events/old-definitions.js +15 -12
- package/dist/helpers/deep-clone.js +33 -17
- package/dist/helpers/detect-changes-proxy.js +95 -57
- package/dist/helpers/general.js +78 -23
- package/dist/helpers/generate-unique-value.js +77 -45
- package/dist/helpers/get-fetch.js +12 -10
- package/dist/helpers/get-resolved-ref.js +11 -10
- package/dist/helpers/is-non-optional-security-requirement.js +3 -6
- package/dist/helpers/merge-object.js +71 -30
- package/dist/helpers/overrides-proxy.js +98 -58
- package/dist/helpers/unpack-proxy.js +60 -58
- package/dist/mutators/auth.js +358 -230
- package/dist/mutators/cookie.js +59 -42
- package/dist/mutators/document.js +104 -66
- package/dist/mutators/environment.js +97 -72
- package/dist/mutators/helpers.js +9 -13
- package/dist/mutators/index.js +62 -49
- package/dist/mutators/operation/body.js +88 -57
- package/dist/mutators/operation/extensions.js +20 -12
- package/dist/mutators/operation/helpers/fetch-request-to-har.js +144 -107
- package/dist/mutators/operation/helpers/fetch-response-to-har.js +143 -95
- package/dist/mutators/operation/helpers/get-parameter-position.js +12 -12
- package/dist/mutators/operation/helpers/har-to-operation.js +169 -132
- package/dist/mutators/operation/helpers/sync-path-parameters.js +109 -60
- package/dist/mutators/operation/history.js +60 -64
- package/dist/mutators/operation/index.js +25 -49
- package/dist/mutators/operation/operation.js +349 -240
- package/dist/mutators/operation/parameters.js +157 -93
- package/dist/mutators/server.js +213 -152
- package/dist/mutators/tabs.js +173 -130
- package/dist/mutators/tag.js +131 -97
- package/dist/mutators/workspace.js +72 -42
- package/dist/navigation/get-navigation-options.js +97 -84
- package/dist/navigation/helpers/get-openapi-object.js +46 -29
- package/dist/navigation/helpers/get-operation-entries.js +72 -32
- package/dist/navigation/helpers/get-parent-entry.js +16 -12
- package/dist/navigation/helpers/get-tag-entries.js +56 -29
- package/dist/navigation/helpers/get-tag.js +22 -23
- package/dist/navigation/helpers/get-x-keys.js +13 -9
- package/dist/navigation/helpers/traverse-description.js +90 -72
- package/dist/navigation/helpers/traverse-document.js +111 -98
- package/dist/navigation/helpers/traverse-examples.js +35 -31
- package/dist/navigation/helpers/traverse-paths.js +118 -106
- package/dist/navigation/helpers/traverse-schemas.js +65 -64
- package/dist/navigation/helpers/traverse-tags.js +158 -129
- package/dist/navigation/helpers/traverse-webhooks.js +96 -90
- package/dist/navigation/helpers/update-order-ids.js +59 -51
- package/dist/navigation/helpers/utils.js +71 -21
- package/dist/navigation/index.js +5 -13
- package/dist/navigation/types.js +1 -1
- package/dist/persistence/index.js +283 -285
- package/dist/persistence/indexdb.js +263 -126
- package/dist/plugins/bundler/helpers.js +21 -12
- package/dist/plugins/bundler/index.d.ts +7 -0
- package/dist/plugins/bundler/index.d.ts.map +1 -1
- package/dist/plugins/bundler/index.js +305 -171
- package/dist/plugins/client/index.js +1 -5
- package/dist/plugins/client/persistence.js +95 -90
- package/dist/resolve.js +18 -25
- package/dist/schemas/compose.js +6 -7
- package/dist/schemas/extensions/document/x-internal.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-environments.js +16 -22
- package/dist/schemas/extensions/document/x-scalar-icon.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-ignore.js +3 -7
- package/dist/schemas/extensions/document/x-scalar-is-dirty.js +21 -8
- package/dist/schemas/extensions/document/x-scalar-original-document-hash.js +17 -8
- package/dist/schemas/extensions/document/x-scalar-registry-meta.js +15 -21
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js +5 -13
- package/dist/schemas/extensions/document/x-scalar-watch-mode.js +4 -8
- package/dist/schemas/extensions/document/x-tags.js +3 -7
- package/dist/schemas/extensions/example/x-disabled.js +17 -7
- package/dist/schemas/extensions/general/x-scalar-active-environment.js +4 -7
- package/dist/schemas/extensions/general/x-scalar-cookies.js +9 -14
- package/dist/schemas/extensions/general/x-scalar-order.js +8 -7
- package/dist/schemas/extensions/operation/index.js +4 -23
- package/dist/schemas/extensions/operation/x-badge.js +42 -50
- package/dist/schemas/extensions/operation/x-code-samples.js +8 -12
- package/dist/schemas/extensions/operation/x-draft-examples.js +3 -7
- package/dist/schemas/extensions/operation/x-post-response.js +18 -7
- package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js +57 -13
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js +9 -7
- package/dist/schemas/extensions/operation/x-scalar-stability.js +15 -14
- package/dist/schemas/extensions/parameter/x-global.js +12 -7
- package/dist/schemas/extensions/schema/x-additional-properties-name.js +10 -7
- package/dist/schemas/extensions/schema/x-enum-descriptions.js +17 -12
- package/dist/schemas/extensions/schema/x-enum-varnames.js +21 -8
- package/dist/schemas/extensions/schema/x-examples.js +3 -7
- package/dist/schemas/extensions/schema/x-variable.js +3 -7
- package/dist/schemas/extensions/security/index.js +1 -1
- package/dist/schemas/extensions/security/x-default-scopes.js +16 -7
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js +16 -7
- package/dist/schemas/extensions/security/x-scalar-security-body.js +14 -7
- package/dist/schemas/extensions/security/x-scalar-security-query.js +14 -7
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js +66 -37
- package/dist/schemas/extensions/security/x-tokenName.js +11 -7
- package/dist/schemas/extensions/security/x-use-pkce.js +6 -10
- package/dist/schemas/extensions/server/x-scalar-selected-server.js +3 -7
- package/dist/schemas/extensions/tag/index.js +1 -1
- package/dist/schemas/extensions/tag/x-display-name.js +11 -7
- package/dist/schemas/extensions/tag/x-tag-groups.js +13 -15
- package/dist/schemas/extensions/workspace/index.js +2 -11
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js +13 -7
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js +15 -13
- package/dist/schemas/extensions.js +11 -15
- package/dist/schemas/inmemory-workspace.js +13 -21
- package/dist/schemas/navigation.js +48 -85
- package/dist/schemas/reference-config/appearance.js +15 -22
- package/dist/schemas/reference-config/features.js +14 -21
- package/dist/schemas/reference-config/index.js +42 -44
- package/dist/schemas/reference-config/meta.js +11 -18
- package/dist/schemas/reference-config/routing.js +7 -14
- package/dist/schemas/reference-config/settings.js +10 -17
- package/dist/schemas/typebox-coerce.js +23 -6
- package/dist/schemas/v3.1/strict/callback.js +6 -12
- package/dist/schemas/v3.1/strict/components.js +26 -48
- package/dist/schemas/v3.1/strict/contact.js +9 -12
- package/dist/schemas/v3.1/strict/discriminator.js +11 -10
- package/dist/schemas/v3.1/strict/encoding.js +15 -12
- package/dist/schemas/v3.1/strict/example.js +11 -13
- package/dist/schemas/v3.1/strict/external-documentation.js +7 -10
- package/dist/schemas/v3.1/strict/header.js +27 -28
- package/dist/schemas/v3.1/strict/info.js +10 -16
- package/dist/schemas/v3.1/strict/license.js +9 -12
- package/dist/schemas/v3.1/strict/link.js +22 -19
- package/dist/schemas/v3.1/strict/media-type.js +17 -16
- package/dist/schemas/v3.1/strict/oauth-flow.js +28 -62
- package/dist/schemas/v3.1/strict/oauthflows.js +14 -20
- package/dist/schemas/v3.1/strict/openapi-document.js +126 -210
- package/dist/schemas/v3.1/strict/operation.js +16 -43
- package/dist/schemas/v3.1/strict/parameter.js +27 -35
- package/dist/schemas/v3.1/strict/path-item.js +36 -40
- package/dist/schemas/v3.1/strict/paths.js +8 -11
- package/dist/schemas/v3.1/strict/ref-definitions.js +76 -100
- package/dist/schemas/v3.1/strict/reference.js +18 -21
- package/dist/schemas/v3.1/strict/request-body.js +8 -16
- package/dist/schemas/v3.1/strict/response.js +12 -16
- package/dist/schemas/v3.1/strict/responses.js +13 -11
- package/dist/schemas/v3.1/strict/schema.js +149 -157
- package/dist/schemas/v3.1/strict/security-requirement.js +13 -12
- package/dist/schemas/v3.1/strict/security-scheme.js +29 -41
- package/dist/schemas/v3.1/strict/server-variable.js +9 -12
- package/dist/schemas/v3.1/strict/server.js +10 -13
- package/dist/schemas/v3.1/strict/tag.js +11 -20
- package/dist/schemas/v3.1/strict/type-guards.js +20 -20
- package/dist/schemas/v3.1/strict/xml.js +17 -16
- package/dist/schemas/workspace-specification/index.js +11 -23
- package/dist/schemas/workspace-specification/info.js +4 -8
- package/dist/schemas/workspace.js +25 -51
- package/dist/schemas.js +2 -6
- package/dist/server.js +286 -176
- package/dist/workspace-plugin.js +1 -1
- package/package.json +13 -19
- package/dist/client.js.map +0 -7
- package/dist/entities/auth/index.js.map +0 -7
- package/dist/entities/auth/schema.js.map +0 -7
- package/dist/entities/history/index.js.map +0 -7
- package/dist/entities/history/schema.js.map +0 -7
- package/dist/events/bus.js.map +0 -7
- package/dist/events/definitions/analytics.js.map +0 -7
- package/dist/events/definitions/auth.js.map +0 -7
- package/dist/events/definitions/common.js.map +0 -7
- package/dist/events/definitions/cookie.js.map +0 -7
- package/dist/events/definitions/document.js.map +0 -7
- package/dist/events/definitions/environment.js.map +0 -7
- package/dist/events/definitions/hooks.js.map +0 -7
- package/dist/events/definitions/index.js.map +0 -7
- package/dist/events/definitions/meta.js.map +0 -7
- package/dist/events/definitions/operation.js.map +0 -7
- package/dist/events/definitions/server.js.map +0 -7
- package/dist/events/definitions/tabs.js.map +0 -7
- package/dist/events/definitions/tag.js.map +0 -7
- package/dist/events/definitions/ui.js.map +0 -7
- package/dist/events/definitions/workspace.js.map +0 -7
- package/dist/events/index.js.map +0 -7
- package/dist/events/listeners.js.map +0 -7
- package/dist/events/old-definitions.js.map +0 -7
- package/dist/helpers/apply-selective-updates.d.ts +0 -19
- package/dist/helpers/apply-selective-updates.d.ts.map +0 -1
- package/dist/helpers/apply-selective-updates.js +0 -37
- package/dist/helpers/apply-selective-updates.js.map +0 -7
- package/dist/helpers/deep-clone.js.map +0 -7
- package/dist/helpers/detect-changes-proxy.js.map +0 -7
- package/dist/helpers/general.js.map +0 -7
- package/dist/helpers/generate-unique-value.js.map +0 -7
- package/dist/helpers/get-fetch.js.map +0 -7
- package/dist/helpers/get-resolved-ref.js.map +0 -7
- package/dist/helpers/is-non-optional-security-requirement.js.map +0 -7
- package/dist/helpers/merge-object.js.map +0 -7
- package/dist/helpers/overrides-proxy.js.map +0 -7
- package/dist/helpers/unpack-proxy.js.map +0 -7
- package/dist/mutators/auth.js.map +0 -7
- package/dist/mutators/cookie.js.map +0 -7
- package/dist/mutators/document.js.map +0 -7
- package/dist/mutators/environment.js.map +0 -7
- package/dist/mutators/helpers.js.map +0 -7
- package/dist/mutators/index.js.map +0 -7
- package/dist/mutators/operation/body.js.map +0 -7
- package/dist/mutators/operation/extensions.js.map +0 -7
- package/dist/mutators/operation/helpers/fetch-request-to-har.js.map +0 -7
- package/dist/mutators/operation/helpers/fetch-response-to-har.js.map +0 -7
- package/dist/mutators/operation/helpers/get-parameter-position.js.map +0 -7
- package/dist/mutators/operation/helpers/har-to-operation.js.map +0 -7
- package/dist/mutators/operation/helpers/sync-path-parameters.js.map +0 -7
- package/dist/mutators/operation/history.js.map +0 -7
- package/dist/mutators/operation/index.js.map +0 -7
- package/dist/mutators/operation/operation.js.map +0 -7
- package/dist/mutators/operation/parameters.js.map +0 -7
- package/dist/mutators/server.js.map +0 -7
- package/dist/mutators/tabs.js.map +0 -7
- package/dist/mutators/tag.js.map +0 -7
- package/dist/mutators/workspace.js.map +0 -7
- package/dist/navigation/get-navigation-options.js.map +0 -7
- package/dist/navigation/helpers/get-openapi-object.js.map +0 -7
- package/dist/navigation/helpers/get-operation-entries.js.map +0 -7
- package/dist/navigation/helpers/get-parent-entry.js.map +0 -7
- package/dist/navigation/helpers/get-tag-entries.js.map +0 -7
- package/dist/navigation/helpers/get-tag.js.map +0 -7
- package/dist/navigation/helpers/get-x-keys.js.map +0 -7
- package/dist/navigation/helpers/traverse-description.js.map +0 -7
- package/dist/navigation/helpers/traverse-document.js.map +0 -7
- package/dist/navigation/helpers/traverse-examples.js.map +0 -7
- package/dist/navigation/helpers/traverse-paths.js.map +0 -7
- package/dist/navigation/helpers/traverse-schemas.js.map +0 -7
- package/dist/navigation/helpers/traverse-tags.js.map +0 -7
- package/dist/navigation/helpers/traverse-webhooks.js.map +0 -7
- package/dist/navigation/helpers/update-order-ids.js.map +0 -7
- package/dist/navigation/helpers/utils.js.map +0 -7
- package/dist/navigation/index.js.map +0 -7
- package/dist/navigation/types.js.map +0 -7
- package/dist/persistence/index.js.map +0 -7
- package/dist/persistence/indexdb.js.map +0 -7
- package/dist/plugins/bundler/helpers.js.map +0 -7
- package/dist/plugins/bundler/index.js.map +0 -7
- package/dist/plugins/client/index.js.map +0 -7
- package/dist/plugins/client/persistence.js.map +0 -7
- package/dist/resolve.js.map +0 -7
- package/dist/schemas/compose.js.map +0 -7
- package/dist/schemas/extensions/document/x-internal.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-environments.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-icon.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-ignore.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-is-dirty.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-original-document-hash.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-registry-meta.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-sdk-installation.js.map +0 -7
- package/dist/schemas/extensions/document/x-scalar-watch-mode.js.map +0 -7
- package/dist/schemas/extensions/document/x-tags.js.map +0 -7
- package/dist/schemas/extensions/example/x-disabled.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-active-environment.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-cookies.js.map +0 -7
- package/dist/schemas/extensions/general/x-scalar-order.js.map +0 -7
- package/dist/schemas/extensions/operation/index.js.map +0 -7
- package/dist/schemas/extensions/operation/x-badge.js.map +0 -7
- package/dist/schemas/extensions/operation/x-code-samples.js.map +0 -7
- package/dist/schemas/extensions/operation/x-draft-examples.js.map +0 -7
- package/dist/schemas/extensions/operation/x-post-response.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-disable-parameters.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-selected-content-type.js.map +0 -7
- package/dist/schemas/extensions/operation/x-scalar-stability.js.map +0 -7
- package/dist/schemas/extensions/parameter/x-global.js.map +0 -7
- package/dist/schemas/extensions/schema/x-additional-properties-name.js.map +0 -7
- package/dist/schemas/extensions/schema/x-enum-descriptions.js.map +0 -7
- package/dist/schemas/extensions/schema/x-enum-varnames.js.map +0 -7
- package/dist/schemas/extensions/schema/x-examples.js.map +0 -7
- package/dist/schemas/extensions/schema/x-variable.js.map +0 -7
- package/dist/schemas/extensions/security/index.js.map +0 -7
- package/dist/schemas/extensions/security/x-default-scopes.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-credentials-location.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-body.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-query.js.map +0 -7
- package/dist/schemas/extensions/security/x-scalar-security-secrets.js.map +0 -7
- package/dist/schemas/extensions/security/x-tokenName.js.map +0 -7
- package/dist/schemas/extensions/security/x-use-pkce.js.map +0 -7
- package/dist/schemas/extensions/server/x-scalar-selected-server.js.map +0 -7
- package/dist/schemas/extensions/tag/index.js.map +0 -7
- package/dist/schemas/extensions/tag/x-display-name.js.map +0 -7
- package/dist/schemas/extensions/tag/x-tag-groups.js.map +0 -7
- package/dist/schemas/extensions/workspace/index.js.map +0 -7
- package/dist/schemas/extensions/workspace/x-scalar-active-proxy.js.map +0 -7
- package/dist/schemas/extensions/workspace/x-scalar-tabs.js.map +0 -7
- package/dist/schemas/extensions.js.map +0 -7
- package/dist/schemas/inmemory-workspace.js.map +0 -7
- package/dist/schemas/navigation.js.map +0 -7
- package/dist/schemas/reference-config/appearance.js.map +0 -7
- package/dist/schemas/reference-config/features.js.map +0 -7
- package/dist/schemas/reference-config/index.js.map +0 -7
- package/dist/schemas/reference-config/meta.js.map +0 -7
- package/dist/schemas/reference-config/routing.js.map +0 -7
- package/dist/schemas/reference-config/settings.js.map +0 -7
- package/dist/schemas/typebox-coerce.js.map +0 -7
- package/dist/schemas/v3.1/strict/callback.js.map +0 -7
- package/dist/schemas/v3.1/strict/components.js.map +0 -7
- package/dist/schemas/v3.1/strict/contact.js.map +0 -7
- package/dist/schemas/v3.1/strict/discriminator.js.map +0 -7
- package/dist/schemas/v3.1/strict/encoding.js.map +0 -7
- package/dist/schemas/v3.1/strict/example.js.map +0 -7
- package/dist/schemas/v3.1/strict/external-documentation.js.map +0 -7
- package/dist/schemas/v3.1/strict/header.js.map +0 -7
- package/dist/schemas/v3.1/strict/info.js.map +0 -7
- package/dist/schemas/v3.1/strict/license.js.map +0 -7
- package/dist/schemas/v3.1/strict/link.js.map +0 -7
- package/dist/schemas/v3.1/strict/media-type.js.map +0 -7
- package/dist/schemas/v3.1/strict/oauth-flow.js.map +0 -7
- package/dist/schemas/v3.1/strict/oauthflows.js.map +0 -7
- package/dist/schemas/v3.1/strict/openapi-document.js.map +0 -7
- package/dist/schemas/v3.1/strict/operation.js.map +0 -7
- package/dist/schemas/v3.1/strict/parameter.js.map +0 -7
- package/dist/schemas/v3.1/strict/path-item.js.map +0 -7
- package/dist/schemas/v3.1/strict/paths.js.map +0 -7
- package/dist/schemas/v3.1/strict/ref-definitions.js.map +0 -7
- package/dist/schemas/v3.1/strict/reference.js.map +0 -7
- package/dist/schemas/v3.1/strict/request-body.js.map +0 -7
- package/dist/schemas/v3.1/strict/response.js.map +0 -7
- package/dist/schemas/v3.1/strict/responses.js.map +0 -7
- package/dist/schemas/v3.1/strict/schema.js.map +0 -7
- package/dist/schemas/v3.1/strict/security-requirement.js.map +0 -7
- package/dist/schemas/v3.1/strict/security-scheme.js.map +0 -7
- package/dist/schemas/v3.1/strict/server-variable.js.map +0 -7
- package/dist/schemas/v3.1/strict/server.js.map +0 -7
- package/dist/schemas/v3.1/strict/tag.js.map +0 -7
- package/dist/schemas/v3.1/strict/type-guards.js.map +0 -7
- package/dist/schemas/v3.1/strict/xml.js.map +0 -7
- package/dist/schemas/workspace-specification/index.js.map +0 -7
- package/dist/schemas/workspace-specification/info.js.map +0 -7
- package/dist/schemas/workspace.js.map +0 -7
- package/dist/schemas.js.map +0 -7
- package/dist/server.js.map +0 -7
- package/dist/workspace-plugin.js.map +0 -7
package/dist/mutators/tabs.js
CHANGED
|
@@ -1,146 +1,189 @@
|
|
|
1
|
-
import { unpackProxyObject } from
|
|
1
|
+
import { unpackProxyObject } from '../helpers/unpack-proxy.js';
|
|
2
|
+
/**
|
|
3
|
+
* Depth level for unpacking tab proxy objects.
|
|
4
|
+
* We only need shallow unpacking since tabs are a flat array.
|
|
5
|
+
*/
|
|
2
6
|
const TAB_UNPACK_DEPTH = 1;
|
|
7
|
+
/**
|
|
8
|
+
* Helper to validate that workspace has tabs configured.
|
|
9
|
+
* Returns false if workspace or tabs are not available.
|
|
10
|
+
*/
|
|
3
11
|
const hasValidTabs = (workspace) => {
|
|
4
|
-
|
|
12
|
+
return workspace !== null && workspace['x-scalar-tabs'] !== undefined;
|
|
5
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Helper to get the unpacked tabs array from workspace.
|
|
16
|
+
* Returns the tabs as a plain array, not a proxy.
|
|
17
|
+
*/
|
|
6
18
|
const getUnpackedTabs = (workspace) => {
|
|
7
|
-
|
|
19
|
+
return unpackProxyObject(workspace['x-scalar-tabs'], { depth: TAB_UNPACK_DEPTH });
|
|
8
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Helper to get the current active tab index.
|
|
23
|
+
* Defaults to 0 if not set.
|
|
24
|
+
*/
|
|
9
25
|
const getActiveIndex = (workspace) => {
|
|
10
|
-
|
|
26
|
+
return workspace['x-scalar-active-tab'] ?? 0;
|
|
11
27
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
workspace
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
const tabs = getUnpackedTabs(workspace);
|
|
28
|
-
const activeIndex = getActiveIndex(workspace);
|
|
29
|
-
const currentTab = tabs[activeIndex];
|
|
30
|
-
if (!currentTab) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
const newTabs = [...tabs, { ...currentTab }];
|
|
34
|
-
workspace["x-scalar-tabs"] = newTabs;
|
|
35
|
-
workspace["x-scalar-active-tab"] = newTabs.length - 1;
|
|
36
|
-
return true;
|
|
28
|
+
/**
|
|
29
|
+
* Updates the tabs and active tab index in the workspace.
|
|
30
|
+
* This is used for bulk updates when synchronizing state.
|
|
31
|
+
*/
|
|
32
|
+
export const updateTabs = (workspace, payload) => {
|
|
33
|
+
if (!workspace) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (payload['x-scalar-tabs']) {
|
|
37
|
+
workspace['x-scalar-tabs'] = payload['x-scalar-tabs'];
|
|
38
|
+
}
|
|
39
|
+
if (payload['x-scalar-active-tab'] !== undefined) {
|
|
40
|
+
workspace['x-scalar-active-tab'] = payload['x-scalar-active-tab'];
|
|
41
|
+
}
|
|
37
42
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
workspace["x-scalar-active-tab"] = newActiveIndex;
|
|
57
|
-
return true;
|
|
43
|
+
/**
|
|
44
|
+
* Adds a new tab by duplicating the currently active tab.
|
|
45
|
+
* This preserves the user's context when opening a new tab.
|
|
46
|
+
*/
|
|
47
|
+
export const addTab = (workspace, _payload) => {
|
|
48
|
+
if (!hasValidTabs(workspace)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const tabs = getUnpackedTabs(workspace);
|
|
52
|
+
const activeIndex = getActiveIndex(workspace);
|
|
53
|
+
const currentTab = tabs[activeIndex];
|
|
54
|
+
if (!currentTab) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const newTabs = [...tabs, { ...currentTab }];
|
|
58
|
+
workspace['x-scalar-tabs'] = newTabs;
|
|
59
|
+
workspace['x-scalar-active-tab'] = newTabs.length - 1;
|
|
60
|
+
return true;
|
|
58
61
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Closes the currently active tab.
|
|
64
|
+
* Prevents closing if only one tab remains, to ensure the user always has a tab open.
|
|
65
|
+
* Adjusts the active index if needed to keep it in bounds.
|
|
66
|
+
*/
|
|
67
|
+
export const closeTab = (workspace, payload) => {
|
|
68
|
+
const getInputIndex = () => {
|
|
69
|
+
if ('event' in payload) {
|
|
70
|
+
return payload.event.code.startsWith('Digit') ? Number.parseInt(payload.event.key, 10) - 1 : Number.NaN;
|
|
71
|
+
}
|
|
72
|
+
return payload.index;
|
|
73
|
+
};
|
|
74
|
+
if (!hasValidTabs(workspace)) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
const index = getInputIndex();
|
|
78
|
+
const activeIndex = getActiveIndex(workspace);
|
|
79
|
+
const filteredTabs = getUnpackedTabs(workspace).filter((_, i) => i !== index);
|
|
80
|
+
if (filteredTabs.length <= 0) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
workspace['x-scalar-tabs'] = filteredTabs;
|
|
84
|
+
/**
|
|
85
|
+
* Adjust active index so it stays in bounds and points to the same logical tab when possible.
|
|
86
|
+
* - Closing a tab before the active: decrement so we stay on the same tab (now at index - 1).
|
|
87
|
+
* - Closing the active tab or one after: clamp to the new length so we never go out of bounds.
|
|
88
|
+
*/
|
|
89
|
+
const newActiveIndex = index < activeIndex ? activeIndex - 1 : Math.min(activeIndex, filteredTabs.length - 1);
|
|
90
|
+
workspace['x-scalar-active-tab'] = newActiveIndex;
|
|
91
|
+
return true;
|
|
70
92
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Closes all other tabs except the one at the given index
|
|
95
|
+
*/
|
|
96
|
+
export const closeOtherTabs = (workspace, payload) => {
|
|
97
|
+
if (!hasValidTabs(workspace)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
const tabs = getUnpackedTabs(workspace);
|
|
101
|
+
if (tabs.length <= 1) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
workspace['x-scalar-tabs'] = tabs.filter((_, index) => index === payload.index);
|
|
105
|
+
// set the active tab to the first tab since we closed all other tabs
|
|
106
|
+
workspace['x-scalar-active-tab'] = 0;
|
|
107
|
+
return true;
|
|
81
108
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Navigates to the previous tab in the list.
|
|
111
|
+
* Does nothing if already at the first tab.
|
|
112
|
+
*/
|
|
113
|
+
export const navigatePreviousTab = (workspace, _payload) => {
|
|
114
|
+
if (!hasValidTabs(workspace)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
const activeIndex = getActiveIndex(workspace);
|
|
118
|
+
if (activeIndex <= 0) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
workspace['x-scalar-active-tab'] = activeIndex - 1;
|
|
122
|
+
return true;
|
|
93
123
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
workspace["x-scalar-active-tab"] = newActiveIndex;
|
|
110
|
-
return true;
|
|
124
|
+
/**
|
|
125
|
+
* Navigates to the next tab in the list.
|
|
126
|
+
* Does nothing if already at the last tab.
|
|
127
|
+
*/
|
|
128
|
+
export const navigateNextTab = (workspace, _payload) => {
|
|
129
|
+
if (!hasValidTabs(workspace)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
const tabs = getUnpackedTabs(workspace);
|
|
133
|
+
const activeIndex = getActiveIndex(workspace);
|
|
134
|
+
if (activeIndex >= tabs.length - 1) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
workspace['x-scalar-active-tab'] = activeIndex + 1;
|
|
138
|
+
return true;
|
|
111
139
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Focuses a specific tab based on keyboard number input (1-9).
|
|
142
|
+
* Extracts the digit from the keyboard event and focuses that tab.
|
|
143
|
+
* Tab numbering starts at 1 for user convenience but uses 0-based indexing internally.
|
|
144
|
+
*/
|
|
145
|
+
export const focusTab = (workspace, payload) => {
|
|
146
|
+
if (!hasValidTabs(workspace)) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
const getInputIndex = () => {
|
|
150
|
+
if ('event' in payload) {
|
|
151
|
+
return payload.event.code.startsWith('Digit') ? Number.parseInt(payload.event.key, 10) - 1 : Number.NaN;
|
|
152
|
+
}
|
|
153
|
+
return payload.index;
|
|
154
|
+
};
|
|
155
|
+
const tabs = getUnpackedTabs(workspace);
|
|
156
|
+
const newActiveIndex = getInputIndex();
|
|
157
|
+
if (Number.isNaN(newActiveIndex) || newActiveIndex < 0 || newActiveIndex >= tabs.length) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
workspace['x-scalar-active-tab'] = newActiveIndex;
|
|
161
|
+
return true;
|
|
122
162
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Focuses the last tab in the list.
|
|
165
|
+
* This provides a quick way to jump to the end, regardless of how many tabs exist.
|
|
166
|
+
*/
|
|
167
|
+
export const focusLastTab = (workspace, _payload) => {
|
|
168
|
+
if (!hasValidTabs(workspace)) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
const tabs = getUnpackedTabs(workspace);
|
|
172
|
+
if (tabs.length <= 1) {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
workspace['x-scalar-active-tab'] = tabs.length - 1;
|
|
176
|
+
return true;
|
|
134
177
|
};
|
|
135
|
-
export {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
178
|
+
export const tabsMutatorsFactory = ({ workspace }) => {
|
|
179
|
+
return {
|
|
180
|
+
updateTabs: (payload) => updateTabs(workspace, payload),
|
|
181
|
+
addTab: (payload) => addTab(workspace, payload),
|
|
182
|
+
closeTab: (payload) => closeTab(workspace, payload),
|
|
183
|
+
closeOtherTabs: (payload) => closeOtherTabs(workspace, payload),
|
|
184
|
+
navigatePreviousTab: (payload) => navigatePreviousTab(workspace, payload),
|
|
185
|
+
navigateNextTab: (payload) => navigateNextTab(workspace, payload),
|
|
186
|
+
focusTab: (payload) => focusTab(workspace, payload),
|
|
187
|
+
focusLastTab: (payload) => focusLastTab(workspace, payload),
|
|
188
|
+
};
|
|
145
189
|
};
|
|
146
|
-
//# sourceMappingURL=tabs.js.map
|
package/dist/mutators/tag.js
CHANGED
|
@@ -1,106 +1,140 @@
|
|
|
1
|
-
import { getResolvedRef } from
|
|
2
|
-
import { unpackProxyObject } from
|
|
3
|
-
import { getNavigationOptions } from
|
|
4
|
-
import { getTagEntries } from
|
|
5
|
-
import { updateOrderIds } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { getResolvedRef } from '../helpers/get-resolved-ref.js';
|
|
2
|
+
import { unpackProxyObject } from '../helpers/unpack-proxy.js';
|
|
3
|
+
import { getNavigationOptions } from '../navigation/get-navigation-options.js';
|
|
4
|
+
import { getTagEntries } from '../navigation/helpers/get-tag-entries.js';
|
|
5
|
+
import { updateOrderIds } from '../navigation/helpers/update-order-ids.js';
|
|
6
|
+
/**
|
|
7
|
+
* Adds a new tag to the WorkspaceDocument's `tags` array.
|
|
8
|
+
*
|
|
9
|
+
* If the document or its tags property does not exist, the function safely no-ops or initializes `tags` as needed.
|
|
10
|
+
*
|
|
11
|
+
* @param document - The target WorkspaceDocument
|
|
12
|
+
* @param payload - The name of the tag to add
|
|
13
|
+
*/
|
|
14
|
+
export const createTag = (store, payload) => {
|
|
15
|
+
const document = store?.workspace.documents[payload.documentName];
|
|
16
|
+
if (!document) {
|
|
17
|
+
console.error('Document not found', { payload, store });
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (!document.tags) {
|
|
21
|
+
document.tags = [];
|
|
22
|
+
}
|
|
23
|
+
document.tags.push({
|
|
24
|
+
name: payload.name,
|
|
25
|
+
});
|
|
18
26
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Edits a tag in the WorkspaceDocument's
|
|
29
|
+
*
|
|
30
|
+
* @param document - The target WorkspaceDocument
|
|
31
|
+
* @param payload - holds the old tag and the new name
|
|
32
|
+
*/
|
|
33
|
+
export const editTag = (store, payload) => {
|
|
34
|
+
const document = store?.workspace.documents[payload.documentName];
|
|
35
|
+
const documentNavigation = document?.['x-scalar-navigation'];
|
|
36
|
+
if (!document || !documentNavigation) {
|
|
37
|
+
console.error('Document not found', { payload, store });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const oldName = payload.tag.name;
|
|
41
|
+
const newName = payload.newName;
|
|
42
|
+
if (document.tags?.length) {
|
|
43
|
+
// const plainTags = unpackProxyObject(document.tags, { depth: null })
|
|
44
|
+
document.tags = document.tags.map((_tag) => {
|
|
45
|
+
const tag = unpackProxyObject(_tag);
|
|
46
|
+
return tag.name === oldName ? { ...tag, name: newName } : tag;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
// Update the tag name in all child operations and webhooks
|
|
50
|
+
payload.tag.children?.forEach((child) => {
|
|
51
|
+
// Operation
|
|
52
|
+
if (child.type === 'operation') {
|
|
53
|
+
const operation = getResolvedRef(document.paths?.[child.path]?.[child.method]);
|
|
54
|
+
if (operation && 'tags' in operation) {
|
|
55
|
+
const plainTags = unpackProxyObject(operation.tags, { depth: null });
|
|
56
|
+
operation.tags = plainTags?.map((tag) => (tag === oldName ? newName : tag));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Webhook
|
|
60
|
+
else if (child.type === 'webhook') {
|
|
61
|
+
const webhook = getResolvedRef(document.webhooks?.[child.name]?.[child.method]);
|
|
62
|
+
if (webhook && 'tags' in webhook) {
|
|
63
|
+
const plainTags = unpackProxyObject(webhook.tags, { depth: null });
|
|
64
|
+
webhook.tags = plainTags?.map((tag) => (tag === oldName ? newName : tag));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
32
67
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
68
|
+
// Update x-tagGroups references to the renamed tag
|
|
69
|
+
if (document['x-tagGroups']) {
|
|
70
|
+
const plainGroups = unpackProxyObject(document['x-tagGroups'], { depth: null });
|
|
71
|
+
document['x-tagGroups'] = plainGroups.map((group) => ({
|
|
72
|
+
...group,
|
|
73
|
+
tags: group.tags.map((tag) => (tag === oldName ? newName : tag)),
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* We don't pass navigation options as we don't have config on the client,
|
|
78
|
+
* and we don't change path or method on the references
|
|
79
|
+
*/
|
|
80
|
+
const { generateId } = getNavigationOptions(documentNavigation.name);
|
|
81
|
+
/** Grabs all sidebar entries for the tag that is being renamed */
|
|
82
|
+
const tagEntriesMap = getTagEntries(documentNavigation);
|
|
83
|
+
const entries = tagEntriesMap.get(oldName);
|
|
84
|
+
// Updates the order ID so we don't lose the sidebar ordering when it rebuilds.
|
|
85
|
+
if (entries) {
|
|
86
|
+
updateOrderIds({ store, tag: { name: newName }, generateId, entries });
|
|
47
87
|
}
|
|
48
|
-
});
|
|
49
|
-
if (document["x-tagGroups"]) {
|
|
50
|
-
const plainGroups = unpackProxyObject(document["x-tagGroups"], { depth: null });
|
|
51
|
-
document["x-tagGroups"] = plainGroups.map((group) => ({
|
|
52
|
-
...group,
|
|
53
|
-
tags: group.tags.map((tag) => tag === oldName ? newName : tag)
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
const { generateId } = getNavigationOptions(documentNavigation.name);
|
|
57
|
-
const tagEntriesMap = getTagEntries(documentNavigation);
|
|
58
|
-
const entries = tagEntriesMap.get(oldName);
|
|
59
|
-
if (entries) {
|
|
60
|
-
updateOrderIds({ store, tag: { name: newName }, generateId, entries });
|
|
61
|
-
}
|
|
62
88
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Deletes a tag from the workspace
|
|
91
|
+
*
|
|
92
|
+
* Example:
|
|
93
|
+
* ```ts
|
|
94
|
+
* deleteTag({
|
|
95
|
+
* document,
|
|
96
|
+
* name: 'tag',
|
|
97
|
+
* })
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
export const deleteTag = (workspace, payload) => {
|
|
101
|
+
const document = workspace?.workspace.documents[payload.documentName];
|
|
102
|
+
if (!document) {
|
|
71
103
|
return;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
104
|
+
}
|
|
105
|
+
// Clear tags from all operations that have this tag
|
|
106
|
+
Object.values(document.paths ?? {}).forEach((path) => {
|
|
107
|
+
Object.values(path).forEach((operation) => {
|
|
108
|
+
// Only process operations that are objects
|
|
109
|
+
if (typeof operation !== 'object' || Array.isArray(operation)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const resolvedOperation = getResolvedRef(operation);
|
|
113
|
+
if ('tags' in resolvedOperation) {
|
|
114
|
+
const plainTags = unpackProxyObject(resolvedOperation.tags, { depth: 1 });
|
|
115
|
+
resolvedOperation.tags = plainTags?.filter((tag) => tag !== payload.name);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
78
118
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
119
|
+
// Remove the tag from all webhooks that have this tag
|
|
120
|
+
Object.values(document.webhooks ?? {}).forEach((webhook) => {
|
|
121
|
+
Object.values(webhook).forEach((operation) => {
|
|
122
|
+
if (typeof operation !== 'object' || Array.isArray(operation)) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const resolvedOperation = getResolvedRef(operation);
|
|
126
|
+
const plainTags = unpackProxyObject(resolvedOperation.tags, { depth: 1 });
|
|
127
|
+
resolvedOperation.tags = plainTags?.filter((tag) => tag !== payload.name);
|
|
128
|
+
});
|
|
88
129
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
const tagMutatorsFactory = ({ store }) => {
|
|
94
|
-
return {
|
|
95
|
-
createTag: (payload) => createTag(store, payload),
|
|
96
|
-
editTag: (payload) => editTag(store, payload),
|
|
97
|
-
deleteTag: (payload) => deleteTag(store, payload)
|
|
98
|
-
};
|
|
130
|
+
// Remove the tag from the document tags array
|
|
131
|
+
const plainDocTags = unpackProxyObject(document.tags, { depth: null });
|
|
132
|
+
document.tags = plainDocTags?.filter((tag) => tag.name !== payload.name);
|
|
99
133
|
};
|
|
100
|
-
export {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
134
|
+
export const tagMutatorsFactory = ({ store }) => {
|
|
135
|
+
return {
|
|
136
|
+
createTag: (payload) => createTag(store, payload),
|
|
137
|
+
editTag: (payload) => editTag(store, payload),
|
|
138
|
+
deleteTag: (payload) => deleteTag(store, payload),
|
|
139
|
+
};
|
|
105
140
|
};
|
|
106
|
-
//# sourceMappingURL=tag.js.map
|