@supernova-studio/client 1.9.18 → 1.9.20
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/dist/index.d.mts +101 -73
- package/dist/index.d.ts +101 -73
- package/dist/index.js +9 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/backend/backend/packages/client/dist/index.js","../../model/src/asset-delete-schedule/asset-delete-schedule.ts","../../model/src/auth/plugin-oauth-request.ts","../../model/src/auth/request.ts","../../model/src/auth/session.ts","../../model/src/billing/card.ts","../../model/src/billing/checkoutSession.ts","../../model/src/billing/customer.ts","../../model/src/billing/features.ts","../../model/src/billing/invoice.ts","../../model/src/billing/portalSession.ts","../../model/src/billing/price.ts","../../model/src/billing/product.ts","../../model/src/billing/subscription.ts","../../model/src/chat-threads/chat-message.ts","../../model/src/chat-threads/chat-thread.ts","../../model/src/common/entity.ts","../../model/src/common/object-meta.ts","../../model/src/custom-domains/custom-domains.ts","../../model/src/data-dumps/code-integration-dump.ts","../../model/src/export/exporter.ts","../../model/src/export/git-providers.ts","../../model/src/export/pulsar.ts","../../model/src/export/export-configuration.ts","../../model/src/export/pipeline.ts","../../model/src/export/export-destinations.ts","../../model/src/dsm/assets/asset-dynamo-record.ts","../../model/src/dsm/assets/asset-reference.ts","../../model/src/dsm/assets/asset-value.ts","../../model/src/dsm/assets/asset.ts","../../model/src/dsm/code-components/code-component.ts","../../model/src/dsm/components/asset-rendering.ts","../../model/src/dsm/import/support/figma-files.ts","../../model/src/dsm/import/support/import-context.ts","../../model/src/dsm/data-sources/data-source.ts","../../model/src/dsm/import/warning.ts","../../model/src/dsm/data-sources/import-summary.ts","../../model/src/dsm/elements/data/base.ts","../../model/src/dsm/elements/data/blur.ts","../../model/src/dsm/elements/data/dimension.ts","../../model/src/dsm/elements/data/border-radius.ts","../../model/src/dsm/elements/data/border-width.ts","../../model/src/dsm/elements/data/border.ts","../../model/src/dsm/elements/data/color.ts","../../model/src/dsm/elements/data/opacity.ts","../../model/src/dsm/elements/data/component.ts","../../model/src/dsm/elements/component-properties.ts","../../model/src/dsm/elements/data/documentation-block-v1.ts","../../model/src/utils/content-loader-instruction.ts","../../model/src/utils/interop-pulsar-error.ts","../../model/src/utils/slugify.ts","../../model/src/dsm/properties/property-definition.ts","../../model/src/dsm/properties/property-value.ts","../../model/src/dsm/elements/primitives/point.ts","../../model/src/dsm/elements/primitives/size.ts","../../model/src/dsm/elements/raw-element.ts","../../model/src/dsm/elements/data/documentation-block-v2.ts","../../model/src/dsm/documentation/block-definitions/item.ts","../../model/src/dsm/documentation/block-definitions/aux.ts","../../model/src/dsm/documentation/block-definitions/variant.ts","../../model/src/dsm/elements/data/documentation-page-v1.ts","../../model/src/dsm/elements/data/documentation-v1.ts","../../model/src/dsm/elements/data/item-header-v1.ts","../../model/src/dsm/elements/data/item-header.ts","../../model/src/dsm/elements/data/documentation-page-v2.ts","../../model/src/dsm/elements/data/documentation-v2.ts","../../model/src/dsm/elements/data/item-header-v2.ts","../../model/src/dsm/elements/data/documentation-section-v2.ts","../../model/src/dsm/elements/page-block-v2.ts","../../model/src/dsm/elements/base.ts","../../model/src/dsm/elements/data/duration.ts","../../model/src/dsm/elements/data/figma-file-structure.ts","../../model/src/dsm/elements/data/figma-node-reference.ts","../../model/src/dsm/elements/data/font-family.ts","../../model/src/dsm/elements/data/font-size.ts","../../model/src/dsm/elements/data/font-weight.ts","../../model/src/dsm/elements/data/font.ts","../../model/src/dsm/elements/data/gradient.ts","../../model/src/dsm/elements/data/group.ts","../../model/src/dsm/elements/data/letter-spacing.ts","../../model/src/dsm/elements/data/line-height.ts","../../model/src/dsm/elements/data/paragraph-indent.ts","../../model/src/dsm/elements/data/paragraph-spacing.ts","../../model/src/dsm/elements/data/product-copy.ts","../../model/src/dsm/elements/data/safe-id.ts","../../model/src/dsm/elements/data/shadow.ts","../../model/src/dsm/elements/data/size.ts","../../model/src/dsm/elements/data/space.ts","../../model/src/dsm/elements/data/string.ts","../../model/src/dsm/elements/data/text-case.ts","../../model/src/dsm/elements/data/text-decoration.ts","../../model/src/dsm/elements/data/typography.ts","../../model/src/dsm/elements/data/visibility.ts","../../model/src/dsm/elements/data/z-index.ts","../../model/src/dsm/elements/documentation-page-v1.ts","../../model/src/dsm/elements/group.ts","../../model/src/dsm/elements/documentation-page-v2.ts","../../model/src/dsm/elements/figma-component.ts","../../model/src/dsm/elements/figma-file-structures.ts","../../model/src/dsm/elements/figma-node-reference.ts","../../model/src/dsm/elements/theme.ts","../../model/src/dsm/elements/tokens.ts","../../model/src/dsm/data-sources/figma.ts","../../model/src/dsm/data-sources/import-job.ts","../../model/src/dsm/import/support/import-model-collections.ts","../../model/src/dsm/import/collection.ts","../../model/src/dsm/collection.ts","../../model/src/dsm/import/component.ts","../../model/src/dsm/import/base.ts","../../model/src/dsm/import/image.ts","../../model/src/dsm/import/data-source.ts","../../model/src/dsm/import/figma-frames.ts","../../model/src/dsm/import/theme.ts","../../model/src/dsm/import/tokens.ts","../../model/src/dsm/documentation/approvals/approval-state.ts","../../model/src/dsm/documentation/approvals/approval.ts","../../model/src/dsm/documentation/block-definitions/definition.ts","../../model/src/dsm/documentation/group.ts","../../model/src/dsm/documentation/link-preview.ts","../../model/src/dsm/documentation/page-anchor.ts","../../model/src/dsm/documentation/page-content-backup.ts","../../model/src/dsm/documentation/page-content.ts","../../model/src/dsm/documentation/page-dependencies.ts","../../model/src/dsm/documentation/page.ts","../../model/src/dsm/documentation/redirects.ts","../../model/src/dsm/documentation/settings.ts","../../model/src/dsm/documentation/thread.ts","../../model/src/dsm/element-snapshots/base.ts","../../model/src/dsm/element-snapshots/documentation-page-snapshot.ts","../../model/src/dsm/figma-exporter/figma-exporter.ts","../../model/src/dsm/figma-node-renderer/renderer-payload.ts","../../model/src/dsm/figma-node-structures/structure-data.ts","../../model/src/dsm/figma-node-structures/structure.ts","../../model/src/dsm/membership/design-system-membership.ts","../../model/src/workspace/npm-registry-settings.ts","../../model/src/workspace/sso-provider.ts","../../model/src/workspace/untyped-data.ts","../../model/src/workspace/user-invite.ts","../../model/src/workspace/workspace-role.ts","../../model/src/workspace/workspace-configuration.ts","../../model/src/workspace/workspace.ts","../../model/src/workspace/workspace-context.ts","../../model/src/workspace/workspace-create.ts","../../model/src/workspace/workspace-invitations.ts","../../model/src/workspace/workspace-membership.ts","../../model/src/users/linked-integrations.ts","../../model/src/users/user-analytics-cleanup-schedule.ts","../../model/src/users/user-identity.ts","../../model/src/users/user-minified.ts","../../model/src/users/user-notification-settings.ts","../../model/src/users/user-profile.ts","../../model/src/users/user-test.ts","../../model/src/users/user.ts","../../model/src/dsm/membership/ds-role.ts","../../model/src/dsm/membership/invitations.ts","../../model/src/dsm/views/column.ts","../../model/src/dsm/views/view.ts","../../model/src/dsm/brand.ts","../../model/src/dsm/design-system.ts","../../model/src/dsm/exporter-property-values-collection.ts","../../model/src/dsm/published-doc-page-visits.ts","../../model/src/dsm/published-doc-page.ts","../../model/src/dsm/published-doc.ts","../../model/src/dsm/storybook-entry.ts","../../model/src/dsm/storybook-payload.ts","../../model/src/dsm/version.ts","../../model/src/data-dumps/design-system-dump.ts","../../model/src/data-dumps/design-system-version-dump.ts","../../model/src/liveblocks/rooms/design-system-version-room.ts","../../model/src/liveblocks/rooms/documentation-page-room.ts","../../model/src/liveblocks/rooms/room-type.ts","../../model/src/liveblocks/rooms/workspace-room.ts","../../model/src/data-dumps/published-docs-dump.ts","../../model/src/data-dumps/user-data-dump.ts","../../model/src/data-dumps/workspace-dump.ts","../../model/src/integrations/integration.ts","../../model/src/docs-server/session.ts","../../model/src/emails/design-system-invite.ts","../../model/src/emails/workspace-invite.ts","../../model/src/events/base.ts","../../model/src/events/data-source-imported.ts","../../model/src/events/version-released.ts","../../model/src/events/documentation-published.ts","../../model/src/export/export-runner/export-context.ts","../../model/src/export/export-runner/exporter-payload.ts","../../model/src/export/export-jobs.ts","../../model/src/export/exporter-list-query.ts","../../model/src/export/exporter-workspace-membership-role.ts","../../model/src/export/exporter-workspace-membership.ts","../../model/src/feature-flags/feature-flags.ts","../../model/src/integrations/external-oauth-request.ts","../../model/src/integrations/oauth-providers.ts","../../model/src/integrations/git.ts","../../model/src/integrations/oauth-token.ts","../../model/src/integrations/workspace-oauth-requests.ts","../../model/src/npm/npm-package.ts","../../model/src/npm/npm-proxy-token-payload.ts","../../model/src/portal/portal-settings.ts","../../model/src/tokens/personal-access-token.ts","../../model/src/helpers/db.ts","../../model/src/helpers/nullish-to-optional.ts","../../model/src/utils/errors.ts","../../model/src/utils/common.ts","../../model/src/utils/short-persistent-id.ts","../../model/src/utils/validation.ts","../../model/src/dsm/elements/utils.ts","../../model/src/dsm/element-snapshots/group-snapshot.ts","../src/api/conversion/analytics/page-visits-to-dto.ts","../src/api/conversion/analytics/page-visits-to-comparison-dto.ts","../src/api/conversion/analytics/page-visits-to-heatmap-dto.ts","../src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts","../src/api/conversion/documentation/documentation-page-to-dto-utils.ts","../src/api/conversion/documentation/documentation-group-v1-to-dto.ts","../src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts","../src/api/conversion/documentation/documentation-group-v2-to-dto.ts","../src/api/conversion/documentation/documentation-page-v1-to-dto.ts","../src/api/conversion/documentation/documentation-page-v2-to-dto.ts","../src/api/conversion/export/pipeline.ts","../src/api/conversion/integrations/git.ts","../src/api/conversion/integrations/integration.ts","../src/api/dto/access-tokens/access-token.ts","../src/api/dto/aux/color.ts","../src/api/dto/aux/meta.ts","../src/api/dto/aux/pagination.ts","../src/api/dto/bff/app-bootstrap-data.ts","../src/api/dto/design-systems/brand.ts","../src/api/dto/design-systems/code-component.ts","../src/api/dto/design-systems/component.ts","../src/api/dto/design-systems/contact.ts","../src/api/dto/users/authenticated-user.ts","../src/api/dto/users/user.ts","../src/api/dto/users/update.ts","../src/api/dto/design-systems/data-source.ts","../src/api/dto/design-systems/design-system.ts","../src/api/dto/design-systems/members.ts","../src/api/dto/design-systems/role.ts","../src/api/dto/design-systems/elements-diff.ts","../src/api/dto/design-systems/figma-variables.ts","../src/api/dto/design-systems/file.ts","../src/api/dto/design-systems/import-job.ts","../src/api/dto/design-systems/redirects.ts","../src/api/dto/design-systems/stats.ts","../src/api/dto/design-systems/storybook.ts","../src/api/dto/design-systems/user-design-systems.ts","../src/api/dto/workspaces/chat-threads.ts","../src/api/dto/workspaces/git.ts","../src/api/dto/workspaces/integrations.ts","../src/api/dto/workspaces/invitations.ts","../src/api/dto/workspaces/membership.ts","../src/api/dto/workspaces/workspace.ts","../src/api/dto/workspaces/npm-registry.ts","../src/api/dto/workspaces/untyped-data.ts","../src/api/dto/design-systems/version-room.ts","../src/api/dto/design-systems/version.ts","../src/api/payloads/design-systems/update-design-system.ts","../src/api/payloads/design-systems/version.ts","../src/api/payloads/documentation/analytics.ts","../src/api/payloads/documentation/block-definitions.ts","../src/api/dto/documentation/block-definition.ts","../src/api/payloads/documentation/design-data-doc-diff.ts","../src/api/payloads/export/pipeline.ts","../src/api/dto/export/exporter-property.ts","../src/api/payloads/liveblocks/auth.ts","../src/api/payloads/users/notifications/notification-settings.ts","../src/api/payloads/users/profile/update.ts","../src/api/payloads/workspaces/transfer-ownership.ts","../src/api/payloads/workspaces/workspace-configuration.ts","../src/api/payloads/workspaces/workspace-integrations.ts","../src/api/dto/design-systems/view.ts","../src/api/dto/collections/token-collection.ts","../src/api/dto/design-tokens/design-token.ts","../src/api/dto/documentation/analytics-v2.ts","../src/api/dto/documentation/analytics.ts","../src/api/dto/documentation/anchor.ts","../src/api/dto/documentation/approvals.ts","../src/api/dto/documentation/block.ts","../src/api/dto/documentation/documentation-page-snapshot.ts","../src/api/dto/elements/documentation/page-v2.ts","../src/api/dto/elements/documentation/draft-state.ts","../src/api/dto/elements/documentation/item-configuration-v2.ts","../src/api/dto/elements/documentation/metadata.ts","../src/api/dto/documentation/link-preview.ts","../src/api/dto/documentation/publish.ts","../src/api/dto/export/exporter.ts","../src/api/dto/export/filter.ts","../src/api/dto/export/job.ts","../src/api/dto/export/pipeline.ts","../src/api/dto/documentation/room.ts","../src/api/dto/elements/components/figma-component-group.ts","../src/api/dto/elements/components/figma-component.ts","../src/api/dto/elements/documentation/group-action.ts","../src/api/dto/elements/documentation/group-v2.ts","../src/api/dto/elements/documentation/group-v1.ts","../src/api/dto/elements/documentation/item-configuration-v1.ts","../src/api/dto/elements/documentation/hierarchy.ts","../src/api/dto/elements/documentation/page-actions-v2.ts","../src/api/dto/elements/documentation/page-content.ts","../src/api/dto/elements/documentation/page-dependencies.ts","../src/api/dto/elements/documentation/page-v1.ts","../src/api/dto/elements/documentation/settings.ts","../src/api/dto/elements/documentation/structure.ts","../src/api/dto/elements/figma-nodes/figma-node-structure.ts","../src/api/dto/elements/figma-nodes/figma-node-v1.ts","../src/api/dto/elements/figma-nodes/figma-node.ts","../src/api/dto/elements/figma-nodes/figma-node-v2.ts","../src/api/dto/elements/figma-nodes/node-actions-v2.ts","../src/api/dto/elements/frame-node-structures/frame-node-structure.ts","../src/api/dto/elements/properties/property-definitions.ts","../src/api/dto/elements/properties/property-values.ts","../src/api/dto/elements/elements-action-v2.ts","../src/api/dto/elements/get-elements-v2.ts","../src/api/dto/figma-components/assets/download.ts","../src/api/dto/figma-exporter/figma-node.ts","../src/api/dto/liveblocks/auth-response.ts","../src/api/dto/portal/portal-settings.ts","../src/api/dto/themes/override.ts","../src/api/dto/themes/theme.ts","../src/utils/figma.ts","../src/utils/hash.ts","../src/utils/query.ts","../src/utils/redirect-validation.ts","../src/api/endpoints/codegen/exporters.ts","../src/api/endpoints/codegen/jobs.ts","../src/api/endpoints/codegen/pipelines.ts","../src/api/endpoints/codegen/codegen.ts","../src/api/endpoints/design-system/versions/brands.ts","../src/api/endpoints/design-system/versions/code-components.ts","../src/api/endpoints/design-system/versions/documentation.ts","../src/api/endpoints/design-system/versions/ds-components.ts","../src/api/endpoints/design-system/versions/elements-action.ts","../src/api/endpoints/design-system/versions/elements.ts","../src/api/endpoints/design-system/versions/figma-component-groups.ts","../src/api/endpoints/design-system/versions/figma-components.ts","../src/api/endpoints/design-system/versions/figma-frame-structures.ts","../src/api/endpoints/design-system/versions/files.ts","../src/api/endpoints/design-system/versions/import-jobs.ts","../src/api/endpoints/design-system/versions/overrides.ts","../src/api/endpoints/design-system/versions/property-definitions.ts","../src/api/endpoints/design-system/versions/property-values.ts","../src/api/endpoints/design-system/versions/stats.ts","../src/api/endpoints/design-system/versions/themes.ts","../src/api/endpoints/design-system/versions/token-collections.ts","../src/api/endpoints/design-system/versions/token-groups.ts","../src/api/endpoints/design-system/versions/tokens.ts","../src/api/endpoints/design-system/versions/versions.ts","../src/api/endpoints/design-system/analytics.ts","../src/api/endpoints/design-system/bff.ts","../src/api/endpoints/design-system/contact.ts","../src/api/endpoints/design-system/design-systems.ts","../src/api/endpoints/design-system/figma-node-structures.ts","../src/api/endpoints/design-system/members.ts","../src/api/endpoints/design-system/redirects.ts","../src/api/endpoints/design-system/sources.ts","../src/api/endpoints/design-system/storybook.ts","../src/api/endpoints/design-system/storybook-hosting.ts","../src/api/endpoints/workspaces/chat-threads.ts","../src/api/endpoints/workspaces/integrations.ts","../src/api/endpoints/workspaces/invites.ts","../src/api/endpoints/workspaces/members.ts","../src/api/endpoints/workspaces/npm-register.ts","../src/api/endpoints/workspaces/workspaces.ts","../src/api/endpoints/liveblocks.ts","../src/api/endpoints/users.ts","../src/api/transport/request-executor-error.ts","../src/api/transport/request-executor.ts","../src/api/client.ts","../src/events/design-system.ts","../src/events/event.ts","../src/sync/docs-structure-repo.ts","../src/yjs/design-system-content/documentation-hierarchy.ts","../src/yjs/version-room/base.ts","../src/yjs/version-room/compute-dto.ts","../src/yjs/version-room/utils.ts","../src/yjs/version-room/frontend.ts","../src/yjs/design-system-content/item-configuration.ts","../src/yjs/docs-editor/model/block.ts","../src/yjs/docs-editor/model/page.ts","../src/yjs/docs-editor/prosemirror/inner-editor-schema.ts","../src/yjs/docs-editor/prosemirror/main-editor-schema.ts","../src/yjs/docs-editor/blocks-to-prosemirror.ts","../src/yjs/docs-editor/utils.ts","../src/yjs/docs-editor/list-tree-builder.ts","../src/yjs/docs-editor/mock.ts","../src/yjs/docs-editor/prosemirror-to-blocks.ts","../src/yjs/version-room/backend.ts","../src/sync/local-action-executor.ts"],"names":["z","GitProviderNames","rest","RoomTypeEnum","OAuthProviderNames","ObjectMeta","PrimitiveValue","ArrayValue","ObjectValue","SuccessPayload","CODE_NAME_REGEX","ParsedFigmaFileURLError","blocks","mapByUnique"],"mappings":"AAAA,qxBAAI,UAAU,EAAE,MAAM,CAAC,cAAc;AACrC,IAAI,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK;AAC/J,IAAI,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC,GAAG,EAAE,OAAO,IAAI,IAAI,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC;AAC9G;AACA;ACJA,oEAAkB;ACAlB;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACIA;ACJA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA,k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A,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACF;AAEmC;A0JjnBV;A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ACrB,EAAA;AACoB,EAAA;AACI,EAAA;AACZ,EAAA;AACI,EAAA;AACI,EAAA;AAC3B;AAKmC;AACb,EAAA;AACvB;ARvK2C;AAEL;AACpC,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACD;AAEsC;AACrC,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACD;AAEyC;AACA;AACA;AACA;AAED;AAEE;AAMJ;AACT,EAAA;AACtB,EAAA;AACP;AAEuC;AACzB,EAAA;AACgB,EAAA;AAC9B;AAEoC;AACR,EAAA;AACIA,EAAAA;AACCA,EAAAA;AACjC;AAEqC;AACFA,EAAAA;AACP,EAAA;AACK,EAAA;AACL,EAAA;AACIA,EAAAA;AACF,EAAA;AACG,EAAA;AACL,EAAA;AACC,EAAA;AAC7B;AAEsC;AACd,EAAA;AACJ,EAAA;AACK,EAAA;AACG,EAAA;AACIA,EAAAA;AACd,EAAA;AACS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ACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACU,IAAA;AACC,MAAA;AACC,MAAA;AACA,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACK,IAAA;AACM,MAAA;AACX,IAAA;AACW,IAAA;AACF,MAAA;AACC,MAAA;AACI,MAAA;AACF,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACG,MAAA;AACT,IAAA;AACY,IAAA;AACD,MAAA;AACF,MAAA;AACG,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACA,MAAA;AACE,QAAA;AACI,UAAA;AACX,QAAA;AACM,QAAA;AACK,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACC,IAAA;AACO,MAAA;AACJ,MAAA;AACC,QAAA;AACK,UAAA;AACX,QAAA;AACQ,QAAA;AACG,UAAA;AACX,QAAA;AACK,QAAA;AACM,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACM,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AACQ,IAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AACQ,IAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACI,UAAA;AACb,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACM,MAAA;AACJ,MAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AACF;AAE4C;AzXokVR;AACA;A0XrtVb;AAEF;AACV,EAAA;AACF,EAAA;AACM,IAAA;AACA,MAAA;AACF,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACgB,IAAA;AACP,MAAA;AACD,MAAA;AACK,MAAA;AACJ,MAAA;AACE,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACU,IAAA;AACG,MAAA;AACF,MAAA;AACC,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACO,IAAA;AACM,MAAA;AACF,MAAA;AACF,MAAA;AACI,MAAA;AACD,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACW,IAAA;AACE,MAAA;AACF,MAAA;AACE,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACU,QAAA;AACC,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACA,MAAA;AACF,MAAA;AACE,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACU,QAAA;AACC,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACgB,IAAA;AACL,MAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACD,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACW,IAAA;AACF,MAAA;AACC,MAAA;AACI,MAAA;AACF,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACG,MAAA;AACT,IAAA;AACS,IAAA;AACE,MAAA;AACF,MAAA;AACG,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA;AACU,IAAA;AACC,MAAA;AACC,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACY,IAAA;AACD,MAAA;AACF,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACgB,IAAA;AACP,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACY,IAAA;AACD,MAAA;AACF,MAAA;AACI,MAAA;AACD,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACc,IAAA;AACH,MAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACE,UAAA;AACgB,YAAA;AACvB,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACD,MAAA;AACM,MAAA;AACD,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACmB,IAAA;AACR,MAAA;AACF,MAAA;AACD,MAAA;AACM,MAAA;AACD,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACK,IAAA;AACM,MAAA;AACX,IAAA;AACS,IAAA;AACE,MAAA;AACF,MAAA;AACI,MAAA;AACD,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACM,QAAA;AACK,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACO,IAAA;AACE,MAAA;AACD,MAAA;AACK,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACY,QAAA;AACD,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACW,IAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACY,QAAA;AACD,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACC,IAAA;AACO,MAAA;AACJ,MAAA;AACC,QAAA;AACK,UAAA;AACX,QAAA;AACQ,QAAA;AACG,UAAA;AACX,QAAA;AACK,QAAA;AACM,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACkB,IAAA;AACT,MAAA;AACQ,QAAA;AACF,UAAA;AACX,QAAA;AACU,QAAA;AACC,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACM,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AACQ,IAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AAC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AA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAA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UAAA;AACF,QAAA;AACF,MAAA;AAC0B,MAAA;AAChB,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACF,UAAA;AAChB,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACF,UAAA;AAChB,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACF,UAAA;AAChB,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACkB,MAAA;AAC9B,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AAER,QAAA;AACJ,MAAA;AACc,MAAA;AAChB,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACy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;AACK,YAAA;AACtB,UAAA;AACF,QAAA;AACF,MAAA;AAC0B,MAAA;AAChB,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACoB,UAAA;AACd,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AAC8B,IAAA;AACf,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACO,YAAA;AACD,YAAA;AACE,YAAA;AACC,YAAA;AAClB,UAAA;AACgB,UAAA;AACF,YAAA;AACM,cAAA;AACD,cAAA;AACF,cAAA;AACf,YAAA;AACF,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACY,YAAA;AACL,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACY,YAAA;AACL,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;A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A;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACa,UAAA;AACd,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACa,UAAA;AACd,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACa,UAAA;AACd,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AAC8B,IAAA;AACf,IAAA;AACD,MAAA;AACA,QAAA;AAER,QAAA;AACJ,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACoB,IAAA;AACpB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACI,UAAA;AACZ,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACa,YAAA;AACN,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACa,YAAA;AACN,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACJ,UAAA;AACV,YAAA;AACF,UAAA;AACF,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACa,YAAA;AACN,YAAA;AACG,YAAA;AACX,YAAA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R,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACK,YAAA;AACE,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACK,YAAA;AACE,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACA,MAAA;AACO,QAAA;AACF,QAAA;AACf,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AAER,QAAA;AACJ,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACuB,IAAA;AACvB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACS,YAAA;AAChB,YAAA;AACF,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACK,YAAA;AACE,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACA,MAAA;AACO,QAAA;AACF,QAAA;AACf,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf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AAA;AACG,MAAA;AAGS,MAAA;AACF,MAAA;AAC3B,IAAA;AACF,EAAA;AACF;AAE0B;AAM8B,EAAA;AALrC,IAAA;AACQ,IAAA;AACV,MAAA;AACd,IAAA;AAGiB,IAAA;AAClB,EAAA;AAEgC,EAAA;AACF,IAAA;AAC9B,EAAA;AAEU,EAAA;AACkB,IAAA;AAC5B,EAAA;AAEQ,EAAA;AACW,IAAA;AACnB,EAAA;AACF;AhXmheoC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/backend/backend/packages/client/dist/index.js","sourcesContent":[null,"import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../helpers\";\n\nconst AssetDeleteScheduleStatus = z.enum([\"InProgress\", \"Pending\"]);\nexport type AssetDeleteScheduleStatus = z.infer<typeof AssetDeleteScheduleStatus>;\n\n\nexport const AssetDeleteSchedule = z.object({\n id: z.string(),\n path: z.string(),\n createdAt: z.date(),\n deleteAt: z.date(),\n isFolder: z.boolean(),\n status: AssetDeleteScheduleStatus,\n});\n\nexport type AssetDeleteSchedule = z.infer<typeof AssetDeleteSchedule>;\n\nexport type AssetDeleteScheduleDbInput = DbCreateInputOmit<AssetDeleteSchedule>;\n\n","import { z } from \"zod\";\n\nexport const PluginOAuthRequestSchema = z.object({\n id: z.string(),\n codeChallenge: z.string(),\n readKey: z.string(),\n writeKey: z.string(),\n readKeyConsumed: z.boolean(),\n writeKeyConsumed: z.boolean(),\n oAuthCode: z.string().optional(),\n createdAt: z.coerce.date(),\n});\n\nexport type PluginOAuthRequest = z.infer<typeof PluginOAuthRequestSchema>;\n","import { z } from \"zod\";\n\nexport const AuthV2Request = z.object({\n code: z.string().optional(),\n state: z.string(),\n codeChallenge: z.string(),\n codeChallengeMethod: z.string(),\n redirectUri: z.string(),\n sessionId: z.string(),\n});\n\nexport type AuthV2Request = z.infer<typeof AuthV2Request>;\n","import { z } from \"zod\";\n\nexport const AuthV2Session = z.object({\n id: z.string(),\n refreshToken: z.string(),\n expiresAt: z.coerce.date(),\n createdAt: z.coerce.date(),\n});\n\nexport type AuthV2Session = z.infer<typeof AuthV2Session>;\n","import { z } from \"zod\";\n\nexport const CardSchema = z.object({\n cardId: z.string().nullish(),\n last4: z.string().length(4).nullish(),\n expiryMonth: z.string().nullish(),\n expiryYear: z.string().nullish(),\n brand: z.string().nullish(),\n name: z.string().nullish(),\n});\n\nexport type Card = z.infer<typeof CardSchema>;\n","import { z } from \"zod\";\n\nexport const PostStripeCheckoutBodyInputSchema = z.object({\n priceId: z.string(),\n successUrl: z.string().url(),\n cancelUrl: z.string().url(),\n quantity: z.number().int().min(1).optional(),\n});\n\nexport const PostStripeCheckoutOutputSchema = z.object({\n id: z.string(),\n url: z.string().nullish(),\n});\n\nexport type StripeCheckoutInput = z.infer<typeof PostStripeCheckoutBodyInputSchema>;\nexport type StripeCheckoutOutput = z.infer<typeof PostStripeCheckoutOutputSchema>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../helpers\";\n\nexport const Customer = z.object({\n id: z.string(),\n});\n\nexport const Address = z.object({\n street1: nullishToOptional(z.string()),\n street2: nullishToOptional(z.string()),\n city: nullishToOptional(z.string()),\n postal: nullishToOptional(z.string()),\n country: nullishToOptional(z.string()),\n state: nullishToOptional(z.string()),\n});\n\nexport const BillingDetails = z.object({\n address: nullishToOptional(Address),\n email: nullishToOptional(z.string()),\n companyName: nullishToOptional(z.string()),\n companyId: nullishToOptional(z.string()),\n notes: nullishToOptional(z.string()),\n vat: nullishToOptional(z.string()),\n poNumber: nullishToOptional(z.string()),\n});\n\nexport type Customer = z.infer<typeof Customer>;\nexport type Address = z.infer<typeof Address>;\nexport type BillingDetails = z.infer<typeof BillingDetails>;\n","import { z } from \"zod\";\n\nconst featureLimitedSchema = z.object({\n max: z.number().optional(),\n errorMessage: z.string(),\n errorReason: z.string(),\n});\n\nconst featureToggleSchema = z.object({\n enabled: z.boolean(),\n errorMessage: z.string(),\n errorReason: z.string(),\n});\n\nconst featureWithImportJobsSchema = featureLimitedSchema.extend({\n noImportJobsErrorMessage: z.string(),\n noImportJobsErrorReason: z.string(),\n});\n\nexport const FeaturesSummary = z.object({\n designSystems: featureLimitedSchema,\n designSystemSources: featureWithImportJobsSchema,\n designSystemVersions: featureLimitedSchema,\n themes: featureLimitedSchema,\n brands: featureLimitedSchema,\n codegenSchedules: featureLimitedSchema,\n publicDocumentation: featureToggleSchema,\n customDocumentationUrl: featureToggleSchema,\n customDocumentationViewButton: featureToggleSchema,\n designSystemSourceAutoImport: featureToggleSchema,\n designSystemSlug: featureToggleSchema,\n ipWhitelisting: featureToggleSchema,\n npmRegistry: featureToggleSchema,\n sso: featureToggleSchema,\n workspacePaidSeats: featureLimitedSchema,\n workspaceViewers: featureLimitedSchema,\n customDocumentationExporter: featureToggleSchema,\n protectedPages: featureToggleSchema,\n approvals: featureToggleSchema,\n selectivePublishing: featureToggleSchema,\n designSystemAccessModes: featureToggleSchema,\n designSystemRoles: featureToggleSchema,\n documentationPageRedirects: featureToggleSchema,\n analytics: featureLimitedSchema,\n designSystemFileSize: featureLimitedSchema,\n});\n\nexport type FeatureLimitedDetails = z.infer<typeof featureLimitedSchema>;\nexport type FeatureToggleDetails = z.infer<typeof featureToggleSchema>;\nexport type FeatureWithImportJobsDetails = z.infer<typeof featureWithImportJobsSchema>;\nexport type FeaturesSummary = z.infer<typeof FeaturesSummary>;\n","import { z } from \"zod\";\nimport { CardSchema } from \"./card\";\n\nexport const InvoiceSchema = z.object({\n id: z.string(),\n number: z.string(),\n amount_due: z.number(),\n date: z.coerce.date(),\n hostedUrl: z.string().url(),\n card: CardSchema.nullish(),\n});\n\nexport const PeriodSchema = z.object({\n start: z.coerce.date(),\n end: z.coerce.date(),\n});\n\nexport const InvoiceLineSchema = z.object({\n amount: z.number(),\n period: PeriodSchema,\n proration: z.boolean(),\n description: z.string(),\n type: z.string(),\n});\n\nexport const InvoiceCouponSchema = z.object({\n amount_off: z.number(),\n percent_off: z.number(),\n name: z.string(),\n});\n\nexport type Invoice = z.infer<typeof InvoiceSchema>;\nexport type InvoiceLine = z.infer<typeof InvoiceLineSchema>;\nexport type InvoiceCoupon = z.infer<typeof InvoiceCouponSchema>;\n","import { z } from \"zod\";\n\nexport const PostStripePortalUpdateSessionBodyInputSchema = z.object({\n priceId: z.string(),\n numberOfSeats: z.number().int(),\n});\nexport const PostStripePortalSessionBodyInputSchema = z.object({\n returnUrl: z.string().url(),\n update: PostStripePortalUpdateSessionBodyInputSchema.optional(),\n cancel: z.boolean().optional(),\n});\n\nexport const PostStripePortalSessionOutputSchema = z.object({\n id: z.string(),\n url: z.string().nullish(),\n});\n\nexport type StripePortalSessionInput = z.infer<typeof PostStripePortalSessionBodyInputSchema>;\nexport type StripePortalSessionOutput = z.infer<typeof PostStripePortalSessionOutputSchema>;\n","import { z } from \"zod\";\n\nexport const BillingIntervalSchema = z.enum([\"daily\", \"monthly\", \"weekly\", \"yearly\"]);\n\nexport const PriceSchema = z.object({\n stripePriceId: z.string(),\n stripeProductId: z.string(),\n stripeProductName: z.string().optional(),\n stripeProductDescription: z.string().optional(),\n active: z.boolean(),\n amount: z.number(),\n interval: BillingIntervalSchema,\n isPricePerCreator: z.boolean().optional(),\n isTrial: z.boolean().optional(),\n isHidden: z.boolean().optional(),\n minimumSeats: z.number().optional(),\n legacyVersion: z.string().optional(),\n featuresSet: z.string().optional(),\n stripeProductFeatures: z.array(z.string()).optional(),\n stripeProductAdditionalFeatures: z.array(z.string()).optional(),\n});\n\nexport type BillingInterval = z.infer<typeof BillingIntervalSchema>;\nexport type Price = z.infer<typeof PriceSchema>;\n","import { z } from \"zod\";\n\nexport const ProductCodeSchema = z.enum([\"free\", \"team\", \"company\", \"enterprise\"]);\nexport type ProductCode = z.infer<typeof ProductCodeSchema>;\nexport const ProductCode = ProductCodeSchema.enum;\n","import { CardSchema } from \"./card\";\nimport { ProductCodeSchema } from \"./product\";\nimport { FeaturesSummary } from \"./features\";\nimport { BillingIntervalSchema } from \"./price\";\nimport { z } from \"zod\";\nexport const StripeSubscriptionStatusSchema = z.enum([\n \"trialing\",\n \"active\",\n \"past_due\",\n \"canceled\",\n \"unpaid\",\n \"incomplete_expired\",\n \"incomplete\",\n \"unknown\",\n]);\n\nexport const InternalStatusSchema = z.enum([\"active\", \"suspended\", \"gracePeriod\", \"cancelled\", \"downgraded_to_free\"]);\n\nexport const BillingTypeSchema = z.enum([\"Auto\", \"Invoice\"]);\n\nexport type StripeSubscriptionStatus = z.infer<typeof StripeSubscriptionStatusSchema>;\nexport type InternalStatus = z.infer<typeof InternalStatusSchema>;\nexport type BillingType = z.infer<typeof BillingTypeSchema>;\n\nexport const StripeSubscriptionStatus = StripeSubscriptionStatusSchema.enum;\nexport const InternalStatus = InternalStatusSchema.enum;\nexport const BillingType = BillingTypeSchema.enum;\n\nexport const Subscription = z.object({\n stripeSubscriptionId: z.string().nullish(),\n stripeCustomerId: z.string().nullish(),\n\n status: InternalStatusSchema.optional(),\n subscriptionStatus: StripeSubscriptionStatusSchema.optional(), // the stripe API official status\n internalStatus: InternalStatusSchema.optional(), // TODO: delete when create/get workspace will stop using it in the former API\n\n product: ProductCodeSchema,\n featuresSummary: FeaturesSummary.optional(),\n stripeProductDescription: z.string().optional(),\n stripeProductFeatures: z.array(z.string()).optional(),\n stripeProductAdditionalFeatures: z.array(z.string()).optional(),\n stripeSubscriptionMainItemId: z.string().optional(),\n planPriceId: z.string(),\n planInterval: BillingIntervalSchema,\n isPricePerCreator: z.boolean().optional(),\n legacyVersion: z.string().optional(),\n\n seats: z.number(),\n seatLimit: z.number(),\n\n currentPeriodStart: z.string().optional(),\n currentPeriodEnd: z.string().optional(),\n subscriptionStatusUpdatedAt: z.string().optional(),\n cancelAt: z.string().nullish(),\n\n card: CardSchema.optional(),\n\n // New\n amount: z.number().nullish(),\n isTrial: z.boolean().optional(),\n billingType: BillingTypeSchema.optional(),\n daysUntilDue: z.number().optional(),\n});\n\nexport type Subscription = z.infer<typeof Subscription>;\n","import { z } from \"zod\";\n\n/**\n * Base ChatMessage schema and ChatMessageSenderType enum\n * Used by message-related endpoints\n */\nexport const ForgeChatMessageSenderType = z.enum([\"User\", \"Agent\"]);\nexport type ForgeChatMessageSenderType = z.infer<typeof ForgeChatMessageSenderType>;\n\nexport const ForgeChatMessageSender = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(ForgeChatMessageSenderType.Values.User) }),\n z.object({ type: z.literal(ForgeChatMessageSenderType.Values.Agent), persona: z.literal(\"Amy\") }),\n]);\n\nexport const ForgeChatMessage = z.object({\n id: z.number(),\n threadId: z.number(),\n payload: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n sender: ForgeChatMessageSender,\n});\n\nexport type ForgeChatMessageSender = z.infer<typeof ForgeChatMessageSender>;\nexport type ForgeChatMessage = z.infer<typeof ForgeChatMessage>;\n","import { z } from \"zod\";\n\n/**\n * Base ChatThread schema used across multiple endpoints\n * Also used for DELETE /api/v1/workspaces/{wsId}/chat-threads/{threadId}\n * (DELETE endpoint returns { ok: boolean } but references this model)\n */\nexport const ForgeChatThread = z.object({\n id: z.string(),\n title: z.string(),\n workspaceId: z.string(),\n userId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type ForgeChatThread = z.infer<typeof ForgeChatThread>;\n","import { z } from \"zod\";\n\nexport const Entity = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type Entity = z.infer<typeof Entity>;\n","import { z } from \"zod\";\n\nexport const ObjectMeta = z.object({\n name: z.string(),\n description: z.string().optional(),\n});\n\nexport type ObjectMeta = z.infer<typeof ObjectMeta>;\n","import { z } from \"zod\";\n\nexport type CustomDomainState =\n | \"Initial\"\n | \"DomainSetupInProgress\"\n | \"DomainSetupFailed\"\n | \"DomainSetupSuccess\"\n | \"SSLSetupInProgress\"\n | \"SSLSetupFailed\"\n | \"SSLSetupSuccess\";\n\nexport const CustomDomain = z.object({\n id: z.string(),\n designSystemId: z.string(),\n state: z.string(),\n\n supernovaDomain: z.string(),\n customerDomain: z.string().nullish(),\n\n error: z.string().nullish(),\n errorCode: z.string().nullish(),\n});\n\nexport type CustomDomain = z.infer<typeof CustomDomain>;\n","import { z } from \"zod\";\nimport { Exporter } from \"../export/exporter\";\nimport { Pipeline } from \"../export/pipeline\";\n\nexport const ExportJobDump = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n finishedAt: z.coerce.date(),\n exportArtefacts: z.string(),\n});\n\nexport const CodeIntegrationDump = z.object({\n exporters: Exporter.array(),\n pipelines: Pipeline.array(),\n exportJobs: ExportJobDump.array(),\n});\n\nexport type ExportJobDump = z.infer<typeof ExportJobDump>;\nexport type CodeIntegrationDump = z.infer<typeof CodeIntegrationDump>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../helpers\";\nimport { GitProvider } from \"./git-providers\";\nimport { PulsarContributionConfigurationProperty, PulsarContributionVariant, PulsarCustomBlock } from \"./pulsar\";\nimport { ExporterPropertyDefinition } from \"./export-configuration\";\n\nexport const ExporterType = z.enum([\"code\", \"documentation\"]);\nexport const ExporterSource = z.enum([\"git\", \"upload\"]);\nexport const ExporterTag = z.string();\n\nexport const ExporterPulsarDetails = z.object({\n description: z.string(),\n version: z.string(),\n routingVersion: nullishToOptional(z.string()),\n author: nullishToOptional(z.string()),\n organization: nullishToOptional(z.string()),\n homepage: nullishToOptional(z.string()),\n readme: nullishToOptional(z.string()),\n tags: nullishToOptional(z.array(ExporterTag)).default([]),\n packageId: nullishToOptional(z.string().max(255)),\n\n iconURL: nullishToOptional(z.string()),\n configurationProperties: nullishToOptional(z.array(PulsarContributionConfigurationProperty)).default([]),\n customBlocks: nullishToOptional(z.array(PulsarCustomBlock)).default([]),\n blockVariants: nullishToOptional(z.record(z.string(), z.array(PulsarContributionVariant))).default({}),\n properties: nullishToOptional(ExporterPropertyDefinition.array()),\n\n usesBrands: nullishToOptional(z.boolean()).default(false),\n usesThemes: nullishToOptional(z.boolean()).default(false),\n usesLocale: nullishToOptional(z.boolean()).default(false),\n});\n\nexport const ExporterDetails = ExporterPulsarDetails.extend({\n source: ExporterSource,\n\n gitProvider: nullishToOptional(GitProvider),\n gitUrl: nullishToOptional(z.string()),\n gitBranch: nullishToOptional(z.string()),\n gitDirectory: nullishToOptional(z.string()),\n});\n\nexport const Exporter = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n name: z.string(),\n isPrivate: z.boolean(),\n details: ExporterDetails,\n exporterType: nullishToOptional(ExporterType).default(\"code\"),\n storagePath: nullishToOptional(z.string()).default(\"\"),\n properties: nullishToOptional(ExporterPropertyDefinition.array()),\n isDeprecated: z.boolean().default(false),\n deprecationNote: nullishToOptional(z.string()),\n replacementExporterId: nullishToOptional(z.string()),\n});\n\nexport type ExporterType = z.infer<typeof ExporterType>;\nexport type ExporterSource = z.infer<typeof ExporterSource>;\nexport type ExporterTag = z.infer<typeof ExporterTag>;\nexport type ExporterPulsarDetails = z.infer<typeof ExporterPulsarDetails>;\nexport type ExporterDetails = z.infer<typeof ExporterDetails>;\nexport type Exporter = z.infer<typeof Exporter>;\n","import { z } from \"zod\";\n\nexport enum GitProviderNames {\n Azure = \"azure\",\n Github = \"github\",\n Gitlab = \"gitlab\",\n Bitbucket = \"bitbucket\",\n}\n\nexport const GitProvider = z.nativeEnum(GitProviderNames);\nexport type GitProvider = z.infer<typeof GitProvider>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../helpers\";\n\n//\n// Base\n//\n\nexport const PulsarPropertyType = z.enum([\n \"string\",\n \"number\",\n \"boolean\",\n \"image\",\n \"enum\",\n \"color\",\n \"typography\",\n \"component\",\n \"componentProperties\",\n \"tokenProperties\",\n \"tokenType\",\n]);\n\nexport const PulsarBaseProperty = z.object({\n label: z.string(),\n key: z.string(),\n description: z.string().nullish(),\n type: PulsarPropertyType,\n values: z.array(z.string()).nullish(),\n default: z.union([z.string(), z.boolean(), z.number()]).nullish(), // PulsarPropertyValueType //is optional?\n inputType: z.enum([\"code\", \"plain\"]).optional(), //is optional?\n isMultiline: z.boolean().nullish(),\n});\n\n//\n// Exporter custom properties\n//\n\nexport const PulsarContributionConfigurationProperty = PulsarBaseProperty.extend({\n category: z.string(),\n});\n\n//\n// Exporter custom blocks\n//\n\nexport const PulsarContributionVariant = z.object({\n key: z.string(),\n name: z.string(),\n isDefault: nullishToOptional(z.boolean()),\n description: nullishToOptional(z.string()),\n thumbnailURL: nullishToOptional(z.string()),\n});\n\nexport const PulsarCustomBlock = z.object({\n title: nullishToOptional(z.string()),\n key: z.string(),\n category: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n iconURL: nullishToOptional(z.string()),\n mode: nullishToOptional(z.enum([\"array\", \"block\"])),\n properties: nullishToOptional(z.array(PulsarBaseProperty)).transform(v => v ?? []),\n});\n\n//\n// Types\n//\n\nexport type PulsarContributionVariant = z.infer<typeof PulsarContributionVariant>;\nexport type PulsarPropertyType = z.infer<typeof PulsarPropertyType>;\nexport type PulsarBaseProperty = z.infer<typeof PulsarBaseProperty>;\nexport type PulsarCustomBlock = z.infer<typeof PulsarCustomBlock>;\nexport type PulsarContributionConfigurationProperty = z.infer<typeof PulsarContributionConfigurationProperty>;\n","import { z } from \"zod\";\n\n//\n// Primitives\n//\n\nconst PrimitiveValue = z.number().or(z.boolean()).or(z.string());\nconst ArrayValue = z.array(z.string());\nconst ObjectValue = z.record(z.string());\n\nexport const ExporterPropertyValue = PrimitiveValue.or(ArrayValue).or(ObjectValue);\nexport const ExporterPropertyType = z.enum([\"Enum\", \"Boolean\", \"String\", \"Number\", \"Array\", \"Object\", \"Code\"]);\n\nexport type ExporterPropertyDefinitionValue = z.infer<typeof ExporterPropertyValue>;\nexport type ExporterPropertyType = z.infer<typeof ExporterPropertyType>;\n\n//\n// Property\n//\n\nconst PropertyDefinitionBase = z.object({\n key: z.string(),\n title: z.string(),\n description: z.string(),\n category: z.string().optional(),\n dependsOn: z.record(z.boolean()).optional(),\n});\n\nexport const ExporterPropertyDefinitionEnumOption = z.object({\n label: z.string(),\n description: z.string(),\n});\n\nexport const ExporterPropertyDefinitionEnum = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Enum),\n options: z.record(ExporterPropertyDefinitionEnumOption),\n default: z.string(),\n});\n\nexport const ExporterPropertyDefinitionBoolean = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Boolean),\n default: z.boolean(),\n});\n\nexport const ExporterPropertyDefinitionString = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.String),\n default: z.string(),\n isMultiline: z.boolean().optional(),\n});\n\nexport const ExporterPropertyDefinitionNumber = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Number),\n default: z.number(),\n});\n\nexport const ExporterPropertyDefinitionArray = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Array),\n default: ArrayValue,\n});\n\nexport const ExporterPropertyDefinitionObject = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Object),\n default: ObjectValue,\n allowedKeys: z\n .object({\n options: z.string().array(),\n type: z.string(),\n })\n .optional(),\n allowedValues: z\n .object({\n type: z.string(),\n })\n .optional(),\n});\n\nexport const ExporterPropertyDefinitionCode = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Code),\n default: z.string(),\n language: z.string(),\n});\n\nexport const ExporterPropertyDefinition = z.discriminatedUnion(\"type\", [\n ExporterPropertyDefinitionEnum,\n ExporterPropertyDefinitionBoolean,\n ExporterPropertyDefinitionString,\n ExporterPropertyDefinitionNumber,\n ExporterPropertyDefinitionArray,\n ExporterPropertyDefinitionObject,\n ExporterPropertyDefinitionCode,\n]);\n\nexport type ExporterPropertyDefinitionEnum = z.infer<typeof ExporterPropertyDefinitionEnum>;\nexport type ExporterPropertyDefinitionBoolean = z.infer<typeof ExporterPropertyDefinitionBoolean>;\nexport type ExporterPropertyDefinitionString = z.infer<typeof ExporterPropertyDefinitionString>;\nexport type ExporterPropertyDefinitionNumber = z.infer<typeof ExporterPropertyDefinitionNumber>;\nexport type ExporterPropertyDefinitionArray = z.infer<typeof ExporterPropertyDefinitionArray>;\nexport type ExporterPropertyDefinitionObject = z.infer<typeof ExporterPropertyDefinitionObject>;\nexport type ExporterPropertyDefinition = z.infer<typeof ExporterPropertyDefinition>;\nexport type ExporterPropertyDefinitionEnumOption = z.infer<typeof ExporterPropertyDefinitionEnumOption>;\n\n//\n// Value\n//\n\nexport const ExporterPropertyValueMap = z.record(ExporterPropertyValue);\nexport type ExporterPropertyValueMap = z.infer<typeof ExporterPropertyValueMap>;\n","import { z } from \"zod\";\nimport { ExporterPropertyValueMap } from \"./export-configuration\";\nimport { ExportDestinationsMap } from \"./export-destinations\";\n\nexport const PipelineEventType = z.enum([\n \"OnVersionReleased\",\n \"OnHeadChanged\",\n \"OnSourceUpdated\",\n \"OnDocumentationPublished\",\n \"None\",\n]);\n\nexport const PipelineDestinationGitType = z.enum([\"Github\", \"Gitlab\", \"Bitbucket\", \"Azure\"]);\nexport const PipelineDestinationExtraType = z.enum([\"WebhookUrl\", \"S3\", \"Documentation\"]);\nexport const PipelineDestinationType = z.union([PipelineDestinationGitType, PipelineDestinationExtraType]);\n\nexport const Pipeline = z.object({\n id: z.string(),\n\n name: z.string(),\n eventType: PipelineEventType,\n isEnabled: z.boolean(),\n\n workspaceId: z.string(),\n designSystemId: z.string(),\n exporterId: z.string(),\n\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n exporterPropertyValues: ExporterPropertyValueMap.optional(),\n\n isExporterDeprecated: z.boolean(),\n\n // Destinations\n ...ExportDestinationsMap.shape,\n});\n\nexport type PipelineEventType = z.infer<typeof PipelineEventType>;\nexport type PipelineDestinationGitType = z.infer<typeof PipelineDestinationGitType>;\nexport type PipelineDestinationExtraType = z.infer<typeof PipelineDestinationExtraType>;\nexport type PipelineDestinationType = z.infer<typeof PipelineDestinationType>;\n\nexport type Pipeline = z.infer<typeof Pipeline>;\n","import { z } from \"zod\";\nimport { PublishedDocEnvironment } from \"../dsm\";\nimport { nullishToOptional } from \"../helpers\";\n\nconst BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;\nconst BITBUCKET_MAX_LENGTH = 64;\n\nexport const ExportJobDocumentationChanges = z.object({\n pagePersistentIds: z.string().array(),\n groupPersistentIds: z.string().array(),\n});\n\nexport const ExporterDestinationDocs = z.object({\n environment: PublishedDocEnvironment,\n changes: nullishToOptional(ExportJobDocumentationChanges),\n});\n\nexport const GitCommonDestinationOptions = z.object({\n branch: z.string(),\n relativePath: nullishToOptional(z.string()),\n purgeDirectory: nullishToOptional(z.boolean()),\n commitAuthorName: nullishToOptional(z.string()),\n commitAuthorEmail: nullishToOptional(z.string()),\n commitMessage: nullishToOptional(z.string()),\n pullRequestTitle: nullishToOptional(z.string()),\n pullRequestDescription: nullishToOptional(z.string()),\n});\n\nexport const ExporterDestinationS3 = z.object({});\n\nexport const ExporterDestinationGithub = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n url: z.string(),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExporterDestinationAzure = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n organizationId: z.string(),\n projectId: z.string(),\n repositoryId: z.string(),\n\n // Maybe not needed\n url: nullishToOptional(z.string()),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExporterDestinationGitlab = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n projectId: z.string(),\n\n // Maybe not needed\n url: nullishToOptional(z.string()),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExporterDestinationBitbucket = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n workspaceSlug: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),\n projectKey: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),\n repoSlug: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),\n\n url: nullishToOptional(z.string()),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExportDestinationsMap = z.object({\n webhookUrl: z.string().optional(),\n destinationSnDocs: ExporterDestinationDocs.optional(),\n destinationS3: ExporterDestinationS3.optional(),\n destinationGithub: ExporterDestinationGithub.optional(),\n destinationAzure: ExporterDestinationAzure.optional(),\n destinationGitlab: ExporterDestinationGitlab.optional(),\n destinationBitbucket: ExporterDestinationBitbucket.optional(),\n});\n\nexport const ExportDestinationsMapUpdate = z.object({\n webhookUrl: z.string().nullish(),\n destinationSnDocs: ExporterDestinationDocs.nullish(),\n destinationS3: ExporterDestinationS3.nullish(),\n destinationGithub: ExporterDestinationGithub.nullish(),\n destinationAzure: ExporterDestinationAzure.nullish(),\n destinationGitlab: ExporterDestinationGitlab.nullish(),\n destinationBitbucket: ExporterDestinationBitbucket.nullish(),\n});\n\nexport type ExportJobDocumentationChanges = z.infer<typeof ExportJobDocumentationChanges>;\nexport type ExporterDestinationDocs = z.infer<typeof ExporterDestinationDocs>;\nexport type ExporterDestinationS3 = z.infer<typeof ExporterDestinationS3>;\nexport type ExporterDestinationGithub = z.infer<typeof ExporterDestinationGithub>;\nexport type ExporterDestinationAzure = z.infer<typeof ExporterDestinationAzure>;\nexport type ExporterDestinationGitlab = z.infer<typeof ExporterDestinationGitlab>;\nexport type ExporterDestinationBitbucket = z.infer<typeof ExporterDestinationBitbucket>;\nexport type ExportDestinationsMap = z.infer<typeof ExportDestinationsMap>;\nexport type ExportDestinationsMapUpdate = z.infer<typeof ExportDestinationsMapUpdate>;\n","import { z } from \"zod\";\n\nexport const AssetDynamoRecord = z.object({\n path: z.string(),\n id: z.string(),\n designSystemId: z.string(),\n expiresAt: z.number(),\n});\n\nexport type AssetDynamoRecord = z.infer<typeof AssetDynamoRecord>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../../helpers\";\n\nexport const AssetReference = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n assetId: z.string(),\n persistentId: z.string(),\n});\n\nexport type AssetReference = z.infer<typeof AssetReference>;\n\nexport type CreateAssetReference = DbCreateInputOmit<AssetReference>;\n\nexport type AssetReferenceDiff = {\n toCreate: CreateAssetReference[];\n toDelete: string[];\n};\n","import { z } from \"zod\";\n\nexport const AssetValue = z.object({});\n","import { z } from \"zod\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const AssetType = z.enum([\"Image\", \"Font\", \"Generic\"]);\nexport const AssetScope = z.enum([\n \"DocumentationFrame\",\n \"ComponentThumbnail\",\n \"DesignSystem\",\n \"Documentation\",\n \"DocumentationEmbed\",\n]);\n\nexport const AssetFontProperties = z.object({\n family: z.string(),\n subfamily: z.string(),\n});\n\nexport const AssetProperties = z.union([\n z.object({\n fontProperties: z.array(AssetFontProperties),\n }),\n z.object({\n width: z.number(),\n height: z.number(),\n }),\n]);\n\nexport const AssetOrigin = z.object({\n originKey: z.string(),\n});\n\nexport const Asset = z.object({\n id: z.string(),\n designSystemId: z.string().nullish(),\n type: AssetType,\n originalFileName: z.string().nullish(),\n filePath: z.string(),\n scope: AssetScope,\n properties: AssetProperties.nullish(),\n originKey: z.string().optional(),\n createdAt: z.coerce.date().optional(),\n pendingUpload: z.boolean().optional(),\n size: z.number().int().positive().optional(),\n checksum: z.string().optional(),\n});\n\nexport const ResolvedAsset = Asset.extend({\n url: z.string(),\n});\n\nexport type AssetType = z.infer<typeof AssetType>;\nexport type AssetScope = z.infer<typeof AssetScope>;\nexport type AssetFontProperties = z.infer<typeof AssetFontProperties>;\nexport type AssetProperties = z.infer<typeof AssetProperties>;\nexport type AssetOrigin = z.infer<typeof AssetOrigin>;\nexport type Asset = z.infer<typeof Asset>;\nexport type ResolvedAsset = z.infer<typeof ResolvedAsset>;\n\nexport type ImportedAsset = OmitStrict<Asset, \"originKey\"> & {\n originKey: string;\n};\n\nexport function isImportedAsset(asset: Asset): asset is ImportedAsset {\n return !!asset.originKey;\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const CodeComponentResolvedTypeKind = z.enum([\n \"string\",\n \"number\",\n \"numberLiteral\",\n \"boolean\",\n \"booleanLiteral\",\n \"object\",\n \"function\",\n \"stringLiteral\",\n \"union\",\n \"slot\",\n \"null\",\n \"undefined\",\n \"any\",\n]);\n\nexport const CodeComponentResolvedType: z.ZodType = z.lazy(() =>\n z.object({\n kind: CodeComponentResolvedTypeKind,\n raw: z.string().optional(),\n types: z.array(CodeComponentResolvedType).optional(),\n isArray: z.boolean().optional(),\n })\n);\n\nexport const CodeComponentParentType = z.object({\n fileName: z.string(),\n name: z.string(),\n});\n\nexport const CodeComponentProperty = z.object({\n defaultValue: z.string().optional(),\n name: z.string(),\n required: z.boolean(),\n type: CodeComponentResolvedType,\n declarations: z.array(CodeComponentParentType).optional(),\n tags: z.record(z.string(), z.string()).optional(),\n description: z.string(),\n});\n\nexport const CodeComponent = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n exportName: z.string(),\n componentPath: z.string(),\n description: z.string(),\n properties: z.record(z.string(), CodeComponentProperty),\n tags: z.record(z.string(), z.string()).nullable(),\n});\n\nexport const CodeComponentUpsertResponse = z.object({\n created: z.number().nonnegative(),\n updated: z.number().nonnegative(),\n deleted: z.number().nonnegative(),\n});\n\nexport type CodeComponentResolvedType = z.infer<typeof CodeComponentResolvedType>;\nexport type CodeComponentParentType = z.infer<typeof CodeComponentParentType>;\nexport type CodeComponentProperty = z.infer<typeof CodeComponentProperty>;\nexport type CodeComponent = z.infer<typeof CodeComponent>;\n\nexport type CodeComponentCreate = DbCreateInputOmit<CodeComponent>;\nexport type CodeComponentUpdate = DbUpdate<CodeComponent>;\nexport type CodeComponentUpsert = OmitStrict<CodeComponentCreate, \"persistentId\" | \"designSystemVersionId\">;\nexport type CodeComponentUpsertResponse = z.infer<typeof CodeComponentUpsertResponse>;\n\n//\n// Analyze\n//\n\nexport const RegistryType = z.enum([\"Npm\", \"Github\", \"Artifactory\", \"Azure\", \"Custom\"]);\n\nexport const Registry = z.object({\n type: RegistryType,\n url: z.string().optional(),\n accessToken: z.string().optional(),\n scope: z.string(),\n authConfig: z.record(z.string()).optional(),\n});\n\nexport const DependencyDefinition = z.object({\n name: z.string(),\n version: z.string().optional(),\n});\n\nexport const AnalyzeCodeComponentsInPackage = z.object({\n designSystemId: z.string(),\n versionId: z.string(),\n mainPackage: DependencyDefinition,\n dependencies: z.array(DependencyDefinition).optional(),\n registries: Registry.array(),\n userAccessToken: z.string(),\n});\n\nexport type Registry = z.infer<typeof Registry>;\nexport type DependencyDefinition = z.infer<typeof DependencyDefinition>;\nexport type AnalyzeCodeComponentsInPackage = z.infer<typeof AnalyzeCodeComponentsInPackage>;\n","import { z } from \"zod\";\nimport { FigmaRenderFormat } from \"../import\";\n\nexport const AssetRenderConfiguration = z.object({\n prefix: z.string().optional(),\n suffix: z.string().optional(),\n scale: z.number(),\n format: FigmaRenderFormat,\n});\n\nexport const RenderedAssetFile = z.object({\n assetPersistentId: z.string(),\n assetName: z.string(),\n\n renderedImageFileName: z.string(),\n renderedImageUrl: z.string(),\n\n settings: AssetRenderConfiguration,\n});\n\nexport type AssetRenderConfiguration = z.infer<typeof AssetRenderConfiguration>;\nexport type RenderedAssetFile = z.infer<typeof RenderedAssetFile>;\n","import { z } from \"zod\";\n\nexport const FigmaFileDownloadScope = z.object({\n styles: z.boolean(),\n components: z.boolean(),\n componentSets: z.boolean(),\n currentVersion: z.literal(\"__latest__\").nullable(),\n publishedVersion: z.string().nullable(),\n downloadChunkSize: z.number().optional(),\n maxFileDepth: z.number().optional(),\n});\n\nexport const FigmaFileAccessData = z.object({\n accessToken: z.string(),\n accessTokenType: z.enum([\"OAuth2\", \"PAT\"]).default(\"OAuth2\"),\n});\n\nexport type FigmaFileDownloadScope = z.infer<typeof FigmaFileDownloadScope>;\nexport type FigmaFileAccessData = z.infer<typeof FigmaFileAccessData>;\n","import { z } from \"zod\";\nimport { DataSourceFigmaImportMetadata, DataSourceFigmaRemote } from \"../../data-sources\";\nimport { ImportWarning } from \"../warning\";\nimport { FigmaFileAccessData, FigmaFileDownloadScope } from \"./figma-files\";\n\n//\n// Importer payload\n//\n\nexport const ImportFunctionInput = z.object({\n importJobId: z.string(),\n importContextId: z.string(),\n designSystemId: z.string(),\n});\n\nexport type ImportFunctionInput = z.infer<typeof ImportFunctionInput>;\n\n//\n// Base context\n//\n\nexport const ImportedFigmaSourceData = z.object({\n sourceId: z.string(),\n figmaRemote: DataSourceFigmaRemote,\n});\n\nexport const FigmaImportBaseContext = z.object({\n designSystemId: z.string(),\n\n /**\n * Data required for accessing Figma files. This should contain access data for all file ids\n * mentioned in the `importedSourceDataBySourceId`\n *\n * fileId: file data\n */\n fileAccessByFileId: z.record(FigmaFileAccessData),\n\n /**\n * Figma source data for which import was requested\n *\n * sourceId: source data\n */\n importedSourceDataBySourceId: z.record(ImportedFigmaSourceData),\n\n /**\n * Array of warnings that will be written into the import result summary at the end\n * of import job execution and displayed by the client.\n */\n importWarnings: z.record(ImportWarning.array()).default({}),\n});\n\nexport type ImportedFigmaSourceData = z.infer<typeof ImportedFigmaSourceData>;\nexport type FigmaImportBaseContext = z.infer<typeof FigmaImportBaseContext>;\n\n//\n// Context with source state updates\n//\n\nexport const FeatureFlagsKeepAliases = z.object({\n isNonCompatibleTypeChangesEnabled: z.boolean().default(false),\n isTypographyUseFontStyleEnabled: z.boolean().default(false),\n});\nexport type FeatureFlagsKeepAliases = z.infer<typeof FeatureFlagsKeepAliases>;\n\nexport const FigmaImportContextWithSourcesState = FigmaImportBaseContext.extend({\n sourcesWithMissingAccess: z.array(z.string()).default([]),\n featureFlagsKeepAliases: FeatureFlagsKeepAliases.default({}),\n});\n\nexport type FigmaImportContextWithSourcesState = z.infer<typeof FigmaImportContextWithSourcesState>;\n\n//\n// Context with file download scope\n//\n\nexport const ChangedImportedFigmaSourceData = ImportedFigmaSourceData.extend({\n importMetadata: DataSourceFigmaImportMetadata,\n});\n\nexport const FigmaImportContextWithDownloadScopes = FigmaImportContextWithSourcesState.extend({\n /**\n * Describes what to download from each file, this should contain all file id mentioned in\n * importMetadataBySourceId.\n *\n * File id -> file download scope\n */\n fileDownloadScopesByFileId: z.record(FigmaFileDownloadScope),\n\n /**\n * Sources filtered down to the ones that have changed since last import and therefore need to be\n * imported again.\n *\n * Source id -> import metadata\n */\n changedImportedSourceDataBySourceId: z.record(ChangedImportedFigmaSourceData),\n});\n\nexport type ChangedImportedFigmaSourceData = z.infer<typeof ChangedImportedFigmaSourceData>;\nexport type FigmaImportContextWithDownloadScopes = z.infer<typeof FigmaImportContextWithDownloadScopes>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { ImportWarning } from \"../import/warning\";\nimport { SourceImportStorybookSummary, SourceImportSummary } from \"./import-summary\";\n\n//\n// Enums\n//\n\nexport const DataSourceRemoteType = z.enum([\"Figma\", \"TokenStudio\", \"FigmaVariablesPlugin\", \"Storybook\"]);\nexport const DataSourceUploadRemoteSource = z.enum([\"TokenStudio\", \"FigmaVariablesPlugin\", \"Custom\"]);\nexport const DataSourceFigmaState = z.enum([\"Active\", \"MissingIntegration\", \"MissingFileAccess\", \"MissingFileOwner\"]);\nexport const DataSourceAutoImportMode = z.enum([\"Never\", \"Hourly\"]);\n\nexport type DataSourceRemoteType = z.infer<typeof DataSourceRemoteType>;\nexport type DataSourceUploadRemoteSource = z.infer<typeof DataSourceUploadRemoteSource>;\nexport type DataSourceFigmaState = z.infer<typeof DataSourceFigmaState>;\nexport type DataSourceAutoImportMode = z.infer<typeof DataSourceAutoImportMode>;\n\n//\n// Aux\n//\n\nexport const DataSourceStats = z.object({\n tokens: zeroNumberByDefault(),\n components: zeroNumberByDefault(),\n assets: zeroNumberByDefault(),\n frames: zeroNumberByDefault(),\n});\n\nexport type DataSourceStats = z.infer<typeof DataSourceStats>;\n\n//\n// Figma\n//\n\nexport const DataSourceFigmaFileData = z.object({\n lastUpdatedAt: z.coerce.date(),\n});\n\nexport const DataSourceFigmaFileVersionData = z.object({\n id: z.string(),\n label: z.string().optional(),\n description: z.string().optional(),\n createdAt: z.coerce.date(),\n});\n\nexport const DataSourceFigmaScope = z.object({\n assets: z.boolean(),\n components: z.boolean(),\n documentationFrames: z.boolean(),\n tokens: z.boolean(),\n themePersistentId: z.string().optional(),\n isUnpublishedContentFallbackEnabled: z.boolean(),\n});\n\nexport const DataSourceFigmaImportMetadata = z.object({\n fileData: DataSourceFigmaFileData.optional(),\n importedPublishedVersion: DataSourceFigmaFileVersionData.optional(),\n});\n\nexport const DataSourceFigmaRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.Figma),\n fileId: z.string(),\n preferredCredentialId: z.string().optional(),\n ownerId: z.string(), // todo remove or keep to reference who created data source\n ownerName: z.string(), // todo probably remove\n scope: DataSourceFigmaScope,\n state: DataSourceFigmaState,\n requiresSync: z\n .boolean()\n .optional()\n .transform(v => v ?? false),\n lastImportMetadata: DataSourceFigmaImportMetadata.optional(),\n downloadChunkSize: z.number().optional(),\n figmaRenderChunkSize: z.number().optional(),\n maxFileDepth: z.number().optional(),\n});\n\nexport type DataSourceFigmaFileData = z.infer<typeof DataSourceFigmaFileData>;\nexport type DataSourceFigmaFileVersionData = z.infer<typeof DataSourceFigmaFileVersionData>;\nexport type DataSourceFigmaScope = z.infer<typeof DataSourceFigmaScope>;\nexport type DataSourceFigmaImportMetadata = z.infer<typeof DataSourceFigmaImportMetadata>;\nexport type DataSourceFigmaRemote = z.infer<typeof DataSourceFigmaRemote>;\n\n//\n// Token Studio\n//\n\nexport const DataSourceTokenStudioRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.TokenStudio),\n});\n\nexport type DataSourceTokenStudioRemote = z.infer<typeof DataSourceTokenStudioRemote>;\n\n//\n// Figma Variables Plugin\n//\n\nexport const DataSourceUploadImportMetadata = z.record(z.any());\n\nexport const DataSourceUploadRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),\n remoteId: z.string(),\n remoteSourceType: DataSourceUploadRemoteSource,\n lastImportMetadata: DataSourceUploadImportMetadata.optional(),\n warnings: nullishToOptional(ImportWarning.array()),\n isTokenTypeSplitEnabled: z.boolean(),\n isCollectionsMigrationCompleted: z.boolean(),\n});\n\nexport type DataSourceUploadImportMetadata = z.infer<typeof DataSourceUploadImportMetadata>;\nexport type DataSourceUploadRemote = z.infer<typeof DataSourceUploadRemote>;\n\n//\n// Storybook\n//\n\nexport const DataSourceStorybookRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.Storybook),\n indexUrl: z.string(),\n userUrl: z.string(),\n ownerId: z.string().optional(),\n lastImportedAt: z.coerce.date().optional(),\n lastImportedSuccessfully: z.coerce.date().optional(),\n lastImportedResult: SourceImportStorybookSummary.optional(),\n isFailed: z.boolean(),\n storiesCount: z.number(),\n docsCount: z.number(),\n description: z.string().optional(),\n isUsingVpn: z.boolean().optional(),\n});\n\nexport type DataSourceStorybookRemote = z.infer<typeof DataSourceStorybookRemote>;\n\n//\n// Base\n//\n\nexport const DataSourceRemote = z.discriminatedUnion(\"type\", [\n DataSourceFigmaRemote,\n DataSourceUploadRemote,\n DataSourceTokenStudioRemote,\n DataSourceStorybookRemote,\n]);\n\nexport const DataSource = z.object({\n id: z.string(),\n\n name: z.string(),\n thumbnailUrl: z.string().optional(),\n\n createdAt: z.coerce.date().optional(),\n\n lastImportedAt: z.coerce.date().optional(),\n lastImportSummary: SourceImportSummary.optional(),\n\n designSystemId: z.string(),\n brandPersistentId: z.string(),\n autoImportMode: DataSourceAutoImportMode,\n stats: DataSourceStats,\n\n remote: DataSourceRemote,\n\n sortOrder: z.number(),\n});\n\nexport const DataSourceVersion = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n label: z.string().nullish(),\n description: z.string().nullish(),\n});\n\nexport type DataSourceVersion = z.infer<typeof DataSourceVersion>;\n\nexport type DataSourceRemote = z.infer<typeof DataSourceRemote>;\nexport type DataSource = z.infer<typeof DataSource>;\nexport type DataSourceOfType<T extends DataSourceRemoteType> = DataSource & {\n remote: Extract<DataSourceRemote, { type: T }>;\n};\n\nexport function isDataSourceOfType<T extends DataSourceRemoteType>(\n dataSource: DataSource,\n type: T\n): dataSource is DataSourceOfType<T> {\n return dataSource.remote.type === type;\n}\n\nexport type CreateDataSource = OmitStrict<DbCreateInputOmit<DataSource>, \"sortOrder\">;\nexport type UpdateDataSource = OmitStrict<DbUpdate<DataSource>, \"brandPersistentId\" | \"designSystemId\">;\n\nfunction zeroNumberByDefault() {\n return z\n .number()\n .nullish()\n .transform(v => v ?? 0);\n}\n","import { z } from \"zod\";\n\nexport const ImportWarningType = z.enum([\n \"NoVersionFound\",\n\n \"UnsupportedFill\",\n \"UnsupportedStroke\",\n \"UnsupportedEffect\",\n\n \"NoPublishedElements\",\n \"NoPublishedStyles\",\n \"NoPublishedComponents\",\n \"NoPublishedAssets\",\n\n \"StyleNotApplied\",\n\n \"ComponentHasNoThumbnail\",\n\n \"DuplicateImportedStyleId\",\n \"DuplicateImportedStylePath\",\n\n \"NoUnpublishedStyles\",\n\n \"ReferenceResolutionFailed\",\n]);\n\nexport const ImportWarning = z.object({\n warningType: ImportWarningType,\n componentId: z.string().optional(),\n componentName: z.string().optional(),\n styleId: z.string().optional(),\n styleName: z.string().optional(),\n unsupportedStyleValueType: z.string().optional(),\n referenceId: z.string().optional(),\n});\n\nexport type ImportWarningType = z.infer<typeof ImportWarningType>;\nexport type ImportWarning = z.infer<typeof ImportWarning>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../helpers\";\nimport { DesignTokenType } from \"../elements\";\nimport { ImportWarning } from \"../import/warning\";\n\nexport const FileStructureStats = z.object({\n frames: zeroNumberByDefault(),\n components: zeroNumberByDefault(),\n componentSets: zeroNumberByDefault(),\n});\n\nconst SourceImportSummaryByTokenTypeKey = DesignTokenType.or(\n // Backward compatibility\n z.enum([\"Measure\", \"Radius\", \"GenericToken\", \"Font\", \"Text\"])\n);\n\nexport const SourceImportSummaryByTokenType = z.record(SourceImportSummaryByTokenTypeKey, z.number());\n\nexport const SourceImportTokenSummary = z.object({\n tokensCreated: zeroNumberByDefault(),\n tokensUpdated: zeroNumberByDefault(),\n tokensDeleted: zeroNumberByDefault(),\n tokensCreatedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),\n tokensUpdatedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),\n tokensDeletedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),\n});\n\nexport const SourceImportComponentSummary = z.object({\n componentsCreated: zeroNumberByDefault(),\n componentsUpdated: zeroNumberByDefault(),\n componentsDeleted: zeroNumberByDefault(),\n componentAssetsCreated: zeroNumberByDefault(),\n componentAssetsUpdated: zeroNumberByDefault(),\n componentAssetsDeleted: zeroNumberByDefault(),\n});\n\nexport const SourceImportStorybookSummary = z.object({\n created: zeroNumberByDefault(),\n updated: zeroNumberByDefault(),\n deleted: zeroNumberByDefault(),\n});\n\nexport const SourceImportFrameSummary = z.object({\n assetsInFile: nullishToOptional(FileStructureStats.optional()),\n invalidReferencesCount: nullishToOptional(z.number().optional()),\n});\n\nexport const SourceImportSummary = z.object({\n sourceId: nullishToOptional(z.string()),\n brandId: nullishToOptional(z.string()),\n versionId: nullishToOptional(z.string()),\n error: nullishToOptional(z.any()),\n isFailed: z.boolean(),\n warnings: z\n .array(ImportWarning)\n .nullish()\n .transform(v => v ?? []),\n\n ...SourceImportTokenSummary.shape,\n ...SourceImportComponentSummary.shape,\n ...FileStructureStats.shape,\n});\n\nexport type FileStructureStats = z.infer<typeof FileStructureStats>;\nexport type SourceImportSummaryByTokenType = z.infer<typeof SourceImportSummaryByTokenType>;\nexport type SourceImportTokenSummary = z.infer<typeof SourceImportTokenSummary>;\nexport type SourceImportComponentSummary = z.infer<typeof SourceImportComponentSummary>;\nexport type SourceImportFrameSummary = z.infer<typeof SourceImportFrameSummary>;\nexport type SourceImportSummary = z.infer<typeof SourceImportSummary>;\nexport type SourceImportStorybookSummary = z.infer<typeof SourceImportStorybookSummary>;\n\nfunction zeroNumberByDefault() {\n return z\n .number()\n .nullish()\n .transform(v => v ?? 0);\n}\n","import { ZodSchema, ZodTypeDef, z } from \"zod\";\n\nexport const TokenDataAliasSchema = z.object({\n aliasTo: z\n .string()\n .optional()\n .nullable()\n .transform(v => v ?? undefined),\n});\n\nexport function tokenAliasOrValue<I, O>(value: ZodSchema<I, ZodTypeDef, O>) {\n return TokenDataAliasSchema.extend({\n value: value\n .optional()\n .nullable()\n .transform(v => (v ?? undefined) as z.output<typeof value> | undefined),\n });\n}\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionTokenData } from \"./dimension\";\n\nexport const BlurType = z.enum([\"Layer\", \"Background\"]);\n\nexport const BlurValue = z.object({\n type: BlurType,\n radius: DimensionTokenData,\n});\n\nexport const BlurTokenData = tokenAliasOrValue(BlurValue);\n\nexport type BlurType = z.infer<typeof BlurType>;\nexport type BlurValue = z.infer<typeof BlurValue>;\nexport type BlurTokenData = z.infer<typeof BlurTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const DimensionUnit = z.enum([\"Pixels\", \"Percent\", \"Rem\", \"Ms\", \"Raw\", \"Points\"]);\n\nexport const DimensionValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const DimensionTokenData = tokenAliasOrValue(DimensionValue);\n\nexport type DimensionUnit = z.infer<typeof DimensionUnit>;\nexport type DimensionValue = z.infer<typeof DimensionValue>;\nexport type DimensionTokenData = z.infer<typeof DimensionTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const BorderRadiusUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const BorderRadiusValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const BorderRadiusTokenData = tokenAliasOrValue(BorderRadiusValue);\n\nexport type BorderRadiusUnit = z.infer<typeof BorderRadiusUnit>;\nexport type BorderRadiusValue = z.infer<typeof BorderRadiusValue>;\nexport type BorderRadiusTokenData = z.infer<typeof BorderRadiusTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const BorderWidthUnit = z.enum([\"Pixels\"]);\n\nexport const BorderWidthValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const BorderWidthTokenData = tokenAliasOrValue(BorderWidthValue);\n\nexport type BorderWidthUnit = z.infer<typeof BorderWidthUnit>;\nexport type BorderWidthValue = z.infer<typeof BorderWidthValue>;\nexport type BorderWidthTokenData = z.infer<typeof BorderWidthTokenData>;\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport { BorderWidthTokenData } from \"./border-width\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const BorderPosition = z.enum([\"Inside\", \"Center\", \"Outside\"]);\nexport const BorderStyle = z.enum([\"Dashed\", \"Dotted\", \"Solid\", \"Groove\"]);\n\nexport const BorderValue = z.object({\n color: ColorTokenData,\n width: BorderWidthTokenData,\n position: BorderPosition,\n style: BorderStyle.optional(),\n});\n\nexport const BorderTokenData = tokenAliasOrValue(BorderValue);\n\nexport type BorderPosition = z.infer<typeof BorderPosition>;\nexport type BorderStyle = z.infer<typeof BorderStyle>;\nexport type BorderValue = z.infer<typeof BorderValue>;\nexport type BorderTokenData = z.infer<typeof BorderTokenData>;\n","import { z } from \"zod\";\nimport { TokenDataAliasSchema, tokenAliasOrValue } from \"./base\";\nimport { OpacityTokenData } from \"./opacity\";\n\nexport const ColorValue = z.object({\n opacity: OpacityTokenData,\n color: z.string().or(TokenDataAliasSchema),\n});\n\nexport const ColorTokenData = tokenAliasOrValue(ColorValue);\n\nexport type ColorValue = z.infer<typeof ColorValue>;\nexport type ColorTokenData = z.infer<typeof ColorTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const OpacityValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const OpacityTokenData = tokenAliasOrValue(OpacityValue);\n\nexport type OpacityValue = z.infer<typeof OpacityValue>;\nexport type OpacityTokenData = z.infer<typeof OpacityTokenData>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers/nullish-to-optional\";\nimport { FigmaComponentPropertyMap } from \"../component-properties\";\n\nexport const ComponentElementData = z.object({\n value: z.object({\n thumbnailImage: z.object({\n value: z.object({\n url: z.string(),\n assetId: z.string(),\n }),\n }),\n\n svg: z\n .object({\n value: z.object({\n url: z.string(),\n assetId: z.string(),\n }),\n })\n .optional(),\n\n parentComponentPersistentId: nullishToOptional(z.string()),\n componentPropertyDefinitions: nullishToOptional(FigmaComponentPropertyMap),\n variantPropertyValues: nullishToOptional(z.record(z.string())),\n renderNodeId: nullishToOptional(z.string()),\n }),\n});\n\nexport type ComponentElementData = z.infer<typeof ComponentElementData>;\n","import { z } from \"zod\";\n\nexport const FigmaComponentPropertyType = z.enum([\"Boolean\", \"InstanceSwap\", \"Variant\", \"Text\"]);\n\n//\n// Definitions\n//\n\nexport const FigmaComponentPropertyOrigin = z.object({\n id: z.string(),\n});\n\nconst FigmaComponentPropertyBase = z.object({\n id: z.string(),\n name: z.string(),\n});\n\nexport const FigmaComponentInstancePreview = z.object({\n componentName: z.string(),\n componentSetName: z.string().optional(),\n isRemote: z.boolean(),\n});\n\nexport const FigmaComponentBooleanProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.Boolean),\n defaultValue: z.boolean(),\n});\n\nexport const FigmaComponentInstanceSwapProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.InstanceSwap),\n defaultValue: z.string(),\n defaultValuePreview: FigmaComponentInstancePreview.optional(),\n});\n\nexport const FigmaComponentVariantProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.Variant),\n defaultValue: z.string(),\n options: z.array(z.string()),\n});\n\nexport const FigmaComponentTextProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.Text),\n id: z.string(),\n defaultValue: z.string(),\n});\n\nexport const FigmaComponentProperty = z.discriminatedUnion(\"type\", [\n FigmaComponentBooleanProperty,\n FigmaComponentInstanceSwapProperty,\n FigmaComponentTextProperty,\n FigmaComponentVariantProperty,\n]);\n\nexport const FigmaComponentPropertyMap = z.record(z.string(), FigmaComponentProperty);\n\nexport type FigmaComponentInstancePreview = z.infer<typeof FigmaComponentInstancePreview>;\nexport type FigmaComponentPropertyType = z.infer<typeof FigmaComponentPropertyType>;\nexport type FigmaComponentBooleanProperty = z.infer<typeof FigmaComponentBooleanProperty>;\nexport type FigmaComponentInstanceSwapProperty = z.infer<typeof FigmaComponentInstanceSwapProperty>;\nexport type FigmaComponentVariantProperty = z.infer<typeof FigmaComponentVariantProperty>;\nexport type FigmaComponentTextProperty = z.infer<typeof FigmaComponentTextProperty>;\nexport type FigmaComponentProperty = z.infer<typeof FigmaComponentProperty>;\nexport type FigmaComponentPropertyMap = z.infer<typeof FigmaComponentPropertyMap>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers\";\nimport { areShallowObjectsEqual, mapByUnique } from \"../../../utils\";\nimport { ColorTokenInlineData } from \"../../properties\";\nimport { Size } from \"../primitives\";\nimport { DesignTokenType } from \"../raw-element\";\nimport { DimensionTokenData } from \"./dimension\";\n\n//\n// Enums\n//\n\nexport const PageBlockCalloutType = z.enum([\"Info\", \"Primary\", \"Success\", \"Warning\", \"Error\"]);\n\nexport const PageBlockTypeV1 = z.enum([\n \"Text\",\n \"Heading\",\n \"Code\",\n \"UnorderedList\",\n \"OrderedList\",\n \"Quote\",\n \"Callout\",\n \"Divider\",\n \"Image\",\n \"Embed\",\n \"Link\",\n \"Shortcuts\",\n \"FigmaEmbed\",\n \"YoutubeEmbed\",\n \"StorybookEmbed\",\n \"Token\",\n \"TokenGroup\",\n \"TokenList\",\n \"Component\",\n \"ComponentGroup\",\n \"Theme\",\n \"ComponentSandbox\",\n \"Custom\",\n \"FigmaFrames\",\n \"ComponentAssets\",\n \"ComponentAssetGroup\",\n \"RenderCode\",\n \"Tabs\",\n \"TabItem\",\n \"Table\",\n \"TableRow\",\n \"TableCell\",\n \"Guidelines\",\n \"Guideline\",\n \"FigmaComponents\",\n \"FigmaComponentPropsTable\",\n \"Files\",\n]);\n\nexport const PageBlockCodeLanguage = z.enum([\n \"Angular\",\n \"Bash\",\n \"C\",\n \"Cpp\",\n \"Csharp\",\n \"CSS\",\n \"Dart\",\n \"Handlebars\",\n \"HTML\",\n \"Java\",\n \"Javascript\",\n \"JSON\",\n \"ReactJSX\",\n \"ReactTSX\",\n \"Kotlin\",\n \"Lua\",\n \"Markdown\",\n \"ObjectiveC\",\n \"PHP\",\n \"Plain\",\n \"Python\",\n \"Ruby\",\n \"Rust\",\n \"Sass\",\n \"SCSS\",\n \"Svetle\",\n \"Swift\",\n \"Twig\",\n \"Typescript\",\n \"Vue\",\n \"XML\",\n \"YAML\",\n]);\n\nexport const PageBlockAlignment = z.enum([\"Left\", \"Center\", \"Stretch\", \"Right\"]);\nexport const PageBlockThemeType = z.enum([\"Override\", \"Comparison\"]);\nexport const PageBlockTokenNameFormat = z.enum([\"Name\", \"GroupAndName\", \"FullPath\", \"CustomProperty\"]);\nexport const PageBlockAssetType = z.enum([\"image\", \"figmaFrame\"]);\n\nexport const PageBlockTilesAlignment = z.enum([\"Center\", \"FrameHeight\"]);\n\nexport const PageBlockTilesLayout = z.enum([\"C8\", \"C7\", \"C6\", \"C5\", \"C4\", \"C3\", \"C2\", \"C1\", \"C1_75\"]);\n\n//\n// Support types\n//\n\nexport const PageBlockTheme = z.object({\n themeIds: z.array(z.string()),\n type: PageBlockThemeType,\n});\n\nexport const PageBlockSwatch = z.object({\n id: z.string(),\n selectedThemeIds: z.string().array(),\n});\n\nexport const PageBlockUrlPreview = z.object({\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n thumbnailUrl: nullishToOptional(z.string()),\n});\n\nexport const PageBlockFrameOrigin = z.object({\n sourceFileName: nullishToOptional(z.string()),\n title: nullishToOptional(z.string()),\n previewUrl: nullishToOptional(z.string()),\n valid: nullishToOptional(z.boolean()),\n referenceId: nullishToOptional(z.string()),\n assetId: nullishToOptional(z.string()),\n assetScale: nullishToOptional(z.number()),\n width: nullishToOptional(z.number()),\n height: nullishToOptional(z.number()),\n});\n\nexport const PageBlockFrame = z.object({\n persistentId: z.string(),\n sourceId: z.string(),\n sourceFrameId: z.string(),\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n origin: nullishToOptional(PageBlockFrameOrigin),\n});\n\nexport const PageBlockAsset = z.object({\n type: PageBlockAssetType,\n id: nullishToOptional(z.string()),\n url: nullishToOptional(z.string()),\n figmaFrame: nullishToOptional(PageBlockFrame),\n});\n\nexport const PageBlockLinkPreview = z.object({\n title: nullishToOptional(z.string()),\n valid: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockShortcut = z.object({\n persistentId: z.string(),\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n asset: nullishToOptional(PageBlockAsset),\n documentationItemId: nullishToOptional(z.string()),\n pageHeadingId: nullishToOptional(z.string()),\n url: nullishToOptional(z.string()),\n openInNewTab: nullishToOptional(z.boolean()),\n urlPreview: nullishToOptional(PageBlockUrlPreview),\n documentationItemPreview: nullishToOptional(PageBlockLinkPreview),\n});\n\nexport const PageBlockCustomBlockPropertyImageValue = z.object({\n asset: nullishToOptional(PageBlockAsset),\n assetId: nullishToOptional(z.string()),\n assetUrl: nullishToOptional(z.string()),\n});\n\nexport const PageBlockCustomBlockPropertyValue = z.object({\n key: z.string(),\n value: z.any(),\n});\n\nexport const PageBlockFigmaFrameProperties = z.object({\n color: nullishToOptional(\n z.object({\n value: z.string(),\n })\n ),\n alignment: PageBlockTilesAlignment,\n previewContainerHeight: nullishToOptional(z.number()),\n layout: PageBlockTilesLayout,\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n showTitles: z.boolean(),\n});\n\nexport const PageBlockRenderCodeProperties = z.object({\n showCode: z.boolean(),\n showControls: z.boolean().optional(),\n});\n\nexport const PageBlockAssetComponent = z.object({\n persistentId: z.string(),\n componentAssetId: z.string(),\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n});\n\nexport const PageBlockTableColumn = z.object({\n id: z.string(),\n width: DimensionTokenData,\n});\n\nexport const PageBlockTableProperties = z.object({\n showBorders: z.boolean(),\n showHeaderRow: z.boolean(),\n showHeaderColumn: z.boolean(),\n columns: z.array(PageBlockTableColumn),\n});\n\nexport const PageBlockFigmaComponentBlockConfig = z.object({\n showComponentName: nullishToOptional(z.boolean()),\n showComponentDescription: nullishToOptional(z.boolean()),\n showPropertyList: nullishToOptional(z.boolean()),\n previewOrderIds: nullishToOptional(z.array(z.string())),\n previewContainerSize: nullishToOptional(z.enum([\"Centered\", \"NaturalHeight\"])),\n previewContainerHeight: nullishToOptional(z.number()),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n});\n\nexport const PageBlockTokenBlockConfig = z.object({\n tokenNameFormat: nullishToOptional(PageBlockTokenNameFormat),\n tokenNameCustomPropertyId: nullishToOptional(z.string()),\n});\n\nexport const PageBlockAssetBlockConfig = z.object({\n showSearch: nullishToOptional(z.boolean()),\n showAssetDescription: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockSelectedFigmaComponent = z.object({\n figmaComponentId: z.string(),\n selectedComponentProperties: z.string().array(),\n selectedComponentVariants: z.record(z.string().array()).optional(),\n});\n\nexport const PageBlockStorybookItem = z.object({\n entityId: z.string().optional(),\n embed: z\n .object({\n inputUrl: z.string(),\n embedUrl: z.string(),\n })\n .optional(),\n entityMeta: z\n .object({\n caption: z.string().optional(),\n height: z.number().optional(),\n hiddenProps: z.array(z.string()).optional(),\n propValues: z.record(z.unknown()).optional(),\n })\n .optional(),\n});\n\nexport const PageBlockStorybookBlockConfig = z.object({\n value: PageBlockStorybookItem.array(),\n\n showCode: z.boolean().optional(),\n showFooter: z.boolean().optional(),\n showProperties: z.boolean().optional(),\n showDescription: z.boolean().optional(),\n showDefaults: z.boolean().optional(),\n});\n\n//\n// Rich text\n//\n\nexport const PageBlockTextSpanAttributeType = z.enum([\"Bold\", \"Italic\", \"Link\", \"Strikethrough\", \"Code\", \"Comment\"]);\n\nexport const PageBlockTextSpanAttribute = z.object({\n type: PageBlockTextSpanAttributeType,\n\n // Link attributes\n link: nullishToOptional(z.string()),\n documentationItemId: nullishToOptional(z.string()),\n openInNewWindow: nullishToOptional(z.boolean()), // deprecated. use openInNewTab\n openInNewTab: nullishToOptional(z.boolean()),\n\n // Comment attributes\n commentHighlightId: nullishToOptional(z.string()),\n commentIsResolved: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockTextSpan = z.object({\n text: z.string(),\n attributes: z.array(PageBlockTextSpanAttribute),\n});\n\nexport const PageBlockText = z.object({\n spans: z.array(PageBlockTextSpan),\n});\n\nexport const PageBlockGuideline = z.object({\n description: nullishToOptional(z.string()),\n asset: nullishToOptional(PageBlockAsset),\n type: z.string(),\n imageAlt: nullishToOptional(z.string()),\n imageCaption: nullishToOptional(z.string()),\n imageAlignment: nullishToOptional(PageBlockAlignment),\n openLightbox: nullishToOptional(z.boolean()),\n isBordered: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockFile = z.object({\n entityId: z.string(),\n entityMeta: z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n })\n .optional(),\n});\n\nexport type PageBlockCalloutType = z.infer<typeof PageBlockCalloutType>;\nexport type PageBlockCodeLanguage = z.infer<typeof PageBlockCodeLanguage>;\nexport type PageBlockAlignment = z.infer<typeof PageBlockAlignment>;\nexport type PageBlockThemeType = z.infer<typeof PageBlockThemeType>;\nexport type PageBlockAssetType = z.infer<typeof PageBlockAssetType>;\nexport type PageBlockTilesAlignment = z.infer<typeof PageBlockTilesAlignment>;\nexport type PageBlockTilesLayout = z.infer<typeof PageBlockTilesLayout>;\nexport type PageBlockTextSpanAttributeType = z.infer<typeof PageBlockTextSpanAttributeType>;\n\nexport type PageBlockTypeV1 = z.infer<typeof PageBlockTypeV1>;\nexport type PageBlockTextSpanAttribute = z.infer<typeof PageBlockTextSpanAttribute>;\nexport type PageBlockTextSpan = z.infer<typeof PageBlockTextSpan>;\nexport type PageBlockText = z.infer<typeof PageBlockText>;\nexport type PageBlockGuideline = z.infer<typeof PageBlockGuideline>;\nexport type PageBlockFrame = z.infer<typeof PageBlockFrame>;\nexport type PageBlockFrameOrigin = z.infer<typeof PageBlockFrameOrigin>;\nexport type PageBlockAsset = z.infer<typeof PageBlockAsset>;\nexport type PageBlockTableColumn = z.infer<typeof PageBlockTableColumn>;\nexport type PageBlockTheme = z.infer<typeof PageBlockTheme>;\nexport type PageBlockSwatch = z.infer<typeof PageBlockSwatch>;\nexport type PageBlockShortcut = z.infer<typeof PageBlockShortcut>;\nexport type PageBlockCustomBlockPropertyValue = z.infer<typeof PageBlockCustomBlockPropertyValue>;\nexport type PageBlockCustomBlockPropertyImageValue = z.infer<typeof PageBlockCustomBlockPropertyImageValue>;\nexport type PageBlockFigmaComponentBlockConfig = z.infer<typeof PageBlockFigmaComponentBlockConfig>;\nexport type PageBlockTokenNameFormat = z.infer<typeof PageBlockTokenNameFormat>;\n\n//\n// Block\n//\n\nexport const PageBlockBaseV1 = z.object({\n persistentId: z.string(),\n type: PageBlockTypeV1,\n\n // V2 generic attributes\n numberOfColumns: nullishToOptional(z.number()),\n itemBackgroundColor: nullishToOptional(ColorTokenInlineData),\n\n // Element linking\n designObjectId: nullishToOptional(z.string()),\n designObjectIds: nullishToOptional(z.array(z.string())),\n tokenType: nullishToOptional(DesignTokenType.or(z.literal(\"Font\"))),\n showNestedGroups: nullishToOptional(z.boolean()),\n brandId: nullishToOptional(z.string()),\n\n // Rich text\n text: nullishToOptional(PageBlockText),\n caption: nullishToOptional(z.string()),\n headingType: nullishToOptional(z.number().min(1).max(3)),\n codeLanguage: nullishToOptional(PageBlockCodeLanguage),\n calloutType: nullishToOptional(PageBlockCalloutType),\n urlInput: nullishToOptional(z.string()),\n url: nullishToOptional(z.string()),\n urlPreview: nullishToOptional(PageBlockUrlPreview),\n\n // Image\n asset: nullishToOptional(PageBlockAsset),\n alignment: nullishToOptional(PageBlockAlignment),\n imageAlt: nullishToOptional(z.string()),\n openLightbox: nullishToOptional(z.boolean()),\n isBordered: nullishToOptional(z.boolean()),\n\n // Shortcuts block\n shortcuts: nullishToOptional(z.array(PageBlockShortcut)),\n\n // Guidelines\n guideline: nullishToOptional(PageBlockGuideline),\n\n // Custom blocks\n customBlockKey: nullishToOptional(z.string()),\n customBlockProperties: nullishToOptional(z.array(PageBlockCustomBlockPropertyValue)),\n variantKey: nullishToOptional(z.string()),\n\n // Figma frames\n figmaFrameProperties: nullishToOptional(PageBlockFigmaFrameProperties),\n figmaFrames: nullishToOptional(z.array(PageBlockFrame)),\n\n // Generic\n size: nullishToOptional(Size),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n\n // Render code\n renderCodeProperties: nullishToOptional(PageBlockRenderCodeProperties),\n\n // Component assets\n componentAssets: nullishToOptional(z.array(PageBlockAssetComponent)),\n\n // Tables\n tableProperties: nullishToOptional(PageBlockTableProperties),\n columnId: nullishToOptional(z.string()),\n\n // Design tokens\n theme: nullishToOptional(PageBlockTheme),\n swatches: nullishToOptional(PageBlockSwatch.array()),\n blacklistedElementProperties: nullishToOptional(z.array(z.string())),\n tokenBlockConfig: nullishToOptional(PageBlockTokenBlockConfig),\n\n // (Vector) assets\n assetBlockConfig: nullishToOptional(PageBlockAssetBlockConfig),\n\n // Figma components\n figmaComponentsBlockConfig: nullishToOptional(PageBlockFigmaComponentBlockConfig),\n selectedFigmaComponent: nullishToOptional(PageBlockSelectedFigmaComponent),\n selectedFigmaComponents: nullishToOptional(PageBlockSelectedFigmaComponent.array()),\n\n // Arbitrary\n userMetadata: nullishToOptional(z.string()),\n\n // Storybook\n storybookBlockConfig: nullishToOptional(PageBlockStorybookBlockConfig),\n\n // Files\n files: nullishToOptional(PageBlockFile.array()),\n});\n\ntype PageBlockV1Input = z.input<typeof PageBlockBaseV1> & {\n children: PageBlockV1Input[] | null | undefined;\n};\n\nexport const PageBlockV1: z.ZodType<PageBlockV1, z.ZodTypeDef, PageBlockV1Input> = PageBlockBaseV1.extend({\n children: z.lazy(\n () =>\n PageBlockV1.array()\n .nullish()\n .transform(t => t ?? []) as z.ZodType<PageBlockV1[], z.ZodTypeDef, PageBlockV1Input[]>\n ),\n});\n\nexport type PageBlockV1 = z.infer<typeof PageBlockBaseV1> & {\n children: PageBlockV1[];\n};\n\n//\n// Utility methods\n//\n\nexport function traversePageBlocksV1(blocks: PageBlockV1[], action: (block: PageBlockV1) => void) {\n for (const block of blocks) {\n action(block);\n traversePageBlocksV1(block.children, action);\n }\n}\n\nexport function removeCommentSpans(text: PageBlockText): PageBlockText {\n const { spans, ...rest } = text;\n\n const newSpans = spans.map(s => {\n return {\n ...s,\n attributes: s.attributes.filter(a => a.type !== \"Comment\"),\n };\n });\n\n const updatedRichText = {\n ...rest,\n spans: newSpans,\n };\n\n return joinRepeatingSpans(updatedRichText);\n}\n\nexport function joinRepeatingSpans(text: PageBlockText): PageBlockText {\n if (text.spans.length < 2) return text;\n\n // Make sure spans are clean before comparing them\n text = sanitizeSpans(text);\n const { spans, ...rest } = text;\n\n let previousSpan = { ...spans[0] };\n const newSpans = [previousSpan];\n\n for (let i = 1; i < spans.length; i++) {\n const span = spans[i];\n if (areAttributesEqual(span.attributes, previousSpan.attributes)) {\n previousSpan.text += span.text;\n } else {\n previousSpan = { ...span };\n newSpans.push(previousSpan);\n }\n }\n\n return {\n ...rest,\n spans: newSpans,\n };\n}\n\nfunction areAttributesEqual(lhs: PageBlockTextSpanAttribute[], rhs: PageBlockTextSpanAttribute[]) {\n if (lhs.length !== rhs.length) return false;\n\n const lhsMap = mapByUnique(lhs, i => i.type);\n for (const rhsAttribute of rhs) {\n const lhsAttribute = lhsMap.get(rhsAttribute.type);\n if (!areShallowObjectsEqual(lhsAttribute, rhsAttribute)) return false;\n }\n\n return true;\n}\n\nfunction sanitizeSpans(text: PageBlockText): PageBlockText {\n const { spans, ...rest } = text;\n\n return {\n ...rest,\n spans: spans.map(s => {\n const { attributes, ...rest } = s;\n\n return {\n ...rest,\n attributes: attributes.map(sanitizeSpanAttribute),\n };\n }),\n };\n}\n\nfunction sanitizeSpanAttribute(attribute: PageBlockTextSpanAttribute): PageBlockTextSpanAttribute {\n switch (attribute.type) {\n case \"Bold\":\n return { type: \"Bold\" };\n case \"Code\":\n return { type: \"Code\" };\n case \"Strikethrough\":\n return { type: \"Strikethrough\" };\n case \"Italic\":\n return { type: \"Italic\" };\n case \"Comment\":\n const { commentHighlightId, commentIsResolved } = attribute;\n const isCommentIsResolvedDefined = commentIsResolved !== undefined && commentIsResolved !== null;\n\n return {\n type: \"Comment\",\n ...(isCommentIsResolvedDefined && { commentIsResolved }),\n ...(commentHighlightId && { commentHighlightId }),\n };\n case \"Link\":\n const { documentationItemId, link, openInNewTab, openInNewWindow } = attribute;\n const isOpenInNewTabDefined = openInNewTab !== undefined && openInNewTab !== null;\n const isOpenInNewWindowDefined = openInNewWindow !== undefined && openInNewWindow !== null;\n\n return {\n type: \"Link\",\n ...(isOpenInNewTabDefined && { openInNewTab }),\n ...(isOpenInNewWindowDefined && { openInNewWindow }),\n ...(documentationItemId && { documentationItemId }),\n ...(link && { link }),\n };\n }\n}\n","import { z } from \"zod\";\n\nexport const ContentLoadInstruction = z.object({\n from: z.string(),\n to: z.string(),\n authorizationHeaderKvsId: z.string().optional(),\n timeout: z.number().optional(),\n});\n\nexport type ContentLoadInstruction = z.infer<typeof ContentLoadInstruction>;\n\nexport const ContentLoaderPayload = z\n .object({\n type: z.literal(\"Single\"),\n instruction: ContentLoadInstruction,\n })\n .or(\n z.object({\n type: z.literal(\"Multiple\"),\n loadingChunkSize: z.number().optional(),\n instructions: z.array(ContentLoadInstruction),\n })\n )\n .or(\n z.object({\n type: z.literal(\"S3\"),\n location: z.string(),\n })\n );\n\nexport type ContentLoaderPayload = z.infer<typeof ContentLoaderPayload>;\n","import { z } from \"zod\";\n\nexport const GitInteropPulsarError = z.object({\n errorType: z.string(),\n errorMessage: z.string(),\n trace: z.array(z.string()),\n});\nexport type GitInteropPulsarError = z.infer<typeof GitInteropPulsarError>;\n","import slugifyImplementation from \"@sindresorhus/slugify\";\n\nexport function slugify(str: string, options?: slugifyImplementation.Options): string {\n const slug = slugifyImplementation(str ?? \"\", options);\n return slug?.length > 0 ? slug : \"item\";\n}\n\nexport const RESERVED_SLUGS = [\n \"workspaces\",\n \"workspace\",\n \"api0\",\n \"api1\",\n \"api2\",\n \"custom\",\n \"x-sn-reserved\",\n // further elements copied from https://github.com/shouldbee/reserved-usernames/blob/master/reserved-usernames.json\n\n \"0\",\n \"about\",\n \"access\",\n \"account\",\n \"accounts\",\n \"activate\",\n \"activities\",\n \"activity\",\n \"ad\",\n \"add\",\n \"address\",\n \"adm\",\n \"admin\",\n \"administration\",\n \"administrator\",\n \"ads\",\n \"adult\",\n \"advertising\",\n \"affiliate\",\n \"affiliates\",\n \"ajax\",\n \"all\",\n \"alpha\",\n \"analysis\",\n \"analytics\",\n \"android\",\n \"anon\",\n \"anonymous\",\n \"api\",\n \"app\",\n \"apps\",\n \"archive\",\n \"archives\",\n \"article\",\n \"asct\",\n \"asset\",\n \"assets\",\n \"atom\",\n \"auth\",\n \"authentication\",\n \"avatar\",\n \"backup\",\n \"balancer-manager\",\n \"banner\",\n \"banners\",\n \"beta\",\n \"billing\",\n \"bin\",\n \"blog\",\n \"blogs\",\n \"board\",\n \"book\",\n \"bookmark\",\n \"bot\",\n \"bots\",\n \"bug\",\n \"business\",\n \"cache\",\n \"cadastro\",\n \"calendar\",\n \"call\",\n \"campaign\",\n \"cancel\",\n \"captcha\",\n \"career\",\n \"careers\",\n \"cart\",\n \"categories\",\n \"category\",\n \"cgi\",\n \"cgi-bin\",\n \"changelog\",\n \"chat\",\n \"check\",\n \"checking\",\n \"checkout\",\n \"client\",\n \"cliente\",\n \"clients\",\n \"code\",\n \"codereview\",\n \"comercial\",\n \"comment\",\n \"comments\",\n \"communities\",\n \"community\",\n \"company\",\n \"compare\",\n \"compras\",\n \"config\",\n \"configuration\",\n \"connect\",\n \"contact\",\n \"contact-us\",\n \"contact_us\",\n \"contactus\",\n \"contest\",\n \"contribute\",\n \"corp\",\n \"create\",\n \"css\",\n \"dashboard\",\n \"data\",\n \"db\",\n \"default\",\n \"delete\",\n \"demo\",\n \"design\",\n \"designer\",\n \"destroy\",\n \"dev\",\n \"devel\",\n \"developer\",\n \"developers\",\n \"diagram\",\n \"diary\",\n \"dict\",\n \"dictionary\",\n \"die\",\n \"dir\",\n \"direct_messages\",\n \"directory\",\n \"dist\",\n \"doc\",\n \"docs\",\n \"documentation\",\n \"domain\",\n \"download\",\n \"downloads\",\n \"ecommerce\",\n \"edit\",\n \"editor\",\n \"edu\",\n \"education\",\n \"email\",\n \"employment\",\n \"empty\",\n \"end\",\n \"enterprise\",\n \"entries\",\n \"entry\",\n \"error\",\n \"errors\",\n \"eval\",\n \"event\",\n \"exit\",\n \"explore\",\n \"facebook\",\n \"faq\",\n \"favorite\",\n \"favorites\",\n \"feature\",\n \"features\",\n \"feed\",\n \"feedback\",\n \"feeds\",\n \"file\",\n \"files\",\n \"first\",\n \"flash\",\n \"fleet\",\n \"fleets\",\n \"flog\",\n \"follow\",\n \"followers\",\n \"following\",\n \"forgot\",\n \"form\",\n \"forum\",\n \"forums\",\n \"founder\",\n \"free\",\n \"friend\",\n \"friends\",\n \"ftp\",\n \"gadget\",\n \"gadgets\",\n \"game\",\n \"games\",\n \"get\",\n \"ghost\",\n \"gift\",\n \"gifts\",\n \"gist\",\n \"github\",\n \"graph\",\n \"group\",\n \"groups\",\n \"guest\",\n \"guests\",\n \"help\",\n \"home\",\n \"homepage\",\n \"host\",\n \"hosting\",\n \"hostmaster\",\n \"hostname\",\n \"howto\",\n \"hpg\",\n \"html\",\n \"http\",\n \"httpd\",\n \"https\",\n \"i\",\n \"iamges\",\n \"icon\",\n \"icons\",\n \"id\",\n \"idea\",\n \"ideas\",\n \"image\",\n \"images\",\n \"imap\",\n \"img\",\n \"index\",\n \"indice\",\n \"info\",\n \"information\",\n \"inquiry\",\n \"instagram\",\n \"intranet\",\n \"invitations\",\n \"invite\",\n \"ipad\",\n \"iphone\",\n \"irc\",\n \"is\",\n \"issue\",\n \"issues\",\n \"it\",\n \"item\",\n \"items\",\n \"java\",\n \"javascript\",\n \"job\",\n \"jobs\",\n \"join\",\n \"js\",\n \"json\",\n \"jump\",\n \"knowledgebase\",\n \"language\",\n \"languages\",\n \"last\",\n \"ldap-status\",\n \"legal\",\n \"license\",\n \"link\",\n \"links\",\n \"linux\",\n \"list\",\n \"lists\",\n \"log\",\n \"log-in\",\n \"log-out\",\n \"log_in\",\n \"log_out\",\n \"login\",\n \"logout\",\n \"logs\",\n \"m\",\n \"mac\",\n \"mail\",\n \"mail1\",\n \"mail2\",\n \"mail3\",\n \"mail4\",\n \"mail5\",\n \"mailer\",\n \"mailing\",\n \"maintenance\",\n \"manager\",\n \"manual\",\n \"map\",\n \"maps\",\n \"marketing\",\n \"master\",\n \"me\",\n \"media\",\n \"member\",\n \"members\",\n \"message\",\n \"messages\",\n \"messenger\",\n \"microblog\",\n \"microblogs\",\n \"mine\",\n \"mis\",\n \"mob\",\n \"mobile\",\n \"movie\",\n \"movies\",\n \"mp3\",\n \"msg\",\n \"msn\",\n \"music\",\n \"musicas\",\n \"mx\",\n \"my\",\n \"mysql\",\n \"name\",\n \"named\",\n \"nan\",\n \"navi\",\n \"navigation\",\n \"net\",\n \"network\",\n \"new\",\n \"news\",\n \"newsletter\",\n \"nick\",\n \"nickname\",\n \"notes\",\n \"noticias\",\n \"notification\",\n \"notifications\",\n \"notify\",\n \"ns\",\n \"ns1\",\n \"ns10\",\n \"ns2\",\n \"ns3\",\n \"ns4\",\n \"ns5\",\n \"ns6\",\n \"ns7\",\n \"ns8\",\n \"ns9\",\n \"null\",\n \"oauth\",\n \"oauth_clients\",\n \"offer\",\n \"offers\",\n \"official\",\n \"old\",\n \"online\",\n \"openid\",\n \"operator\",\n \"order\",\n \"orders\",\n \"organization\",\n \"organizations\",\n \"overview\",\n \"owner\",\n \"owners\",\n \"page\",\n \"pager\",\n \"pages\",\n \"panel\",\n \"password\",\n \"payment\",\n \"perl\",\n \"phone\",\n \"photo\",\n \"photoalbum\",\n \"photos\",\n \"php\",\n \"phpmyadmin\",\n \"phppgadmin\",\n \"phpredisadmin\",\n \"pic\",\n \"pics\",\n \"ping\",\n \"plan\",\n \"plans\",\n \"plugin\",\n \"plugins\",\n \"policy\",\n \"pop\",\n \"pop3\",\n \"popular\",\n \"portal\",\n \"post\",\n \"postfix\",\n \"postmaster\",\n \"posts\",\n \"pr\",\n \"premium\",\n \"press\",\n \"price\",\n \"pricing\",\n \"privacy\",\n \"privacy-policy\",\n \"privacy_policy\",\n \"privacypolicy\",\n \"private\",\n \"product\",\n \"products\",\n \"profile\",\n \"project\",\n \"projects\",\n \"promo\",\n \"pub\",\n \"public\",\n \"purpose\",\n \"put\",\n \"python\",\n \"query\",\n \"random\",\n \"ranking\",\n \"read\",\n \"readme\",\n \"recent\",\n \"recruit\",\n \"recruitment\",\n \"register\",\n \"registration\",\n \"release\",\n \"remove\",\n \"replies\",\n \"report\",\n \"reports\",\n \"repositories\",\n \"repository\",\n \"req\",\n \"request\",\n \"requests\",\n \"reset\",\n \"roc\",\n \"root\",\n \"rss\",\n \"ruby\",\n \"rule\",\n \"sag\",\n \"sale\",\n \"sales\",\n \"sample\",\n \"samples\",\n \"save\",\n \"school\",\n \"script\",\n \"scripts\",\n \"search\",\n \"secure\",\n \"security\",\n \"self\",\n \"send\",\n \"server\",\n \"server-info\",\n \"server-status\",\n \"service\",\n \"services\",\n \"session\",\n \"sessions\",\n \"setting\",\n \"settings\",\n \"setup\",\n \"share\",\n \"shop\",\n \"show\",\n \"sign-in\",\n \"sign-up\",\n \"sign_in\",\n \"sign_up\",\n \"signin\",\n \"signout\",\n \"signup\",\n \"site\",\n \"sitemap\",\n \"sites\",\n \"smartphone\",\n \"smtp\",\n \"soporte\",\n \"source\",\n \"spec\",\n \"special\",\n \"sql\",\n \"src\",\n \"ssh\",\n \"ssl\",\n \"ssladmin\",\n \"ssladministrator\",\n \"sslwebmaster\",\n \"staff\",\n \"stage\",\n \"staging\",\n \"start\",\n \"stat\",\n \"state\",\n \"static\",\n \"stats\",\n \"status\",\n \"store\",\n \"stores\",\n \"stories\",\n \"style\",\n \"styleguide\",\n \"stylesheet\",\n \"stylesheets\",\n \"subdomain\",\n \"subscribe\",\n \"subscriptions\",\n \"suporte\",\n \"support\",\n \"svn\",\n \"swf\",\n \"sys\",\n \"sysadmin\",\n \"sysadministrator\",\n \"system\",\n \"tablet\",\n \"tablets\",\n \"tag\",\n \"talk\",\n \"task\",\n \"tasks\",\n \"team\",\n \"teams\",\n \"tech\",\n \"telnet\",\n \"term\",\n \"terms\",\n \"terms-of-service\",\n \"terms_of_service\",\n \"termsofservice\",\n \"test\",\n \"test1\",\n \"test2\",\n \"test3\",\n \"teste\",\n \"testing\",\n \"tests\",\n \"theme\",\n \"themes\",\n \"thread\",\n \"threads\",\n \"tmp\",\n \"todo\",\n \"tool\",\n \"tools\",\n \"top\",\n \"topic\",\n \"topics\",\n \"tos\",\n \"tour\",\n \"translations\",\n \"trends\",\n \"tutorial\",\n \"tux\",\n \"tv\",\n \"twitter\",\n \"undef\",\n \"unfollow\",\n \"unsubscribe\",\n \"update\",\n \"upload\",\n \"uploads\",\n \"url\",\n \"usage\",\n \"user\",\n \"username\",\n \"users\",\n \"usuario\",\n \"vendas\",\n \"ver\",\n \"version\",\n \"video\",\n \"videos\",\n \"visitor\",\n \"watch\",\n \"weather\",\n \"web\",\n \"webhook\",\n \"webhooks\",\n \"webmail\",\n \"webmaster\",\n \"website\",\n \"websites\",\n \"welcome\",\n \"widget\",\n \"widgets\",\n \"wiki\",\n \"win\",\n \"windows\",\n \"word\",\n \"work\",\n \"works\",\n \"workshop\",\n \"ww\",\n \"wws\",\n \"www\",\n \"www1\",\n \"www2\",\n \"www3\",\n \"www4\",\n \"www5\",\n \"www6\",\n \"www7\",\n \"wwws\",\n \"wwww\",\n \"xfn\",\n \"xml\",\n \"xmpp\",\n \"xpg\",\n \"xxx\",\n \"yaml\",\n \"year\",\n \"yml\",\n \"you\",\n \"yourdomain\",\n \"yourname\",\n \"yoursite\",\n \"yourusername\",\n \"latest\",\n \"live\",\n \"preview\",\n \"learn\",\n \"supernova\",\n \"super-nova\",\n];\n\nconst RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);\n\nexport const RESERVED_SLUG_PREFIX = \"x-sn-reserved-\";\n\nconst isSlugReservedInternal = (slug: string) => slug?.startsWith(RESERVED_SLUG_PREFIX);\nexport function isSlugReserved(slug: string) {\n return RESERVED_SLUGS_SET.has(slug) || isSlugReservedInternal(slug);\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const ElementPropertyTypeSchema = z.enum([\"Text\", \"Number\", \"Boolean\", \"Select\", \"Generic\", \"Link\", \"URL\"]);\nexport const ElementPropertyTargetType = z.enum([\"Token\", \"Component\", \"DocumentationPage\"]);\nexport const ElementPropertyLinkType = z.enum([\"FigmaComponent\", \"DocumentationPage\"]);\nexport const ElementPropertyImmutableType = z.enum([\"Collection\"]);\n\nconst CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;\n\nexport const ColorTokenInlineData = z.object({\n value: z.string(),\n});\n\nexport const ElementPropertyDefinitionOption = z.object({\n id: z.string(),\n name: z.string(),\n backgroundColor: ColorTokenInlineData.optional(),\n});\n\nexport const ElementPropertyDefinition = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n name: z.string(),\n codeName: z.string().regex(CODE_NAME_REGEX),\n description: z.string(),\n type: ElementPropertyTypeSchema,\n targetElementType: ElementPropertyTargetType,\n options: z.array(ElementPropertyDefinitionOption).optional(),\n linkElementType: ElementPropertyLinkType.optional(),\n});\n\nexport type ElementPropertyType = z.infer<typeof ElementPropertyTypeSchema>;\nexport const ElementPropertyType = ElementPropertyTypeSchema.enum;\n\nexport type ElementPropertyTargetType = z.infer<typeof ElementPropertyTargetType>;\nexport type ElementPropertyLinkType = z.infer<typeof ElementPropertyLinkType>;\nexport type ElementPropertyImmutableType = z.infer<typeof ElementPropertyImmutableType>;\nexport type ColorTokenInlineData = z.infer<typeof ColorTokenInlineData>;\nexport type ElementPropertyDefinitionOption = z.infer<typeof ElementPropertyDefinitionOption>;\nexport type ElementPropertyDefinition = z.infer<typeof ElementPropertyDefinition>;\n\nexport type CreateElementPropertyDefinition = DbCreateInputOmit<ElementPropertyDefinition> & {\n columnWidth?: number;\n};\n\nexport type UpdateElementPropertyDefinition = OmitStrict<\n DbUpdate<ElementPropertyDefinition>,\n \"designSystemVersionId\" | \"targetElementType\" | \"type\" | \"linkElementType\"\n>;\n\nexport type ElementPropertyDefinitionDiff = {\n toCreate: CreateElementPropertyDefinition[];\n toUpdate: UpdateElementPropertyDefinition[];\n};\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const ElementPropertyValue = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n targetElementPersistentId: z.string(),\n definitionPersistentId: z.string(),\n stringValue: z.string().nullish(),\n numberValue: z.number().nullish(),\n booleanValue: z.boolean().nullish(),\n referenceValue: z.string().nullish(),\n referenceValuePreview: z.string().optional(),\n});\n\nexport type ElementPropertyValue = z.infer<typeof ElementPropertyValue>;\n\nexport type CreateElementPropertyValue = DbCreateInputOmit<ElementPropertyValue>;\nexport type UpdateElementPropertyValue = OmitStrict<\n DbUpdate<ElementPropertyValue>,\n \"designSystemVersionId\" | \"definitionPersistentId\" | \"targetElementPersistentId\"\n>;\n\nexport type ElementPropertyValueDiff = {\n toCreate: CreateElementPropertyValue[];\n toUpdate: UpdateElementPropertyValue[];\n toDelete: ElementPropertyValue[];\n};\n","import { z } from \"zod\";\n\nexport const Point2D = z.object({\n x: z.number(),\n y: z.number(),\n});\n\nexport type Point2D = z.infer<typeof Point2D>;\n","import { z } from \"zod\";\n\nconst nullSize = { height: -1, width: -1 };\n\nfunction isNullSize(size: Size): boolean {\n return size.height === nullSize.height && size.width === nullSize.width;\n}\n\nexport const Size = z.object({\n width: z\n .number()\n .nullish()\n .transform(v => v ?? nullSize.width),\n\n height: z\n .number()\n .nullish()\n .transform(v => v ?? nullSize.height),\n});\n\nexport const SizeOrUndefined = Size.optional().transform(v => {\n if (!v) return undefined;\n if (isNullSize(v)) return undefined;\n\n return v;\n});\n\nexport type Size = z.infer<typeof Size>;\n","import { z } from \"zod\";\nimport { ObjectMeta } from \"../../common\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport type CreateDesignElement = DbCreateInputOmit<DesignElement>;\nexport type UpdateDesignElement = OmitStrict<\n DbUpdate<DesignElement>,\n \"brandPersistentId\" | \"childType\" | \"designSystemVersionId\" | \"shortPersistentId\"\n>;\n\n//\n// Token types\n//\n\nexport const DesignTokenType = z.enum([\n \"Color\",\n \"Border\",\n \"Gradient\",\n \"Shadow\",\n \"Dimension\",\n \"Duration\",\n \"Size\",\n \"Space\",\n \"Opacity\",\n \"FontSize\",\n \"LineHeight\",\n \"LetterSpacing\",\n \"ParagraphSpacing\",\n \"BorderWidth\",\n \"BorderRadius\",\n \"ZIndex\",\n \"Image\",\n \"String\",\n \"ProductCopy\",\n \"FontFamily\",\n \"FontWeight\",\n \"TextDecoration\",\n \"TextCase\",\n \"Visibility\",\n \"Typography\",\n \"Blur\",\n \"Font\",\n]);\n\nexport const tokenElementTypes: DesignTokenType[] = [...DesignTokenType.options.filter(v => v !== \"Font\")];\n\nexport type DesignTokenType = z.infer<typeof DesignTokenType>;\n\n//\n// Non-token types\n//\n\nexport const DesignElementType = DesignTokenType.or(\n z.enum([\n \"Component\",\n \"Theme\",\n \"Documentation\",\n \"DocumentationPage\",\n \"DesignSystemComponent\",\n \"ElementGroup\",\n \"FigmaNodeStructure\",\n \"FigmaNodeReference\",\n \"PageBlock\",\n ])\n);\n\nexport type DesignElementType = z.infer<typeof DesignElementType>;\n\nexport function isTokenType(type: DesignElementType): type is DesignTokenType {\n return DesignTokenType.safeParse(type).success;\n}\n\nconst numberTokenTypes: Set<DesignTokenType> = new Set([\n \"Dimension\",\n \"Duration\",\n \"Size\",\n \"Space\",\n \"Opacity\",\n \"FontSize\",\n \"LineHeight\",\n \"LetterSpacing\",\n \"ParagraphSpacing\",\n \"BorderWidth\",\n \"BorderRadius\",\n \"ZIndex\",\n] satisfies DesignTokenType[]);\n\nconst stringTokenTypes: Set<DesignTokenType> = new Set([\n \"String\",\n \"ProductCopy\",\n \"FontFamily\",\n \"FontWeight\",\n] satisfies DesignTokenType[]);\n\nconst fallbackNumberValue = 14;\n\nexport function areTokenTypesCompatible(\n lhs: DesignTokenType,\n rhs: DesignTokenType,\n isNonCompatibleTypeChangesEnabled = false\n): boolean {\n if (lhs === rhs) return true;\n if (numberTokenTypes.has(lhs) && numberTokenTypes.has(rhs)) return true;\n if (stringTokenTypes.has(lhs) && stringTokenTypes.has(rhs)) return true;\n\n if (isNonCompatibleTypeChangesEnabled && stringTokenTypes.has(lhs) && numberTokenTypes.has(rhs)) return true;\n\n return false;\n}\n\nexport function castStringToDimensionValue(lhs: DesignTokenType, rhs: DesignTokenType, value?: unknown) {\n if (stringTokenTypes.has(lhs) && numberTokenTypes.has(rhs) && value) {\n const newValue = Number.parseFloat(value?.toString() ?? \"\");\n const measure = Number.isNaN(newValue) ? fallbackNumberValue : newValue;\n return { unit: \"Pixels\", measure };\n }\n\n return value;\n}\n\n//\n// Element category\n//\n\nexport const DesignElementCategory = z.enum([\n \"Token\",\n \"Component\",\n \"DesignSystemComponent\",\n \"DocumentationPage\",\n \"Theme\",\n \"PageBlock\",\n]);\n\nexport type DesignElementCategory = z.infer<typeof DesignElementCategory>;\n\n// Elements\n\nexport const DesignSystemElementExportProps = z.object({\n isAsset: z\n .boolean()\n .nullish()\n .transform(v => v ?? false),\n\n codeName: z.string().nullish(),\n});\n\nexport type DesignSystemElementExportProps = z.infer<typeof DesignSystemElementExportProps>;\n\nexport const ShallowDesignElement = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n type: DesignElementType,\n brandPersistentId: z.string().optional(),\n collectionPersistentId: z.string().optional(),\n parentPersistentId: z.string().optional(),\n shortPersistentId: z.string().optional(),\n childType: DesignElementType.optional(),\n sortOrder: z.number(),\n origin: z.record(z.any()).optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DesignElement = ShallowDesignElement.extend({\n meta: ObjectMeta,\n slug: z.string().optional(),\n userSlug: z.string().optional(),\n exportProperties: DesignSystemElementExportProps.optional(),\n data: z.record(z.any()),\n origin: z.record(z.any()).optional(),\n});\n\nexport type ShallowDesignElement = z.infer<typeof ShallowDesignElement>;\nexport type DesignElement = z.infer<typeof DesignElement>;\n\nexport const HierarchicalElements = DesignTokenType.or(\n z.enum([\"Component\", \"DesignSystemComponent\", \"DocumentationPage\"])\n);\n\nexport type HierarchicalElements = z.infer<typeof HierarchicalElements>;\n","import { z } from \"zod\";\nimport { PageBlockDefinitionMultiRichTextPropertyStyle } from \"../../documentation/block-definitions/item\";\nimport { DesignTokenType } from \"../raw-element\";\nimport {\n PageBlockCalloutType,\n PageBlockCodeLanguage,\n PageBlockText,\n PageBlockTokenNameFormat,\n} from \"./documentation-block-v1\";\n\n//\n// Enums\n//\n\nexport const PageBlockLinkType = z.enum([\"DocumentationItem\", \"PageHeading\", \"Url\"]);\nexport const PageBlockImageType = z.enum([\"Resource\", \"FigmaNode\"]);\nexport const PageBlockImageAlignment = z.enum([\"Left\", \"Center\", \"Stretch\"]);\nexport const PageBlockTableCellAlignment = z.enum([\"Left\", \"Center\", \"Right\"]);\nexport const PageBlockPreviewContainerSize = z.enum([\"Centered\", \"NaturalHeight\"]);\nexport const PageBlockThemeDisplayMode = z.enum([\"Split\", \"Override\"]);\nexport const PageBlockTokenValueFormat = z.enum([\"ResolvedValue\", \"ReferenceName\", \"NoValue\"]);\n\nexport type PageBlockLinkType = z.infer<typeof PageBlockLinkType>;\nexport type PageBlockImageType = z.infer<typeof PageBlockImageType>;\nexport type PageBlockImageAlignment = z.infer<typeof PageBlockImageAlignment>;\nexport type PageBlockTableCellAlignment = z.infer<typeof PageBlockTableCellAlignment>;\nexport type PageBlockPreviewContainerSize = z.infer<typeof PageBlockPreviewContainerSize>;\nexport type PageBlockThemeDisplayMode = z.infer<typeof PageBlockThemeDisplayMode>;\nexport type PageBlockTokenValueFormat = z.infer<typeof PageBlockTokenValueFormat>;\n\n//\n// Definitions - Block\n//\n\nexport const PageBlockImageResourceReference = z.object({\n resourceId: z.string(),\n url: z.string(),\n});\n\nexport const PageBlockResourceFrameNodeReference = z.object({\n sourceId: z.string(),\n frameReferenceId: z.string(),\n});\n\nexport const PageBlockImageReference = z.object({\n type: PageBlockImageType,\n\n resource: PageBlockImageResourceReference.optional(),\n figmaNode: PageBlockResourceFrameNodeReference.optional(),\n});\n\nexport const PageBlockColorV2 = z.object({\n value: z.string(),\n referencedTokenId: z.string().optional(),\n});\n\nexport const PageBlockAssetEntityMeta = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n showNestedGroups: z.boolean().optional(),\n});\n\nexport const PageBlockFigmaComponentEntityMeta = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n selectedComponentProperties: z.array(z.string()).optional(),\n});\n\nexport const PageBlockFigmaNodeEntityMeta = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n});\n\nexport const PageBlockAppearanceV2 = z.object({\n itemBackgroundColor: PageBlockColorV2.optional(),\n numberOfColumns: z.number().optional(),\n});\n\nexport const PageBlockItemUntypedValue = z\n .object({\n value: z.any(),\n })\n .and(z.record(z.any()));\n\nexport const PageBlockLinkV2 = z.object({\n type: PageBlockLinkType,\n documentationItemId: z.string().optional(),\n pageHeadingId: z.string().optional(),\n url: z.string().optional(),\n openInNewTab: z.boolean().optional(),\n});\n\nexport const PageBlockItemV2 = z.object({\n id: z.string(),\n linksTo: PageBlockLinkV2.optional(),\n props: z.record(PageBlockItemUntypedValue),\n});\n\nexport const PageBlockDataV2 = z.object({\n packageId: z.string(),\n variantId: z.string().optional(),\n indentLevel: z.number(),\n appearance: PageBlockAppearanceV2.optional(),\n items: z.array(PageBlockItemV2),\n});\n\nexport type PageBlockImageResourceReference = z.infer<typeof PageBlockImageResourceReference>;\nexport type PageBlockResourceFrameNodeReference = z.infer<typeof PageBlockResourceFrameNodeReference>;\nexport type PageBlockImageReference = z.infer<typeof PageBlockImageReference>;\nexport type PageBlockColorV2 = z.infer<typeof PageBlockColorV2>;\nexport type PageBlockAssetEntityMeta = z.infer<typeof PageBlockAssetEntityMeta>;\nexport type PageBlockFigmaComponentEntityMeta = z.infer<typeof PageBlockFigmaComponentEntityMeta>;\nexport type PageBlockFigmaNodeEntityMeta = z.infer<typeof PageBlockFigmaNodeEntityMeta>;\nexport type PageBlockAppearanceV2 = z.infer<typeof PageBlockAppearanceV2>;\nexport type PageBlockItemUntypedValue = z.infer<typeof PageBlockItemUntypedValue>;\nexport type PageBlockLinkV2 = z.infer<typeof PageBlockLinkV2>;\nexport type PageBlockItemV2 = z.infer<typeof PageBlockItemV2>;\nexport type PageBlockDataV2 = z.infer<typeof PageBlockDataV2>;\n\n//\n// Definitions - Typed Values\n//\n\nexport const PageBlockItemAssetValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n showSearch: z.boolean().optional(),\n showAssetDescription: z.boolean().optional(),\n previewContainerSize: PageBlockPreviewContainerSize.optional(),\n previewContainerHeight: z.number().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"Asset\", \"AssetGroup\"]),\n entityMeta: PageBlockAssetEntityMeta.optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemAssetPropertyValue = z.object({\n value: z.array(z.string()).default([]),\n});\n\nexport const PageBlockItemFigmaComponentValue = z.object({\n showComponentName: z.boolean().optional(),\n showComponentDescription: z.boolean().optional(),\n showPropertyList: z.boolean().optional(),\n previewOrderIds: z.array(z.string()).optional(),\n previewContainerSize: PageBlockPreviewContainerSize.optional(),\n previewContainerHeight: z.number().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"FigmaComponent\"]),\n entityMeta: z\n .object({\n selectedComponentProperties: z.string().array().optional(),\n selectedComponentVariants: z.record(z.string().array()).optional(),\n })\n .optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemBooleanValue = z.object({\n value: z.boolean(),\n});\n\nexport const PageBlockItemCodeValue = z.object({\n format: PageBlockCodeLanguage.optional(),\n caption: z.string().optional(),\n value: z.string(),\n});\n\nexport const PageBlockItemSandboxValue = z.object({\n showCode: z.boolean().optional(),\n showControls: z.boolean().optional(),\n backgroundColor: z.string().optional(),\n alignPreview: z.enum([\"Left\", \"Center\"]).optional(),\n previewHeight: z.number().optional(),\n value: z.string(),\n});\n\nexport const PageBlockItemColorValue = z.record(z.any());\n\nexport const PageBlockItemComponentValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n selectedBrandId: z.string().optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"Component\", \"ComponentGroup\"]),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemComponentPropertyValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemDividerValue = z.object({});\n\nexport const PageBlockItemEmbedValue = z.object({\n value: z.string().optional(),\n caption: z.string().optional(),\n height: z.number().optional(),\n alt: z.string().optional(),\n openGraph: z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n imageUrl: z.string().optional(),\n })\n .optional(),\n});\n\nexport const PageBlockItemFigmaNodeValue = z.object({\n showSearch: z.boolean().optional(),\n previewContainerSize: PageBlockPreviewContainerSize.optional(),\n previewContainerHeight: z.number().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n showFrameDetails: z.boolean().optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityMeta: PageBlockFigmaNodeEntityMeta.optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemImageValue = z.object({\n alt: z.string().optional(),\n caption: z.string().optional(),\n alignment: PageBlockImageAlignment.optional(),\n openLightbox: z.boolean().optional(),\n isBordered: z.boolean().optional(),\n value: PageBlockImageReference.optional(),\n});\n\nexport const PageBlockItemMarkdownValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemMultiRichTextValue = z.object({\n value: PageBlockText.array(),\n});\n\nexport const PageBlockItemMultiSelectValue = z.object({\n value: z.array(z.string()).default([]),\n});\n\nexport const PageBlockItemNumberValue = z.object({\n value: z.number(),\n});\n\nexport const PageBlockItemRichTextValue = z.object({\n value: PageBlockText,\n calloutType: PageBlockCalloutType.optional(),\n});\n\nexport const PageBlockItemSingleSelectValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemStorybookValueOld = z.object({\n value: z.string().optional(),\n caption: z.string().optional(),\n height: z.number().optional(),\n embedUrl: z.string().optional(),\n\n storyId: z.string().optional(),\n sourceId: z.string().optional(),\n});\n\nexport const PageBlockItemStorybookValue = z.object({\n value: z\n .array(\n z.object({\n entityId: z.string().optional(),\n embed: z\n .object({\n inputUrl: z.string(),\n embedUrl: z.string(),\n })\n .optional(),\n entityMeta: z\n .object({\n caption: z.string().optional(),\n height: z.number().optional(),\n hiddenProps: z.array(z.string()).optional(),\n propValues: z.record(z.unknown()).optional(),\n })\n .optional(),\n })\n )\n .optional(),\n showCode: z.boolean().optional(),\n showFooter: z.boolean().optional(),\n showProperties: z.boolean().optional(),\n showDescription: z.boolean().optional(),\n showDefaults: z.boolean().optional(),\n});\n\nexport const PageBlockItemTextValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemSwatch = z.object({\n id: z.string(),\n selectedThemeIds: z.string().array(),\n});\n\nexport const PageBlockItemTokenValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n selectedThemeIds: z.array(z.string()).optional(),\n swatches: z.array(PageBlockItemSwatch).optional(),\n themeDisplayMode: PageBlockThemeDisplayMode.optional(),\n tokenNameFormat: PageBlockTokenNameFormat.optional(),\n tokenNameCustomPropertyId: z.string().optional(),\n tokenValueFormat: PageBlockTokenValueFormat.optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"Token\", \"TokenGroup\"]),\n entityMeta: z\n .object({\n showNestedGroups: z.boolean().optional(),\n })\n .optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemFileValue = z.object({\n value: z\n .object({\n entityId: z.string(),\n entityMeta: z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n })\n .optional(),\n })\n .array(),\n});\n\nexport const PageBlockItemTokenPropertyValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n selectedThemeIds: z.array(z.string()).optional(),\n value: z.array(z.string()).default([]),\n});\n\nexport const PageBlockItemTokenTypeValue = z.object({\n value: z.array(DesignTokenType).default([]),\n});\n\nexport const PageBlockItemUrlValue = z.object({\n value: z.string(),\n});\n\nexport type PageBlockItemAssetValue = z.infer<typeof PageBlockItemAssetValue>;\nexport type PageBlockItemAssetPropertyValue = z.infer<typeof PageBlockItemAssetPropertyValue>;\nexport type PageBlockItemFigmaComponentValue = z.infer<typeof PageBlockItemFigmaComponentValue>;\nexport type PageBlockItemBooleanValue = z.infer<typeof PageBlockItemBooleanValue>;\nexport type PageBlockItemCodeValue = z.infer<typeof PageBlockItemCodeValue>;\nexport type PageBlockItemSandboxValue = z.infer<typeof PageBlockItemSandboxValue>;\nexport type PageBlockItemColorValue = z.infer<typeof PageBlockItemColorValue>;\nexport type PageBlockItemComponentValue = z.infer<typeof PageBlockItemComponentValue>;\nexport type PageBlockItemComponentPropertyValue = z.infer<typeof PageBlockItemComponentPropertyValue>;\nexport type PageBlockItemDividerValue = z.infer<typeof PageBlockItemDividerValue>;\nexport type PageBlockItemEmbedValue = z.infer<typeof PageBlockItemEmbedValue>;\nexport type PageBlockItemFigmaNodeValue = z.infer<typeof PageBlockItemFigmaNodeValue>;\nexport type PageBlockItemImageValue = z.infer<typeof PageBlockItemImageValue>;\nexport type PageBlockItemMarkdownValue = z.infer<typeof PageBlockItemMarkdownValue>;\nexport type PageBlockItemMultiRichTextValue = z.infer<typeof PageBlockItemMultiRichTextValue>;\nexport type PageBlockItemMultiSelectValue = z.infer<typeof PageBlockItemMultiSelectValue>;\nexport type PageBlockItemNumberValue = z.infer<typeof PageBlockItemNumberValue>;\nexport type PageBlockItemRichTextValue = z.infer<typeof PageBlockItemRichTextValue>;\nexport type PageBlockItemSingleSelectValue = z.infer<typeof PageBlockItemSingleSelectValue>;\nexport type PageBlockItemStorybookValueOld = z.infer<typeof PageBlockItemStorybookValueOld>;\nexport type PageBlockItemStorybookValue = z.infer<typeof PageBlockItemStorybookValue>;\nexport type PageBlockItemTextValue = z.infer<typeof PageBlockItemTextValue>;\nexport type PageBlockItemSwatch = z.infer<typeof PageBlockItemSwatch>;\nexport type PageBlockItemTokenValue = z.infer<typeof PageBlockItemTokenValue>;\nexport type PageBlockItemTokenPropertyValue = z.infer<typeof PageBlockItemTokenPropertyValue>;\nexport type PageBlockItemTokenTypeValue = z.infer<typeof PageBlockItemTokenTypeValue>;\nexport type PageBlockItemUrlValue = z.infer<typeof PageBlockItemUrlValue>;\nexport type PageBlockItemFileValue = z.infer<typeof PageBlockItemFileValue>;\n\n//\n// Definitions - Rich text editor value\n//\n\nexport const PageBlockItemRichTextEditorParagraphNode = z.object({\n type: z.literal(\"Paragraph\"),\n value: PageBlockItemRichTextValue.shape.value,\n});\n\nexport const PageBlockItemRichTextEditorListNode = z.object({\n type: z.literal(\"List\"),\n listType: PageBlockDefinitionMultiRichTextPropertyStyle,\n value: PageBlockItemMultiRichTextValue.shape.value,\n});\n\nexport const PageBlockItemRichTextEditorNode = z.discriminatedUnion(\"type\", [\n PageBlockItemRichTextEditorParagraphNode,\n PageBlockItemRichTextEditorListNode,\n]);\n\nexport const PageBlockItemRichTextEditorValue = z.object({\n value: PageBlockItemRichTextEditorNode.array(),\n});\n\nexport type PageBlockItemRichTextEditorParagraphNode = z.infer<typeof PageBlockItemRichTextEditorParagraphNode>;\nexport type PageBlockItemRichTextEditorListNode = z.infer<typeof PageBlockItemRichTextEditorListNode>;\nexport type PageBlockItemRichTextEditorNode = z.infer<typeof PageBlockItemRichTextEditorNode>;\nexport type PageBlockItemRichTextEditorValue = z.infer<typeof PageBlockItemRichTextEditorValue>;\n\n//\n// Definitions - Table Value\n//\n\nexport const PageBlockItemTableRichTextNode = z.object({\n type: z.literal(\"RichText\"),\n id: z.string(),\n value: PageBlockItemRichTextValue.shape.value,\n});\n\nexport const PageBlockItemTableImageNode = z.object({\n type: z.literal(\"Image\"),\n id: z.string(),\n caption: PageBlockItemImageValue.shape.caption,\n alt: PageBlockItemImageValue.shape.alt,\n value: PageBlockItemImageValue.shape.value,\n alignment: PageBlockItemImageValue.shape.alignment,\n openLightbox: PageBlockItemImageValue.shape.openLightbox,\n isBordered: PageBlockItemImageValue.shape.isBordered,\n});\n\nexport const PageBlockItemTableNode = z.discriminatedUnion(\"type\", [\n PageBlockItemTableRichTextNode,\n PageBlockItemTableImageNode,\n]);\n\nexport const PageBlockItemTableCell = z.object({\n id: z.string(),\n nodes: z.array(PageBlockItemTableNode),\n columnWidth: z.number().optional(),\n alignment: PageBlockTableCellAlignment,\n});\n\nexport const PageBlockItemTableRow = z.object({\n cells: z.array(PageBlockItemTableCell),\n});\n\nexport const PageBlockItemTableValue = z.object({\n highlightHeaderColumn: z.boolean().optional(),\n highlightHeaderRow: z.boolean().optional(),\n showBorder: z.boolean().optional(),\n value: z.array(PageBlockItemTableRow).default([]),\n});\n\nexport type PageBlockItemTableRichTextNode = z.infer<typeof PageBlockItemTableRichTextNode>;\nexport type PageBlockItemTableImageNode = z.infer<typeof PageBlockItemTableImageNode>;\nexport type PageBlockItemTableNode = z.infer<typeof PageBlockItemTableNode>;\nexport type PageBlockItemTableCell = z.infer<typeof PageBlockItemTableCell>;\nexport type PageBlockItemTableRow = z.infer<typeof PageBlockItemTableRow>;\nexport type PageBlockItemTableValue = z.infer<typeof PageBlockItemTableValue>;\n\n//\n// Definitions - Conversion\n//\n\nexport function storybookValueFromOldValue(oldValue: PageBlockItemStorybookValueOld): PageBlockItemStorybookValue {\n return {\n value: [\n {\n // URLs\n ...(oldValue.embedUrl &&\n oldValue.value && {\n embed: {\n embedUrl: oldValue.embedUrl,\n inputUrl: oldValue.value,\n },\n }),\n\n // Meta\n entityMeta: {\n caption: oldValue.caption,\n height: oldValue.height,\n },\n },\n ],\n };\n}\n","import { z } from \"zod\";\nimport { PageBlockDefinitionAppearance } from \"./aux\";\nimport { PageBlockDefinitionVariant } from \"./variant\";\n\n//\n// Enums\n//\n\nexport const PageBlockDefinitionPropertyType = z.enum([\n \"RichText\",\n \"MultiRichText\",\n \"RichTextEditor\",\n \"Text\",\n \"Boolean\",\n \"Number\",\n \"SingleSelect\",\n \"MultiSelect\",\n \"Image\",\n \"Token\",\n \"TokenType\",\n \"TokenProperty\",\n \"Component\",\n \"ComponentProperty\",\n \"Asset\",\n \"AssetProperty\",\n \"FigmaNode\",\n \"EmbedURL\",\n \"URL\",\n \"Markdown\",\n \"Code\",\n \"CodeSandbox\",\n \"Table\",\n \"Divider\",\n \"Storybook\",\n \"Color\",\n \"FigmaComponent\",\n \"File\",\n]);\n\nexport const PageBlockDefinitionRichTextPropertyStyle = z.enum([\n \"Title1\",\n \"Title2\",\n \"Title3\",\n \"Title4\",\n \"Title5\",\n \"Quote\",\n \"Callout\",\n \"Default\",\n]);\n\nexport const PageBlockDefinitionMultiRichTextPropertyStyle = z.enum([\"OL\", \"UL\"]);\n\nexport const PageBlockDefinitionRichTextEditorPropertyStyle = z.enum([\n \"OL\",\n \"UL\",\n \"Bold\",\n \"Italic\",\n \"Link\",\n \"Strikethrough\",\n \"InlineCode\",\n]);\n\nexport const PageBlockDefinitionTextPropertyStyle = z.enum([\n \"Title1\",\n \"Title2\",\n \"Title3\",\n \"Title4\",\n \"Title5\",\n \"Default\",\n \"DefaultBold\",\n \"DefaultSemibold\",\n \"Small\",\n \"SmallBold\",\n \"SmallSemibold\",\n \"Custom\",\n]);\n\nexport const PageBlockDefinitionTextPropertyColor = z.enum([\"Neutral\", \"NeutralFaded\"]);\n\nexport const PageBlockDefinitionBooleanPropertyStyle = z.enum([\"SegmentedControl\", \"ToggleButton\", \"Checkbox\"]);\nexport const PageBlockDefinitionSingleSelectPropertyStyle = z.enum([\n \"SegmentedControl\",\n \"ToggleButton\",\n \"Select\",\n \"Checkbox\",\n]);\nexport const PageBlockDefinitionSingleSelectPropertyColor = z.enum([\n \"Green\",\n \"Red\",\n \"Yellow\",\n \"Blue\",\n \"Purple\",\n \"Orange\",\n \"Pink\",\n \"Teal\",\n \"Brown\",\n \"Grey\",\n \"LightGrey\",\n \"Cyan\",\n \"Fuchsia\",\n]);\n\nexport const IconSet = z.enum([\"CheckCircle\", \"CrossCircle\", \"Alert\"]);\n\nexport const PageBlockDefinitionMultiSelectPropertyStyle = z.enum([\"SegmentedControl\", \"Select\", \"Checkbox\"]);\n\nexport const PageBlockDefinitionImageAspectRatio = z.enum([\"Auto\", \"Square\", \"Landscape\", \"Portrait\", \"Wide\"]);\n\nexport const PageBlockDefinitionImageWidth = z.enum([\"Full\", \"Icon\", \"Small\", \"Medium\", \"Large\", \"Poster\"]);\n\nexport type PageBlockDefinitionPropertyType = z.infer<typeof PageBlockDefinitionPropertyType>;\nexport type PageBlockDefinitionRichTextPropertyStyle = z.infer<typeof PageBlockDefinitionRichTextPropertyStyle>;\nexport type PageBlockDefinitionMultiRichTextPropertyStyle = z.infer<\n typeof PageBlockDefinitionMultiRichTextPropertyStyle\n>;\nexport type PageBlockDefinitionTextPropertyStyle = z.infer<typeof PageBlockDefinitionTextPropertyStyle>;\nexport type PageBlockDefinitionTextPropertyColor = z.infer<typeof PageBlockDefinitionTextPropertyColor>;\nexport type PageBlockDefinitionBooleanPropertyStyle = z.infer<typeof PageBlockDefinitionBooleanPropertyStyle>;\nexport type PageBlockDefinitionSingleSelectPropertyStyle = z.infer<typeof PageBlockDefinitionSingleSelectPropertyStyle>;\nexport type PageBlockDefinitionMultiSelectPropertyStyle = z.infer<typeof PageBlockDefinitionMultiSelectPropertyStyle>;\nexport type PageBlockDefinitionImageAspectRatio = z.infer<typeof PageBlockDefinitionImageAspectRatio>;\nexport type PageBlockDefinitionImageWidth = z.infer<typeof PageBlockDefinitionImageWidth>;\n\n//\n// Aux\n//\n\nexport const PageBlockDefinitionSelectChoice = z.object({\n value: z.string(),\n name: z.string(),\n icon: IconSet.optional(),\n customIconUrl: z.string().optional(),\n color: PageBlockDefinitionSingleSelectPropertyColor.optional(),\n});\n\nexport type PageBlockDefinitionSelectChoice = z.infer<typeof PageBlockDefinitionSelectChoice>;\n\n//\n// Property options\n//\n\nexport const PageBlockDefinitionUntypedPropertyOptions = z.record(z.any());\n\nexport const PageBlockDefinitionRichTextOptions = z.object({\n richTextStyle: PageBlockDefinitionRichTextPropertyStyle.optional(),\n});\n\nexport const PageBlockDefinitionMutiRichTextOptions = z.object({\n multiRichTextStyle: PageBlockDefinitionMultiRichTextPropertyStyle.optional(),\n});\n\nexport const PageBlockDefinitionRichTextEditorOptions = z.object({\n placeholder: z.string().optional(),\n allowedInlineStyles: z.array(PageBlockDefinitionRichTextEditorPropertyStyle).optional(),\n});\n\nexport const PageBlockDefinitionTextOptions = z.object({\n placeholder: z.string().optional(),\n defaultValue: z.string().optional(),\n textStyle: PageBlockDefinitionTextPropertyStyle.optional(),\n color: PageBlockDefinitionTextPropertyColor.optional(),\n allowLineBreaks: z.boolean().optional(),\n});\n\nexport const PageBlockDefinitionSelectOptions = z.object({\n singleSelectStyle: PageBlockDefinitionSingleSelectPropertyStyle.optional(),\n defaultChoice: z.string(),\n choices: z.array(PageBlockDefinitionSelectChoice),\n});\n\nexport const PageBlockDefinitionImageOptions = z.object({\n width: PageBlockDefinitionImageWidth.optional(),\n aspectRatio: PageBlockDefinitionImageAspectRatio.optional(),\n allowCaption: z.boolean().optional(),\n recommendation: z.string().optional(),\n});\n\nexport const PageBlockDefinitionBooleanOptions = z.object({\n defaultvalue: z.boolean().optional(),\n booleanStyle: PageBlockDefinitionBooleanPropertyStyle.optional(),\n});\n\nexport const PageBlockDefinitionNumberOptions = z.object({\n defaultValue: z.number(),\n min: z.number().optional(),\n max: z.number().optional(),\n step: z.number().optional(),\n placeholder: z.string().optional(),\n});\n\nexport const PageBlockDefinitionComponentOptions = z.object({\n renderLayoutAs: z.enum([\"List\", \"Table\"]).optional(),\n allowPropertySelection: z.boolean().optional(),\n});\n\nexport const PageBlockDefinitionFigmaComponentOptions = z.object({\n renderLayoutAs: z.enum([\"Grid\", \"PropsTable\", \"Canvas\", \"Playground\"]),\n invertPropertySelection: z.boolean().optional(),\n});\n\nexport type PageBlockDefinitionUntypedPropertyOptions = z.infer<typeof PageBlockDefinitionUntypedPropertyOptions>;\nexport type PageBlockDefinitionRichTextOptions = z.infer<typeof PageBlockDefinitionRichTextOptions>;\nexport type PageBlockDefinitionMutiRichTextOptions = z.infer<typeof PageBlockDefinitionMutiRichTextOptions>;\nexport type PageBlockDefinitionRichTextEditorOptions = z.infer<typeof PageBlockDefinitionRichTextEditorOptions>;\nexport type PageBlockDefinitionTextOptions = z.infer<typeof PageBlockDefinitionTextOptions>;\nexport type PageBlockDefinitionSelectOptions = z.infer<typeof PageBlockDefinitionSelectOptions>;\nexport type PageBlockDefinitionImageOptions = z.infer<typeof PageBlockDefinitionImageOptions>;\nexport type PageBlockDefinitionBooleanOptions = z.infer<typeof PageBlockDefinitionBooleanOptions>;\nexport type PageBlockDefinitionNumberOptions = z.infer<typeof PageBlockDefinitionNumberOptions>;\nexport type PageBlockDefinitionComponentOptions = z.infer<typeof PageBlockDefinitionComponentOptions>;\nexport type PageBlockDefinitionFigmaComponentOptions = z.infer<typeof PageBlockDefinitionFigmaComponentOptions>;\n\n//\n// Definitions\n//\n\nexport const PageBlockDefinitionProperty = z.object({\n id: z.string(),\n name: z.string(),\n type: PageBlockDefinitionPropertyType,\n description: z.string().optional(),\n options: PageBlockDefinitionUntypedPropertyOptions.optional(),\n variantOptions: z.record(PageBlockDefinitionUntypedPropertyOptions).optional(),\n});\n\nexport const PageBlockDefinitionItem = z.object({\n properties: z.array(PageBlockDefinitionProperty),\n appearance: PageBlockDefinitionAppearance.optional(),\n variants: z.array(PageBlockDefinitionVariant),\n defaultVariantKey: z.string(),\n});\n\nexport type PageBlockDefinitionProperty = z.infer<typeof PageBlockDefinitionProperty>;\nexport type PageBlockDefinitionItem = z.infer<typeof PageBlockDefinitionItem>;\n","import { z } from \"zod\";\n\nexport const PageBlockDefinitionAppearance = z.object({\n isBordered: z.boolean().optional(),\n hasBackground: z.boolean().optional(),\n isEditorPresentationDifferent: z.boolean().optional(),\n showBlockHeaderInEditor: z.boolean().optional(),\n});\n\nexport type PageBlockDefinitionAppearance = z.infer<typeof PageBlockDefinitionAppearance>;\n","import { ZodTypeDef, z } from \"zod\";\nimport { PageBlockDefinitionAppearance } from \"./aux\";\n\n//\n// Enums\n//\n\nexport const PageBlockDefinitionLayoutType = z.enum([\"Column\", \"Row\"]);\nexport const PageBlockDefinitionLayoutGap = z.enum([\"Small\", \"Medium\", \"Large\", \"None\"]);\nexport const PageBlockDefinitionLayoutAlign = z.enum([\"Start\", \"Center\", \"End\"]);\nexport const PageBlockDefinitionLayoutResizing = z.enum([\"Fill\", \"Hug\"]);\n\nexport type PageBlockDefinitionLayoutType = z.infer<typeof PageBlockDefinitionLayoutType>;\nexport type PageBlockDefinitionLayoutGap = z.infer<typeof PageBlockDefinitionLayoutGap>;\nexport type PageBlockDefinitionLayoutAlign = z.infer<typeof PageBlockDefinitionLayoutAlign>;\nexport type PageBlockDefinitionLayoutResizing = z.infer<typeof PageBlockDefinitionLayoutResizing>;\n\n//\n// Definitions\n//\n\nexport const PageBlockDefinitionLayoutBase = z.object({\n type: PageBlockDefinitionLayoutType,\n gap: PageBlockDefinitionLayoutGap.optional(),\n columnAlign: PageBlockDefinitionLayoutAlign.optional(),\n columnResizing: PageBlockDefinitionLayoutResizing.optional(),\n});\n\nexport const PageBlockDefinitionLayout: z.ZodType<PageBlockDefinitionLayout, ZodTypeDef, PageBlockDefinitionLayout> =\n PageBlockDefinitionLayoutBase.extend({\n children: z.lazy(() => z.array(PageBlockDefinitionLayout.or(z.string()))),\n });\n\nexport const PageBlockDefinitionVariant = z.object({\n id: z.string(),\n name: z.string(),\n image: z.string().optional(),\n description: z.string().optional(),\n documentationLink: z.string().optional(),\n layout: PageBlockDefinitionLayout,\n maxColumns: z.number().optional(),\n defaultColumns: z.number().optional(),\n appearance: PageBlockDefinitionAppearance.optional(),\n});\n\nexport type PageBlockDefinitionVariant = z.infer<typeof PageBlockDefinitionVariant>;\nexport type PageBlockDefinitionLayout = z.infer<typeof PageBlockDefinitionLayoutBase> & {\n children: (PageBlockDefinitionLayout | string)[];\n};\n","import { z } from \"zod\";\nimport { DocumentationItemConfigurationV1 } from \"./documentation-v1\";\nimport { PageBlockV1 } from \"./documentation-block-v1\";\nimport { nullishToOptional } from \"../../../helpers\";\n\nexport const DocumentationPageDataV1 = z.object({\n blocks: z.array(PageBlockV1),\n configuration: nullishToOptional(DocumentationItemConfigurationV1),\n});\n","import { z } from \"zod\";\nimport { DocumentationItemHeaderV1, defaultDocumentationItemHeaderV1 } from \"./item-header-v1\";\n\nexport const DocumentationItemConfigurationV1 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean().optional(),\n isHidden: z.boolean().optional(),\n header: DocumentationItemHeaderV1,\n});\n\nexport type DocumentationItemConfigurationV1 = z.infer<typeof DocumentationItemConfigurationV1>;\n\nexport const defaultDocumentationItemConfigurationV1: DocumentationItemConfigurationV1 = {\n header: defaultDocumentationItemHeaderV1,\n showSidebar: true,\n};\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport {\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderAlignmentSchema,\n DocumentationItemHeaderImageScaleType,\n DocumentationItemHeaderImageScaleTypeSchema,\n} from \"./item-header\";\nimport { PageBlockAsset } from \"./documentation-block-v1\";\n\n//\n// Definitions\n//\n\nexport const DocumentationItemHeaderV1 = z.object({\n description: z.string(),\n alignment: DocumentationItemHeaderAlignmentSchema,\n foregroundColor: ColorTokenData.nullish(),\n backgroundColor: ColorTokenData.nullish(),\n backgroundImageAsset: PageBlockAsset.nullish(),\n backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,\n showBackgroundOverlay: z.boolean(),\n showCoverText: z.boolean(),\n minHeight: z.number().nullish(),\n});\n\nexport type DocumentationItemHeaderV1 = z.infer<typeof DocumentationItemHeaderV1>;\n\nexport const defaultDocumentationItemHeaderV1: DocumentationItemHeaderV1 = {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n};\n","//\n// Enums\n//\n\nimport { z } from \"zod\";\n\nexport const DocumentationItemHeaderAlignmentSchema = z.enum([\"Left\", \"Center\"]);\nexport const DocumentationItemHeaderImageScaleTypeSchema = z.enum([\"AspectFill\", \"AspectFit\"]);\n\nexport const DocumentationItemHeaderAlignment = DocumentationItemHeaderAlignmentSchema.enum;\nexport const DocumentationItemHeaderImageScaleType = DocumentationItemHeaderImageScaleTypeSchema.enum;\n\nexport type DocumentationItemHeaderImageScaleType = z.infer<typeof DocumentationItemHeaderImageScaleTypeSchema>;\nexport type DocumentationItemHeaderAlignment = z.infer<typeof DocumentationItemHeaderAlignmentSchema>;\n","import { z } from \"zod\";\nimport { DocumentationItemConfigurationV2 } from \"./documentation-v2\";\nimport { nullishToOptional } from \"../../../helpers\";\n\nexport const DocumentationPageDataV2 = z.object({\n configuration: nullishToOptional(DocumentationItemConfigurationV2),\n});\n","import { z } from \"zod\";\nimport { DocumentationItemHeaderV2, defaultDocumentationItemHeaderV2 } from \"./item-header-v2\";\n\nexport const DocumentationItemConfigurationV2 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean().optional(),\n isHidden: z.boolean().optional(),\n header: DocumentationItemHeaderV2,\n});\n\nexport type DocumentationItemConfigurationV2 = z.infer<typeof DocumentationItemConfigurationV2>;\n\nexport const defaultDocumentationItemConfigurationV2 = {\n header: defaultDocumentationItemHeaderV2,\n isHidden: false,\n isPrivate: false,\n showSidebar: true,\n} as const;\n","import { z } from \"zod\";\nimport {\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderAlignmentSchema,\n DocumentationItemHeaderImageScaleType,\n DocumentationItemHeaderImageScaleTypeSchema,\n} from \"./item-header\";\nimport { PageBlockColorV2, PageBlockImageReference } from \"./documentation-block-v2\";\n\n//\n// Definitions\n//\n\nexport const DocumentationItemHeaderV2 = z.object({\n description: z.string(),\n alignment: DocumentationItemHeaderAlignmentSchema,\n foregroundColor: PageBlockColorV2.nullish(),\n backgroundColor: PageBlockColorV2.nullish(),\n backgroundImageAsset: PageBlockImageReference.nullish(),\n backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,\n showBackgroundOverlay: z.boolean(),\n showCoverText: z.boolean(),\n minHeight: z.number().nullish(),\n});\n\nexport type DocumentationItemHeaderV2 = z.infer<typeof DocumentationItemHeaderV2>;\n\nexport const defaultDocumentationItemHeaderV2: DocumentationItemHeaderV2 = {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n};\n","import { z } from \"zod\";\nimport { PageBlockEditorModelV2 } from \"../page-block-v2\";\nimport { PageBlockColorV2 } from \"./documentation-block-v2\";\n\nexport const PageSectionTypeV2 = z.enum([\"Tabs\"]);\n\nexport const PageSectionColumnV2 = z.object({\n id: z.string(),\n blocks: z.array(PageBlockEditorModelV2),\n});\n\nexport const PageSectionItemV2 = z.object({\n id: z.string(),\n title: z.string(),\n columns: z.array(PageSectionColumnV2),\n});\n\nexport const PageSectionPaddingV2 = z.object({\n top: z.number().optional(),\n bottom: z.number().optional(),\n left: z.number().optional(),\n right: z.number().optional(),\n});\n\nexport const PageSectionAppearanceV2 = z.object({\n expandToEdges: z.boolean(),\n contentExpandToEdges: z.boolean(),\n backgroundColor: PageBlockColorV2.optional(),\n foregroundColor: PageBlockColorV2.optional(),\n padding: PageSectionPaddingV2.optional(),\n});\n\nexport const PageSectionEditorModelV2 = z.object({\n id: z.string(),\n type: z.literal(\"Section\"),\n variantId: z.string().optional(),\n sectionType: PageSectionTypeV2,\n appearance: PageSectionAppearanceV2,\n items: z.array(PageSectionItemV2),\n});\n\nexport type PageSectionTypeV2 = z.infer<typeof PageSectionTypeV2>;\nexport type PageSectionColumnV2 = z.infer<typeof PageSectionColumnV2>;\nexport type PageSectionItemV2 = z.infer<typeof PageSectionItemV2>;\nexport type PageSectionPaddingV2 = z.infer<typeof PageSectionPaddingV2>;\nexport type PageSectionAppearanceV2 = z.infer<typeof PageSectionAppearanceV2>;\nexport type PageSectionEditorModelV2 = z.infer<typeof PageSectionEditorModelV2>;\n","import { z } from \"zod\";\nimport { DesignElementBase, DesignElementGroupableRequiredPart } from \"./base\";\nimport { PageBlockDataV2 } from \"./data\";\n\n//\n// Element\n//\n\nexport const PageBlockV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend({\n data: PageBlockDataV2,\n});\n\nexport type PageBlockV2 = z.infer<typeof PageBlockV2>;\n\n//\n// Editor Model\n//\n\nexport const PageBlockEditorModelV2 = z.object({\n id: z.string(),\n type: z.literal(\"Block\"),\n data: PageBlockDataV2,\n});\n\nexport type PageBlockEditorModelV2 = z.infer<typeof PageBlockEditorModelV2>;\n","import { z } from \"zod\";\nimport { ObjectMeta } from \"../../common\";\n\nexport const DesignElementOrigin = z.object({\n id: z.string(),\n sourceId: z.string(),\n name: z.string(),\n});\n\nexport const DesignElementBase = z.object({\n id: z.string(),\n persistentId: z.string(),\n meta: ObjectMeta,\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DesignElementImportedBase = DesignElementBase.extend({\n origin: DesignElementOrigin,\n});\n\nexport const DesignElementGroupablePart = z.object({\n parentPersistentId: z.string().optional(),\n sortOrder: z.number(),\n});\n\nexport const DesignElementGroupableBase = DesignElementBase.extend(DesignElementGroupablePart.shape);\n\nexport const DesignElementGroupableRequiredPart = DesignElementGroupablePart.extend({\n parentPersistentId: z.string(),\n});\n\nexport const DesignElementBrandedPart = z.object({\n brandPersistentId: z.string(),\n});\n\nexport const DesignElementSlugPart = z.object({\n slug: z.string().optional(),\n userSlug: z.string().optional(),\n});\n\nexport type DesignElementOrigin = z.infer<typeof DesignElementOrigin>;\nexport type DesignElementBase = z.infer<typeof DesignElementBase>;\nexport type DesignElementGroupablePart = z.infer<typeof DesignElementGroupablePart>;\nexport type DesignElementGroupableBase = z.infer<typeof DesignElementGroupableBase>;\nexport type DesignElementGroupableRequiredPart = z.infer<typeof DesignElementGroupableRequiredPart>;\nexport type DesignElementBrandedPart = z.infer<typeof DesignElementBrandedPart>;\nexport type DesignElementSlugPart = z.infer<typeof DesignElementSlugPart>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const DurationUnit = z.enum([\"Ms\"]);\n\nexport const DurationValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const DurationTokenData = tokenAliasOrValue(DurationValue);\n\nexport type DurationUnit = z.infer<typeof DurationUnit>;\nexport type DurationValue = z.infer<typeof DurationValue>;\nexport type DurationTokenData = z.infer<typeof DurationTokenData>;\n","import { ZodTypeDef, z } from \"zod\";\nimport { Size, SizeOrUndefined } from \"../primitives/size\";\n\nexport const FigmaFileStructureNodeType = z.enum([\"DOCUMENT\", \"CANVAS\", \"FRAME\", \"COMPONENT\", \"COMPONENT_SET\"]);\n\nexport const FigmaFileStructureNodeBase = z.object({\n id: z.string(),\n name: z.string(),\n type: FigmaFileStructureNodeType,\n size: SizeOrUndefined,\n parentComponentSetId: z.string().optional(),\n});\n\nexport const FigmaFileStructureNode: z.ZodType<FigmaFileStructureNode, ZodTypeDef, FigmaFileStructureNodeBaseInput> =\n FigmaFileStructureNodeBase.extend({\n children: z.lazy(() => FigmaFileStructureNode.array()),\n });\n\ntype FigmaFileStructureNodeBaseInput = z.input<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNodeBaseInput[];\n};\n\nexport const FigmaFileStructureStatistics = z.object({\n frames: z\n .number()\n .nullable()\n .optional()\n .transform(v => v ?? 0),\n components: z\n .number()\n .nullable()\n .optional()\n .transform(v => v ?? 0),\n componentSets: z\n .number()\n .nullable()\n .optional()\n .transform(v => v ?? 0),\n});\n\nexport const FigmaFileStructureElementData = z.object({\n value: z.object({\n structure: FigmaFileStructureNode,\n assetsInFile: FigmaFileStructureStatistics,\n }),\n});\n\nexport type FigmaFileStructureNodeBase = z.infer<typeof FigmaFileStructureNodeBase>;\nexport type FigmaFileStructureNodeType = z.infer<typeof FigmaFileStructureStatistics>;\nexport type FigmaFileStructureNode = z.infer<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNode[];\n};\nexport type FigmaFileStructureStatistics = z.infer<typeof FigmaFileStructureStatistics>;\nexport type FigmaFileStructureElementData = z.infer<typeof FigmaFileStructureElementData>;\n\nexport function figmaFileStructureToMap(root: FigmaFileStructureNode): Map<string, FigmaFileStructureNode> {\n const map = new Map<string, FigmaFileStructureNode>();\n recursiveFigmaFileStructureToMap(root, map);\n return map;\n}\n\nfunction recursiveFigmaFileStructureToMap(node: FigmaFileStructureNode, map: Map<string, FigmaFileStructureNode>) {\n map.set(node.id, node);\n for (const child of node.children) recursiveFigmaFileStructureToMap(child, map);\n}\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers/nullish-to-optional\";\n\n//\n// Enums\n//\n\nexport const FigmaNodeRenderState = z.enum([\"InProgress\", \"Success\", \"Failed\"]);\nexport const FigmaNodeRenderFormat = z.enum([\"Png\", \"Svg\"]);\nexport const FigmaNodeRenderErrorType = z.enum([\"MissingIntegration\", \"NodeNotFound\", \"RenderError\"]);\n\nexport type FigmaNodeRenderState = z.infer<typeof FigmaNodeRenderState>;\nexport type FigmaNodeRenderFormat = z.infer<typeof FigmaNodeRenderFormat>;\nexport type FigmaNodeRenderErrorType = z.infer<typeof FigmaNodeRenderErrorType>;\n\n//\n// Definition\n//\n\nexport const FigmaNodeRelinkData = z.object({\n fileId: z.string(),\n});\n\nexport const FigmaNodeRenderedImage = z.object({\n resourceId: z.string(),\n format: FigmaNodeRenderFormat,\n scale: nullishToOptional(z.number()),\n\n width: nullishToOptional(z.number()),\n height: nullishToOptional(z.number()),\n url: nullishToOptional(z.string()),\n originKey: nullishToOptional(z.string()),\n});\n\nexport const FigmaNodeRenderError = z.object({\n type: FigmaNodeRenderErrorType,\n});\n\nexport const FigmaNodeReferenceData = z.object({\n sceneNodeId: z.string(),\n format: FigmaNodeRenderFormat,\n scale: nullishToOptional(z.number()),\n\n renderState: FigmaNodeRenderState,\n renderedImage: FigmaNodeRenderedImage.optional(),\n renderError: FigmaNodeRenderError.optional(),\n\n hasSource: z.boolean(),\n relinkData: FigmaNodeRelinkData.optional(),\n});\n\nexport type FigmaNodeRelinkData = z.infer<typeof FigmaNodeRelinkData>;\nexport type FigmaNodeRenderedImage = z.infer<typeof FigmaNodeRenderedImage>;\nexport type FigmaNodeRenderError = z.infer<typeof FigmaNodeRenderError>;\nexport type FigmaNodeReferenceData = z.infer<typeof FigmaNodeReferenceData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const FontFamilyValue = z.string();\nexport const FontFamilyTokenData = tokenAliasOrValue(FontFamilyValue);\n\nexport type FontFamilyValue = z.infer<typeof FontFamilyValue>;\nexport type FontFamilyTokenData = z.infer<typeof FontFamilyTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const FontSizeUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const FontSizeValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const FontSizeTokenData = tokenAliasOrValue(FontSizeValue);\n\nexport type FontSizeUnit = z.infer<typeof FontSizeUnit>;\nexport type FontSizeValue = z.infer<typeof FontSizeValue>;\nexport type FontSizeTokenData = z.infer<typeof FontSizeTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const FontWeightValue = z.string();\nexport const FontWeightTokenData = tokenAliasOrValue(FontWeightValue);\n\nexport type FontWeightValue = z.infer<typeof FontWeightValue>;\nexport type FontWeightTokenData = z.infer<typeof FontWeightTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const FontValue = z.unknown();\n\nexport const FontTokenData = tokenAliasOrValue(FontValue);\n\nexport type FontValue = z.infer<typeof FontValue>;\nexport type FontTokenData = z.infer<typeof FontTokenData>;\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { nullishToOptional } from \"../../../helpers\";\nimport { Point2D } from \"../primitives\";\n\nexport const GradientType = z.enum([\"Linear\", \"Radial\", \"Angular\"]);\n\nexport const GradientStop = z.object({\n position: z.number(),\n color: ColorTokenData,\n});\n\nexport const GradientLayerValue = z.object({\n from: Point2D,\n to: Point2D,\n type: GradientType,\n aspectRatio: nullishToOptional(z.number()), // z.number(),\n stops: z.array(GradientStop).min(2),\n});\n\nexport const GradientLayerData = tokenAliasOrValue(GradientLayerValue);\n\nexport const GradientTokenValue = z.array(GradientLayerData);\nexport const GradientTokenData = tokenAliasOrValue(GradientTokenValue);\n\nexport type GradientType = z.infer<typeof GradientType>;\nexport type GradientStop = z.infer<typeof GradientStop>;\nexport type GradientLayerValue = z.infer<typeof GradientLayerValue>;\nexport type GradientLayerData = z.infer<typeof GradientLayerData>;\nexport type GradientTokenValue = z.infer<typeof GradientTokenValue>;\nexport type GradientTokenData = z.infer<typeof GradientTokenData>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers\";\nimport { DocumentationItemConfigurationV1 } from \"./documentation-v1\";\nimport { DocumentationItemConfigurationV2 } from \"./documentation-v2\";\n\nexport const DocumentationGroupBehavior = z.enum([\"Group\", \"Tabs\"]);\n\nexport const ElementGroupDataV1 = z.object({\n behavior: nullishToOptional(DocumentationGroupBehavior.optional()),\n configuration: nullishToOptional(DocumentationItemConfigurationV1),\n});\n\nexport const ElementGroupDataV2 = z.object({\n behavior: nullishToOptional(DocumentationGroupBehavior.optional()),\n configuration: nullishToOptional(DocumentationItemConfigurationV2),\n});\n\nexport type DocumentationGroupBehavior = z.infer<typeof DocumentationGroupBehavior>;\nexport type ElementGroupDataV1 = z.infer<typeof ElementGroupDataV1>;\nexport type ElementGroupDataV2 = z.infer<typeof ElementGroupDataV2>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const LetterSpacingUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const LetterSpacingValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const LetterSpacingTokenData = tokenAliasOrValue(LetterSpacingValue);\n\nexport type LetterSpacingUnit = z.infer<typeof LetterSpacingUnit>;\nexport type LetterSpacingValue = z.infer<typeof LetterSpacingValue>;\nexport type LetterSpacingTokenData = z.infer<typeof LetterSpacingTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const LineHeightUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\", \"Raw\"]);\n\nexport const LineHeightValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const LineHeightTokenData = tokenAliasOrValue(LineHeightValue);\n\nexport type LineHeightUnit = z.infer<typeof LineHeightUnit>;\nexport type LineHeightValue = z.infer<typeof LineHeightValue>;\nexport type LineHeightTokenData = z.infer<typeof LineHeightTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const ParagraphIndentUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const ParagraphIndentValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const ParagraphIndentTokenData = tokenAliasOrValue(ParagraphIndentValue);\n\nexport type ParagraphIndentUnit = z.infer<typeof ParagraphIndentUnit>;\nexport type ParagraphIndentValue = z.infer<typeof ParagraphIndentValue>;\nexport type ParagraphIndentTokenData = z.infer<typeof ParagraphIndentTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const ParagraphSpacingUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const ParagraphSpacingValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const ParagraphSpacingTokenData = tokenAliasOrValue(ParagraphSpacingValue);\n\nexport type ParagraphSpacingUnit = z.infer<typeof ParagraphSpacingUnit>;\nexport type ParagraphSpacingValue = z.infer<typeof ParagraphSpacingValue>;\nexport type ParagraphSpacingTokenData = z.infer<typeof ParagraphSpacingTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const ProductCopyValue = z.string();\nexport const ProductCopyTokenData = tokenAliasOrValue(ProductCopyValue);\n\nexport type ProductCopyValue = z.infer<typeof ProductCopyValue>;\nexport type ProductCopyTokenData = z.infer<typeof ProductCopyTokenData>;\n","import { z } from \"zod\";\n\nconst RESERVED_OBJECT_ID_PREFIX = \"x-sn-reserved-\";\n\n// Really only checks if the schema does not have the reserved prefix\nexport const SafeIdSchema = z.string().refine(\n value => {\n return !value.startsWith(RESERVED_OBJECT_ID_PREFIX);\n },\n {\n message: `ID value can't start with ${RESERVED_OBJECT_ID_PREFIX}`,\n }\n);\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport { OpacityTokenData } from \"./opacity\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const ShadowType = z.enum([\"Drop\", \"Inner\"]);\n\nexport const ShadowLayerValue = z.object({\n color: ColorTokenData,\n x: z.number(),\n y: z.number(),\n radius: z.number(),\n spread: z.number(),\n opacity: OpacityTokenData.optional(),\n type: ShadowType,\n});\n\nconst ShadowTokenDataBase = tokenAliasOrValue(ShadowLayerValue);\nexport const ShadowValue = z.array(ShadowTokenDataBase);\nexport const ShadowTokenData = tokenAliasOrValue(z.array(ShadowTokenDataBase));\n\nexport type ShadowType = z.infer<typeof ShadowType>;\nexport type ShadowLayerValue = z.infer<typeof ShadowLayerValue>;\nexport type ShadowValue = z.infer<typeof ShadowValue>;\nexport type ShadowTokenData = z.infer<typeof ShadowTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const SizeUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const SizeValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const SizeTokenData = tokenAliasOrValue(SizeValue);\n\nexport type SizeUnit = z.infer<typeof SizeUnit>;\nexport type SizeValue = z.infer<typeof SizeValue>;\nexport type SizeTokenData = z.infer<typeof SizeTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const SpaceUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const SpaceValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const SpaceTokenData = tokenAliasOrValue(SpaceValue);\n\nexport type SpaceUnit = z.infer<typeof SpaceUnit>;\nexport type SpaceValue = z.infer<typeof SpaceValue>;\nexport type SpaceTokenData = z.infer<typeof SpaceTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const StringValue = z.string();\nexport const StringTokenData = tokenAliasOrValue(StringValue);\n\nexport type StringValue = z.infer<typeof StringValue>;\nexport type StringTokenData = z.infer<typeof StringTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const TextCase = z.enum([\"Original\", \"Upper\", \"Lower\", \"Camel\", \"SmallCaps\"]);\nexport const TextCaseValue = TextCase;\nexport const TextCaseTokenData = tokenAliasOrValue(TextCaseValue);\n\nexport type TextCase = z.infer<typeof TextCase>;\nexport type TextCaseValue = z.infer<typeof TextCaseValue>;\nexport type TextCaseTokenData = z.infer<typeof TextCaseTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const TextDecoration = z.enum([\"None\", \"Underline\", \"Strikethrough\"]);\nexport const TextDecorationValue = TextDecoration;\nexport const TextDecorationTokenData = tokenAliasOrValue(TextDecorationValue);\n\nexport type TextDecoration = z.infer<typeof TextDecoration>;\nexport type TextDecorationValue = z.infer<typeof TextDecorationValue>;\nexport type TextDecorationTokenData = z.infer<typeof TextDecorationTokenData>;\n","import { z } from \"zod\";\nimport { FontSizeTokenData } from \"./font-size\";\nimport { FontFamilyTokenData } from \"./font-family\";\nimport { FontWeightTokenData } from \"./font-weight\";\nimport { TextDecorationTokenData } from \"./text-decoration\";\nimport { TextCaseTokenData } from \"./text-case\";\nimport { LetterSpacingTokenData } from \"./letter-spacing\";\nimport { LineHeightTokenData } from \"./line-height\";\nimport { ParagraphIndentTokenData } from \"./paragraph-indent\";\nimport { ParagraphSpacingTokenData } from \"./paragraph-spacing\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const TypographyValue = z.object({\n fontSize: FontSizeTokenData,\n fontFamily: FontFamilyTokenData,\n fontWeight: FontWeightTokenData,\n textDecoration: TextDecorationTokenData,\n textCase: TextCaseTokenData,\n letterSpacing: LetterSpacingTokenData.optional(),\n lineHeight: LineHeightTokenData.optional(),\n paragraphIndent: ParagraphIndentTokenData.optional(),\n paragraphSpacing: ParagraphSpacingTokenData.optional(),\n});\n\nexport const TypographyTokenData = tokenAliasOrValue(TypographyValue);\n\nexport type TypographyValue = z.infer<typeof TypographyValue>;\nexport type TypographyTokenData = z.infer<typeof TypographyTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const Visibility = z.enum([\"Hidden\", \"Visible\"]);\nexport const VisibilityValue = Visibility;\nexport const VisibilityTokenData = tokenAliasOrValue(VisibilityValue);\n\nexport type Visibility = z.infer<typeof Visibility>;\nexport type VisibilityValue = z.infer<typeof VisibilityValue>;\nexport type VisibilityTokenData = z.infer<typeof VisibilityTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const ZIndexUnit = z.enum([\"Raw\"]);\n\nexport const ZIndexValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const ZIndexTokenData = tokenAliasOrValue(ZIndexValue);\n\nexport type ZIndexUnit = z.infer<typeof ZIndexUnit>;\nexport type ZIndexValue = z.infer<typeof ZIndexValue>;\nexport type ZIndexTokenData = z.infer<typeof ZIndexTokenData>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementGroupableRequiredPart, DesignElementSlugPart } from \"./base\";\nimport { DocumentationPageDataV1, ElementGroupDataV1 } from \"./data\";\nimport { ElementGroup } from \"./group\";\n\n//\n// Documentation page\n//\n\nexport const DocumentationPageV1 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementSlugPart.shape)\n .extend({\n shortPersistentId: z.string(),\n data: DocumentationPageDataV1,\n });\n\nexport type DocumentationPageV1 = z.infer<typeof DocumentationPageV1>;\n\nexport type CreateDocumentationPageV1 = DbCreateInputOmit<DocumentationPageV1>;\nexport type UpdateDocumentationPageV1 = OmitStrict<DbUpdate<DocumentationPageV1>, \"designSystemVersionId\">;\n\n//\n// Documentation group (legacy)\n//\n\nexport const DocumentationGroupV1 = ElementGroup.omit({\n data: true,\n}).extend({\n data: ElementGroupDataV1.optional(),\n});\n\nexport type DocumentationGroupV1 = z.infer<typeof DocumentationGroupV1>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementBrandedPart, DesignElementGroupablePart, DesignElementSlugPart } from \"./base\";\nimport { ElementGroupDataV2 } from \"./data\";\nimport { DesignElementType } from \"./raw-element\";\n\nexport const ElementGroup = DesignElementBase.extend(DesignElementGroupablePart.shape)\n .extend(DesignElementSlugPart.shape)\n .extend(DesignElementBrandedPart.partial().shape)\n .extend({\n shortPersistentId: z.string().optional(),\n childType: DesignElementType,\n data: ElementGroupDataV2.optional(),\n });\n\nexport const BrandedElementGroup = ElementGroup.extend(DesignElementBrandedPart.shape);\n\nexport type ElementGroup = z.infer<typeof ElementGroup>;\nexport type BrandedElementGroup = z.infer<typeof BrandedElementGroup>;\n\nexport type CreateElementGroup = OmitStrict<DbCreateInputOmit<ElementGroup>, \"parentPersistentId\"> & {\n parentPersistentId: string;\n};\n\nexport type UpdateElementGroup = DbUpdate<\n OmitStrict<ElementGroup, \"brandPersistentId\" | \"childType\" | \"designSystemVersionId\" | \"parentPersistentId\"> & {\n parentPersistentId: string;\n }\n>;\n\nexport type RestoreElementGroup = OmitStrict<ElementGroup, \"parentPersistentId\"> & {\n parentPersistentId: string;\n};\n\nexport type ElementGroupsDiff = {\n toCreate: CreateElementGroup[];\n toUpdate: UpdateElementGroup[];\n toDelete: ElementGroup[\"id\"][];\n};\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementGroupableRequiredPart, DesignElementSlugPart } from \"./base\";\nimport { PageBlockV1 } from \"./data\";\nimport { DocumentationPageDataV2 } from \"./data/documentation-page-v2\";\n\nexport const DocumentationPageV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementSlugPart.shape)\n .extend({\n shortPersistentId: z.string(),\n data: DocumentationPageDataV2.extend({\n oldBlocks: z.array(PageBlockV1).optional(),\n }),\n });\n\nexport type DocumentationPageV2 = z.infer<typeof DocumentationPageV2>;\n\nexport type CreateDocumentationPageV2 = DbCreateInputOmit<DocumentationPageV2>;\nexport type UpdateDocumentationPageV2 = OmitStrict<DbUpdate<DocumentationPageV2>, \"designSystemVersionId\">;\nexport type RestoreDocumentationPage = CreateDocumentationPageV2 & { id: string; createdAt: Date; updatedAt: Date };\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport {\n DesignElementBase,\n DesignElementBrandedPart,\n DesignElementGroupableRequiredPart,\n DesignElementOrigin,\n} from \"./base\";\nimport { FigmaComponentPropertyMap } from \"./component-properties\";\n\n//\n// Figma Component\n//\n\nexport const FigmaComponentOriginPart = z.object({\n nodeId: z.string().optional(),\n width: z.number().optional(),\n height: z.number().optional(),\n});\n\nconst FigmaComponentAsset = z.object({\n assetId: z.string(),\n assetPath: z.string(),\n});\n\nexport const FigmaComponentOrigin = DesignElementOrigin.extend(FigmaComponentOriginPart.shape);\n\nexport const FigmaComponent = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementBrandedPart.shape)\n .extend({\n origin: FigmaComponentOrigin.optional(),\n thumbnail: FigmaComponentAsset,\n componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),\n variantPropertyValues: z.record(z.string()).optional(),\n\n svg: FigmaComponentAsset.optional(),\n isAsset: z.boolean(),\n parentComponentPersistentId: nullishToOptional(z.string()),\n renderNodeId: z.string().optional(),\n });\n\nexport type FigmaComponentAsset = z.infer<typeof FigmaComponentAsset>;\nexport type FigmaComponent = z.infer<typeof FigmaComponent>;\nexport type FigmaComponentOrigin = z.infer<typeof FigmaComponentOrigin>;\nexport type ImportedFigmaComponent = OmitStrict<FigmaComponent, \"origin\"> & { origin: FigmaComponentOrigin };\n\n//\n// Support types\n//\n\nexport type CreateFigmaComponent = DbCreateInputOmit<FigmaComponent>;\nexport type UpdateFigmaComponent = OmitStrict<DbUpdate<FigmaComponent>, \"brandPersistentId\" | \"designSystemVersionId\">;\n\nexport type FigmaComponentDiff = {\n toCreate: CreateFigmaComponent[];\n toUpdate: UpdateFigmaComponent[];\n toDelete: FigmaComponent[\"id\"][];\n};\n\n//\n// Utils\n//\n\nexport function isImportedFigmaComponent(component: FigmaComponent): component is ImportedFigmaComponent {\n return !!component.origin;\n}\n","import { z } from \"zod\";\nimport { DesignElementBase } from \"./base\";\nimport { FigmaFileStructureNode, FigmaFileStructureStatistics } from \"./data/figma-file-structure\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const FigmaFileStructureOrigin = z.object({\n sourceId: z.string(),\n fileId: z.string().optional(),\n});\n\nexport const FigmaFileStructureData = z.object({\n rootNode: FigmaFileStructureNode,\n assetsInFile: FigmaFileStructureStatistics,\n});\n\nexport const FigmaFileStructure = DesignElementBase.extend({\n origin: FigmaFileStructureOrigin,\n data: FigmaFileStructureData,\n});\n\nexport type FigmaFileStructureOrigin = z.infer<typeof FigmaFileStructureOrigin>;\nexport type FigmaFileStructureData = z.infer<typeof FigmaFileStructureData>;\nexport type FigmaFileStructure = z.infer<typeof FigmaFileStructure>;\n\nexport type CreateFigmaFileStructure = DbCreateInputOmit<FigmaFileStructure>;\nexport type UpdateFigmaFileStructure = OmitStrict<DbUpdate<FigmaFileStructure>, \"designSystemVersionId\">;\n\nexport type FigmaFileStructureDiff = {\n toCreate: CreateFigmaFileStructure[];\n toUpdate: UpdateFigmaFileStructure[];\n};\n\nexport function traverseStructure(node: FigmaFileStructureNode, action: (node: FigmaFileStructureNode) => void) {\n action(node);\n\n for (const child of node.children) {\n traverseStructure(child, action);\n }\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase } from \"./base\";\nimport { FigmaNodeReferenceData } from \"./data/figma-node-reference\";\n\nexport const FigmaNodeReferenceOrigin = z.object({\n sourceId: z.string(),\n parentName: z.string().optional(),\n});\n\nexport const FigmaNodeReference = DesignElementBase.extend({\n data: FigmaNodeReferenceData,\n origin: FigmaNodeReferenceOrigin,\n});\n\nexport type FigmaNodeReferenceOrigin = z.infer<typeof FigmaNodeReferenceOrigin>;\nexport type FigmaNodeReference = z.infer<typeof FigmaNodeReference>;\n\nexport type CreateFigmaNodeReference = DbCreateInputOmit<FigmaNodeReference>;\nexport type UpdateFigmaNodeReference = OmitStrict<DbUpdate<FigmaNodeReference>, \"designSystemVersionId\">;\n\nexport type FigmaNodeReferenceDiff = {\n toUpdate: UpdateFigmaNodeReference[];\n};\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementBrandedPart } from \"./base\";\nimport { DesignTokenType } from \"./raw-element\";\nimport { DesignTokenOrigin, DesignTokenOriginPart, DesignTokenTypedData } from \"./tokens\";\n\n//\n// Overrides\n//\n\nexport const ThemeOverrideOriginPart = DesignTokenOriginPart;\nexport const ThemeOverrideOrigin = DesignTokenOrigin;\n\nexport const ThemeOverride = DesignTokenTypedData.and(\n z.object({\n tokenPersistentId: z.string(),\n origin: ThemeOverrideOrigin.optional()\n .nullable()\n .transform(v => v ?? undefined),\n })\n);\n\nexport type ThemeOverride = z.infer<typeof ThemeOverride>;\nexport type ThemeOverrideOfType<T extends DesignTokenType> = Extract<ThemeOverride, { type: T }>;\n\n//\n// Theme data\n//\n\nexport const ThemeElementData = z.object({\n value: z.object({\n overrides: z.array(ThemeOverride),\n }),\n});\n\nexport type ThemeElementData = z.infer<typeof ThemeElementData>;\n\n//\n// Theme\n//\n\nexport const ThemeOriginPart = z.object({});\n\nexport const ThemeOriginObject = z.object({\n id: z.string(),\n name: z.string(),\n});\n\nexport const ThemeOriginSource = z.object({\n sourceId: z.string(),\n sourceObjects: z.array(ThemeOriginObject),\n});\n\nexport const ThemeOrigin = z.object({\n sources: z.array(ThemeOriginSource),\n});\n\nexport const Theme = DesignElementBase.extend(DesignElementBrandedPart.shape).extend({\n origin: ThemeOrigin.optional(),\n overrides: z.array(ThemeOverride),\n codeName: z.string(),\n});\n\nexport type Theme = z.infer<typeof Theme>;\nexport type ThemeOrigin = z.infer<typeof ThemeOrigin>;\nexport type ThemeOriginSource = z.infer<typeof ThemeOriginSource>;\nexport type ThemeOriginObject = z.infer<typeof ThemeOriginObject>;\n\nexport type CreateTheme = DbCreateInputOmit<Theme>;\nexport type UpdateTheme = OmitStrict<DbUpdate<Theme>, \"brandPersistentId\" | \"designSystemVersionId\">;\n\nexport type ThemeDiff = {\n toCreate: CreateTheme[];\n toUpdate: UpdateTheme[];\n};\n","import { z } from \"zod\";\nimport { DbUpdate, zodCreateInputOmit, zodUpdateInputOmit } from \"../../helpers\";\nimport { OmitStrict, SupernovaException } from \"../../utils\";\nimport {\n DesignElementBase,\n DesignElementBrandedPart,\n DesignElementGroupableRequiredPart,\n DesignElementOrigin,\n} from \"./base\";\nimport {\n BlurTokenData,\n BorderRadiusTokenData,\n BorderTokenData,\n BorderWidthTokenData,\n ColorTokenData,\n DimensionTokenData,\n DurationTokenData,\n FontFamilyTokenData,\n FontSizeTokenData,\n FontTokenData,\n FontWeightTokenData,\n GradientTokenData,\n LetterSpacingTokenData,\n LineHeightTokenData,\n OpacityTokenData,\n ParagraphSpacingTokenData,\n ProductCopyTokenData,\n ShadowTokenData,\n SizeTokenData,\n SpaceTokenData,\n StringTokenData,\n TextCaseTokenData,\n TextDecorationTokenData,\n TypographyTokenData,\n VisibilityTokenData,\n ZIndexTokenData,\n} from \"./data\";\nimport { areTokenTypesCompatible, castStringToDimensionValue, DesignTokenType } from \"./raw-element\";\n\n//\n// Base\n//\n\nexport const DesignTokenOriginPart = z.object({\n referenceOriginId: z.string().optional(),\n referenceOriginKey: z.string().optional(),\n referenceOriginName: z.string().optional(),\n referenceOriginRemote: z.boolean().optional(),\n referencePersistentId: z.string().optional(),\n referenceResolutionFailed: z.boolean().optional(),\n key: z.string().optional(),\n sortOrder: z.number().optional(),\n});\n\nexport const DesignTokenOrigin = DesignElementOrigin.extend(DesignTokenOriginPart.shape);\n\nconst DesignTokenBase = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementBrandedPart.shape)\n .extend({\n origin: DesignTokenOrigin.optional(),\n collectionPersistentId: z.string().optional(),\n });\n\nconst CreateDesignTokenBase = DesignTokenBase.omit(zodCreateInputOmit());\nconst UpdateDesignTokenBase = DesignTokenBase.omit({\n ...zodUpdateInputOmit(),\n brandPersistentId: true,\n designSystemVersionId: true,\n});\n\n//\n// Per type\n//\n\nconst BlurTokenTypedData = z.object({\n type: z.literal(\"Blur\"),\n data: BlurTokenData,\n});\n\nconst ColorTokenTypedData = z.object({\n type: z.literal(\"Color\"),\n data: ColorTokenData,\n});\n\nconst GradientTokenTypedData = z.object({\n type: z.literal(\"Gradient\"),\n data: GradientTokenData,\n});\n\nconst OpacityTokenTypedData = z.object({\n type: z.literal(\"Opacity\"),\n data: OpacityTokenData,\n});\n\nconst ShadowTokenTypedData = z.object({\n type: z.literal(\"Shadow\"),\n data: ShadowTokenData,\n});\n\nconst TypographyTokenTypedData = z.object({\n type: z.literal(\"Typography\"),\n data: TypographyTokenData,\n});\n\nconst StringTokenTypedData = z.object({\n type: z.literal(\"String\"),\n data: StringTokenData,\n});\n\nconst DimensionTokenTypedData = z.object({\n type: z.literal(\"Dimension\"),\n data: DimensionTokenData,\n});\n\nconst FontSizeTokenTypedData = z.object({\n type: z.literal(\"FontSize\"),\n data: FontSizeTokenData,\n});\n\nconst FontFamilyTokenTypedData = z.object({\n type: z.literal(\"FontFamily\"),\n data: FontFamilyTokenData,\n});\n\nconst FontWeightTokenTypedData = z.object({\n type: z.literal(\"FontWeight\"),\n data: FontWeightTokenData,\n});\n\nconst LetterSpacingTokenTypedData = z.object({\n type: z.literal(\"LetterSpacing\"),\n data: LetterSpacingTokenData,\n});\n\nconst LineHeightTokenTypedData = z.object({\n type: z.literal(\"LineHeight\"),\n data: LineHeightTokenData,\n});\n\nconst ParagraphSpacingTokenTypedData = z.object({\n type: z.literal(\"ParagraphSpacing\"),\n data: ParagraphSpacingTokenData,\n});\n\nconst TextCaseTokenTypedData = z.object({\n type: z.literal(\"TextCase\"),\n data: TextCaseTokenData,\n});\n\nconst TextDecorationTokenTypedData = z.object({\n type: z.literal(\"TextDecoration\"),\n data: TextDecorationTokenData,\n});\n\nconst BorderRadiusTokenTypedData = z.object({\n type: z.literal(\"BorderRadius\"),\n data: BorderRadiusTokenData,\n});\n\nconst BorderWidthTokenTypedData = z.object({\n type: z.literal(\"BorderWidth\"),\n data: BorderWidthTokenData,\n});\n\nconst BorderTypedData = z.object({\n type: z.literal(\"Border\"),\n data: BorderTokenData,\n});\n\nconst ProductCopyTypedData = z.object({\n type: z.literal(\"ProductCopy\"),\n data: ProductCopyTokenData,\n});\n\nconst SizeTypedData = z.object({\n type: z.literal(\"Size\"),\n data: SizeTokenData,\n});\n\nconst SpaceTypedData = z.object({\n type: z.literal(\"Space\"),\n data: SpaceTokenData,\n});\n\nconst VisibilityTypedData = z.object({\n type: z.literal(\"Visibility\"),\n data: VisibilityTokenData,\n});\n\nconst ZIndexTypedData = z.object({\n type: z.literal(\"ZIndex\"),\n data: ZIndexTokenData,\n});\n\nconst DurationTypedData = z.object({\n type: z.literal(\"Duration\"),\n data: DurationTokenData,\n});\n\nconst FontTypedData = z.object({\n type: z.literal(\"Font\"),\n data: FontTokenData,\n});\n\n//\n// Global types\n//\n\nexport const DesignTokenTypedData = z.discriminatedUnion(\"type\", [\n BlurTokenTypedData,\n BorderRadiusTokenTypedData,\n BorderWidthTokenTypedData,\n BorderTypedData,\n ColorTokenTypedData,\n\n DimensionTokenTypedData,\n DurationTypedData,\n FontSizeTokenTypedData,\n FontFamilyTokenTypedData,\n FontWeightTokenTypedData,\n\n GradientTokenTypedData,\n LetterSpacingTokenTypedData,\n LineHeightTokenTypedData,\n OpacityTokenTypedData,\n ParagraphSpacingTokenTypedData,\n\n ProductCopyTypedData,\n ShadowTokenTypedData,\n SizeTypedData,\n SpaceTypedData,\n StringTokenTypedData,\n\n TextCaseTokenTypedData,\n TextDecorationTokenTypedData,\n TypographyTokenTypedData,\n VisibilityTypedData,\n ZIndexTypedData,\n FontTypedData,\n]);\n\nexport type DesignTokenOriginPart = z.infer<typeof DesignTokenOriginPart>;\nexport type DesignTokenOrigin = z.infer<typeof DesignTokenOrigin>;\n\nexport type DesignTokenBase = z.infer<typeof DesignTokenBase>;\n\nexport const DesignToken = DesignTokenTypedData.and(DesignTokenBase);\nexport const CreateDesignToken = DesignTokenTypedData.and(CreateDesignTokenBase);\n\nexport type DesignTokenTypedData = z.infer<typeof DesignTokenTypedData>;\nexport type DesignTokenTypedDataOfType<T extends DesignTokenType> = Extract<DesignTokenTypedData, { type: T }>;\n\nexport type DesignToken = z.infer<typeof DesignToken>;\nexport type ImportedDesignToken = OmitStrict<DesignToken, \"origin\"> & { origin: DesignTokenOrigin };\n\nexport type DesignTokenOfType<T extends DesignTokenType> = Extract<DesignToken, { type: T }>;\nexport type ImportedDesignTokenOfType<T extends DesignTokenType> = Extract<ImportedDesignToken, { type: T }>;\n\nexport type CreateDesignToken = z.infer<typeof CreateDesignToken>;\nexport type UpdateDesignToken = OmitStrict<DbUpdate<DesignToken>, \"brandPersistentId\" | \"designSystemVersionId\">;\n\nexport type DesignTokensDiff = {\n toCreate: CreateDesignToken[];\n toUpdate: UpdateDesignToken[];\n};\n\n//\n// Utilities\n//\n\nexport function extractTokenTypedData<T extends DesignTokenType, I extends DesignTokenTypedDataOfType<T>>(\n source: I\n): DesignTokenTypedDataOfType<T> {\n return {\n type: source.type,\n data: source.data,\n } as DesignTokenTypedDataOfType<T>;\n}\n\nexport function convertTokenTypedData<I extends DesignTokenType, O extends DesignTokenType>(\n source: DesignTokenTypedDataOfType<I>,\n type: O,\n isNonCompatibleTypeChangesEnabled: boolean\n): DesignTokenTypedDataOfType<O> {\n if (!areTokenTypesCompatible(source.type, type, isNonCompatibleTypeChangesEnabled)) {\n throw SupernovaException.invalidOperation(`Cannot convert token from ${source.type} to ${type}`);\n }\n\n const data = source.data;\n if (isNonCompatibleTypeChangesEnabled) {\n data.value = castStringToDimensionValue(source.type, type, source.data.value);\n }\n\n return {\n type,\n data,\n } as DesignTokenTypedDataOfType<O>;\n}\n\nexport function isImportedDesignToken<T extends DesignTokenType>(\n designToken: DesignTokenOfType<T>\n): designToken is ImportedDesignTokenOfType<T> {\n return !!designToken.origin;\n}\n\nexport function isDesignTokenOfType<T extends DesignTokenType>(\n designToken: DesignToken,\n type: T\n): designToken is DesignTokenOfType<T> {\n return designToken.type === type;\n}\n\nexport function designTokenTypeFilter<T extends DesignTokenType>(\n type: T\n): (designToken: DesignToken) => designToken is DesignTokenOfType<T> {\n return (designToken): designToken is DesignTokenOfType<T> => isDesignTokenOfType(designToken, type);\n}\n","import { z } from \"zod\";\n\nexport const FigmaFile = z.object({\n id: z.string(),\n name: z.string(),\n lastModifiedAt: z.coerce.date(),\n thumbnailUrl: z.string().optional(),\n});\n\nexport type FigmaFile = z.infer<typeof FigmaFile>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DataSourceRemoteType } from \"./data-source\";\nimport { Entity } from \"../../common\";\n\nexport const ImportJobState = z.enum([\"PendingInput\", \"Queued\", \"InProgress\", \"Failed\", \"Success\"]);\nexport const ImportJobOperation = z.enum([\"Check\", \"Import\"]);\n\nexport const ImportJob = Entity.extend({\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n sourceIds: z.array(z.string()),\n state: ImportJobState,\n createdByUserId: z.string().optional(),\n importContextId: z.string(),\n error: z.string().optional(),\n sourceType: DataSourceRemoteType,\n importContextCleanedUp: z.boolean(),\n});\n\nexport type ImportJobState = z.infer<typeof ImportJobState>;\nexport type ImportJobOperation = z.infer<typeof ImportJobOperation>;\nexport type ImportJob = z.infer<typeof ImportJob>;\n\nexport type CreateImportJob = DbCreateInputOmit<ImportJob>;\nexport type UpdateImportJob = OmitStrict<\n DbUpdate<ImportJob>,\n \"designSystemId\" | \"createdByUserId\" | \"sourceIds\" | \"importContextId\"\n>;\n","import { z } from \"zod\";\nimport { CollectionImportModel, CollectionImportModelInput } from \"../collection\";\nimport { AssetImportModelInput, FigmaComponentImportModel, FigmaComponentImportModelInput } from \"../component\";\nimport { DataSourceImportModel } from \"../data-source\";\nimport { FigmaFileStructureImportModel, FigmaFileStructureImportModelInput } from \"../figma-frames\";\nimport { ThemeImportModel, ThemeImportModelInput, ThemeUpdateImportModel, ThemeUpdateImportModelInput } from \"../theme\";\nimport { DesignTokenImportModel, DesignTokenImportModelInput } from \"../tokens\";\n\n//\n// Collections\n//\n\nexport const ImportModelInputCollection = z.object({\n source: DataSourceImportModel,\n tokens: z.array(DesignTokenImportModelInput).default([]),\n components: z.array(FigmaComponentImportModelInput).default([]),\n assets: z.array(AssetImportModelInput).default([]),\n themeUpdates: z.array(ThemeUpdateImportModelInput).default([]),\n themes: z.array(ThemeImportModelInput).default([]),\n figmaFileStructure: FigmaFileStructureImportModelInput.optional(),\n collections: z.array(CollectionImportModelInput),\n});\n\nexport const ImportModelCollection = z.object({\n sources: z.array(DataSourceImportModel),\n tokens: z.array(DesignTokenImportModel).default([]),\n components: z.array(FigmaComponentImportModel).default([]),\n themeUpdates: z.array(ThemeUpdateImportModel).default([]),\n themes: z.array(ThemeImportModel).default([]),\n figmaFileStructures: z.array(FigmaFileStructureImportModel),\n collections: z.array(CollectionImportModel),\n});\n\nexport type ImportModelCollection = z.infer<typeof ImportModelCollection>;\nexport type ImportModelInputCollection = z.infer<typeof ImportModelInputCollection>;\n\nexport function addImportModelCollections(\n lhs: ImportModelCollection,\n rhs: ImportModelCollection\n): ImportModelCollection {\n return {\n sources: [...lhs.sources, ...rhs.sources],\n tokens: [...lhs.tokens, ...rhs.tokens],\n components: [...lhs.components, ...rhs.components],\n themeUpdates: [...lhs.themeUpdates, ...rhs.themeUpdates],\n themes: [...lhs.themes, ...rhs.themes],\n figmaFileStructures: [...lhs.figmaFileStructures, ...rhs.figmaFileStructures],\n collections: [...lhs.collections, ...rhs.collections],\n };\n}\n","import { z } from \"zod\";\nimport { CollectionOrigin } from \"../collection\";\n\nexport const CollectionImportModelInput = z.object({\n id: z.string(),\n name: z.string(),\n});\n\nexport const CollectionImportModel = z.object({\n id: z.string(),\n name: z.string(),\n origin: CollectionOrigin,\n});\n\nexport type CollectionImportModelInput = z.infer<typeof CollectionImportModelInput>;\nexport type CollectionImportModel = z.infer<typeof CollectionImportModel>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\nimport { ColorTokenInlineData } from \"./properties\";\n\nexport const CollectionOrigin = z.object({\n id: z.string(),\n sourceId: z.string(),\n});\n\nexport const Collection = z.object({\n id: z.string(),\n persistentId: z.string(),\n\n designSystemVersionId: z.string(),\n\n name: z.string(),\n description: z.string(),\n backgroundColor: ColorTokenInlineData.optional(),\n\n /**\n * ID of Select element property definition's option that corresponds to this collection.\n *\n * Each collection is represented by an option in a special kind of element property that\n * is present in each design system where a collections are present. The property is maintained\n * automatically and is not available to the user (see immutable element properties).\n *\n * Collections have an immutable element property that allows bridging places where element properites\n * can be selected (e.g. documentation blocks) with the concept of collection without having to add\n * specific logic for collection selection.\n */\n elementPropertyOptionId: z.string(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n sortOrder: z.string(),\n\n origin: CollectionOrigin.optional(),\n});\n\nexport type CollectionOrigin = z.infer<typeof CollectionOrigin>;\nexport type Collection = z.infer<typeof Collection>;\n\nexport type CreateCollection = OmitStrict<DbCreateInputOmit<Collection>, \"elementPropertyOptionId\">;\nexport type UpdateCollection = OmitStrict<\n DbUpdate<Collection>,\n \"designSystemVersionId\" | \"origin\" | \"elementPropertyOptionId\"\n> & {\n origin?: Partial<CollectionOrigin>;\n};\n","import { z } from \"zod\";\nimport { FigmaComponentOrigin, FigmaComponentOriginPart, FigmaComponentPropertyMap } from \"../elements\";\nimport { ImportModelBase, ImportModelInputBase } from \"./base\";\nimport { FigmaSvgRenderImportModel, ImageImportModel } from \"./image\";\n\n//\n// Import model\n//\n\nconst FigmaComponentImportModelPart = z.object({\n thumbnail: ImageImportModel,\n parentComponentId: z.string().optional(),\n componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),\n variantPropertyValues: z.record(z.string()).optional(),\n renderNodeId: z.string(),\n svg: FigmaSvgRenderImportModel.optional(),\n});\n\nexport const FigmaComponentImportModel = ImportModelBase.extend(FigmaComponentImportModelPart.shape).extend({\n origin: FigmaComponentOrigin,\n isAsset: z.boolean(),\n});\n\nexport type FigmaComponentImportModel = z.infer<typeof FigmaComponentImportModel>;\n\n//\n// Import model input\n//\n\nexport const FigmaComponentImportModelInput = ImportModelInputBase.extend(FigmaComponentImportModelPart.shape).extend({\n originMetadata: FigmaComponentOriginPart,\n isAsset: z.boolean().optional(),\n});\n\nexport const AssetImportModelInput = FigmaComponentImportModelInput;\n\nexport type FigmaComponentImportModelInput = z.infer<typeof FigmaComponentImportModelInput>;\nexport type AssetImportModelInput = z.infer<typeof AssetImportModelInput>;\n","import { z } from \"zod\";\nimport { DesignElementOrigin } from \"../elements\";\nimport { ObjectMeta } from \"../../common\";\n\nexport const ImportModelBase = z.object({\n id: z.string(),\n meta: ObjectMeta,\n origin: DesignElementOrigin,\n brandPersistentId: z.string(),\n sortOrder: z.number(),\n});\n\nexport type ImportModelBase = z.infer<typeof ImportModelBase>;\n\nexport const ImportModelInputBase = ImportModelBase.omit({\n brandPersistentId: true,\n origin: true,\n sortOrder: true,\n}).extend({\n originId: z.string(),\n originMetadata: z.record(z.any()),\n});\n\nexport type ImportModelInputBase = z.infer<typeof ImportModelInputBase>;\n","import { z } from \"zod\";\nimport { AssetScope } from \"../assets\";\n\n//\n// Abstract\n//\n\nexport const ImageImportModelType = z.enum([\"Url\", \"FigmaRender\"]);\nexport type ImageImportModelType = z.infer<typeof ImageImportModelType>;\n\nconst ImageImportModelBase = z.object({\n scope: AssetScope,\n});\n\n//\n// Url\n//\n\nexport const UrlImageImportModel = ImageImportModelBase.extend({\n type: z.literal(ImageImportModelType.enum.Url),\n url: z.string(),\n originKey: z.string(),\n extension: z.string(),\n});\n\nexport type UrlImageImportModel = z.infer<typeof UrlImageImportModel>;\n\n//\n// Figma Render\n//\n\nexport const FigmaRenderFormat = z.enum([\"Svg\", \"Png\", \"Pdf\"]);\n\nconst FigmaRenderBase = ImageImportModelBase.extend({\n type: z.literal(ImageImportModelType.enum.FigmaRender),\n fileId: z.string(),\n fileVersionId: z.string().optional(),\n nodeId: z.string(),\n originKey: z.string(),\n});\n\nexport const FigmaPngRenderImportModel = FigmaRenderBase.extend({\n format: z.literal(FigmaRenderFormat.enum.Png),\n scale: z.number(),\n});\n\nexport const FigmaSvgRenderImportModel = FigmaRenderBase.extend({\n format: z.literal(FigmaRenderFormat.enum.Svg),\n});\n\nexport const FigmaRenderImportModel = z.discriminatedUnion(\"format\", [\n FigmaPngRenderImportModel,\n FigmaSvgRenderImportModel,\n]);\n\n//\n// Union\n//\n\n// Unfortunately discriminated union doesn't support inserting another discriminated union\nexport const ImageImportModel = z.union([UrlImageImportModel, FigmaRenderImportModel]);\n\n//\n// Types\n//\n\nexport type FigmaRenderFormat = z.infer<typeof FigmaRenderFormat>;\nexport type FigmaRenderBase = z.infer<typeof FigmaRenderBase>;\nexport type FigmaPngRenderImportModel = z.infer<typeof FigmaPngRenderImportModel>;\nexport type FigmaSvgRenderImportModel = z.infer<typeof FigmaSvgRenderImportModel>;\nexport type FigmaRenderImportModel = z.infer<typeof FigmaRenderImportModel>;\nexport type ImageImportModel = z.infer<typeof ImageImportModel>;\n\n//\n// Utils\n//\n\nexport function getFigmaRenderFormatFileExtension(format: FigmaRenderFormat): string {\n switch (format) {\n case \"Pdf\":\n return \"pdf\";\n case \"Png\":\n return \"png\";\n case \"Svg\":\n return \"svg\";\n }\n}\n","import { z } from \"zod\";\n\nexport const DataSourceImportModel = z.object({\n id: z.string(),\n fileName: z.string().optional(),\n thumbnailUrl: z.string().optional(),\n});\n\nexport type DataSourceImportModel = z.infer<typeof DataSourceImportModel>;\n","import { ZodTypeDef, z } from \"zod\";\nimport { FigmaFileStructureNodeBase, FigmaFileStructureOrigin, FigmaFileStructureStatistics } from \"../elements\";\nimport { ImportModelBase, ImportModelInputBase } from \"./base\";\n\n//\n// Nodes Import Model\n//\n\nexport const FigmaFileStructureNodeImportModel: z.ZodType<\n FigmaFileStructureNodeImportModel,\n ZodTypeDef,\n FigmaFileStructureNodeImportModelBaseInput\n> = FigmaFileStructureNodeBase.extend({\n children: z.lazy(() => FigmaFileStructureNodeImportModel.array()),\n});\n\ntype FigmaFileStructureNodeImportModelBaseInput = z.input<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNodeImportModelBaseInput[];\n};\n\nexport type FigmaFileStructureNodeImportModel = z.infer<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNodeImportModel[];\n};\n\n//\n// Structure Import Model\n//\n\nconst FigmaFileStructureImportModelPart = z.object({\n data: z.object({\n rootNode: FigmaFileStructureNodeImportModel,\n assetsInFile: FigmaFileStructureStatistics,\n }),\n});\n\nexport const FigmaFileStructureImportModel = ImportModelBase.extend(FigmaFileStructureImportModelPart.shape).extend({\n origin: FigmaFileStructureOrigin,\n});\n\nexport type FigmaFileStructureImportModel = z.infer<typeof FigmaFileStructureImportModel>;\n\n//\n// Import model input\n//\n\nexport const FigmaFileStructureImportModelInput = ImportModelInputBase.extend(\n FigmaFileStructureImportModelPart.shape\n).extend({\n fileVersionId: z.string(),\n});\n\nexport type FigmaFileStructureImportModelInput = z.infer<typeof FigmaFileStructureImportModelInput>;\n\nexport function figmaFileStructureImportModelToMap(\n root: FigmaFileStructureNodeImportModel\n): Map<string, FigmaFileStructureNodeImportModel> {\n const map = new Map<string, FigmaFileStructureNodeImportModel>();\n recursiveFigmaFileStructureToMap(root, map);\n return map;\n}\n\nfunction recursiveFigmaFileStructureToMap(\n node: FigmaFileStructureNodeImportModel,\n map: Map<string, FigmaFileStructureNodeImportModel>\n) {\n map.set(node.id, node);\n for (const child of node.children) recursiveFigmaFileStructureToMap(child, map);\n}\n","import { z } from \"zod\";\nimport {\n DesignTokenTypedData,\n DesignTokenType,\n ThemeOriginObject,\n ThemeOriginSource,\n ThemeOverrideOrigin,\n ThemeOverrideOriginPart,\n} from \"../elements\";\nimport { ObjectMeta } from \"../../common\";\n\n//\n// Overrides\n//\n\nexport const ThemeOverrideImportModelBase = DesignTokenTypedData.and(\n z.object({\n id: z.string(),\n meta: ObjectMeta,\n })\n);\n\nexport const ThemeOverrideImportModel = ThemeOverrideImportModelBase.and(\n z.object({\n origin: ThemeOverrideOrigin,\n })\n);\n\nexport const ThemeOverrideImportModelInput = ThemeOverrideImportModelBase.and(\n z.object({\n originId: z.string(),\n originMetadata: ThemeOverrideOriginPart,\n })\n);\n\nexport type ThemeOverrideImportModel = z.infer<typeof ThemeOverrideImportModel>;\nexport type ThemeOverrideImportModelOfType<T extends DesignTokenType> = Extract<ThemeOverrideImportModel, { type: T }>;\n\nexport type ThemeOverrideImportModelInput = z.infer<typeof ThemeOverrideImportModelInput>;\nexport type ThemeOverrideImportModelInputOfType<T extends DesignTokenType> = Extract<\n ThemeOverrideImportModelInput,\n { type: T }\n>;\n\n//\n// Themes\n//\n\nexport const ThemeImportModel = z.object({\n meta: ObjectMeta,\n brandPersistentId: z.string(),\n originSource: ThemeOriginSource,\n overrides: z.array(ThemeOverrideImportModel),\n sortOrder: z.number(),\n});\n\nexport const ThemeImportModelInput = z.object({\n meta: ObjectMeta,\n originObjects: z.array(ThemeOriginObject),\n overrides: z.array(ThemeOverrideImportModelInput),\n});\n\nexport type ThemeImportModel = z.infer<typeof ThemeImportModel>;\nexport type ThemeImportModelInput = z.infer<typeof ThemeImportModelInput>;\n\n//\n// Theme Update\n//\n\nexport const ThemeUpdateImportModel = z.object({\n themePersistentId: z.string(),\n overrides: z.array(ThemeOverrideImportModel),\n});\n\nexport const ThemeUpdateImportModelInput = z.object({\n themePersistentId: z.string(),\n overrides: z.array(ThemeOverrideImportModelInput),\n});\n\nexport type ThemeUpdateImportModel = z.infer<typeof ThemeUpdateImportModel>;\nexport type ThemeUpdateImportModelInput = z.infer<typeof ThemeUpdateImportModelInput>;\n","import { z } from \"zod\";\nimport { DesignTokenOrigin, DesignTokenOriginPart, DesignTokenType, DesignTokenTypedData } from \"../elements\";\nimport { ImportModelBase, ImportModelInputBase } from \"./base\";\n\n//\n// Base\n//\n\nconst DesignTokenImportModelPart = z.object({\n collectionId: z.string().optional(),\n codeSyntax: z.record(z.coerce.string()).optional(),\n scopes: z.array(z.string()).optional(),\n});\n\nexport const DesignTokenImportModelBase = ImportModelBase.extend(DesignTokenImportModelPart.shape).extend({\n origin: DesignTokenOrigin,\n});\n\nexport const DesignTokenImportModelInputBase = ImportModelInputBase.extend(DesignTokenImportModelPart.shape).extend({\n originMetadata: DesignTokenOriginPart,\n});\n\n//\n// Import models\n//\n\nexport const DesignTokenImportModel = DesignTokenTypedData.and(DesignTokenImportModelBase);\nexport const DesignTokenImportModelInput = DesignTokenTypedData.and(DesignTokenImportModelInputBase);\n\nexport type DesignTokenImportModelInputBase = z.infer<typeof DesignTokenImportModelInputBase>;\n\nexport type DesignTokenImportModel = z.infer<typeof DesignTokenImportModel>;\nexport type DesignTokenImportModelOfType<T extends DesignTokenType> = Extract<DesignTokenImportModel, { type: T }>;\n\nexport type DesignTokenImportModelInput = z.infer<typeof DesignTokenImportModelInput>;\nexport type DesignTokenImportModelInputOfType<T extends DesignTokenType> = Extract<DesignTokenImportModel, { type: T }>;\n\nexport function isDesignTokenImportModelOfType<T extends DesignTokenType>(\n designToken: DesignTokenImportModel,\n type: T\n): designToken is DesignTokenImportModelOfType<T> {\n return designToken.type === type;\n}\n\nexport function designTokenImportModelTypeFilter<T extends DesignTokenType>(\n type: T\n): (designToken: DesignTokenImportModel) => designToken is DesignTokenImportModelOfType<T> {\n return (designToken): designToken is DesignTokenImportModelOfType<T> =>\n isDesignTokenImportModelOfType(designToken, type);\n}\n","import { z } from \"zod\";\n\nexport const DocumentationPageApprovalState = z.enum([\"ReadyForReview\", \"ChangesRequested\", \"Approved\"]);\nexport type DocumentationPageApprovalState = z.infer<typeof DocumentationPageApprovalState>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../../../helpers/db\";\nimport { DocumentationPageApprovalState } from \"../approvals/approval-state\";\n\nexport const DocumentationPageApproval = z.object({\n id: z.string(),\n approvalState: DocumentationPageApprovalState,\n persistentId: z.string(),\n pageId: z.string(),\n pagePersistentId: z.string(),\n updatedByUserId: z.string(),\n designSystemVersionId: z.string(),\n updatedAt: z.coerce.date(),\n createdAt: z.coerce.date(),\n});\n\nexport type CreateDocumentationPageApproval = DbCreateInputOmit<DocumentationPageApproval>;\nexport type DocumentationPageApproval = z.infer<typeof DocumentationPageApproval>;\n","import { z } from \"zod\";\nimport { PageBlockDefinitionAppearance } from \"./aux\";\nimport { PageBlockDefinitionItem } from \"./item\";\n\n//\n// Enums\n//\n\nexport const PageBlockCategory = z.enum([\n \"Text\",\n \"Layout\",\n \"Media\",\n \"Embed\",\n \"Figma\",\n \"Code\",\n \"Guidelines\",\n \"Tokens\",\n \"Components\",\n \"Assets\",\n \"Data\",\n \"Other\",\n]);\n\nexport const PageBlockBehaviorDataType = z.enum([\n \"Item\",\n \"Token\",\n \"Asset\",\n \"Component\",\n \"FigmaNode\",\n \"FigmaComponent\",\n \"File\",\n]);\n\nexport const PageBlockBehaviorSelectionType = z.enum([\"Entity\", \"Group\", \"EntityAndGroup\"]);\n\nexport type PageBlockCategory = z.infer<typeof PageBlockCategory>;\nexport type PageBlockBehaviorDataType = z.infer<typeof PageBlockBehaviorDataType>;\nexport type PageBlockBehaviorSelectionType = z.infer<typeof PageBlockBehaviorSelectionType>;\n\n//\n// Definitions\n//\n\nexport const PageBlockDefinitionBehavior = z.object({\n dataType: PageBlockBehaviorDataType,\n items: z\n .object({\n numberOfItems: z.number(),\n allowLinks: z.boolean(),\n newItemLabel: z.string().optional(),\n })\n .optional(),\n entities: z\n .object({\n selectionType: PageBlockBehaviorSelectionType,\n maxSelected: z.number(),\n })\n .optional(),\n});\n\nexport const PageBlockDefinitionOnboarding = z.object({\n helpText: z.string(),\n documentationLink: z.string().optional(),\n});\n\nexport const PageBlockDefinition = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string(),\n category: PageBlockCategory,\n icon: z.string().optional(),\n documentationLink: z.string().optional(),\n searchKeywords: z.array(z.string()).optional(),\n item: PageBlockDefinitionItem,\n behavior: PageBlockDefinitionBehavior,\n editorOptions: z.object({\n onboarding: PageBlockDefinitionOnboarding.optional(),\n newItemLabel: z.string().optional(),\n }),\n appearance: PageBlockDefinitionAppearance.optional(),\n});\n\nexport type PageBlockDefinitionBehavior = z.infer<typeof PageBlockDefinitionBehavior>;\nexport type PageBlockDefinitionOnboarding = z.infer<typeof PageBlockDefinitionOnboarding>;\nexport type PageBlockDefinition = z.infer<typeof PageBlockDefinition>;\n","import { z } from \"zod\";\n\nexport const DocumentationPageGroup = z.object({\n type: z.literal(\"ElementGroup\"),\n childType: z.literal(\"DocumentationPage\"),\n id: z.string(),\n persistentId: z.string(),\n shortPersistentId: z.string(),\n designSystemVersionId: z.string(),\n parentPersistentId: z.string().nullish(),\n sortOrder: z.number(),\n title: z.string(),\n slug: z.string(),\n userSlug: z.string().nullish(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DocumentationPageGroup = z.infer<typeof DocumentationPageGroup>;\n","import { z } from \"zod\";\nimport { PageBlockImageReference } from \"../elements\";\n\nexport const DocumentationLinkPreview = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n thumbnail: PageBlockImageReference.optional(),\n});\n\nexport type DocumentationLinkPreview = z.infer<typeof DocumentationLinkPreview>;\n","import { z } from \"zod\";\n\nexport const DocumentationPageAnchor = z.object({\n blockId: z.string(),\n level: z.number(),\n text: z.string(),\n});\n\nexport type DocumentationPageAnchor = z.infer<typeof DocumentationPageAnchor>;\n","import { z } from \"zod\";\n\nexport const DocumentationPageContentBackup = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n documentationPageName: z.string(),\n storagePath: z.string(),\n});\n\nexport type DocumentationPageContentBackup = z.infer<typeof DocumentationPageContentBackup>;\n","import { z } from \"zod\";\nimport { PageBlockEditorModelV2, PageSectionEditorModelV2 } from \"../elements\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const DocumentationPageContentItem = z.discriminatedUnion(\"type\", [\n PageBlockEditorModelV2,\n PageSectionEditorModelV2,\n]);\n\nexport const DocumentationPageContentData = z.object({\n items: z.array(DocumentationPageContentItem),\n});\n\nexport const DocumentationPageContent = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n data: DocumentationPageContentData,\n});\n\nexport type DocumentationPageContentItem = z.infer<typeof DocumentationPageContentItem>;\nexport type DocumentationPageContentData = z.infer<typeof DocumentationPageContentData>;\nexport type DocumentationPageContent = z.infer<typeof DocumentationPageContent>;\n\nexport type CreateDocumentationPageContent = DbCreateInputOmit<DocumentationPageContent>;\nexport type UpdateDocumentationPageContent = OmitStrict<\n DbUpdate<DocumentationPageContent>,\n \"designSystemVersionId\" | \"documentationPageId\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const DocumentationPageDependencies = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n\n tokenPersistentIds: z.set(z.string()),\n figmaComponentPersistentIds: z.set(z.string()),\n componentPersistentIds: z.set(z.string()),\n figmaNodePersistentIds: z.set(z.string()),\n groupPersistentIds: z.set(z.string()),\n propertyPersistentIds: z.set(z.string()),\n themePersistentIds: z.set(z.string()),\n documentationPagePersistentIds: z.set(z.string()),\n storybookEntriesStoryIds: z.array(z.string()),\n});\n\nexport type PageContentDependencies = {\n tokenPersistentIds: Set<string>;\n figmaComponentPersistentIds: Set<string>;\n componentPersistentIds: Set<string>;\n figmaNodePersistentIds: Set<string>;\n groupPersistentIds: Set<string>;\n propertyPersistentIds: Set<string>;\n themePersistentIds: Set<string>;\n documentationPagePersistentIds: Set<string>;\n storybookEntriesStoryIds: Array<string>;\n};\nexport type PagesContentDependencies = Map<string, PageContentDependencies>;\n\nexport type DocumentationPageDependencies = z.infer<typeof DocumentationPageDependencies>;\n\nexport type CreateDocumentationPageDependencies = DbCreateInputOmit<DocumentationPageDependencies>;\nexport type UpdateDocumentationPageDependencies = OmitStrict<\n DbUpdate<DocumentationPageDependencies>,\n \"designSystemVersionId\" | \"documentationPageId\"\n>;\n","import { z } from \"zod\";\n\nexport const DocumentationPage = z.object({\n type: z.literal(\"DocumentationPage\"),\n id: z.string(),\n persistentId: z.string(),\n shortPersistentId: z.string(),\n designSystemVersionId: z.string(),\n parentPersistentId: z.string().nullish(),\n sortOrder: z.number(),\n title: z.string(),\n slug: z.string(),\n userSlug: z.string().nullish(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DocumentationPage = z.infer<typeof DocumentationPage>;\n","import { z } from \"zod\";\n\nexport const PageRedirect = z.object({\n id: z.string(),\n pagePersistentId: z.string(),\n path: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n designSystemId: z.string(),\n});\n\nexport type PageRedirect = z.infer<typeof PageRedirect>;\n","import { z } from \"zod\";\n\nexport const DocumentationSettings = z.object({\n // Basic\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n // Configuration\n isTabbedLayoutEnabled: z.boolean(),\n storybookEmbedErrorMessage: z.string().optional(),\n renderCodePackageJson: z.string().optional(),\n selectedBrandPersistentId: z.string().optional(),\n serveDefaultVersionOnly: z.boolean(),\n isPublic: z.boolean(),\n});\n\nexport type DocumentationSettings = z.infer<typeof DocumentationSettings>;\n","import { z } from \"zod\";\n\nexport const DocumentationComment = z.object({\n id: z.string(),\n\n authorId: z.string(),\n threadId: z.string(),\n roomId: z.string(),\n\n createdAt: z.coerce.date(),\n editedAt: z.coerce.date().optional(),\n deletedAt: z.coerce.date().optional(),\n\n body: z.string(),\n});\n\nexport const DocumentationCommentThread = z.object({\n id: z.string(),\n\n roomId: z.string(),\n\n pagePersistentId: z.string(),\n brandId: z.string(),\n designSystemVersionId: z.string(),\n designSystemId: z.string(),\n\n blockId: z.string().optional(),\n resolved: z.boolean(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DocumentationComment = z.infer<typeof DocumentationComment>;\nexport type DocumentationCommentThread = z.infer<typeof DocumentationCommentThread>;\n","import { z } from \"zod\";\nimport { groupBy } from \"../../utils\";\n\nexport const DesignElementSnapshotReason = z.enum([\"Publish\", \"Deletion\"]);\n\nexport const DesignElementSnapshotBase = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n reason: DesignElementSnapshotReason,\n createdByUserId: z.string(),\n});\n\nexport type DesignElementSnapshotBase = z.infer<typeof DesignElementSnapshotBase>;\nexport type DesignElementSnapshotReason = z.infer<typeof DesignElementSnapshotReason>;\n\n//\n// Util functions\n//\n\nexport function pickLatestSnapshots<T extends DesignElementSnapshotBase>(\n snapshots: T[],\n getSnapshotElementId: (snapshot: T) => string\n): T[] {\n const groupedSnapshots = groupBy(snapshots, getSnapshotElementId);\n\n return Array.from(groupedSnapshots.entries()).map(([_, snapshots]) => {\n // Sort snapshots by created at date desc\n const sorted = snapshots.sort((lhs, rhs) => rhs.createdAt.getTime() - lhs.createdAt.getTime());\n return sorted[0];\n });\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DocumentationPageV2 } from \"../elements\";\nimport { DesignElementSnapshotBase, pickLatestSnapshots } from \"./base\";\n\n/**\n * Snapshot of a documentation page.\n *\n * Please note that existence of snapshot's references (including parent persistent id) is not guaranteed.\n */\nexport const DocumentationPageSnapshot = DesignElementSnapshotBase.extend({\n page: DocumentationPageV2,\n pageContentHash: z.string(),\n pageContentStorageKey: z.string(),\n});\n\nexport type DocumentationPageSnapshot = z.infer<typeof DocumentationPageSnapshot>;\n\nexport type CreateDocumentationPageSnapshot = DbCreateInputOmit<DocumentationPageSnapshot>;\nexport type UpdateDocumentationPageSnapshot = OmitStrict<DbUpdate<DocumentationPageSnapshot>, \"designSystemVersionId\">;\n\n//\n// Util functions\n//\n\nexport function pickLatestPageSnapshots(snapshots: DocumentationPageSnapshot[]): DocumentationPageSnapshot[] {\n return pickLatestSnapshots(snapshots, s => s.page.id);\n}\n","import { z } from \"zod\";\n\nconst FigmaExporterProcessedStylesSchema = z.object({\n display: z\n .union([\n z.literal(\"block\"),\n z.literal(\"inline-block\"),\n z.literal(\"inline\"),\n z.literal(\"flex\"),\n z.literal(\"grid\"),\n z.literal(\"none\"),\n ])\n .optional(),\n position: z\n .union([z.literal(\"absolute\"), z.literal(\"relative\"), z.literal(\"fixed\"), z.literal(\"static\"), z.literal(\"sticky\")])\n .optional(),\n top: z.string().optional(),\n right: z.string().optional(),\n bottom: z.string().optional(),\n left: z.string().optional(),\n width: z.string().optional(),\n height: z.string().optional(),\n minWidth: z.string().optional(),\n minHeight: z.string().optional(),\n maxWidth: z.string().optional(),\n maxHeight: z.string().optional(),\n zIndex: z.number().optional(),\n overflow: z\n .union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"scroll\"), z.literal(\"auto\"), z.literal(\"clip\")])\n .optional(),\n overflowX: z\n .union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"scroll\"), z.literal(\"auto\"), z.literal(\"clip\")])\n .optional(),\n overflowY: z\n .union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"scroll\"), z.literal(\"auto\"), z.literal(\"clip\")])\n .optional(),\n aspectRatio: z.string().optional(),\n flexDirection: z\n .union([z.literal(\"row\"), z.literal(\"row-reverse\"), z.literal(\"column\"), z.literal(\"column-reverse\")])\n .optional(),\n justifyContent: z\n .union([\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"space-between\"),\n z.literal(\"space-around\"),\n z.literal(\"space-evenly\"),\n ])\n .optional(),\n alignItems: z\n .union([\n z.literal(\"stretch\"),\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"baseline\"),\n ])\n .optional(),\n alignSelf: z\n .union([\n z.literal(\"auto\"),\n z.literal(\"stretch\"),\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"baseline\"),\n ])\n .optional(),\n flexGrow: z.number().optional(),\n flexShrink: z.number().optional(),\n flexBasis: z.string().optional(),\n flexWrap: z.union([z.literal(\"nowrap\"), z.literal(\"wrap\"), z.literal(\"wrap-reverse\")]).optional(),\n gap: z.string().optional(),\n rowGap: z.string().optional(),\n columnGap: z.string().optional(),\n gridTemplateColumns: z.string().optional(),\n gridTemplateRows: z.string().optional(),\n gridColumn: z.string().optional(),\n gridRow: z.string().optional(),\n gridAutoFlow: z\n .union([\n z.literal(\"row\"),\n z.literal(\"column\"),\n z.literal(\"dense\"),\n z.literal(\"row dense\"),\n z.literal(\"column dense\"),\n ])\n .optional(),\n alignContent: z\n .union([\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"space-between\"),\n z.literal(\"space-around\"),\n z.literal(\"stretch\"),\n ])\n .optional(),\n padding: z.string().optional(),\n paddingTop: z.string().optional(),\n paddingRight: z.string().optional(),\n paddingBottom: z.string().optional(),\n paddingLeft: z.string().optional(),\n margin: z.string().optional(),\n marginTop: z.string().optional(),\n marginRight: z.string().optional(),\n marginBottom: z.string().optional(),\n marginLeft: z.string().optional(),\n border: z.string().optional(),\n borderWidth: z.string().optional(),\n borderStyle: z.string().optional(),\n borderColor: z.string().optional(),\n borderTop: z.string().optional(),\n borderRight: z.string().optional(),\n borderBottom: z.string().optional(),\n borderLeft: z.string().optional(),\n borderRadius: z.string().optional(),\n borderTopLeftRadius: z.string().optional(),\n borderTopRightRadius: z.string().optional(),\n borderBottomRightRadius: z.string().optional(),\n borderBottomLeftRadius: z.string().optional(),\n backgroundColor: z.string().optional(),\n backgroundImage: z.string().optional(),\n backgroundSize: z.string().optional(),\n backgroundPosition: z.string().optional(),\n backgroundRepeat: z.string().optional(),\n backgroundClip: z\n .union([z.literal(\"border-box\"), z.literal(\"padding-box\"), z.literal(\"content-box\"), z.literal(\"text\")])\n .optional(),\n backgroundOrigin: z.union([z.literal(\"border-box\"), z.literal(\"padding-box\"), z.literal(\"content-box\")]).optional(),\n opacity: z.number().optional(),\n boxShadow: z.string().optional(),\n filter: z.string().optional(),\n backdropFilter: z.string().optional(),\n mixBlendMode: z\n .union([\n z.literal(\"normal\"),\n z.literal(\"multiply\"),\n z.literal(\"screen\"),\n z.literal(\"overlay\"),\n z.literal(\"darken\"),\n z.literal(\"lighten\"),\n z.literal(\"color-dodge\"),\n z.literal(\"color-burn\"),\n z.literal(\"hard-light\"),\n z.literal(\"soft-light\"),\n z.literal(\"difference\"),\n z.literal(\"exclusion\"),\n z.literal(\"hue\"),\n z.literal(\"saturation\"),\n z.literal(\"color\"),\n z.literal(\"luminosity\"),\n z.literal(\"plus-lighter\"),\n ])\n .optional(),\n transform: z.string().optional(),\n transformOrigin: z.string().optional(),\n rotate: z.string().optional(),\n clipPath: z.string().optional(),\n color: z.string().optional(),\n fontFamily: z.string().optional(),\n fontSize: z.string().optional(),\n fontWeight: z.union([z.string(), z.number()]).optional(),\n fontStyle: z.union([z.literal(\"normal\"), z.literal(\"italic\"), z.literal(\"oblique\")]).optional(),\n fontStretch: z.string().optional(),\n fontVariantCaps: z\n .union([\n z.literal(\"normal\"),\n z.literal(\"small-caps\"),\n z.literal(\"all-small-caps\"),\n z.literal(\"petite-caps\"),\n z.literal(\"all-petite-caps\"),\n z.literal(\"unicase\"),\n z.literal(\"titling-caps\"),\n ])\n .optional(),\n lineHeight: z.union([z.string(), z.number()]).optional(),\n letterSpacing: z.string().optional(),\n textAlign: z\n .union([\n z.literal(\"left\"),\n z.literal(\"center\"),\n z.literal(\"right\"),\n z.literal(\"justify\"),\n z.literal(\"start\"),\n z.literal(\"end\"),\n ])\n .optional(),\n textDecorationLine: z\n .union([z.literal(\"none\"), z.literal(\"underline\"), z.literal(\"overline\"), z.literal(\"line-through\")])\n .optional(),\n textDecorationColor: z.string().optional(),\n textDecorationStyle: z\n .union([z.literal(\"solid\"), z.literal(\"double\"), z.literal(\"dotted\"), z.literal(\"dashed\"), z.literal(\"wavy\")])\n .optional(),\n textDecorationThickness: z.string().optional(),\n textTransform: z\n .union([\n z.literal(\"none\"),\n z.literal(\"uppercase\"),\n z.literal(\"lowercase\"),\n z.literal(\"capitalize\"),\n z.literal(\"full-width\"),\n ])\n .optional(),\n whiteSpace: z\n .union([\n z.literal(\"normal\"),\n z.literal(\"nowrap\"),\n z.literal(\"pre\"),\n z.literal(\"pre-wrap\"),\n z.literal(\"pre-line\"),\n z.literal(\"break-spaces\"),\n ])\n .optional(),\n wordBreak: z\n .union([z.literal(\"normal\"), z.literal(\"break-all\"), z.literal(\"keep-all\"), z.literal(\"break-word\")])\n .optional(),\n textOverflow: z.union([z.literal(\"clip\"), z.literal(\"ellipsis\")]).optional(),\n WebkitLineClamp: z.number().optional(),\n WebkitBoxOrient: z.literal(\"vertical\").optional(),\n fontFeatureSettings: z.string().optional(),\n fill: z.string().optional(),\n stroke: z.string().optional(),\n strokeWidth: z.string().optional(),\n strokeLinecap: z.union([z.literal(\"butt\"), z.literal(\"round\"), z.literal(\"square\")]).optional(),\n strokeLinejoin: z.union([z.literal(\"miter\"), z.literal(\"round\"), z.literal(\"bevel\")]).optional(),\n strokeDasharray: z.string().optional(),\n strokeDashoffset: z.string().optional(),\n transition: z.string().optional(),\n animation: z.string().optional(),\n cursor: z.string().optional(),\n userSelect: z.union([z.literal(\"auto\"), z.literal(\"none\"), z.literal(\"text\"), z.literal(\"all\")]).optional(),\n pointerEvents: z\n .union([\n z.literal(\"auto\"),\n z.literal(\"none\"),\n z.literal(\"visiblePainted\"),\n z.literal(\"visibleFill\"),\n z.literal(\"visibleStroke\"),\n z.literal(\"visible\"),\n z.literal(\"painted\"),\n z.literal(\"fill\"),\n z.literal(\"stroke\"),\n z.literal(\"all\"),\n z.literal(\"inherit\"),\n ])\n .optional(),\n visibility: z.union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"collapse\")]).optional(),\n});\n\ntype ProcessedStyles = z.infer<typeof FigmaExporterProcessedStylesSchema>;\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Schema Definitions\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\nconst FigmaExporterDesignNodeTypeSchema = z.union([\n z.literal(\"FRAME\"),\n z.literal(\"TEXT\"),\n z.literal(\"SVG\"),\n z.literal(\"COMPONENT_INSTANCE\"),\n]);\n\n// Base schema without children for extension\nconst baseDesignNodeObjectSchema = z.object({\n id: z.string(),\n type: FigmaExporterDesignNodeTypeSchema,\n parentId: z.string().nullable(),\n styles: FigmaExporterProcessedStylesSchema.partial(),\n});\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Individual node schemas extending the base\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\nconst frameNodeObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"FRAME\"),\n});\n\nconst textNodeObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"TEXT\"),\n characters: z.string(),\n});\n\nconst svgNodeObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"SVG\"),\n svgString: z.string(),\n});\n\nconst componentInstanceObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"COMPONENT_INSTANCE\"),\n supernovaId: z.string(),\n componentSetName: z.string(),\n componentSetDescription: z.string(),\n componentName: z.string(),\n componentDescription: z.string(),\n props: z.record(z.string(), z.union([z.string(), z.boolean()])),\n});\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Final Node Types with children\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\ntype FrameNode = z.infer<typeof frameNodeObjectSchema> & {\n children: AnyDesignNode[];\n};\n\ntype TextNode = z.infer<typeof textNodeObjectSchema>;\n\ntype SvgNode = z.infer<typeof svgNodeObjectSchema>;\n\ntype ComponentInstanceNode = z.infer<typeof componentInstanceObjectSchema> & {\n children: AnyDesignNode[];\n};\n\ntype AnyDesignNode = FrameNode | TextNode | SvgNode | ComponentInstanceNode;\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Final Schemas with children\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\nconst frameNodeSchema: z.ZodType<FrameNode> = z.lazy(() =>\n frameNodeObjectSchema.extend({\n children: FigmaExporterAnyDesignNodeSchema.array(),\n })\n);\n\n// Text nodes don't have children\nconst textNodeSchema = textNodeObjectSchema;\n\nconst svgNodeSchema: z.ZodType<SvgNode> = z.lazy(() =>\n svgNodeObjectSchema.extend({\n children: FigmaExporterAnyDesignNodeSchema.array(),\n })\n);\n\nconst componentInstanceNodeSchema: z.ZodType<ComponentInstanceNode> = z.lazy(() =>\n componentInstanceObjectSchema.extend({\n children: FigmaExporterAnyDesignNodeSchema.array(),\n })\n);\n\nexport const FigmaExporterAnyDesignNodeSchema = z.union([\n frameNodeSchema,\n textNodeSchema,\n svgNodeSchema,\n componentInstanceNodeSchema,\n]);\n\n// Exported types - exported like this to avoid naming conflicts and unnecessarily long names\nexport type FigmaExporter = {\n AnyDesignNode: AnyDesignNode;\n FrameNode: FrameNode;\n TextNode: TextNode;\n SvgNode: SvgNode;\n ComponentInstanceNode: ComponentInstanceNode;\n ProcessedStyles: ProcessedStyles;\n};\n","import { z } from \"zod\";\n\nexport const FigmaNodeRendererPayload = z.object({\n designSystemId: z.string(),\n versionId: z.string(),\n figmaNodePersistentIds: z.string().array(),\n});\n\nexport type FigmaNodeRendererPayload = z.infer<typeof FigmaNodeRendererPayload>;\n","import { z } from \"zod\";\nimport { FigmaFileStructureNodeImportModel } from \"../import/figma-frames\";\n\nexport const FigmaNodeStructureDataV2 = z.object({\n rootNode: FigmaFileStructureNodeImportModel,\n assetsInFile: z.object({\n components: z.number(),\n componentSets: z.number(),\n frames: z.number(),\n }),\n});\n\nexport type FigmaNodeStructureDataV2 = z.infer<typeof FigmaNodeStructureDataV2>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const FigmaNodeStructureStateV2 = z.enum([\"InProgress\", \"Success\", \"Failed\"]);\n\nexport const FigmaNodeStructureV2 = z.object({\n id: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n storagePath: z.string().optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n importState: FigmaNodeStructureStateV2,\n error: z.string().optional(),\n chunkSize: z.number().optional(),\n\n // TODO Artem: remove after migration\n isFromLegacyStorage: z.boolean(),\n});\n\nexport type FigmaNodeStructureStateV2 = z.infer<typeof FigmaNodeStructureStateV2>;\nexport type FigmaNodeStructureV2 = z.infer<typeof FigmaNodeStructureV2>;\n\nexport type CreateFigmaNodeStructureV2 = OmitStrict<DbCreateInputOmit<FigmaNodeStructureV2>, \"isFromLegacyStorage\">;\nexport type UpdateFigmaNodeStructureV2 = OmitStrict<\n DbUpdate<FigmaNodeStructureV2>,\n \"designSystemId\" | \"sourceId\" | \"isFromLegacyStorage\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { WorkspaceRoleSchema } from \"../../workspace\";\nimport { DesignSystemRole } from \"./ds-role\";\nimport { DesignSystemInvitation } from \"./invitations\";\n\nexport const DesignSystemMembership = z.object({\n id: z.string(),\n userId: z.string(),\n designSystemId: z.string(),\n designSystemRole: DesignSystemRole.optional(),\n workspaceMembershipId: z.string(),\n workspaceRole: WorkspaceRoleSchema,\n});\n\nexport type DesignSystemMembership = z.infer<typeof DesignSystemMembership>;\n\nexport type CreateDesignSystemMembership = DbCreateInputOmit<DesignSystemMembership>;\nexport type UpdateDesignSystemMembership = OmitStrict<\n DbUpdate<DesignSystemMembership>,\n \"designSystemId\" | \"userId\" | \"workspaceMembershipId\"\n>;\n\nexport const DesignSystemMembers = z.object({\n members: DesignSystemMembership.array(),\n invitations: DesignSystemInvitation.array(),\n});\n\nexport const DesignSystemPendingMemberInvitation = z.object({\n inviteId: z.string(),\n\n /**\n * Role that the user will have in the design system, undefined\n * if it should be inherited from the workspace\n */\n designSystemRole: DesignSystemRole.optional(),\n});\n\nexport const DesignSystemUserInvitation = z.object({\n userId: z.string(),\n\n /**\n * Role that the user will have in the design system, undefined\n * if it should be inherited from the workspace\n */\n designSystemRole: DesignSystemRole.optional(),\n});\n\nexport const DesignSystemInvite = z.object({\n email: z.string(),\n workspaceRole: WorkspaceRoleSchema,\n\n /**\n * Role that the user will have in the design system, undefined\n * if it should be inherited from the workspace\n */\n designSystemRole: DesignSystemRole.optional(),\n});\n\nexport const DesignSystemMemberUpdate = z.object({\n userId: z.string(),\n designSystemRole: DesignSystemRole.nullable(),\n});\n\nexport const DesignSystemInviteUpdate = z.object({\n /**\n * Workspace invitation id\n */\n inviteId: z.string(),\n designSystemRole: DesignSystemRole.nullable(),\n});\n\nexport const DesignSystemMembershipUpdates = z.object({\n usersToInvite: DesignSystemUserInvitation.array().optional(),\n invitesToInvite: DesignSystemPendingMemberInvitation.array().optional(),\n emailsToInvite: DesignSystemInvite.array().optional(),\n\n usersToUpdate: DesignSystemMemberUpdate.array().optional(),\n invitesToUpdate: DesignSystemInviteUpdate.array().optional(),\n\n removeUserIds: z.string().array().optional(),\n deleteInvitationIds: z.string().array().optional(),\n});\n\nexport type DesignSystemMembers = z.infer<typeof DesignSystemMembers>;\nexport type DesignSystemInvite = z.infer<typeof DesignSystemInvite>;\nexport type DesignSystemMemberUpdate = z.infer<typeof DesignSystemMemberUpdate>;\nexport type DesignSystemInviteUpdate = z.infer<typeof DesignSystemInviteUpdate>;\nexport type DesignSystemPendingMemberInvite = z.infer<typeof DesignSystemPendingMemberInvitation>;\nexport type DesignSystemUserInvitation = z.infer<typeof DesignSystemUserInvitation>;\nexport type DesignSystemMembershipUpdates = z.infer<typeof DesignSystemMembershipUpdates>;\n","import { z } from \"zod\";\n\nexport const NpmRegistryAuthType = z.enum([\"Basic\", \"Bearer\", \"None\", \"Custom\"]);\nexport const NpmRegistryType = z.enum([\"NPMJS\", \"GitHub\", \"AzureDevOps\", \"Artifactory\", \"Custom\"]);\n\nexport const NpmRegistryBasicAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.Basic),\n username: z.string(),\n password: z.string(),\n});\n\nexport const NpmRegistryBearerAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.Bearer),\n accessToken: z.string(),\n});\n\nexport const NpmRegistryNoAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.None),\n});\n\nexport const NpmRegistrCustomAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.Custom),\n authHeaderName: z.string(),\n authHeaderValue: z.string(),\n});\n\nexport const NpmRegistryAuthConfig = z.discriminatedUnion(\"authType\", [\n NpmRegistryBasicAuthConfig,\n NpmRegistryBearerAuthConfig,\n NpmRegistryNoAuthConfig,\n NpmRegistrCustomAuthConfig,\n]);\n\nconst NpmRegistryConfigBase = z.object({\n registryType: NpmRegistryType,\n enabledScopes: z.array(z.string()),\n customRegistryUrl: z.string().optional(),\n bypassProxy: z.boolean().default(false),\n npmProxyRegistryConfigId: z.string().optional(),\n npmProxyVersion: z.number().optional(),\n});\n\nexport const NpmRegistryConfig = NpmRegistryConfigBase.and(NpmRegistryAuthConfig);\n\nexport type NpmRegistryConfig = z.infer<typeof NpmRegistryConfig>;\n","import { z } from \"zod\";\nexport const SsoProvider = z.object({\n providerId: z.string(),\n defaultAutoInviteValue: z.boolean(),\n autoInviteDomains: z.record(z.string(), z.boolean()),\n skipDocsSupernovaLogin: z.boolean(),\n areInvitesDisabled: z.boolean(),\n isTestMode: z.boolean(),\n emailDomains: z.array(z.string()),\n metadataXml: z.string().nullish(),\n});\n\nexport type SsoProvider = z.infer<typeof SsoProvider>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const WorkspaceUntypedData = z.object({\n id: z.string(),\n workspaceId: z.string(),\n value: z.unknown(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type WorkspaceUntypedData = z.infer<typeof WorkspaceUntypedData>;\n\nexport type WorkspaceUntypedDataCreate = DbCreateInputOmit<WorkspaceUntypedData>;\nexport type WorkspaceUntypedDataUpdate = OmitStrict<DbUpdate<WorkspaceUntypedData>, \"id\" | \"workspaceId\">;\n","import { z } from \"zod\";\nimport { WorkspaceRoleSchema } from \"./workspace-role\";\n\nexport const MAX_MEMBERS_COUNT = 100;\n\nexport const UserInvite = z.object({\n email: z\n .string()\n .email()\n .trim()\n .transform(value => value.toLowerCase()),\n role: WorkspaceRoleSchema,\n});\n\nexport const UserInvites = z.array(UserInvite).max(MAX_MEMBERS_COUNT);\n\nexport type UserInvite = z.infer<typeof UserInvite>;\nexport type UserInvites = z.infer<typeof UserInvites>;\n","import { z } from \"zod\";\n\nexport const WorkspaceRoleSchema = z.enum([\"Owner\", \"Admin\", \"Creator\", \"Viewer\", \"Billing\", \"Guest\", \"Contributor\"]);\n\nexport type WorkspaceRole = z.infer<typeof WorkspaceRoleSchema>;\nexport const WorkspaceRole = WorkspaceRoleSchema.enum;\n","import { z } from \"zod\";\nimport { SsoProvider } from \"./sso-provider\";\nimport { WorkspaceIpSettings, WorkspaceProfileUpdate } from \"./workspace\";\nimport { NpmRegistryConfig } from \"./npm-registry-settings\";\n\nexport const WorkspaceConfigurationUpdate = z.object({\n id: z.string(),\n ipWhitelist: WorkspaceIpSettings.optional(),\n sso: SsoProvider.optional(),\n npmRegistrySettings: NpmRegistryConfig.optional(),\n profile: WorkspaceProfileUpdate.optional(),\n});\n\nexport type WorkspaceConfigurationUpdate = z.infer<typeof WorkspaceConfigurationUpdate>;\n","import IPCIDR from \"ip-cidr\";\nimport { z } from \"zod\";\nimport { BillingDetails, Subscription } from \"../billing\";\nimport { DesignSystem } from \"../dsm\";\nimport { DbCreateInputOmit, DbUpdateInputOmit, nullishToOptional } from \"../helpers\";\nimport { NpmRegistryConfig } from \"./npm-registry-settings\";\nimport { SsoProvider } from \"./sso-provider\";\n\nconst isValidCIDR = (value: string) => {\n return IPCIDR.isValidAddress(value);\n};\n\nexport const WorkspaceIpWhitelistEntry = z.object({\n isEnabled: z.boolean(),\n name: z.string(),\n range: z.string().refine(isValidCIDR, {\n message: \"Invalid IP CIDR\",\n }),\n});\n\nexport const WorkspaceIpSettings = z.object({\n isEnabledForCloud: z.boolean(),\n isEnabledForDocs: z.boolean(),\n entries: z.array(WorkspaceIpWhitelistEntry),\n});\n\nexport const WorkspaceProfile = z.object({\n name: z.string(),\n handle: z.string(),\n color: z.string(),\n avatar: nullishToOptional(z.string()),\n billingDetails: nullishToOptional(BillingDetails),\n});\n\nexport const WorkspaceProfileUpdate = WorkspaceProfile.omit({\n avatar: true,\n});\n\nexport type WorkspaceProfileUpdate = z.infer<typeof WorkspaceProfileUpdate>;\n\nexport const Workspace = z.object({\n id: z.string(),\n profile: WorkspaceProfile,\n subscription: Subscription,\n ipWhitelist: nullishToOptional(WorkspaceIpSettings),\n sso: nullishToOptional(SsoProvider),\n npmRegistrySettings: nullishToOptional(NpmRegistryConfig),\n});\n\nexport const WorkspaceWithDesignSystems = z.object({\n workspace: Workspace,\n designSystems: z.array(DesignSystem),\n});\n\nexport type CreateWorkspaceDbInput = DbCreateInputOmit<Workspace>;\nexport type UpdateWorkspaceDbInput = DbUpdateInputOmit<Workspace>;\n\nexport type WorkspaceIpWhitelistEntry = z.infer<typeof WorkspaceIpWhitelistEntry>;\nexport type WorkspaceIpSettings = z.infer<typeof WorkspaceIpSettings>;\nexport type WorkspaceProfile = z.infer<typeof WorkspaceProfile>;\nexport type Workspace = z.infer<typeof Workspace>;\nexport type WorkspaceWithDesignSystems = z.infer<typeof WorkspaceWithDesignSystems>;\n","import { z } from \"zod\";\nimport { ProductCodeSchema } from \"../billing\";\nimport { WorkspaceIpSettings } from \"./workspace\";\nimport { nullishToOptional } from \"../helpers\";\n\nexport const WorkspaceContext = z.object({\n workspaceId: z.string(),\n product: ProductCodeSchema,\n ipWhitelist: nullishToOptional(WorkspaceIpSettings),\n publicDesignSystem: z.boolean().optional(),\n});\n\nexport type WorkspaceContext = z.infer<typeof WorkspaceContext>;\n","import { z } from \"zod\";\nimport { UserInvites } from \"./user-invite\";\nimport { BillingIntervalSchema, CardSchema, InternalStatusSchema, ProductCodeSchema } from \"../billing\";\nimport { slugRegex } from \"../utils/validation\";\nimport { SsoProvider } from \"./sso-provider\";\nimport { NpmRegistryConfig } from \"./npm-registry-settings\";\nimport { WorkspaceIpSettings } from \"./workspace\";\n\nconst WORKSPACE_NAME_MIN_LENGTH: number = 2;\nconst WORKSPACE_NAME_MAX_LENGTH: number = 64;\nexport const HANDLE_MIN_LENGTH = 2;\nexport const HANDLE_MAX_LENGTH = 64;\n\nexport const CreateWorkspaceInput = z.object({\n name: z.string().min(WORKSPACE_NAME_MIN_LENGTH).max(WORKSPACE_NAME_MAX_LENGTH).trim(),\n handle: z\n .string()\n .regex(slugRegex)\n .min(HANDLE_MIN_LENGTH)\n .max(HANDLE_MAX_LENGTH)\n .refine(value => value?.length > 0)\n .optional(),\n});\n\nexport type CreateWorkspaceInput = z.infer<typeof CreateWorkspaceInput>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\nimport { WorkspaceRole } from \"./workspace-role\";\n\nexport const WorkspaceInvitation = z.object({\n id: z.string(),\n email: z.string().email(),\n createdAt: z.coerce.date(),\n resentAt: z.coerce.date().nullish(),\n role: z.nativeEnum(WorkspaceRole),\n workspaceId: z.string(),\n invitedBy: z.string(),\n});\n\nexport type WorkspaceInvitation = z.infer<typeof WorkspaceInvitation>;\n\nexport type CreateWorkspaceInvitation = DbCreateInputOmit<WorkspaceInvitation>;\nexport type UpdateWorkspaceInvitation = OmitStrict<\n DbUpdate<WorkspaceInvitation>,\n \"email\" | \"invitedBy\" | \"workspaceId\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { UserNotificationSettings } from \"../users\";\nimport { OmitStrict } from \"../utils\";\nimport { WorkspaceRole } from \"./workspace-role\";\n\nexport const WorkspaceMembership = z.object({\n id: z.string(),\n userId: z.string(),\n workspaceId: z.string(),\n workspaceRole: z.nativeEnum(WorkspaceRole),\n notificationSettings: UserNotificationSettings,\n isPrimaryOwner: z.boolean().nullish(),\n});\n\nexport type WorkspaceMembership = z.infer<typeof WorkspaceMembership>;\n\nexport type CreateWorkspaceMembership = DbCreateInputOmit<WorkspaceMembership>;\nexport type UpdateWorkspaceMembership = OmitStrict<DbUpdate<WorkspaceMembership>, \"userId\" | \"workspaceId\">;\n\nexport const UpdateMembershipRolesInput = z.object({\n members: z.array(\n z.object({\n userId: z.string(),\n role: z.nativeEnum(WorkspaceRole),\n isPrimaryOwner: z.boolean().optional(),\n })\n ),\n});\n\nexport type UpdateMembershipRolesInput = z.infer<typeof UpdateMembershipRolesInput>;\n","import { z } from \"zod\";\n\nexport const IntegrationAuthType = z.union([z.literal(\"OAuth2\"), z.literal(\"PAT\")]);\n\nexport type IntegrationAuthType = z.infer<typeof IntegrationAuthType>;\n\nexport const ExternalServiceType = z.union([\n z.literal(\"figma\"),\n z.literal(\"github\"),\n z.literal(\"azure\"),\n z.literal(\"gitlab\"),\n z.literal(\"bitbucket\"),\n]);\n\nexport type ExternalServiceType = z.infer<typeof ExternalServiceType>;\n\nexport const IntegrationUserInfo = z.object({\n id: z.string(),\n handle: z.string().optional(),\n avatarUrl: z.string().optional(),\n email: z.string().optional(),\n authType: IntegrationAuthType.optional(),\n customUrl: z.string().optional(),\n});\n\nexport type IntegrationUserInfo = z.infer<typeof IntegrationUserInfo>;\n\nexport const UserLinkedIntegrations = z.object({\n figma: IntegrationUserInfo.optional(),\n github: IntegrationUserInfo.array().optional(),\n azure: IntegrationUserInfo.array().optional(),\n gitlab: IntegrationUserInfo.array().optional(),\n bitbucket: IntegrationUserInfo.array().optional(),\n});\n\nexport type UserLinkedIntegrations = z.infer<typeof UserLinkedIntegrations>;\n","import { z } from \"zod\";\n\nexport const UserAnalyticsCleanupSchedule = z.object({\n userId: z.string(),\n createdAt: z.coerce.date(),\n deleteAt: z.coerce.date(),\n});\n\nexport type UserAnalyticsCleanupSchedule = z.infer<typeof UserAnalyticsCleanupSchedule>;\n\nexport const UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({\n createdAt: true,\n});\n\nexport type UserAnalyticsCleanupScheduleDbInput = z.infer<typeof UserAnalyticsCleanupScheduleDbInput>;\n","import { z } from \"zod\";\n\nexport const UserIdentity = z.object({\n id: z.string(),\n userId: z.string(),\n});\n\nexport type UserIdentity = z.infer<typeof UserIdentity>;\n","import { z } from \"zod\";\n\nexport const UserMinified = z.object({\n id: z.string(),\n name: z.string(),\n email: z.string(),\n avatar: z.string().optional(),\n});\n\nexport type UserMinified = z.infer<typeof UserMinified>;\n","import { z } from \"zod\";\n\nexport const LiveblocksNotificationSettings = z.object({\n sendCommentNotificationEmails: z.boolean(),\n});\nexport type LiveblocksNotificationSettings = z.infer<typeof LiveblocksNotificationSettings>;\n\nexport const UserNotificationSettings = z.object({\n liveblocksNotificationSettings: LiveblocksNotificationSettings,\n});\n\nexport type UserNotificationSettings = z.infer<typeof UserNotificationSettings>;\n\nexport const defaultNotificationSettings: UserNotificationSettings = {\n liveblocksNotificationSettings: {\n sendCommentNotificationEmails: true,\n }\n} as const;\n","import { z } from \"zod\";\n\nexport const UserOnboardingDepartment = z.enum([\"Design\", \"Engineering\", \"Product\", \"Brand\", \"Other\"]);\nexport const UserOnboardingJobLevel = z.enum([\"Executive\", \"Manager\", \"IndividualContributor\", \"Other\"]);\n\nexport const UserTheme = z.object({\n preset: z\n .enum([\n \"Custom\",\n \"Default\",\n \"HighContrast\",\n \"DefaultDark\",\n \"HighContrastDark\",\n \"SpaceBlue\",\n \"DarkGrey\",\n \"SystemPreference\",\n \"Sepia\",\n ])\n .optional(),\n backgroundColor: z.string().optional(),\n accentColor: z.string().optional(),\n contrast: z.number().min(16).max(100).optional(),\n isSecondaryEnabled: z.boolean().optional(),\n secondaryBackgroundColor: z.string().optional(),\n secondaryContrast: z.number().min(16).max(100).optional(),\n isEditorWhite: z.boolean().optional(),\n});\n\nexport const UserOnboarding = z.object({\n companyName: z.string().optional(),\n numberOfPeopleInOrg: z.string().optional(),\n numberOfPeopleInDesignTeam: z.string().optional(),\n department: UserOnboardingDepartment.optional(),\n jobTitle: z.string().optional(),\n phase: z.string().optional(),\n jobLevel: UserOnboardingJobLevel.optional(),\n designSystemName: z.string().optional(),\n defaultDestination: z.string().optional(),\n figmaUrl: z.string().optional(),\n isPageDraftOnboardingFinished: z.boolean().optional(),\n isApprovalsOnboardingFinished: z.boolean().optional(),\n});\n\nexport const UserProfile = z.object({\n name: z.string(),\n avatar: z.string().optional(),\n nickname: z.string().optional(),\n onboarding: UserOnboarding.optional(),\n theme: UserTheme.optional(),\n});\n\nexport type UserOnboardingDepartment = z.infer<typeof UserOnboardingDepartment>;\nexport type UserOnboardingJobLevel = z.infer<typeof UserOnboardingJobLevel>;\nexport type UserOnboarding = z.infer<typeof UserOnboarding>;\nexport type UserTheme = z.infer<typeof UserTheme>;\nexport type UserProfile = z.infer<typeof UserProfile>;\n\n//\n// TO DELETE\n//\n\nexport const UserProfileUpdate = UserProfile.partial().omit({\n avatar: true,\n});\n\nexport type UserProfileUpdate = z.infer<typeof UserProfileUpdate>;\n","import { z } from \"zod\";\n\nexport const UserTest = z.object({\n id: z.string(),\n email: z.string(),\n});\n\nexport type UserTest = z.infer<typeof UserTest>;\n","import { z } from \"zod\";\nimport { UserProfile } from \"./user-profile\";\n\nexport const UserSource = z.enum([\"SignUp\", \"Invite\", \"SSO\"]);\n\nexport const User = z.object({\n id: z.string(),\n email: z.string(),\n createdAt: z.coerce.date(),\n profile: UserProfile,\n loggedOutAt: z.coerce.date().optional(),\n isProtected: z.boolean(),\n source: UserSource.optional(),\n});\n\nexport type UserSource = z.infer<typeof UserSource>;\nexport type User = z.infer<typeof User>;\n","import { z } from \"zod\";\nimport { WorkspaceRole } from \"../../workspace\";\nimport { SupernovaException } from \"../../utils\";\n\nexport const DesignSystemRole = z.enum([\n WorkspaceRole.Admin,\n WorkspaceRole.Contributor,\n WorkspaceRole.Creator,\n WorkspaceRole.Viewer,\n]);\nexport type DesignSystemRole = z.infer<typeof DesignSystemRole>;\n\nexport function workspaceRoleToDesignSystemRole(role: WorkspaceRole): DesignSystemRole {\n switch (role) {\n case \"Owner\":\n case \"Admin\":\n return \"Admin\";\n case \"Creator\":\n return \"Creator\";\n case \"Contributor\":\n return \"Contributor\";\n case \"Billing\":\n case \"Viewer\":\n return \"Viewer\";\n case \"Guest\":\n throw SupernovaException.shouldNotHappen(`Illegal role ${role}`);\n }\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { WorkspaceRoleSchema } from \"../../workspace\";\nimport { DesignSystemRole } from \"./ds-role\";\n\nexport const DesignSystemInvitation = z.object({\n id: z.string(),\n designSystemId: z.string(),\n workspaceInvitationId: z.string(),\n designSystemRole: DesignSystemRole.optional(),\n workspaceRole: WorkspaceRoleSchema,\n});\n\nexport type DesignSystemInvitation = z.infer<typeof DesignSystemInvitation>;\n\nexport type CreateDesignSystemInvitation = DbCreateInputOmit<DesignSystemInvitation>;\nexport type UpdateDesignSystemInvitation = OmitStrict<\n DbUpdate<DesignSystemInvitation>,\n \"designSystemId\" | \"workspaceInvitationId\"\n>;\n","import { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { z } from \"zod\";\n\nexport const ElementViewBaseColumnType = z.enum([\"Name\", \"Description\", \"Value\", \"UpdatedAt\"]);\n\nexport const ElementViewColumnType = z.union([\n z.literal(\"BaseProperty\"),\n z.literal(\"PropertyDefinition\"),\n z.literal(\"Theme\"),\n]);\n\nexport const ElementViewColumnSharedAttributes = z.object({\n id: z.string(),\n persistentId: z.string(),\n elementDataViewId: z.string(),\n sortPosition: z.number(),\n width: z.number(),\n});\n\nexport const ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({\n type: z.literal(\"BaseProperty\"),\n basePropertyType: ElementViewBaseColumnType,\n});\n\nexport const ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({\n type: z.literal(\"PropertyDefinition\"),\n propertyDefinitionId: z.string(),\n});\n\nexport const ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({\n type: z.literal(\"Theme\"),\n themeId: z.string(),\n});\n\nexport const ElementViewColumn = z.discriminatedUnion(\"type\", [\n ElementViewBasePropertyColumn,\n ElementViewPropertyDefinitionColumn,\n ElementViewThemeColumn,\n]);\n\nexport type ElementViewBaseColumnType = z.infer<typeof ElementViewBaseColumnType>;\nexport type ElementViewBasePropertyColumn = z.infer<typeof ElementViewBasePropertyColumn>;\nexport type ElementViewPropertyDefinitionColumn = z.infer<typeof ElementViewPropertyDefinitionColumn>;\nexport type ElementViewThemeColumn = z.infer<typeof ElementViewThemeColumn>;\nexport type ElementViewColumn = z.infer<typeof ElementViewColumn>;\nexport type ElementViewColumnSharedAttributes = z.infer<typeof ElementViewColumnSharedAttributes>;\nexport type ElementViewColumnType = z.infer<typeof ElementViewColumn>[\"type\"];\n\nexport type CreateElementViewColumn =\n | DbCreateInputOmit<ElementViewBasePropertyColumn>\n | DbCreateInputOmit<ElementViewPropertyDefinitionColumn>\n | DbCreateInputOmit<ElementViewThemeColumn>;\n\nexport type UpdateElementViewColumn =\n | OmitStrict<DbUpdate<ElementViewBasePropertyColumn>, \"elementDataViewId\">\n | OmitStrict<DbUpdate<ElementViewPropertyDefinitionColumn>, \"elementDataViewId\">\n | OmitStrict<DbUpdate<ElementViewThemeColumn>, \"elementDataViewId\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { ElementPropertyTargetType } from \"../properties\";\n\nexport const ElementView = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n name: z.string(),\n description: z.string(),\n targetElementType: ElementPropertyTargetType,\n isDefault: z.boolean(),\n});\n\nexport type ElementView = z.infer<typeof ElementView>;\n\nexport type CreateElementView = DbCreateInputOmit<ElementView>;\nexport type UpdateElementView = OmitStrict<DbUpdate<ElementView>, \"designSystemVersionId\" | \"targetElementType\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../helpers\";\n\nexport const Brand = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n name: z.string(),\n description: z.string(),\n});\n\nexport type Brand = z.infer<typeof Brand>;\nexport type CreateBrand = DbCreateInputOmit<Brand>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\n//\n// Enums\n//\n\nexport const DesignSystemAccessMode = z.enum([\"Open\", \"InviteOnly\"]);\nexport type DesignSystemAccessMode = z.infer<typeof DesignSystemAccessMode>;\n\n//\n// Model\n//\n\nexport const DesignSystemSwitcher = z.object({\n isEnabled: z.boolean(),\n designSystemIds: z.array(z.string()),\n});\n\nexport const DesignSystem = z.object({\n id: z.string(),\n workspaceId: z.string(),\n name: z.string(),\n description: z.string(),\n docExporterId: nullishToOptional(z.string()),\n docSlug: z.string(),\n docUserSlug: nullishToOptional(z.string()),\n docSlugDeprecated: z.string(),\n isMultibrand: z.boolean(),\n docViewUrl: nullishToOptional(z.string()),\n basePrefixes: z.array(z.string()),\n designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),\n isApprovalFeatureEnabled: z.boolean(),\n approvalRequiredForPublishing: z.boolean(),\n accessMode: DesignSystemAccessMode,\n membersGenerated: z.boolean(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DesignSystemSwitcher = z.infer<typeof DesignSystemSwitcher>;\nexport type DesignSystem = z.infer<typeof DesignSystem>;\n\nexport type CreateDesignSystem = DbCreateInputOmit<DesignSystem>;\nexport type UpdateDesignSystem = OmitStrict<DbUpdate<DesignSystem>, \"workspaceId\" | \"docSlug\" | \"docSlugDeprecated\">;\n","import { z } from \"zod\";\nimport { ColorTokenData, PageBlockAsset, TypographyTokenData } from \"./elements\";\n\nexport const ExporterPropertyImageValue = z.object({\n asset: PageBlockAsset.optional(),\n assetId: z.string().optional(),\n assetUrl: z.string().optional(),\n});\n\nexport const ExporterConfigurationPropertyValue = z.object({\n key: z.string(),\n value: z.union([\n z.number(),\n z.string(),\n z.boolean(),\n ExporterPropertyImageValue,\n ColorTokenData,\n TypographyTokenData,\n ]),\n});\n\nexport const ExporterPropertyValuesCollection = z.object({\n id: z.string(),\n designSystemId: z.string(),\n exporterId: z.string(),\n values: z.array(ExporterConfigurationPropertyValue),\n});\n\nexport type ExporterPropertyImageValue = z.infer<typeof ExporterPropertyImageValue>;\nexport type ExporterConfigurationPropertyValue = z.infer<typeof ExporterConfigurationPropertyValue>;\nexport type ExporterPropertyValuesCollection = z.infer<typeof ExporterPropertyValuesCollection>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, nullishToOptional } from \"../helpers\";\n\nexport const PublishedDocPageVisitsEntry = z.object({\n id: z.string(),\n versionId: z.string(),\n pagePersistentId: z.string(),\n locale: z.string().optional(),\n timestamp: z.coerce.date(),\n visits: z.number(),\n userId: nullishToOptional(z.string()),\n anonymousId: nullishToOptional(z.string()),\n});\n\nexport type PublishedDocPageVisitsEntry = z.infer<typeof PublishedDocPageVisitsEntry>;\n\nexport type CreatePublishedDocPageVisitsEntry = DbCreateInputOmit<PublishedDocPageVisitsEntry>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const SHORT_PERSISTENT_ID_LENGTH = 8;\n\nexport function tryParseShortPersistentId(url = \"/\") {\n const lastUrlPart = url.split(\"/\").pop() || \"\";\n const shortPersistentId = lastUrlPart.split(\"-\").pop()?.replaceAll(\".html\", \"\") || null;\n\n return shortPersistentId?.length === SHORT_PERSISTENT_ID_LENGTH ? shortPersistentId : null;\n}\n\nexport const PublishedDocPage = z.object({\n id: z.string(),\n publishedDocId: z.string(),\n pageShortPersistentId: z.string(),\n pagePersistentId: z.string().optional(),\n pathV1: z.string(),\n pathV2: z.string(),\n storagePath: z.string(),\n locale: z.string().optional(),\n\n isPrivate: z.boolean(),\n isHidden: z.boolean(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type PublishedDocPage = z.infer<typeof PublishedDocPage>;\n\nexport type CreatePublishedDocPage = DbCreateInputOmit<PublishedDocPage> & {\n pagePersistentId: string;\n};\n\nexport type UpdatePublishedDocPage = DbUpdate<OmitStrict<PublishedDocPage, \"pageShortPersistentId\" | \"publishedDocId\">>;\n","import { z } from \"zod\";\n\nexport const publishedDocEnvironments = [\"Live\", \"Preview\"] as const;\nexport const PublishedDocEnvironment = z.enum(publishedDocEnvironments);\n\nexport const PublishedDocsChecksums = z.record(z.string());\n\nexport const PublishedDocRoutingVersion = z.enum([\"1\", \"2\"]);\n\nexport const PublishedDoc = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n lastPublishedAt: z.coerce.date(),\n isDefault: z.boolean(),\n isPublic: z.boolean(),\n environment: PublishedDocEnvironment,\n checksums: PublishedDocsChecksums,\n storagePath: z.string(),\n wasMigrated: z.boolean(),\n routingVersion: PublishedDocRoutingVersion,\n usesLocalizations: z.boolean(),\n wasPublishedWithLocalizations: z.boolean(),\n tokenCount: z.number(),\n assetCount: z.number(),\n});\n\nexport type PublishedDocEnvironment = z.infer<typeof PublishedDocEnvironment>;\nexport type PublishedDocsChecksums = z.infer<typeof PublishedDocsChecksums>;\nexport type PublishedDocRoutingVersion = z.infer<typeof PublishedDocRoutingVersion>;\nexport type PublishedDoc = z.infer<typeof PublishedDoc>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const StorybookEntryOrigin = z.object({\n id: z.string(),\n type: z.enum([\"story\", \"docs\"]),\n name: z.string(),\n title: z.string(), // Same as 'kind' for v3\n index: z.number().optional(),\n});\n\nexport const StorybookEntry = z.object({\n id: z.string(),\n storyId: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n aliases: z.array(z.string()).optional(),\n\n url: z.string(),\n isDeleted: z.boolean().optional(),\n\n origin: StorybookEntryOrigin,\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type StorybookEntry = z.infer<typeof StorybookEntry>;\nexport type StorybookEntryOrigin = z.infer<typeof StorybookEntryOrigin>;\nexport type CreateStorybookEntry = OmitStrict<DbCreateInputOmit<StorybookEntry>, \"storyId\">;\nexport type UpdateStorybookEntry = OmitStrict<\n DbUpdate<StorybookEntry>,\n \"sourceId\" | \"designSystemId\" | \"storyId\" | \"id\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const StorybookPayload = z.object({\n id: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n payload: z.any(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type StorybookPayload = z.infer<typeof StorybookPayload>;\nexport type CreateStorybookPayload = DbCreateInputOmit<StorybookPayload>;\nexport type UpdateStorybookPayload = OmitStrict<DbUpdate<StorybookPayload>, \"designSystemId\" | \"sourceId\" | \"id\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const DesignSystemVersion = z.object({\n id: z.string(),\n version: z.string(),\n createdAt: z.coerce.date(),\n designSystemId: z.string(),\n name: z.string(),\n comment: z.string(),\n isReadonly: z.boolean(),\n changeLog: z.string(),\n parentId: z.string().optional(),\n isDraftsFeatureAdopted: z.boolean(),\n});\n\nexport type DesignSystemVersion = z.infer<typeof DesignSystemVersion>;\n\nexport type CreateDesignSystemVersion = DbCreateInputOmit<DesignSystemVersion>;\n\nexport type UpdateDesignSystemVersion = OmitStrict<\n DbUpdate<DesignSystemVersion>,\n \"designSystemId\" | \"isReadonly\" | \"version\" | \"parentId\"\n>;\n\n// Jobs\nexport const VersionCreationJobStatus = z.enum([\"Success\", \"InProgress\", \"Error\"]);\n\nexport type VersionCreationJobStatus = z.infer<typeof VersionCreationJobStatus>;\n\nexport const VersionCreationJob = z.object({\n id: z.string(),\n version: z.string(),\n designSystemId: z.string(),\n designSystemVersionId: nullishToOptional(z.string()),\n status: VersionCreationJobStatus,\n errorMessage: nullishToOptional(z.string()),\n});\n\nexport type VersionCreationJob = z.infer<typeof VersionCreationJob>;\n","import { z } from \"zod\";\nimport { CustomDomain } from \"../custom-domains\";\nimport { Asset } from \"../dsm/assets/asset\";\nimport { DataSource } from \"../dsm/data-sources/data-source\";\nimport { DesignSystem } from \"../dsm/design-system\";\nimport { DesignSystemVersionDump } from \"./design-system-version-dump\";\n\nexport const DesignSystemDump = z.object({\n designSystem: DesignSystem,\n dataSources: DataSource.array(),\n versions: DesignSystemVersionDump.array(),\n customDomain: CustomDomain.optional(),\n files: Asset.array(),\n});\n\nexport type DesignSystemDump = z.infer<typeof DesignSystemDump>;\n","import { z } from \"zod\";\nimport { AssetReference } from \"../dsm/assets/asset-reference\";\nimport { Brand } from \"../dsm/brand\";\nimport { DocumentationPageContent } from \"../dsm/documentation/page-content\";\nimport { DocumentationComment, DocumentationCommentThread } from \"../dsm/documentation/thread\";\nimport { DesignElement } from \"../dsm/elements/raw-element\";\nimport { ElementPropertyDefinition } from \"../dsm/properties/property-definition\";\nimport { ElementPropertyValue } from \"../dsm/properties/property-value\";\nimport { DesignSystemVersion } from \"../dsm/version\";\nimport { ElementViewColumn } from \"../dsm/views/column\";\nimport { ElementView } from \"../dsm/views/view\";\nimport { DocumentationPageRoom } from \"../liveblocks\";\nimport { PublishedDocsDump } from \"./published-docs-dump\";\n\nexport const DocumentationThreadDump = z.object({\n thread: DocumentationCommentThread,\n comments: DocumentationComment.array(),\n});\n\nexport const DocumentationPageRoomDump = z.object({\n room: DocumentationPageRoom,\n threads: DocumentationThreadDump.array(),\n});\n\nexport const DesignSystemVersionMultiplayerDump = z.object({\n documentationPages: DocumentationPageRoomDump.array(),\n});\n\nexport const DesignSystemVersionDump = z.object({\n version: DesignSystemVersion,\n brands: Brand.array(),\n elements: DesignElement.array(),\n elementPropertyDefinitions: ElementPropertyDefinition.array(),\n elementPropertyValues: ElementPropertyValue.array(),\n elementViews: ElementView.array(),\n elementColumns: ElementViewColumn.array(),\n documentationPageContents: DocumentationPageContent.array(),\n documentationPageRooms: DocumentationPageRoomDump.array(),\n publishedDocumentations: PublishedDocsDump.array(),\n assetReferences: AssetReference.array(),\n});\n\nexport type DocumentationThreadDump = z.infer<typeof DocumentationThreadDump>;\nexport type DocumentationPageRoomDump = z.infer<typeof DocumentationPageRoomDump>;\nexport type DesignSystemVersionDump = z.infer<typeof DesignSystemVersionDump>;\n","import { z } from \"zod\";\nimport { Entity } from \"../../common/entity\";\nimport { DocumentationPageApproval, DocumentationPageSnapshot, ElementGroupSnapshot } from \"../../dsm\";\nimport { DocumentationPageV2 } from \"../../dsm/elements/documentation-page-v2\";\nimport { ElementGroup } from \"../../dsm/elements/group\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\n\n//\n// Room\n//\n\nexport const DesignSystemVersionRoom = Entity.extend({\n designSystemVersionId: z.string(),\n liveblocksId: z.string(),\n});\n\nexport type DesignSystemVersionRoom = z.infer<typeof DesignSystemVersionRoom>;\n\nexport type CreateDesignSystemVersionRoom = DbCreateInputOmit<DesignSystemVersionRoom>;\nexport type UpdateDesignSystemVersionRoom = DbUpdate<DesignSystemVersionRoom>;\n\n//\n// Room state\n//\n\nexport const DesignSystemVersionRoomInternalSettings = z.object({\n routingVersion: z.string(),\n isDraftFeatureAdopted: z.boolean(),\n isApprovalFeatureEnabled: z.boolean(),\n approvalRequiredForPublishing: z.boolean(),\n});\n\nexport const DesignSystemVersionRoomInitialState = z.object({\n pages: z.array(DocumentationPageV2),\n groups: z.array(ElementGroup),\n\n pageSnapshots: z.array(DocumentationPageSnapshot),\n groupSnapshots: z.array(ElementGroupSnapshot),\n\n pageApprovals: z.array(DocumentationPageApproval),\n internalSettings: DesignSystemVersionRoomInternalSettings,\n\n pageHashes: z.record(z.string()).optional(),\n});\n\nexport const DesignSystemVersionRoomUpdate = z.object({\n pages: z.array(DocumentationPageV2),\n groups: z.array(ElementGroup),\n pageIdsToDelete: z.array(z.string()),\n groupIdsToDelete: z.array(z.string()),\n\n pageSnapshots: z.array(DocumentationPageSnapshot),\n groupSnapshots: z.array(ElementGroupSnapshot),\n pageSnapshotIdsToDelete: z.array(z.string()),\n groupSnapshotIdsToDelete: z.array(z.string()),\n pageHashesToUpdate: z.record(z.string(), z.string()),\n\n pageApprovals: z.array(DocumentationPageApproval),\n pageApprovalIdsToDelete: z.array(z.string()),\n executedTransactionIds: z.array(z.string()),\n});\n\nexport type DesignSystemVersionRoomInternalSettings = z.infer<typeof DesignSystemVersionRoomInternalSettings>;\nexport type DesignSystemVersionRoomInitialState = z.infer<typeof DesignSystemVersionRoomInitialState>;\nexport type DesignSystemVersionRoomUpdate = z.infer<typeof DesignSystemVersionRoomUpdate>;\n","import { z } from \"zod\";\nimport { Entity } from \"../../common/entity\";\nimport { DocumentationPageContentData } from \"../../dsm\";\nimport { PageBlockDefinition } from \"../../dsm/documentation/block-definitions/definition\";\nimport { PageSectionEditorModelV2 } from \"../../dsm/elements/data/documentation-section-v2\";\nimport { DocumentationItemConfigurationV2 } from \"../../dsm/elements/data/documentation-v2\";\nimport { DocumentationPageV2 } from \"../../dsm/elements/documentation-page-v2\";\nimport { ElementGroup } from \"../../dsm/elements/group\";\nimport { PageBlockEditorModelV2 } from \"../../dsm/elements/page-block-v2\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const DocumentationPageRoom = Entity.extend({\n designSystemVersionId: z.string(),\n documentationPageId: z.string(),\n liveblocksId: z.string(),\n isDirty: z.boolean(),\n});\n\nexport type DocumentationPageRoom = z.infer<typeof DocumentationPageRoom>;\n\nexport type CreateDocumentationPageRoom = DbCreateInputOmit<DocumentationPageRoom>;\nexport type UpdateDocumentationPageRoom = OmitStrict<\n DbUpdate<DocumentationPageRoom>,\n \"designSystemVersionId\" | \"documentationPageId\" | \"liveblocksId\"\n>;\n\n//\n// Room content\n//\n\nexport const DocumentationPageRoomState = z.object({\n pageItems: z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),\n});\n\nexport const DocumentationPageRoomRoomUpdate = z.object({\n page: DocumentationPageV2,\n pageParent: ElementGroup,\n});\n\nexport const DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({\n pageItems: z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),\n blockDefinitions: z.array(PageBlockDefinition),\n});\n\nexport const RestoredDocumentationPage = z.object({\n page: DocumentationPageV2,\n pageParent: ElementGroup,\n pageContent: DocumentationPageContentData,\n contentHash: z.string(),\n});\n\nexport const RestoredDocumentationGroup = z.object({\n group: ElementGroup,\n parent: ElementGroup,\n});\n\nexport type DocumentationPageRoomState = z.infer<typeof DocumentationPageRoomState>;\nexport type DocumentationPageRoomRoomUpdate = z.infer<typeof DocumentationPageRoomRoomUpdate>;\nexport type DocumentationPageRoomInitialStateUpdate = z.infer<typeof DocumentationPageRoomInitialStateUpdate>;\nexport type RestoredDocumentationPage = z.infer<typeof RestoredDocumentationPage>;\nexport type RestoredDocumentationGroup = z.infer<typeof RestoredDocumentationGroup>;\n","import { z } from \"zod\";\n\nexport enum RoomTypeEnum {\n DocumentationPageOld = \"documentation-page\",\n DocumentationPage = \"doc-page\",\n DesignSystemVersion = \"design-system-version\",\n Workspace = \"workspace\",\n}\n\nexport const RoomTypeSchema = z.nativeEnum(RoomTypeEnum);\n\nexport type RoomType = z.infer<typeof RoomTypeSchema>;\nexport const RoomType = RoomTypeSchema.enum;\n\n//\n// Room owners\n//\n\nexport type WorkspaceRoomOwner = {\n type: \"Workspace\";\n workspaceId: string;\n};\n\nexport type VersionRoomOwner = {\n type: \"DesignSystemVersion\";\n workspaceId: string;\n designSystemId: string;\n designSystemVersionId: string;\n};\n\nexport type RoomOwner = WorkspaceRoomOwner | VersionRoomOwner;\n\n//\n// Room ids\n//\n\nexport type WorkspaceParsedRoomId = {\n type: RoomTypeEnum.Workspace;\n raw: string;\n};\n\nexport type DesignSystemVersionParsedRoomId = {\n type: RoomTypeEnum.DesignSystemVersion;\n raw: string;\n};\n\nexport type DocumentationPageOldParsedRoomId = {\n type: RoomTypeEnum.DocumentationPageOld;\n raw: string;\n};\n\nexport type DocumentationPageParsedRoomId = {\n type: RoomTypeEnum.DocumentationPage;\n raw: string;\n\n /**\n * Id of DS version, cannot be a wildcard (always a specific ID)\n */\n designSystemVersionId: string;\n\n /**\n * Documentation page persistent ID or wildcard `*`\n */\n pagePersistentId: string;\n};\n\nexport type ParsedRoomId =\n | WorkspaceParsedRoomId\n | DesignSystemVersionParsedRoomId\n | DocumentationPageOldParsedRoomId\n | DocumentationPageParsedRoomId;\n","//\n// Room\n//\n\nimport { z } from \"zod\";\nimport { Entity } from \"../../common/entity\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers/db\";\n\nexport const WorkspaceRoom = Entity.extend({\n workspaceId: z.string(),\n liveblocksId: z.string(),\n});\n\nexport type WorkspaceRoom = z.infer<typeof WorkspaceRoom>;\nexport type CreateWorkspaceRoom = DbCreateInputOmit<WorkspaceRoom>;\nexport type UpdateWorkspaceRoom = DbUpdate<WorkspaceRoom>;\n","import { z } from \"zod\";\nimport { PublishedDoc } from \"../dsm/published-doc\";\nimport { PublishedDocPage } from \"../dsm/published-doc-page\";\n\nexport const PublishedDocsDump = z.object({\n documentation: PublishedDoc,\n pages: PublishedDocPage.array(),\n});\n\nexport type PublishedDocsDump = z.infer<typeof PublishedDocsDump>;\n","import { z } from \"zod\";\nimport { User } from \"../users\";\nimport { WorkspaceDump } from \"./workspace-dump\";\n\nexport const UserDump = z.object({\n user: User,\n workspaces: WorkspaceDump.array(),\n});\n\nexport type UserDump = z.infer<typeof UserDump>;\n","import { z } from \"zod\";\nimport { Integration } from \"../integrations/integration\";\nimport { Workspace } from \"../workspace/workspace\";\nimport { CodeIntegrationDump } from \"./code-integration-dump\";\nimport { DesignSystemDump } from \"./design-system-dump\";\n\nexport const WorkspaceDump = z.object({\n workspace: Workspace,\n designSystems: DesignSystemDump.array(),\n codeIntegration: CodeIntegrationDump,\n integrations: Integration.array(),\n});\n\nexport type WorkspaceDump = z.infer<typeof WorkspaceDump>;\n","import { z } from \"zod\";\nimport { DbUpdate, nullishToOptional } from \"../helpers\";\nimport { UserMinified } from \"../users/user-minified\";\nimport { OmitStrict, tryParseUrl } from \"../utils\";\n\nexport const IntegrationDesignSystem = z.object({\n designSystemId: z.string(),\n brandId: z.string(),\n title: z.string().optional(),\n userId: z.string().optional(),\n date: z.coerce.date().optional(),\n});\n\nexport type IntegrationDesignSystem = z.infer<typeof IntegrationDesignSystem>;\n\nexport const IntegrationCredentialsType = z.enum([\"OAuth2\", \"PAT\"]);\nexport type IntegrationCredentialsType = z.infer<typeof IntegrationCredentialsType>;\n\nexport const IntegrationCredentialsState = z.enum([\"Active\", \"Inactive\"]);\nexport type IntegrationCredentialsState = z.infer<typeof IntegrationCredentialsState>;\n\nexport const IntegrationCredentialsProfile = z.object({\n id: nullishToOptional(z.string()),\n email: nullishToOptional(z.string()),\n handle: nullishToOptional(z.string()),\n type: nullishToOptional(z.string()),\n avatarUrl: nullishToOptional(z.string()),\n organization: nullishToOptional(z.string()),\n collection: nullishToOptional(z.string()),\n});\n\nexport type IntegrationCredentialsProfile = z.infer<typeof IntegrationCredentialsProfile>;\n\nexport const IntegrationCredentials = z.object({\n id: z.string(),\n type: IntegrationCredentialsType,\n integrationId: z.string(),\n accessToken: z.string(),\n userId: z.string(),\n createdAt: z.coerce.date(),\n refreshToken: z.string().optional(),\n tokenName: z.string().optional(),\n expiresAt: z.coerce.date().optional(),\n refreshedAt: z.coerce.date().optional(),\n username: z.string().optional(),\n appInstallationId: z.string().optional(),\n profile: IntegrationCredentialsProfile.optional(),\n customUrl: z.string().optional(),\n state: IntegrationCredentialsState,\n\n user: UserMinified.optional(),\n});\n\nexport type IntegrationCredentials = z.infer<typeof IntegrationCredentials>;\n\nexport type UpdateIntegrationCredential = OmitStrict<\n DbUpdate<IntegrationCredentials>,\n \"id\" | \"integrationId\" | \"appInstallationId\" | \"type\"\n>;\n\nexport const ExtendedIntegrationType = z.enum([\n \"Figma\",\n \"Github\",\n \"Gitlab\",\n \"Bitbucket\",\n \"Azure\",\n \"TokenStudio\",\n \"FigmaVariablesPlugin\",\n]);\nexport type ExtendedIntegrationType = z.infer<typeof ExtendedIntegrationType>;\n\nexport const IntegrationType = ExtendedIntegrationType.exclude([\"TokenStudio\", \"FigmaVariablesPlugin\"]);\nexport type IntegrationType = z.infer<typeof IntegrationType>;\n\nexport const GitIntegrationType = IntegrationType.exclude([\"Figma\"]);\nexport type GitIntegrationType = z.infer<typeof GitIntegrationType>;\n\nexport const Integration = z.object({\n id: z.string(),\n workspaceId: z.string(),\n type: IntegrationType,\n createdAt: z.coerce.date(),\n integrationCredentials: z.array(IntegrationCredentials).optional(),\n});\nexport type Integration = z.infer<typeof Integration>;\nexport type ExtendedIntegration = Omit<Integration, \"type\"> & {\n type: ExtendedIntegrationType;\n integrationDesignSystems?: IntegrationDesignSystem[];\n};\n\nexport const IntegrationToken = z\n .object({\n access_token: z.string(),\n refresh_token: z.string().optional(),\n expires_in: z.union([z.number().optional(), z.string().optional()]),\n token_type: z.string().optional(),\n token_name: z.string().optional(),\n token_azure_organization_name: z.string().optional(), // Azure Cloud PAT only\n token_azure_collection_name: z.string().optional(), // Azure Server PAT only\n token_bitbucket_username: z.string().optional(), // Bitbucket only\n custom_url: z\n .string()\n .optional()\n .transform(value => {\n if (!value?.trim()) return undefined;\n return formatCustomUrl(value);\n }),\n })\n .refine(data => {\n return !data.custom_url || tryParseUrl(data.custom_url);\n }, \"Custom URL must be a valid URL\")\n .refine(data => {\n if (data.custom_url && data.token_azure_organization_name) {\n return false;\n }\n return true;\n }, \"Custom URL and Azure organization name cannot be present at the same time\")\n .transform(data => {\n return {\n accessToken: data.access_token,\n refreshToken: data.refresh_token,\n expiresIn: typeof data.expires_in === \"string\" ? Number(data.expires_in) : data.expires_in,\n tokenType: data.token_type,\n tokenName: data.token_name,\n tokenBitbucketUsername: data.token_bitbucket_username,\n tokenAzureOrganizationName: data.token_azure_organization_name,\n tokenAzureCollection: data.token_azure_collection_name,\n customUrl: data.custom_url,\n };\n });\n\nexport type IntegrationToken = z.infer<typeof IntegrationToken>;\n\n// Custom URL validation\nconst forbiddenCustomUrlDomainList = [\"github.com\", \"gitlab.com\", \"bitbucket.org\", \"figma.com\", \"dev.azure.com\"];\n\nfunction formatCustomUrl(url: string): string | undefined {\n let formattedUrl = url.trim().toLowerCase();\n if (!formattedUrl.startsWith(\"http://\") && !formattedUrl.startsWith(\"https://\")) {\n formattedUrl = \"https://\" + formattedUrl;\n }\n if (formattedUrl.endsWith(\"/\")) {\n formattedUrl = formattedUrl.slice(0, -1);\n }\n\n // do not store default urls that we incorrectly provided as custom urls\n return forbiddenCustomUrlDomainList.some(domain => formattedUrl.includes(domain)) ? undefined : formattedUrl;\n}\n","import { z } from \"zod\";\nimport { User } from \"../users\";\n\nexport const NpmProxyToken = z.object({\n access: z.string(),\n expiresAt: z.number(),\n});\n\nexport type NpmProxyToken = z.infer<typeof NpmProxyToken>;\n\nexport const SessionData = z.object({\n returnToUrl: z.string().optional(),\n npmProxyToken: NpmProxyToken.optional(),\n});\n\nexport type SessionData = z.infer<typeof SessionData>;\n\nexport const Session = z.object({\n id: z.string(),\n expiresAt: z.coerce.date(),\n userId: z.string().nullable(),\n anonymousId: z.string().nullable(),\n data: SessionData,\n});\n\nexport type Session = z.infer<typeof Session>;\n\nexport const AuthTokens = z.object({\n access: z.string(),\n refresh: z.string(),\n});\n\nexport type AuthTokens = z.infer<typeof AuthTokens>;\n\nexport const UserSession = z.object({\n session: Session,\n user: User.nullable(),\n});\n\nexport type UserSession = z.infer<typeof UserSession>;\n","import { z } from \"zod\";\nimport { DesignSystem } from \"../dsm/design-system\";\nimport { User } from \"../users/user\";\nimport { Workspace } from \"../workspace\";\nimport { WorkspaceRoleSchema } from \"../workspace/workspace-role\";\n\n/**\n * Object describing who is going to receive the email.\n *\n * Normally recepient is just an email, however in some cases email can be tailored\n * for who receives it. In this case the email has cutomization based on the role of the\n * recepient in the workspace (or design design system).\n */\nexport const DesignSystemInviteEmailRecipient = z.object({\n email: z.string(),\n role: WorkspaceRoleSchema,\n});\n\n/**\n * Object describing the necessary data to send an email notifying a user that\n * they've been added to a design system.\n */\nexport const DesignSystemInviteEmailData = z.object({\n workspace: Workspace,\n designSystem: DesignSystem,\n invitedBy: User,\n documentationDomain: z.string().optional(),\n});\n\nexport type DesignSystemInviteEmailRecipient = z.infer<typeof DesignSystemInviteEmailRecipient>;\nexport type DesignSystemInviteEmailData = z.infer<typeof DesignSystemInviteEmailData>;\n","import { z } from \"zod\";\nimport { User } from \"../users/user\";\nimport { Workspace } from \"../workspace/workspace\";\nimport { WorkspaceRoleSchema } from \"../workspace/workspace-role\";\n\n/**\n * Object describing who is going to receive the email.\n *\n * Normally recepient is just an email, however in some cases email can be tailored\n * for who receives it. In this case the email has cutomization based on the role of the\n * recepient in the workspace.\n */\nexport const WorkspaceInviteEmailRecipient = z.object({\n email: z.string(),\n role: WorkspaceRoleSchema,\n});\n\n/**\n * Object describing the necessary data to send an email notifying a user that\n * they've been added to a workspace.\n */\nexport const WorkspaceInviteEmailData = z.object({\n workspace: Workspace,\n invitedBy: User,\n documentationDomain: z.string().optional(),\n});\n\nexport type WorkspaceInviteEmailRecipient = z.infer<typeof WorkspaceInviteEmailRecipient>;\nexport type WorkspaceInviteEmailData = z.infer<typeof WorkspaceInviteEmailData>;\n","import { z } from \"zod\";\nimport { EventDataSourceImported } from \"./data-source-imported\";\nimport { EventVersionReleased } from \"./version-released\";\nimport { EventDocumentationPublished } from \"./documentation-published\";\n\nexport const Event = z.discriminatedUnion(\"type\", [\n EventVersionReleased,\n EventDataSourceImported,\n EventDocumentationPublished,\n]);\n\nexport type Event = z.infer<typeof Event>;\n","import { z } from \"zod\";\n\nexport const EventDataSourceImported = z.object({\n type: z.literal(\"DataSourceImported\"),\n workspaceId: z.string(),\n designSystemId: z.string(),\n});\n\nexport type EventDataSourceImported = z.infer<typeof EventDataSourceImported>;\n","import { z } from \"zod\";\n\nexport const EventVersionReleased = z.object({\n type: z.literal(\"DesignSystemVersionReleased\"),\n workspaceId: z.string(),\n designSystemId: z.string(),\n versionId: z.string(),\n});\n\nexport type EventVersionReleased = z.infer<typeof EventVersionReleased>;\n","import { z } from \"zod\";\n\nexport const EventDocumentationPublished = z.object({\n type: z.literal(\"DocumentationPublished\"),\n workspaceId: z.string(),\n designSystemId: z.string(),\n versionId: z.string(),\n});\n\nexport type EventDocumentationPublished = z.infer<typeof EventDocumentationPublished>;\n","import { z } from \"zod\";\nimport { ExporterConfigurationPropertyValue, PublishedDocEnvironment } from \"../../dsm\";\nimport { ExporterPropertyValueMap } from \"../export-configuration\";\n\nexport const ExportJobDocumentationContext = z.object({\n isSingleVersionDocs: z.boolean(),\n versionSlug: z.string(),\n environment: PublishedDocEnvironment,\n});\n\nexport const ExportJobDebugContext = z.object({\n debugMode: z.boolean().optional(),\n concurrency: z.number().optional(),\n preloadData: z.string().optional(),\n concurrencyMode: z.string().optional(),\n cacheSdk: z.string().optional(),\n logSdkNetwork: z.boolean().optional(),\n profilerMode: z.string().optional(),\n});\n\nexport const ExportJobContext = z.object({\n apiUrl: z.string(),\n accessToken: z.string(),\n\n designSystemId: z.string(),\n designSystemName: z.string(),\n exporterId: z.string(),\n versionId: z.string(),\n brandId: z.string().optional(),\n themeId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n previewMode: z.boolean().optional(),\n\n exporterName: z.string(),\n\n documentation: ExportJobDocumentationContext.optional(),\n debug: ExportJobDebugContext.optional(),\n});\n\nexport const ExportJobExporterConfiguration = z.object({\n exporterPackageUrl: z.string(),\n exporterPropertyValues: ExporterConfigurationPropertyValue.array(),\n exporterPropertyValuesV2: ExporterPropertyValueMap.optional(),\n});\n\nexport type ExportJobDocumentationContext = z.infer<typeof ExportJobDocumentationContext>;\nexport type ExportJobDebugContext = z.infer<typeof ExportJobDebugContext>;\nexport type ExportJobExporterConfiguration = z.infer<typeof ExportJobExporterConfiguration>;\nexport type ExportJobContext = z.infer<typeof ExportJobContext>;\n","import { z } from \"zod\";\n\nexport const ExporterFunctionPayload = z.object({\n exportJobId: z.string(),\n exportContextId: z.string(),\n designSystemId: z.string(),\n workspaceId: z.string(),\n exporterId: z.string(),\n});\n\nexport type ExporterFunctionPayload = z.infer<typeof ExporterFunctionPayload>;\n","import { z } from \"zod\";\nimport { PublishedDocEnvironment } from \"../dsm\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { ExporterPropertyValueMap } from \"./export-configuration\";\nimport { ExportDestinationsMap } from \"./export-destinations\";\n\n//\n// Enums\n//\n\nexport const ExportJobDestinationType = z.enum([\n \"s3\",\n \"webhookUrl\",\n \"github\",\n \"documentation\",\n \"azure\",\n \"gitlab\",\n \"bitbucket\",\n]);\nexport const ExportJobStatus = z.enum([\"InProgress\", \"Success\", \"Failed\", \"Timeout\"]);\nexport const ExportJobLogEntryType = z.enum([\"success\", \"info\", \"warning\", \"error\", \"user\"]);\n\nexport type ExportJobDestinationType = z.infer<typeof ExportJobDestinationType>;\nexport type ExportJobStatus = z.infer<typeof ExportJobStatus>;\nexport type ExportJobLogEntryType = z.infer<typeof ExportJobLogEntryType>;\n\n//\n// Results\n//\n\nexport const ExportJobLogEntry = z.object({\n id: z.string().optional(),\n time: z.coerce.date(),\n type: ExportJobLogEntryType,\n message: z.string(),\n});\n\nexport const ExportJobPullRequestDestinationResult = z.object({\n pullRequestUrl: z.string(),\n});\n\nexport const ExportJobS3DestinationResult = z.object({\n bucket: z.string(),\n urlPrefix: z.string().optional(),\n path: z.string(),\n files: z.array(z.string()),\n\n url: nullishToOptional(z.string()),\n urls: nullishToOptional(z.string().array()),\n});\n\nexport const ExportJobDocsDestinationResult = z.object({\n url: z.string(),\n});\n\nexport const ExportJobResult = z.object({\n error: z.string().optional(),\n s3: nullishToOptional(ExportJobS3DestinationResult),\n github: nullishToOptional(ExportJobPullRequestDestinationResult),\n azure: nullishToOptional(ExportJobPullRequestDestinationResult),\n gitlab: nullishToOptional(ExportJobPullRequestDestinationResult),\n bitbucket: nullishToOptional(ExportJobPullRequestDestinationResult),\n sndocs: nullishToOptional(ExportJobDocsDestinationResult),\n logs: nullishToOptional(ExportJobLogEntry.array()),\n});\n\nexport type ExportJobLogEntry = z.infer<typeof ExportJobLogEntry>;\nexport type ExportJobPullRequestDestinationResult = z.infer<typeof ExportJobPullRequestDestinationResult>;\nexport type ExportJobS3DestinationResult = z.infer<typeof ExportJobS3DestinationResult>;\nexport type ExportJobDocsDestinationResult = z.infer<typeof ExportJobDocsDestinationResult>;\nexport type ExportJobResult = z.infer<typeof ExportJobResult>;\n\n//\n// Job\n//\n\nexport const ExportJob = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n finishedAt: z.coerce.date().optional(),\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n workspaceId: z.string(),\n scheduleId: z.string().nullish(),\n exporterId: z.string(),\n brandId: z.string().optional(),\n themeId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n estimatedExecutionTime: z.number().optional(),\n status: ExportJobStatus,\n result: ExportJobResult.optional(),\n createdByUserId: z.string().optional(),\n exporterPropertyValues: ExporterPropertyValueMap.optional(),\n previewMode: z.boolean().optional(),\n exportContextId: z.string().optional().nullable(),\n\n // Destinations\n ...ExportDestinationsMap.shape,\n});\n\nexport type ExportJob = z.infer<typeof ExportJob>;\n\nexport type CreateExportJob = DbCreateInputOmit<ExportJob>;\nexport type UpdateExportJob = Pick<DbUpdate<ExportJob>, \"id\" | \"status\" | \"result\" | \"finishedAt\">;\n\n//\n// Support\n//\n\nexport const ExportJobFindByFilter = ExportJob.pick({\n exporterId: true,\n designSystemVersionId: true,\n createdByUserId: true,\n status: true,\n scheduleId: true,\n designSystemId: true,\n themeId: true,\n brandId: true,\n})\n .extend({\n destinations: z.array(ExportJobDestinationType),\n docsEnvironment: PublishedDocEnvironment,\n })\n .partial();\n\nexport type ExportJobFindByFilter = z.infer<typeof ExportJobFindByFilter>;\n","import { z } from \"zod\";\n\nconst ExporterType = z.enum([\"documentation\", \"code\"]);\n\nexport const ListExporterQuery = z.object({\n limit: z.number().optional(),\n offset: z.number().optional(),\n type: ExporterType.optional(),\n search: z.string().optional(),\n});\n\nexport type ListExporterQuery = z.infer<typeof ListExporterQuery>;\n","import { z } from \"zod\";\n\nexport const ExporterWorkspaceMembershipRole = z.enum([\"Owner\", \"OwnerArchived\", \"User\"]);\nexport type ExporterWorkspaceMembershipRole = z.infer<typeof ExporterWorkspaceMembershipRole>;\n","import { z } from \"zod\";\nimport { ExporterWorkspaceMembershipRole } from \"./exporter-workspace-membership-role\";\nimport { DbCreateInputOmit } from \"../helpers\";\n\nexport const ExporterWorkspaceMembership = z.object({\n id: z.string(),\n workspaceId: z.string(),\n exporterId: z.string(),\n role: ExporterWorkspaceMembershipRole,\n});\n\nexport type ExporterWorkspaceMembership = z.infer<typeof ExporterWorkspaceMembership>;\n\nexport type CreateExporterMembership = DbCreateInputOmit<ExporterWorkspaceMembership>;\n","import { z } from \"zod\";\n\nexport const FlaggedFeature = z.enum([\n \"FigmaImporterV2\",\n \"DisableImporter\",\n \"VariablesOrder\",\n \"TypographyPropsKeepAliases\",\n \"GradientPropsKeepAliases\",\n \"ShadowPropsKeepAliases\",\n \"NonCompatibleTypeChanges\",\n \"TypographyUseFontStyle\",\n \"FigmaImporterV3\",\n\n \"PulsarDebugMode\",\n \"PulsarLogSdkNetwork\",\n \"PulsarCacheSdk\",\n \"PulsarPreloadData\",\n \"PulsarConcurrencyMode\",\n \"PulsarConcurrency\",\n \"PulsarProfilerMode\",\n]);\n\nexport const FeatureFlagMap = z.record(FlaggedFeature, z.boolean());\nexport const FeatureFlag = z.object({\n id: z.string(),\n feature: FlaggedFeature,\n createdAt: z.coerce.date(),\n enabled: z.boolean(),\n designSystemId: z.string().optional(),\n data: z.record(z.any()).nullable().optional(),\n});\n\nexport type FlaggedFeature = z.infer<typeof FlaggedFeature>;\nexport type FeatureFlagMap = z.infer<typeof FeatureFlagMap>;\nexport type FeatureFlag = z.infer<typeof FeatureFlag>;\n","import { z } from \"zod\";\nimport { OAuthProviderSchema } from \"./oauth-providers\";\n\nexport const ExternalOAuthRequest = z.object({\n id: z.string(),\n provider: OAuthProviderSchema,\n userId: z.string(),\n state: z.string(),\n createdAt: z.coerce.date(),\n});\n\nexport type ExternalOAuthRequest = z.infer<typeof ExternalOAuthRequest>;\n","import { z } from \"zod\";\n\nexport enum OAuthProviderNames {\n Figma = \"figma\",\n Azure = \"azure\",\n Github = \"github\",\n Gitlab = \"gitlab\",\n Bitbucket = \"bitbucket\",\n}\n\nexport const OAuthProviderSchema = z.nativeEnum(OAuthProviderNames);\nexport type OAuthProvider = z.infer<typeof OAuthProviderSchema>;\nexport const OAuthProvider = OAuthProviderSchema.enum;\n","import { z } from \"zod\";\n\nexport const GitObjectsQuery = z.object({\n organization: z.string().optional(), // Azure Organization | Bitbucket Workspace slug | Gitlab Group | Github Account (User or Organization)\n project: z.string().optional(), // Only for Bitbucket and Azure\n repository: z.string().optional(), // For all providers. For Gitlab, it's called \"project\".\n branch: z.string().optional(), // For all providers.\n user: z.string().optional(), // Gitlab user\n});\n\nexport type GitObjectsQuery = z.infer<typeof GitObjectsQuery>;\n\nexport const GitOrganization = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\n\nexport const GitProject = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\n\nexport const GitRepository = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n\n /**\n * Can be undefined when:\n * - there are no branches in the repository yet\n * - Git provider doesn't expose this information on a repository via their API\n */\n defaultBranch: z.string().optional(),\n});\n\nexport const GitBranch = z.object({\n name: z.string(),\n lastCommitId: z.string(),\n});\n\nexport type GitOrganization = z.infer<typeof GitOrganization>;\nexport type GitProject = z.infer<typeof GitProject>;\nexport type GitRepository = z.infer<typeof GitRepository>;\nexport type GitBranch = z.infer<typeof GitBranch>;\n","import { z } from \"zod\";\nimport { OAuthProviderSchema } from \"./oauth-providers\";\n\nexport const IntegrationTokenSchemaOld = z.object({\n id: z.string(),\n provider: OAuthProviderSchema,\n scope: z.string(),\n userId: z.string(),\n accessToken: z.string(),\n refreshToken: z.string(),\n expiresAt: z.coerce.date(),\n externalUserId: z.string().nullish(),\n});\n\n// Renamed because will be deleted later after full migration / end of project\nexport type IntegrationTokenOld = z.infer<typeof IntegrationTokenSchemaOld>;\n","import { z } from \"zod\";\nimport { OAuthProviderSchema } from \"./oauth-providers\";\n\nexport const WorkspaceOAuthRequestSchema = z.object({\n id: z.string(),\n workspaceId: z.string(),\n provider: OAuthProviderSchema,\n userId: z.string(),\n createdAt: z.coerce.date(),\n});\n\nexport type WorkspaceOAuthRequest = z.infer<typeof WorkspaceOAuthRequestSchema>;\n","import { z } from \"zod\";\n\nconst AnyRecord = z.record(z.any());\n\nconst NpmPackageVersionDist = AnyRecord.and(\n z.object({\n tarball: z.string(),\n })\n);\n\nconst NpmPackageVersion = AnyRecord.and(\n z.object({\n dist: NpmPackageVersionDist,\n })\n);\n\nexport const NpmPackage = AnyRecord.and(\n z.object({\n _id: z.string(),\n name: z.string(),\n\n // e.g. \"latest\": \"1.2.3\"\n \"dist-tags\": z.record(z.string(), z.string()),\n\n // \"1.2.3\": {...}\n versions: z.record(NpmPackageVersion),\n })\n);\n\nexport type NpmPackage = z.infer<typeof NpmPackage>;\n","import { z } from \"zod\";\n\nexport const NpmProxyTokenPayload = z.object({\n npmProxyRegistryConfigId: z.string(),\n});\n\nexport type NpmProxyTokenPayload = z.infer<typeof NpmProxyTokenPayload>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { UserTheme } from \"../users\";\nimport { OmitStrict } from \"../utils\";\n\nexport const PortalSettingsTheme = nullishToOptional(UserTheme);\n\nexport const PortalSettings = z.object({\n id: z.string(),\n workspaceId: z.string(),\n\n enabledDesignSystemIds: z.array(z.string()),\n enabledBrandPersistentIds: z.array(z.string()),\n\n theme: PortalSettingsTheme,\n sidebar: nullishToOptional(z.any()),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type PortalSettingsTheme = z.infer<typeof PortalSettingsTheme>;\nexport type PortalSettings = z.infer<typeof PortalSettings>;\nexport type CreatePortalSettings = DbCreateInputOmit<PortalSettings>;\nexport type UpdatePortalSettings = OmitStrict<DbUpdate<PortalSettings>, \"workspaceId\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../helpers\";\nimport { WorkspaceRoleSchema } from \"../workspace\";\n\nexport const PersonalAccessToken = z.object({\n id: z.string(),\n userId: z.string(),\n\n workspaceId: z.string().optional(),\n designSystemId: z.string().optional(),\n workspaceRole: WorkspaceRoleSchema.optional(),\n\n name: z.string(),\n hidden: z.boolean(),\n\n token: z.string(),\n scope: z.string().optional(),\n\n createdAt: z.coerce.date(),\n expireAt: z.coerce.date().optional(),\n});\n\nexport type PersonalAccessToken = z.infer<typeof PersonalAccessToken>;\n\nexport type CreatePersonalAccessToken = DbCreateInputOmit<PersonalAccessToken>;\n","import { OptionalToNullable } from \"../utils\";\n\nexport type DbCreateInputOmit<T> = Omit<T, \"id\" | \"createdAt\" | \"updatedAt\">;\n\nexport type DbUpdateInputOmit<T> = Omit<T, \"createdAt\" | \"updatedAt\" | \"persistentId\">;\n\nexport type DbUpdate<T extends { id: string }> = Partial<OptionalToNullable<DbUpdateInputOmit<Omit<T, \"id\">>>> &\n Pick<T, \"id\">;\n\nexport function zodCreateInputOmit() {\n return {\n id: true,\n createdAt: true,\n updatedAt: true,\n } as const;\n}\n\nexport function zodUpdateInputOmit() {\n return {\n id: true,\n createdAt: true,\n updatedAt: true,\n persistentId: true,\n } as const;\n}\n","import { ZodType, ZodTypeDef } from \"zod\";\n\n/**\n * Allows both null and undefined as input values in addition to the actual value,\n * but coerces them both to undefined.\n */\nexport function nullishToOptional<I, O>(type: ZodType<I, ZodTypeDef, O>) {\n return type.nullish().transform(t => t ?? undefined);\n}\n","export type SupernovaExceptionType =\n | \"AccessDenied\"\n | \"ResourceNotFound\"\n | \"WrongFormat\"\n | \"TooMuchWork\"\n | \"Timeout\"\n | \"Conflict\"\n | \"NotImplemented\"\n | \"BadRequest\"\n | \"WrongActionOrder\"\n | \"InvalidOperation\"\n | \"UnexpectedError\"\n | \"IPRestricted\"\n | \"PlanRestricted\"\n | \"MissingWorkspacePermission\"\n | \"MissingExporterPermission\"\n | \"MissingIntegration\"\n | \"MissingIntegrationAccess\"\n | \"NoAccess\"\n | \"MissingCredentials\"\n | \"ValidationError\"\n | \"ThirdPartyError\";\n\nexport class SupernovaException extends Error {\n static wrongFormat(message?: string): SupernovaException {\n return new SupernovaException(\"WrongFormat\", message);\n }\n\n static validationError(message?: string): SupernovaException {\n return new SupernovaException(\"ValidationError\", message);\n }\n\n static accessDenied(message?: string): SupernovaException {\n return new SupernovaException(\"AccessDenied\", message);\n }\n\n static tooMuchWork(message?: string): SupernovaException {\n return new SupernovaException(\"TooMuchWork\", message);\n }\n\n static notFound(message?: string): SupernovaException {\n return new SupernovaException(\"ResourceNotFound\", message);\n }\n\n static timeout(message?: string): SupernovaException {\n return new SupernovaException(\"Timeout\", message);\n }\n\n static conflict(message?: string): SupernovaException {\n return new SupernovaException(\"Conflict\", message);\n }\n\n static notImplemented(message?: string): SupernovaException {\n return new SupernovaException(\"NotImplemented\", message);\n }\n\n static wrongActionOrder(message?: string): SupernovaException {\n return new SupernovaException(\"WrongActionOrder\", message);\n }\n\n static invalidOperation(message?: string): SupernovaException {\n return new SupernovaException(\"InvalidOperation\", message);\n }\n\n static shouldNotHappen(message?: string): SupernovaException {\n return new SupernovaException(\"UnexpectedError\", message);\n }\n\n static ipRestricted(message?: string): SupernovaException {\n return new SupernovaException(\"IPRestricted\", message);\n }\n\n static planRestricted(message?: string): SupernovaException {\n return new SupernovaException(\"PlanRestricted\", message);\n }\n\n static missingWorkspacePermission(message?: string): SupernovaException {\n return new SupernovaException(\"MissingWorkspacePermission\", message);\n }\n\n static missingExporterPermission(message?: string): SupernovaException {\n return new SupernovaException(\"MissingExporterPermission\", message);\n }\n\n static missingIntegration(message?: string): SupernovaException {\n return new SupernovaException(\"MissingIntegration\", message);\n }\n\n static missingIntegrationAccess(message?: string): SupernovaException {\n return new SupernovaException(\"MissingIntegrationAccess\", message);\n }\n\n static noAccess(message?: string): SupernovaException {\n return new SupernovaException(\"NoAccess\", message);\n }\n\n static missingCredentials(message?: string): SupernovaException {\n return new SupernovaException(\"MissingCredentials\", message);\n }\n\n static thirdPartyError(message?: string): SupernovaException {\n return new SupernovaException(\"ThirdPartyError\", message);\n }\n\n //\n // To refactor\n //\n\n static badRequest(message?: string): SupernovaException {\n return new SupernovaException(\"BadRequest\", message);\n }\n\n //\n // Properties\n //\n\n constructor(readonly type: SupernovaExceptionType, message?: string) {\n const fullMessage = message || `${type}: something went wrong`;\n super(fullMessage);\n }\n}\n","import { SupernovaException } from \"./errors\";\n\nexport type OmitStrict<T, K extends keyof T> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;\n\nexport type Nullish<T> = T | null | undefined;\n\nexport type ExplicitPartial<T> = { [P in keyof T]: T[P] | undefined };\n\n// Magic as far as I'm concerned.\n// Taken from https://stackoverflow.com/a/50375286/3229534\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;\n\n// This utility lets T be indexed by any key\ntype Indexify<T> = T & { [str: string]: undefined };\n\n// To make a type where all values are undefined, so that in AllUnionKeys<T>\n// TS doesn't remove the keys whose values are incompatible, e.g. string & number\ntype UndefinedVals<T> = { [K in keyof T]: undefined };\n\n// This returns a union of all keys present across all members of the union T\ntype AllUnionKeys<T> = keyof UnionToIntersection<UndefinedVals<T>>;\n\n// Where the (rest of the) magic happens ✨\nexport type AllFields<T> = { [K in AllUnionKeys<T> & string]: Indexify<T>[K] };\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type Defined<T> = T extends null | undefined ? never : T;\n\n// Makes specific properties in the type required\nexport type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\ntype PickOptional<T> = {\n [P in keyof T as undefined extends T[P] ? P : never]: T[P];\n};\n\ntype PickNotOptional<T> = {\n [P in keyof T as undefined extends T[P] ? never : P]: T[P];\n};\n\nexport type OptionalToNullable<T> = {\n [K in keyof PickOptional<T>]-?: Exclude<T[K], undefined> | null;\n} & {\n [K in keyof PickNotOptional<T>]: T[K];\n};\n\nexport function forceUnwrapNullish<T>(value: Nullish<T>): T {\n if (value === null) throw new Error(\"Illegal null\");\n if (value === undefined) throw new Error(\"Illegal undefined\");\n return value;\n}\n\nexport function trimLeadingSlash(string: string): string {\n return string.startsWith(\"/\") ? string.substring(1) : string;\n}\n\nexport function trimTrailingSlash(string: string): string {\n return string.endsWith(\"/\") ? string.substring(0, string.length - 1) : string;\n}\n\nexport function tryParseUrl(url: string): URL | null {\n try {\n return parseUrl(url);\n } catch (e) {\n console.error(`Error parsing URL ${url}`);\n console.error(e);\n return null;\n }\n}\n\nexport function parseUrl(url: string): URL {\n return new URL(url.startsWith(\"https://\") || url.startsWith(\"http://\") ? url : `https://${url}`);\n}\n\nexport function mapByUnique<V, K>(items: Iterable<V>, keyFn: (item: V) => K): Map<K, V> {\n const result = new Map<K, V>();\n for (const item of items) {\n result.set(keyFn(item), item);\n }\n return result;\n}\n\nexport function groupBy<V, K>(items: V[], keyFn: (item: V) => K): Map<K, V[]> {\n const result = new Map<K, V[]>();\n\n for (const item of items) {\n const key = keyFn(item);\n const array = result.get(key);\n if (array) {\n array.push(item);\n } else {\n result.set(key, [item]);\n }\n }\n\n return result;\n}\n\nexport function filterNonNullish<T>(items: Nullish<T>[]): T[] {\n return items.filter(Boolean) as T[];\n}\n\nexport function nonNullishFilter<T>(item: Nullish<T>): item is T {\n return !!item;\n}\n\nexport function nonNullFilter<T>(item: T | null): item is T {\n return item !== null;\n}\n\nexport type ArrayElementType<T extends Default[], Default = any> = T extends (infer U)[] ? U : Default;\n\nexport function buildConstantEnum<Inferred extends ArrayElementType<Passed>[], Passed extends string[]>(\n values: Inferred\n): { [key in Inferred[number]]: key } {\n const constMap = values.reduce((acc, code) => ({ ...acc, [code]: code }), {});\n\n return constMap as { [key in Inferred[number]]: key };\n}\n\nexport async function promiseWithTimeout<T>(\n timeoutMs: number,\n promise: () => Promise<T>,\n onTimeout?: () => Error\n): Promise<T> {\n let timeoutHandle: NodeJS.Timeout | undefined;\n const timeoutPromise = new Promise<never>((_, reject) => {\n timeoutHandle = setTimeout(() => reject(onTimeout?.() ?? SupernovaException.timeout()), timeoutMs);\n });\n\n const result = await Promise.race([promise(), timeoutPromise]);\n\n clearTimeout(timeoutHandle);\n return result;\n}\n\nexport async function sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function uniqueBy<K, V>(items: V[], prop: (v: V) => K): V[] {\n return Array.from(mapByUnique(items, prop).values());\n}\n\nexport function areShallowObjectsEqual<T extends object>(lhs: T | undefined, rhs: T | undefined) {\n if ((lhs === undefined) !== (rhs === undefined)) return false;\n if (lhs === undefined || rhs === undefined) return true;\n\n if ((lhs === null) !== (rhs === null)) return false;\n if (lhs === null || rhs === null) return true;\n\n for (const key in lhs) {\n if (!(key in rhs) || lhs[key] !== rhs[key]) {\n return false;\n }\n }\n\n for (const key in rhs) {\n if (!(key in lhs)) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function isNotNullish<T>(value: T | null | undefined): value is T {\n return !isNullish(value);\n}\n\nexport function isNullish<T>(value: T | null | undefined): value is null | undefined {\n return value === null || value === undefined;\n}\n\nexport function hasProperty<K extends string>(prop: K) {\n return <T extends { [key in K]?: unknown }>(obj: T): obj is T & Required<Pick<T, K>> => {\n return obj[prop] !== null && obj[prop] !== undefined;\n };\n}\n\nexport function chunkedArray<V>(array: V[], chunkSize: number): V[][] {\n const result: V[][] = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n return result;\n}\n\nexport function recordToMap<V>(record: Record<string, V>): Map<string, V> {\n const map = new Map<string, V>();\n for (const [k, v] of Object.entries(record)) map.set(k, v);\n return map;\n}\n\n/**\n * Applies direct properties from `update` to `object`.\n *\n * - In case a property is not defined in `update`, it `object` will retain the current one\n * - In case a property is null in `update`, it will be removed from `object`\n *\n * @param object base object to perform updates on\n * @param update source of property updates\n * @returns object by merging updates from `update` into `object`\n */\nexport function applyShallowObjectUpdate<T>(object: T, update: Partial<OptionalToNullable<T>>): T {\n const objectShallowCopy = { ...object };\n\n for (const [key, value] of Object.entries(update)) {\n if (value === null) {\n // @ts-expect-error it's very hard to get typescript to believe that the types will match\n objectShallowCopy[key] = undefined;\n } else if (value !== undefined) {\n // @ts-expect-error it's very hard to get typescript to believe that the types will match\n objectShallowCopy[key] = value;\n }\n }\n\n return objectShallowCopy;\n}\n\nexport type Pagination = {\n skip?: number;\n take?: number;\n};\n","const shortPersistentIdLength = 8;\nconst alphanumeric = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\nexport function generateShortPersistentId() {\n return generateAlphanumericId(shortPersistentIdLength);\n}\n\nfunction generateAlphanumericId(length: number): string {\n let randomString = \"\";\n\n for (let i = 0; i < length; i++) {\n const randomIndex = Math.floor(Math.random() * alphanumeric.length);\n randomString += alphanumeric.charAt(randomIndex);\n }\n\n return randomString;\n}\n","// Consists of lowercased letters, digits and hyphens.\n// Can not start or end with hyphen.\n// Warning: does not forbid consecutive hyphens\nexport const slugRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;\n","import { DocumentationPageContentItem, PageBlockDefinition, PageBlockDefinitionProperty } from \"../documentation\";\nimport { PageBlockItemUntypedValue, PageBlockItemV2 } from \"./data\";\nimport { PageBlockEditorModelV2 } from \"./page-block-v2\";\n\n//\n// Traverse\n//\n\n/**\n * Pay attention to correct types!\n */\nexport function mapPageBlockItemValuesV2(\n pageItems: DocumentationPageContentItem[],\n definitionsMap: PageBlockDefinitionsMap,\n fn: (\n block: PageBlockEditorModelV2,\n item: PageBlockItemV2,\n property: PageBlockDefinitionProperty,\n value: PageBlockItemUntypedValue\n ) => PageBlockItemUntypedValue\n) {\n traversePageBlockItemsV2(pageItems, (block, item) => {\n Object.entries(item.props).forEach(([propKey, value]) => {\n const property = definitionsMap.getDefinitionProperty(block.data.packageId, propKey);\n if (!property) return;\n\n item.props[propKey] = fn(block, item, property, value);\n });\n });\n}\n\nexport function traversePageBlockItemValuesV2(\n pageItems: DocumentationPageContentItem[],\n definitionsMap: PageBlockDefinitionsMap,\n fn: (\n block: PageBlockEditorModelV2,\n item: PageBlockItemV2,\n property: PageBlockDefinitionProperty,\n value: PageBlockItemUntypedValue\n ) => void\n) {\n traversePageBlockItemsV2(pageItems, (block, item) => {\n Object.entries(item.props).forEach(([propKey, value]) => {\n const property = definitionsMap.getDefinitionProperty(block.data.packageId, propKey);\n if (!property) return;\n\n fn(block, item, property, value);\n });\n });\n}\n\nexport function traversePageBlockItemsV2(\n pageItems: DocumentationPageContentItem[],\n fn: (block: PageBlockEditorModelV2, item: PageBlockItemV2) => void\n) {\n traversePageItemsV2(pageItems, block => {\n block.data.items.forEach(item => {\n fn(block, item);\n });\n });\n}\n\nexport function traversePageItemsV2(\n pageItems: DocumentationPageContentItem[],\n fn: (item: PageBlockEditorModelV2) => void\n): void {\n for (const item of pageItems) {\n switch (item.type) {\n case \"Block\":\n fn(item);\n\n break;\n\n case \"Section\":\n item.items.forEach(i => {\n i.columns.forEach(c => {\n traversePageItemsV2(c.blocks, fn);\n });\n });\n\n break;\n }\n }\n}\n\n//\n// Definitions map\n//\n\nexport class PageBlockDefinitionsMap {\n private definitionsMap = new Map<string, PageBlockDefinition>();\n private propertiesMap = new Map<string, PageBlockDefinitionProperty>();\n\n constructor(definitions: PageBlockDefinition[]) {\n definitions.forEach(d => {\n this.definitionsMap.set(d.id, d);\n d.item.properties.forEach(p => {\n this.propertiesMap.set(this.propertyKey(d.id, p.id), p);\n });\n });\n }\n\n getDefinition(id: string): PageBlockDefinition | undefined {\n return this.definitionsMap.get(id);\n }\n\n getDefinitionProperty(defId: string, propId: string): PageBlockDefinitionProperty | undefined {\n return this.propertiesMap.get(this.propertyKey(defId, propId));\n }\n\n private propertyKey(defId: string, propId: string): string {\n return `${defId}.${propId}`;\n }\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { ElementGroup } from \"../elements\";\nimport { DesignElementSnapshotBase, pickLatestSnapshots } from \"./base\";\n\n/**\n * Snapshot of an element group.\n *\n * Please note that existence of snapshot's references (including parent persistent id) is not guaranteed.\n */\nexport const ElementGroupSnapshot = DesignElementSnapshotBase.extend({\n group: ElementGroup,\n});\n\nexport type ElementGroupSnapshot = z.infer<typeof ElementGroupSnapshot>;\n\nexport type CreateElementGroupSnapshot = DbCreateInputOmit<ElementGroupSnapshot>;\nexport type UpdateElementGroupSnapshot = OmitStrict<DbUpdate<ElementGroupSnapshot>, \"designSystemVersionId\">;\n\n//\n// Util functions\n//\n\nexport function pickLatestGroupSnapshots(snapshots: ElementGroupSnapshot[]): ElementGroupSnapshot[] {\n return pickLatestSnapshots(snapshots, s => s.group.id);\n}\n","import { groupBy, nonNullishFilter, PublishedDocPageVisitsEntry } from \"@supernova-studio/model\";\nimport { DTOPublishedDocPageVisitData, DTOPublishedDocVisitData } from \"../../dto\";\n\n//\n// Analytics data conversion\n//\n\nexport function documentationAnalyticsToGlobalDto(entries: PublishedDocPageVisitsEntry[]): DTOPublishedDocVisitData[] {\n return squashAndConvertToDto(entries);\n}\n\n//\n// Analytics data per page conversion\n//\n\nexport function documentationAnalyticsToPageDto(\n entries: PublishedDocPageVisitsEntry[]\n): DTOPublishedDocPageVisitData[] {\n // Group by page id\n const byPageIdEntries = Array.from(groupBy(entries, e => e.pagePersistentId).entries());\n byPageIdEntries.sort((lhs, rhs) => lhs[0].localeCompare(rhs[0]));\n\n return byPageIdEntries.flatMap(([pagePersistentId, entries]) => {\n const dtoWithoutPageId = squashAndConvertToDto(entries);\n return dtoWithoutPageId.map(dto => ({ ...dto, pagePersistentId }));\n });\n}\n\n//\n// Base\n//\n\nfunction squashAndConvertToDto(entries: PublishedDocPageVisitsEntry[]): DTOPublishedDocVisitData[] {\n // Group by beginning of day\n const byDay = groupBy(entries, e => getStartOfUTCDay(e.timestamp));\n\n const obj = Object.fromEntries(\n Array.from(byDay.entries()).map(([date, values]) => [new Date(date).toISOString(), values.length])\n );\n\n // Convert model to DTO by squashing model entries that belong to the same day\n return Array.from(byDay.entries()).map(([startOfDay, dayEntries]) => {\n const firstEntry = dayEntries[0];\n\n // Sessions are number of unique user IDs who visited the page during that day\n const uniqueSessions = new Set(dayEntries.map(e => e.anonymousId).filter(nonNullishFilter)).size;\n\n // Visits are sum of all recorded visits of the page during that day\n const visitsSum = dayEntries.reduce((prev, curr) => prev + curr.visits, 0);\n\n return {\n versionId: firstEntry.versionId,\n timestamp: new Date(startOfDay),\n sessions: uniqueSessions,\n visits: visitsSum,\n\n ...(firstEntry.locale && { locale: firstEntry.locale }),\n };\n });\n}\n\nfunction getStartOfUTCDay(date: Date): number {\n const year = date.getUTCFullYear();\n const month = date.getUTCMonth();\n const day = date.getUTCDate();\n\n return Date.UTC(year, month, day, 0, 0, 0, 0);\n}\n","import { PublishedDocPageVisitsEntry, SupernovaException } from \"@supernova-studio/model\";\nimport {\n DTODocumentationAnalyticsTimeFrame,\n DTOPublishedDocAnalyticsComparisonData,\n DTOPublishedDocPageAnalyticsComparisonData,\n} from \"../../dto\";\nimport { documentationAnalyticsToGlobalDto } from \"./page-visits-to-dto\";\n\n//\n// Page analytics\n//\n\ntype PageAnalyticsInput = {\n pagePersistentId: string;\n priorDataPoints: PublishedDocPageVisitsEntry[];\n currentDataPoints: PublishedDocPageVisitsEntry[];\n timeFrame: DTODocumentationAnalyticsTimeFrame;\n};\n\nexport function documentationAnalyticsToPageComparisonDto(\n input: PageAnalyticsInput\n): DTOPublishedDocPageAnalyticsComparisonData {\n const { pagePersistentId } = input;\n\n function validateDataPoint(dataPoint: PublishedDocPageVisitsEntry) {\n if (dataPoint.pagePersistentId !== pagePersistentId) {\n throw SupernovaException.shouldNotHappen(`Tried to include invalid analytics data point!`);\n }\n }\n\n input.priorDataPoints.forEach(validateDataPoint);\n input.currentDataPoints.forEach(validateDataPoint);\n\n return {\n ...documentationAnalyticsToComparisonDto(input),\n pagePersistentId,\n };\n}\n\n//\n// Global analytics\n//\n\ntype GlobalAnalyticsInput = {\n priorDataPoints: PublishedDocPageVisitsEntry[];\n currentDataPoints: PublishedDocPageVisitsEntry[];\n timeFrame: DTODocumentationAnalyticsTimeFrame;\n};\n\nexport function documentationAnalyticsToComparisonDto(\n input: GlobalAnalyticsInput\n): DTOPublishedDocAnalyticsComparisonData {\n const { timeFrame } = input;\n\n const priorDataPoints = documentationAnalyticsToGlobalDto(input.priorDataPoints);\n const currentDataPoints = documentationAnalyticsToGlobalDto(input.currentDataPoints);\n\n return {\n timeFrame,\n priorSessionCount: priorDataPoints.reduce((sum, d) => sum + d.sessions, 0),\n priorVisitCount: priorDataPoints.reduce((sum, d) => sum + d.visits, 0),\n currentSessionCount: currentDataPoints.reduce((sum, d) => sum + d.sessions, 0),\n currentVisitCount: currentDataPoints.reduce((sum, d) => sum + d.visits, 0),\n };\n}\n","import { groupBy, PublishedDocPageVisitsEntry } from \"@supernova-studio/model\";\nimport { DTODocumentationAnalyticsTimeFrame, DTOPublishedDocVisitHeatMapWeek } from \"../../dto\";\n\nexport function documentationAnalyticsToHeatMapDto(\n entries: PublishedDocPageVisitsEntry[],\n timeFrame: DTODocumentationAnalyticsTimeFrame\n): DTOPublishedDocVisitHeatMapWeek {\n const byWeekDay = groupBy(entries, e => e.timestamp.getUTCDay());\n\n return {\n timeFrame,\n mon: entriesToHeatmapDay(byWeekDay.get(1)),\n tue: entriesToHeatmapDay(byWeekDay.get(2)),\n wed: entriesToHeatmapDay(byWeekDay.get(3)),\n thu: entriesToHeatmapDay(byWeekDay.get(4)),\n fri: entriesToHeatmapDay(byWeekDay.get(5)),\n sat: entriesToHeatmapDay(byWeekDay.get(6)),\n sun: entriesToHeatmapDay(byWeekDay.get(7)),\n };\n}\n\nfunction entriesToHeatmapDay(entries: PublishedDocPageVisitsEntry[] | undefined): number[] {\n const byHour = groupBy(entries ?? [], e => e.timestamp.getUTCHours());\n\n return [\n sumVisits(byHour.get(0), byHour.get(1)), // 0am-2am\n sumVisits(byHour.get(2), byHour.get(3)), // 2am-4am\n sumVisits(byHour.get(4), byHour.get(5)), // 4am-6am\n sumVisits(byHour.get(6), byHour.get(7)), // 6am-6am\n sumVisits(byHour.get(8), byHour.get(9)), // 8am-6am\n sumVisits(byHour.get(10), byHour.get(11)), // 10am-12pm\n sumVisits(byHour.get(12), byHour.get(13)), // 12pm-2pm\n sumVisits(byHour.get(14), byHour.get(15)), // 2pm-4pm\n sumVisits(byHour.get(16), byHour.get(17)), // 4pm-6pm\n sumVisits(byHour.get(18), byHour.get(19)), // 6pm-8pm\n sumVisits(byHour.get(20), byHour.get(21)), // 8pm-10pm\n sumVisits(byHour.get(22), byHour.get(23)), // 10pm-12pm\n ];\n}\n\nfunction sumVisits(...entryArrays: (PublishedDocPageVisitsEntry[] | undefined)[]) {\n let sum = 0;\n\n entryArrays.forEach(a => {\n a?.forEach(e => (sum += e.visits));\n });\n\n return sum;\n}\n","import {\n ColorTokenData,\n DocumentationItemConfigurationV1,\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderImageScaleType,\n} from \"@supernova-studio/model\";\nimport { DTODocumentationItemConfigurationV1 } from \"../../dto\";\n\nexport const getDtoDefaultItemConfigurationV1 = () =>\n ({\n showSidebar: true,\n isHidden: false,\n isPrivate: false,\n header: {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n },\n } as const);\n\nexport function documentationItemConfigurationToDTOV1(\n config: DocumentationItemConfigurationV1 | undefined\n): DTODocumentationItemConfigurationV1 {\n const dtoDefaultItemConfigurationV1 = getDtoDefaultItemConfigurationV1();\n if (!config) return dtoDefaultItemConfigurationV1;\n\n const { backgroundColor, foregroundColor, ...headerRest } = config.header;\n\n return {\n showSidebar: config.showSidebar,\n isHidden: config.isHidden ?? dtoDefaultItemConfigurationV1.isHidden,\n isPrivate: config.isPrivate ?? dtoDefaultItemConfigurationV1.isPrivate,\n header: {\n ...headerRest,\n backgroundColor: colorToDTOV1(backgroundColor ?? undefined),\n foregroundColor: colorToDTOV1(foregroundColor ?? undefined),\n },\n };\n}\n\nfunction colorToDTOV1(color: ColorTokenData | undefined) {\n if (!color) return undefined;\n if (color.aliasTo) return { aliasTo: color.aliasTo };\n if (!color.value) return undefined;\n\n if (typeof color.value === \"string\") return { value: color.value };\n if (typeof color.value.color === \"string\") return { value: color.value.color };\n\n return undefined;\n}\n","import {\n DocumentationGroupV1,\n DocumentationItemConfigurationV1,\n DocumentationItemConfigurationV2,\n DocumentationPageV1,\n mapByUnique,\n} from \"@supernova-studio/model\";\nimport { LocalDocsPage, LocalDocsPageGroup } from \"../../../sync/types\";\nimport { VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../../../yjs/version-room/types\";\n\ntype GroupLike = {\n persistentId: string;\n parentPersistentId?: string;\n};\n\ntype DocsPage = LocalDocsPage | VersionRoomDocsPage;\ntype DocsPageGroup = LocalDocsPageGroup | VersionRoomDocsPageGroup;\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function buildDocPagePublishPaths(\n groups: (DocsPageGroup | DocumentationGroupV1)[],\n pages: (DocsPage | DocumentationPageV1)[],\n routingVersion: string\n): Map<string, string> {\n const groupPersistentIdToGroupMap = mapByUnique(groups, group => group.persistentId);\n const result = new Map<string, string>();\n\n for (const page of pages) {\n const parentChain = calculateElementParentChain(page.parentPersistentId, groupPersistentIdToGroupMap);\n\n let pathV1 = `${page.userSlug || page.slug}.html`;\n let pathV2 = `${page.slug}-${page.shortPersistentId}`;\n\n for (const parent of parentChain) {\n if (!parent.parentPersistentId) continue;\n\n pathV1 = `${parent.userSlug || parent.slug || \"root\"}/${pathV1}`;\n pathV2 = `${parent.slug || \"root\"}/${pathV2}`;\n }\n\n pathV1 = `/${pathV1}`;\n pathV2 = `/${pathV2}`;\n\n if (routingVersion === \"2\") {\n result.set(page.persistentId, pathV2);\n } else {\n result.set(page.persistentId, pathV1);\n }\n }\n\n return result;\n}\n\nexport function calculateElementParentChain<T extends GroupLike>(\n elementParentPersistentId: string,\n groupPersistentIdToGroupMap: Map<string, T>\n): T[] {\n const result: T[] = [];\n\n let parentId: string | undefined = elementParentPersistentId;\n while (parentId) {\n const parent = groupPersistentIdToGroupMap.get(parentId);\n if (parent) result.push(parent);\n\n parentId = parent?.parentPersistentId;\n }\n\n return result;\n}\n\nexport function applyPrivacyConfigurationToNestedItems<\n PageType extends DocumentationPageV1 | DocsPage,\n GroupType extends DocumentationGroupV1 | DocsPageGroup,\n ItemConfigurationType extends DocumentationItemConfigurationV1 | DocumentationItemConfigurationV2\n>(\n pages: PageType[],\n groups: GroupType[],\n getDefaultItemConfiguration: () => ItemConfigurationType\n): { pages: PageType[]; groups: GroupType[] } {\n // copy groups to mutate them later\n const fixedGroups = groups.map(group => ({\n ...group,\n data: {\n ...group.data,\n configuration: group.data?.configuration ?? getDefaultItemConfiguration(),\n },\n }));\n const groupPersistentIdToGroupMap = mapByUnique(fixedGroups, group => group.persistentId);\n\n for (const groupToFix of fixedGroups) {\n let isHidden = groupToFix.data.configuration.isHidden;\n let isPrivate = groupToFix.data.configuration.isPrivate;\n\n let nextParentId: string | undefined = groupToFix.parentPersistentId;\n while ((!isHidden || !isPrivate) && nextParentId) {\n const parent = groupPersistentIdToGroupMap.get(nextParentId);\n if (!parent) break;\n\n isHidden = isHidden || parent.data?.configuration?.isHidden || false;\n isPrivate = isPrivate || parent.data?.configuration?.isPrivate || false;\n\n nextParentId = parent.parentPersistentId;\n }\n\n groupToFix.data.configuration.isHidden = isHidden;\n groupToFix.data.configuration.isPrivate = isPrivate;\n }\n\n const fixedPages: PageType[] = [];\n // set isHidden and isPrivate configuration fields based on page and parents value\n for (const page of pages) {\n const configuration = page.data?.configuration ?? getDefaultItemConfiguration();\n const parent = groupPersistentIdToGroupMap.get(page.parentPersistentId);\n\n fixedPages.push({\n ...page,\n data: {\n ...page.data,\n configuration: {\n ...configuration,\n isHidden: configuration.isHidden || parent?.data?.configuration?.isHidden || false,\n isPrivate: configuration.isPrivate || parent?.data?.configuration?.isPrivate || false,\n },\n },\n });\n }\n\n return { pages: fixedPages, groups: fixedGroups };\n}\n","import {\n DocumentationGroupV1,\n DocumentationItemConfigurationV1,\n DocumentationPageV1,\n DocumentationPageV2,\n groupBy,\n} from \"@supernova-studio/model\";\nimport { DTODocumentationGroupStructureV1, DTODocumentationGroupV1 } from \"../../dto/elements/documentation/group-v1\";\nimport {\n documentationItemConfigurationToDTOV1,\n getDtoDefaultItemConfigurationV1,\n} from \"./documentation-item-configuration-v1-to-dto\";\nimport { applyPrivacyConfigurationToNestedItems } from \"./documentation-page-to-dto-utils\";\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function elementGroupsToDocumentationGroupStructureDTOV1(\n groups: DocumentationGroupV1[],\n pages: (DocumentationPageV1 | DocumentationPageV2)[]\n): DTODocumentationGroupStructureV1[] {\n const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);\n\n return groups.map(group => elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap));\n}\n\nexport function elementGroupsToDocumentationGroupDTOV1(\n groups: DocumentationGroupV1[],\n pages: (DocumentationPageV1 | DocumentationPageV2)[]\n): DTODocumentationGroupV1[] {\n const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);\n\n return groups.map(group => {\n return {\n ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),\n configuration: documentationItemConfigurationToDTOV1(group.data?.configuration),\n };\n });\n}\n\nexport function elementGroupsToDocumentationGroupFixedConfigurationDTOV1(\n groups: DocumentationGroupV1[],\n pages: (DocumentationPageV1 | DocumentationPageV2)[]\n): DTODocumentationGroupV1[] {\n const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);\n\n const { groups: fixedGroups } = applyPrivacyConfigurationToNestedItems<\n DocumentationPageV1 | DocumentationPageV2,\n DocumentationGroupV1,\n DocumentationItemConfigurationV1\n >(pages, groups, getDtoDefaultItemConfigurationV1);\n\n return fixedGroups.map(group => {\n const configuration = documentationItemConfigurationToDTOV1(group.data?.configuration);\n\n return {\n ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),\n // backward compatibility with custom doc exporters, anyway these groups will not be shown, so we can adjust title\n title: configuration.isHidden && !group.meta.name.startsWith(\"_\") ? \"_\" + group.meta.name : group.meta.name,\n configuration,\n };\n });\n}\n\nfunction elementGroupToDocumentationGroupStructureDTOV1(\n group: DocumentationGroupV1,\n childrenIdsMap: Map<string, string[]>\n): DTODocumentationGroupStructureV1 {\n const childrenIds = childrenIdsMap.get(group.persistentId) ?? [];\n\n if (!group.shortPersistentId) {\n throw new Error(`Short persistent id is required for docs groups, group id: ${group.id}`);\n }\n\n return {\n id: group.id,\n designSystemVersionId: group.designSystemVersionId,\n persistentId: group.persistentId,\n slug: group.slug,\n userSlug: group.userSlug,\n createdAt: group.createdAt,\n updatedAt: group.updatedAt,\n title: group.meta.name,\n childrenIds: childrenIds,\n isRoot: !group.parentPersistentId,\n groupBehavior: group.data?.behavior ?? \"Group\",\n shortPersistentId: group.shortPersistentId,\n type: \"Group\",\n };\n}\n\nfunction calculateChildrenIdsMapV1(\n elements: { persistentId: string; parentPersistentId: string; sortOrder: number }[],\n groups: DocumentationGroupV1[]\n): Map<string, string[]> {\n const byParentId = groupBy([...elements, ...groups], e => e.parentPersistentId);\n\n const childrenIdsMap = new Map<string, string[]>();\n\n for (const [parentPersistentId, children] of byParentId) {\n if (!parentPersistentId) continue;\n children.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);\n\n childrenIdsMap.set(\n parentPersistentId,\n children.map(c => c.persistentId)\n );\n }\n\n return childrenIdsMap;\n}\n","import {\n DocumentationItemConfigurationV2,\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderImageScaleType,\n} from \"@supernova-studio/model\";\nimport { DTODocumentationItemConfigurationV2 } from \"../../dto/elements/documentation/item-configuration-v2\";\n\nexport const getDtoDefaultItemConfigurationV2 = () =>\n ({\n showSidebar: true,\n isHidden: false,\n isPrivate: false,\n header: {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n },\n } as const);\n\nexport function documentationItemConfigurationToDTOV2(\n config: DocumentationItemConfigurationV2 | undefined\n): DTODocumentationItemConfigurationV2 {\n const dtoDefaultItemConfigurationV2 = getDtoDefaultItemConfigurationV2();\n if (!config) return dtoDefaultItemConfigurationV2;\n\n return {\n header: config.header,\n isHidden: config.isHidden ?? dtoDefaultItemConfigurationV2.isHidden,\n isPrivate: config.isPrivate ?? dtoDefaultItemConfigurationV2.isPrivate,\n showSidebar: config.showSidebar,\n };\n}\n","import { DocumentationItemConfigurationV2, DocumentationPageV1, groupBy } from \"@supernova-studio/model\";\nimport { VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../../../yjs/version-room/types\";\nimport { LocalDocsPage, LocalDocsPageGroup } from \"../../../sync/types\";\nimport { DTODocumentationGroupV2 } from \"../../dto\";\nimport {\n documentationItemConfigurationToDTOV2,\n getDtoDefaultItemConfigurationV2,\n} from \"./documentation-item-configuration-v2-to-dto\";\nimport { applyPrivacyConfigurationToNestedItems } from \"./documentation-page-to-dto-utils\";\n\ntype DocsPage = LocalDocsPage | VersionRoomDocsPage;\ntype DocsPageGroup = LocalDocsPageGroup | VersionRoomDocsPageGroup;\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function elementGroupsToDocumentationGroupDTOV2(\n groups: DocsPageGroup[],\n pages: (DocumentationPageV1 | DocsPage)[]\n): DTODocumentationGroupV2[] {\n const childrenIdsMap = calculateChildrenIdsMapV2(pages, groups);\n\n return groups.map(group => elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap));\n}\n\nexport function elementGroupsToDocumentationGroupFixedConfigurationDTOV2(\n groups: DocsPageGroup[],\n pages: (DocumentationPageV1 | DocsPage)[]\n): DTODocumentationGroupV2[] {\n const childrenIdsMap = calculateChildrenIdsMapV2(pages, groups);\n\n const { groups: fixedGroups } = applyPrivacyConfigurationToNestedItems<\n DocumentationPageV1 | DocsPage,\n DocsPageGroup,\n DocumentationItemConfigurationV2\n >(pages, groups, getDtoDefaultItemConfigurationV2);\n\n return fixedGroups.map(group => elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap));\n}\n\nfunction elementGroupToDocumentationGroupStructureDTOV2(\n group: DocsPageGroup,\n childrenIdsMap: Map<string, string[]>\n): DTODocumentationGroupV2 {\n const childrenIds = childrenIdsMap.get(group.persistentId) ?? [];\n\n if (!group.shortPersistentId) {\n throw new Error(`Short persistent id is required for docs groups, group id: ${group.persistentId}`);\n }\n\n return {\n id: \"to_be_removed\",\n designSystemVersionId: group.designSystemVersionId,\n persistentId: group.persistentId,\n slug: group.slug,\n userSlug: group.userSlug,\n createdAt: group.createdAt,\n updatedAt: group.updatedAt,\n title: group.meta.name,\n configuration: documentationItemConfigurationToDTOV2(group?.data?.configuration),\n childrenIds: childrenIds,\n isRoot: !group.parentPersistentId,\n groupBehavior: group.data?.behavior ?? \"Group\",\n shortPersistentId: group.shortPersistentId,\n type: \"Group\",\n };\n}\n\nfunction calculateChildrenIdsMapV2(\n elements: { persistentId: string; parentPersistentId: string; sortOrder: number }[],\n groups: DocsPageGroup[]\n): Map<string, string[]> {\n const byParentId = groupBy([...elements, ...groups], e => e.parentPersistentId);\n\n const childrenIdsMap = new Map<string, string[]>();\n\n for (const [parentPersistentId, children] of byParentId) {\n if (!parentPersistentId) continue;\n children.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);\n\n childrenIdsMap.set(\n parentPersistentId,\n children.map(c => c.persistentId)\n );\n }\n\n return childrenIdsMap;\n}\n","import {\n DocumentationGroupV1,\n DocumentationItemConfigurationV1,\n DocumentationPageV1,\n SupernovaException,\n} from \"@supernova-studio/model\";\nimport { DocumentationPageV1DTO } from \"../../dto\";\nimport {\n documentationItemConfigurationToDTOV1,\n getDtoDefaultItemConfigurationV1,\n} from \"./documentation-item-configuration-v1-to-dto\";\nimport { buildDocPagePublishPaths, applyPrivacyConfigurationToNestedItems } from \"./documentation-page-to-dto-utils\";\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function documentationPagesToDTOV1(\n pages: DocumentationPageV1[],\n groups: DocumentationGroupV1[],\n routingVersion: string\n): DocumentationPageV1DTO[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n\n return pages.map(page => documentationPageToDTOV1(page, pathsMap));\n}\n\nexport function documentationPagesFixedConfigurationToDTOV1(\n pages: DocumentationPageV1[],\n groups: DocumentationGroupV1[],\n routingVersion: string\n): DocumentationPageV1DTO[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n\n const { pages: fixedPages } = applyPrivacyConfigurationToNestedItems<\n DocumentationPageV1,\n DocumentationGroupV1,\n DocumentationItemConfigurationV1\n >(pages, groups, getDtoDefaultItemConfigurationV1);\n\n return fixedPages.map((page: DocumentationPageV1) => documentationPageToDTOV1(page, pathsMap));\n}\n\nfunction documentationPageToDTOV1(page: DocumentationPageV1, pagePathMap: Map<string, string>): DocumentationPageV1DTO {\n let path = pagePathMap.get(page.persistentId);\n if (!path) throw SupernovaException.conflict(`Path for page ${page.id} was not calculated`);\n\n if (path.startsWith(\"/\")) path = path.substring(1);\n\n const configuration = documentationItemConfigurationToDTOV1(page.data.configuration);\n\n return {\n id: page.id,\n designSystemVersionId: page.designSystemVersionId,\n persistentId: page.persistentId,\n shortPersistentId: page.shortPersistentId,\n // backward compatibility with custom doc exporters, anyway these pages will not be shown, so we can adjust title\n title: configuration.isHidden && !page.meta.name.startsWith(\"_\") ? \"_\" + page.meta.name : page.meta.name,\n blocks: page.data.blocks,\n slug: page.slug,\n userSlug: page.userSlug,\n configuration,\n createdAt: page.createdAt,\n updatedAt: page.updatedAt,\n path: path,\n };\n}\n","import { DocumentationItemConfigurationV2 } from \"@supernova-studio/model\";\nimport { LocalDocsPage, LocalDocsPageGroup } from \"../../../sync/types\";\nimport { VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../../../yjs/version-room/types\";\nimport { DTODocumentationPageV2 } from \"../../dto\";\nimport {\n documentationItemConfigurationToDTOV2,\n getDtoDefaultItemConfigurationV2,\n} from \"./documentation-item-configuration-v2-to-dto\";\nimport { applyPrivacyConfigurationToNestedItems, buildDocPagePublishPaths } from \"./documentation-page-to-dto-utils\";\n\ntype DocsPage = LocalDocsPage | VersionRoomDocsPage;\ntype DocsPageGroup = LocalDocsPageGroup | VersionRoomDocsPageGroup;\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function documentationPageToDTOV2(\n page: DocsPage,\n groups: DocsPageGroup[],\n routingVersion: string,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2 {\n const pathsMap = buildDocPagePublishPaths(groups, [page], routingVersion);\n return _documentationPageToDTOV2(page, pathsMap, pageLiveblocksRoomIdMap);\n}\n\nexport function documentationPagesToDTOV2(\n pages: DocsPage[],\n groups: DocsPageGroup[],\n routingVersion: string,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n return pages.map(page => _documentationPageToDTOV2(page, pathsMap, pageLiveblocksRoomIdMap));\n}\n\nexport function documentationPagesFixedConfigurationToDTOV2(\n pages: DocsPage[],\n groups: DocsPageGroup[],\n routingVersion: string,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n\n const { pages: fixedPages } = applyPrivacyConfigurationToNestedItems<\n DocsPage,\n DocsPageGroup,\n DocumentationItemConfigurationV2\n >(pages, groups, getDtoDefaultItemConfigurationV2);\n\n return fixedPages.map(page => _documentationPageToDTOV2(page, pathsMap, pageLiveblocksRoomIdMap));\n}\n\nfunction _documentationPageToDTOV2(\n page: DocsPage,\n pagePathMap: Map<string, string>,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2 {\n let path = pagePathMap.get(page.persistentId);\n if (!path) throw new Error(`Path for page ${page.persistentId} was not calculated`);\n\n if (path.startsWith(\"/\")) path = path.substring(1);\n\n const liveblocksRoomId = pageLiveblocksRoomIdMap.get(page.persistentId);\n\n return {\n id: \"to_be_removed\",\n designSystemVersionId: page.designSystemVersionId,\n persistentId: page.persistentId,\n shortPersistentId: page.shortPersistentId,\n title: page.meta.name,\n slug: page.slug,\n userSlug: page.userSlug,\n configuration: documentationItemConfigurationToDTOV2(page.data.configuration),\n createdAt: page.createdAt,\n updatedAt: page.updatedAt,\n path: path,\n type: \"Page\",\n ...(liveblocksRoomId && { liveblocksRoomId }),\n };\n}\n","import { Pipeline } from \"@supernova-studio/model\";\nimport { DTOPipeline } from \"../../dto/export/pipeline\";\n\nexport function pipelineToDto(pipeline: Pipeline): DTOPipeline {\n return {\n id: pipeline.id,\n name: pipeline.name,\n eventType: pipeline.eventType,\n isEnabled: pipeline.isEnabled,\n workspaceId: pipeline.workspaceId,\n designSystemId: pipeline.designSystemId,\n exporterId: pipeline.exporterId,\n brandPersistentId: pipeline.brandPersistentId,\n themePersistentId: pipeline.themePersistentId,\n themePersistentIds: pipeline.themePersistentIds,\n destinationAzure: pipeline.destinationAzure,\n destinationBitbucket: pipeline.destinationBitbucket,\n destinationSnDocs: pipeline.destinationSnDocs,\n destinationGithub: pipeline.destinationGithub,\n destinationGitlab: pipeline.destinationGitlab,\n destinationS3: pipeline.destinationS3,\n exporterPropertyValues: pipeline.exporterPropertyValues,\n webhookUrl: pipeline.webhookUrl,\n latestJobs: [],\n isExporterDeprecated: pipeline.isExporterDeprecated,\n };\n}\n","import { GitBranch, GitOrganization, GitProject, GitRepository } from \"@supernova-studio/model\";\nimport { DTOGitBranch, DTOGitOrganization, DTOGitProject, DTOGitRepository } from \"../../dto\";\n\nexport function gitOrganizationToDto(org: GitOrganization): DTOGitOrganization {\n return {\n id: org.id,\n name: org.name,\n url: org.url,\n slug: org.slug,\n };\n}\n\nexport function gitProjectToDto(project: GitProject): DTOGitProject {\n return {\n id: project.id,\n name: project.name,\n url: project.url,\n slug: project.slug,\n };\n}\n\nexport function gitRepositoryToDto(repo: GitRepository): DTOGitRepository {\n return {\n id: repo.id,\n name: repo.name,\n url: repo.url,\n slug: repo.slug,\n defaultBranch: repo.defaultBranch,\n };\n}\n\nexport function gitBranchToDto(branch: GitBranch): DTOGitBranch {\n return {\n name: branch.name,\n lastCommitId: branch.lastCommitId,\n };\n}\n","import { ExtendedIntegration, IntegrationCredentials } from \"@supernova-studio/model\";\nimport { DTOIntegration, DTOIntegrationCredentials } from \"../../dto\";\n\nexport function integrationToDto(integration: ExtendedIntegration): DTOIntegration {\n return {\n id: integration.id,\n workspaceId: integration.workspaceId,\n type: integration.type,\n createdAt: integration.createdAt,\n integrationCredentials: integration.integrationCredentials?.map(integrationCredentialToDto),\n integrationDesignSystems: integration.integrationDesignSystems ?? undefined,\n };\n}\n\nexport function integrationCredentialToDto(credential: IntegrationCredentials): DTOIntegrationCredentials {\n return {\n id: credential.id,\n\n createdAt: credential.createdAt,\n refreshedAt: credential.refreshedAt,\n expiresAt: credential.expiresAt,\n\n integrationId: credential.integrationId,\n type: credential.type,\n\n userId: credential.userId,\n user: credential.user,\n\n customUrl: credential.customUrl,\n\n profile: credential.profile,\n tokenName: credential.tokenName,\n username: credential.username,\n appInstallationId: credential.appInstallationId,\n state: credential.state,\n };\n}\n","import { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOAccessToken = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n name: z.string(),\n scope: z.string().optional(),\n});\n\nexport const DTOAccessTokenFull = DTOAccessToken.extend({\n token: z.string(),\n});\n\nexport const DTOAccessTokenListResponse = z.object({\n tokens: DTOAccessToken.array(),\n});\n\nexport const DTOAccessTokenResponse = z.object({\n token: DTOAccessToken,\n});\n\nexport const DTOAccessTokenFullResponse = z.object({\n token: DTOAccessTokenFull,\n});\n\nexport type DTOAccessToken = z.infer<typeof DTOAccessToken>;\nexport type DTOAccessTokenFull = z.infer<typeof DTOAccessTokenFull>;\nexport type DTOAccessTokenListResponse = z.infer<typeof DTOAccessTokenListResponse>;\nexport type DTOAccessTokenResponse = z.infer<typeof DTOAccessTokenResponse>;\nexport type DTOAccessTokenFullResponse = z.infer<typeof DTOAccessTokenFullResponse>;\n\n//\n// Write\n//\n\nexport const DTOAccessTokenCreatePayload = z.object({\n name: z.string(),\n scope: z.string().optional(),\n});\n\nexport type DTOAccessTokenCreatePayload = z.infer<typeof DTOAccessTokenCreatePayload>;\n","import { z } from \"zod\";\n\nexport const DTOColorTokenInlineData = z.object({\n value: z.string().regex(/^#[a-f0-9]{6,8}$/),\n});\n\nexport type DTOColorTokenInlineData = z.infer<typeof DTOColorTokenInlineData>;\n","import { z } from \"zod\";\n\nexport const DTOObjectMeta = z.object({\n name: z.string().max(512),\n description: z.string().max(2048).optional(),\n});\n\nexport type DTOObjectMeta = z.infer<typeof DTOObjectMeta>;\n","import { z } from \"zod\";\n\nexport const DTOPagination = z.object({\n limit: z.string().optional(),\n offset: z.string().optional(),\n});\n\nexport type DTOPagination = z.infer<typeof DTOPagination>;\n","import { z } from \"zod\";\nimport { DTOBrand, DTODesignSystem, DTODesignSystemVersion } from \"../design-systems\";\nimport { DTOUserWorkspaceMembership } from \"../workspaces\";\n\nexport const DTOAppBootstrapDataQuery = z.object({\n preferredWorkspaceId: z.string().optional(),\n preferredDesignSystemId: z.string().optional(),\n preferredVersionId: z.string().optional(),\n preferredBrandId: z.string().optional(),\n});\n\nexport const DTOAppBootstrapDataResponse = z.object({\n workspaceMembership: DTOUserWorkspaceMembership.optional(),\n designSystem: DTODesignSystem.optional(),\n version: DTODesignSystemVersion.optional(),\n brand: DTOBrand.optional(),\n});\n\nexport type DTOAppBootstrapDataQuery = z.infer<typeof DTOAppBootstrapDataQuery>;\nexport type DTOAppBootstrapDataResponse = z.infer<typeof DTOAppBootstrapDataResponse>;\n","import { ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOObjectMeta } from \"../aux\";\n\n//\n// Read\n//\n\nexport const DTOBrand = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n meta: ObjectMeta,\n});\n\nexport const DTOBrandGetResponse = z.object({ brand: DTOBrand });\n\nexport const DTOBrandCreateResponse = z.object({\n brand: DTOBrand,\n});\n\nexport const DTOBrandsListResponse = z.object({ brands: z.array(DTOBrand) });\n\nexport type DTOBrand = z.infer<typeof DTOBrand>;\nexport type DTOBrandGetResponse = z.infer<typeof DTOBrandGetResponse>;\nexport type DTOBrandCreateResponse = z.infer<typeof DTOBrandCreateResponse>;\nexport type DTOBrandsListResponse = z.infer<typeof DTOBrandsListResponse>;\n\n//\n// Write\n//\n\nexport const DTOBrandCreatePayload = z.object({\n persistentId: z.string().uuid(),\n meta: DTOObjectMeta,\n});\n\nexport const DTOBrandUpdatePayload = z.object({\n meta: DTOObjectMeta.optional(),\n persistentId: z.string(),\n});\n\nexport type DTOBrandCreatePayload = z.infer<typeof DTOBrandCreatePayload>;\nexport type DTOBrandUpdatePayload = z.infer<typeof DTOBrandUpdatePayload>;\n","import {\n AnalyzeCodeComponentsInPackage,\n CodeComponent,\n CodeComponentParentType,\n CodeComponentProperty,\n CodeComponentResolvedType,\n CodeComponentResolvedTypeKind,\n CodeComponentUpsertResponse,\n DependencyDefinition,\n Registry,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOCodeComponentResolvedTypeKind = CodeComponentResolvedTypeKind;\n\nexport const DTOCodeComponentResolvedType = CodeComponentResolvedType;\n\nexport const DTOCodeComponentParentType = CodeComponentParentType;\n\nexport const DTOCodeComponentProperty = CodeComponentProperty;\n\nexport const DTOCodeComponent = CodeComponent;\n\nexport const DTOCodeComponentResponse = z.object({\n codeComponent: DTOCodeComponent,\n});\n\nexport const DTOCodeComponentListResponse = z.object({\n codeComponents: DTOCodeComponent.array(),\n});\n\nexport type DTOCodeComponentResolvedTypeKind = z.infer<typeof DTOCodeComponentResolvedTypeKind>;\nexport type DTOCodeComponentResolvedType = z.infer<typeof DTOCodeComponentResolvedType>;\nexport type DTOCodeComponentParentType = z.infer<typeof DTOCodeComponentParentType>;\nexport type DTOCodeComponentProperty = z.infer<typeof DTOCodeComponentProperty>;\nexport type DTOCodeComponent = z.infer<typeof DTOCodeComponent>;\nexport type DTOCodeComponentResponse = z.infer<typeof DTOCodeComponentResponse>;\nexport type DTOCodeComponentListResponse = z.infer<typeof DTOCodeComponentListResponse>;\n\n//\n// Write\n//\n\nexport const DTOCodeComponentCreateInput = z.object({\n persistentId: z.string(),\n exportName: z.string(),\n componentPath: z.string(),\n description: z.string(),\n properties: z.record(z.string(), DTOCodeComponentProperty),\n tags: z.record(z.string(), z.string()).nullable(),\n});\n\nexport const DTOCodeComponentsCreateInput = z.object({\n codeComponents: DTOCodeComponentCreateInput.array(),\n});\n\nexport const DTOCodeComponentUpsertResponse = CodeComponentUpsertResponse;\n\nexport type DTOCodeComponentCreateInput = z.infer<typeof DTOCodeComponentCreateInput>;\nexport type DTOCodeComponentsCreateInput = z.infer<typeof DTOCodeComponentsCreateInput>;\nexport type DTOCodeComponentUpsertResponse = z.infer<typeof DTOCodeComponentUpsertResponse>;\n\n//\n// Analyze\n//\n\nexport const DTOAnalyzeCodeComponentsInPackage = AnalyzeCodeComponentsInPackage;\nexport const DTODependencyDefinition = DependencyDefinition;\nexport const DTORegistry = Registry;\n\nexport const DTOAnalyzeCodeComponentsInPackageResponse = z.object({\n ok: z.literal(true),\n});\n\nexport const DTOAnalyzeCodeComponentsInPackageInput = AnalyzeCodeComponentsInPackage.omit({\n designSystemId: true,\n versionId: true,\n userAccessToken: true,\n});\n\nexport type DTOAnalyzeCodeComponentsInPackageInput = z.infer<typeof DTOAnalyzeCodeComponentsInPackageInput>;\nexport type DTOAnalyzeCodeComponentsInPackageResponse = z.infer<typeof DTOAnalyzeCodeComponentsInPackageResponse>;\nexport type DTOAnalyzeCodeComponentsInPackage = AnalyzeCodeComponentsInPackage;\nexport type DTODependencyDefinition = DependencyDefinition;\nexport type DTORegistry = Registry;\n","import { z } from \"zod\";\nimport { DTOObjectMeta } from \"../aux\";\n\n//\n// Read\n//\n\nexport const DTODesignSystemComponent = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n brandId: z.string(),\n meta: DTOObjectMeta,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTODesignSystemComponentResponse = z.object({\n designSystemComponent: DTODesignSystemComponent,\n});\n\nexport const DTODesignSystemComponentListResponse = z.object({\n designSystemComponents: DTODesignSystemComponent.array(),\n});\n\nexport type DTODesignSystemComponent = z.infer<typeof DTODesignSystemComponent>;\nexport type DTODesignSystemComponentResponse = z.infer<typeof DTODesignSystemComponentResponse>;\nexport type DTODesignSystemComponentListResponse = z.infer<typeof DTODesignSystemComponentListResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignSystemComponentCreateInput = z.object({\n brandId: z.string(), // Persistent ID,\n persistentId: z.string(),\n meta: DTOObjectMeta,\n});\n\nexport type DTODesignSystemComponentCreateInput = z.infer<typeof DTODesignSystemComponentCreateInput>;\n","import { z } from \"zod\";\nimport { DTOUser } from \"../users\";\n\nexport const DTODesignSystemContactsResponse = z.object({\n contacts: z.object({\n workspace: z.array(DTOUser),\n designSystem: z.array(DTOUser),\n }),\n});\n\nexport type DTODesignSystemContactsResponse = z.infer<typeof DTODesignSystemContactsResponse>;\n","import { UserOnboardingDepartment, UserOnboardingJobLevel, UserSource, UserTheme } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOUser, DTOUserProfile } from \"./user\";\n\nexport const DTOUserOnboardingDepartment = UserOnboardingDepartment;\nexport const DTOUserOnboardingJobLevel = UserOnboardingJobLevel;\nexport const DTOUserSource = UserSource;\nexport const DTOUserTheme = UserTheme;\n\nexport const DTOUserOnboarding = z.object({\n companyName: z.string().optional(),\n numberOfPeopleInOrg: z.string().optional(),\n numberOfPeopleInDesignTeam: z.string().optional(),\n department: DTOUserOnboardingDepartment.optional(),\n jobTitle: z.string().optional(),\n phase: z.string().optional(),\n jobLevel: DTOUserOnboardingJobLevel.optional(),\n designSystemName: z.string().optional(),\n defaultDestination: z.string().optional(),\n isPageDraftOnboardingFinished: z.boolean().optional(),\n});\n\nexport const DTOAuthenticatedUserProfile = DTOUserProfile.extend({\n onboarding: DTOUserOnboarding.optional(),\n theme: DTOUserTheme.optional(),\n});\n\nexport const DTOAuthenticatedUser = DTOUser.extend({\n profile: DTOAuthenticatedUserProfile,\n createdAt: z.coerce.date(),\n loggedOutAt: z.coerce.date().optional(),\n source: DTOUserSource.optional(),\n});\n\nexport const DTOAuthenticatedUserResponse = z.object({\n user: DTOAuthenticatedUser,\n});\n\nexport type DTOUserOnboardingDepartment = z.infer<typeof DTOUserOnboardingDepartment>;\nexport type DTOUserOnboardingJobLevel = z.infer<typeof DTOUserOnboardingJobLevel>;\nexport type DTOUserSource = z.infer<typeof DTOUserSource>;\nexport type DTOUserTheme = z.infer<typeof DTOUserTheme>;\nexport type DTOUserOnboarding = z.infer<typeof DTOUserOnboarding>;\nexport type DTOAuthenticatedUserProfile = z.infer<typeof DTOAuthenticatedUserProfile>;\nexport type DTOAuthenticatedUser = z.infer<typeof DTOAuthenticatedUser>;\nexport type DTOAuthenticatedUserResponse = z.infer<typeof DTOAuthenticatedUserResponse>;\n","import { UserProfileUpdate } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n/**\n * Definition of a user profile as inspectable by other users (i.e. reduced version)\n */\nexport const DTOUserProfile = z.object({\n name: z.string(),\n nickname: z.string().optional(),\n avatar: z.string().optional(),\n});\n\n/**\n * Definition of a user as inspectable by other users (i.e. reduced version)\n */\nexport const DTOUser = z.object({\n id: z.string(),\n email: z.string(),\n profile: DTOUserProfile,\n});\n\nexport const DTOUserGetResponse = z.object({\n user: DTOUser,\n});\n\nexport const DTOUserProfileUpdate = UserProfileUpdate;\n\nexport type DTOUserProfile = z.infer<typeof DTOUserProfile>;\nexport type DTOUser = z.infer<typeof DTOUser>;\nexport type DTOUserGetResponse = z.infer<typeof DTOUserGetResponse>;\nexport type DTOUserProfileUpdate = z.infer<typeof DTOUserProfileUpdate>;\n","import { User } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOUserProfileUpdateResponse = z.object({\n user: User,\n});\n\nexport type DTOUserProfileUpdateResponse = z.infer<typeof DTOUserProfileUpdateResponse>;\n","import {\n DataSourceAutoImportMode,\n DataSourceFigmaScope,\n DataSourceFigmaState,\n DataSourceRemoteType,\n DataSourceStats,\n DataSourceUploadImportMetadata,\n DataSourceUploadRemoteSource,\n SourceImportStorybookSummary,\n SourceImportSummary,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODataSourceFigmaScope = DataSourceFigmaScope;\n\nconst DTODataSourceFigmaFileVersion = z.object({\n id: z.string(),\n created_at: z.coerce.date(),\n label: z.string(),\n description: z.string(),\n});\n\nexport const DTODataSourceFigmaCloud = z.object({\n fileId: z.string(),\n state: DataSourceFigmaState,\n autoImportMode: DataSourceAutoImportMode,\n fileThumbnailUrl: z.string().optional(),\n lastImportResult: SourceImportSummary.nullish(),\n lastImportedAt: z.coerce.date().nullish(),\n lastImportedVersion: DTODataSourceFigmaFileVersion.nullish(),\n lastUpdatesCheckedAt: z.date().nullish(),\n ownerId: z.string(),\n ownerUserName: z.string().optional(),\n preferredCredentialId: z.string().optional(),\n stats: DataSourceStats,\n});\n\nexport const DTODataSourceFigma = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.Figma),\n fileName: z.string(),\n scope: DTODataSourceFigmaScope,\n brandId: z.string(),\n themeId: z.string().nullish(),\n cloud: DTODataSourceFigmaCloud.nullish(),\n sortOrder: z.number().optional(),\n});\n\n// TS is not yet implemented in new BE\nexport const DTODataSourceTokenStudio = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.TokenStudio),\n fileName: z.string(),\n brandId: z.string(),\n themeId: z.string().nullish(),\n sortOrder: z.number().optional(),\n tokenStudio: z.object({\n settings: z.object({\n dryRun: z.boolean(),\n verbose: z.boolean(),\n preciseCopy: z.boolean(),\n }),\n connectionName: z.string(),\n lastImportedAt: z.coerce.date(),\n lastImportedResults: z.array(\n z.object({\n mapping: z.object({\n tokenSets: z.array(z.string()),\n supernovaBrand: z.string(),\n supernovaTheme: z.string().optional(),\n }),\n isFailed: z.boolean(),\n tokensCreated: z.number(),\n tokensDeleted: z.number(),\n tokensUpdated: z.number(),\n })\n ),\n }),\n});\n\nexport const DTODataSourceFigmaVariablesPlugin = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),\n fileName: z.string(),\n brandId: z.string(),\n sortOrder: z.number().optional(),\n upload: z.object({\n remoteId: z.string(),\n remoteSourceType: DataSourceUploadRemoteSource,\n lastImportedAt: z.coerce.date().optional(),\n lastImportMetadata: DataSourceUploadImportMetadata.optional(),\n isTokenTypeSplitEnabled: z.boolean(),\n }),\n figmaVariablesPlugin: z.object({\n fileId: z.string(),\n lastImportedAt: z.coerce.date().optional(),\n lastImportMetadata: DataSourceUploadImportMetadata.optional(),\n isTokenTypeSplitEnabled: z.boolean(),\n isCollectionsMigrationCompleted: z.boolean().default(false),\n }),\n});\n\nexport const DTODataSourceStorybook = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.Storybook),\n fileName: z.string(),\n brandId: z.string(),\n sortOrder: z.number().optional(),\n storybook: z.object({\n indexUrl: z.string(),\n userUrl: z.string(),\n lastImportedAt: z.coerce.date().optional(),\n lastImportedResult: SourceImportStorybookSummary.optional(),\n lastImportedSuccessfully: z.coerce.date().optional(),\n isFailed: z.boolean(),\n storiesCount: z.number(),\n docsCount: z.number(),\n description: z.string().optional(),\n isUsingVpn: z.boolean().optional(),\n }),\n});\n\nexport const DTODataSourcesStorybookResponse = z.object({\n isFailed: z.boolean(),\n storiesCount: z.number(),\n docsCount: z.number(),\n created: z.array(z.string()).optional(),\n updated: z.array(z.string()).optional(),\n deleted: z.array(z.string()).optional(),\n});\n\nexport const DTODataSource = z.discriminatedUnion(\"type\", [\n DTODataSourceFigma,\n DTODataSourceFigmaVariablesPlugin,\n DTODataSourceTokenStudio,\n DTODataSourceStorybook,\n]);\n\nexport const DTODataSourcesListResponse = z.object({\n sources: z.array(DTODataSource),\n});\n\nexport const DTODataSourceResponse = z.object({\n source: DTODataSource,\n});\n\nexport type DTODataSourceFigma = z.infer<typeof DTODataSourceFigma>;\nexport type DTODataSourceTokenStudio = z.infer<typeof DTODataSourceTokenStudio>;\nexport type DTODataSourceFigmaVariablesPlugin = z.infer<typeof DTODataSourceFigmaVariablesPlugin>;\nexport type DTODataSourceStorybook = z.infer<typeof DTODataSourceStorybook>;\nexport type DTODataSource = z.infer<typeof DTODataSource>;\nexport type DTODataSourceResponse = z.infer<typeof DTODataSourceResponse>;\nexport type DTODataSourcesListResponse = z.infer<typeof DTODataSourcesListResponse>;\nexport type DTODataSourcesStorybookResponse = z.infer<typeof DTODataSourcesStorybookResponse>;\n\n//\n// Write\n//\n\nexport const DTODataSourceFigmaCreatePayload = z.object({\n brandPersistentId: z.string(),\n figmaFileUrl: z.string(),\n scope: DTODataSourceFigmaScope,\n autoImportMode: DataSourceAutoImportMode,\n});\n\nexport const DTODataSourceFigmaImportPayload = z.object({\n sourceIds: z.array(z.string()),\n});\n\nexport const DTODataSourceStorybookCreatePayload = z.object({\n brandPersistentId: z.string(),\n fileName: z.string().optional(),\n userUrl: z.string(),\n indexUrl: z.string(),\n payload: z.unknown(),\n type: z.literal(DataSourceRemoteType.Enum.Storybook),\n description: z.string().optional(),\n isUsingVpn: z.boolean().optional(),\n});\n\nexport const DTOStorybookImportPayload = z.object({\n sourceId: z.string(),\n payload: z.unknown(),\n});\n\nexport const DTOStorybookSourceUpdatePayload = z.object({\n description: z.string().nullish().optional(),\n isUsingVpn: z.boolean().optional(),\n fileName: z.string().optional(),\n});\n\nexport const DTOFigmaSourceUpdatePayload = z.object({\n themeId: z.string().optional(),\n scope: DataSourceFigmaScope.optional(),\n autoImportMode: DataSourceAutoImportMode.optional(),\n});\n\nexport type DTODataSourceFigmaScope = z.infer<typeof DTODataSourceFigmaScope>;\nexport type DTODataSourceFigmaCreatePayload = z.infer<typeof DTODataSourceFigmaCreatePayload>;\nexport type DTODataSourceStorybookCreatePayload = z.infer<typeof DTODataSourceStorybookCreatePayload>;\nexport type DTODataSourceFigmaImportPayload = z.infer<typeof DTODataSourceFigmaImportPayload>;\nexport type DTOStorybookImportPayload = z.infer<typeof DTOStorybookImportPayload>;\nexport type DTOStorybookSourceUpdatePayload = z.infer<typeof DTOStorybookSourceUpdatePayload>;\nexport type DTOFigmaSourceUpdatePayload = z.infer<typeof DTOFigmaSourceUpdatePayload>;\n","import { DesignSystem, DesignSystemAccessMode, ObjectMeta, WorkspaceRoleSchema } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODesignSystemMembersUpdatePayload } from \"./members\";\nimport { DTODesignSystemRole } from \"./role\";\n\n//\n// Read\n//\n\nexport const DTODesignSystem = DesignSystem.omit({\n name: true,\n description: true,\n docExporterId: true,\n}).extend({\n meta: ObjectMeta,\n docExporterId: z.string(),\n sources: z.array(z.any()),\n isPublic: z.literal(true),\n\n /**\n * Whether or not user who is requesting the design system\n * has access to the design system's contents.\n */\n isAvailableToUser: z.boolean(),\n\n /**\n * @deprecated\n */\n role: WorkspaceRoleSchema.optional(),\n\n /**\n * User's role within the design system that can come either from\n * the design system or workspace.\n */\n effectiveRole: DTODesignSystemRole.optional(),\n});\n\nexport const DTODesignSystemResponse = z.object({\n designSystem: DTODesignSystem,\n});\n\nexport const DTODesignSystemsListResponse = z.object({\n designSystems: DTODesignSystem.array(),\n});\n\nexport type DTODesignSystem = z.infer<typeof DTODesignSystem>;\nexport type DTODesignSystemResponse = z.infer<typeof DTODesignSystemResponse>;\nexport type DTODesignSystemsListResponse = z.infer<typeof DTODesignSystemsListResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignSystemCreateInput = z.object({\n workspaceId: z.string(),\n meta: ObjectMeta.optional(),\n name: z.string().min(2).max(64).optional(),\n description: z.string().max(1024).optional(),\n accessMode: DesignSystemAccessMode.optional(),\n\n invites: DTODesignSystemMembersUpdatePayload.pick({\n usersToInvite: true,\n invitesToInvite: true,\n emailsToInvite: true,\n }).optional(),\n});\n\nexport type DTODesignSystemCreateInput = z.infer<typeof DTODesignSystemCreateInput>;\n","import { DesignSystemMembershipUpdates } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODesignSystemRole } from \"./role\";\n\n//\n// Read\n//\n\nexport const DTODesignSystemMember = z.object({\n userId: z.string(),\n\n /**\n * Role that the member has in the design system,\n * undefined if set to inherit from workspace\n */\n designSystemRole: DTODesignSystemRole.optional(),\n});\n\nexport const DTODesignSystemInvitation = z.object({\n id: z.string(),\n workspaceInvitationId: z.string(),\n\n /**\n * Role that the invitation has in the design system,\n * undefined if set to inherit from workspace\n */\n designSystemRole: DTODesignSystemRole.optional(),\n});\n\nexport const DTODesignSystemMemberListResponse = z.object({\n members: DTODesignSystemMember.array(),\n invitations: DTODesignSystemInvitation.array(),\n});\n\nexport const DTODesignSystemMembersUpdateResponse = z.object({\n ok: z.literal(true),\n});\n\nexport type DTODesignSystemMember = z.infer<typeof DTODesignSystemMember>;\nexport type DTODesignSystemInvitation = z.infer<typeof DTODesignSystemInvitation>;\nexport type DTODesignSystemMemberListResponse = z.infer<typeof DTODesignSystemMemberListResponse>;\nexport type DTODesignSystemMembersUpdateResponse = z.infer<typeof DTODesignSystemMembersUpdateResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignSystemMembersUpdatePayload = DesignSystemMembershipUpdates;\n\nexport type DTODesignSystemMembersUpdatePayload = z.infer<typeof DTODesignSystemMembersUpdatePayload>;\n","import { WorkspaceRole } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODesignSystemRole = z.enum([\n WorkspaceRole.Admin,\n WorkspaceRole.Contributor,\n WorkspaceRole.Creator,\n WorkspaceRole.Viewer,\n]);\n\nexport type DTODesignSystemRole = z.infer<typeof DTODesignSystemRole>;\n","import { z } from \"zod\";\n\nexport const DTODiffCountBase = z.object({\n created: z.number(),\n updated: z.number(),\n deleted: z.number(),\n});\n\nexport const DTODesignElementsDataDiffResponse = z.object({\n tokens: DTODiffCountBase,\n assets: DTODiffCountBase,\n});\n\nexport type DTODesignElementsDataDiffResponse = z.infer<typeof DTODesignElementsDataDiffResponse>;\n","import { z } from \"zod\";\n\nconst DimensionsVariableScopeSchema = z.enum([\n \"CORNER_RADIUS\",\n \"WIDTH_HEIGHT\",\n \"GAP\",\n \"STROKE_FLOAT\",\n \"EFFECT_FLOAT\",\n \"OPACITY\",\n \"FONT_SIZE\",\n \"LINE_HEIGHT\",\n \"LETTER_SPACING\",\n \"PARAGRAPH_SPACING\",\n \"PARAGRAPH_INDENT\",\n \"FONT_WEIGHT\",\n]);\n\nconst StringVariableScopeSchema = z.enum([\"TEXT_CONTENT\", \"FONT_FAMILY\", \"FONT_STYLE\"]);\n\nexport type DimensionsVariableScopeType = z.infer<typeof DimensionsVariableScopeSchema>;\nexport const DimensionsVariableScopeType = DimensionsVariableScopeSchema.enum;\n\nexport type StringVariableScopeType = z.infer<typeof StringVariableScopeSchema>;\nexport const StringVariableScopeType = StringVariableScopeSchema.enum;\n\nconst VariableScope = z.string();\n\nconst ReferencedVariableOrigin = z.object({\n name: z.string(),\n remote: z.boolean(),\n});\n\nexport const RGB = z.object({\n r: z.number(),\n g: z.number(),\n b: z.number(),\n});\n\nexport const RGBA = RGB.extend({\n a: z.number(),\n});\n\nexport const VariableAlias = z.object({\n type: z.literal(\"VARIABLE_ALIAS\"),\n id: z.string(),\n resolvedValue: z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).optional(),\n referenceOrigin: ReferencedVariableOrigin.optional().or(z.null()),\n});\n\nexport const VariableValue = z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).or(VariableAlias);\nexport const ResolvedVariableType = z.enum([\"BOOLEAN\", \"FLOAT\", \"STRING\", \"COLOR\"]);\n\nexport const Variable = z.object({\n id: z.string(),\n name: z.string(),\n key: z.string(),\n variableCollectionId: z.string(),\n resolvedType: ResolvedVariableType,\n valuesByMode: z.record(VariableValue),\n remote: z.boolean(),\n description: z.string(),\n hiddenFromPublishing: z.boolean(),\n scopes: z.array(VariableScope),\n codeSyntax: z.record(z.any()).optional(),\n});\n\nexport const VariableMode = z.object({\n modeId: z.string(),\n name: z.string(),\n});\n\nexport const Collection = z.object({\n id: z.string(),\n name: z.string(),\n modes: z.array(VariableMode),\n defaultModeId: z.string(),\n remote: z.boolean(),\n hiddenFromPublishing: z.boolean(),\n});\n\nexport const VariablesMapping = z.object({\n variableCollections: z.array(z.string()).min(1),\n variableMode: z.string().min(1),\n supernovaBrand: z.string().min(1),\n supernovaTheme: z.string().min(1).optional().or(z.null()),\n});\n\nexport const FormattedCollections = z.object({\n variables: z.record(z.string(), Variable),\n variableCollections: z.record(z.string(), Collection),\n mappings: z.array(VariablesMapping).optional(),\n variablesOrder: z.string().array().optional(),\n});\n\n//\n// Types\n//\n\nexport type RGB = z.infer<typeof RGB>;\nexport type RGBA = z.infer<typeof RGBA>;\nexport type ResolvedVariableType = z.infer<typeof ResolvedVariableType>;\nexport type Variable = z.infer<typeof Variable>;\nexport type VariableAlias = z.infer<typeof VariableAlias>;\nexport type VariableValue = z.infer<typeof VariableValue>;\nexport type VariableMode = z.infer<typeof VariableMode>;\nexport type Collection = z.infer<typeof Collection>;\nexport type VariablesMapping = z.infer<typeof VariablesMapping>;\nexport type FormattedCollections = z.infer<typeof FormattedCollections>;\n","import { AssetScope } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOAssetScope = AssetScope;\n\nexport const DTOFileUploadItem = z.object({\n size: z.number(),\n name: z.string(),\n checksum: z.string(),\n scope: DTOAssetScope.exclude([\"ComponentThumbnail\", \"DocumentationFrame\"]).optional(),\n});\n\nexport const DTOFileUploadPayload = z.object({\n files: z.array(DTOFileUploadItem),\n});\n\nexport const DTOFileUploadResponseItem = z.object({\n fileId: z.string(),\n referencePersistentId: z.string(),\n name: z.string(),\n checksum: z.string(),\n pendingUpload: z.boolean().optional(),\n url: z.string(),\n size: z.number(),\n});\n\nexport const DTOFileResponseItem = DTOFileUploadResponseItem;\n\nexport const DTOUploadUrlItem = z.object({\n fileId: z.string(),\n uploadUrl: z.string(),\n});\n\nexport const DTOFileUploadResponse = z.object({\n files: z.array(DTOFileUploadResponseItem),\n uploadUrls: z.array(DTOUploadUrlItem),\n});\n\n/**\n * @deprecated Use GET method with DTOFilesGetQuery\n */\nexport const DTOFilesGetPayload = z.object({\n persistentIds: z.string().array().optional(),\n});\n\nexport const DTOFilesGetQuery = z.object({\n includeScope: DTOAssetScope.optional(),\n});\n\nexport const DTOFilesResponse = z.object({\n files: z.array(DTOFileResponseItem),\n});\n\nexport const DTOFileUploadFinalizePayload = z.object({\n fileIds: z.array(z.string()),\n});\n\nexport const DTOFileUploadFinalizeResponse = z.object({ ok: z.literal(true) });\n\nexport type DTOFileUploadItem = z.infer<typeof DTOFileUploadItem>;\nexport type DTOFileUploadPayload = z.infer<typeof DTOFileUploadPayload>;\nexport type DTOFileUploadResponseItem = z.infer<typeof DTOFileUploadResponseItem>;\nexport type DTOUploadUrlItem = z.infer<typeof DTOUploadUrlItem>;\nexport type DTOFileUploadResponse = z.infer<typeof DTOFileUploadResponse>;\nexport type DTOFileUploadFinalizePayload = z.infer<typeof DTOFileUploadFinalizePayload>;\nexport type DTOFileUploadFinalizeResponse = z.infer<typeof DTOFileUploadFinalizeResponse>;\nexport type DTOFileResponseItem = z.infer<typeof DTOFileResponseItem>;\nexport type DTOFilesGetPayload = z.infer<typeof DTOFilesGetPayload>;\nexport type DTOFilesResponse = z.infer<typeof DTOFilesResponse>;\nexport type DTOFilesGetQuery = z.infer<typeof DTOFilesGetQuery>;\nexport type DTOAssetScope = z.infer<typeof DTOAssetScope>;\n","import {\n DataSourceAutoImportMode,\n DataSourceFigmaScope,\n DataSourceRemoteType,\n ImportJobState,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOImportJob = z.object({\n id: z.string(),\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n operation: z.literal(\"Import\"),\n createdAt: z.coerce.date(),\n stateChangedAt: z.coerce.date(),\n state: ImportJobState,\n sourceIds: z.string().array(),\n});\n\nexport const DTOImportJobResponse = z.object({\n job: DTOImportJob,\n});\n\nexport type DTOImportJob = z.infer<typeof DTOImportJob>;\nexport type DTOImportJobResponse = z.infer<typeof DTOImportJobResponse>;\n\n//\n// Write\n//\n\nexport const DTOBffFigmaImportRequestBody = z.object({\n type: z.literal(DataSourceRemoteType.Enum.Figma),\n brandPersistentId: z.string().optional(),\n fileId: z.string(),\n scope: DataSourceFigmaScope,\n autoImportMode: DataSourceAutoImportMode,\n});\n\nexport const DTOBffUploadImportRequestBody = z.object({\n type: z\n .enum([DataSourceRemoteType.Enum.FigmaVariablesPlugin, \"Upload\"])\n .transform(v => DataSourceRemoteType.Enum.FigmaVariablesPlugin),\n brandPersistentId: z.string().optional(),\n sourceName: z.string().optional(),\n remoteId: z.string(),\n isTokenTypeSplitEnabled: z.boolean().optional(),\n payload: z.any(),\n});\n\nexport const DTOBffImportRequestBody = z.discriminatedUnion(\"type\", [\n DTOBffFigmaImportRequestBody,\n DTOBffUploadImportRequestBody,\n]);\n\nexport type DTOBffFigmaImportRequestBody = z.infer<typeof DTOBffFigmaImportRequestBody>;\nexport type DTOBffUploadImportRequestBody = z.infer<typeof DTOBffUploadImportRequestBody>;\nexport type DTOBffImportRequestBody = z.infer<typeof DTOBffImportRequestBody>;\n","import { z } from \"zod\";\n\nexport const DTOPageRedirectCreateBody = z.object({\n pagePersistentId: z.string(),\n path: z.string(),\n});\n\nexport const DTOPageRedirectUpdateBody = DTOPageRedirectCreateBody.partial();\n\nexport const DTOPageRedirect = z.object({\n id: z.string(),\n pagePersistentId: z.string(),\n path: z.string(),\n});\n\nexport const DTOPageRedirectListResponse = z.object({\n redirects: DTOPageRedirect.array(),\n});\n\nexport const DTOPageRedirectResponse = z.object({\n redirect: DTOPageRedirect,\n});\n\nexport const DTOPageRedirectDeleteResponse = z.object({\n success: z.boolean(),\n});\n\nexport type DTOPageRedirectCreateBody = z.infer<typeof DTOPageRedirectCreateBody>;\nexport type DTOPageRedirectUpdateBody = z.infer<typeof DTOPageRedirectUpdateBody>;\nexport type DTOPageRedirect = z.infer<typeof DTOPageRedirect>;\nexport type DTOPageRedirectListResponse = z.infer<typeof DTOPageRedirectListResponse>;\nexport type DTOPageRedirectResponse = z.infer<typeof DTOPageRedirectResponse>;\nexport type DTOPageRedirectDeleteResponse = z.infer<typeof DTOPageRedirectDeleteResponse>;\n","import { z } from \"zod\";\n\nexport const DTODesignSystemVersionStats = z.object({\n tokens: z.number(),\n designSystemComponents: z.number(),\n assets: z.number(),\n documentationPages: z.number(),\n figmaComponents: z.number(),\n});\n\nexport const DTODesignSystemVersionStatsQuery = z.object({\n /**\n * Unique ID across versions (non-persistent ID)\n */\n brandId: z.string().optional(),\n});\n\nexport type DTODesignSystemVersionStats = z.infer<typeof DTODesignSystemVersionStats>;\nexport type DTODesignSystemVersionStatsQuery = z.infer<typeof DTODesignSystemVersionStatsQuery>;\n","import { z } from \"zod\";\n\nexport const DTOStorybookUploadUrlRequest = z.object({\n name: z.string(),\n});\n\nexport const DTOStorybookUploadUrlResponse = z.object({\n signedUrl: z.string(),\n storybookUploadId: z.string(),\n});\n\nexport const DTOStorybookAccessTokenResponse = z.object({\n accessToken: z.string(),\n});\n\nexport const DTOStorybookAccessTokenPayload = z.object({\n designSystemId: z.string(),\n storybookUploadId: z.string(),\n});\n\nexport const DTOStorybookUploadStatus = z.object({\n status: z.enum([\"Failed\", \"InProgress\", \"Completed\", \"Unknown\"]),\n timestamp: z.number().optional(),\n reason: z.string().optional(),\n});\n\nexport const DTOStorybookEntryOrigin = z.object({\n id: z.string(),\n type: z.enum([\"story\", \"docs\"]),\n name: z.string(),\n title: z.string(),\n});\n\nexport const DTOStorybookEntry = z.object({\n id: z.string(),\n storyId: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n aliases: z.array(z.string()).optional(),\n url: z.string(),\n isDeleted: z.boolean().optional(),\n origin: DTOStorybookEntryOrigin,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTOStorybookEntryReplaceAction = z.object({\n newStoryId: z.string(),\n});\n\nexport const DTOStorybookEntryListResponse = z.object({ entries: z.array(DTOStorybookEntry) });\nexport const DTOStorybookEntryResponse = z.object({ entry: DTOStorybookEntry });\n\nexport type DTOStorybookEntry = z.infer<typeof DTOStorybookEntry>;\nexport type DTOStorybookEntryOrigin = z.infer<typeof DTOStorybookEntryOrigin>;\nexport type DTOStorybookEntryReplaceAction = z.infer<typeof DTOStorybookEntryReplaceAction>;\nexport type DTOStorybookEntryListResponse = z.infer<typeof DTOStorybookEntryListResponse>;\nexport type DTOStorybookEntryResponse = z.infer<typeof DTOStorybookEntryResponse>;\nexport type DTOStorybookUploadUrlRequest = z.infer<typeof DTOStorybookUploadUrlRequest>;\nexport type DTOStorybookUploadUrlResponse = z.infer<typeof DTOStorybookUploadUrlResponse>;\nexport type DTOStorybookAccessTokenResponse = z.infer<typeof DTOStorybookAccessTokenResponse>;\nexport type DTOStorybookAccessTokenPayload = z.infer<typeof DTOStorybookAccessTokenPayload>;\nexport type DTOStorybookUploadStatus = z.infer<typeof DTOStorybookUploadStatus>;\n","import { z } from \"zod\";\nimport { DTODesignSystem } from \"./design-system\";\nimport { DTOWorkspace } from \"../workspaces\";\n\nexport const DTOUserDesignSystemsResponse = z.object({\n designSystems: DTODesignSystem.array(),\n workspaces: DTOWorkspace.array(),\n});\n\nexport type DTOUserDesignSystemsResponse = z.infer<typeof DTOUserDesignSystemsResponse>;\n","import {\n ForgeChatMessage,\n ForgeChatMessageSender,\n ForgeChatMessageSenderType,\n ForgeChatThread,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOForgeChatMessage = ForgeChatMessage;\nexport type DTOForgeChatMessage = z.infer<typeof DTOForgeChatMessage>;\n\nexport const DTOForgeChatThread = ForgeChatThread;\nexport type DTOForgeChatThread = z.infer<typeof DTOForgeChatThread>;\n\nexport const DTOForgeChatMessageSenderType = ForgeChatMessageSenderType;\nexport type DTOForgeChatMessageSenderType = z.infer<typeof DTOForgeChatMessageSenderType>;\n\nexport const DTOForgeChatMessageSender = ForgeChatMessageSender;\nexport type DTOForgeChatMessageSender = z.infer<typeof DTOForgeChatMessageSender>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/chat-threads\n */\nexport const DTOForgeChatThreadCreateInput = z.object({\n title: z.string().optional(),\n});\nexport type DTOForgeChatThreadCreateInput = z.infer<typeof DTOForgeChatThreadCreateInput>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/threads\n */\nexport const DTOForgeChatThreadCreateResponse = z.object({\n thread: DTOForgeChatThread,\n});\nexport type DTOForgeChatThreadCreateResponse = z.infer<typeof DTOForgeChatThreadCreateResponse>;\n\n/**\n * PUT /api/v1/workspaces/{wsId}/forge/threads/{threadId}\n */\nexport const DTOForgeChatThreadUpdateInput = z.object({\n title: z.string(),\n});\nexport type DTOForgeChatThreadUpdateInput = z.infer<typeof DTOForgeChatThreadUpdateInput>;\n\n/**\n * PUT /api/v1/workspaces/{wsId}/forge/threads/{threadId}\n */\nexport const DTOForgeChatThreadUpdateResponse = z.object({\n thread: DTOForgeChatThread,\n});\nexport type DTOForgeChatThreadUpdateResponse = z.infer<typeof DTOForgeChatThreadUpdateResponse>;\n\n/**\n * DELETE /api/v1/workspaces/{wsId}/forge/threads/{threadId}\n */\nexport const DTOForgeChatThreadDeleteResponse = z.object({\n success: z.boolean(),\n});\nexport type DTOForgeChatThreadDeleteResponse = z.infer<typeof DTOForgeChatThreadDeleteResponse>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads\n */\nexport const DTOForgeChatThreadListQuery = z.object({\n limit: z.number().optional(),\n offset: z.number().optional(),\n});\nexport type DTOForgeChatThreadListQuery = z.infer<typeof DTOForgeChatThreadListQuery>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads\n */\nexport const DTOForgeChatThreadListResponse = z.object({\n threads: z.array(DTOForgeChatThread),\n pagination: z.object({\n offset: z.number(),\n limit: z.number(),\n total: z.number(),\n }),\n});\nexport type DTOForgeChatThreadListResponse = z.infer<typeof DTOForgeChatThreadListResponse>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageCreateInput = z.object({\n payload: z.string(),\n sender: DTOForgeChatMessageSender,\n});\n\nexport type DTOForgeChatMessageCreateInput = z.infer<typeof DTOForgeChatMessageCreateInput>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageCreateResponse = z.object({\n message: DTOForgeChatMessage,\n});\nexport type DTOForgeChatMessageCreateResponse = z.infer<typeof DTOForgeChatMessageCreateResponse>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageListQuery = z.object({\n limit: z\n .string()\n .optional()\n .transform(val => (val ? parseInt(val, 10) : undefined)),\n offset: z\n .string()\n .optional()\n .transform(val => (val ? parseInt(val, 10) : undefined)),\n});\n\nexport type DTOForgeChatMessageListQuery = z.infer<typeof DTOForgeChatMessageListQuery>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageListResponse = z.object({\n messages: z.array(DTOForgeChatMessage),\n totalCount: z.number(),\n hasMore: z.boolean(),\n});\n\nexport type DTOForgeChatMessageListResponse = z.infer<typeof DTOForgeChatMessageListResponse>;\n","import { z } from \"zod\";\n\nexport const DTOGitOrganization = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\nexport type DTOGitOrganization = z.infer<typeof DTOGitOrganization>;\n\nexport const DTOGitProject = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\nexport type DTOGitProject = z.infer<typeof DTOGitProject>;\n\nexport const DTOGitRepository = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n defaultBranch: z.string().optional(),\n});\nexport type DTOGitRepository = z.infer<typeof DTOGitRepository>;\n\nexport const DTOGitBranch = z.object({\n name: z.string(),\n lastCommitId: z.string(),\n});\nexport type DTOGitBranch = z.infer<typeof DTOGitBranch>;\n","import { ExtendedIntegrationType, IntegrationCredentials, IntegrationDesignSystem } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOIntegrationCredentials = IntegrationCredentials.omit({\n accessToken: true,\n refreshToken: true,\n});\n\nexport const DTOIntegration = z.object({\n id: z.string(),\n workspaceId: z.string(),\n type: ExtendedIntegrationType,\n createdAt: z.coerce.date(),\n integrationCredentials: z.array(DTOIntegrationCredentials).optional(),\n integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),\n});\n\nexport const DTOIntegrationOAuthGetResponse = z.object({\n url: z.string(),\n});\n\nexport const DTOIntegrationPostResponse = z.object({\n integration: DTOIntegration,\n});\n\nexport const DTOIntegrationsGetListResponse = z.object({\n integrations: DTOIntegration.array(),\n});\n\nexport type DTOIntegration = z.infer<typeof DTOIntegration>;\nexport type DTOIntegrationCredentials = z.infer<typeof DTOIntegrationCredentials>;\nexport type DTOIntegrationOAuthGetResponse = z.infer<typeof DTOIntegrationOAuthGetResponse>;\nexport type DTOIntegrationPostResponse = z.infer<typeof DTOIntegrationPostResponse>;\nexport type DTOIntegrationsGetListResponse = z.infer<typeof DTOIntegrationsGetListResponse>;\n","import { WorkspaceInvitation, WorkspaceRoleSchema } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOWorkspaceInvitationInput = z.object({\n email: z.string().email(),\n role: WorkspaceRoleSchema,\n});\n\nexport const DTOWorkspaceInvitationsListInput = z.object({\n invites: DTOWorkspaceInvitationInput.array().max(100),\n designSystemId: z.string().optional(),\n});\n\nexport const DTOWorkspaceInvitationsResponse = z.object({\n invitations: WorkspaceInvitation.array(),\n});\n\nexport const DTOWorkspaceInviteUpdate = z.object({\n role: WorkspaceRoleSchema,\n});\n\nexport const DTOWorkspaceInvitationUpdateResponse = z.object({\n invitation: WorkspaceInvitation,\n});\n\nexport type DTOWorkspaceInvitationInput = z.infer<typeof DTOWorkspaceInvitationInput>;\nexport type DTOWorkspaceInvitationsListInput = z.infer<typeof DTOWorkspaceInvitationsListInput>;\nexport type DTOWorkspaceInvitationsResponse = z.infer<typeof DTOWorkspaceInvitationsResponse>;\nexport type DTOWorkspaceInviteUpdate = z.infer<typeof DTOWorkspaceInviteUpdate>;\nexport type DTOWorkspaceInvitationUpdateResponse = z.infer<typeof DTOWorkspaceInvitationUpdateResponse>;\n","import { z } from \"zod\";\nimport { DTOWorkspace } from \"./workspace\";\nimport { User, WorkspaceRoleSchema } from \"@supernova-studio/model\";\n\n//\n// Read\n//\n\nexport const DTOWorkspaceRole = z.enum([\"Owner\", \"Admin\", \"Creator\", \"Viewer\", \"Billing\", \"Contributor\"]);\n\nexport const DTOUserWorkspaceMembership = z.object({\n // Workspace the user is a member of\n workspace: DTOWorkspace,\n\n // Assigned role the user has in the workspace\n role: DTOWorkspaceRole,\n\n // Role that determines actual permissions the user has in the workspace\n // E.g. this is different from the default role when editors are downgraded to viewers\n // when a workspace's subscription is downgraded to free tier\n effectiveRole: DTOWorkspaceRole,\n});\n\nexport const DTOWorkspaceMember = z.object({\n user: User,\n role: WorkspaceRoleSchema,\n effectiveRole: WorkspaceRoleSchema,\n});\n\nexport const DTOUserWorkspaceMembershipsResponse = z.object({\n membership: z.array(DTOUserWorkspaceMembership),\n});\n\nexport const DTOWorkspaceMembersListResponse = z.object({\n members: z.array(DTOWorkspaceMember),\n});\n\nexport type DTOWorkspaceRole = z.infer<typeof DTOWorkspaceRole>;\nexport type DTOUserWorkspaceMembership = z.infer<typeof DTOUserWorkspaceMembership>;\nexport type DTOUserWorkspaceMembershipsResponse = z.infer<typeof DTOUserWorkspaceMembershipsResponse>;\nexport type DTOWorkspaceMembersListResponse = z.infer<typeof DTOWorkspaceMembersListResponse>;\n","import { Subscription, WorkspaceProfile } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTONpmRegistryConfig } from \"./npm-registry\";\n\n//\n// Read\n//\n\nexport const DTOWorkspaceProfile = WorkspaceProfile;\n\nexport const DTOWorkspace = z.object({\n id: z.string(),\n profile: DTOWorkspaceProfile,\n subscription: Subscription,\n npmRegistry: DTONpmRegistryConfig.optional(),\n});\n\nexport type DTOWorkspaceProfile = z.infer<typeof DTOWorkspaceProfile>;\nexport type DTOWorkspace = z.infer<typeof DTOWorkspace>;\n\n//\n// Write\n//\n\nexport const DTOWorkspaceCreateInput = z.object({\n name: z.string(),\n});\n\nexport const DTOWorkspaceResponse = z.object({\n workspace: DTOWorkspace,\n});\n\nexport type DTOWorkspaceCreateInput = z.infer<typeof DTOWorkspaceCreateInput>;\nexport type DTOWorkspaceResponse = z.infer<typeof DTOWorkspaceResponse>;\n","import { NpmRegistryAuthType, NpmRegistryType, nullishToOptional } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTONpmRegistryConfigConstants = {\n passwordPlaceholder: \"redacted\",\n};\n\nexport const DTONpmRegistryConfig = z.object({\n // Registry basic configuration\n registryType: NpmRegistryType,\n registryUrl: z.string(),\n customRegistryUrl: z.string().optional(),\n\n // URL of Supernova NPM packages proxy\n proxyUrl: z.string(),\n\n // Auth configuration\n authType: NpmRegistryAuthType,\n accessToken: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),\n username: z.string().optional(),\n password: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),\n\n // NPM package scopes for whih the proxy should be enabled\n enabledScopes: z.array(z.string()),\n\n // True if client should bypass Supernova proxy and connect directly to the registry\n // (e.g. when the NPM registry is behind a VPN or firewall which prevents Supernova from accessing it)\n bypassProxy: z.boolean(),\n});\n\nexport const DTONpmRegistryAccessTokenResponse = z.object({\n version: z.number(),\n accessToken: z.string().optional(),\n registryUrl: z.string(),\n});\n\nexport const DTOUpdateRegistryInput = z.object({\n registryType: nullishToOptional(NpmRegistryType),\n authType: nullishToOptional(NpmRegistryAuthType),\n enabledScopes: nullishToOptional(z.array(z.string())),\n customRegistryUrl: nullishToOptional(z.string()),\n bypassProxy: nullishToOptional(z.boolean()),\n npmProxyVersion: nullishToOptional(z.number()),\n authHeaderName: nullishToOptional(z.string()),\n authHeaderValue: nullishToOptional(z.string()),\n accessToken: nullishToOptional(z.string()),\n username: nullishToOptional(z.string()),\n password: nullishToOptional(z.string()),\n});\n\nexport const DTOUpdateRegistryOutput = z.object({\n npmRegistrySettings: DTONpmRegistryConfig,\n});\n\nexport type DTONpmRegistryConfig = z.infer<typeof DTONpmRegistryConfig>;\nexport type DTONpmRegistryAccessTokenResponse = z.infer<typeof DTONpmRegistryAccessTokenResponse>;\nexport type DTOUpdateRegistryInput = z.infer<typeof DTOUpdateRegistryInput>;\nexport type DTOUpdateRegistryOutput = z.infer<typeof DTOUpdateRegistryOutput>;\n","import { WorkspaceUntypedData } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOWorkspaceUntypedData = WorkspaceUntypedData;\n\nexport const DTOWorkspaceUntypedDataListResponse = z.object({\n data: DTOWorkspaceUntypedData.array(),\n});\n\nexport const DTOWorkspaceUntypedDataResponse = z.object({\n data: DTOWorkspaceUntypedData,\n});\n\nexport type DTOWorkspaceUntypedData = z.infer<typeof DTOWorkspaceUntypedData>;\nexport type DTOWorkspaceUntypedDataListResponse = z.infer<typeof DTOWorkspaceUntypedDataListResponse>;\nexport type DTOWorkspaceUntypedDataResponse = z.infer<typeof DTOWorkspaceUntypedDataResponse>;\n\n//\n// Write\n//\n\nexport const DTOWorkspaceUntypedDataCreatePayload = z.object({\n value: z.unknown(),\n});\n\nexport const DTOWorkspaceUntypedDataUpdatePayload = z.object({\n value: z.unknown(),\n});\n\nexport type DTOWorkspaceUntypedDataCreatePayload = z.infer<typeof DTOWorkspaceUntypedDataCreatePayload>;\nexport type DTOWorkspaceUntypedDataUpdatePayload = z.infer<typeof DTOWorkspaceUntypedDataUpdatePayload>;\n","import { z } from \"zod\";\n\nexport const DTODesignSystemVersionRoom = z.object({\n id: z.string(),\n});\n\nexport const DTODesignSystemVersionRoomResponse = z.object({\n room: DTODesignSystemVersionRoom,\n});\n\nexport type DTODesignSystemVersionRoom = z.infer<typeof DTODesignSystemVersionRoom>;\nexport type DTODesignSystemVersionRoomResponse = z.infer<typeof DTODesignSystemVersionRoomResponse>;\n","import { ObjectMeta, VersionCreationJob } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOCreateVersionInput } from \"../../payloads\";\n\nexport const DTODesignSystemVersion = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n meta: ObjectMeta,\n version: z.string(),\n isReadonly: z.boolean(),\n changeLog: z.string(),\n designSystemId: z.string(),\n});\n\nexport const DTODesignSystemVersionsListResponse = z.object({\n designSystemVersions: z.array(DTODesignSystemVersion),\n});\n\nexport const DTODesignSystemVersionGetResponse = z.object({\n designSystemVersion: DTODesignSystemVersion,\n});\n\nexport const DTODesignSystemVersionCreationResponse = z.object({\n meta: ObjectMeta,\n version: z.string(),\n changeLog: z.string(),\n isReadOnly: z.boolean(),\n designSystemId: z.string(),\n jobId: z.string(),\n});\n\nexport const VersionSQSPayload = z.object({\n jobId: z.string(),\n designSystemId: z.string(),\n input: DTOCreateVersionInput,\n});\n\nexport type VersionSQSPayload = z.infer<typeof VersionSQSPayload>;\n\nexport type DTODesignSystemVersionCreationResponse = z.infer<typeof DTODesignSystemVersionCreationResponse>;\nexport type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;\nexport type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;\nexport type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;\n\nexport const DTODesignSystemVersionJobsResponse = z.object({\n jobs: z.array(VersionCreationJob),\n});\n\nexport type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;\n\n// Creation job status response\nexport const DTODesignSystemVersionJobStatusResponse = z.object({\n job: VersionCreationJob,\n});\n\nexport type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;\n","import { DesignSystem, DesignSystemAccessMode, ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODesignSystemUpdateInput = DesignSystem.partial()\n .omit({\n id: true,\n workspaceId: true,\n createdAt: true,\n updatedAt: true,\n docSlug: true,\n docViewUrl: true,\n accessMode: true,\n })\n .extend({\n meta: ObjectMeta.partial().optional(),\n });\n\nexport const DTODesignSystemUpdateAccessModeInput = z.object({\n accessMode: DesignSystemAccessMode,\n retain: z\n .object({\n userIds: z.string().array(),\n inviteIds: z.string().array(),\n })\n .optional(),\n});\n\nexport type DTODesignSystemUpdateInput = z.infer<typeof DTODesignSystemUpdateInput>;\nexport type DTODesignSystemUpdateAccessModeInput = z.infer<typeof DTODesignSystemUpdateAccessModeInput>;\n","import { z } from \"zod\";\n\nexport const ObjectMeta = z.object({\n name: z.string().max(150).optional(),\n description: z.string().max(2000).optional(),\n});\n\nexport function validateDesignSystemVersion(version: string) {\n const urlCompliantRegex = /^[a-zA-Z0-9+.-]+$/;\n return urlCompliantRegex.test(version);\n}\n\nexport const DTOCreateVersionInput = z.object({\n meta: ObjectMeta,\n version: z.string().refine(validateDesignSystemVersion, {\n message: \"Invalid semantic versioning format\",\n }),\n changeLog: z.string().optional(),\n});\n\nexport type DTOCreateVersionInput = z.infer<typeof DTOCreateVersionInput>;\n\nexport const DTOUpdateVersionInput = z.object({\n meta: ObjectMeta,\n version: z.string(), // required for PUT, but not editable\n changeLog: z.string(),\n});\n\nexport type DTOUpdateVersionInput = z.infer<typeof DTOUpdateVersionInput>;\n","import { z } from \"zod\";\n\n//\n// TO DELETE!\n//\n\n/**\n * @deprecated\n */\nexport const DTODocumentationAnalyticsTimeFrameComparison = z.object({\n referencePeriod: z.object({\n start: z.coerce.date(),\n end: z.coerce.date().optional(),\n }),\n baselinePeriod: z.object({\n start: z.coerce.date(),\n end: z.coerce.date().optional(),\n }),\n});\n\n/**\n * @deprecated\n */\nexport const DTODocumentationAnalyticsDiffPayload = z.object({\n timeFrames: z.array(DTODocumentationAnalyticsTimeFrameComparison),\n});\n\n/**\n * @deprecated\n */\nexport type DTODocumentationAnalyticsTimeFrameComparison = z.infer<typeof DTODocumentationAnalyticsTimeFrameComparison>;\n\n/**\n * @deprecated\n */\nexport type DTODocumentationAnalyticsDiffPayload = z.infer<typeof DTODocumentationAnalyticsDiffPayload>;\n","import { z } from \"zod\";\nimport { DTOPageBlockDefinition } from \"../../dto/documentation/block-definition\";\n\n//\n// Read\n//\n\nexport const DTOGetBlockDefinitionsQuery = z.object({\n files: z.coerce.boolean().optional(),\n});\n\nexport const DTOGetBlockDefinitionsOutput = z.object({\n definitions: z.array(DTOPageBlockDefinition),\n});\n\nexport type DTOGetBlockDefinitionsOutput = z.infer<typeof DTOGetBlockDefinitionsOutput>;\nexport type DTOGetBlockDefinitionsQuery = z.infer<typeof DTOGetBlockDefinitionsQuery>;\n","import {\n PageBlockColorV2,\n PageBlockDefinition,\n PageBlockDefinitionBehavior,\n PageBlockDefinitionItem,\n PageBlockDefinitionLayout,\n PageBlockDefinitionProperty,\n PageBlockDefinitionVariant,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOPageBlockDefinitionBehavior = PageBlockDefinitionBehavior;\nexport const DTOPageBlockDefinitionItem = PageBlockDefinitionItem;\nexport const DTOPageBlockDefinitionLayout = PageBlockDefinitionLayout;\nexport const DTOPageBlockDefinitionVariant = PageBlockDefinitionVariant;\nexport const DTOPageBlockDefinitionProperty = PageBlockDefinitionProperty;\nexport const DTOPageBlockColorV2 = PageBlockColorV2;\n\nexport const DTOPageBlockDefinition = PageBlockDefinition;\n\nexport type DTOPageBlockDefinitionBehavior = z.infer<typeof DTOPageBlockDefinitionBehavior>;\nexport type DTOPageBlockDefinitionItem = z.infer<typeof DTOPageBlockDefinitionItem>;\nexport type DTOPageBlockDefinitionLayout = z.infer<typeof DTOPageBlockDefinitionLayout>;\nexport type DTOPageBlockDefinitionVariant = z.infer<typeof DTOPageBlockDefinitionVariant>;\nexport type DTOPageBlockDefinitionProperty = z.infer<typeof DTOPageBlockDefinitionProperty>;\nexport type DTOPageBlockColorV2 = z.infer<typeof DTOPageBlockColorV2>;\n\nexport type DTOPageBlockDefinition = z.infer<typeof DTOPageBlockDefinition>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationPublishTypeQueryParams = z.object({\n environment: z.enum([\"Live\", \"Preview\"]),\n});\n\nexport type DTODocumentationPublishTypeQueryParams = z.infer<typeof DTODocumentationPublishTypeQueryParams>;\n","import {\n ExporterDestinationAzure,\n ExporterDestinationBitbucket,\n ExporterDestinationDocs,\n ExporterDestinationGithub,\n ExporterDestinationGitlab,\n ExporterDestinationS3,\n GitObjectsQuery,\n PipelineDestinationType,\n PipelineEventType,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyValueMap } from \"../../dto/export/exporter-property\";\n\nexport const GitDestinationOptions = z.object({\n branch: z.string().min(1).nullish(),\n commitMessage: z.string().min(1).nullish(),\n commitAuthorName: z.string().min(1).nullish(),\n commitAuthorEmail: z.string().email().nullish(),\n pullRequestTitle: z.string().min(1).nullish(),\n pullRequestDescription: z.string().min(1).nullish(),\n relativePath: z.string().nullish(),\n purgeDirectory: z.boolean().nullish(),\n});\n\nexport const DTOPipelineCreateBody = z.object({\n name: z.string(),\n exporterId: z.string(),\n designSystemId: z.string(),\n isEnabled: z.boolean(),\n eventType: PipelineEventType,\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n\n destination: PipelineDestinationType.optional(),\n gitQuery: GitObjectsQuery,\n destinations: z.object({\n s3: ExporterDestinationS3.nullish(),\n azure: ExporterDestinationAzure.nullish(),\n bitbucket: ExporterDestinationBitbucket.nullish(),\n github: ExporterDestinationGithub.nullish(),\n gitlab: ExporterDestinationGitlab.nullish(),\n documentation: ExporterDestinationDocs.nullish(),\n webhookUrl: z.string().nullish(),\n }),\n});\n\nexport const DTOPipelineUpdateBody = z.object({\n exporterId: z.string().optional(),\n name: z.string().optional(),\n isEnabled: z.boolean().optional(),\n eventType: PipelineEventType.optional(),\n\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n\n destination: PipelineDestinationType.optional(),\n gitQuery: GitObjectsQuery.optional(),\n\n destinations: z\n .object({\n s3: ExporterDestinationS3.nullish(),\n azure: ExporterDestinationAzure.nullish(),\n bitbucket: ExporterDestinationBitbucket.nullish(),\n github: ExporterDestinationGithub.nullish(),\n gitlab: ExporterDestinationGitlab.nullish(),\n documentation: ExporterDestinationDocs.nullish(),\n webhookUrl: z.string().nullish(),\n })\n .optional(),\n gitDestinationOptions: GitDestinationOptions.partial().optional(),\n});\n\nexport const DTOPipelineTriggerBody = z.object({\n designSystemVersionId: z.string(),\n});\n\nexport type GitDestinationOptions = z.infer<typeof GitDestinationOptions>;\nexport type DTOPipelineCreateBody = z.infer<typeof DTOPipelineCreateBody>;\nexport type DTOPipelineUpdateBody = z.infer<typeof DTOPipelineUpdateBody>;\nexport type DTOPipelineTriggerBody = z.infer<typeof DTOPipelineTriggerBody>;\n","import { z } from \"zod\";\n\n//\n// Primitives\n//\n\nconst PrimitiveValue = z.number().or(z.boolean()).or(z.string());\nconst ArrayValue = z.array(z.string());\nconst ObjectValue = z.record(z.string());\n\nexport const DTOExporterPropertyValue = PrimitiveValue.or(ArrayValue).or(ObjectValue);\nexport const DTOExporterPropertyType = z.enum([\"Enum\", \"Boolean\", \"String\", \"Number\", \"Array\", \"Object\", \"Code\"]);\n\nexport type DTOExporterPropertyDefinitionValue = z.infer<typeof DTOExporterPropertyValue>;\nexport type DTOExporterPropertyType = z.infer<typeof DTOExporterPropertyType>;\n\n//\n// Property\n//\n\nconst PropertyDefinitionBase = z.object({\n key: z.string(),\n title: z.string(),\n description: z.string(),\n category: z.string().optional(),\n dependsOn: z.record(z.boolean()).optional(),\n});\n\nexport type DTOPropertyDefinitionBase = z.infer<typeof PropertyDefinitionBase>;\nexport const DTOExporterPropertyDefinitionEnumOption = z.object({\n label: z.string(),\n description: z.string(),\n});\n\nexport const DTOExporterPropertyDefinitionEnum = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Enum),\n options: z.record(DTOExporterPropertyDefinitionEnumOption),\n default: z.string(),\n});\n\nexport const DTOExporterPropertyDefinitionBoolean = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Boolean),\n default: z.boolean(),\n});\n\nexport const DTOExporterPropertyDefinitionString = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.String),\n default: z.string(),\n isMultiline: z.boolean().optional(),\n});\n\nexport const DTOExporterPropertyDefinitionNumber = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Number),\n default: z.number(),\n});\n\nexport const DTOExporterPropertyDefinitionArray = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Array),\n default: ArrayValue,\n});\n\nexport const DTOExporterPropertyDefinitionObject = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Object),\n default: ObjectValue,\n allowedKeys: z\n .object({\n options: z.string().array(),\n type: z.string(),\n })\n .optional(),\n allowedValues: z\n .object({\n type: z.string(),\n })\n .optional(),\n});\n\nexport const DTOExporterPropertyDefinitionCode = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Code),\n language: z.string(),\n default: z.string(),\n});\n\nexport const DTOExporterPropertyDefinition = z.discriminatedUnion(\"type\", [\n DTOExporterPropertyDefinitionEnum,\n DTOExporterPropertyDefinitionBoolean,\n DTOExporterPropertyDefinitionString,\n DTOExporterPropertyDefinitionNumber,\n DTOExporterPropertyDefinitionArray,\n DTOExporterPropertyDefinitionObject,\n DTOExporterPropertyDefinitionCode,\n]);\n\nexport const DTOExporterPropertyDefinitionsResponse = z.object({\n properties: DTOExporterPropertyDefinition.array(),\n});\n\nexport type DTOExporterPropertyDefinitionEnum = z.infer<typeof DTOExporterPropertyDefinitionEnum>;\nexport type DTOExporterPropertyDefinitionBoolean = z.infer<typeof DTOExporterPropertyDefinitionBoolean>;\nexport type DTOExporterPropertyDefinitionString = z.infer<typeof DTOExporterPropertyDefinitionString>;\nexport type DTOExporterPropertyDefinitionNumber = z.infer<typeof DTOExporterPropertyDefinitionNumber>;\nexport type DTOExporterPropertyDefinitionArray = z.infer<typeof DTOExporterPropertyDefinitionArray>;\nexport type DTOExporterPropertyDefinitionObject = z.infer<typeof DTOExporterPropertyDefinitionObject>;\nexport type DTOExporterPropertyDefinitionCode = z.infer<typeof DTOExporterPropertyDefinitionCode>;\nexport type DTOExporterPropertyDefinition = z.infer<typeof DTOExporterPropertyDefinition>;\nexport type DTOExporterPropertyDefinitionEnumOption = z.infer<typeof DTOExporterPropertyDefinitionEnumOption>;\nexport type DTOExporterPropertyDefinitionsResponse = z.infer<typeof DTOExporterPropertyDefinitionsResponse>;\n\n//\n// Value\n//\n\nexport const DTOExporterPropertyValueMap = z.record(DTOExporterPropertyValue);\nexport type DTOExporterPropertyValueMap = z.infer<typeof DTOExporterPropertyValueMap>;\n","import { z } from \"zod\";\n\nexport const DTOLiveblocksAuthRequest = z.object({\n room: z.string().optional(),\n});\n\nexport type DTOLiveblocksAuthRequest = z.infer<typeof DTOLiveblocksAuthRequest>;\n","import { UserNotificationSettings } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOUpdateUserNotificationSettingsPayload = z.object({\n notificationSettings: UserNotificationSettings,\n});\n\nexport type DTOUpdateUserNotificationSettingsPayload = z.infer<typeof DTOUpdateUserNotificationSettingsPayload>;\n\n\nexport const DTOUserNotificationSettingsResponse = z.object({\n userId: z.string(),\n workspaceId: z.string(),\n notificationSettings: UserNotificationSettings,\n});\n\nexport type DTOUserNotificationSettingsResponse = z.infer<typeof DTOUserNotificationSettingsResponse>;\n","import { UserProfileUpdate } from \"@supernova-studio/model\";\n\n\nexport const DTOUserProfileUpdatePayload = UserProfileUpdate;\n","import { z } from \"zod\";\n\nexport const DTOTransferOwnershipPayload = z.object({\n newOwnerId: z.string(),\n});\n\nexport type DTOTransferOwnershipPayload = z.infer<typeof DTOTransferOwnershipPayload>;\n","import { z } from \"zod\";\nimport { SsoProvider, WorkspaceIpSettings, WorkspaceProfile } from \"@supernova-studio/model\";\n\nconst prohibitedSsoKeys = [\"providerId\", \"metadataXml\", \"emailDomains\"];\n\nexport function validateSsoPayload(ssoPayload: Partial<SsoProvider> | undefined) {\n const keys = [];\n let valid = true;\n if (!ssoPayload) {\n valid = true;\n return {\n valid,\n keys: [],\n };\n }\n for (const key of Object.keys(ssoPayload)) {\n if (prohibitedSsoKeys.includes(key)) {\n keys.push(key);\n valid = false;\n }\n }\n return {\n valid,\n keys,\n };\n}\n\nexport const NpmRegistryInput = z.object({\n enabledScopes: z.array(z.string()),\n customRegistryUrl: z.string().optional(),\n bypassProxy: z.boolean().optional(),\n npmProxyRegistryConfigId: z.string().optional(),\n npmProxyVersion: z.number().optional(),\n registryType: z.string(),\n authType: z.string(),\n authHeaderName: z.string(),\n authHeaderValue: z.string(),\n accessToken: z.string(),\n username: z.string(),\n password: z.string(),\n});\n\nexport const WorkspaceConfigurationPayload = z.object({\n ipWhitelist: WorkspaceIpSettings.partial().optional(),\n sso: SsoProvider.partial().optional(),\n npmRegistrySettings: NpmRegistryInput.partial().optional(),\n profile: WorkspaceProfile.partial().optional(),\n});\n\nexport type WorkspaceConfigurationPayload = z.infer<typeof WorkspaceConfigurationPayload>;\n","import { IntegrationToken, IntegrationType } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOWorkspaceIntegrationOauthInput = z.object({\n type: IntegrationType,\n});\n\nexport type DTOWorkspaceIntegrationOauthInput = z.infer<typeof DTOWorkspaceIntegrationOauthInput>;\n\nexport const DTOWorkspaceIntegrationPATInput = z.object({\n type: IntegrationType,\n token: IntegrationToken,\n});\n\nexport type DTOWorkspaceIntegrationPATInput = z.infer<typeof DTOWorkspaceIntegrationPATInput>;\n\nexport const DTOWorkspaceIntegrationGetGitObjectsInput = z.object({\n organization: z.string().optional(), // Azure Organization | Bitbucket Workspace slug | Gitlab Group and Sub-Groups | Github Account (User or Organization)\n project: z.string().optional(), // Only for Bitbucket and Azure\n repository: z.string().optional(), // For all providers. Pay attention for Gitlab, they call repositories \"projects\".\n branch: z.string().optional(), // For all providers, useful for PR creations.\n user: z.string().optional(), // Only for Gitlab User Repositories\n});\n\nexport type DTOWorkspaceIntegrationGetGitObjectsInput = z.infer<typeof DTOWorkspaceIntegrationGetGitObjectsInput>;\n","import { z } from \"zod\";\nimport { ElementPropertyTargetType, ElementViewBaseColumnType, ObjectMeta } from \"@supernova-studio/model\";\n\nexport const DTOElementViewColumnSharedAttributes = z.object({\n id: z.string(),\n persistentId: z.string(),\n width: z.number(),\n});\n\nexport const DTOElementViewBasePropertyColumn = DTOElementViewColumnSharedAttributes.extend({\n type: z.literal(\"BaseProperty\"),\n basePropertyType: ElementViewBaseColumnType,\n});\n\nexport const DTOElementViewPropertyDefinitionColumn = DTOElementViewColumnSharedAttributes.extend({\n type: z.literal(\"PropertyDefinition\"),\n propertyDefinitionId: z.string(),\n});\n\nexport const DTOElementViewThemeColumn = DTOElementViewColumnSharedAttributes.extend({\n type: z.literal(\"Theme\"),\n themeId: z.string(),\n});\n\nexport const DTOElementViewColumn = z.discriminatedUnion(\"type\", [\n DTOElementViewBasePropertyColumn,\n DTOElementViewPropertyDefinitionColumn,\n DTOElementViewThemeColumn,\n]);\n\nexport const DTOElementView = z.object({\n meta: ObjectMeta,\n persistentId: z.string(),\n targetElementType: ElementPropertyTargetType,\n id: z.string(),\n isDefault: z.boolean(),\n columns: z.array(DTOElementViewColumn),\n});\n\nexport const DTOElementViewsListResponse = z.object({\n elementDataViews: z.array(DTOElementView),\n});\n\nexport type DTOElementView = z.infer<typeof DTOElementView>;\nexport type DTOElementViewsListResponse = z.infer<typeof DTOElementViewsListResponse>;\n","import { CollectionOrigin, ColorTokenInlineData, ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOTokenCollection = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n\n meta: ObjectMeta,\n backgroundColor: ColorTokenInlineData.optional(),\n elementPropertyOptionId: z.string(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n origin: CollectionOrigin.optional(),\n});\n\nexport const DTOTokenCollectionsListReponse = z.object({\n collections: DTOTokenCollection.array(),\n});\n\nexport type DTOTokenCollection = z.infer<typeof DTOTokenCollection>;\nexport type DTOTokenCollectionsListReponse = z.infer<typeof DTOTokenCollectionsListReponse>;\n","import { DesignTokenOrigin, DesignTokenType, DesignTokenTypedData, ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODesignToken = DesignTokenTypedData.and(\n z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n meta: ObjectMeta,\n originStyle: DesignTokenOrigin.optional(),\n brandId: z.string(),\n collectionId: z.string().optional(),\n updatedAt: z.coerce.date(),\n })\n);\n\nexport const DTODesignTokenListResponse = z.object({\n tokens: DTODesignToken.array(),\n});\n\nexport const DTODesignTokenResponse = z.object({\n token: DTODesignToken,\n});\n\nexport const DTODesignTokenGroup = z.object({\n id: z.string(),\n tokenType: DesignTokenType,\n persistentId: z.string(),\n isRoot: z.boolean(),\n brandId: z.string(),\n meta: ObjectMeta,\n childrenIds: z.string().array(),\n});\n\nexport const DTODesignTokenGroupListResponse = z.object({\n groups: DTODesignTokenGroup.array(),\n});\n\nexport const DTODesignTokenGroupResponse = z.object({\n group: DTODesignTokenGroup,\n});\n\nexport type DTODesignToken = z.infer<typeof DTODesignToken>;\nexport type DTODesignTokenResponse = z.infer<typeof DTODesignTokenResponse>;\nexport type DTODesignTokenListResponse = z.infer<typeof DTODesignTokenListResponse>;\n\nexport type DTODesignTokenGroup = z.infer<typeof DTODesignTokenGroup>;\nexport type DTODesignTokenGroupListResponse = z.infer<typeof DTODesignTokenGroupListResponse>;\nexport type DTODesignTokenGroupResponse = z.infer<typeof DTODesignTokenGroupResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignTokenCreatePayload = DesignTokenTypedData.and(\n z.object({\n persistentId: z.string(),\n meta: ObjectMeta,\n brandId: z.string(),\n groupPersistentId: z.string().optional(),\n })\n);\n\nexport const DTODesignTokenGroupCreatePayload = z.object({\n persistentId: z.string(),\n meta: ObjectMeta,\n brandId: z.string(),\n parentId: z.string().optional(),\n tokenType: DesignTokenType,\n childrenIds: z.string().array(),\n});\n\nexport type DTODesignTokenCreatePayload = z.infer<typeof DTODesignTokenCreatePayload>;\nexport type DTODesignTokenGroupCreatePayload = z.infer<typeof DTODesignTokenGroupCreatePayload>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationAnalyticsTimeFrame = z.object({\n start: z.coerce.date(),\n end: z.coerce.date().optional(),\n});\n\nexport type DTODocumentationAnalyticsTimeFrame = z.infer<typeof DTODocumentationAnalyticsTimeFrame>;\n\n//\n// Read\n//\n\nexport const DTOPublishedDocVisitData = z.object({\n timestamp: z.coerce.date(),\n versionId: z.string(),\n locale: z.string().optional(),\n visits: z.number(),\n sessions: z.number(),\n});\n\nexport const DTOPublishedDocPageVisitData = DTOPublishedDocVisitData.extend({\n pagePersistentId: z.string(),\n});\n\n/**\n * Array of values per 2 hours (0, 2, 4, 6, etc)\n */\nconst DTOPublishedDocVisitHeatMapDay = z.number().array().length(12);\n\nexport const DTOPublishedDocVisitHeatMapWeek = z.object({\n /**\n * For which timeframe it was calculated\n */\n timeFrame: DTODocumentationAnalyticsTimeFrame,\n\n mon: DTOPublishedDocVisitHeatMapDay,\n tue: DTOPublishedDocVisitHeatMapDay,\n wed: DTOPublishedDocVisitHeatMapDay,\n thu: DTOPublishedDocVisitHeatMapDay,\n fri: DTOPublishedDocVisitHeatMapDay,\n sat: DTOPublishedDocVisitHeatMapDay,\n sun: DTOPublishedDocVisitHeatMapDay,\n});\n\nexport const DTOPublishedDocAnalyticsComparisonData = z.object({\n /**\n * For which timeframe it was calculated\n */\n timeFrame: DTODocumentationAnalyticsTimeFrame,\n\n priorVisitCount: z.number(),\n priorSessionCount: z.number(),\n currentVisitCount: z.number(),\n currentSessionCount: z.number(),\n});\n\nexport const DTOPublishedDocPageAnalyticsComparisonData = DTOPublishedDocAnalyticsComparisonData.extend({\n pagePersistentId: z.string(),\n});\n\nexport const DTODocumentationPageAnalyticsResponse = z.object({\n globalAnalytics: DTOPublishedDocVisitData.array(),\n pageAnalytics: DTOPublishedDocPageVisitData.array(),\n heatMapData: DTOPublishedDocVisitHeatMapWeek.array(),\n comparisonData: DTOPublishedDocAnalyticsComparisonData.array(),\n pageComparisonData: DTOPublishedDocPageAnalyticsComparisonData.array(),\n});\n\nexport const DTODocumentationAnalyticsRequest = z.object({\n timeFrames: z.array(DTODocumentationAnalyticsTimeFrame),\n});\n\nexport type DTOPublishedDocVisitHeatMapWeek = z.infer<typeof DTOPublishedDocVisitHeatMapWeek>;\nexport type DTOPublishedDocPageVisitData = z.infer<typeof DTOPublishedDocPageVisitData>;\nexport type DTOPublishedDocVisitData = z.infer<typeof DTOPublishedDocVisitData>;\nexport type DTOPublishedDocAnalyticsComparisonData = z.infer<typeof DTOPublishedDocAnalyticsComparisonData>;\nexport type DTOPublishedDocPageAnalyticsComparisonData = z.infer<typeof DTOPublishedDocPageAnalyticsComparisonData>;\nexport type DTODocumentationPageAnalyticsResponse = z.infer<typeof DTODocumentationPageAnalyticsResponse>;\nexport type DTODocumentationAnalyticsRequest = z.infer<typeof DTODocumentationAnalyticsRequest>;\n","import { z } from \"zod\";\n\n//\n// Difference\n//\n\n/**\n * @deprecated\n */\nexport const DTODocumentationPageAnalyticsDifference = z.object({\n startDate: z.coerce.date(),\n endDate: z.coerce.date().optional(),\n currentVisitCount: z.number(),\n currentSessionCount: z.number(),\n priorVisitCount: z.number(),\n priorSessionCount: z.number(),\n});\n\n/**\n * @deprecated\n */\nexport const DTODocumentationPageIntervalDifferenceResponse = z.object({\n differences: z.array(DTODocumentationPageAnalyticsDifference),\n});\n\n/**\n * @deprecated\n */\nexport type DTODocumentationPageAnalyticsDifference = z.infer<typeof DTODocumentationPageAnalyticsDifference>;\nexport type DTODocumentationPageIntervalDifferenceResponse = z.infer<\n typeof DTODocumentationPageIntervalDifferenceResponse\n>;\n","import { DocumentationPageAnchor } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageAnchor = DocumentationPageAnchor;\n\nexport const DTOGetDocumentationPageAnchorsResponse = z.object({\n anchors: z.array(DTODocumentationPageAnchor),\n});\n\nexport type DTODocumentationPageAnchor = z.infer<typeof DTODocumentationPageAnchor>;\nexport type DTOGetDocumentationPageAnchorsResponse = z.infer<typeof DTOGetDocumentationPageAnchorsResponse>;\n","import { DocumentationPageApprovalState } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODocumentationPageApprovalState = z.object({\n approvalState: DocumentationPageApprovalState,\n pagePersistentId: z.string(),\n updatedByUserId: z.string(),\n designSystemVersionId: z.string(),\n updatedAt: z.coerce.date(),\n createdAt: z.coerce.date(),\n});\n\nexport const DTODocumentationGroupApprovalState = z.object({\n persistentId: z.string(),\n groupPersistentId: z.string(),\n designSystemVersionId: z.string(),\n approvalState: DocumentationPageApprovalState,\n});\n\nexport type DTODocumentationPageApprovalState = z.infer<typeof DTODocumentationPageApprovalState>;\nexport type DTODocumentationGroupApprovalState = z.infer<typeof DTODocumentationGroupApprovalState>;\n","import { PageBlockItemV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOPageBlockItemV2 = PageBlockItemV2;\n\nexport type DTOPageBlockItemV2 = z.infer<typeof DTOPageBlockItemV2>;\n","import { DesignElementSnapshotReason } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationPageV2 } from \"../elements/documentation/page-v2\";\n\nexport const DTODocumentationPageSnapshot = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n\n createdAt: z.string(),\n updatedAt: z.string(),\n\n documentationPage: DTODocumentationPageV2,\n pageContentHash: z.string(),\n\n reason: DesignElementSnapshotReason,\n});\n\nexport type DTODocumentationPageSnapshot = z.infer<typeof DTODocumentationPageSnapshot>;\n","import { DocumentationPageApprovalState, DocumentationPageContentItem } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationPageApprovalState } from \"../../documentation\";\nimport { DTODocumentationDraftState } from \"./draft-state\";\nimport { DTODocumentationItemConfigurationV2 } from \"./item-configuration-v2\";\nimport { DTODocumentationPublishMetadata } from \"./metadata\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageV2 = z.object({\n id: z.string(),\n persistentId: z.string(),\n\n designSystemVersionId: z.string(),\n\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2,\n\n shortPersistentId: z.string(),\n\n slug: z.string().optional(),\n userSlug: z.string().optional(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n path: z.string(),\n\n /** Defined when a page has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n\n /** Defined if a page was published at least once and contains metadata about last publish */\n publishMetadata: DTODocumentationPublishMetadata.optional(),\n\n /** Defines the approval state of the documentation page */\n approvalState: DTODocumentationPageApprovalState.optional(),\n\n /** Id of the page document room */\n liveblocksRoomId: z.string().optional(),\n\n // Backward compatibility\n type: z.literal(\"Page\"),\n});\n\nexport type DTODocumentationPageV2 = z.infer<typeof DTODocumentationPageV2>;\n\n//\n// Write\n//\n\nexport const DTOCreateDocumentationPageInputV2 = z.object({\n // Identifier\n persistentId: z.string(),\n\n // Page properties\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n\n // Page placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTOUpdateDocumentationPageInputV2 = z.object({\n // Identifier of the page to update\n id: z.string(),\n\n // Page properties\n title: z.string().optional(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n});\n\nexport const DTOUpdateDocumentationPageDocumentInputV2 = z.object({\n // Identifier of the page to update\n id: z.string(),\n\n // Page properties\n documentItems: z.array(DocumentationPageContentItem),\n});\n\nexport const DTOMoveDocumentationPageInputV2 = z.object({\n // Identifier of the group to update\n id: z.string(),\n\n // Page placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTODuplicateDocumentationPageInputV2 = z.object({\n // Identifier of the page to duplicate from\n id: z.string(),\n\n // New page persistent id\n persistentId: z.string(),\n\n // Page placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTODeleteDocumentationPageInputV2 = z.object({\n // Identifier\n id: z.string(),\n});\n\nexport const DTORestoreDocumentationPageInput = z.object({\n persistentId: z.string(),\n snapshotId: z.string().optional(),\n});\n\nexport const DTORestoreDocumentationGroupInput = z.object({\n persistentId: z.string(),\n snapshotId: z.string().optional(),\n});\n\nexport const DTODocumentationPageApprovalStateChangeInput = z.object({\n persistentId: z.string(),\n approvalState: DocumentationPageApprovalState.optional(),\n});\n\nexport type DTOCreateDocumentationPageInputV2 = z.infer<typeof DTOCreateDocumentationPageInputV2>;\nexport type DTOUpdateDocumentationPageInputV2 = z.infer<typeof DTOUpdateDocumentationPageInputV2>;\nexport type DTOUpdateDocumentationPageDocumentInputV2 = z.infer<typeof DTOUpdateDocumentationPageDocumentInputV2>;\nexport type DTOMoveDocumentationPageInputV2 = z.infer<typeof DTOMoveDocumentationPageInputV2>;\nexport type DTODuplicateDocumentationPageInputV2 = z.infer<typeof DTODuplicateDocumentationPageInputV2>;\nexport type DTODeleteDocumentationPageInputV2 = z.infer<typeof DTODeleteDocumentationPageInputV2>;\nexport type DTORestoreDocumentationPageInput = z.infer<typeof DTORestoreDocumentationPageInput>;\nexport type DTORestoreDocumentationGroupInput = z.infer<typeof DTORestoreDocumentationGroupInput>;\nexport type DTODocumentationPageApprovalStateChangeInput = z.infer<typeof DTODocumentationPageApprovalStateChangeInput>;\n","import { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV2 } from \"./item-configuration-v2\";\n\nexport const DTODocumentationDraftChangeType = z.enum([\"Created\", \"Updated\", \"Deleted\"]);\n\nexport const DTODocumentationDraftStateCreated = z.object({\n changeType: z.literal(DTODocumentationDraftChangeType.enum.Created),\n});\n\nexport const DTODocumentationDraftStateUpdated = z.object({\n changeType: z.literal(DTODocumentationDraftChangeType.enum.Updated),\n changes: z.object({\n previousTitle: z.string().optional(),\n previousConfiguration: DTODocumentationItemConfigurationV2.optional(),\n previousContentHash: z.string().optional(),\n }),\n});\n\nexport const DTODocumentationDraftStateDeleted = z.object({\n changeType: z.literal(DTODocumentationDraftChangeType.enum.Deleted),\n deletedAt: z.coerce.date(),\n deletedByUserId: z.string(),\n});\n\nexport const DTODocumentationDraftState = z.discriminatedUnion(\"changeType\", [\n DTODocumentationDraftStateCreated,\n DTODocumentationDraftStateUpdated,\n DTODocumentationDraftStateDeleted,\n]);\n\nexport type DTODocumentationDraftChangeType = z.infer<typeof DTODocumentationDraftChangeType>;\n\nexport type DTODocumentationDraftStateCreated = z.infer<typeof DTODocumentationDraftStateCreated>;\nexport type DTODocumentationDraftStateUpdated = z.infer<typeof DTODocumentationDraftStateUpdated>;\nexport type DTODocumentationDraftStateDeleted = z.infer<typeof DTODocumentationDraftStateDeleted>;\n\nexport type DTODocumentationDraftState = z.infer<typeof DTODocumentationDraftState>;\n","import { DocumentationItemHeaderV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODocumentationItemHeaderV2 = DocumentationItemHeaderV2;\n\nexport const DTODocumentationItemConfigurationV2 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean(),\n isHidden: z.boolean(),\n header: DTODocumentationItemHeaderV2,\n});\n\nexport type DTODocumentationItemHeaderV2 = z.infer<typeof DTODocumentationItemHeaderV2>;\nexport type DTODocumentationItemConfigurationV2 = z.infer<typeof DTODocumentationItemConfigurationV2>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationPublishMetadata = z.object({\n lastPublishedByUserId: z.string(),\n lastPublishedAt: z.coerce.date(),\n});\n\nexport type DTODocumentationPublishMetadata = z.infer<typeof DTODocumentationPublishMetadata>;\n","import { DocumentationLinkPreview } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationLinkPreviewResponse = z.object({\n linkPreview: DocumentationLinkPreview,\n});\n\nexport type DTODocumentationLinkPreviewResponse = z.infer<typeof DTODocumentationLinkPreviewResponse>;\n\n//\n// Write\n//\n\nexport const DTODocumentationLinkPreviewRequest = z.object({\n url: z.string().optional(),\n documentationItemPersistentId: z.string().optional(),\n});\n\nexport type DTODocumentationLinkPreviewRequest = z.infer<typeof DTODocumentationLinkPreviewRequest>;\n","import { ExportJobDocumentationChanges, PublishedDocEnvironment } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExportJob } from \"../export\";\n\nexport const DTOPublishDocumentationChanges = ExportJobDocumentationChanges;\n\nexport const DTOPublishDocumentationRequest = z.object({\n environment: PublishedDocEnvironment,\n\n /**\n * If defined, this allows narrowing down what is published to a set of specific pages and groups\n * If undefined, everything will be published.\n */\n changes: DTOPublishDocumentationChanges.optional(),\n});\n\nexport const DTOPublishDocumentationResponse = z.object({\n job: DTOExportJob,\n});\n\nexport type DTOPublishDocumentationChanges = z.infer<typeof DTOPublishDocumentationChanges>;\nexport type DTOPublishDocumentationRequest = z.infer<typeof DTOPublishDocumentationRequest>;\nexport type DTOPublishDocumentationResponse = z.infer<typeof DTOPublishDocumentationResponse>;\n","import {\n nullishToOptional,\n PulsarContributionConfigurationProperty,\n PulsarContributionVariant,\n PulsarCustomBlock,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyDefinition } from \"./exporter-property\";\n\n//\n// Read\n//\n\nexport const DTOExporterType = z.enum([\"documentation\", \"code\"]);\nexport const DTOExporterSource = z.enum([\"git\", \"upload\"]);\nexport const DTOExporterMembershipRole = z.enum([\"Owner\", \"OwnerArchived\", \"User\"]);\n\nexport const DTOExporterListQuery = z.object({\n limit: z.coerce.number().optional(),\n offset: z.coerce.number().optional(),\n type: DTOExporterType.optional(),\n search: z.string().optional(),\n});\n\nexport const DTOExporter = z.object({\n id: z.string(),\n name: z.string(),\n isPrivate: z.boolean(),\n exporterType: DTOExporterType,\n isDefaultDocumentationExporter: z.boolean(),\n\n iconURL: z.string().optional(),\n configurationProperties: PulsarContributionConfigurationProperty.array(),\n properties: DTOExporterPropertyDefinition.array().optional(),\n customBlocks: PulsarCustomBlock.array(),\n blockVariants: z.record(z.string(), PulsarContributionVariant.array()),\n\n homepage: z.string().optional(),\n organization: z.string().optional(),\n packageId: z.string().optional(),\n tags: z.array(z.string()),\n author: z.string().optional(),\n version: z.string(),\n description: z.string(),\n\n usesLocale: z.boolean(),\n usesBrands: z.boolean(),\n usesThemes: z.boolean(),\n\n readme: z.string().optional(),\n routingVersion: z.string().optional(),\n\n source: DTOExporterSource,\n\n gitProvider: z.string().optional(),\n gitUrl: nullishToOptional(z.string()),\n gitBranch: nullishToOptional(z.string()),\n gitDirectory: nullishToOptional(z.string()),\n\n isDeprecated: z.boolean(),\n deprecationNote: z.string().optional(),\n replacementExporterId: z.string().optional(),\n});\n\nexport const DTOExporterMembership = z.object({\n workspaceId: z.string(),\n exporterId: z.string(),\n role: DTOExporterMembershipRole,\n});\n\nexport const DTOExporterResponse = z.object({\n exporter: DTOExporter,\n membership: DTOExporterMembership,\n});\n\nexport const DTOExporterListResponse = z.object({\n exporters: DTOExporter.array(),\n membership: DTOExporterMembership.array(),\n total: z.number(),\n});\n\nexport type DTOExporterListQuery = z.infer<typeof DTOExporterListQuery>;\nexport type DTOExporterType = z.infer<typeof DTOExporterType>;\nexport type DTOExporterSource = z.infer<typeof DTOExporterSource>;\nexport type DTOExporterMembershipRole = z.infer<typeof DTOExporterMembershipRole>;\nexport type DTOExporter = z.infer<typeof DTOExporter>;\nexport type DTOExporterMembership = z.infer<typeof DTOExporterMembership>;\nexport type DTOExporterResponse = z.infer<typeof DTOExporterResponse>;\nexport type DTOExporterListResponse = z.infer<typeof DTOExporterListResponse>;\n\n//\n// Write\n//\n\nexport const DTOExporterGitProviderEnum = z.enum([\"github\", \"gitlab\", \"bitbucket\", \"azure\"]);\n\nexport const DTOExporterCreateInput = z.object({\n url: z.string(),\n provider: DTOExporterGitProviderEnum,\n});\n\nexport const DTOExporterUpdateInput = z.object({\n url: z.string().optional(),\n});\n\nexport const DTOExporterDeprecationInput = z.object({\n isDeprecated: z.boolean(),\n deprecationNote: z.string().optional(),\n replacementExporterId: z.string().optional(),\n});\n\nexport type DTOExporterGitProviderEnum = z.infer<typeof DTOExporterGitProviderEnum>;\nexport type DTOExporterCreateInput = z.infer<typeof DTOExporterCreateInput>;\nexport type DTOExporterUpdateInput = z.infer<typeof DTOExporterUpdateInput>;\nexport type DTOExporterDeprecationInput = z.infer<typeof DTOExporterDeprecationInput>;\n","import { ExportJobFindByFilter } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOExportJobsListFilter = ExportJobFindByFilter;\n\nexport type DTOExportJobsListFilter = z.infer<typeof DTOExportJobsListFilter>;\n","import {\n ExportJobDocsDestinationResult,\n ExportJobResult,\n ExportJobStatus,\n ExporterDestinationAzure,\n ExporterDestinationBitbucket,\n ExporterDestinationDocs,\n ExporterDestinationGithub,\n ExporterDestinationGitlab,\n ExporterDestinationS3,\n ObjectMeta,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyValueMap } from \"./exporter-property\";\n\nexport const DTOExportJobCreatedBy = z.object({\n userId: z.string(),\n userName: z.string(),\n});\n\nexport const DTOExportJobDesignSystemPreview = z.object({\n id: z.string(),\n meta: ObjectMeta,\n});\n\nexport const DTOExportJobDesignSystemVersionPreview = z.object({\n id: z.string(),\n meta: ObjectMeta,\n version: z.string(),\n isReadonly: z.boolean(),\n});\n\nexport const DTOExportJobDestinations = z.object({\n s3: ExporterDestinationS3.optional(),\n azure: ExporterDestinationAzure.optional(),\n bitbucket: ExporterDestinationBitbucket.optional(),\n github: ExporterDestinationGithub.optional(),\n gitlab: ExporterDestinationGitlab.optional(),\n documentation: ExporterDestinationDocs.optional(),\n webhookUrl: z.string().optional(),\n});\n\nexport const DTOExportJobResult = ExportJobResult.omit({\n sndocs: true,\n}).extend({\n documentation: ExportJobDocsDestinationResult.optional(),\n});\n\nexport const DTOExportJob = z.object({\n id: z.string(),\n\n createdAt: z.coerce.date(),\n finishedAt: z.coerce.date().optional(),\n\n index: z.number().optional(),\n status: ExportJobStatus,\n estimatedExecutionTime: z.number().optional(),\n\n createdBy: DTOExportJobCreatedBy.optional(),\n designSystem: DTOExportJobDesignSystemPreview,\n designSystemVersion: DTOExportJobDesignSystemVersionPreview,\n\n destinations: DTOExportJobDestinations,\n\n exporterId: z.string(),\n scheduleId: z.string().optional(),\n\n result: DTOExportJobResult.optional(),\n\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n});\n\nexport const DTOExportJobResponse = z.object({\n job: DTOExportJob,\n});\n\n// Deprecated: Use only for test purposes and extend if only necessary. This defines the BE response for an export job.\nexport const DTOExportJobResponseLegacy = z.object({\n job: z.object({\n id: z.string(),\n status: ExportJobStatus,\n }),\n});\n\nexport type DTOExportJobResponseLegacy = z.infer<typeof DTOExportJobResponseLegacy>;\nexport type DTOExportJobCreatedBy = z.infer<typeof DTOExportJobCreatedBy>;\nexport type DTOExportJobDesignSystemPreview = z.infer<typeof DTOExportJobDesignSystemPreview>;\nexport type DTOExportJobDesignSystemVersionPreview = z.infer<typeof DTOExportJobDesignSystemVersionPreview>;\nexport type DTOExportJobDestinations = z.infer<typeof DTOExportJobDestinations>;\nexport type DTOExportJobResult = z.infer<typeof DTOExportJobResult>;\nexport type DTOExportJob = z.infer<typeof DTOExportJob>;\nexport type DTOExportJobResponse = z.infer<typeof DTOExportJobResponse>;\n\n//\n// Write\n//\n\nexport const DTOExportJobCreateInput = z.object({\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n exporterId: z.string(),\n brandId: z.string().optional(),\n themeId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n destinations: DTOExportJobDestinations,\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n previewMode: z.boolean().optional(),\n});\n\nexport type DTOExportJobCreateInput = z.infer<typeof DTOExportJobCreateInput>;\n","import { ExportDestinationsMap, PipelineEventType } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyValueMap } from \"./exporter-property\";\nimport { DTOExportJob } from \"./job\";\n\nexport const DTOPipelineListQuery = z.object({\n designSystemId: z.string().optional(),\n exporterId: z.string().optional(),\n latestJobsLimit: z.coerce.number().optional(),\n});\n\nexport const DTOPipeline = z.object({\n id: z.string(),\n name: z.string(),\n eventType: PipelineEventType,\n isEnabled: z.boolean(),\n workspaceId: z.string(),\n designSystemId: z.string(),\n exporterId: z.string(),\n brandPersistentId: z.string().optional(),\n\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n\n ...ExportDestinationsMap.shape,\n\n latestJobs: DTOExportJob.array(),\n\n isExporterDeprecated: z.boolean(),\n});\n\nexport const DTOPipelineListResponse = z.object({\n pipelines: DTOPipeline.array(),\n});\n\nexport const DTOPipelineResponse = z.object({\n pipeline: DTOPipeline,\n});\n\nexport type DTOPipelineListQuery = z.infer<typeof DTOPipelineListQuery>;\nexport type DTOPipeline = z.infer<typeof DTOPipeline>;\nexport type DTOPipelineResponse = z.infer<typeof DTOPipelineResponse>;\nexport type DTOPipelineListResponse = z.infer<typeof DTOPipelineListResponse>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationPageRoom = z.object({\n id: z.string(),\n});\n\nexport const DTODocumentationPageRoomResponse = z.object({\n room: DTODocumentationPageRoom,\n});\n\nexport type DTODocumentationPageRoom = z.infer<typeof DTODocumentationPageRoom>;\nexport type DTODocumentationPageRoomResponse = z.infer<typeof DTODocumentationPageRoomResponse>;\n","import z from \"zod\";\nimport { DTOObjectMeta } from \"../../aux/meta\";\n\nexport const DTOFigmaComponentGroup = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n isRoot: z.boolean(),\n brandId: z.string(),\n meta: DTOObjectMeta,\n childrenIds: z.string().array(),\n});\n\nexport const DTOFigmaComponentGroupListResponse = z.object({\n groups: DTOFigmaComponentGroup.array(),\n});\n\nexport type DTOFigmaComponentGroup = z.infer<typeof DTOFigmaComponentGroup>;\nexport type DTOFigmaComponentGroupListResponse = z.infer<typeof DTOFigmaComponentGroupListResponse>;\n","import {\n FigmaComponentBooleanProperty,\n FigmaComponentInstanceSwapProperty,\n FigmaComponentOrigin,\n FigmaComponentProperty,\n FigmaComponentTextProperty,\n FigmaComponentVariantProperty,\n ObjectMeta,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nconst DTOFigmaComponentBooleanProperty = FigmaComponentBooleanProperty;\nconst DTOFigmaComponentInstanceSwapProperty = FigmaComponentInstanceSwapProperty;\nconst DTOFigmaComponentTextProperty = FigmaComponentTextProperty;\nconst DTOFigmaComponentVariantProperty = FigmaComponentVariantProperty;\nconst DTOFigmaComponentProperty = FigmaComponentProperty;\nconst DTOFigmaComponentPropertyMap = z.record(DTOFigmaComponentProperty);\n\nexport const DTOFigmaComponent = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n brandId: z.string(),\n thumbnailUrl: z.string().optional(),\n svgUrl: z.string().optional(),\n\n exportProperties: z.object({\n isAsset: z.boolean(),\n }),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n meta: ObjectMeta,\n originComponent: FigmaComponentOrigin.optional(),\n\n parentComponentPersistentId: z.string().optional(),\n childrenPersistentIds: z.string().array().optional(),\n\n componentPropertyDefinitions: DTOFigmaComponentPropertyMap.optional(),\n variantPropertyValues: z.record(z.string()).optional(),\n});\n\nexport const DTOFigmaComponentListResponse = z.object({\n components: DTOFigmaComponent.array(),\n});\n\nexport type DTOFigmaComponentBooleanProperty = z.infer<typeof DTOFigmaComponentBooleanProperty>;\nexport type DTOFigmaComponentInstanceSwapProperty = z.infer<typeof DTOFigmaComponentInstanceSwapProperty>;\nexport type DTOFigmaComponentTextProperty = z.infer<typeof DTOFigmaComponentTextProperty>;\nexport type DTOFigmaComponentVariantProperty = z.infer<typeof DTOFigmaComponentVariantProperty>;\nexport type DTOFigmaComponentProperty = z.infer<typeof DTOFigmaComponentProperty>;\nexport type DTOFigmaComponentPropertyMap = z.infer<typeof DTOFigmaComponentPropertyMap>;\n\nexport type DTOFigmaComponent = z.infer<typeof DTOFigmaComponent>;\nexport type DTOFigmaComponentListResponse = z.infer<typeof DTOFigmaComponentListResponse>;\n","import { z } from \"zod\";\nimport {\n DTOCreateDocumentationGroupInput,\n DTOCreateDocumentationTabInput,\n DTODeleteDocumentationGroupInput,\n DTODeleteDocumentationTabGroupInput,\n DTODuplicateDocumentationGroupInput,\n DTOMoveDocumentationGroupInput,\n DTOUpdateDocumentationGroupInput,\n} from \"./group-v2\";\n\n//\n// Read\n//\n\nconst SuccessPayload = z.object({\n success: z.literal(true),\n});\n\nexport const DTODocumentationGroupCreateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupCreate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationTabCreateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationTabCreate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupUpdateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupUpdate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupMoveActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupMove\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupDuplicateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupDuplicate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupDeleteActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupDelete\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationTabGroupDeleteActionOutputV2 = z.object({\n type: z.literal(\"DocumentationTabGroupDelete\"),\n output: SuccessPayload,\n});\n\nexport type DTODocumentationGroupCreateActionOutputV2 = z.infer<typeof DTODocumentationGroupCreateActionOutputV2>;\nexport type DTODocumentationTabCreateActionOutputV2 = z.infer<typeof DTODocumentationTabCreateActionOutputV2>;\nexport type DTODocumentationGroupUpdateActionOutputV2 = z.infer<typeof DTODocumentationGroupUpdateActionOutputV2>;\nexport type DTODocumentationGroupMoveActionOutputV2 = z.infer<typeof DTODocumentationGroupMoveActionOutputV2>;\nexport type DTODocumentationGroupDuplicateActionOutputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionOutputV2>;\nexport type DTODocumentationGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationGroupDeleteActionOutputV2>;\nexport type DTODocumentationTabGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionOutputV2>;\n\n//\n// Write\n//\n\nexport const DTODocumentationGroupCreateActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupCreate\"),\n input: DTOCreateDocumentationGroupInput,\n});\n\nexport const DTODocumentationTabCreateActionInputV2 = z.object({\n type: z.literal(\"DocumentationTabCreate\"),\n input: DTOCreateDocumentationTabInput,\n});\n\nexport const DTODocumentationGroupUpdateActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupUpdate\"),\n input: DTOUpdateDocumentationGroupInput,\n});\n\nexport const DTODocumentationGroupMoveActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupMove\"),\n input: DTOMoveDocumentationGroupInput,\n});\n\nexport const DTODocumentationGroupDuplicateActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupDuplicate\"),\n input: DTODuplicateDocumentationGroupInput,\n});\n\nexport const DTODocumentationGroupDeleteActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupDelete\"),\n input: DTODeleteDocumentationGroupInput,\n});\n\nexport const DTODocumentationTabGroupDeleteActionInputV2 = z.object({\n type: z.literal(\"DocumentationTabGroupDelete\"),\n input: DTODeleteDocumentationTabGroupInput,\n});\n\nexport type DTODocumentationGroupCreateActionInputV2 = z.infer<typeof DTODocumentationGroupCreateActionInputV2>;\nexport type DTODocumentationTabGroupCreateActionInputV2 = z.infer<typeof DTODocumentationTabCreateActionInputV2>;\nexport type DTODocumentationGroupUpdateActionInputV2 = z.infer<typeof DTODocumentationGroupUpdateActionInputV2>;\nexport type DTODocumentationGroupMoveActionInputV2 = z.infer<typeof DTODocumentationGroupMoveActionInputV2>;\nexport type DTODocumentationGroupDuplicateActionInputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionInputV2>;\nexport type DTODocumentationGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationGroupDeleteActionInputV2>;\nexport type DTODocumentationTabGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionInputV2>;\n","import { DocumentationGroupBehavior, ElementGroup } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationDraftState } from \"./draft-state\";\nimport { DTODocumentationItemConfigurationV2 } from \"./item-configuration-v2\";\nimport { DTODocumentationPublishMetadata } from \"./metadata\";\nimport { DTODocumentationGroupApprovalState } from \"../../documentation\";\n\n//\n// Read\n//\n\nexport const DTODocumentationGroupV2 = ElementGroup.omit({\n sortOrder: true,\n parentPersistentId: true,\n brandPersistentId: true,\n meta: true,\n childType: true,\n data: true,\n shortPersistentId: true,\n}).extend({\n title: z.string(),\n isRoot: z.boolean(),\n childrenIds: z.array(z.string()),\n groupBehavior: DocumentationGroupBehavior,\n shortPersistentId: z.string(),\n configuration: DTODocumentationItemConfigurationV2,\n type: z.literal(\"Group\"),\n\n /** Defined when a group has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n\n /** Defined if a group was published at least once and contains metadata about last publish */\n publishMetadata: DTODocumentationPublishMetadata.optional(),\n\n //** An approval state for frontend to utilize. */\n approvalState: DTODocumentationGroupApprovalState.optional(),\n});\n\nexport type DTODocumentationGroupV2 = z.infer<typeof DTODocumentationGroupV2>;\n\n//\n// Write\n//\n\nexport const DTOCreateDocumentationGroupInput = z.object({\n // Identifier\n persistentId: z.string(),\n\n // Group properties\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n\n // Group placement properties\n afterPersistentId: z.string().nullish(),\n parentPersistentId: z.string(),\n});\n\nexport const DTOUpdateDocumentationGroupInput = z.object({\n // Identifier of the group to update\n id: z.string(),\n\n // Group properties\n title: z.string().optional(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n});\n\nexport const DTOMoveDocumentationGroupInput = z.object({\n // Identifier of the group to update\n id: z.string(),\n\n // Group placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTODuplicateDocumentationGroupInput = z.object({\n // Identifier of the group to duplicate from\n id: z.string(),\n\n // New group persistent id\n persistentId: z.string(),\n\n // Group placement properties\n afterPersistentId: z.string().nullish(),\n parentPersistentId: z.string(),\n});\n\nexport const DTOCreateDocumentationTabInput = z.object({\n // New group persistent id\n persistentId: z.string(),\n\n // If this is page, we will attempt to convert it to tab\n // If this is tab group, we will add a new tab to it\n fromItemPersistentId: z.string(),\n tabName: z.string(),\n});\n\nexport const DTODeleteDocumentationTabGroupInput = z.object({\n // Deleted group id\n id: z.string(),\n});\n\nexport const DTODeleteDocumentationGroupInput = z.object({\n // Identifier\n id: z.string(),\n\n // Deletion options\n deleteSubtree: z.boolean().default(false),\n});\n\nexport type DTOCreateDocumentationGroupInput = z.infer<typeof DTOCreateDocumentationGroupInput>;\nexport type DTOUpdateDocumentationGroupInput = z.infer<typeof DTOUpdateDocumentationGroupInput>;\nexport type DTOMoveDocumentationGroupInput = z.infer<typeof DTOMoveDocumentationGroupInput>;\nexport type DTODuplicateDocumentationGroupInput = z.infer<typeof DTODuplicateDocumentationGroupInput>;\nexport type DTOCreateDocumentationTabInput = z.infer<typeof DTOCreateDocumentationTabInput>;\nexport type DTODeleteDocumentationTabGroupInput = z.infer<typeof DTODeleteDocumentationTabGroupInput>;\nexport type DTODeleteDocumentationGroupInput = z.infer<typeof DTODeleteDocumentationGroupInput>;\n","import { DocumentationGroupBehavior, ElementGroup } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV1 } from \"./item-configuration-v1\";\n\n//\n// Read\n//\n\n/**\n * Structure DTO is element properties minus element data (in other words data required\n * to display the element in the left panel)\n */\nexport const DTODocumentationGroupStructureV1 = ElementGroup.omit({\n sortOrder: true,\n parentPersistentId: true,\n brandPersistentId: true,\n meta: true,\n childType: true,\n data: true,\n shortPersistentId: true,\n}).extend({\n title: z.string(),\n isRoot: z.boolean(),\n childrenIds: z.array(z.string()),\n groupBehavior: DocumentationGroupBehavior,\n shortPersistentId: z.string(),\n type: z.literal(\"Group\"),\n});\n\nexport const DTODocumentationGroupV1 = DTODocumentationGroupStructureV1.extend({\n configuration: DTODocumentationItemConfigurationV1,\n});\n\nexport type DTODocumentationGroupStructureV1 = z.infer<typeof DTODocumentationGroupStructureV1>;\nexport type DTODocumentationGroupV1 = z.infer<typeof DTODocumentationGroupV1>;\n","import { DocumentationItemHeaderV1 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nconst DocumentationColorV1 = z.object({\n aliasTo: z.string().optional(),\n value: z.string().optional(),\n});\n\nconst DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({\n foregroundColor: true,\n backgroundColor: true,\n}).extend({\n foregroundColor: DocumentationColorV1.optional(),\n backgroundColor: DocumentationColorV1.optional(),\n});\n\nexport const DTODocumentationItemConfigurationV1 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean(),\n isHidden: z.boolean(),\n header: DTODocumentationItemHeaderV1,\n});\n\nexport type DTODocumentationItemConfigurationV1 = z.infer<typeof DTODocumentationItemConfigurationV1>;\n","import { z } from \"zod\";\nimport { DTODocumentationDraftState } from \"./draft-state\";\nimport { DTODocumentationGroupV2 } from \"./group-v2\";\nimport { DTODocumentationPageV2 } from \"./page-v2\";\n\nexport const DTODocumentationHierarchyV2 = z.object({\n pages: z.array(\n DTODocumentationPageV2.extend({\n /** Defined when a page has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n })\n ),\n\n groups: z.array(\n DTODocumentationGroupV2.extend({\n /** Defined when a page has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n })\n ),\n\n /** True if the documentation was already published, false otherwise. */\n hasPublishedDocumentationContent: z.boolean(),\n});\n\nexport type DTODocumentationHierarchyV2 = z.infer<typeof DTODocumentationHierarchyV2>;\n","import { z } from \"zod\";\nimport {\n DTOCreateDocumentationPageInputV2,\n DTODeleteDocumentationPageInputV2,\n DTODocumentationPageApprovalStateChangeInput,\n DTODuplicateDocumentationPageInputV2,\n DTOMoveDocumentationPageInputV2,\n DTORestoreDocumentationGroupInput,\n DTORestoreDocumentationPageInput,\n DTOUpdateDocumentationPageDocumentInputV2,\n DTOUpdateDocumentationPageInputV2,\n} from \"./page-v2\";\n\n//\n// Read\n//\n\nconst SuccessPayload = z.object({\n success: z.literal(true),\n});\n\nexport const DTODocumentationPageCreateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageCreate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageUpdateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageUpdateDocumentActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdateDocument\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageMoveActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageMove\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageDuplicateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageDuplicate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageDeleteActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageDelete\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageRestoreActionOutput = z.object({\n type: z.literal(\"DocumentationPageRestore\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupRestoreActionOutput = z.object({\n type: z.literal(\"DocumentationGroupRestore\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageApprovalStateChangeActionOutput = z.object({\n type: z.literal(\"DocumentationPageApprovalStateChange\"),\n output: SuccessPayload,\n});\n\nexport type DTODocumentationPageCreateActionOutputV2 = z.infer<typeof DTODocumentationPageCreateActionOutputV2>;\nexport type DTODocumentationPageUpdateActionOutputV2 = z.infer<typeof DTODocumentationPageUpdateActionOutputV2>;\nexport type DTODocumentationPageUpdateDocumentActionOutputV2 = z.infer<\n typeof DTODocumentationPageUpdateDocumentActionOutputV2\n>;\nexport type DTODocumentationPageMoveActionOutputV2 = z.infer<typeof DTODocumentationPageMoveActionOutputV2>;\nexport type DTODocumentationPageDuplicateActionOutputV2 = z.infer<typeof DTODocumentationPageDuplicateActionOutputV2>;\nexport type DTODocumentationPageDeleteActionOutputV2 = z.infer<typeof DTODocumentationPageDeleteActionOutputV2>;\nexport type DTODocumentationPageRestoreActionOutput = z.infer<typeof DTODocumentationPageRestoreActionOutput>;\nexport type DTODocumentationGroupRestoreActionOutput = z.infer<typeof DTODocumentationGroupRestoreActionOutput>;\nexport type DTODocumentationPageApprovalStateChangeActionOutput = z.infer<\n typeof DTODocumentationPageApprovalStateChangeActionOutput\n>;\n\n// Write\n//\n\nexport const DTODocumentationPageCreateActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageCreate\"),\n input: DTOCreateDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageUpdateActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdate\"),\n input: DTOUpdateDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageUpdateDocumentActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdateDocument\"),\n input: DTOUpdateDocumentationPageDocumentInputV2,\n});\n\nexport const DTODocumentationPageMoveActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageMove\"),\n input: DTOMoveDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageDuplicateActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageDuplicate\"),\n input: DTODuplicateDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageDeleteActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageDelete\"),\n input: DTODeleteDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageRestoreActionInput = z.object({\n type: z.literal(\"DocumentationPageRestore\"),\n input: DTORestoreDocumentationPageInput,\n});\n\nexport const DTODocumentationGroupRestoreActionInput = z.object({\n type: z.literal(\"DocumentationGroupRestore\"),\n input: DTORestoreDocumentationGroupInput,\n});\n\nexport const DTODocumentationPageApprovalStateChangeActionInput = z.object({\n type: z.literal(\"DocumentationPageApprovalStateChange\"),\n input: DTODocumentationPageApprovalStateChangeInput,\n});\n\nexport type DTODocumentationPageCreateActionInputV2 = z.infer<typeof DTODocumentationPageCreateActionInputV2>;\nexport type DTODocumentationPageUpdateActionInputV2 = z.infer<typeof DTODocumentationPageUpdateActionInputV2>;\nexport type DTODocumentationPageUpdateDocumentActionInputV2 = z.infer<\n typeof DTODocumentationPageUpdateDocumentActionInputV2\n>;\nexport type DTODocumentationPageMoveActionInputV2 = z.infer<typeof DTODocumentationPageMoveActionInputV2>;\nexport type DTODocumentationPageDuplicateActionInputV2 = z.infer<typeof DTODocumentationPageDuplicateActionInputV2>;\nexport type DTODocumentationPageDeleteActionInputV2 = z.infer<typeof DTODocumentationPageDeleteActionInputV2>;\nexport type DTODocumentationPageRestoreActionInput = z.infer<typeof DTODocumentationPageRestoreActionInput>;\nexport type DTODocumentationGroupRestoreActionInput = z.infer<typeof DTODocumentationGroupRestoreActionInput>;\n","import { DocumentationPageContent } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageContent = DocumentationPageContent;\n\nexport const DTODocumentationPageContentGetResponse = z.object({\n pageContent: DTODocumentationPageContent,\n});\n\nexport type DTODocumentationPageContent = z.infer<typeof DTODocumentationPageContent>;\nexport type DTODocumentationPageContentGetResponse = z.infer<typeof DTODocumentationPageContentGetResponse>;\n","import { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageDependencies = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n\n tokenPersistentIds: z.array(z.string()),\n figmaComponentPersistentIds: z.array(z.string()),\n componentPersistentIds: z.array(z.string()),\n figmaNodePersistentIds: z.array(z.string()),\n groupPersistentIds: z.array(z.string()),\n propertyPersistentIds: z.array(z.string()),\n themePersistentIds: z.array(z.string()),\n documentationPagePersistentIds: z.array(z.string()),\n storybookEntriesStoryIds: z.array(z.string()),\n});\n\nexport const DTODocumentationPageDependenciesGetResponse = z.object({\n dependencies: z.array(DTODocumentationPageDependencies),\n});\n\nexport type DTODocumentationPageDependencies = z.infer<typeof DTODocumentationPageDependencies>;\nexport type DTODocumentationPageDependenciesGetResponse = z.infer<typeof DTODocumentationPageDependenciesGetResponse>;\n","import { DocumentationPageV1, PageBlockV1 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV1 } from \"./item-configuration-v1\";\n\n//\n// Read\n//\n\nexport const DocumentationPageV1DTO = DocumentationPageV1.omit({\n data: true,\n meta: true,\n parentPersistentId: true,\n sortOrder: true,\n}).extend({\n configuration: DTODocumentationItemConfigurationV1,\n blocks: z.array(PageBlockV1),\n title: z.string(),\n path: z.string(),\n});\n\nexport type DocumentationPageV1DTO = z.infer<typeof DocumentationPageV1DTO>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationSettings = z.object({\n isDraftFeatureAdopted: z.boolean(),\n isApprovalsFeatureEnabled: z.boolean(),\n isApprovalRequiredForPublishing: z.boolean(),\n});\n\nexport type DTODocumentationSettings = z.infer<typeof DTODocumentationSettings>;\n","import { z } from \"zod\";\n\nconst DTODocumentationStructureItemType = z.enum([\"Group\", \"Page\"]);\n\nconst DTODocumentationStructureItemBase = z.object({\n type: DTODocumentationStructureItemType,\n id: z.string(),\n designSystemVersionId: z.string(),\n shortPersistentId: z.string(),\n persistentId: z.string(),\n title: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTODocumentationStructureGroupItem = DTODocumentationStructureItemBase.extend({\n type: z.literal(DTODocumentationStructureItemType.enum.Group),\n groupBehavior: z.string(),\n childrenIds: z.string().array(),\n isRoot: z.boolean(),\n});\n\nexport const DTODocumentationStructurePageItem = DTODocumentationStructureItemBase.extend({\n type: z.literal(DTODocumentationStructureItemType.enum.Page),\n path: z.string(),\n});\n\nexport const DTODocumentationStructureItem = z.discriminatedUnion(\"type\", [\n DTODocumentationStructureGroupItem,\n DTODocumentationStructurePageItem,\n]);\nexport const DTODocumentationStructure = z.object({\n items: z.array(DTODocumentationStructureItem),\n});\n\nexport type DTODocumentationStructureItem = z.infer<typeof DTODocumentationStructureItem>;\nexport type DTODocumentationStructure = z.infer<typeof DTODocumentationStructure>;\n","import { FigmaFileStructureNode, FigmaNodeStructureStateV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOFigmaNodeStructure = z.object({\n id: z.string(),\n sourceId: z.string(),\n importState: FigmaNodeStructureStateV2,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTOFigmaNodeStructureDetail = DTOFigmaNodeStructure.extend({\n rootNode: FigmaFileStructureNode,\n});\n\nexport const DTOFigmaNodeStructureListResponse = z.object({\n structures: DTOFigmaNodeStructure.array(),\n});\n\nexport const DTOFigmaNodeStructureDetailResponse = z.object({\n structure: DTOFigmaNodeStructureDetail,\n});\n\nexport type DTOFigmaNodeStructure = z.infer<typeof DTOFigmaNodeStructure>;\nexport type DTOFigmaNodeStructureDetail = z.infer<typeof DTOFigmaNodeStructureDetail>;\nexport type DTOFigmaNodeStructureListResponse = z.infer<typeof DTOFigmaNodeStructureListResponse>;\nexport type DTOFigmaNodeStructureDetailResponse = z.infer<typeof DTOFigmaNodeStructureDetailResponse>;\n","import { FigmaNodeReference } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOFigmaNodeOrigin, DTOFigmaNodeRenderFormat } from \"./figma-node\";\n\nexport const DTOFigmaNodeData = z.object({\n // Id of the node in the Figma file\n figmaNodeId: z.string(),\n\n // Validity\n isValid: z.boolean(),\n\n // Asset data\n assetId: z.string(),\n assetUrl: z.string(),\n assetFormat: DTOFigmaNodeRenderFormat,\n\n // Asset metadata\n assetScale: z.number(),\n assetWidth: z.number().optional(),\n assetHeight: z.number().optional(),\n});\n\nexport const DTOFigmaNode = FigmaNodeReference.omit({\n data: true,\n origin: true,\n}).extend({\n data: DTOFigmaNodeData,\n origin: DTOFigmaNodeOrigin,\n});\n\nexport type DTOFigmaNodeData = z.infer<typeof DTOFigmaNodeData>;\nexport type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;\n","import { FigmaNodeRenderFormat } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Enums\n//\n\nexport const DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;\nexport type DTOFigmaNodeRenderFormat = z.infer<typeof DTOFigmaNodeRenderFormat>;\n\n//\n// Read\n//\n\nexport const DTOFigmaNodeOrigin = z.object({\n sourceId: z.string(),\n fileId: z.string().optional(),\n parentName: z.string().optional(),\n});\n\nexport type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;\n\n//\n// Write\n//\n\n/**\n * Properties that are available on all types of Figma node render requests\n */\nconst DTOFigmaNodeRenderInputBase = z.object({\n /**\n * Format in which the node must be rendered, png by default.\n */\n format: FigmaNodeRenderFormat.default(\"Png\"),\n\n /**\n * Scale to apply to PNG images, can be between 1 and 4. Scale is ignored for other image formats.\n */\n scale: z.number().optional(),\n});\n\n/**\n * Figma node render request that uses source ID + node ID to identify the requested\n * node to render. The node ID can be obtained from the source's Figma node structure.\n */\nexport const DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({\n inputType: z\n .literal(\"NodeId\")\n .optional()\n .transform(v => v ?? \"NodeId\"),\n\n /**\n * Id of a design system's data source representing a linked Figma file\n */\n sourceId: z.string(),\n\n /**\n * Id of a node within the Figma file\n */\n figmaFileNodeId: z.string(),\n});\n\n/**\n * Figma node render request that uses Figma URL to identify the requested\n * node to render. The URL can be obtained by the user directly from the Figma app.\n */\nexport const DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({\n inputType: z.literal(\"URL\"),\n\n /**\n * Id of a design system's data source representing a linked Figma file\n */\n figmaNodeUrl: z.string(),\n\n /**\n * Brand persistent id to use in case a source has to be created for this render\n */\n brandPersistentId: z.string(),\n});\n\n/**\n * Figma node render request that uses Figma URL to identify the requested\n * node to render. The URL can be obtained by the user directly from the Figma app.\n */\nexport const DTOFigmaNodeRerenderInput = z.object({\n inputType: z.literal(\"Rerender\"),\n\n /**\n * Persistent ID of an existing Figma node\n */\n figmaNodePersistentId: z.string(),\n});\n\nexport const DTOFigmaNodeRenderInput = z.discriminatedUnion(\"inputType\", [\n DTOFigmaNodeRenderIdInput,\n DTOFigmaNodeRenderUrlInput,\n DTOFigmaNodeRerenderInput,\n]);\n\nexport type DTOFigmaNodeRenderIdInput = z.infer<typeof DTOFigmaNodeRenderIdInput>;\nexport type DTOFigmaNodeRenderUrlInput = z.infer<typeof DTOFigmaNodeRenderUrlInput>;\nexport type DTOFigmaNodeRerenderInput = z.infer<typeof DTOFigmaNodeRerenderInput>;\nexport type DTOFigmaNodeRenderInput = z.infer<typeof DTOFigmaNodeRenderInput>;\n","import {\n FigmaNodeReference,\n FigmaNodeRenderedImage,\n FigmaNodeRenderError,\n FigmaNodeRenderFormat,\n FigmaNodeRenderState,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOFigmaNodeOrigin } from \"./figma-node\";\n\nexport const DTOFigmaNodeDataV2 = z.object({\n sceneNodeId: z.string(),\n format: FigmaNodeRenderFormat,\n scale: z.number().optional(),\n\n renderState: FigmaNodeRenderState,\n renderedImage: FigmaNodeRenderedImage.optional(),\n renderError: FigmaNodeRenderError.optional(),\n\n hasSource: z.boolean(),\n});\n\nexport const DTOFigmaNodeV2 = FigmaNodeReference.omit({\n data: true,\n origin: true,\n}).extend({\n data: DTOFigmaNodeDataV2,\n origin: DTOFigmaNodeOrigin,\n});\n\nexport type DTOFigmaNodeDataV2 = z.infer<typeof DTOFigmaNodeDataV2>;\nexport type DTOFigmaNodeV2 = z.infer<typeof DTOFigmaNodeV2>;\n","import { z } from \"zod\";\nimport { DTOFigmaNodeRenderIdInput, DTOFigmaNodeRenderInput } from \"./figma-node\";\nimport { DTOFigmaNode } from \"./figma-node-v1\";\nimport { DTOFigmaNodeV2 } from \"./figma-node-v2\";\n\n//\n// Read\n//\n\n/**\n * @deprecated Please use FigmaNodeRenderAsync (DTOFigmaNodeRenderAsyncActionOutput)\n */\nexport const DTOFigmaNodeRenderActionOutput = z.object({\n type: z.literal(\"FigmaNodeRender\"),\n figmaNodes: z.array(DTOFigmaNode),\n});\n\nexport const DTOFigmaNodeRenderAsyncActionOutput = z.object({\n type: z.literal(\"FigmaNodeRenderAsync\"),\n figmaNodes: z.array(DTOFigmaNodeV2),\n});\n\nexport type DTOFigmaNodeRenderActionOutput = z.infer<typeof DTOFigmaNodeRenderActionOutput>;\nexport type DTOFigmaNodeRenderAsyncActionOutput = z.infer<typeof DTOFigmaNodeRenderAsyncActionOutput>;\n\n//\n// Read\n//\n\n/**\n * @deprecated Please use FigmaNodeRenderAsync (DTOFigmaNodeRenderAsyncActionInput)\n */\nexport const DTOFigmaNodeRenderActionInput = z.object({\n type: z.literal(\"FigmaNodeRender\"),\n input: DTOFigmaNodeRenderIdInput.array(),\n});\n\nexport const DTOFigmaNodeRenderAsyncActionInput = z.object({\n type: z.literal(\"FigmaNodeRenderAsync\"),\n nodes: DTOFigmaNodeRenderInput.array(),\n});\n\nexport type DTOFigmaNodeRenderActionInput = z.infer<typeof DTOFigmaNodeRenderActionInput>;\nexport type DTOFigmaNodeRenderAsyncActionInput = z.infer<typeof DTOFigmaNodeRenderAsyncActionInput>;\n","import { FigmaFileStructureOrigin, FigmaFileStructureStatistics } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOFrameNodeStructure = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n origin: FigmaFileStructureOrigin,\n assetsInFile: FigmaFileStructureStatistics,\n});\n\nexport const DTOFrameNodeStructureListResponse = z.object({\n structures: DTOFrameNodeStructure.array(),\n});\n\nexport type DTOFrameNodeStructure = z.infer<typeof DTOFrameNodeStructure>;\nexport type DTOFrameNodeStructureListResponse = z.infer<typeof DTOFrameNodeStructureListResponse>;\n","import {\n ElementPropertyImmutableType,\n ElementPropertyLinkType,\n ElementPropertyTargetType,\n ElementPropertyTypeSchema,\n nullishToOptional,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOColorTokenInlineData } from \"../../aux\";\nimport { DTOObjectMeta } from \"../../aux/meta\";\n\nconst CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9-]{1,99}$/;\n\nexport const DTOElementPropertyDefinitionOption = z.object({\n id: z.string(),\n name: z.string(),\n backgroundColor: DTOColorTokenInlineData.optional(),\n});\n\n// DTO Object\nexport const DTOElementPropertyDefinition = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n meta: DTOObjectMeta,\n persistentId: z.string(),\n type: ElementPropertyTypeSchema,\n targetElementType: ElementPropertyTargetType,\n codeName: z.string().regex(CODE_NAME_REGEX),\n options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),\n linkElementType: nullishToOptional(ElementPropertyLinkType),\n isImmutable: z.boolean(),\n immutablePropertyType: ElementPropertyImmutableType.optional(),\n});\n\nexport type DTOElementPropertyDefinitionOption = z.infer<typeof DTOElementPropertyDefinitionOption>;\nexport type DTOElementPropertyDefinition = z.infer<typeof DTOElementPropertyDefinition>;\n\n//\n// Read\n//\n\nexport const DTOElementPropertyDefinitionListResponse = z.object({\n definitions: z.array(DTOElementPropertyDefinition),\n});\n\nexport const DTOElementPropertyDefinitionResponse = z.object({\n definition: DTOElementPropertyDefinition,\n});\n\nexport type DTOElementPropertyDefinitionListResponse = z.infer<typeof DTOElementPropertyDefinitionListResponse>;\nexport type DTOElementPropertyDefinitionResponse = z.infer<typeof DTOElementPropertyDefinitionResponse>;\n\n//\n// Write\n//\n\nexport const DTOElementPropertyDefinitionCreatePayload = z.object({\n meta: DTOObjectMeta,\n persistentId: z.string(),\n type: ElementPropertyTypeSchema,\n targetElementType: ElementPropertyTargetType,\n codeName: z.string().regex(CODE_NAME_REGEX),\n options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),\n linkElementType: nullishToOptional(ElementPropertyLinkType),\n columnWidth: z.number().max(1024).optional(),\n});\n\nexport const DTOElementPropertyDefinitionUpdatePayload = z.object({\n meta: DTOObjectMeta.optional(),\n codeName: z.string().regex(CODE_NAME_REGEX).optional(),\n options: z.array(DTOElementPropertyDefinitionOption).optional(),\n});\n\nexport type DTOElementPropertyDefinitionCreatePayload = z.infer<typeof DTOElementPropertyDefinitionCreatePayload>;\nexport type DTOElementPropertyDefinitionUpdatePayload = z.infer<typeof DTOElementPropertyDefinitionUpdatePayload>;\n","import { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOElementPropertyValue = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n definitionId: z.string(),\n targetElementId: z.string(),\n value: z.union([z.string(), z.number(), z.boolean()]).optional(),\n valuePreview: z.string().optional(),\n});\n\nexport const DTOElementPropertyValueListResponse = z.object({\n values: z.array(DTOElementPropertyValue),\n});\n\nexport const DTOElementPropertyValueResponse = z.object({\n value: DTOElementPropertyValue,\n});\n\nexport const DTOElementPropertyValuesEditActionOutput = z.object({\n type: z.literal(\"ElementPropertyValuesEdit\"),\n output: z.object({ success: z.literal(true) }),\n});\n\nexport type DTOElementPropertyValue = z.infer<typeof DTOElementPropertyValue>;\nexport type DTOElementPropertyValueListResponse = z.infer<typeof DTOElementPropertyValueListResponse>;\nexport type DTOElementPropertyValueResponse = z.infer<typeof DTOElementPropertyValueResponse>;\nexport type DTOElementPropertyValuesEditActionOutput = z.infer<typeof DTOElementPropertyValuesEditActionOutput>;\n\n//\n// Write\n//\n\nexport const DTOElementPropertyValueUpsertPaylod = z.object({\n definitionId: z.string(),\n targetElementId: z.string(),\n value: z.string().or(z.number()).or(z.boolean()).nullable(),\n});\n\nexport const DTOElementPropertyValuesEditActionInput = z.object({\n type: z.literal(\"ElementPropertyValuesEdit\"),\n values: DTOElementPropertyValueUpsertPaylod.array(),\n});\n\nexport type DTOElementPropertyValueUpsertPaylod = z.infer<typeof DTOElementPropertyValueUpsertPaylod>;\nexport type DTOElementPropertyValuesEditActionInput = z.infer<typeof DTOElementPropertyValuesEditActionInput>;\n","import { z } from \"zod\";\nimport {\n DTODocumentationGroupCreateActionInputV2,\n DTODocumentationGroupCreateActionOutputV2,\n DTODocumentationGroupDeleteActionInputV2,\n DTODocumentationGroupDeleteActionOutputV2,\n DTODocumentationGroupDuplicateActionInputV2,\n DTODocumentationGroupDuplicateActionOutputV2,\n DTODocumentationGroupMoveActionInputV2,\n DTODocumentationGroupMoveActionOutputV2,\n DTODocumentationGroupUpdateActionInputV2,\n DTODocumentationGroupUpdateActionOutputV2,\n DTODocumentationTabCreateActionInputV2,\n DTODocumentationTabCreateActionOutputV2,\n DTODocumentationTabGroupDeleteActionInputV2,\n DTODocumentationTabGroupDeleteActionOutputV2,\n} from \"./documentation/group-action\";\nimport {\n DTODocumentationGroupRestoreActionInput,\n DTODocumentationGroupRestoreActionOutput,\n DTODocumentationPageApprovalStateChangeActionInput,\n DTODocumentationPageApprovalStateChangeActionOutput,\n DTODocumentationPageCreateActionInputV2,\n DTODocumentationPageCreateActionOutputV2,\n DTODocumentationPageDeleteActionInputV2,\n DTODocumentationPageDeleteActionOutputV2,\n DTODocumentationPageDuplicateActionInputV2,\n DTODocumentationPageDuplicateActionOutputV2,\n DTODocumentationPageMoveActionInputV2,\n DTODocumentationPageMoveActionOutputV2,\n DTODocumentationPageRestoreActionInput,\n DTODocumentationPageRestoreActionOutput,\n DTODocumentationPageUpdateActionInputV2,\n DTODocumentationPageUpdateActionOutputV2,\n DTODocumentationPageUpdateDocumentActionInputV2,\n DTODocumentationPageUpdateDocumentActionOutputV2,\n} from \"./documentation/page-actions-v2\";\nimport {\n DTOFigmaNodeRenderActionInput,\n DTOFigmaNodeRenderActionOutput,\n DTOFigmaNodeRenderAsyncActionInput,\n DTOFigmaNodeRenderAsyncActionOutput,\n} from \"./figma-nodes/node-actions-v2\";\nimport { DTOElementPropertyValuesEditActionInput, DTOElementPropertyValuesEditActionOutput } from \"./properties\";\n\n//\n// Read\n//\n\nexport const DTOElementActionOutput = z.discriminatedUnion(\"type\", [\n // Documentation pages\n DTODocumentationPageCreateActionOutputV2,\n DTODocumentationPageUpdateActionOutputV2,\n DTODocumentationPageUpdateDocumentActionOutputV2,\n DTODocumentationPageMoveActionOutputV2,\n DTODocumentationPageDuplicateActionOutputV2,\n DTODocumentationPageDeleteActionOutputV2,\n\n // Documentation groups\n DTODocumentationGroupCreateActionOutputV2,\n DTODocumentationTabCreateActionOutputV2,\n DTODocumentationGroupUpdateActionOutputV2,\n DTODocumentationGroupMoveActionOutputV2,\n DTODocumentationGroupDuplicateActionOutputV2,\n DTODocumentationGroupDeleteActionOutputV2,\n DTODocumentationTabGroupDeleteActionOutputV2,\n\n // Figma frames\n DTOFigmaNodeRenderActionOutput,\n DTOFigmaNodeRenderAsyncActionOutput,\n\n // Restore\n DTODocumentationPageRestoreActionOutput,\n DTODocumentationGroupRestoreActionOutput,\n\n // Approvals\n DTODocumentationPageApprovalStateChangeActionOutput,\n\n // Element properties\n DTOElementPropertyValuesEditActionOutput,\n]);\n\nexport type DTOElementActionOutput = z.infer<typeof DTOElementActionOutput>;\n\n//\n// Write\n//\n\nexport const DTOElementActionInput = z\n .discriminatedUnion(\"type\", [\n // Documentation pages\n DTODocumentationPageCreateActionInputV2,\n DTODocumentationPageUpdateActionInputV2,\n DTODocumentationPageUpdateDocumentActionInputV2,\n DTODocumentationPageMoveActionInputV2,\n DTODocumentationPageDuplicateActionInputV2,\n DTODocumentationPageDeleteActionInputV2,\n\n // Documentation groups\n DTODocumentationGroupCreateActionInputV2,\n DTODocumentationTabCreateActionInputV2,\n DTODocumentationGroupUpdateActionInputV2,\n DTODocumentationGroupMoveActionInputV2,\n DTODocumentationGroupDuplicateActionInputV2,\n DTODocumentationGroupDeleteActionInputV2,\n DTODocumentationTabGroupDeleteActionInputV2,\n\n // Figma frames\n DTOFigmaNodeRenderActionInput,\n DTOFigmaNodeRenderAsyncActionInput,\n\n // Restore\n DTODocumentationPageRestoreActionInput,\n DTODocumentationGroupRestoreActionInput,\n\n // Approval\n DTODocumentationPageApprovalStateChangeActionInput,\n\n // Element properties\n DTOElementPropertyValuesEditActionInput,\n ])\n .and(\n z.object({\n tId: z.string().optional(),\n })\n );\n\nexport type DTOElementActionInput = z.infer<typeof DTOElementActionInput>;\nexport type DTOElementActionInputOfType<T extends DTOElementActionInput[\"type\"]> = Extract<\n DTOElementActionInput,\n { type: T }\n>;\n","import { z } from \"zod\";\nimport { DTOFigmaNode, DTOFigmaNodeV2 } from \"./figma-nodes\";\n\n//\n// Read\n//\n\nexport const DTOElementsGetTypeFilter = z.enum([\"FigmaNode\"]);\n\nexport const DTOElementsGetQuerySchema = z.object({\n types: z.string().transform(val => val.split(\",\").map(v => DTOElementsGetTypeFilter.parse(v))),\n responseVersion: z.coerce.number().default(1),\n});\n\nexport const DTOElementsGetOutput = z.object({\n figmaNodes: z.array(DTOFigmaNode).optional(),\n});\n\nexport const DTOElementsGetOutputV2 = z.object({\n figmaNodes: z.array(DTOFigmaNodeV2).optional(),\n});\n\nexport type DTOElementsGetOutput = z.infer<typeof DTOElementsGetOutput>;\nexport type DTOElementsGetOutputV2 = z.infer<typeof DTOElementsGetOutputV2>;\nexport type DTOElementsGetQueryRaw = z.input<typeof DTOElementsGetQuerySchema>;\nexport type DTOElementsGetQueryParsed = z.output<typeof DTOElementsGetQuerySchema>;\nexport type DTOElementsGetTypeFilter = z.infer<typeof DTOElementsGetTypeFilter>;\n","import { z } from \"zod\";\n\nexport const DTOAssetRenderConfiguration = z.object({\n prefix: z.string().optional(),\n suffix: z.string().optional(),\n scale: z.enum([\"x1\", \"x2\", \"x3\", \"x4\"]),\n format: z.enum([\"png\", \"pdf\", \"svg\"]),\n});\n\nexport const DTORenderedAssetFile = z.object({\n assetId: z.string(),\n fileName: z.string(),\n sourceUrl: z.string(),\n settings: DTOAssetRenderConfiguration,\n originalName: z.string(),\n});\n\nexport const DTODownloadAssetsRequest = z.object({\n persistentIds: z.array(z.string().uuid()).optional(),\n settings: DTOAssetRenderConfiguration.array(),\n});\n\nexport const DTODownloadAssetsResponse = z.object({\n items: DTORenderedAssetFile.array(),\n});\n\nexport type DTOAssetRenderConfiguration = z.infer<typeof DTOAssetRenderConfiguration>;\nexport type DTORenderedAssetFile = z.infer<typeof DTORenderedAssetFile>;\nexport type DTODownloadAssetsRequest = z.infer<typeof DTODownloadAssetsRequest>;\nexport type DTODownloadAssetsResponse = z.infer<typeof DTODownloadAssetsResponse>;\n","import { type FigmaExporter, FigmaExporterAnyDesignNodeSchema } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOFigmaNodeResponse: z.ZodType<{\n nodes: FigmaExporter[\"AnyDesignNode\"];\n}> = z.object({\n nodes: FigmaExporterAnyDesignNodeSchema,\n});\n\nexport type DTOFigmaNodeResponse = {\n nodes: FigmaExporter[\"AnyDesignNode\"];\n};\n","import { z } from \"zod\";\n\nexport const DTOLiveblocksAuthResponse = z.object({\n token: z.string(),\n})\n\nexport type DTOLiveblocksAuthResponse = z.infer<typeof DTOLiveblocksAuthResponse>;\n","import { nullishToOptional, PortalSettingsTheme } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOPortalSettingsTheme = PortalSettingsTheme;\n\nexport const DTOPortalSettings = z.object({\n id: z.string(),\n workspaceId: z.string(),\n\n enabledDesignSystemIds: z.array(z.string()),\n enabledBrandPersistentIds: z.array(z.string()),\n\n theme: nullishToOptional(DTOPortalSettingsTheme),\n sidebar: nullishToOptional(z.any()),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTOPortalSettingsGetResponse = z.object({\n portalSettings: DTOPortalSettings,\n});\n\nexport const DTOPortalSettingsUpdatePayload = z.object({\n enabledDesignSystemIds: z.array(z.string()).optional(),\n enabledBrandPersistentIds: z.array(z.string()).optional(),\n theme: DTOPortalSettingsTheme.optional(),\n sidebar: z.any().optional(),\n});\n\nexport type DTOPortalSettingsTheme = z.infer<typeof DTOPortalSettingsTheme>;\nexport type DTOPortalSettings = z.infer<typeof DTOPortalSettings>;\nexport type DTOPortalSettingsGetResponse = z.infer<typeof DTOPortalSettingsGetResponse>;\nexport type DTOPortalSettingsUpdatePayload = z.infer<typeof DTOPortalSettingsUpdatePayload>;\n","import { DesignTokenTypedData, ThemeOverrideOrigin } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOThemeOverride = DesignTokenTypedData.and(\n z.object({\n tokenPersistentId: z.string(),\n origin: ThemeOverrideOrigin.optional(),\n })\n);\n\nexport type DTOThemeOverride = z.infer<typeof DTOThemeOverride>;\n\n//\n// Write\n//\n\nexport const DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(\n z.object({\n tokenPersistentId: z.string(),\n })\n);\n\nexport type DTOThemeOverrideCreatePayload = z.infer<typeof DTOThemeOverrideCreatePayload>;\n","import { ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOThemeOverride } from \"./override\";\n\n//\n// Read\n//\n\nexport const DTOTheme = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n brandId: z.string(),\n\n meta: ObjectMeta,\n codeName: z.string(),\n\n overrides: DTOThemeOverride.array(),\n});\n\nexport const DTOThemeResponse = z.object({\n theme: DTOTheme,\n});\n\nexport const DTOThemeListResponse = z.object({\n themes: DTOTheme.array(),\n});\n\nexport type DTOTheme = z.infer<typeof DTOTheme>;\nexport type DTOThemeResponse = z.infer<typeof DTOThemeResponse>;\nexport type DTOThemeListResponse = z.infer<typeof DTOThemeListResponse>;\n\n//\n// Write\n//\n\nexport const DTOThemeCreatePayload = z.object({\n meta: ObjectMeta,\n persistentId: z.string(),\n brandId: z.string(),\n codeName: z.string(),\n overrides: DTOThemeOverride.array(),\n});\n\nexport type DTOThemeCreatePayload = z.infer<typeof DTOThemeCreatePayload>;\n","const figmaFileIdRegex = /^[0-9a-zA-Z]{22,128}$/;\nconst nodeIdRegex = /^\\d+-\\d+$/;\nconst nodeTypeRegex = /^[0-9a-zA-Z]^/;\n\nexport enum ParsedFigmaFileURLError {\n InvalidUrl = \"InvalidUrl\",\n InvalidFigmaFileId = \"InvalidFigmaFileId\",\n}\n\ntype ParsedFigmaFileURL =\n | {\n status: \"Success\";\n fileId: string;\n fileName: string | null;\n nodeId: string | null;\n nodeType: string | null;\n }\n | {\n status: \"Error\";\n error: ParsedFigmaFileURLError;\n };\n\nexport const FigmaUtils = {\n tryParseFigmaFileURL(urlString: string): ParsedFigmaFileURL {\n if (!URL.canParse(urlString)) {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidUrl };\n }\n\n // Validate that this is a Figma URL\n const url = new URL(urlString);\n if (!url.hostname.endsWith(\"figma.com\")) {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidUrl };\n }\n\n // Validate that the URL type is the correct one (pointing to a design file)\n const pathSegments = url.pathname.split(\"/\");\n if (pathSegments[1] !== \"design\" && pathSegments[1] !== \"file\") {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidUrl };\n }\n\n // Validate Figma file ID\n const fileId = pathSegments[2];\n if (!fileId || !fileId.match(figmaFileIdRegex)) {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidFigmaFileId };\n }\n\n // Parse Figma file name\n let fileName: string | null = null;\n const rawFileName = pathSegments[3];\n if (rawFileName) {\n fileName = rawFileName.replaceAll(\"-\", \" \");\n }\n\n // Parse node id\n let nodeId: string | null = null;\n const nodeIdRaw = url.searchParams.get(\"node-id\");\n if (nodeIdRaw && nodeIdRaw.match(nodeIdRegex)) {\n nodeId = nodeIdRaw.replace(\"-\", \":\");\n }\n\n // Parse node type\n let nodeType: string | null = null;\n const nodeTypeRaw = url.searchParams.get(\"node-type\");\n if (nodeTypeRaw && nodeTypeRaw.match(nodeTypeRegex)) {\n nodeType = nodeTypeRaw;\n }\n\n return { status: \"Success\", fileId, fileName, nodeId, nodeType };\n },\n};\n\n// https://www.figma.com/design/U3Mg3I8WbvqF6CcZtRJM7w?node-id=2-3&t=9Qev2vhsldyFMhuE-1\n","function hash(input: string): string {\n return farmhash(input).toString(16);\n}\n\nfunction farmhash(input: string): number {\n const seed = 0x9e3779b9;\n let hash = seed;\n\n for (let i = 0; i < input.length; i++) {\n const charCode = input.charCodeAt(i);\n hash ^= charCode;\n hash = Math.imul(hash, 0x5bd1e995);\n hash ^= hash >>> 15;\n }\n\n hash = Math.imul(hash, 0x5bd1e995);\n hash ^= hash >>> 13;\n hash = Math.imul(hash, 0x5bd1e995);\n hash ^= hash >>> 15;\n\n return hash >>> 0;\n}\n\nfunction prepareObject(obj: any): any {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n if (Array.isArray(obj)) {\n return obj.map(prepareObject);\n }\n const sortedObj: any = {};\n for (const key of Object.keys(obj).sort()) {\n if (obj[key] === null || obj[key] === undefined) {\n continue;\n }\n sortedObj[key] = prepareObject(obj[key]);\n }\n return sortedObj;\n}\n\nexport function generateHash(input: object | string, debug = false): string {\n if (typeof input === \"object\") {\n const sanitized = JSON.stringify(prepareObject(input));\n if (debug) {\n console.log(\"Hashing sanitized string:\");\n console.log(sanitized);\n }\n return hash(sanitized);\n } else {\n try {\n const obj = JSON.parse(input);\n const sanitized = JSON.stringify(prepareObject(obj));\n if (debug) {\n console.log(\"Hashing sanitized string:\");\n console.log(sanitized);\n }\n return hash(sanitized);\n } catch {\n return hash(input);\n }\n }\n}\n","type CompatibleValue = number | string | boolean | undefined;\ntype QueryObject = Record<string, CompatibleValue | CompatibleValue[]>;\n\nexport function serializeQuery(query: QueryObject): URLSearchParams {\n const queryWithStrings = Object.fromEntries(\n Object.entries(query)\n .filter(e => !!e[1])\n .map(([k, v]) => {\n if (Array.isArray(v)) {\n return [k, v.join(\", \")];\n } else {\n return [k, v!.toString()];\n }\n })\n );\n\n return new URLSearchParams(queryWithStrings);\n}\n","export const exhaustiveInvalidUriPaths = {\n emptyPath: \"\",\n spacesInPath: \"/invalid path/with spaces\",\n specialCharacter1: \"/path/with|invalid>characters\",\n specialCharacter2: \"/path/with<invalid*characters\",\n specialCharacter3: \"/path/{invalid}?characters\",\n consecutiveSlashes: \"/path//with///too/many/slashes\",\n unencodedPercent: \"/path/with/unencoded%percent\",\n unencodedSpaces: \"/path/with unencoded spaces\",\n fragmentIdentifier: \"/path/with#fragment\",\n queryParameters: \"/path/with?query=parameter\",\n nullCharacter: \"/path/with/\\u0000nullcharacter\",\n onlySlash: \"/\",\n controlCharacter: \"/path/with/control\\0character\",\n extremelyLongPath: \"/\" + \"a\".repeat(2047),\n invalidStartCharacter: \"///path/starting/with/slashes\",\n invalidStartCharacterColon: \":/path/starting/with/colon\",\n invalidTrailingDot: \"/path/ending/with/dot.\",\n invalidPercentEncoding1: \"/path/with/%2\",\n invalidPercentEncoding2: \"/path/with/%ZZ\",\n invalidPercentEncoding3: \"/path/with/%G1\",\n reservedCharacter1: \"/path/with?<reserved>\",\n reservedCharacter2: '/path/with/\"quotes\"',\n reservedCharacter3: \"/path/with/[brackets]\",\n reservedCharacter4: \"/path/with/\\\\backslashes\",\n nonAscii1: \"/path/with/你好\",\n nonAscii2: \"/path/with/emoji/😃\",\n mixedEncodingPath: \"/path/%41A%42B%C3%28\",\n directoryTraversal1: \"/path/../../etc/passwd\",\n directoryTraversal2: \"/path/./././\",\n};\n\ntype ValidationErrorReason = \"TooLong\" | \"InvalidURI\" | \"Empty\" | \"ContainsQuery\" | \"ContainsFragment\";\n\nexport function isValidRedirectPath(path: string): { isValid: boolean; reason: ValidationErrorReason | undefined } {\n const trimmedPath = path.toLowerCase().trim();\n const url = \"https://www.example.com\" + trimmedPath;\n if (url.length > 2048) {\n return {\n isValid: false,\n reason: \"TooLong\",\n };\n }\n if (trimmedPath === \"\") {\n return {\n isValid: false,\n reason: \"Empty\",\n };\n }\n if (url === \"/\") {\n return {\n isValid: false,\n reason: \"Empty\",\n };\n }\n\n if (url.includes(\"?\")) {\n return {\n isValid: false,\n reason: \"ContainsQuery\",\n };\n }\n if (url.includes(\"#\")) {\n return {\n isValid: false,\n reason: \"ContainsFragment\",\n };\n }\n\n const regex = /^\\/[A-Za-z0-9_-]+(\\/[A-Za-z0-9_-]+)*$/;\n const isValid = regex.test(trimmedPath);\n return {\n isValid: regex.test(trimmedPath),\n reason: !isValid ? \"InvalidURI\" : undefined,\n };\n}\n","import { serializeQuery } from \"../../../utils\";\nimport { z } from \"zod\";\nimport {\n DTOExporterCreateInput,\n DTOExporterResponse,\n DTOExporterListQuery,\n DTOExporterListResponse,\n DTOExporterDeprecationInput,\n DTOExporter,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class ExportersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n add(workspaceId: string, body: DTOExporterCreateInput) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterResponse, {\n body,\n method: \"POST\",\n });\n }\n\n list(workspaceId: string, query?: DTOExporterListQuery) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterListResponse, {\n query: query ? serializeQuery(query) : undefined,\n });\n }\n\n get(workspaceId: string, exporterId: string) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters/${exporterId}`, DTOExporterResponse);\n }\n\n deprecate(workspaceId: string, exporterId: string, body: DTOExporterDeprecationInput) {\n return this.requestExecutor.json(\n `/codegen/workspaces/${workspaceId}/exporters/${exporterId}/deprecation`,\n DTOExporter,\n {\n body,\n method: \"PUT\",\n }\n );\n }\n\n pullChanges(workspaceId: string, exporterId: string) {\n return this.requestExecutor.json(\n `/codegen/workspaces/${workspaceId}/exporters/${exporterId}`,\n DTOExporterResponse,\n {\n body: {},\n method: \"PUT\",\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport { DTOExportJobResponseLegacy } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class ExporterJobsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`, z.any());\n }\n\n get(workspaceId: string, jobId: string) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs/${jobId}`, DTOExportJobResponseLegacy);\n }\n}\n","import { DTOExportJobResponse, DTOPipelineListQuery, DTOPipelineListResponse, DTOPipelineResponse } from \"../../dto\";\nimport { DTOPipelineCreateBody, DTOPipelineTriggerBody, DTOPipelineUpdateBody } from \"../../payloads\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class PipelinesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string, query: DTOPipelineListQuery) {\n const queryWithStrings = Object.fromEntries(\n Object.entries(query)\n .filter(e => !!e[1])\n .map(([k, v]) => [k, v.toString()])\n );\n\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineListResponse, {\n query: new URLSearchParams(queryWithStrings),\n });\n }\n\n create(workspaceId: string, payload: DTOPipelineCreateBody) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineResponse, {\n body: payload,\n method: \"POST\",\n });\n }\n\n update(designSystemId: string, pipelineId: string, payload: DTOPipelineUpdateBody) {\n return this.requestExecutor.json(`/design-systems/${designSystemId}/pipelines/${pipelineId}`, DTOPipelineResponse, {\n body: payload,\n method: \"PUT\",\n });\n }\n\n trigger(workspaceId: string, pipelineId: string, payload: DTOPipelineTriggerBody) {\n return this.requestExecutor.json(\n `/codegen/workspaces/${workspaceId}/pipelines/${pipelineId}/trigger`,\n DTOExportJobResponse,\n {\n body: payload,\n method: \"POST\",\n }\n );\n }\n}\n","import { RequestExecutor } from \"../../transport\";\nimport { ExportersEndpoint } from \"./exporters\";\nimport { ExporterJobsEndpoint } from \"./jobs\";\nimport { PipelinesEndpoint } from \"./pipelines\";\n\nexport class CodegenEndpoint {\n readonly exporters: ExportersEndpoint;\n readonly pipelines: PipelinesEndpoint;\n readonly jobs: ExporterJobsEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.pipelines = new PipelinesEndpoint(requestExecutor);\n this.exporters = new ExportersEndpoint(requestExecutor);\n this.jobs = new ExporterJobsEndpoint(requestExecutor);\n }\n}\n","import { z } from \"zod\";\nimport { DTOBrandCreatePayload, DTOBrandGetResponse, DTOBrandsListResponse, DTOBrandUpdatePayload } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class BrandsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(designSystemId: string, versionId: string, brandId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/brands/${brandId}`,\n DTOBrandGetResponse\n );\n }\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/brands`,\n DTOBrandsListResponse\n );\n }\n\n create(designSystemId: string, versionId: string, body: DTOBrandCreatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/brands`,\n DTOBrandGetResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n update(dsId: string, vId: string, brandId: string, body: DTOBrandUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, DTOBrandGetResponse, {\n method: \"PUT\",\n body,\n });\n }\n\n delete(dsId: string, vId: string, brandId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z.any(), {\n method: \"DELETE\",\n });\n }\n}\n","import {\n DTOAnalyzeCodeComponentsInPackageInput,\n DTOAnalyzeCodeComponentsInPackageResponse,\n DTOCodeComponentListResponse,\n DTOCodeComponentsCreateInput,\n DTOCodeComponentUpsertResponse,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class CodeComponentsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async import(dsId: string, vId: string, body: DTOCodeComponentsCreateInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components`,\n DTOCodeComponentUpsertResponse,\n {\n body,\n method: \"POST\",\n }\n );\n }\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components`,\n DTOCodeComponentListResponse\n );\n }\n\n async deleteAll(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components`,\n DTOCodeComponentListResponse,\n {\n method: \"DELETE\",\n }\n );\n }\n\n async analyzePackage(dsId: string, vId: string, body: DTOAnalyzeCodeComponentsInPackageInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components/analyze-package`,\n DTOAnalyzeCodeComponentsInPackageResponse,\n {\n body,\n method: \"POST\",\n }\n );\n }\n}\n","import {\n DTODocumentationPageRoomResponse,\n DTODocumentationStructure,\n DTOPublishDocumentationRequest,\n DTOPublishDocumentationResponse,\n} from \"../../../dto\";\nimport { DTOGetBlockDefinitionsOutput } from \"../../../payloads\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class DocumentationEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async getStructure(designSystemId: string, versionId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/documentation/structure`,\n DTODocumentationStructure\n );\n }\n\n async getDocStructure(dsId: string, vId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/structure`,\n DTODocumentationStructure\n );\n }\n\n async getPageRoom(dsId: string, vId: string, pageId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/pages/${pageId}/room`,\n DTODocumentationPageRoomResponse\n );\n }\n\n async getBlockDefinitions(dsId: string, vId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/block-definitions`,\n DTOGetBlockDefinitionsOutput\n );\n }\n\n async publish(dsId: string, vId: string, body: DTOPublishDocumentationRequest) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/publish`,\n DTOPublishDocumentationResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n}\n","import {\n DTODesignSystemComponentCreateInput,\n DTODesignSystemComponentListResponse,\n DTODesignSystemComponentResponse,\n} from \"../../../dto/design-systems/component\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class DesignSystemComponentEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/design-system-components`,\n DTODesignSystemComponentListResponse\n );\n }\n\n async create(dsId: string, vId: string, body: DTODesignSystemComponentCreateInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/design-system-components`,\n DTODesignSystemComponentResponse,\n {\n body,\n method: \"POST\",\n }\n );\n }\n}\n","import {\n DTOCreateDocumentationGroupInput,\n DTOCreateDocumentationPageInputV2,\n DTOCreateDocumentationTabInput,\n DTOElementActionInput,\n DTOElementActionOutput,\n DTOElementPropertyValueUpsertPaylod,\n DTOFigmaNodeRenderIdInput,\n DTOFigmaNodeRenderInput,\n DTOMoveDocumentationGroupInput,\n DTOUpdateDocumentationGroupInput,\n DTOUpdateDocumentationPageDocumentInputV2,\n DTOUpdateDocumentationPageInputV2,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ElementsActionEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async createDocPage(dsId: string, vId: string, input: DTOCreateDocumentationPageInputV2) {\n return this.action(dsId, vId, { type: \"DocumentationPageCreate\", input });\n }\n\n async createDocGroup(dsId: string, vId: string, input: DTOCreateDocumentationGroupInput) {\n return this.action(dsId, vId, { type: \"DocumentationGroupCreate\", input });\n }\n\n async moveDocGroup(dsId: string, vId: string, input: DTOMoveDocumentationGroupInput) {\n return this.action(dsId, vId, { type: \"DocumentationGroupMove\", input });\n }\n\n async updateDocPage(dsId: string, vId: string, input: DTOUpdateDocumentationPageInputV2) {\n return this.action(dsId, vId, { type: \"DocumentationPageUpdate\", input });\n }\n\n async updateDocPageDocument(dsId: string, vId: string, input: DTOUpdateDocumentationPageDocumentInputV2) {\n return this.action(dsId, vId, { type: \"DocumentationPageUpdateDocument\", input });\n }\n\n async updateDocGroup(dsId: string, vId: string, input: DTOUpdateDocumentationGroupInput) {\n return this.action(dsId, vId, { type: \"DocumentationGroupUpdate\", input });\n }\n\n async createDocTab(dsId: string, vId: string, input: DTOCreateDocumentationTabInput) {\n return this.action(dsId, vId, { type: \"DocumentationTabCreate\", input });\n }\n\n async renderNodes(dsId: string, vId: string, input: DTOFigmaNodeRenderIdInput[]) {\n return this.action(dsId, vId, { type: \"FigmaNodeRender\", input });\n }\n\n async renderNodesAsync(dsId: string, vId: string, nodes: DTOFigmaNodeRenderInput[]) {\n return this.action(dsId, vId, { type: \"FigmaNodeRenderAsync\", nodes });\n }\n\n async bulkEditPropertyValues(dsId: string, vId: string, values: DTOElementPropertyValueUpsertPaylod[]) {\n return this.action(dsId, vId, { type: \"ElementPropertyValuesEdit\", values });\n }\n\n private async action(dsId: string, vId: string, input: DTOElementActionInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/elements-action`,\n DTOElementActionOutput,\n {\n body: input,\n method: \"POST\",\n }\n );\n }\n}\n","import { OmitStrict } from \"@supernova-studio/model\";\nimport { serializeQuery } from \"../../../../utils\";\nimport { DTOElementsGetOutput, DTOElementsGetOutputV2, DTOElementsGetQueryParsed } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\ntype GetElementsQuery = OmitStrict<DTOElementsGetQueryParsed, \"responseVersion\">;\n\nexport class ElementsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getElementsV1(dsId: string, vId: string, query: GetElementsQuery) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/elements`, DTOElementsGetOutput, {\n query: serializeQuery(query),\n });\n }\n\n getElementsV2(dsId: string, vId: string, query: GetElementsQuery) {\n const fullQuery: DTOElementsGetQueryParsed = {\n ...query,\n responseVersion: 2,\n };\n\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/elements`, DTOElementsGetOutputV2, {\n query: serializeQuery(fullQuery),\n });\n }\n}\n","import { DTOFigmaComponentGroupListResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class FigmaComponentGroupsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/component-groups`,\n DTOFigmaComponentGroupListResponse\n );\n }\n}\n","import { DTOFigmaComponentListResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class FigmaComponentsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/components`,\n DTOFigmaComponentListResponse\n );\n }\n}\n","import { DTOFrameNodeStructureListResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class FigmaFrameStructuresEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/figma-frames/node-structures`,\n DTOFrameNodeStructureListResponse\n );\n }\n}\n","import {\n DTOFilesGetQuery,\n DTOFilesResponse,\n DTOFileUploadFinalizePayload,\n DTOFileUploadFinalizeResponse,\n DTOFileUploadPayload,\n DTOFileUploadResponse,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport\";\n\nexport class FilesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n upload(designSystemId: string, versionId: string, body: DTOFileUploadPayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/files/upload`,\n DTOFileUploadResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n finalize(designSystemId: string, versionId: string, body: DTOFileUploadFinalizePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/files/finalize`,\n DTOFileUploadFinalizeResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n get(designSystemId: string, versionId: string, query?: DTOFilesGetQuery) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/files`,\n DTOFilesResponse,\n { query: query ? new URLSearchParams(query) : undefined }\n );\n }\n}\n","import { DTOImportJobResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ImportJobsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(designSystemId: string, versionId: string, jobId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/import-jobs/${jobId}`,\n DTOImportJobResponse\n );\n }\n}\n","import { z } from \"zod\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class OverridesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, versionId: string, themeId: string, body: any) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/themes/${themeId}/overrides`,\n z.any(),\n {\n method: \"POST\",\n body,\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport {\n DTOElementPropertyDefinitionCreatePayload,\n DTOElementPropertyDefinitionListResponse,\n DTOElementPropertyDefinitionResponse,\n DTOElementPropertyDefinitionUpdatePayload,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ElementPropertyDefinitionsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions`,\n DTOElementPropertyDefinitionListResponse\n );\n }\n\n create(designSystemId: string, versionId: string, body: DTOElementPropertyDefinitionCreatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions`,\n DTOElementPropertyDefinitionResponse,\n { method: \"POST\", body }\n );\n }\n\n update(designSystemId: string, versionId: string, defId: string, body: DTOElementPropertyDefinitionUpdatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,\n DTOElementPropertyDefinitionResponse,\n { method: \"PUT\", body }\n );\n }\n\n delete(designSystemId: string, versionId: string, defId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,\n z.any(),\n { method: \"DELETE\" }\n );\n }\n}\n","import {\n DTOElementPropertyValueListResponse,\n DTOElementPropertyValueResponse,\n DTOElementPropertyValueUpsertPaylod,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ElementPropertyValuesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/values`,\n DTOElementPropertyValueListResponse\n );\n }\n\n upsert(designSystemId: string, versionId: string, body: DTOElementPropertyValueUpsertPaylod) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/values`,\n DTOElementPropertyValueResponse,\n { method: \"POST\", body }\n );\n }\n}\n","import { DTODesignSystemVersionStats, DTODesignSystemVersionStatsQuery } from \"../../../dto/design-systems/stats\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class VersionStatsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(dsId: string, vId: string, query: DTODesignSystemVersionStatsQuery = {}) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/stats`, DTODesignSystemVersionStats, {\n query: new URLSearchParams(query),\n });\n }\n}\n","import { z } from \"zod\";\nimport { DTOThemeCreatePayload, DTOThemeListResponse, DTOThemeResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\nimport { OverridesEndpoint } from \"./overrides\";\n\nexport class ThemesEndpoint {\n readonly overrides: OverridesEndpoint;\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.overrides = new OverridesEndpoint(requestExecutor);\n }\n\n list(dsId: string, versionId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes`, DTOThemeListResponse);\n }\n\n get(dsId: string, versionId: string, themeId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`,\n DTOThemeResponse\n );\n }\n\n create(dsId: string, versionId: string, body: DTOThemeCreatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes`, DTOThemeResponse, {\n method: \"POST\",\n body,\n });\n }\n\n delete(dsId: string, versionId: string, themeId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z.any(), {\n method: \"DELETE\",\n });\n }\n}\n","import { DTOTokenCollectionsListReponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class TokenCollectionsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/token-collections`,\n DTOTokenCollectionsListReponse\n );\n }\n}\n","import {\n DTODesignTokenGroupCreatePayload,\n DTODesignTokenGroupListResponse,\n DTODesignTokenGroupResponse,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class TokenGroupsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, versionId: string, body: DTODesignTokenGroupCreatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/token-groups`,\n DTODesignTokenGroupResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n list(dsId: string, versionId: string): Promise<DTODesignTokenGroupListResponse> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/token-groups`,\n DTODesignTokenGroupListResponse\n );\n }\n}\n","import { DTODesignTokenCreatePayload, DTODesignTokenListResponse, DTODesignTokenResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class TokensEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, versionId: string, body: DTODesignTokenCreatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/tokens`, DTODesignTokenResponse, {\n method: \"POST\",\n body,\n });\n }\n\n list(dsId: string, versionId: string): Promise<DTODesignTokenListResponse> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/tokens`,\n DTODesignTokenListResponse\n );\n }\n\n get(dsId: string, versionId: string, tokenId: string): Promise<DTODesignTokenListResponse> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/tokens/${tokenId}`,\n DTODesignTokenListResponse\n );\n }\n}\n","import {\n DTODesignSystemVersionCreationResponse,\n DTODesignSystemVersionJobStatusResponse,\n DTODesignSystemVersionRoomResponse,\n DTODesignSystemVersionsListResponse,\n} from \"../../../dto\";\nimport { DTOCreateVersionInput } from \"../../../payloads\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\nimport { BrandsEndpoint } from \"./brands\";\nimport { DocumentationEndpoint } from \"./documentation\";\nimport { DesignSystemComponentEndpoint } from \"./ds-components\";\nimport { ElementsEndpoint } from \"./elements\";\nimport { ElementsActionEndpoint } from \"./elements-action\";\nimport { FigmaComponentGroupsEndpoint } from \"./figma-component-groups\";\nimport { FigmaComponentsEndpoint } from \"./figma-components\";\nimport { FigmaFrameStructuresEndpoint } from \"./figma-frame-structures\";\nimport { ImportJobsEndpoint } from \"./import-jobs\";\nimport { ElementPropertyDefinitionsEndpoint } from \"./property-definitions\";\nimport { ElementPropertyValuesEndpoint } from \"./property-values\";\nimport { VersionStatsEndpoint } from \"./stats\";\nimport { ThemesEndpoint } from \"./themes\";\nimport { TokenCollectionsEndpoint } from \"./token-collections\";\nimport { TokenGroupsEndpoint } from \"./token-groups\";\nimport { TokensEndpoint } from \"./tokens\";\nimport { CodeComponentsEndpoint } from \"./code-components\";\nimport { FilesEndpoint } from \"./files\";\n\nexport class DesignSystemVersionsEndpoint {\n readonly themes: ThemesEndpoint;\n readonly brands: BrandsEndpoint;\n readonly tokenCollections: TokenCollectionsEndpoint;\n readonly importJobs: ImportJobsEndpoint;\n readonly tokens: TokensEndpoint;\n readonly tokenGroups: TokenGroupsEndpoint;\n readonly figmaComponents: FigmaComponentsEndpoint;\n readonly figmaComponentGroups: FigmaComponentGroupsEndpoint;\n readonly figmaFrameStructures: FigmaFrameStructuresEndpoint;\n readonly stats: VersionStatsEndpoint;\n readonly elementPropertyDefinitions: ElementPropertyDefinitionsEndpoint;\n readonly elementPropertyValues: ElementPropertyValuesEndpoint;\n readonly elementsAction: ElementsActionEndpoint;\n readonly elements: ElementsEndpoint;\n readonly designSystemComponents: DesignSystemComponentEndpoint;\n readonly documentation: DocumentationEndpoint;\n readonly codeComponents: CodeComponentsEndpoint;\n readonly files: FilesEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.themes = new ThemesEndpoint(requestExecutor);\n this.brands = new BrandsEndpoint(requestExecutor);\n this.tokenCollections = new TokenCollectionsEndpoint(requestExecutor);\n this.importJobs = new ImportJobsEndpoint(requestExecutor);\n this.tokens = new TokensEndpoint(requestExecutor);\n this.tokenGroups = new TokenGroupsEndpoint(requestExecutor);\n this.figmaComponents = new FigmaComponentsEndpoint(requestExecutor);\n this.figmaComponentGroups = new FigmaComponentGroupsEndpoint(requestExecutor);\n this.figmaFrameStructures = new FigmaFrameStructuresEndpoint(requestExecutor);\n this.stats = new VersionStatsEndpoint(requestExecutor);\n this.elementPropertyDefinitions = new ElementPropertyDefinitionsEndpoint(requestExecutor);\n this.elementPropertyValues = new ElementPropertyValuesEndpoint(requestExecutor);\n this.elementsAction = new ElementsActionEndpoint(requestExecutor);\n this.elements = new ElementsEndpoint(requestExecutor);\n this.designSystemComponents = new DesignSystemComponentEndpoint(requestExecutor);\n this.documentation = new DocumentationEndpoint(requestExecutor);\n this.codeComponents = new CodeComponentsEndpoint(requestExecutor);\n this.files = new FilesEndpoint(requestExecutor);\n }\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions`, DTODesignSystemVersionsListResponse);\n }\n\n commit(dsId: string, body: DTOCreateVersionInput) {\n return this.requestExecutor.json(`/design-systems/${dsId}/head/commit`, DTODesignSystemVersionCreationResponse, {\n method: \"POST\",\n body,\n });\n }\n\n job(dsId: string, jobId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/jobs/${jobId}`,\n DTODesignSystemVersionJobStatusResponse\n );\n }\n\n room(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/room`,\n DTODesignSystemVersionRoomResponse\n );\n }\n}\n","import { DTODocumentationAnalyticsRequest, DTODocumentationPageAnalyticsResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemAnalyticsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(designSystemId: string, versionId: string, body: DTODocumentationAnalyticsRequest) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/documentation/analytics`,\n DTODocumentationPageAnalyticsResponse,\n { method: \"POST\", body }\n );\n }\n}\n","import { DTOBffImportRequestBody, DTOImportJobResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemBffEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n import(dsId: string, payload: DTOBffImportRequestBody) {\n return this.requestExecutor.json(`/design-systems/${dsId}/bff/import`, DTOImportJobResponse, {\n method: \"POST\",\n body: payload,\n });\n }\n}\n","import { DTODesignSystemContactsResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemContactsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/contacts`, DTODesignSystemContactsResponse, {\n method: \"GET\",\n });\n }\n}\n","import { z } from \"zod\";\nimport {\n DTODesignSystemCreateInput,\n DTODesignSystemResponse,\n DTODesignSystemsListResponse,\n DTOUserDesignSystemsResponse,\n} from \"../../dto\";\nimport { DTODesignSystemUpdateAccessModeInput, DTODesignSystemUpdateInput } from \"../../payloads\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\nimport { DesignSystemBffEndpoint } from \"./bff\";\nimport { DesignSystemContactsEndpoint } from \"./contact\";\nimport { FigmaNodeStructuresEndpoint } from \"./figma-node-structures\";\nimport { DesignSystemMembersEndpoint } from \"./members\";\nimport { DesignSystemPageRedirectsEndpoint } from \"./redirects\";\nimport { DesignSystemSourcesEndpoint } from \"./sources\";\nimport { StorybookEntriesEndpoint } from \"./storybook\";\nimport { DesignSystemVersionsEndpoint } from \"./versions/versions\";\nimport { DesignSystemAnalyticsEndpoint } from \"./analytics\";\nimport { StorybookHostingEndpoint } from \"./storybook-hosting\";\n\nexport class DesignSystemsEndpoint {\n readonly members: DesignSystemMembersEndpoint;\n readonly versions: DesignSystemVersionsEndpoint;\n readonly bff: DesignSystemBffEndpoint;\n readonly sources: DesignSystemSourcesEndpoint;\n readonly storybook: StorybookEntriesEndpoint;\n readonly storybookHosting: StorybookHostingEndpoint;\n readonly contacts: DesignSystemContactsEndpoint;\n readonly redirects: DesignSystemPageRedirectsEndpoint;\n readonly figmaNodeStructures: FigmaNodeStructuresEndpoint;\n readonly analytics: DesignSystemAnalyticsEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.members = new DesignSystemMembersEndpoint(requestExecutor);\n this.versions = new DesignSystemVersionsEndpoint(requestExecutor);\n this.bff = new DesignSystemBffEndpoint(requestExecutor);\n this.sources = new DesignSystemSourcesEndpoint(requestExecutor);\n this.storybook = new StorybookEntriesEndpoint(requestExecutor);\n this.storybookHosting = new StorybookHostingEndpoint(requestExecutor);\n this.contacts = new DesignSystemContactsEndpoint(requestExecutor);\n this.redirects = new DesignSystemPageRedirectsEndpoint(requestExecutor);\n this.figmaNodeStructures = new FigmaNodeStructuresEndpoint(requestExecutor);\n this.analytics = new DesignSystemAnalyticsEndpoint(requestExecutor);\n }\n\n create(body: DTODesignSystemCreateInput) {\n return this.requestExecutor.json(\"/design-systems\", DTODesignSystemResponse, { method: \"POST\", body });\n }\n\n list(wsId: string) {\n return this.requestExecutor.json(`/workspaces/${wsId}/design-systems`, DTODesignSystemsListResponse);\n }\n\n listUserDesignSystems() {\n return this.requestExecutor.json(\"/design-systems\", DTOUserDesignSystemsResponse);\n }\n\n get(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);\n }\n\n delete(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}`, z.any(), { method: \"DELETE\" });\n }\n\n update(dsId: string, body: DTODesignSystemUpdateInput) {\n return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {\n method: \"PUT\",\n body,\n });\n }\n\n updateAccessMode(dsId: string, body: DTODesignSystemUpdateAccessModeInput) {\n return this.requestExecutor.json(`/design-systems/${dsId}/access-mode`, DTODesignSystemResponse, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { DTOFigmaNodeStructureDetailResponse, DTOFigmaNodeStructureListResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class FigmaNodeStructuresEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/figma-node-structures`,\n DTOFigmaNodeStructureListResponse\n );\n }\n\n get(dsId: string, structureId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/figma-node-structures/${structureId}`,\n DTOFigmaNodeStructureDetailResponse\n );\n }\n}\n","import {\n DTODesignSystemMemberListResponse,\n DTODesignSystemMembersUpdatePayload,\n DTODesignSystemMembersUpdateResponse,\n DTOUserGetResponse,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemMembersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMemberListResponse, {\n method: \"GET\",\n });\n }\n\n update(dsId: string, body: DTODesignSystemMembersUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMembersUpdateResponse, {\n method: \"POST\",\n body,\n });\n }\n}\n","import {\n DTOPageRedirectDeleteResponse,\n DTOPageRedirectListResponse,\n DTOPageRedirectResponse,\n DTOPageRedirectCreateBody,\n DTOPageRedirectUpdateBody,\n} from \"../../dto/design-systems/redirects\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemPageRedirectsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, body: DTOPageRedirectCreateBody) {\n return this.requestExecutor.json(`/design-systems/${dsId}/documentation/redirects`, DTOPageRedirectResponse, {\n body,\n method: \"POST\",\n });\n }\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/documentation/redirects`, DTOPageRedirectListResponse, {\n method: \"GET\",\n });\n }\n\n update(dsId: string, redirectId: string, body: DTOPageRedirectUpdateBody) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/documentation/redirects/${redirectId}`,\n DTOPageRedirectResponse,\n {\n body,\n method: \"PUT\",\n }\n );\n }\n\n delete(dsId: string, redirectId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/documentation/redirects/${redirectId}`,\n DTOPageRedirectDeleteResponse,\n {\n method: \"DELETE\",\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport {\n DTODataSourceFigmaCreatePayload,\n DTODataSourceFigmaImportPayload,\n DTODataSourceResponse,\n DTODataSourcesListResponse,\n DTODataSourcesStorybookResponse,\n DTODataSourceStorybookCreatePayload,\n DTOFigmaSourceUpdatePayload,\n DTOImportJobResponse,\n DTOStorybookImportPayload,\n DTOStorybookSourceUpdatePayload,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemSourcesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, payload: DTODataSourceFigmaCreatePayload | DTODataSourceStorybookCreatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourceResponse, {\n method: \"POST\",\n body: payload,\n });\n }\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);\n }\n\n get(dsId: string, sourceId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse);\n }\n\n delete(dsId: string, sourceId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z.any(), { method: \"DELETE\" });\n }\n\n updateFigmaSource(dsId: string, sourceId: string, payload: DTOFigmaSourceUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse, {\n method: \"PUT\",\n body: payload,\n });\n }\n\n updateStorybookSource(dsId: string, sourceId: string, payload: DTOStorybookSourceUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse, {\n method: \"PUT\",\n body: payload,\n });\n }\n\n figmaImport(dsId: string, payload: DTODataSourceFigmaImportPayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/cloud-import`, DTOImportJobResponse, {\n method: \"POST\",\n body: payload,\n });\n }\n\n storybookImport(dsId: string, payload: DTOStorybookImportPayload) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/head/storybook-import`,\n DTODataSourcesStorybookResponse,\n {\n method: \"POST\",\n body: payload,\n }\n );\n }\n\n updateStorybookImport(dsId: string, versionId: string, payload: DTOStorybookImportPayload) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/storybook-import`,\n DTODataSourcesStorybookResponse,\n {\n method: \"POST\",\n body: payload,\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport { DTOStorybookEntryListResponse, DTOStorybookEntryReplaceAction } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class StorybookEntriesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook`, DTOStorybookEntryListResponse);\n }\n\n replace(dsId: string, entryId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/head/storybook/${entryId}`,\n DTOStorybookEntryReplaceAction,\n { method: \"PUT\" }\n );\n }\n\n delete(dsId: string, entryId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook/${entryId}`, z.any(), {\n method: \"DELETE\",\n });\n }\n}\n","import { z } from \"zod\";\nimport {\n DTOStorybookAccessTokenResponse,\n DTOStorybookUploadStatus,\n DTOStorybookUploadUrlRequest,\n DTOStorybookUploadUrlResponse,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class StorybookHostingEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getSignedUploadUrl(dsId: string, body: DTOStorybookUploadUrlRequest): Promise<DTOStorybookUploadUrlResponse> {\n return this.requestExecutor.json(`/design-systems/${dsId}/storybook/upload`, DTOStorybookUploadUrlResponse, {\n body,\n method: \"POST\",\n });\n }\n\n delete(dsId: string, storybookUploadId: string): Promise<{ ok: boolean }> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/storybook/${storybookUploadId}`,\n z.object({ ok: z.boolean() }),\n {\n method: \"DELETE\",\n }\n );\n }\n\n getUploadStatus(dsId: string, storybookUploadId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/storybook/${storybookUploadId}/status`,\n DTOStorybookUploadStatus\n );\n }\n\n getAccessToken(dsId: string, name: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/storybook/alias/${name}/access-token`,\n DTOStorybookAccessTokenResponse\n );\n }\n}\n","import {\n DTOForgeChatMessageCreateInput,\n DTOForgeChatMessageCreateResponse,\n DTOForgeChatMessageListQuery,\n DTOForgeChatMessageListResponse,\n DTOForgeChatThreadCreateInput,\n DTOForgeChatThreadCreateResponse,\n DTOForgeChatThreadDeleteResponse,\n DTOForgeChatThreadListQuery,\n DTOForgeChatThreadListResponse,\n DTOForgeChatThreadUpdateInput,\n DTOForgeChatThreadUpdateResponse,\n} from \"../../dto/workspaces/chat-threads\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class WorkspaceChatThreadsEndpoint {\n readonly messages: ChatThreadMessagesEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.messages = new ChatThreadMessagesEndpoint(requestExecutor);\n }\n\n create(workspaceId: string, body: DTOForgeChatThreadCreateInput) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads`, DTOForgeChatThreadCreateResponse, {\n method: \"POST\",\n body,\n });\n }\n\n list(workspaceId: string, query?: DTOForgeChatThreadListQuery) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads`, DTOForgeChatThreadListResponse, {\n query: query\n ? new URLSearchParams({\n ...(query.limit !== undefined && { limit: query.limit.toString() }),\n ...(query.offset !== undefined && { offset: query.offset.toString() }),\n })\n : undefined,\n });\n }\n\n update(workspaceId: string, threadId: string, body: DTOForgeChatThreadUpdateInput) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/forge/threads/${threadId}`,\n DTOForgeChatThreadUpdateResponse,\n {\n method: \"PUT\",\n body,\n }\n );\n }\n\n delete(workspaceId: string, threadId: string) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/forge/threads/${threadId}`,\n DTOForgeChatThreadDeleteResponse,\n {\n method: \"DELETE\",\n }\n );\n }\n}\n\nexport class ChatThreadMessagesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string, threadId: string, query?: DTOForgeChatMessageListQuery) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/forge/threads/${threadId}/messages`,\n DTOForgeChatMessageListResponse,\n {\n query: query\n ? new URLSearchParams({\n ...(query.limit !== undefined && { limit: query.limit.toString() }),\n ...(query.offset !== undefined && { offset: query.offset.toString() }),\n })\n : undefined,\n }\n );\n }\n\n create(workspaceId: string, threadId: string, body: DTOForgeChatMessageCreateInput) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/forge/threads/${threadId}/messages`,\n DTOForgeChatMessageCreateResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport { DTOIntegrationsGetListResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class WorkspaceIntegrationsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(wsId: string) {\n return this.requestExecutor.json(`/workspaces/${wsId}/integrations`, DTOIntegrationsGetListResponse);\n }\n\n delete(wsId: string, iId: string) {\n return this.requestExecutor.json(`/workspaces/${wsId}/integrations/${iId}`, z.unknown(), { method: \"DELETE\" });\n }\n}\n","import {\n DTOWorkspaceInvitationsResponse,\n DTOWorkspaceInvitationUpdateResponse,\n DTOWorkspaceInviteUpdate,\n DTOWorkspaceResponse,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class WorkspaceInvitationsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n update(workspaceId: string, invitationId: string, body: DTOWorkspaceInviteUpdate) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/invitations/${invitationId}/role`,\n DTOWorkspaceInvitationUpdateResponse,\n {\n method: \"PUT\",\n body,\n }\n );\n }\n\n list(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/invitations`, DTOWorkspaceInvitationsResponse, {\n method: \"GET\",\n });\n }\n\n delete(workspaceId: string, invitationId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/invitations/${invitationId}`, DTOWorkspaceResponse, {\n method: \"DELETE\",\n });\n }\n}\n","import { UpdateMembershipRolesInput } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOWorkspaceInvitationsListInput, DTOWorkspaceMembersListResponse, DTOWorkspaceResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class WorkspaceMembersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, DTOWorkspaceMembersListResponse, {\n method: \"GET\",\n });\n }\n\n update(workspaceId: string, body: UpdateMembershipRolesInput) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members/role`, DTOWorkspaceResponse, {\n method: \"PUT\",\n body,\n });\n }\n\n invite(workspaceId: string, body: DTOWorkspaceInvitationsListInput) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z.any(), { method: \"POST\", body });\n }\n\n delete(workspaceId: string, userId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members/${userId}`, DTOWorkspaceResponse, {\n method: \"DELETE\",\n });\n }\n}\n","import { RequestExecutor } from \"../../transport/request-executor\";\nimport { DTONpmRegistryAccessTokenResponse, DTOUpdateRegistryInput, DTOUpdateRegistryOutput } from \"../../dto\";\n\nexport class WorkspaceNpmRegistryEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getAccessToken(wsId: string) {\n return this.requestExecutor.json(\n `/workspaces/${wsId}/npm-registry/access-token`,\n DTONpmRegistryAccessTokenResponse\n );\n }\n\n update(wsId: string, body: DTOUpdateRegistryInput) {\n return this.requestExecutor.json(`/workspaces/${wsId}/npm-registry`, DTOUpdateRegistryOutput, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { z } from \"zod\";\nimport { DTOUserWorkspaceMembershipsResponse, DTOWorkspaceCreateInput, DTOWorkspaceResponse } from \"../../dto\";\nimport { DTOTransferOwnershipPayload } from \"../../payloads\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\nimport { WorkspaceChatThreadsEndpoint } from \"./chat-threads\";\nimport { WorkspaceIntegrationsEndpoint } from \"./integrations\";\nimport { WorkspaceInvitationsEndpoint } from \"./invites\";\nimport { WorkspaceMembersEndpoint } from \"./members\";\nimport { WorkspaceNpmRegistryEndpoint } from \"./npm-register\";\n\n// TODO Response types\nexport class WorkspacesEndpoint {\n public members: WorkspaceMembersEndpoint;\n public invitations: WorkspaceInvitationsEndpoint;\n public npmRegistry: WorkspaceNpmRegistryEndpoint;\n public chatThreads: WorkspaceChatThreadsEndpoint;\n integrations: WorkspaceIntegrationsEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.members = new WorkspaceMembersEndpoint(requestExecutor);\n this.invitations = new WorkspaceInvitationsEndpoint(requestExecutor);\n this.integrations = new WorkspaceIntegrationsEndpoint(requestExecutor);\n this.npmRegistry = new WorkspaceNpmRegistryEndpoint(requestExecutor);\n this.chatThreads = new WorkspaceChatThreadsEndpoint(requestExecutor);\n }\n\n create(body: DTOWorkspaceCreateInput) {\n return this.requestExecutor.json(\"/workspaces\", DTOWorkspaceResponse, {\n method: \"POST\",\n body: {\n ...body,\n product: \"free\",\n priceId: \"yearly\",\n },\n });\n }\n\n list() {\n return this.requestExecutor.json(`/workspaces`, DTOUserWorkspaceMembershipsResponse, { method: \"GET\" });\n }\n\n get(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}`, DTOWorkspaceResponse, { method: \"GET\" });\n }\n\n delete(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}`, z.any(), { method: \"DELETE\" });\n }\n\n subscription(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z.any(), { method: \"GET\" });\n }\n\n transferOwnership(workspaceId: string, body: DTOTransferOwnershipPayload) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/ownership`, DTOWorkspaceResponse, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { DTOLiveblocksAuthResponse } from \"../dto\";\nimport { DTOLiveblocksAuthRequest } from \"../payloads\";\nimport { RequestExecutor } from \"../transport/request-executor\";\n\nexport class LiveblocksEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n auth(body: DTOLiveblocksAuthRequest) {\n return this.requestExecutor.json(\"/liveblocks/auth\", DTOLiveblocksAuthResponse, {\n method: \"POST\",\n body,\n });\n }\n}\n","import { DTOUserProfileUpdate, DTOUserWorkspaceMembershipsResponse } from \"../dto\";\nimport { DTOAuthenticatedUserResponse } from \"../dto/users/authenticated-user\";\nimport { RequestExecutor } from \"../transport/request-executor\";\n\nexport class UsersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getMe() {\n return this.requestExecutor.json(\"/users/me\", DTOAuthenticatedUserResponse);\n }\n\n listWorkspaces(uid: string) {\n return this.requestExecutor.json(`/users/${uid}/workspaces`, DTOUserWorkspaceMembershipsResponse);\n }\n\n delete(uid: string) {\n return this.requestExecutor.json(`/users/${uid}`, DTOAuthenticatedUserResponse, { method: \"DELETE\" });\n }\n\n updateProfile(uid: string, body: DTOUserProfileUpdate) {\n return this.requestExecutor.json(`/users/${uid}/profile`, DTOAuthenticatedUserResponse, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { SupernovaExceptionType } from \"@supernova-studio/model\";\n\nexport type RequestExecutorErrorType = \"ServerError\" | \"ResponseParsingError\";\nexport type RequestEexecutorServerErrorCode = SupernovaExceptionType | undefined;\n\nexport class RequestExecutorError extends Error {\n readonly type: RequestExecutorErrorType;\n readonly errorCode: RequestEexecutorServerErrorCode | undefined;\n readonly serverErrorType: SupernovaExceptionType | undefined;\n\n static tryParseErrorCode(body: string) {\n try {\n const errorObj = JSON.parse(body);\n if (errorObj && typeof errorObj.errorCode === \"string\") {\n return errorObj.errorCode;\n }\n return null;\n } catch (e) {\n return null;\n }\n }\n\n static tryParseServerErrorType(body: string) {\n try {\n const errorObj = JSON.parse(body);\n if (errorObj && typeof errorObj.errorCode === \"string\") {\n return errorObj.type;\n }\n return null;\n } catch (e) {\n return null;\n }\n }\n\n static serverError(endpoint: string, status: number, bodyText: string) {\n return new RequestExecutorError(\n \"ServerError\",\n `Endpoint ${endpoint} returned ${status}\\n${bodyText}`,\n this.tryParseErrorCode(bodyText),\n this.tryParseServerErrorType(bodyText)\n );\n }\n\n static responseParsingError(endpoint: string, cause: Error) {\n return new RequestExecutorError(\n \"ResponseParsingError\",\n `Endpoint ${endpoint} returned incompatible JSON`,\n undefined,\n undefined,\n cause\n );\n }\n\n private constructor(\n type: RequestExecutorErrorType,\n message: string,\n errorCode: RequestEexecutorServerErrorCode | undefined,\n serverErrorType?: SupernovaExceptionType | undefined,\n cause?: unknown\n ) {\n super(`${type}: ${message}`, { cause });\n this.type = type;\n this.errorCode = errorCode;\n this.serverErrorType = serverErrorType;\n }\n}\n","import fetch, { RequestInit } from \"node-fetch\";\nimport { z, ZodSchema, ZodTypeDef } from \"zod\";\nimport { RequestExecutorError } from \"./request-executor-error\";\n\nexport type RequestExecutorConfig = {\n host: string;\n accessToken?: string;\n};\n\nexport type RequestExecutorJSONRequest = Omit<RequestInit, \"body\"> & {\n body?: object;\n query?: URLSearchParams;\n};\n\nconst ResponseWrapper = z.object({\n result: z.record(z.any()),\n});\n\nexport class RequestExecutor {\n private readonly testServerConfig: RequestExecutorConfig;\n\n constructor(testServerConfig: RequestExecutorConfig) {\n this.testServerConfig = testServerConfig;\n }\n\n async json<O, I>(\n path: `/${string}`,\n schema: ZodSchema<O, ZodTypeDef, I>,\n requestInit: RequestExecutorJSONRequest = {}\n ) {\n // Headers\n const defaultHeaders: Record<string, string> = {\n Accept: \"application/json\",\n };\n\n if (requestInit.body) defaultHeaders[\"Content-Type\"] = \"application/json\";\n if (this.testServerConfig.accessToken) {\n defaultHeaders[\"Authorization\"] = `Bearer ${this.testServerConfig.accessToken}`;\n }\n\n // Body\n let body: string | undefined;\n if (requestInit.body && typeof requestInit.body === \"object\") body = JSON.stringify(requestInit.body);\n\n const response = await fetch(this.fullUrl(path, requestInit.query), {\n ...requestInit,\n headers: {\n ...requestInit.headers,\n ...defaultHeaders,\n },\n body: body,\n });\n\n const endpoint = `${requestInit.method ?? \"GET\"} ${path}`;\n\n if (!response.ok) {\n const bodyString = await response.text();\n throw RequestExecutorError.serverError(endpoint, response.status, bodyString);\n }\n\n const json = await response.json();\n const wrapperParseResult = ResponseWrapper.safeParse(json);\n if (!wrapperParseResult.success) {\n console.error(`Response was:`);\n console.error(json);\n throw RequestExecutorError.responseParsingError(endpoint, wrapperParseResult.error);\n }\n\n const responseParseResult = schema.safeParse(wrapperParseResult.data.result);\n if (!responseParseResult.success) {\n console.error(`Response was:`);\n console.error(wrapperParseResult.data.result);\n throw RequestExecutorError.responseParsingError(endpoint, responseParseResult.error);\n }\n\n return responseParseResult.data;\n }\n\n private fullUrl(path: string, query: URLSearchParams | undefined): string {\n let url = `https://${this.testServerConfig.host}/api/v2${path}`;\n\n const queryString = query?.toString();\n if (queryString) url += `?${queryString}`;\n\n return url;\n }\n}\n","import { CodegenEndpoint, WorkspacesEndpoint } from \"./endpoints\";\nimport { DesignSystemsEndpoint } from \"./endpoints/design-system\";\nimport { LiveblocksEndpoint } from \"./endpoints/liveblocks\";\nimport { UsersEndpoint } from \"./endpoints/users\";\nimport { RequestExecutor } from \"./transport/request-executor\";\n\ntype SupernovaApiClientConfig = {\n host: string;\n accessToken: string;\n};\n\nexport class SupernovaApiClient {\n readonly users: UsersEndpoint;\n readonly workspaces: WorkspacesEndpoint;\n readonly designSystems: DesignSystemsEndpoint;\n readonly codegen: CodegenEndpoint;\n readonly liveblocks: LiveblocksEndpoint;\n\n constructor(config: SupernovaApiClientConfig) {\n const requestExecutor = new RequestExecutor({\n host: config.host,\n accessToken: config.accessToken,\n });\n\n this.users = new UsersEndpoint(requestExecutor);\n this.workspaces = new WorkspacesEndpoint(requestExecutor);\n this.designSystems = new DesignSystemsEndpoint(requestExecutor);\n this.codegen = new CodegenEndpoint(requestExecutor);\n this.liveblocks = new LiveblocksEndpoint(requestExecutor);\n }\n}\n","import { DataSourceRemoteType } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOEventFigmaNodesRendered = z.object({\n type: z.literal(\"DesignSystem.FigmaNodesRendered\"),\n designSystemId: z.string(),\n versionId: z.string(),\n figmaNodePersistentIds: z.string().array(),\n});\n\nexport const DTOEventDataSourcesImported = z.object({\n type: z.literal(\"DesignSystem.ImportJobFinished\"),\n designSystemId: z.string(),\n versionId: z.string(),\n importJobId: z.string(),\n dataSourceType: DataSourceRemoteType,\n dataSourceIds: z.string().array(),\n});\n\nexport type DTOEventFigmaNodesRendered = z.infer<typeof DTOEventFigmaNodesRendered>;\nexport type DTOEventDataSourcesImported = z.infer<typeof DTOEventDataSourcesImported>;\n","import { z } from \"zod\";\nimport { DTOEventDataSourcesImported, DTOEventFigmaNodesRendered } from \"./design-system\";\n\nexport const DTOEvent = z.discriminatedUnion(\"type\", [DTOEventDataSourcesImported, DTOEventFigmaNodesRendered]);\n\nexport type DTOEvent = z.infer<typeof DTOEvent>;\n","import { OmitStrict } from \"@supernova-studio/model\";\nimport PQueue from \"p-queue\";\nimport * as Y from \"yjs\";\nimport {\n DTODocumentationHierarchyV2,\n DTODocumentationSettings,\n DTOElementActionInput,\n DTOElementActionInputOfType,\n DTOPageBlockDefinition,\n} from \"../api\";\nimport { DocumentationPageEditorModel, generatePageContentHash, VersionRoomBaseYDoc } from \"../yjs\";\nimport { computeDocsHierarchy } from \"../yjs/version-room/compute-dto\";\nimport { VersionRoomBaseYDocState } from \"../yjs/version-room/types\";\nimport { applyActionsLocally } from \"./local-action-executor\";\nimport { SupportedActionType } from \"./types\";\n\ntype YObserver = () => void;\ntype HierarchyObserver = (hierarchy: DTODocumentationHierarchyV2) => void;\ntype SettingsObserver = (settings: DTODocumentationSettings) => void;\ntype ErrorObserver<T> = (error: unknown, actionMetadata: T | undefined) => void;\n\ntype TransactionExecutor = (trx: DTOElementActionInput) => Promise<void>;\ntype InternalTransactionExecutor<T> = (trx: InternalAction<T>) => Promise<void>;\ntype TransactionIdGenerator = () => string;\n\ntype Action = DTOElementActionInputOfType<SupportedActionType>;\ntype InputAction<T> = OmitStrict<Action, \"tId\">;\ntype InternalAction<T> = { action: Action; metadata?: T };\n\nexport class DocsStructureRepository<T> {\n private userId: string;\n private designSystemVersionId: string;\n\n private readonly yDoc: Y.Doc;\n private readonly yObserver: YObserver;\n private _yState: VersionRoomBaseYDocState | undefined;\n\n private _currentHierarchy: DTODocumentationHierarchyV2 | undefined;\n private _currentSettings: DTODocumentationSettings | undefined;\n\n private localActions: DTOElementActionInput[] = [];\n private readonly actionQueue: TransactionQueue<T>;\n private readonly hierarchyObservers = new Set<HierarchyObserver>();\n private readonly settingsObservers = new Set<SettingsObserver>();\n private readonly errorObservers = new Set<ErrorObserver<T>>();\n private readonly initCallbacks = new Set<() => void>();\n\n private readonly transactionIdGenerator: TransactionIdGenerator;\n private readonly transactionExecutor: TransactionExecutor;\n\n constructor(config: {\n userId: string;\n designSystemVersionId: string;\n yDoc: Y.Doc;\n transactionExecutor: TransactionExecutor;\n transactionIdGenerator: TransactionIdGenerator;\n }) {\n this.userId = config.userId;\n this.designSystemVersionId = config.designSystemVersionId;\n this.yDoc = config.yDoc;\n\n this.yObserver = this.yDoc.on(\"update\", () => this.onYUpdate()) as YObserver;\n this.onYUpdate();\n\n this.transactionExecutor = config.transactionExecutor;\n this.transactionIdGenerator = config.transactionIdGenerator;\n\n this.actionQueue = new TransactionQueue(action => this.executeInternalAction(action));\n }\n\n //\n // Lifecycle\n //\n\n get isInitialized(): boolean {\n return !!this._currentHierarchy;\n }\n\n onInitialized(): Promise<void> {\n if (this.isInitialized) return Promise.resolve();\n return new Promise(resolve => {\n this.initCallbacks.add(resolve);\n });\n }\n\n addHierarchyObserver(observer: HierarchyObserver) {\n this.hierarchyObservers.add(observer);\n if (this._currentHierarchy) observer(this._currentHierarchy);\n }\n\n removeHierarchyObserver(observer: HierarchyObserver) {\n this.hierarchyObservers.delete(observer);\n }\n\n addSettingsObserver(observer: SettingsObserver) {\n this.settingsObservers.add(observer);\n if (this._currentSettings) observer(this._currentSettings);\n }\n\n removeSettingsObserver(observer: SettingsObserver) {\n this.settingsObservers.delete(observer);\n }\n\n addErrorObserver(observer: ErrorObserver<T>) {\n this.errorObservers.add(observer);\n }\n\n removeErrorObserver(observer: ErrorObserver<T>) {\n this.errorObservers.delete(observer);\n }\n\n dispose() {\n this.yDoc.off(\"update\", this.yObserver);\n this.hierarchyObservers.clear();\n this.settingsObservers.clear();\n this.errorObservers.clear();\n this.actionQueue.clear();\n }\n\n //\n // Accessors\n //\n\n get currentHierarchy(): DTODocumentationHierarchyV2 {\n const hierarchy = this._currentHierarchy;\n if (!hierarchy) throw new Error(`Hierarchy cannot be accessed while it's still loading`);\n return hierarchy;\n }\n\n //\n // Actions\n //\n\n executeAction(action: InputAction<T>, metadata?: T) {\n void this.executeActionPromise(action, metadata);\n }\n\n executeActionPromise(action: InputAction<T>, metadata?: T) {\n const fullAction: DTOElementActionInput = { ...action, tId: this.transactionIdGenerator() };\n this.localActions.push(fullAction);\n this.refreshHierarchy();\n return this.actionQueue.enqueue({ action: fullAction, metadata });\n }\n\n notifyPageContentUpdated(\n pagePersistentId: string,\n content: DocumentationPageEditorModel,\n definitions: DTOPageBlockDefinition[]\n ) {\n const pageContentHash = generatePageContentHash(content, definitions);\n new VersionRoomBaseYDoc(this.yDoc).updateDocumentationPageContentHashes({\n [pagePersistentId]: pageContentHash,\n });\n }\n\n private async executeInternalAction(action: InternalAction<T>) {\n try {\n return await this.transactionExecutor(action.action);\n } catch (e: unknown) {\n // Remove this action from local actions and reload hierarchy\n this.localActions = this.localActions.filter(a => a.tId !== action.action.tId);\n this.refreshHierarchy();\n\n this.errorObservers.forEach(o => o(e, action.metadata));\n }\n }\n\n //\n // Reactions\n //\n\n private refreshState() {\n this.refreshHierarchy();\n this.refreshSettings();\n }\n\n private refreshSettings() {\n const yState = this._yState;\n if (!yState) return;\n\n // Calculate new settings\n const newSettings: DTODocumentationSettings = {\n isApprovalRequiredForPublishing: yState.settings.approvalRequiredForPublishing,\n isApprovalsFeatureEnabled: yState.settings.isApprovalFeatureEnabled,\n isDraftFeatureAdopted: yState.settings.isDraftFeatureAdopted,\n };\n\n // Only invoke when changed\n if (\n !this._currentSettings ||\n newSettings.isApprovalRequiredForPublishing !== this._currentSettings.isApprovalRequiredForPublishing ||\n newSettings.isApprovalsFeatureEnabled !== this._currentSettings.isApprovalsFeatureEnabled ||\n newSettings.isDraftFeatureAdopted !== this._currentSettings.isDraftFeatureAdopted\n ) {\n this._currentSettings = newSettings;\n\n // Invoke observers\n this.settingsObservers.forEach(o => o(newSettings));\n }\n }\n\n private refreshHierarchy() {\n const yState = this._yState;\n if (!yState) return;\n\n // Calculate new hierarchy\n const hierarchy = this.calculateHierarchy(yState);\n if (!hierarchy) return;\n this._currentHierarchy = hierarchy;\n\n // Invoke observers\n this.hierarchyObservers.forEach(o => o(hierarchy));\n }\n\n private calculateHierarchy(yState: VersionRoomBaseYDocState) {\n // Remove local actions that have been applied remotely\n const executedTransactionIds = new Set(yState.executedTransactionIds);\n const localActions = this.localActions.filter(a => a.tId && !executedTransactionIds.has(a.tId));\n this.localActions = localActions;\n\n // Apply local actions onto the Yjs state\n const { pages, groups, approvals, pageLiveblockRoomIds } = applyActionsLocally({\n userId: this.userId,\n designSystemVersionId: this.designSystemVersionId,\n remoteState: yState,\n actions: localActions,\n });\n\n const hierarchy = computeDocsHierarchy(\n {\n // Merged remote + local\n pages,\n groups,\n approvals,\n pageLiveblockRoomIds,\n\n // Remote only\n groupSnapshots: yState.groupSnapshots,\n pageContentHashes: yState.pageContentHashes,\n pageSnapshots: yState.pageSnapshots,\n settings: yState.settings,\n },\n { includeDeletedContent: true }\n );\n\n return hierarchy;\n }\n\n private onYUpdate() {\n const newState = new VersionRoomBaseYDoc(this.yDoc).getState();\n if (newState.groups.length) {\n this._yState = newState;\n this.refreshState();\n\n // Flush init callbacks\n this.initCallbacks.forEach(f => f());\n this.initCallbacks.clear();\n }\n }\n}\n\nclass TransactionQueue<T> {\n private readonly executor: InternalTransactionExecutor<T>;\n private readonly queue = new PQueue({\n concurrency: 1,\n });\n\n constructor(executor: InternalTransactionExecutor<T>) {\n this.executor = executor;\n }\n\n enqueue(trx: InternalAction<T>) {\n return this.queue.add(() => this.executor(trx));\n }\n\n onEmpty() {\n return this.queue.onEmpty();\n }\n\n clear() {\n this.queue.clear();\n }\n}\n","import * as Y from \"yjs\";\nimport { z } from \"zod\";\nimport { DTODocumentationHierarchyV2 } from \"../../api\";\nimport { FrontendVersionRoomYDoc } from \"../version-room/frontend\";\n\n// We store pages and groups in the same way they are stored in the database.\n// This means that instead of groups having childrenIds array, all items have\n// parentPersistentId property that points to the parent item in the tree.\n// Upon read this gets converted to the format that client expects, which is\n// ordered childrenIds array on all groups.\n//\n// The decision behind it is that we potentially want to get rid of childrenIds\n// array entirely because it makes group updates more complicated. For now\n// resolving it on fly is a tradeoff for not rewriting client to stop relying\n// on children ids array.\n\n//\n// Types\n//\n\nexport const DocumentationHierarchySettings = z.object({\n routingVersion: z.string(),\n isDraftFeatureAdopted: z.boolean(),\n isApprovalFeatureEnabled: z.boolean(),\n approvalRequiredForPublishing: z.boolean(),\n});\n\nexport type DocumentationHierarchySettings = z.infer<typeof DocumentationHierarchySettings>;\n\n/**\n * @deprecated - Use FrontendVersionRoomYDoc.getDocumentationHierarchy\n */\nexport function yjsToDocumentationHierarchy(doc: Y.Doc): DTODocumentationHierarchyV2 {\n return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();\n}\n","import {\n DocumentationPageApproval,\n DocumentationPageSnapshot,\n DocumentationPageV2,\n ElementGroup,\n ElementGroupSnapshot,\n} from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { ZodSchema, ZodTypeDef } from \"zod\";\nimport { DocumentationHierarchySettings } from \"../design-system-content\";\nimport { VersionRoomBaseYDocState } from \"./types\";\n\ntype YJSSerializable = { id: string };\n\nexport class VersionRoomBaseYDoc {\n private readonly yDoc: Y.Doc;\n\n constructor(yDoc: Y.Doc) {\n this.yDoc = yDoc;\n }\n\n getState(): VersionRoomBaseYDocState {\n // For backward compatibility we are using groups array to determine if Y doc content\n // was loaded: if the content was loaded there has to be at least one (root) group in\n // the doc. To be improved later if needed.\n\n const groups = this.getGroups();\n const isLoaded = !!groups.length;\n\n return {\n isLoaded,\n groups,\n pages: this.getPages(),\n approvals: this.getApprovals(),\n groupSnapshots: this.getGroupSnapshots(),\n pageContentHashes: this.getDocumentationPageContentHashes(),\n pageSnapshots: this.getPageSnapshots(),\n settings: this.getDocumentationInternalSettings(),\n pageLiveblockRoomIds: this.getDocumentationPageLiveblocksRoomIds(),\n executedTransactionIds: this.getExecutedTransactionIds(),\n };\n }\n\n //\n // Pages\n //\n\n getPages(): DocumentationPageV2[] {\n return this.getObjects(this.pagesYMap, DocumentationPageV2);\n }\n\n updatePages(pages: DocumentationPageV2[]) {\n pages = pages.map(page => {\n // We remove blocks from the payload here because it will not get parsed anyway\n return {\n ...page,\n data: {\n configuration: page.data.configuration,\n },\n };\n });\n\n this.setObjects(this.pagesYMap, pages);\n }\n\n deletePages(ids: string[]) {\n this.deleteObjects(this.pagesYMap, ids);\n }\n\n private get pagesYMap() {\n return this.yDoc.getMap<object>(\"documentationPages\");\n }\n\n //\n // Groups\n //\n\n getGroups(): ElementGroup[] {\n return this.getObjects(this.groupsYMap, ElementGroup);\n }\n\n updateGroups(groups: ElementGroup[]) {\n this.setObjects(this.groupsYMap, groups);\n }\n\n deleteGroups(ids: string[]) {\n this.deleteObjects(this.groupsYMap, ids);\n }\n\n private get groupsYMap() {\n return this.yDoc.getMap<object>(\"documentationGroups\");\n }\n\n //\n // Documentation internal settings\n //\n\n getDocumentationInternalSettings(): DocumentationHierarchySettings {\n const map = this.internalSettingsYMap;\n\n const rawSettings: Record<keyof DocumentationHierarchySettings, any> = {\n routingVersion: map.get(\"routingVersion\"),\n isDraftFeatureAdopted: map.get(\"isDraftFeatureAdopted\") ?? false,\n isApprovalFeatureEnabled: map.get(\"isApprovalFeatureEnabled\") ?? false,\n approvalRequiredForPublishing: map.get(\"approvalRequiredForPublishing\") ?? false,\n };\n\n const settingsParseResult = DocumentationHierarchySettings.safeParse(rawSettings);\n if (!settingsParseResult.success) {\n return {\n routingVersion: \"2\",\n isDraftFeatureAdopted: false,\n isApprovalFeatureEnabled: false,\n approvalRequiredForPublishing: false,\n };\n }\n\n return settingsParseResult.data;\n }\n\n updateDocumentationInternalSettings(settings: Partial<DocumentationHierarchySettings>) {\n const map = this.internalSettingsYMap;\n map.set(\"routingVersion\", settings.routingVersion ?? map.get(\"routingVersion\"));\n map.set(\"isDraftFeatureAdopted\", settings.isDraftFeatureAdopted ?? map.get(\"isDraftFeatureAdopted\"));\n map.set(\"isApprovalFeatureEnabled\", settings.isApprovalFeatureEnabled ?? map.get(\"isApprovalFeatureEnabled\"));\n map.set(\n \"approvalRequiredForPublishing\",\n settings.approvalRequiredForPublishing ?? map.get(\"approvalRequiredForPublishing\")\n );\n }\n\n private get internalSettingsYMap() {\n return this.yDoc.getMap<unknown>(\"documentationInternalSettings\");\n }\n\n //\n // Documentation page snapshot\n //\n\n getPageSnapshots(): DocumentationPageSnapshot[] {\n return this.getObjects(this.documentationPagePublishedStatesYMap, DocumentationPageSnapshot);\n }\n\n updatePageSnapshots(snapshots: DocumentationPageSnapshot[]) {\n this.setObjects(this.documentationPagePublishedStatesYMap, snapshots);\n }\n\n deletePageSnapshots(ids: string[]) {\n this.deleteObjects(this.documentationPagePublishedStatesYMap, ids);\n }\n\n private get documentationPagePublishedStatesYMap() {\n return this.yDoc.getMap<object>(\"documentationPageSnapshots\");\n }\n\n //\n // Documentation group snapshots\n //\n\n getGroupSnapshots(): ElementGroupSnapshot[] {\n return this.getObjects(this.documentationGroupPublishedStatesYMap, ElementGroupSnapshot);\n }\n\n updateGroupSnapshots(snapshots: ElementGroupSnapshot[]) {\n this.setObjects(this.documentationGroupPublishedStatesYMap, snapshots);\n }\n\n deleteGroupSnapshots(ids: string[]) {\n this.deleteObjects(this.documentationGroupPublishedStatesYMap, ids);\n }\n\n private get documentationGroupPublishedStatesYMap() {\n return this.yDoc.getMap<object>(\"documentationGroupSnapshots\");\n }\n\n //\n // Utils\n //\n\n private getObjects<T extends YJSSerializable, I>(map: Y.Map<object>, schema: ZodSchema<T, ZodTypeDef, I>): T[] {\n const results: T[] = [];\n map.forEach(object => results.push(schema.parse(object)));\n return results;\n }\n\n private setObjects<T extends YJSSerializable>(map: Y.Map<object>, objects: T[]) {\n objects.forEach(o => map.set(o.id, JSON.parse(JSON.stringify(o))));\n }\n\n private deleteObjects(map: Y.Map<object>, ids: string[]) {\n ids.forEach(id => map.delete(id));\n }\n\n //\n // Documentation page content hashes\n //\n\n getDocumentationPageContentHashes(): Record<string, string> {\n const map = this.documentationPageContentHashesYMap;\n\n const result: Record<string, string> = {};\n map.forEach((hash, key) => {\n if (typeof hash === \"string\") result[key] = hash;\n });\n\n return result;\n }\n\n getDocumentationPageLiveblocksRoomIds(): Record<string, string> {\n const map = this.documentationPageLiveblocksRoomIdsYMap;\n\n const result: Record<string, string> = {};\n map.forEach((hash, key) => {\n if (typeof hash === \"string\") result[key] = hash;\n });\n\n return result;\n }\n\n private get documentationPageLiveblocksRoomIdsYMap() {\n return this.yDoc.getMap<string>(\"documentationPageLiveblocksRoomIds\");\n }\n\n updateDocumentationPageContentHashes(hashes: Record<string, string>) {\n const map = this.documentationPageContentHashesYMap;\n Object.entries(hashes).forEach(([key, hash]) => map.set(key, hash));\n }\n\n private get documentationPageContentHashesYMap() {\n return this.yDoc.getMap<string>(\"documentationPageHashes\");\n }\n\n //\n // Approval states\n //\n\n updateApprovalStates(updates: DocumentationPageApproval[]) {\n this.setObjects(this.documentationPageApprovalsMap, updates);\n }\n\n removeApprovalStates(ids: string[]) {\n this.deleteObjects(this.documentationPageApprovalsMap, ids);\n }\n\n getApprovals() {\n return this.getObjects(this.documentationPageApprovalsMap, DocumentationPageApproval);\n }\n\n private get documentationPageApprovalsMap() {\n return this.yDoc.getMap<object>(\"documentationPageApprovals\");\n }\n\n //\n // Executed transactions\n //\n\n updateExecutedTransactionIds(transactionIds: string[]) {\n transactionIds = Array.from(new Set(transactionIds));\n if (!transactionIds.length) return;\n\n const array = this.executedTransactionIdsArray;\n\n // Append transactions at the end\n array.push(transactionIds);\n\n // Trim from the beginning in case it contains more than 100\n if (array.length > 100) {\n array.delete(0, array.length - 100);\n }\n }\n\n getExecutedTransactionIds(): string[] {\n const array = this.executedTransactionIdsArray;\n\n // Y.Array doesn't support filtering\n const transactionIds: string[] = [];\n array.forEach(e => typeof e === \"string\" && transactionIds.push(e));\n\n return transactionIds;\n }\n\n private get executedTransactionIdsArray() {\n return this.yDoc.getArray<unknown>(\"executedTransactionIds\");\n }\n}\n","import {\n DocumentationItemConfigurationV2,\n DocumentationPageSnapshot,\n ElementGroupSnapshot,\n defaultDocumentationItemConfigurationV2,\n mapByUnique,\n pickLatestGroupSnapshots,\n pickLatestPageSnapshots,\n recordToMap,\n} from \"@supernova-studio/model\";\nimport {\n DTODocumentationDraftState,\n DTODocumentationDraftStateUpdated,\n DTODocumentationGroupApprovalState,\n DTODocumentationHierarchyV2,\n documentationItemConfigurationToDTOV2,\n documentationPagesToDTOV2,\n elementGroupsToDocumentationGroupDTOV2,\n} from \"../../api\";\nimport { DTODocumentationPublishMetadata } from \"../../api/dto/elements/documentation/metadata\";\nimport { LocalApproval, LocalDocsPage, LocalDocsPageGroup } from \"../../sync/types\";\nimport { generateHash } from \"../../utils\";\nimport { DocumentationHierarchySettings } from \"../design-system-content\";\nimport { VersionRoomApproval, VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"./types\";\n\ntype ItemState = {\n title: string;\n configuration: DocumentationItemConfigurationV2;\n contentHash: string;\n};\n\ntype DocsPage = VersionRoomDocsPage | LocalDocsPage;\ntype DocsPageGroup = VersionRoomDocsPageGroup | LocalDocsPageGroup;\ntype Approval = VersionRoomApproval | LocalApproval;\n\ntype Input = {\n pages: DocsPage[];\n pageSnapshots: DocumentationPageSnapshot[];\n pageContentHashes: Record<string, string>;\n pageLiveblockRoomIds: Record<string, string>;\n\n groups: DocsPageGroup[];\n groupSnapshots: ElementGroupSnapshot[];\n\n approvals: Approval[];\n settings: DocumentationHierarchySettings;\n};\n\nexport function computeDocsHierarchy(\n input: Input,\n options: { includeDeletedContent?: boolean; debug?: boolean } = {}\n): DTODocumentationHierarchyV2 {\n const includeDeletedContent = options.includeDeletedContent ?? false;\n const debug = options.debug ?? false;\n\n // Read current room data\n const { pages, groups, pageSnapshots, groupSnapshots, settings, pageContentHashes, approvals, pageLiveblockRoomIds } =\n input;\n\n if (settings.isDraftFeatureAdopted && includeDeletedContent) {\n pages.push(...getDeletedPages(pages, pageSnapshots));\n groups.push(...getDeletedGroups(groups, groupSnapshots));\n }\n\n // Convert pages to DTOs\n const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion, recordToMap(pageLiveblockRoomIds));\n const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);\n\n // Calculate hasPublishedDocumentationContent\n const hasPublishedPages = pageSnapshots.some(s => s.reason === \"Publish\");\n const hasPublishedGroups = groupSnapshots.some(s => s.reason === \"Publish\");\n const hasPublishedDocumentationContent = hasPublishedPages || hasPublishedGroups;\n\n // If draft feature is not yet adopted, no snapshot-based features should not be provided\n if (!settings.isDraftFeatureAdopted) {\n return {\n hasPublishedDocumentationContent,\n pages: pageDTOs,\n groups: groupDTOs,\n };\n }\n\n const pageDraftStates = buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots, pageContentHashes, debug);\n const pageDraftDeletedStates = buildPageDraftDeletedStates(pages, pageSnapshots);\n const pagePublishedMetadata = buildPagePublishedMetadata(pages, pageSnapshots);\n const pageApprovalStates = mapByUnique(approvals, a => a.pagePersistentId);\n\n pageDTOs.forEach(p => {\n // Assign draft state\n const draftState = pageDraftDeletedStates.get(p.persistentId) ?? pageDraftStates.get(p.persistentId);\n draftState && (p.draftState = draftState);\n\n // Assign publish metadata\n const publishMetadata = pagePublishedMetadata.get(p.persistentId);\n publishMetadata && (p.publishMetadata = publishMetadata);\n\n // Assign approval state\n const approvalState = pageApprovalStates.get(p.persistentId);\n approvalState && (p.approvalState = approvalState);\n });\n\n const groupDraftStates = buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots, debug);\n const groupDraftDeletedStates = buildGroupDraftDeletedStates(groups, groupSnapshots);\n const groupPublishedMetadata = buildGroupPublishedMetadata(groups, groupSnapshots);\n const groupApprovalStates = buildGroupApprovalStates(groups, groupSnapshots);\n groupDTOs.forEach(g => {\n // Assign draft state\n const draftState = groupDraftDeletedStates.get(g.persistentId) ?? groupDraftStates.get(g.persistentId);\n draftState && (g.draftState = draftState);\n\n // Assign publish metadata\n const publishMetadata = groupPublishedMetadata.get(g.persistentId);\n publishMetadata && (g.publishMetadata = publishMetadata);\n\n const approvalState = groupApprovalStates.get(g.persistentId);\n approvalState && (g.approvalState = approvalState);\n });\n\n return {\n hasPublishedDocumentationContent,\n pages: pageDTOs,\n groups: groupDTOs,\n };\n}\n\nfunction getDeletedPages(pages: DocsPage[], pageSnapshots: DocumentationPageSnapshot[]): DocsPage[] {\n const existingPagePersistentIds = new Set(pages.map(p => p.persistentId));\n const latestSnapshots = pickLatestPageSnapshots(pageSnapshots);\n return latestSnapshots.filter(s => !existingPagePersistentIds.has(s.page.persistentId)).map(s => s.page);\n}\n\nfunction getDeletedGroups(groups: DocsPageGroup[], groupSnapshots: ElementGroupSnapshot[]): DocsPageGroup[] {\n const existingGroupPersistentIds = new Set(groups.map(p => p.persistentId));\n const latestSnapshots = pickLatestGroupSnapshots(groupSnapshots);\n return latestSnapshots.filter(s => !existingGroupPersistentIds.has(s.group.persistentId)).map(s => s.group);\n}\n\nfunction buildPageDraftCreatedAndUpdatedStates(\n pages: DocsPage[],\n pageSnapshots: DocumentationPageSnapshot[],\n pageHashes: Record<string, string>,\n debug: boolean\n): Map<string, DTODocumentationDraftState> {\n // Read room data\n const publishedSnapshots = pickLatestPageSnapshots(pageSnapshots.filter(s => s.reason === \"Publish\"));\n const publishedSnapshotsByPagePersistentId = mapByUnique(publishedSnapshots, s => s.page.persistentId);\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n pages.forEach(page => {\n // Published state\n const snapshot = publishedSnapshotsByPagePersistentId.get(page.persistentId);\n let publishedState: ItemState | undefined;\n if (snapshot) {\n publishedState = itemStateFromPage(snapshot.page, snapshot.pageContentHash);\n }\n\n // Current state - if content hash is undefined, it means that the page hasn't changed\n const currentPageContentHash = pageHashes[page.persistentId] ?? snapshot?.pageContentHash ?? \"\";\n const currentState: ItemState = itemStateFromPage(page, currentPageContentHash);\n\n // Calculate draft\n const draftState = createDraftState(page.persistentId, currentState, publishedState, debug);\n if (draftState) result.set(page.persistentId, draftState);\n });\n\n return result;\n}\n\nfunction itemStateFromPage(page: DocsPage, pageContentHash: string): ItemState {\n return {\n title: page.meta.name,\n configuration: page.data.configuration ?? defaultDocumentationItemConfigurationV2,\n contentHash: pageContentHash,\n };\n}\n\nfunction buildPagePublishedMetadata(\n pages: DocsPage[],\n pageSnapshots: DocumentationPageSnapshot[]\n): Map<string, DTODocumentationPublishMetadata> {\n const publishedPageSnapshotsByPersistentId = mapByUnique(\n pickLatestPageSnapshots(pageSnapshots.filter(s => s.reason === \"Publish\")),\n s => s.page.persistentId\n );\n\n const result = new Map<string, DTODocumentationPublishMetadata>();\n\n pages.forEach(p => {\n const publishedSnapshot = publishedPageSnapshotsByPersistentId.get(p.persistentId);\n if (!publishedSnapshot) return;\n\n result.set(p.persistentId, {\n lastPublishedAt: publishedSnapshot.createdAt,\n lastPublishedByUserId: publishedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n\nfunction createDraftState(\n itemPersistentId: string,\n currentState: ItemState,\n publishedState: ItemState | undefined,\n debug: boolean\n): DTODocumentationDraftState | undefined {\n if (!publishedState) {\n // New item (hasn't been published yet)\n return { changeType: \"Created\" };\n }\n\n // Compare current item state to the published state\n const updatedDraftState: DTODocumentationDraftStateUpdated = {\n changeType: \"Updated\",\n changes: {},\n };\n\n if (currentState.title !== publishedState.title) {\n if (debug) {\n console.log(`Item ${itemPersistentId} (${currentState.title}): updated title`);\n }\n\n updatedDraftState.changes.previousTitle = publishedState.title;\n }\n\n const currentConfigHash = generateHash(currentState.configuration, debug);\n const publishedConfigHash = generateHash(publishedState.configuration, debug);\n\n if (currentConfigHash !== publishedConfigHash) {\n if (debug) {\n console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);\n }\n\n const configurationDto = documentationItemConfigurationToDTOV2(publishedState.configuration);\n updatedDraftState.changes.previousConfiguration = configurationDto;\n }\n\n if (currentState.contentHash !== publishedState.contentHash) {\n if (debug) {\n console.log(`Item ${itemPersistentId} (${currentState.title}): updated content hash`);\n }\n\n updatedDraftState.changes.previousContentHash = publishedState.contentHash;\n }\n\n if (Object.keys(updatedDraftState.changes).length) {\n // Item has at least one of the draft changes\n return updatedDraftState;\n }\n\n // Item has no draft changes compared to the published item\n return undefined;\n}\n\nfunction buildGroupApprovalStates(groups: DocsPageGroup[], groupSnapshots: ElementGroupSnapshot[]) {\n const result = new Map<string, DTODocumentationGroupApprovalState>();\n const allGroups = [...groups, ...groupSnapshots];\n for (const g of allGroups) {\n const approvalState: DTODocumentationGroupApprovalState = {\n approvalState: \"Approved\",\n designSystemVersionId: g.designSystemVersionId,\n persistentId: g.persistentId,\n groupPersistentId: g.persistentId,\n };\n result.set(g.persistentId, approvalState);\n }\n return result;\n}\n\nfunction buildPageDraftDeletedStates(\n pages: DocsPage[],\n pageSnapshots: DocumentationPageSnapshot[]\n): Map<string, DTODocumentationDraftState> {\n const deletedSnapshotsByPagePersistentId = mapByUnique(\n pickLatestPageSnapshots(pageSnapshots.filter(s => s.reason === \"Deletion\")),\n s => s.page.persistentId\n );\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n pages.forEach(page => {\n const deletedSnapshot = deletedSnapshotsByPagePersistentId.get(page.persistentId);\n if (!deletedSnapshot) return;\n\n result.set(page.persistentId, {\n changeType: \"Deleted\",\n deletedAt: deletedSnapshot.createdAt,\n deletedByUserId: deletedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n\nfunction buildGroupDraftDeletedStates(\n groups: DocsPageGroup[],\n groupSnapshots: ElementGroupSnapshot[]\n): Map<string, DTODocumentationDraftState> {\n const deletedSnapshotsByGroupPersistentId = mapByUnique(\n pickLatestGroupSnapshots(groupSnapshots.filter(s => s.reason === \"Deletion\")),\n s => s.group.persistentId\n );\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n groups.forEach(group => {\n if (!group.parentPersistentId) return;\n\n const deletedSnapshot = deletedSnapshotsByGroupPersistentId.get(group.persistentId);\n if (!deletedSnapshot) return;\n\n result.set(group.persistentId, {\n changeType: \"Deleted\",\n deletedAt: deletedSnapshot.createdAt,\n deletedByUserId: deletedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n\nfunction buildGroupDraftCreatedAndUpdatedStates(\n groups: DocsPageGroup[],\n groupSnapshots: ElementGroupSnapshot[],\n debug: boolean\n): Map<string, DTODocumentationDraftState> {\n // Read room data\n const publishedSnapshots = pickLatestGroupSnapshots(groupSnapshots.filter(s => s.reason === \"Publish\"));\n const publishedSnapshotsByGroupPersistent = mapByUnique(publishedSnapshots, s => s.group.persistentId);\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n groups.forEach(group => {\n if (!group.parentPersistentId) return;\n\n // Current state\n const currentState: ItemState = itemStateFromGroup(group);\n\n // Published state\n const snapshot = publishedSnapshotsByGroupPersistent.get(group.persistentId);\n let publishedState: ItemState | undefined;\n if (snapshot) {\n publishedState = itemStateFromGroup(snapshot.group);\n }\n\n // Calculate draft\n const draftState = createDraftState(group.persistentId, currentState, publishedState, debug);\n if (draftState) result.set(group.persistentId, draftState);\n });\n\n return result;\n}\n\nfunction itemStateFromGroup(group: DocsPageGroup): ItemState {\n return {\n title: group.meta.name,\n configuration: group.data?.configuration ?? defaultDocumentationItemConfigurationV2,\n contentHash: \"-\",\n };\n}\n\nfunction buildGroupPublishedMetadata(\n groups: DocsPageGroup[],\n groupSnapshots: ElementGroupSnapshot[]\n): Map<string, DTODocumentationPublishMetadata> {\n const publishedGroupSnapshotsByPersistentId = mapByUnique(\n pickLatestGroupSnapshots(groupSnapshots.filter(s => s.reason === \"Publish\")),\n s => s.group.persistentId\n );\n\n const result = new Map<string, DTODocumentationPublishMetadata>();\n\n groups.forEach(g => {\n if (!g.parentPersistentId) return;\n\n const publishedSnapshot = publishedGroupSnapshotsByPersistentId.get(g.persistentId);\n if (!publishedSnapshot) return;\n\n result.set(g.persistentId, {\n lastPublishedAt: publishedSnapshot.createdAt,\n lastPublishedByUserId: publishedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n","import {\n PageBlockDefinition,\n PageBlockDefinitionsMap,\n PageBlockItemMultiRichTextValue,\n PageBlockItemRichTextValue,\n PageBlockItemTableValue,\n PageBlockText,\n mapPageBlockItemValuesV2,\n removeCommentSpans,\n} from \"@supernova-studio/model\";\nimport { generateHash } from \"../../utils\";\nimport { DocumentationPageEditorModel } from \"../docs-editor\";\n\nexport function generatePageContentHash(\n content: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[],\n debug = false\n) {\n let sanitizedContent = structuredClone(content);\n\n // Remove comment spans\n sanitizedContent = sanitizePageContents(sanitizedContent, definitions);\n\n // Make sure hashes of empty pages always match\n if (isPageContentEmpty(sanitizedContent)) {\n sanitizedContent = { blocks: [] };\n }\n\n return generateHash(sanitizedContent, debug);\n}\n\n/**\n * Empty page content can be one of the following:\n * - page without any blocks\n * - page with a single block, the block is a paragraph whithout any text\n */\nfunction isPageContentEmpty(content: DocumentationPageEditorModel): boolean {\n if (content.blocks.length > 1) return false;\n if (content.blocks.length < 1) return true;\n\n const singleBlock = content.blocks[0];\n if (singleBlock.type !== \"Block\" || singleBlock.data.packageId !== \"io.supernova.block.rich-text\") {\n return false;\n }\n\n const singleItem = singleBlock.data.items[0];\n\n // Block has no value, effectively the same as empty value\n if (!singleItem || !singleItem.props[\"text\"]) return true;\n\n const textValue = singleItem.props[\"text\"] as PageBlockItemRichTextValue;\n return !textValue.value.spans.length;\n}\n\nfunction sanitizePageContents(\n content: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[]\n): DocumentationPageEditorModel {\n const defMap = new PageBlockDefinitionsMap(definitions);\n\n mapPageBlockItemValuesV2(content.blocks, defMap, (block, item, prop, value) => {\n if (prop.type === \"RichText\") {\n const richTextValue = value as PageBlockItemRichTextValue;\n return {\n ...richTextValue,\n value: sanitizeRichText(richTextValue.value),\n };\n }\n\n if (prop.type === \"MultiRichText\") {\n const multiRichTextValue = value as PageBlockItemMultiRichTextValue;\n return {\n ...multiRichTextValue,\n value: multiRichTextValue.value.map(sanitizeRichText),\n };\n }\n\n if (prop.type === \"Table\") {\n const tableValue = value as PageBlockItemTableValue;\n tableValue.value.forEach(r => {\n r.cells.forEach(c => {\n c.nodes.forEach(n => {\n if (n.type === \"RichText\") {\n n.value = sanitizeRichText(n.value);\n }\n });\n });\n });\n\n return tableValue;\n }\n\n return value;\n });\n\n return content;\n}\n\nfunction sanitizeRichText(richText: PageBlockText): PageBlockText {\n return sortSpanAttributes(removeCommentSpans(richText));\n}\n\nfunction sortSpanAttributes(richText: PageBlockText) {\n richText.spans.forEach(s => {\n s.attributes.sort((lhs, rhs) => lhs.type.localeCompare(rhs.type));\n });\n\n return richText;\n}\n","import { PageBlockDefinition } from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { DTODocumentationHierarchyV2 } from \"../../api\";\nimport { DocumentationPageEditorModel } from \"../docs-editor\";\nimport { VersionRoomBaseYDoc } from \"./base\";\nimport { computeDocsHierarchy } from \"./compute-dto\";\nimport { generatePageContentHash } from \"./utils\";\n\nexport class FrontendVersionRoomYDoc {\n private readonly yDoc: Y.Doc;\n\n constructor(yDoc: Y.Doc, private readonly debug = false) {\n this.yDoc = yDoc;\n }\n\n //\n // Hierarchy\n //\n\n getDocumentationHierarchy(\n options: { includeDeletedContent?: boolean; debug?: boolean } = {}\n ): DTODocumentationHierarchyV2 {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n return computeDocsHierarchy(doc.getState(), options);\n }\n\n //\n // Update page content hash\n //\n\n notifyDocumentationPageContentUpdated(\n pageId: string,\n content: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[]\n ) {\n const pageContentHash = generatePageContentHash(content, definitions, this.debug);\n if (this.debug) {\n console.log(`Will set page content hash: '${pageId}' : '${pageContentHash}'`);\n }\n\n new VersionRoomBaseYDoc(this.yDoc).updateDocumentationPageContentHashes({\n [pageId]: pageContentHash,\n });\n }\n\n //\n // Misc\n //\n\n isDraftFeatureAdopted() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n const settings = doc.getDocumentationInternalSettings();\n return settings.isDraftFeatureAdopted;\n }\n\n hasPublishedDocumentationContent() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n\n return (\n doc.getPageSnapshots().filter(s => s.reason === \"Publish\").length > 0 ||\n doc.getGroupSnapshots().filter(s => s.reason === \"Publish\").length > 0\n );\n }\n\n isApprovalsFeatureEnabled() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n const settings = doc.getDocumentationInternalSettings();\n return settings.isApprovalFeatureEnabled;\n }\n\n isApprovalRequiredForPublishing() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n const settings = doc.getDocumentationInternalSettings();\n return settings.approvalRequiredForPublishing;\n }\n}\n","import { DocumentationItemHeaderV2 } from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV2 } from \"../../api/dto/elements/documentation/item-configuration-v2\";\n\n//\n// Types\n//\n\nexport const DTODocumentationPageRoomHeaderData = z.object({\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2,\n});\n\nexport const DTODocumentationPageRoomHeaderDataUpdate = z.object({\n title: z.string().optional(),\n configuration: DTODocumentationItemConfigurationV2.omit({ header: true })\n .extend({ header: DocumentationItemHeaderV2.partial() })\n .optional(),\n});\n\nexport type DTODocumentationPageRoomHeaderData = z.infer<typeof DTODocumentationPageRoomHeaderData>;\nexport type DTODocumentationPageRoomHeaderDataUpdate = z.infer<typeof DTODocumentationPageRoomHeaderDataUpdate>;\n\n//\n// YJS Bindings\n//\n\nexport function itemConfigurationToYjs(yDoc: Y.Doc, item: DTODocumentationPageRoomHeaderDataUpdate) {\n yDoc.transact(trx => {\n const { title, configuration } = item;\n\n const header = configuration?.header;\n\n if (title !== undefined) {\n const headerYMap = trx.doc.getMap(\"itemTitle\");\n headerYMap.set(\"title\", title);\n }\n\n if (header) {\n const headerYMap = trx.doc.getMap(\"itemHeader\");\n\n header.description !== undefined && headerYMap.set(\"description\", header.description);\n header.alignment !== undefined && headerYMap.set(\"alignment\", header.alignment);\n header.foregroundColor !== undefined && headerYMap.set(\"foregroundColor\", header.foregroundColor);\n header.backgroundColor !== undefined && headerYMap.set(\"backgroundColor\", header.backgroundColor);\n header.backgroundImageAsset !== undefined && headerYMap.set(\"backgroundImageAsset\", header.backgroundImageAsset);\n header.backgroundImageScaleType !== undefined &&\n headerYMap.set(\"backgroundImageScaleType\", header.backgroundImageScaleType);\n header.showBackgroundOverlay !== undefined &&\n headerYMap.set(\"showBackgroundOverlay\", header.showBackgroundOverlay);\n header.showCoverText !== undefined && headerYMap.set(\"showCoverText\", header.showCoverText);\n header.minHeight !== undefined && headerYMap.set(\"minHeight\", header.minHeight);\n }\n\n const configYMap = trx.doc.getMap(\"itemConfiguration\");\n\n configuration?.showSidebar !== undefined && configYMap.set(\"showSidebar\", configuration.showSidebar);\n configuration?.isHidden !== undefined && configYMap.set(\"isHidden\", configuration.isHidden);\n configuration?.isPrivate !== undefined && configYMap.set(\"isPrivate\", configuration.isPrivate);\n });\n}\n","import { PageBlockEditorModelV2, PageSectionEditorModelV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const PageBlockEditorModel = PageBlockEditorModelV2;\nexport type PageBlockEditorModel = z.infer<typeof PageBlockEditorModel>;\n\nexport const PageSectionEditorModel = PageSectionEditorModelV2;\nexport type PageSectionEditorModel = z.infer<typeof PageSectionEditorModel>;\n","import { DocumentationPageContentItem } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DocumentationPageEditorModel = z.object({\n blocks: z.array(DocumentationPageContentItem),\n});\n\nexport type DocumentationPageEditorModel = z.infer<typeof DocumentationPageEditorModel>;\n","import { Schema } from \"prosemirror-model\";\n\nconst pmSchemaJson = {\n topNode: \"doc\",\n nodes: {\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n parseDOM: [\n {\n tag: \"p\",\n },\n ],\n },\n listItem: {\n content: \"paragraph\",\n defining: true,\n parseDOM: [\n {\n tag: \"li\",\n },\n ],\n },\n doc: {\n content: \"block+\",\n },\n hardBreak: {\n group: \"inline\",\n inline: true,\n selectable: false,\n parseDOM: [\n {\n tag: \"br\",\n },\n ],\n },\n text: {\n group: \"inline\",\n },\n bulletList: {\n content: \"listItem+\",\n group: \"block list\",\n parseDOM: [\n {\n tag: \"ul\",\n },\n ],\n },\n orderedList: {\n content: \"listItem+\",\n group: \"block list\",\n attrs: {\n start: {\n default: 1,\n },\n type: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"ol\",\n },\n ],\n },\n },\n marks: {\n link: {\n inclusive: false,\n attrs: {\n href: {\n default: null,\n },\n target: {\n default: \"_blank\",\n },\n rel: {\n default: \"noopener noreferrer nofollow\",\n },\n class: {\n default: \"tiptap-link\",\n },\n },\n parseDOM: [\n {\n tag: \"a[href]\",\n },\n ],\n },\n bold: {\n parseDOM: [\n {\n tag: \"strong\",\n },\n {\n tag: \"b\",\n },\n {\n style: \"font-weight\",\n },\n ],\n },\n italic: {\n parseDOM: [\n {\n tag: \"em\",\n },\n {\n tag: \"i\",\n },\n {\n style: \"font-style=italic\",\n },\n ],\n },\n strike: {\n parseDOM: [\n {\n tag: \"s\",\n },\n {\n tag: \"del\",\n },\n {\n tag: \"strike\",\n },\n {\n style: \"text-decoration\",\n consuming: false,\n },\n ],\n },\n code: {\n excludes: \"bold code italic strike link\",\n code: true,\n parseDOM: [\n {\n tag: \"code\",\n },\n ],\n },\n },\n} as const;\n\nexport const innerEditorProsemirrorSchema = new Schema(pmSchemaJson);\n","import { Schema } from \"prosemirror-model\";\n\nconst pmSchemaJson = {\n topNode: \"doc\",\n nodes: {\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.rich-text\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"p\",\n },\n ],\n },\n reactComponent: {\n group: \"block\",\n atom: true,\n draggable: true,\n attrs: {\n count: {\n default: 0,\n },\n },\n parseDOM: [\n {\n tag: \"react-component\",\n },\n ],\n },\n tableRow: {\n tableRole: \"row\",\n content: \"(tableCell | tableHeader)*\",\n parseDOM: [\n {\n tag: \"tr\",\n },\n ],\n },\n table: {\n tableRole: \"table\",\n content: \"tableRow+\",\n group: \"defaultTable\",\n isolating: true,\n parseDOM: [\n {\n tag: \"table\",\n },\n ],\n },\n tableCell: {\n tableRole: \"cell\",\n content: \"(paragraph|image)+\",\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n textAlign: {\n default: \"left\",\n },\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"td\",\n },\n ],\n },\n tableHeader: {\n tableRole: \"header_cell\",\n content: \"(paragraph|image)+\",\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n textAlign: {\n default: \"left\",\n },\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"th\",\n },\n ],\n },\n tableContainer: {\n content: \"table\",\n group: \"block\",\n atom: true,\n draggable: false,\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.table\",\n },\n variantId: {\n default: \"default\",\n },\n hasBorder: {\n default: true,\n },\n },\n parseDOM: [\n {\n tag: \"tableContainer\",\n },\n ],\n },\n hardBreak: {\n group: \"inline\",\n inline: true,\n selectable: false,\n parseDOM: [\n {\n tag: \"br\",\n },\n ],\n },\n text: {\n group: \"inline\",\n },\n heading: {\n content: \"inline*\",\n group: \"block\",\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n level: {\n default: 1,\n },\n definitionId: {\n default: null,\n },\n variantId: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"h1\",\n attrs: {\n level: 1,\n definitionId: \"io.supernova.block.title1\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h2\",\n attrs: {\n level: 2,\n definitionId: \"io.supernova.block.title2\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h3\",\n attrs: {\n level: 3,\n definitionId: \"io.supernova.block.title3\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h4\",\n attrs: {\n level: 4,\n definitionId: \"io.supernova.block.title4\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h5\",\n attrs: {\n level: 5,\n definitionId: \"io.supernova.block.title5\",\n variantId: \"default\",\n },\n },\n ],\n },\n listItem: {\n content: \"paragraph list{0,1}\",\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"li\",\n },\n ],\n },\n orderedList: {\n content: \"listItem+\",\n group: \"block list\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.ordered-list\",\n },\n variantId: {\n default: \"default\",\n },\n start: {\n default: 1,\n },\n },\n parseDOM: [\n {\n tag: \"ol\",\n },\n ],\n },\n bulletList: {\n content: \"listItem+\",\n group: \"block list\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.unordered-list\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"ul\",\n },\n ],\n },\n horizontalRule: {\n group: \"block\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.divider\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"div.node-horizontalRule\",\n },\n {\n tag: \"hr\",\n },\n ],\n },\n blockquote: {\n content: \"inline*\",\n group: \"block\",\n draggable: true,\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.blockquote\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"blockquote\",\n },\n ],\n },\n plainSection: {\n content: \"sectionItem\",\n group: \"section\",\n atom: true,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"section\",\n attrs: {\n \"data-section-type\": \"plain\",\n },\n },\n ],\n },\n tabsSection: {\n content: \"sectionItem+\",\n group: \"section\",\n atom: true,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n variantId: {\n default: \"Tabs\",\n },\n },\n parseDOM: [\n {\n tag: \"div\",\n },\n ],\n },\n sectionItem: {\n content: \"sectionItemColumn{1, 3}\",\n group: \"sectionItem\",\n atom: true,\n selectable: false,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n title: {\n default: \"\",\n },\n },\n parseDOM: [\n {\n tag: \"section-item\",\n },\n ],\n },\n sectionItemColumn: {\n content: \"block+\",\n group: \"sectionItemColumn\",\n atom: true,\n selectable: false,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"section-item-column\",\n },\n ],\n },\n doc: {\n content: \"(block|section)+\",\n },\n callout: {\n content: \"inline*\",\n group: \"block\",\n draggable: true,\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.callout\",\n },\n variantId: {\n default: \"default\",\n },\n type: {\n default: \"neutral\",\n },\n },\n parseDOM: [\n {\n tag: \"callout\",\n },\n ],\n },\n image: {\n group: \"block customBlock\",\n atom: true,\n draggable: false,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: null,\n },\n variantId: {\n default: null,\n },\n appearance: {\n default: \"{}\",\n },\n columns: {\n default: 1,\n },\n items: {\n default: \"[]\",\n },\n },\n parseDOM: [\n {\n tag: \"block-node\",\n },\n ],\n },\n blockNode: {\n group: \"block customBlock\",\n atom: true,\n draggable: false,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: null,\n },\n variantId: {\n default: null,\n },\n appearance: {\n default: \"{}\",\n },\n columns: {\n default: 1,\n },\n items: {\n default: \"[]\",\n },\n },\n parseDOM: [\n {\n tag: \"block-node\",\n },\n ],\n },\n },\n marks: {\n link: {\n inclusive: false,\n attrs: {\n href: {\n default: null,\n },\n target: {\n default: \"_blank\",\n },\n rel: {\n default: \"noopener noreferrer nofollow\",\n },\n class: {\n default: \"tiptap-link\",\n },\n },\n parseDOM: [\n {\n tag: 'a[href]:not([href *= \"javascript:\" i])',\n },\n ],\n },\n commentHighlight: {\n attrs: {\n highlightId: {\n default: null,\n },\n resolved: {\n default: false,\n },\n },\n parseDOM: [\n {\n tag: \"commenthighlight\",\n },\n ],\n },\n bold: {\n parseDOM: [\n {\n tag: \"strong\",\n },\n {\n tag: \"b\",\n },\n {\n style: \"font-weight\",\n },\n ],\n },\n italic: {\n parseDOM: [\n {\n tag: \"em\",\n },\n {\n tag: \"i\",\n },\n {\n style: \"font-style=italic\",\n },\n ],\n },\n strike: {\n parseDOM: [\n {\n tag: \"s\",\n },\n {\n tag: \"del\",\n },\n {\n tag: \"strike\",\n },\n {\n style: \"text-decoration\",\n consuming: false,\n },\n ],\n },\n code: {\n excludes: \"bold code italic strike link\",\n code: true,\n parseDOM: [\n {\n tag: \"code\",\n },\n ],\n },\n },\n} as const;\n\nexport const mainEditorProsemirrorSchema = new Schema(pmSchemaJson);\n","import {\n PageBlockCalloutType,\n PageBlockDefinition,\n PageBlockDefinitionProperty,\n PageBlockDefinitionRichTextOptions,\n PageBlockItemImageValue,\n PageBlockItemRichTextEditorListNode,\n PageBlockItemRichTextEditorNode,\n PageBlockItemRichTextEditorParagraphNode,\n PageBlockItemRichTextEditorValue,\n PageBlockItemRichTextValue,\n PageBlockItemTableCell,\n PageBlockItemTableNode,\n PageBlockItemTableRow,\n PageBlockItemTableValue,\n PageBlockTableCellAlignment,\n PageBlockText,\n PageBlockTextSpan,\n PageBlockTextSpanAttribute,\n PageSectionColumnV2,\n PageSectionItemV2,\n SupernovaException,\n mapByUnique,\n} from \"@supernova-studio/model\";\nimport { prosemirrorJSONToYXmlFragment } from \"y-prosemirror\";\nimport * as Y from \"yjs\";\nimport { ListNode, ListTreeBuilder } from \"./list-tree-builder\";\nimport { DocumentationPageEditorModel } from \"./model\";\nimport { PageBlockEditorModel, PageSectionEditorModel } from \"./model/block\";\nimport { mainEditorProsemirrorSchema } from \"./prosemirror\";\nimport { ProsemirrorMark, ProsemirrorNode } from \"./prosemirror/types\";\nimport { BlockDefinitionUtils, BlockParsingUtils } from \"./utils\";\n\n//\n// Types\n//\n\ntype BaseInput = {\n block: PageBlockEditorModel;\n definition: PageBlockDefinition;\n};\n\ntype InputWithProperty = BaseInput & {\n property: PageBlockDefinitionProperty;\n};\n\ntype RichTextInputWithValue = InputWithProperty & {\n richTextPropertyValue: PageBlockItemRichTextValue;\n};\n\n//\n// Implementation\n//\n\nexport function pageToYDoc(doc: Y.Doc, page: DocumentationPageEditorModel, definitions: PageBlockDefinition[]) {\n pageToYXmlFragment(page, definitions, doc.getXmlFragment(\"default\"));\n}\n\nexport function pageToYXmlFragment(\n page: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[],\n fragment: Y.XmlFragment\n): Y.XmlFragment {\n const doc = pageToProsemirrorDoc(page, definitions);\n // console.log(JSON.stringify(doc, null, 2));\n return prosemirrorJSONToYXmlFragment(mainEditorProsemirrorSchema, doc, fragment);\n}\n\nexport function pageToProsemirrorDoc(\n page: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[]\n): ProsemirrorNode {\n const definitionsMap = mapByUnique(definitions, d => d.id);\n\n const children: ProsemirrorNode[] = [];\n let blockBuffer: PageBlockEditorModel[] = [];\n\n page.blocks.forEach(b => {\n if (b.type === \"Block\") {\n blockBuffer.push(b);\n } else if (b.type === \"Section\") {\n if (blockBuffer.length) {\n children.push(...internalBlocksToProsemirrorNodes(blockBuffer, definitionsMap));\n blockBuffer = [];\n }\n\n children.push(internalSectionToProsemirrorNode(b, definitionsMap));\n }\n });\n\n if (blockBuffer.length) {\n children.push(...internalBlocksToProsemirrorNodes(blockBuffer, definitionsMap));\n }\n\n return {\n type: \"doc\",\n content: children,\n };\n}\n\nexport function blockToProsemirrorNode(\n block: PageBlockEditorModel,\n definition: PageBlockDefinition\n): ProsemirrorNode | null {\n const definitionsMap = new Map<string, PageBlockDefinition>([[definition.id, definition]]);\n const nodes = internalBlocksToProsemirrorNodes([block], definitionsMap);\n return nodes[0] ?? null;\n}\n\nexport function richTextPropertyValueToProsemirror(\n richTextEditorValue: PageBlockItemRichTextEditorValue\n): ProsemirrorNode {\n return {\n type: \"doc\",\n content: richTextEditorValue.value.map(node => {\n return serializeRichTextEditorNode(node);\n }),\n };\n}\n\nfunction serializeRichTextEditorNode(node: PageBlockItemRichTextEditorNode): ProsemirrorNode {\n switch (node.type) {\n case \"Paragraph\":\n return serializeRichTextEditorParagraphNode(node);\n\n case \"List\":\n return serializeRichTextEditorListNode(node);\n }\n}\n\nfunction serializeRichTextEditorParagraphNode(node: PageBlockItemRichTextEditorParagraphNode): ProsemirrorNode {\n const content = serializeRichText(node.value);\n return {\n type: \"paragraph\",\n ...(content.length && { content }),\n };\n}\n\nfunction serializeRichTextEditorListNode(node: PageBlockItemRichTextEditorListNode): ProsemirrorNode {\n const type = node.listType === \"OL\" ? \"orderedList\" : \"bulletList\";\n const attrs = node.listType === \"OL\" ? { start: 1 } : undefined;\n const richTexts = node.value.length ? node.value : [{ spans: [] }];\n\n return {\n type,\n ...(attrs && { attrs }),\n content: richTexts.map(n => {\n const content = serializeRichText(n);\n\n return {\n type: \"listItem\",\n content: [\n {\n type: \"paragraph\",\n ...(content.length && { content }),\n },\n ],\n };\n }),\n };\n}\n\n//\n// Sections\n//\n\nfunction internalSectionToProsemirrorNode(\n section: PageSectionEditorModel,\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode {\n return {\n type: \"tabsSection\",\n attrs: {\n id: section.id,\n ...(section.variantId && { variantId: section.variantId }),\n },\n content: section.items.map(item => sectionItemToProsemirrorNode(item, definitionsMap)),\n };\n}\n\nfunction sectionItemToProsemirrorNode(\n sectionItem: PageSectionItemV2,\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode {\n return {\n type: \"sectionItem\",\n attrs: {\n id: sectionItem.id,\n title: sectionItem.title,\n },\n content: sectionItem.columns.map(column => sectionColumnToProsemirrorNode(column, definitionsMap)),\n };\n}\n\nfunction sectionColumnToProsemirrorNode(\n sectionColumn: PageSectionColumnV2,\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode {\n const blocks = internalBlocksToProsemirrorNodes(sectionColumn.blocks, definitionsMap);\n\n if (!blocks.length) {\n blocks.push({\n type: \"paragraph\",\n attrs: {\n id: \"id\",\n definitionId: \"io.supernova.block.rich-text\",\n },\n });\n }\n\n return {\n type: \"sectionItemColumn\",\n attrs: {\n id: sectionColumn.id,\n },\n content: blocks,\n };\n}\n\n//\n// Blocks\n//\n\nfunction internalBlocksToProsemirrorNodes(\n blocks: PageBlockEditorModel[],\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode[] {\n const result: ProsemirrorNode[] = [];\n\n const listTreeBuilder = new ListTreeBuilder();\n\n blocks.forEach(b => {\n const definition = definitionsMap.get(b.data.packageId);\n if (!definition) {\n console.warn(`Could not find definition for ${b.id} (${b.data.packageId})`);\n return;\n }\n\n const multiRichTextProp = BlockDefinitionUtils.firstMultiRichTextProperty(definition);\n\n if (multiRichTextProp) {\n // This is list\n const node = listTreeBuilder.addWithProperty(b, multiRichTextProp);\n if (node) {\n result.push(serializeAsMultiRichTextBlock(node));\n }\n } else {\n // This is not a list\n // Flush the tree builder to inject a non-tree block after it\n const tree = listTreeBuilder.flush();\n if (tree) {\n result.push(serializeAsMultiRichTextBlock(tree));\n }\n\n const node = internalBlockToProsemirrorNode(b, definition);\n node && result.push(node);\n }\n });\n\n const tree = listTreeBuilder.flush();\n if (tree) {\n result.push(serializeAsMultiRichTextBlock(tree));\n }\n\n return result;\n}\n\nfunction internalBlockToProsemirrorNode(\n block: PageBlockEditorModel,\n definition: PageBlockDefinition\n): ProsemirrorNode | null {\n // Single rich text\n const richTextProperty = BlockDefinitionUtils.firstRichTextProperty(definition);\n if (richTextProperty) {\n return serializeAsRichTextBlock({\n block: block,\n definition: definition,\n property: richTextProperty,\n });\n }\n\n const tableProperty = BlockDefinitionUtils.firstTableProperty(definition);\n if (tableProperty) {\n return serializeAsTable({\n block: block,\n definition: definition,\n property: tableProperty,\n });\n }\n\n // Divider\n if (block.data.packageId === \"io.supernova.block.divider\") {\n return serializeAsDivider({\n block: block,\n definition: definition,\n });\n }\n\n return serializeAsCustomBlock(block, definition);\n}\n\n//\n// Single rich text blocks\n//\n\nfunction serializeAsRichTextBlock(input: InputWithProperty): ProsemirrorNode {\n const { block, definition, property: richTextProperty } = input;\n\n const blockItem = BlockParsingUtils.singleBlockItem(block);\n const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);\n\n const enrichedInput: RichTextInputWithValue = { ...input, richTextPropertyValue: textPropertyValue };\n\n const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);\n const style = parsedOptions?.richTextStyle ?? \"Default\";\n\n switch (style) {\n case \"Callout\":\n return serializeAsCallout(enrichedInput);\n case \"Default\":\n return serializeAsParagraph(enrichedInput);\n\n case \"Quote\":\n return serializeAsBlockquote(enrichedInput);\n\n case \"Title1\":\n case \"Title2\":\n case \"Title3\":\n case \"Title4\":\n case \"Title5\":\n return serializeAsHeading(enrichedInput);\n }\n}\n\nfunction serializeAsParagraph(input: RichTextInputWithValue): ProsemirrorNode {\n return {\n type: \"paragraph\",\n attrs: serializeBlockNodeAttributes(input.block),\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\nfunction serializeAsHeading(input: RichTextInputWithValue): ProsemirrorNode {\n return {\n type: \"heading\",\n attrs: {\n ...serializeBlockNodeAttributes(input.block),\n level: richTextHeadingLevel(input.property),\n },\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\nfunction serializeAsBlockquote(input: RichTextInputWithValue): ProsemirrorNode {\n return {\n type: \"blockquote\",\n attrs: serializeBlockNodeAttributes(input.block),\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\nfunction serializeAsCallout(input: RichTextInputWithValue): ProsemirrorNode {\n const calloutType = input.richTextPropertyValue.calloutType ?? \"Info\";\n\n return {\n type: \"callout\",\n attrs: {\n ...serializeBlockNodeAttributes(input.block),\n type: serializeCalloutType(calloutType),\n },\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\n//\n// Multi rich text blocks\n//\n\nfunction serializeAsMultiRichTextBlock(node: ListNode): ProsemirrorNode {\n switch (node.listType) {\n case \"Ordered\":\n return serializeAsOrderedList(node);\n\n case \"Unordered\":\n return serializeAsUnorderedList(node);\n }\n}\n\nfunction serializeAsOrderedList(tree: ListNode): ProsemirrorNode {\n return {\n type: \"orderedList\",\n attrs: {\n ...serializeBlockNodeAttributes(tree.block),\n start: \"1\",\n },\n content: serializeListContent(tree),\n };\n}\n\nfunction serializeAsUnorderedList(tree: ListNode): ProsemirrorNode {\n return {\n type: \"bulletList\",\n attrs: {\n ...serializeBlockNodeAttributes(tree.block),\n },\n content: serializeListContent(tree),\n };\n}\n\nfunction serializeListContent(tree: ListNode): ProsemirrorNode[] {\n const result: ProsemirrorNode[] = tree.leadingChildren.map(i => serializeAsTextListItem(i.text));\n\n for (const child of tree.children) {\n if (child.type === \"ListItem\") {\n // Text list item\n\n result.push(serializeAsTextListItem(child.text));\n } else if (child.type === \"List\") {\n // List list item\n\n const previousNode = result[result.length - 1];\n if (!previousNode) {\n throw SupernovaException.shouldNotHappen(\"List node without previous node\");\n }\n if (!previousNode.content) {\n throw SupernovaException.shouldNotHappen(\"List item node has no content\");\n }\n\n const serializedList = serializeAsMultiRichTextBlock(child);\n previousNode.content.push(serializedList);\n } else {\n // Should noit happen\n\n throw SupernovaException.shouldNotHappen(`Unknown list node type: ${child}`);\n }\n }\n\n return result;\n}\n\nfunction serializeAsTextListItem(text: PageBlockText): ProsemirrorNode {\n return {\n type: \"listItem\",\n content: [\n {\n type: \"paragraph\",\n attrs: {\n definitionId: \"io.supernova.block.rich-text\",\n variantId: \"default\",\n },\n content: serializeRichText(text),\n },\n ],\n };\n}\n\n//\n// Tables\n//\n\nfunction serializeAsTable(input: InputWithProperty): ProsemirrorNode {\n const { block, definition, property: tableProperty } = input;\n\n const blockItem = BlockParsingUtils.singleBlockItem(block);\n const table = BlockParsingUtils.tablePropertyValue(blockItem, tableProperty.id);\n\n return {\n type: \"tableContainer\",\n attrs: {\n ...serializeBlockNodeAttributes(input.block),\n hasBorder: table.showBorder ?? true,\n },\n\n content: [\n {\n type: \"table\",\n content: serializeTableRows(table),\n },\n ],\n };\n}\n\nfunction serializeTableRows(table: PageBlockItemTableValue): ProsemirrorNode[] {\n // If no rows are present, we have to generate a least one empty row\n const rows: PageBlockItemTableRow[] = table.value.length ? table.value : [{ cells: [] }];\n\n return rows.map<ProsemirrorNode>((row, rowIndex) => {\n const isHeaderRow = rowIndex === 0 && table.highlightHeaderRow === true;\n\n // If no cells are present, we have to generate at least one cell\n const cells: PageBlockItemTableCell[] = row.cells.length ? row.cells : [{ id: \"\", alignment: \"Left\", nodes: [] }];\n\n return {\n type: \"tableRow\",\n content: cells.map<ProsemirrorNode>((cell, cellIndex) => {\n const isHeaderColumn = cellIndex === 0 && table.highlightHeaderColumn === true;\n\n return {\n type: isHeaderRow || isHeaderColumn ? \"tableHeader\" : \"tableCell\",\n attrs: {\n ...(cell.id && { id: cell.id }),\n textAlign: serializeTableCellAlignment(cell.alignment),\n colspan: 1,\n rowspan: 1,\n ...(cell.columnWidth && { colwidth: [cell.columnWidth] }),\n },\n content: serializeTableCellNodes(cell),\n };\n }),\n };\n });\n}\n\nfunction serializeTableCellAlignment(alignment: PageBlockTableCellAlignment) {\n switch (alignment) {\n case \"Left\":\n return \"left\";\n case \"Center\":\n return \"center\";\n case \"Right\":\n return \"right\";\n\n default:\n return \"left\";\n }\n}\n\nfunction serializeTableCellNodes(cell: PageBlockItemTableCell): ProsemirrorNode[] {\n const result = cell.nodes.map(serializeTableNode);\n\n if (result.length) {\n return result;\n } else {\n return [{ type: \"paragraph\" }];\n }\n}\n\nfunction serializeTableNode(node: PageBlockItemTableNode): ProsemirrorNode {\n switch (node.type) {\n case \"RichText\":\n return {\n type: \"paragraph\",\n attrs: {\n id: node.id,\n definitionId: \"io.supernova.block.rich-text\",\n },\n ...serializeRichTextNodePart(node.value),\n };\n\n case \"Image\":\n return {\n type: \"image\",\n attrs: {\n id: node.id,\n definitionId: \"io.supernova.block.image\",\n items: JSON.stringify([\n {\n id: node.id,\n props: {\n image: {\n ...(node.alt && { alt: node.alt }),\n ...(node.caption && { caption: node.caption }),\n ...(node.alignment && { alignment: node.alignment }),\n value: node.value,\n } satisfies PageBlockItemImageValue,\n },\n },\n ]),\n },\n };\n }\n}\n\n//\n// Divider\n//\n\nfunction serializeAsDivider(input: BaseInput): ProsemirrorNode {\n return {\n type: \"horizontalRule\",\n attrs: serializeBlockNodeAttributes(input.block),\n };\n}\n\n//\n// Attributes\n//\n\nfunction serializeBlockNodeAttributes(block: PageBlockEditorModel) {\n return {\n id: block.id,\n definitionId: block.data.packageId,\n ...(block.data.variantId && { variantId: block.data.variantId }),\n };\n}\n\nfunction richTextHeadingLevel(property: PageBlockDefinitionProperty): number | undefined {\n const style = property.options?.richTextStyle;\n if (!style) return undefined;\n\n switch (style) {\n case \"Title1\":\n return 1;\n case \"Title2\":\n return 2;\n case \"Title3\":\n return 3;\n case \"Title4\":\n return 4;\n case \"Title5\":\n return 5;\n case \"Callout\":\n case \"Default\":\n case \"Quote\":\n return undefined;\n }\n}\n\nfunction serializeCalloutType(calloutType: PageBlockCalloutType) {\n switch (calloutType) {\n case \"Error\":\n return \"critical\";\n case \"Info\":\n return \"neutral\";\n case \"Success\":\n return \"positive\";\n case \"Warning\":\n return \"warning\";\n case \"Primary\":\n return \"primary\";\n }\n}\n\n//\n// Rich text\n//\n\nfunction serializeRichTextNodePart(richText: PageBlockText): Pick<ProsemirrorNode, \"content\"> {\n const spans = serializeRichText(richText);\n if (spans.length) return { content: spans };\n return {};\n}\n\nfunction serializeRichText(richText: PageBlockText) {\n return richText.spans.map(serializeTextSpan).flat();\n}\n\nfunction serializeTextSpan(span: PageBlockTextSpan): ProsemirrorNode[] {\n const hardBreakType = \"hardBreak\";\n\n const marks = span.attributes.map(serializeTextSpanAttribute);\n\n const textParts = span.text.split(\"\\n\");\n const interspersed: ProsemirrorNode[] = [\n {\n type: \"text\",\n text: textParts[0],\n\n ...(marks.length && { marks: marks }),\n },\n ];\n\n for (let i = 1; i < textParts.length; i++) {\n interspersed.push(\n {\n type: hardBreakType,\n },\n {\n type: \"text\",\n text: textParts[i],\n\n ...(marks.length && { marks: marks }),\n }\n );\n }\n\n return interspersed.filter(t => t.type === hardBreakType || !!t.text);\n}\n\nfunction serializeTextSpanAttribute(spanAttribute: PageBlockTextSpanAttribute): ProsemirrorMark {\n switch (spanAttribute.type) {\n case \"Bold\":\n return { type: \"bold\", attrs: {} };\n case \"Italic\":\n return { type: \"italic\", attrs: {} };\n case \"Strikethrough\":\n return { type: \"strike\", attrs: {} };\n case \"Code\":\n return { type: \"code\", attrs: {} };\n case \"Comment\":\n return {\n type: \"commentHighlight\",\n attrs: {\n highlightId: spanAttribute.commentHighlightId,\n resolved: spanAttribute.commentIsResolved,\n },\n };\n case \"Link\":\n if (spanAttribute.link) {\n return serializeLinkMark(\n spanAttribute.link,\n spanAttribute.openInNewTab ?? spanAttribute.openInNewWindow ?? false\n );\n } else if (spanAttribute.documentationItemId) {\n return serializeLinkMark(\n `@page:${spanAttribute.documentationItemId}`,\n spanAttribute.openInNewTab ?? spanAttribute.openInNewWindow ?? false\n );\n } else {\n return serializeLinkMark(\"about:blank\", spanAttribute.openInNewTab ?? spanAttribute.openInNewWindow ?? false);\n }\n }\n}\n\nfunction serializeLinkMark(href: string, openInNewTab: boolean): ProsemirrorMark {\n return {\n type: \"link\",\n attrs: {\n href: href,\n target: openInNewTab ? \"_blank\" : \"_self\",\n rel: \"noopener noreferrer nofollow\",\n class: \"tiptap-link\",\n },\n };\n}\n\nexport function serializeAsCustomBlock(block: PageBlockEditorModel, definition: PageBlockDefinition): ProsemirrorNode {\n const items = block.data.items.map(i => {\n return {\n id: i.id,\n props: i.props,\n linksTo: i.linksTo,\n };\n });\n\n const columns = block.data.appearance?.numberOfColumns;\n\n return {\n type: serializeCustomBlockNodeType(block, definition),\n attrs: {\n id: block.id,\n definitionId: block.data.packageId,\n ...(block.data.variantId && { variantId: block.data.variantId }),\n items: JSON.stringify(items),\n\n ...(block.data.appearance && { appearance: JSON.stringify(block.data.appearance) }),\n ...(columns && { columns: columns }),\n },\n };\n}\n\nfunction serializeCustomBlockNodeType(block: PageBlockEditorModel, definition: PageBlockDefinition): string {\n switch (block.data.packageId) {\n case \"io.supernova.block.image\":\n return \"image\";\n\n default:\n return \"blockNode\";\n }\n}\n\nfunction nonNullFilter<T>(item: T | null): item is T {\n return !!item;\n}\n","import { PageBlockEditorModel } from \"./model/block\";\nimport {\n PageBlockDefinition,\n PageBlockDefinitionPropertyType,\n PageBlockItemEmbedValue,\n PageBlockItemMultiRichTextValue,\n PageBlockItemRichTextValue,\n PageBlockItemTableValue,\n PageBlockItemUntypedValue,\n PageBlockItemV2,\n PageBlockText,\n} from \"@supernova-studio/model\";\n\nexport const BlockParsingUtils = {\n singleBlockItem(block: PageBlockEditorModel) {\n if (!block.data.items.length) throw new Error(`Block ${block.id} has no items`);\n if (block.data.items.length > 1) throw new Error(`Block ${block.id} has more than 1 item`);\n\n return block.data.items[0]!;\n },\n\n richTextPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemRichTextValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const richText = PageBlockItemRichTextValue.parse(objectValue);\n\n return richText;\n },\n\n multiRichTextPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemMultiRichTextValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const richText = PageBlockItemMultiRichTextValue.parse(objectValue);\n\n return richText;\n },\n\n tablePropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemTableValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const table = PageBlockItemTableValue.parse(objectValue);\n\n return table;\n },\n\n embedPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemEmbedValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const embed = PageBlockItemEmbedValue.parse(objectValue);\n\n return embed;\n },\n\n objectPropertyValue(item: PageBlockItemV2, propertyKey: string) {\n const value = this.propertyValueOrThrow(item, propertyKey);\n\n if (typeof value !== \"object\") {\n throw new Error(`Value for property ${propertyKey} is expected to be an object, but instead is ${typeof value}`);\n }\n\n return value;\n },\n\n propertyValueOrThrow(item: PageBlockItemV2, propertyKey: string): PageBlockItemUntypedValue {\n const value = item.props[propertyKey];\n if (!value) throw new Error(`Property ${propertyKey} is not defined on block item`);\n\n return value;\n },\n};\n\nexport const BlockDefinitionUtils = {\n firstRichTextProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"RichText\");\n if (property) return property;\n return undefined;\n },\n\n firstMultiRichTextProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"MultiRichText\");\n if (property) return property;\n return undefined;\n },\n\n firstTableProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"Table\");\n if (property) return property;\n return undefined;\n },\n\n firstEmbedProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"EmbedURL\");\n if (property) return property;\n return undefined;\n },\n\n richTextProperty(definition: PageBlockDefinition, propertyKey: string) {\n return this.property(definition, propertyKey, \"RichText\");\n },\n\n property(\n definition: PageBlockDefinition,\n propertyKey: string,\n expectedPropertyType?: PageBlockDefinitionPropertyType\n ) {\n const property = definition.item.properties.find(p => p.id === propertyKey);\n if (!property) {\n throw new Error(`Definition ${definition.id} doesn't contain property ${propertyKey}`);\n }\n\n if (expectedPropertyType && property.type !== expectedPropertyType) {\n throw new Error(\n `Property ${propertyKey} of definition ${definition.id} expected to be ${expectedPropertyType} but was ${property.type}`\n );\n }\n\n return property;\n },\n};\n","import {\n PageBlockDefinitionMultiRichTextPropertyStyle,\n PageBlockDefinitionMutiRichTextOptions,\n PageBlockDefinitionProperty,\n PageBlockText,\n} from \"@supernova-studio/model\";\nimport { PageBlockEditorModel } from \"./model\";\nimport { BlockParsingUtils } from \"./utils\";\n\ntype Node = ListNode | ListItemNode;\n\nexport type ListNode = {\n type: \"List\";\n listType: \"Ordered\" | \"Unordered\";\n block: PageBlockEditorModel;\n leadingChildren: ListItemNode[];\n children: Node[];\n};\n\nexport type ListItemNode = {\n type: \"ListItem\";\n text: PageBlockText;\n};\n\nexport class ListTreeBuilder {\n private rootNode: ListNode | undefined;\n\n addWithProperty(\n block: PageBlockEditorModel,\n multiRichTextProperty: PageBlockDefinitionProperty\n ): ListNode | undefined {\n const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);\n return this.add(block, multiRichTextProperty.id, parsedOptions?.multiRichTextStyle || \"OL\");\n }\n\n add(\n block: PageBlockEditorModel,\n multiRichTextPropertyId: string,\n multiRichTextPropertyStyle: PageBlockDefinitionMultiRichTextPropertyStyle\n ) {\n const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);\n\n // No root\n if (!this.rootNode) {\n this.rootNode = list;\n return undefined;\n }\n\n // Inserting at the root\n if (block.data.indentLevel <= 0) {\n const flushed = this.flush();\n this.rootNode = list;\n return flushed;\n }\n\n // Inserting at a depth\n const listParent = this.getParentOfDepth(block.data.indentLevel);\n\n const lastChild = listParent.children[listParent.children.length - 1];\n if (lastChild?.type === \"List\") {\n // Merge items into the current list\n lastChild.children.push(...list.leadingChildren);\n return;\n } else {\n // We can add this list as a child of another list\n listParent.children.push(list);\n }\n }\n\n flush(): ListNode | undefined {\n const node = this.rootNode;\n this.rootNode = undefined;\n return node;\n }\n\n private getParentOfDepth(depth: number): ListNode {\n if (!this.rootNode || depth <= 0) throw new Error(\"Invalid state\");\n\n let currentNode = this.rootNode;\n let currentDepth = depth - 1;\n\n while (currentDepth > 0) {\n // Check if we can go any lower\n if (currentNode.children.length === 0) return currentNode;\n\n const lastChild = currentNode.children[currentNode.children.length - 1];\n if (lastChild.type !== \"List\") {\n // Cannot go lower if last child is not a list\n return currentNode;\n }\n\n currentNode = lastChild;\n currentDepth--;\n }\n\n return currentNode;\n }\n\n private createList(\n block: PageBlockEditorModel,\n multiRichTextPropertyId: string,\n multiRichTextPropertyStyle: PageBlockDefinitionMultiRichTextPropertyStyle\n ): ListNode {\n // private createList(block: PageBlockEditorModel, multiRichTextProperty: PageBlockDefinitionProperty): ListNode {\n const blockItem = BlockParsingUtils.singleBlockItem(block);\n const multiRichTextValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextPropertyId);\n\n const leadingChildren: ListNode[\"leadingChildren\"] = multiRichTextValue.value.map(t => {\n return {\n type: \"ListItem\",\n text: t,\n };\n });\n\n if (!leadingChildren.length) {\n leadingChildren.push({ type: \"ListItem\", text: { spans: [] } });\n }\n\n return {\n type: \"List\",\n listType: multiRichTextPropertyStyle === \"OL\" ? \"Ordered\" : \"Unordered\",\n leadingChildren: leadingChildren,\n block: block,\n children: [],\n };\n }\n}\n","import { PageBlockDefinition } from \"@supernova-studio/model\";\n\nexport function getMockPageBlockDefinitions(): PageBlockDefinition[] {\n return blocks.map(block => {\n return {\n ...block,\n item: {\n ...block.item,\n\n // Make sure variatns array is copied\n variants: [...block.item.variants],\n },\n };\n });\n}\n\nconst blocks: PageBlockDefinition[] = [\n {\n id: \"io.supernova.block.rich-text\",\n name: \"Text\",\n description: \"Plain text\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/text.svg\",\n searchKeywords: [\"paragraph\", \"rich text\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n richTextStyle: \"Default\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {\n isEditorPresentationDifferent: false,\n },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use rich text block to write text and add additional formatting to it.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/text-HxZ9ssJR\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title1\",\n name: \"Heading 1\",\n description: \"Main sections within the page\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-1.svg\",\n searchKeywords: [\"title\", \"h1\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 1\",\n richTextStyle: \"Title1\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for main sections within the page, introducing broad topics or themes.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title2\",\n name: \"Heading 2\",\n description: \"Section subheadings\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-2.svg\",\n searchKeywords: [\"title\", \"h2\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 2\",\n richTextStyle: \"Title2\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for subheadings, indicating major subsections under the main sections.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title3\",\n name: \"Heading 3\",\n description: \"Further subsections\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-3.svg\",\n searchKeywords: [\"title\", \"h3\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 3\",\n richTextStyle: \"Title3\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for further subsections, detailing specific topics within the major subsections.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title4\",\n name: \"Heading 4\",\n description: \"Details in subsections\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-4.svg\",\n searchKeywords: [\"title\", \"h4\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 4\",\n richTextStyle: \"Title4\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: 1, allowLinks: false },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for sub-divisions, elaborating on details within the subsections.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title5\",\n name: \"Heading 5\",\n description: \"Nuanced details or sub-points\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-5.svg\",\n searchKeywords: [\"title\", \"h5\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 5\",\n richTextStyle: \"Title5\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: 1, allowLinks: false },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for nuanced details or specific sub-points within sub-divisions.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.ordered-list\",\n name: \"Numbered list\",\n description: \"An ordered list with numbers\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/list-ordered.svg\",\n searchKeywords: [\"ol\", \"ordered\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"MultiRichText\",\n options: { multiRichTextStyle: \"OL\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Display a sequence of numbers or letters to indicate order.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/list-UC5iPZLK\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.unordered-list\",\n name: \"Bulleted list\",\n description: \"A list with bullet points\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/list-unordered.svg\",\n searchKeywords: [\"ul\", \"bullet points\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"MultiRichText\",\n options: { multiRichTextStyle: \"UL\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"A list of items displayed with bullet points without a specific sequence.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/list-UC5iPZLK\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.do-dont-guidelines\",\n name: \"Guidelines\",\n description: \"Document your Do's and Don'ts.\",\n category: \"Guidelines\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/guidelines.svg\",\n searchKeywords: [\"do\", \"dont\", \"caution\", \"rules\"],\n item: {\n properties: [\n {\n id: \"block.do-dont-guidelines.property.image\",\n name: \"Image\",\n type: \"Image\",\n options: { allowCaption: true },\n },\n {\n id: \"block.do-dont-guidelines.property.type\",\n name: \"Type\",\n type: \"SingleSelect\",\n options: {\n defaultChoice: \"do\",\n choices: [\n { value: \"do\", name: \"Do\", color: \"Green\", icon: \"CheckCircle\" },\n { value: \"dont\", name: \"Don't\", color: \"Red\", icon: \"CrossCircle\" },\n { value: \"caution\", name: \"Caution\", color: \"Orange\", icon: \"Alert\" },\n ],\n singleSelectStyle: \"ToggleButton\",\n },\n },\n {\n id: \"block.do-dont-guidelines.property.description\",\n name: \"Description\",\n type: \"RichTextEditor\",\n options: {\n allowedInlineStyles: [\"Bold\", \"Italic\", \"Strikethrough\", \"UL\", \"OL\", \"Link\", \"InlineCode\"],\n placeholder: \"Add description\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"simple\",\n name: \"Simple\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-simple.svg\",\n description: \"With a minimalist badge at the top, this design is great for content guidelines.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 2,\n appearance: {},\n },\n {\n id: \"prominent\",\n name: \"Prominent\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-prominent.svg\",\n description: \"Recommended when you need guidelines that need to stand out.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n {\n id: \"contained\",\n name: \"Contained\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-contained.svg\",\n description: \"Perfect for component guidelines with spacious images.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n {\n id: \"side-border\",\n name: \"Side border\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-side-border.svg\",\n description: \"The side border makes this variant well-suited for longer text guidelines.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"simple\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: -1, allowLinks: false, newItemLabel: \"Add guideline\" },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use link block to document your Do/Don't guidelines for your components and patterns.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/links/shortcuts/general-jVfNifo4\",\n },\n newItemLabel: \"Add guideline\",\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.divider\",\n name: \"Divider\",\n description: \"A section divider\",\n category: \"Layout\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/divider.svg\",\n searchKeywords: [\"hr\", \"line\", \"rule\", \"separator\"],\n item: {\n properties: [{ id: \"divider\", name: \"Divider\", type: \"Divider\", options: {} }],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"divider\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"A thematic break or horizontal rule, often used to separate content or define a change in topic.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/divider-tLuxooLH\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.blockquote\",\n name: \"Quote\",\n description: \"Display a quotation\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/blockquote.svg\",\n searchKeywords: [\"cite\", \"blockquote\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: { placeholder: \"Write a quote...\", richTextStyle: \"Quote\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"text\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use a blockquote to set off a quotation or cited content from the main text.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/blockquote-zYWAsb6X\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.callout\",\n name: \"Callout\",\n description: \"Highlight a section of text\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/callout.svg\",\n searchKeywords: [\"banner\", \"alert\", \"note\", \"tip\", \"warning\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: { placeholder: \"Highlight some information...\", richTextStyle: \"Callout\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"text\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use to highlight a section of text.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/callout-ZPlZObD1\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.image\",\n name: \"Image\",\n description: \"Display an image or Figma image\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/image.svg\",\n searchKeywords: [\"image\", \"figma\", \"frame\", \"picture\", \"photo\"],\n item: {\n properties: [\n {\n id: \"image\",\n name: \"Image\",\n type: \"Image\",\n options: { allowCaption: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"image\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use to display an image or Figma image.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/image-Ue8VdT8B\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.shortcut-links\",\n name: \"Shortcut links\",\n description: \"Link to a page or external URL\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/shortcuts.svg\",\n searchKeywords: [\"url\", \"page\", \"card\"],\n item: {\n properties: [\n {\n id: \"block.links.property.image\",\n name: \"Image\",\n type: \"Image\",\n options: { aspectRatio: \"Landscape\", allowCaption: false },\n variantOptions: {\n iconOnTop: { width: \"Icon\", aspectRatio: \"Square\" },\n imageOnLeft: { width: \"Medium\" },\n iconOnLeft: { width: \"Icon\", aspectRatio: \"Square\" },\n },\n },\n {\n id: \"block.links.property.title\",\n name: \"Title\",\n type: \"Text\",\n options: { textStyle: \"Title5\", placeholder: \"Add title\", allowLineBreaks: false },\n },\n {\n id: \"block.links.property.description\",\n name: \"Short description\",\n type: \"Text\",\n options: { textStyle: \"Default\", color: \"NeutralFaded\", placeholder: \"Add description\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"imageOnTop\",\n name: \"Image on top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-image-on-top.svg\",\n layout: {\n type: \"Column\",\n children: [\"block.links.property.image\", \"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 3,\n appearance: {},\n },\n {\n id: \"imageOnLeft\",\n name: \"Image on left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-leading-image.svg\",\n layout: {\n type: \"Row\",\n children: [\n {\n type: \"Column\",\n children: [\"block.links.property.image\"],\n columnAlign: \"Start\",\n columnResizing: \"Hug\",\n gap: \"Medium\",\n },\n {\n type: \"Column\",\n children: [\"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Small\",\n },\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"iconOnTop\",\n name: \"Icon on top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-icon-on-top.svg\",\n layout: {\n type: \"Column\",\n children: [\"block.links.property.image\", \"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"iconOnLeft\",\n name: \"Icon on left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-leading-icon.svg\",\n layout: {\n type: \"Row\",\n children: [\n {\n type: \"Column\",\n children: [\"block.links.property.image\"],\n columnAlign: \"Start\",\n columnResizing: \"Hug\",\n gap: \"Medium\",\n },\n {\n type: \"Column\",\n children: [\"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Small\",\n },\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 2,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"imageOnTop\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: -1, allowLinks: true, newItemLabel: \"Add shortcut\" },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use link block to create single or multiple links to places in or out of your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/links/shortcuts/general-jVfNifo4\",\n },\n newItemLabel: \"Add shortcut\",\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.embed-figma\",\n name: \"Figma embed\",\n description: \"Embed a Figma canvas or prototype\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/embed-figma.svg\",\n searchKeywords: [\"embed\", \"figma\", \"design\", \"prototype\", \"canvas\"],\n item: {\n properties: [\n {\n id: \"embed\",\n name: \"Figma URL\",\n type: \"EmbedURL\",\n options: {\n allowCaption: false,\n allowResize: true,\n defaultHeight: 400,\n urlValidationRegex: \"^(https?://)?(www.)?(figma.com)/.+$\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"embed\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a Figma canvas or prototype to your documentation.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/figma/embed-figma-GPNJsT8A\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.storybook\",\n name: \"Storybook\",\n description: \"Embed Storybook canvas\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/storybook.svg\",\n searchKeywords: [\"storybook\", \"story\", \"stories\", \"example\", \"preview\", \"code\", \"react\"],\n item: {\n properties: [\n {\n id: \"embed\",\n name: \"Storybook URL\",\n type: \"Storybook\",\n options: {\n allowCaption: true,\n allowResize: true,\n defaultHeight: 400,\n renderLayoutAs: \"Iframe\",\n },\n variantOptions: {\n playground: {\n renderLayoutAs: \"Playground\",\n defaultHeight: 400,\n allowResize: true,\n },\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"playground\",\n name: \"Playground\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/storybook-playground.svg\",\n description: \"Embed a Storybook story with a preview of the component and controls to adjust the props.\",\n layout: {\n type: \"Column\",\n children: [\"embed\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"default\",\n name: \"HTML iframe\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/storybook-iframe.svg\",\n description: \"Embed a Storybook story in an iframe.\",\n layout: {\n type: \"Column\",\n children: [\"embed\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"playground\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a Storybook story to your documentation.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/code/storybook-1EGPhwBl\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.embed-youtube\",\n name: \"YouTube\",\n description: \"Embed a Youtube video\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/embed-youtube.svg\",\n searchKeywords: [\"embed\", \"video\", \"player\", \"upload\"],\n item: {\n properties: [\n {\n id: \"embed\",\n name: \"Youtube URL\",\n type: \"EmbedURL\",\n options: {\n allowCaption: false,\n allowResize: false,\n defaultHeight: 400,\n urlValidationRegex: \"^(https?://)?(www.)?(youtube.com|youtu.?be)/.+$\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"embed\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a YouTube video to your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/youtube-Gh8VUrSF\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.embed-lottie\",\n name: \"Lottie animation\",\n description: \"Preview a Lottie animation\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/lottie.svg\",\n searchKeywords: [\"embed\", \"lottie\", \"animation\", \"rive\", \"json\"],\n item: {\n properties: [\n {\n id: \"url\",\n name: \"Lottie URL\",\n type: \"URL\",\n description: \"Add URL to your Lottie animation file. We support .json and .lottie file extensions.\",\n options: { urlValidationRegex: \"^(http|https)://.*.(json|lottie)$\" },\n },\n {\n id: \"height\",\n name: \"Height\",\n type: \"Number\",\n options: { defaultValue: 270 },\n },\n {\n id: \"width\",\n name: \"Width\",\n type: \"Number\",\n options: { defaultValue: 400 },\n },\n {\n id: \"autoplay\",\n name: \"Autoplay\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n {\n id: \"loop\",\n name: \"Loop\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n {\n id: \"playerControls\",\n name: \"Show player controls\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/lottie-player.svg\",\n description: \"Embed a Lottie animation to your documentation.\",\n layout: {\n type: \"Column\",\n children: [\"url\", \"height\", \"width\", \"autoplay\", \"loop\", \"playerControls\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a Lottie animation to your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/lottie-preview-7CqFdGv9\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: true,\n showBlockHeaderInEditor: true,\n },\n },\n {\n id: \"io.supernova.block.embed\",\n name: \"Embed\",\n description: \"Embed a generic URL\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/embed.svg\",\n searchKeywords: [\"embed\", \"url\", \"iframe\", \"site\", \"import\"],\n item: {\n properties: [\n {\n id: \"embedUrl\",\n name: \"Embed URL\",\n type: \"EmbedURL\",\n options: {\n allowCaption: true,\n allowResize: true,\n defaultHeight: 400,\n urlValidationRegex: \"^(https?://)?(www.)?.+$\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"embedUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed any page to your documentation as an iframe.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/embed/public-url-2ZeRQ332\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.markdown\",\n name: \"Markdown\",\n description: \"Render Markdown URL\",\n category: \"Other\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/markdown.svg\",\n searchKeywords: [\"md\", \"embed\", \"api\", \"props\", \"mdx\"],\n item: {\n properties: [\n {\n id: \"markdownUrl\",\n name: \"Markdown URL\",\n type: \"Markdown\",\n options: { urlValidationRegex: \"^(https?://)?(www\\\\.)?.+\\\\.md(\\\\?.*)?$\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"plain\",\n name: \"Plain\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/markdown-plain.svg\",\n layout: {\n type: \"Column\",\n children: [\"markdownUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"bordered\",\n name: \"Bordered\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/markdown-bordered.svg\",\n layout: {\n type: \"Column\",\n children: [\"markdownUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"boxed\",\n name: \"Boxed\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/markdown-boxed.svg\",\n layout: {\n type: \"Column\",\n children: [\"markdownUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"plain\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Render any markdown file directly inside of your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/code/markdown/general-B8wQVOem\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: true,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.table\",\n name: \"Table\",\n description: \"Display a simple table\",\n category: \"Layout\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/table.svg\",\n searchKeywords: [\"grid\", \"data\", \"spreadsheet\", \"api\"],\n item: {\n properties: [{ id: \"table\", name: \"Table\", type: \"Table\", options: {} }],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"table\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use for displaying data in a tabular format.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/layout/table-R8KGnxej\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.design-tokens\",\n name: \"Design tokens\",\n description: \"A list of design tokens\",\n category: \"Tokens\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/design-tokens.svg\",\n searchKeywords: [\n \"tokens\",\n \"color\",\n \"typography\",\n \"spacing\",\n \"grid\",\n \"material\",\n \"theme\",\n \"token list\",\n \"token group\",\n ],\n item: {\n properties: [\n {\n id: \"tokens\",\n name: \"Tokens\",\n type: \"Token\",\n options: { renderLayoutAs: \"List\", defaultTheme: \"none\", defaultValuePreview: \"Split\" },\n variantOptions: { grid: { renderLayoutAs: \"Grid\" } },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"table\",\n name: \"Table\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/tokens-table.svg\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"grid\",\n name: \"Grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/tokens-grid.svg\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"table\",\n },\n behavior: { dataType: \"Token\", entities: { selectionType: \"EntityAndGroup\", maxSelected: 0 } },\n editorOptions: {\n onboarding: {\n helpText: \"Show a group of design tokens. Automatically display all subgroups too.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/token/tokens/general-84NRgxGl#section-token-group-09\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.token-color-ramps\",\n name: \"Color ramps\",\n description: \"The best way to display colors\",\n category: \"Tokens\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/color-ramp.svg\",\n searchKeywords: [\"tokens\", \"ramp\", \"shades\", \"palette\", \"spectrum\", \"stack\", \"range\", \"swatch\"],\n item: {\n properties: [\n {\n id: \"tokens\",\n name: \"Tokens\",\n type: \"Token\",\n options: { allowedTypes: [\"Color\"], allowPropertySelection: false, allowThemeSelection: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/tokens-color-stack.svg\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 2,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Token\", entities: { selectionType: \"EntityAndGroup\", maxSelected: 0 } },\n editorOptions: {\n onboarding: { helpText: \"The best way to display colors\", documentationLink: \"https://learn.supernova.io\" },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.color-accessibility-grid\",\n name: \"Accessibility color grid\",\n description: \"Visualize accessibility of your color tokens\",\n category: \"Tokens\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/token-accessibility-grid.svg\",\n searchKeywords: [\"tokens\", \"color\", \"accessibility\", \"grid\", \"contrast\"],\n item: {\n properties: [\n {\n id: \"tokens\",\n name: \"Tokens\",\n type: \"Token\",\n options: { allowedTypes: [\"Color\"], allowPropertySelection: false, allowThemeSelection: false },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/contrast-grid-large.svg\",\n description:\n \"Visualize accessibility of your colors by automatically calculating their color contrast ratio.\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Token\", entities: { selectionType: \"EntityAndGroup\", maxSelected: 0 } },\n editorOptions: {\n onboarding: {\n helpText: \"Visualize accessibility of your colors by automatically calculating their color contrast ratio.\",\n documentationLink: \"https://learn.supernova.io\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.code\",\n name: \"Code\",\n description: \"Display simple code examples\",\n category: \"Code\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/code.svg\",\n searchKeywords: [\"code\"],\n item: {\n properties: [\n {\n id: \"code\",\n name: \"Code\",\n type: \"Code\",\n options: {},\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"code\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display simple code examples\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.code-react\",\n name: \"React code\",\n description: \"Render a code snippet\",\n category: \"Code\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/code-react.svg\",\n searchKeywords: [\"code\", \"react\", \"snippet\", \"storybook\", \"editor\", \"example\", \"sandbox\"],\n item: {\n properties: [\n {\n id: \"code\",\n name: \"Code\",\n type: \"CodeSandbox\",\n options: { renderLayoutAs: \"PreviewOnTop\" },\n variantOptions: {\n codeTop: { renderLayoutAs: \"PreviewOnBottom\" },\n codeLeft: { renderLayoutAs: \"PreviewOnRight\" },\n codeRight: { renderLayoutAs: \"PreviewOnLeft\" },\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"codeBottom\",\n name: \"Full width, code bottom\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-bottom.svg\",\n description: \"Full-width block of code, with a preview on top.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"codeTop\",\n name: \"Full width, code top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-top.svg\",\n description: \"Full-width block of code, with a preview on bottom.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"codeLeft\",\n name: \"Side by side, code left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-left.svg\",\n description: \"Side-by-side preview and code, with code on the left.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"codeRight\",\n name: \"Side by side, code right\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-right.svg\",\n description: \"Side-by-side preview and code, with code on the right.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"codeBottom\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Display rendered code example\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/code/render-react-code-vxufnkFm\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.assets\",\n name: \"Vector assets\",\n description: \"Display icons or illustrations\",\n category: \"Assets\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/assets.svg\",\n searchKeywords: [\"icons\", \"illustrations\", \"grid\", \"svg\", \"logos\", \"vectors\"],\n item: {\n properties: [\n {\n id: \"assets\",\n name: \"Assets\",\n type: \"Asset\",\n options: {},\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Simple grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/assets-simple-grid.svg\",\n description: \"A simple grid. Both the title and description are displayed below the preview.\",\n layout: {\n type: \"Column\",\n children: [\"assets\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 4,\n appearance: {},\n },\n {\n id: \"square-grid\",\n name: \"Square grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/assets-square-grid.svg\",\n description: \"Bordered square grid tailored for displaying icon assets.\",\n layout: {\n type: \"Column\",\n children: [\"assets\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 4,\n appearance: {\n isEditorPresentationDifferent: true,\n },\n },\n {\n id: \"borderless-grid\",\n name: \"Borderless grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/assets-borderless-grid.svg\",\n description: \"Borderless grid, perfect for displaying vector assets of the same height.\",\n layout: {\n type: \"Column\",\n children: [\"assets\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 4,\n appearance: {\n isEditorPresentationDifferent: true,\n },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Asset\",\n entities: {\n selectionType: \"EntityAndGroup\",\n maxSelected: 0,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display a grid of icons or illustrations.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/asset/general-xa6EgXb2\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.figma-frames\",\n name: \"Figma images\",\n description: \"Generate images from Figma layers\",\n category: \"Figma\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/figma-frames.svg\",\n searchKeywords: [\"figma\", \"frames\", \"image\", \"layer\"],\n item: {\n properties: [\n {\n id: \"figmaNodes\",\n name: \"Figma Frames\",\n type: \"FigmaNode\",\n options: {},\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"bordered\",\n name: \"Bordered\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-nodes-boxed.svg\",\n description: \"Tiles with background and border, great for larger sets of frames.\",\n layout: {\n type: \"Column\",\n children: [\"figmaNodes\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"plain\",\n name: \"Plain\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-nodes-plain.svg\",\n description: \"Frame as it is in Figma with no extra formatting, great for single images.\",\n layout: {\n type: \"Column\",\n children: [\"figmaNodes\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"bordered\",\n },\n behavior: { dataType: \"FigmaNode\", entities: { selectionType: \"Entity\", maxSelected: 0 } },\n editorOptions: {\n onboarding: {\n helpText: \"Generate images from Figma layers\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/figma/figma-frames/general-f3IYC5dg\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.release-notes\",\n name: \"Release notes\",\n description: \"Show version release notes\",\n category: \"Other\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/release-notes.svg\",\n searchKeywords: [\"version\", \"changelog\", \"history\"],\n item: {\n properties: [],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/release-notes-2.svg\",\n description: \"Show formatted release notes from all previously released versions.\",\n layout: { type: \"Column\", children: [], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Show formatted release notes from all previously released versions.\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: true,\n showBlockHeaderInEditor: true,\n },\n },\n {\n id: \"io.supernova.block.component-checklist\",\n name: \"Component checklist\",\n description: \"Highlight specific component properties\",\n category: \"Components\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/component-checklist.svg\",\n searchKeywords: [\"components\", \"health\", \"properties\", \"overview\", \"status\"],\n item: {\n properties: [\n {\n id: \"components\",\n name: \"Components\",\n type: \"Component\",\n options: { renderLayoutAs: \"List\" },\n },\n {\n id: \"title\",\n name: \"Title\",\n type: \"Text\",\n options: { defaultValue: \"Component checklist\" },\n },\n {\n id: \"showDescription\",\n name: \"Show description\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/component-checklist.svg\",\n layout: {\n type: \"Column\",\n children: [\"components\", \"showDescription\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Component\", entities: { selectionType: \"Entity\", maxSelected: 1 } },\n editorOptions: {\n onboarding: {\n helpText: \"Highlight specific component properties\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-checklist-NXepPIpZ\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.component-checklist-all\",\n name: \"Component overview table\",\n description: \"Show an overview of all components\",\n category: \"Components\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/component-overview-table.svg\",\n searchKeywords: [\"components\", \"health\", \"overview\", \"status\"],\n item: {\n properties: [\n {\n id: \"components\",\n name: \"Components\",\n type: \"Component\",\n options: { renderLayoutAs: \"Table\" },\n },\n {\n id: \"showLastUpdatedColumn\",\n name: \"Show last updated column\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/component-overview-table.svg\",\n layout: {\n type: \"Column\",\n children: [\"components\", \"showLastUpdatedColumn\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Component\", entities: { selectionType: \"Group\", maxSelected: 1 } },\n editorOptions: {\n onboarding: {\n helpText: \"Show an overview of all your components\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-overview-table-W8eOtJ5t\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.component-health\",\n name: \"Component health\",\n description: \"Show component health and other attributes\",\n category: \"Components\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/component-health.svg\",\n searchKeywords: [\"components\", \"health\", \"properties\", \"overview\", \"status\"],\n item: {\n properties: [\n {\n id: \"components\",\n name: \"Components\",\n type: \"Component\",\n options: { renderLayoutAs: \"List\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/component-health.svg\",\n layout: {\n type: \"Column\",\n children: [\"components\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Component\", entities: { selectionType: \"Entity\", maxSelected: 1 } },\n editorOptions: {\n onboarding: {\n helpText: \"Show component health and additional attributes\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-health-sezSxEED\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.figma-components\",\n name: \"Figma component\",\n description: \"Display components and variants from Figma\",\n category: \"Figma\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/figma-component.svg\",\n searchKeywords: [\"variants\", \"properties\"],\n item: {\n properties: [\n {\n id: \"figmaComponent\",\n name: \"Figma component\",\n type: \"FigmaComponent\",\n options: {\n renderLayoutAs: \"Grid\",\n },\n variantOptions: {\n canvas: {\n renderLayoutAs: \"Canvas\",\n },\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"grid\",\n name: \"Grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-component-grid.svg\",\n description: \"Components or variants will be rendered individually in a grid layout\",\n layout: {\n type: \"Column\",\n children: [\"figmaComponent\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"canvas\",\n name: \"Canvas\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-component-canvas.svg\",\n description: \"Components or variants will be rendered on a single canvas\",\n layout: {\n type: \"Column\",\n children: [\"figmaComponent\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"grid\",\n },\n behavior: {\n dataType: \"FigmaComponent\",\n entities: {\n selectionType: \"Entity\",\n maxSelected: 0,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display Figma component variants or group of components.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/token/tokens/general-84NRgxGl#section-token-group-09\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.figma-components-propstable\",\n name: \"Figma component properties\",\n description: \"Display list of Figma component properties\",\n category: \"Figma\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/figma-component-properties.svg\",\n searchKeywords: [\"variants\", \"properties\", \"props\", \"table\"],\n item: {\n properties: [\n {\n id: \"figmaComponent\",\n name: \"Figma component\",\n type: \"FigmaComponent\",\n options: {\n renderLayoutAs: \"PropsTable\",\n invertPropertySelection: true,\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"figmaComponent\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"FigmaComponent\",\n entities: {\n selectionType: \"Entity\",\n maxSelected: 1,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display properties based on Figma component data.\",\n documentationLink: \"\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.files\",\n name: \"File upload\",\n description: \"Display attachments for download\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/files.svg\",\n searchKeywords: [\"files\", \"attachments\", \"download\", \"upload\"],\n item: {\n properties: [\n {\n id: \"files\",\n name: \"Files\",\n type: \"File\",\n options: {\n renderLayoutAs: \"iconOnLeft\",\n },\n variantOptions: {\n iconOnTop: {\n renderLayoutAs: \"iconOnTop\",\n },\n iconOnLeft: {\n renderLayoutAs: \"iconOnLeft\",\n },\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"iconOnTop\",\n name: \"Icon on top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/files-icon-on-top.svg\",\n layout: {\n type: \"Column\",\n children: [\"files\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"iconOnLeft\",\n name: \"Icon on left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/files-leading-icon.svg\",\n layout: {\n type: \"Column\",\n children: [\"files\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 2,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"iconOnTop\",\n },\n behavior: {\n dataType: \"File\",\n entities: {\n selectionType: \"Entity\",\n maxSelected: 0,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display attachments for download\",\n documentationLink: \"https://learn.supernova.io/file-upload-block\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n];\n","import {\n PageBlockAppearanceV2,\n PageBlockCalloutType,\n PageBlockColorV2,\n PageBlockDefinition,\n PageBlockDefinitionProperty,\n PageBlockDefinitionPropertyType,\n PageBlockItemAssetPropertyValue,\n PageBlockItemAssetValue,\n PageBlockItemBooleanValue,\n PageBlockItemCodeValue,\n PageBlockItemColorValue,\n PageBlockItemComponentPropertyValue,\n PageBlockItemComponentValue,\n PageBlockItemDividerValue,\n PageBlockItemEmbedValue,\n PageBlockItemFigmaComponentValue,\n PageBlockItemFigmaNodeValue,\n PageBlockItemFileValue,\n PageBlockItemImageValue,\n PageBlockItemMarkdownValue,\n PageBlockItemMultiRichTextValue,\n PageBlockItemMultiSelectValue,\n PageBlockItemNumberValue,\n PageBlockItemRichTextEditorListNode,\n PageBlockItemRichTextEditorNode,\n PageBlockItemRichTextEditorParagraphNode,\n PageBlockItemRichTextEditorValue,\n PageBlockItemRichTextValue,\n PageBlockItemSandboxValue,\n PageBlockItemSingleSelectValue,\n PageBlockItemStorybookValue,\n PageBlockItemStorybookValueOld,\n PageBlockItemTableCell,\n PageBlockItemTableNode,\n PageBlockItemTableValue,\n PageBlockItemTextValue,\n PageBlockItemTokenPropertyValue,\n PageBlockItemTokenTypeValue,\n PageBlockItemTokenValue,\n PageBlockItemUntypedValue,\n PageBlockItemUrlValue,\n PageBlockItemV2,\n PageBlockTableCellAlignment,\n PageBlockText,\n PageBlockTextSpan,\n PageBlockTextSpanAttribute,\n PageSectionColumnV2,\n PageSectionItemV2,\n nullishToOptional,\n storybookValueFromOldValue,\n} from \"@supernova-studio/model\";\nimport { yXmlFragmentToProsemirrorJSON } from \"y-prosemirror\";\nimport * as Y from \"yjs\";\nimport { ZodSchema, ZodTypeDef, z } from \"zod\";\nimport { PageBlockEditorModel, PageSectionEditorModel } from \"./model/block\";\nimport { DocumentationPageEditorModel } from \"./model/page\";\nimport { ProsemirrorMark, ProsemirrorNode } from \"./prosemirror/types\";\nimport { BlockDefinitionUtils } from \"./utils\";\n\nexport function yDocToPage(yDoc: Y.Doc, definitions: PageBlockDefinition[]): DocumentationPageEditorModel {\n return yXmlFragmentToPage(yDoc.getXmlFragment(\"default\"), definitions);\n}\n\nexport function yXmlFragmentToPage(\n fragment: Y.XmlFragment,\n definitions: PageBlockDefinition[]\n): DocumentationPageEditorModel {\n const prosemirrorJson = yXmlFragmentToProsemirrorJSON(fragment) as ProsemirrorNode;\n return prosemirrorDocToPage(prosemirrorJson, definitions);\n}\n\nexport function prosemirrorDocToPage(\n prosemirrorDoc: ProsemirrorNode,\n definitions: PageBlockDefinition[]\n): DocumentationPageEditorModel {\n const definitionsById = mapByUnique(definitions, d => d.id);\n\n return {\n blocks: internalProsemirrorNodesToPageItems(prosemirrorDoc.content ?? [], definitionsById),\n };\n}\n\nexport function shallowProsemirrorNodeToBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n return (\n prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, new Map([[definition.id, definition]]), 0)[0] ??\n null\n );\n}\n\nexport function prosemirrorDocToRichTextPropertyValue(\n prosemirrorNode: ProsemirrorNode\n): PageBlockItemRichTextEditorValue {\n return {\n value: (prosemirrorNode.content ?? [])\n .map(n => prosemirrorNodeToRichTextEditorPropertyNode(n))\n .filter(nonNullFilter),\n };\n}\n\nfunction prosemirrorNodeToRichTextEditorPropertyNode(\n prosemirrorNode: ProsemirrorNode\n): PageBlockItemRichTextEditorNode | null {\n switch (prosemirrorNode.type) {\n case \"paragraph\":\n return parseAsParagraphNode(prosemirrorNode);\n\n case \"orderedList\":\n case \"bulletList\":\n return parseAsListNode(prosemirrorNode);\n\n default:\n return null;\n }\n}\n\nfunction parseAsParagraphNode(prosemirrorNode: ProsemirrorNode): PageBlockItemRichTextEditorParagraphNode {\n return {\n type: \"Paragraph\",\n value: parseRichText(prosemirrorNode.content ?? []),\n };\n}\n\nfunction parseAsListNode(prosemirrorNode: ProsemirrorNode): PageBlockItemRichTextEditorListNode {\n return {\n type: \"List\",\n listType: prosemirrorNode.type === \"orderedList\" ? \"OL\" : \"UL\",\n value: (prosemirrorNode.content ?? []).map(parseAsListNodeItem).filter(nonNullFilter),\n };\n}\n\nfunction parseAsListNodeItem(prosemirrorNode: ProsemirrorNode): PageBlockText | null {\n if (prosemirrorNode.type !== \"listItem\") return null;\n\n const firstChild = prosemirrorNode.content?.[0];\n if (!firstChild || firstChild.type !== \"paragraph\") return null;\n\n return parseRichText(firstChild.content ?? []);\n}\n\n//\n// Sections\n//\n\nexport function prosemirrorNodeToSection(\n prosemirrorNode: ProsemirrorNode,\n definitions: PageBlockDefinition[]\n): PageSectionEditorModel | null {\n const definitionsById = mapByUnique(definitions, d => d.id);\n return internalProsemirrorNodeToSection(prosemirrorNode, definitionsById);\n}\n\nfunction internalProsemirrorNodeToSection(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>\n): PageSectionEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n return {\n id: id,\n type: \"Section\",\n variantId: getProsemirrorBlockVariantId(prosemirrorNode),\n sectionType: \"Tabs\",\n appearance: {\n contentExpandToEdges: true,\n expandToEdges: true,\n },\n items: (prosemirrorNode.content ?? [])\n .filter(c => c.type === \"sectionItem\")\n .map(c => prosemirrorNodeToSectionItem(c, definitionsMap))\n .filter(nonNullFilter),\n };\n}\n\nfunction prosemirrorNodeToSectionItem(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>\n): PageSectionItemV2 | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n return {\n id: id,\n title: getProsemirrorAttribute(prosemirrorNode, \"title\", z.string()) ?? \"\",\n columns: (prosemirrorNode.content ?? [])\n .filter(c => c.type === \"sectionItemColumn\")\n .map(c => prosemirrorNodeToSectionColumns(c, definitionsMap))\n .filter(nonNullFilter),\n };\n}\n\nfunction prosemirrorNodeToSectionColumns(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>\n): PageSectionColumnV2 | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n return {\n id: id,\n blocks: internalProsemirrorNodesToBlocks(prosemirrorNode.content ?? [], definitionsMap, 0),\n };\n}\n\n//\n// Blocks\n//\n\nexport function prosemirrorNodesToBlocks(prosemirrorNodes: ProsemirrorNode[], definitions: PageBlockDefinition[]) {\n const definitionsById = mapByUnique(definitions, d => d.id);\n return internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsById, 0);\n}\n\nfunction internalProsemirrorNodesToPageItems(\n prosemirrorNodes: ProsemirrorNode[],\n definitionsMap: Map<string, PageBlockDefinition>\n): (PageBlockEditorModel | PageSectionEditorModel)[] {\n const result: (PageBlockEditorModel | PageSectionEditorModel)[] = [];\n\n for (const prosemirrorNode of prosemirrorNodes) {\n if (prosemirrorNode.type === \"tabsSection\") {\n // Section\n const section = prosemirrorNodeToSection(prosemirrorNode, Array.from(definitionsMap.values()));\n section && result.push(section);\n } else {\n // Block\n result.push(...internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, 0));\n }\n }\n\n return result;\n}\n\nfunction internalProsemirrorNodesToBlocks(\n prosemirrorNodes: ProsemirrorNode[],\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n return prosemirrorNodes.flatMap(prosemirrorNode => {\n return internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth);\n });\n}\n\nfunction internalProsemirrorNodeToBlock(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n const definitionId = getProsemirrorAttribute(prosemirrorNode, \"definitionId\", z.string());\n if (!definitionId) {\n console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);\n\n return [];\n }\n\n const definition = definitionsMap.get(definitionId);\n if (!definition) {\n console.warn(\n `Block definitionId \"${definitionId}\" (prosemirror node ${prosemirrorNode.type}) is not among available definitions`\n );\n console.warn(prosemirrorNode);\n return [];\n }\n\n return prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, definitionsMap, depth);\n}\n\nfunction prosemirrorNodeAndDefinitionToBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n const multiRichTextProperty = BlockDefinitionUtils.firstMultiRichTextProperty(definition);\n if (multiRichTextProperty) {\n return parseAsMultiRichText(prosemirrorNode, definition, multiRichTextProperty, definitionsMap, depth);\n }\n\n const block = shallowProsemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition);\n return block ? [block] : [];\n}\n\nfunction shallowProsemirrorNodeAndDefinitionToBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n const richTextProperty = BlockDefinitionUtils.firstRichTextProperty(definition);\n if (richTextProperty) {\n return parseAsRichText(prosemirrorNode, definition, richTextProperty);\n }\n\n const tableProperty = BlockDefinitionUtils.firstTableProperty(definition);\n if (tableProperty) {\n return parseAsTable(prosemirrorNode, definition, tableProperty);\n }\n\n if (definition.id === \"io.supernova.block.divider\") {\n return parseAsDivider(prosemirrorNode, definition);\n }\n\n return parseAsCustomBlock(prosemirrorNode, definition);\n}\n\n//\n// Single rich text\n//\n\nfunction parseAsRichText(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n property: PageBlockDefinitionProperty\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, \"type\", z.string().optional()));\n\n return {\n id: id,\n type: \"Block\",\n\n data: {\n packageId: definition.id,\n indentLevel: 0,\n ...(variantId && { variantId: variantId }),\n items: [\n {\n id: id,\n props: {\n [property.id]: {\n // Required\n value: parseRichText(prosemirrorNode.content ?? []),\n\n // Optional\n ...(calloutType && { calloutType: calloutType }),\n } satisfies PageBlockItemRichTextValue,\n },\n },\n ],\n },\n };\n}\n\nfunction parseCalloutType(prosemirrorCalloutType: unknown): PageBlockCalloutType | undefined {\n if (!prosemirrorCalloutType) return undefined;\n\n switch (prosemirrorCalloutType) {\n case \"critical\":\n return \"Error\";\n case \"neutral\":\n return \"Info\";\n case \"positive\":\n return \"Success\";\n case \"warning\":\n return \"Warning\";\n case \"primary\":\n return \"Primary\";\n }\n}\n\n//\n// Multi rich text\n//\n\nfunction parseAsMultiRichText(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n property: PageBlockDefinitionProperty,\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return [];\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n const result: PageBlockEditorModel[] = [];\n\n // Flatten items\n const listItems: ProsemirrorNode[] = [];\n prosemirrorNode.content?.forEach(c => {\n // Illegal child of a list\n if (c.type !== \"listItem\") return;\n\n c.content?.forEach(cc => {\n listItems.push(cc);\n });\n });\n\n // Text list items buffering\n let bufferedTextItems: ProsemirrorNode[] = [];\n function flushBufferedTextItems() {\n if (!bufferedTextItems.length) return;\n\n const idSuffix = result.length ? `-${result.length}` : \"\";\n\n result.push({\n id: id + idSuffix,\n type: \"Block\",\n data: {\n packageId: definition.id,\n indentLevel: depth,\n ...(variantId && { variantId: variantId }),\n items: [\n {\n id: id + idSuffix,\n props: {\n [property.id]: {\n value: bufferedTextItems.map(paragraph => {\n return parseRichText(paragraph.content ?? []);\n }),\n } satisfies PageBlockItemMultiRichTextValue,\n },\n },\n ],\n },\n });\n\n bufferedTextItems = [];\n }\n\n listItems.forEach(item => {\n if (item.type === \"paragraph\") {\n bufferedTextItems.push(item);\n return;\n }\n\n // This is not a paragraph, flush text items first\n flushBufferedTextItems();\n\n result.push(...internalProsemirrorNodeToBlock(item, definitionsMap, depth + 1));\n });\n\n // Flush text items at the end\n flushBufferedTextItems();\n\n return result;\n}\n\n//\n// Rich text\n//\n\nfunction parseRichText(spans: ProsemirrorNode[]): PageBlockText {\n return {\n spans: spans.map(parseRichTextSpan).filter(nonNullFilter),\n };\n}\n\nfunction parseRichTextSpan(span: ProsemirrorNode): PageBlockTextSpan | null {\n if (span.type === \"hardBreak\") {\n return { text: \"\\n\", attributes: [] };\n }\n\n if (span.type !== \"text\" || !span.text) return null;\n\n const marks = span.marks ?? [];\n\n return {\n text: span.text,\n attributes: marks.map(parseRichTextAttribute).filter(nonNullFilter),\n };\n}\n\nfunction parseRichTextAttribute(mark: ProsemirrorMark): PageBlockTextSpanAttribute | null {\n switch (mark.type) {\n case \"bold\":\n return { type: \"Bold\" };\n case \"italic\":\n return { type: \"Italic\" };\n case \"strike\":\n return { type: \"Strikethrough\" };\n case \"code\":\n return { type: \"Code\" };\n case \"link\":\n return parseProsemirrorLink(mark);\n case \"commentHighlight\":\n return parseProsemirrorCommentHighlight(mark);\n }\n\n return null;\n}\n\nfunction parseProsemirrorLink(mark: ProsemirrorMark): PageBlockTextSpanAttribute | null {\n const href = getProsemirrorAttribute(mark, \"href\", z.string().optional());\n if (!href) return null;\n\n const target = getProsemirrorAttribute(mark, \"target\", z.string().optional());\n const openInNewTab = target === \"_blank\";\n\n if (href.startsWith(\"@\")) {\n return {\n type: \"Link\",\n openInNewWindow: openInNewTab,\n openInNewTab: openInNewTab,\n documentationItemId: href.split(\":\")[1],\n };\n } else {\n return {\n type: \"Link\",\n openInNewWindow: openInNewTab,\n openInNewTab: openInNewTab,\n link: href,\n };\n }\n}\n\nfunction parseProsemirrorCommentHighlight(mark: ProsemirrorMark): PageBlockTextSpanAttribute | null {\n const highlightId = getProsemirrorAttribute(mark, \"highlightId\", z.string().optional());\n if (!highlightId) return null;\n\n const isResolved = getProsemirrorAttribute(mark, \"resolved\", z.boolean().optional()) ?? false;\n\n return {\n type: \"Comment\",\n commentHighlightId: highlightId,\n commentIsResolved: isResolved,\n };\n}\n\n//\n// Embed\n//\n\nfunction parseAsTable(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n property: PageBlockDefinitionProperty\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n const hasBorder = getProsemirrorAttribute(prosemirrorNode, \"hasBorder\", z.boolean().optional()) !== false;\n\n const tableChild = prosemirrorNode.content?.find(c => c.type === \"table\");\n if (!tableChild) {\n return emptyTable(id, variantId, 0);\n }\n\n // Nodes can are considered rows if they have correct node type + their content is non-empty\n const rows = tableChild.content?.filter(c => c.type === \"tableRow\" && !!c.content?.length) ?? [];\n if (!rows.length) {\n return emptyTable(id, variantId, 0);\n }\n\n const rowHeaderCells = rows[0].content?.filter(c => c.type === \"tableHeader\").length ?? 0;\n const columnHeaderCells = rows.filter(r => r.content?.[0]?.type === \"tableHeader\").length;\n\n const hasHeaderRow = rows[0].content?.length === rowHeaderCells;\n const hasHeaderColumn = rows.length === columnHeaderCells;\n\n const tableValue: PageBlockItemTableValue = {\n showBorder: hasBorder,\n highlightHeaderRow: hasHeaderRow,\n highlightHeaderColumn: hasHeaderColumn,\n value: [],\n };\n\n tableValue.value = rows.map(row => {\n return {\n cells: (row.content ?? []).map(parseAsTableCell).filter(nonNullFilter),\n };\n });\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: \"io.supernova.block.table\",\n indentLevel: 0,\n variantId: \"default\",\n\n ...(variantId && { variantId: variantId }),\n\n items: [\n {\n id: id,\n props: {\n table: tableValue,\n },\n },\n ],\n },\n };\n}\n\nfunction parseAsTableCell(prosemirrorNode: ProsemirrorNode): PageBlockItemTableCell | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const textAlign = getProsemirrorAttribute(prosemirrorNode, \"textAlign\", z.string().optional());\n\n let columnWidth: number | undefined;\n const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, \"colwidth\", z.array(z.number()).nullish());\n if (columnWidthArray) {\n columnWidth = roundDimension(columnWidthArray[0]);\n }\n\n const tableNodes = (prosemirrorNode.content ?? []).map(parseAsTableNode).filter(nonNullFilter);\n\n return {\n id: id,\n alignment: parseTableCellAlignment(textAlign),\n ...(columnWidth && { columnWidth }),\n nodes: tableNodes.length ? tableNodes : emptyTableCellContent(),\n };\n}\n\nfunction parseTableCellAlignment(alignment: unknown): PageBlockTableCellAlignment {\n if (!alignment) return \"Left\";\n\n switch (alignment) {\n case \"left\":\n return \"Left\";\n case \"center\":\n return \"Center\";\n case \"right\":\n return \"Right\";\n\n default:\n return \"Left\";\n }\n}\n\nfunction parseAsTableNode(prosemirrorNode: ProsemirrorNode): PageBlockItemTableNode | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n switch (prosemirrorNode.type) {\n case \"paragraph\":\n return {\n type: \"RichText\",\n id: id,\n value: parseRichText(prosemirrorNode.content ?? []),\n };\n\n case \"image\":\n const items = getProsemirrorAttribute(prosemirrorNode, \"items\", z.string());\n if (!items) return null;\n\n const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));\n if (!parsedItems.success) return null;\n\n const rawImagePropertyValue = parsedItems.data[0]?.props.image;\n if (!rawImagePropertyValue) return null;\n\n const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);\n if (!imagePropertyValueParseResult.success) return null;\n\n const { value, caption, alt, alignment } = imagePropertyValueParseResult.data;\n\n return {\n type: \"Image\",\n id,\n value,\n ...(alt && { alt }),\n ...(caption && { caption }),\n ...(alignment && { alignment }),\n };\n\n default:\n return null;\n }\n}\n\nfunction emptyTable(id: string, variantId?: string, indentLevel?: number): PageBlockEditorModel {\n const tableValue: PageBlockItemTableValue = {\n showBorder: true,\n highlightHeaderColumn: false,\n highlightHeaderRow: false,\n value: [],\n };\n\n for (let i = 0; i < 2; i++) {\n tableValue.value.push({\n cells: [],\n });\n\n for (let j = 0; j < 3; j++) {\n tableValue.value[i].cells.push({\n id: \"\",\n alignment: \"Left\",\n nodes: emptyTableCellContent(),\n });\n }\n }\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: \"io.supernova.block.table\",\n indentLevel: indentLevel ?? 0,\n variantId: variantId,\n items: [\n {\n id: id,\n props: {\n table: tableValue,\n },\n },\n ],\n },\n };\n}\n\nfunction emptyTableCellContent(): PageBlockItemTableNode[] {\n return [\n {\n type: \"RichText\",\n id: \"\",\n value: { spans: [] },\n },\n ];\n}\n\n//\n// Divider\n//\n\nfunction parseAsDivider(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: definition.id,\n indentLevel: 0,\n\n ...(variantId && { variantId: variantId }),\n\n items: [{ id: id, props: {} }],\n },\n };\n}\n\n//\n// Custom block\n//\n\nfunction parseAsCustomBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n\n const appearance = parseAppearance(prosemirrorNode);\n\n const parsedItems = parseBlockItems(prosemirrorNode, definition) ?? [];\n\n // Some blocks can expect at least one item to be always present. In such case we fallback to an item\n // without any properties defined which should be a valid item for any combination of block settings.\n if (!parsedItems.length && definitionExpectsPlaceholderItem(definition)) {\n parsedItems.push({\n id: id,\n props: {},\n });\n }\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: definition.id,\n indentLevel: 0,\n\n ...(variantId && { variantId: variantId }),\n ...(appearance && { appearance: appearance }),\n\n items: parsedItems,\n },\n };\n}\n\nfunction definitionExpectsPlaceholderItem(definition: PageBlockDefinition): boolean {\n return (\n // Block needs an item when it's a data block (tokens, components, etc)\n !definition.behavior.items ||\n // Block needs an item when number of items is expected to be 1\n definition.behavior.items.numberOfItems === 1\n );\n}\n\nfunction parseBlockItems(prosemirrorNode: ProsemirrorNode, definition: PageBlockDefinition): PageBlockItemV2[] | null {\n const itemsString = getProsemirrorAttribute(prosemirrorNode, \"items\", z.string());\n if (!itemsString) return null;\n\n const itemsJson: unknown = JSON.parse(itemsString);\n if (!Array.isArray(itemsJson)) {\n console.error(\"Block `items` property must be a json array\");\n return null;\n }\n\n return itemsJson.map(i => parseItem(i, definition)).filter(nonNullFilter);\n}\n\nfunction parseAppearance(prosemirrorNode: ProsemirrorNode): PageBlockAppearanceV2 | undefined {\n let appearance: PageBlockAppearanceV2 = {};\n\n const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, \"appearance\", z.string().optional());\n if (rawAppearanceString) {\n const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));\n if (parsedAppearance.success) {\n appearance = parsedAppearance.data;\n }\n }\n\n const columns = getProsemirrorAttribute(prosemirrorNode, \"columns\", z.number().optional());\n if (columns) {\n appearance.numberOfColumns = columns;\n }\n\n const backgroundColor = getProsemirrorAttribute(prosemirrorNode, \"backgroundColor\", z.string().optional());\n if (backgroundColor) {\n const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));\n if (parsedColor.success) {\n appearance.itemBackgroundColor = parsedColor.data;\n }\n }\n\n if (!Object.keys(appearance).length) return undefined;\n\n return appearance;\n}\n\nfunction parseItem(rawItem: unknown, definition: PageBlockDefinition): PageBlockItemV2 | null {\n const parsedItem = PageBlockItemV2.safeParse(rawItem);\n if (!parsedItem.success) {\n return null;\n }\n\n const sanitizedProps: Record<string, PageBlockItemUntypedValue> = {};\n\n for (const property of definition.item.properties) {\n const value = parsedItem.data.props[property.id];\n if (!value) {\n continue;\n }\n\n const valueSchema = valueSchemaForPropertyType(property.type);\n const validationResult = valueSchema.safeParse(value);\n\n if (validationResult.success) {\n sanitizedProps[property.id] = validationResult.data;\n } else {\n // Migration - Storybook\n if (property.type === \"Storybook\") {\n const oldParsed = PageBlockItemStorybookValueOld.safeParse(value);\n if (oldParsed.success) {\n sanitizedProps[property.id] = storybookValueFromOldValue(oldParsed.data);\n }\n }\n }\n }\n\n return {\n id: parsedItem.data.id,\n ...(parsedItem.data.linksTo && { linksTo: parsedItem.data.linksTo }),\n props: sanitizedProps,\n };\n}\n\nfunction valueSchemaForPropertyType(type: PageBlockDefinitionPropertyType) {\n switch (type) {\n case \"RichText\":\n return PageBlockItemRichTextValue;\n case \"MultiRichText\":\n return PageBlockItemMultiRichTextValue;\n case \"Text\":\n return PageBlockItemTextValue;\n case \"Boolean\":\n return PageBlockItemBooleanValue;\n case \"Number\":\n return PageBlockItemNumberValue;\n case \"SingleSelect\":\n return PageBlockItemSingleSelectValue;\n case \"MultiSelect\":\n return PageBlockItemMultiSelectValue;\n case \"Image\":\n return PageBlockItemImageValue;\n case \"Token\":\n return PageBlockItemTokenValue;\n case \"TokenType\":\n return PageBlockItemTokenTypeValue;\n case \"TokenProperty\":\n return PageBlockItemTokenPropertyValue;\n case \"Component\":\n return PageBlockItemComponentValue;\n case \"ComponentProperty\":\n return PageBlockItemComponentPropertyValue;\n case \"Asset\":\n return PageBlockItemAssetValue;\n case \"AssetProperty\":\n return PageBlockItemAssetPropertyValue;\n case \"FigmaNode\":\n return PageBlockItemFigmaNodeValue;\n case \"EmbedURL\":\n return PageBlockItemEmbedValue;\n case \"URL\":\n return PageBlockItemUrlValue;\n case \"Markdown\":\n return PageBlockItemMarkdownValue;\n case \"Code\":\n return PageBlockItemCodeValue;\n case \"CodeSandbox\":\n return PageBlockItemSandboxValue;\n case \"Table\":\n return PageBlockItemTableValue;\n case \"Divider\":\n return PageBlockItemDividerValue;\n case \"Storybook\":\n return PageBlockItemStorybookValue;\n case \"Color\":\n return PageBlockItemColorValue;\n case \"FigmaComponent\":\n return PageBlockItemFigmaComponentValue;\n case \"RichTextEditor\":\n return PageBlockItemRichTextEditorValue;\n case \"File\":\n return PageBlockItemFileValue;\n }\n}\n\n//\n// Attributes\n//\n\nfunction getProsemirrorBlockId(prosemirrorNode: ProsemirrorNode): string | undefined {\n const id = getProsemirrorAttribute(prosemirrorNode, \"id\", z.string());\n if (!id) console.warn(`Prosemirror attribute \"id\" on ${prosemirrorNode.type} is required`);\n return id;\n}\n\nfunction getProsemirrorBlockVariantId(prosemirrorNode: ProsemirrorNode): string | undefined {\n return getProsemirrorAttribute(prosemirrorNode, \"variantId\", nullishToOptional(z.string()));\n}\n\nfunction getProsemirrorAttribute<I, O>(\n prosemirrorNode: ProsemirrorNode,\n attributeName: string,\n validationSchema: ZodSchema<O, ZodTypeDef, I>\n): O | undefined {\n const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);\n if (parsedAttr.success) {\n return parsedAttr.data;\n } else {\n console.warn(`Prosemirror attribute ${attributeName} on ${prosemirrorNode.type} is invalid`);\n console.warn(parsedAttr.error.flatten());\n return undefined;\n }\n}\n\n//\n// Utils\n//\n\nfunction nonNullFilter<T>(item: T | null): item is T {\n return item !== null;\n}\n\nfunction mapByUnique<V, K>(items: V[], keyFn: (item: V) => K): Map<K, V> {\n const result = new Map<K, V>();\n for (const item of items) {\n result.set(keyFn(item), item);\n }\n return result;\n}\n\nfunction roundDimension(dimension: number) {\n return Math.round(dimension * 100) / 100;\n}\n","import {\n DocumentationPageApproval,\n DocumentationPageSnapshot,\n DocumentationPageV2,\n ElementGroup,\n ElementGroupSnapshot,\n} from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { DocumentationHierarchySettings } from \"../design-system-content\";\nimport { VersionRoomBaseYDoc } from \"./base\";\n\ntype DocumentationHierarchyTransaction = {\n pages?: DocumentationPageV2[];\n pageIdsToDelete?: string[];\n\n groups?: ElementGroup[];\n groupIdsToDelete?: string[];\n\n pageSnapshots?: DocumentationPageSnapshot[];\n pageSnapshotIdsToDelete?: string[];\n\n groupSnapshots?: ElementGroupSnapshot[];\n groupSnapshotIdsToDelete?: string[];\n\n internalSettings?: Partial<DocumentationHierarchySettings>;\n\n pageHashesToUpdate?: Record<string, string>;\n\n pageApprovals?: DocumentationPageApproval[];\n pageApprovalIdsToDelete?: string[];\n\n executedTransactionIds?: string[];\n};\n\nexport class BackendVersionRoomYDoc {\n private readonly yDoc: Y.Doc;\n\n constructor(yDoc: Y.Doc) {\n this.yDoc = yDoc;\n }\n\n updateDocumentationHierarchy(transaction: DocumentationHierarchyTransaction) {\n this.yDoc.transact(trx => {\n const yDoc = new VersionRoomBaseYDoc(trx.doc);\n\n // Pages\n transaction.pageIdsToDelete && yDoc.deletePages(transaction.pageIdsToDelete);\n transaction.pages && yDoc.updatePages(transaction.pages);\n\n // Groups\n transaction.groupIdsToDelete && yDoc.deleteGroups(transaction.groupIdsToDelete);\n transaction.groups && yDoc.updateGroups(transaction.groups);\n\n // Page snapshots\n transaction.pageSnapshotIdsToDelete && yDoc.deletePageSnapshots(transaction.pageSnapshotIdsToDelete);\n transaction.pageSnapshots && yDoc.updatePageSnapshots(transaction.pageSnapshots);\n\n // Snapshots - published groups\n transaction.groupSnapshotIdsToDelete && yDoc.deleteGroupSnapshots(transaction.groupSnapshotIdsToDelete);\n transaction.groupSnapshots && yDoc.updateGroupSnapshots(transaction.groupSnapshots);\n\n // Settings\n transaction.internalSettings && yDoc.updateDocumentationInternalSettings(transaction.internalSettings);\n transaction.pageHashesToUpdate && yDoc.updateDocumentationPageContentHashes(transaction.pageHashesToUpdate);\n transaction.pageApprovals && yDoc.updateApprovalStates(transaction.pageApprovals);\n transaction.pageApprovalIdsToDelete && yDoc.removeApprovalStates(transaction.pageApprovalIdsToDelete);\n\n // Executed transaction ids\n transaction.executedTransactionIds && yDoc.updateExecutedTransactionIds(transaction.executedTransactionIds);\n });\n }\n\n getDocumentationPageContentHashes() {\n const versionDoc = new VersionRoomBaseYDoc(this.yDoc);\n\n // Limit each hash string by 100 characters\n const validHashes = Object.entries(versionDoc.getDocumentationPageContentHashes()).filter(e => {\n return e[1].length < 100;\n });\n\n return Object.fromEntries(validHashes);\n }\n}\n","import {\n defaultDocumentationItemConfigurationV2,\n generateShortPersistentId,\n mapByUnique,\n RoomType,\n slugify,\n} from \"@supernova-studio/model\";\nimport { DTOElementActionInput, DTOElementActionInputOfType } from \"../api\";\nimport { VersionRoomApproval, VersionRoomBaseYDocState, VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../yjs\";\nimport { LocalApproval, LocalDocsPage, LocalDocsPageGroup } from \"./types\";\n\n//\n// Types\n//\n\ntype Page = LocalDocsPage | VersionRoomDocsPage;\ntype Group = LocalDocsPageGroup | VersionRoomDocsPageGroup;\ntype ApprovalState = LocalApproval | VersionRoomApproval;\n\n//\n// Interface\n//\n\ntype Input = LocalExecutorConfig & {\n actions: DTOElementActionInput[];\n};\n\nexport function applyActionsLocally(input: Input) {\n const actionExecutor = new LocalDocsElementActionExecutor(input);\n actionExecutor.applyActions(input.actions);\n return actionExecutor.localState;\n}\n\n//\n// Executor\n//\n\ntype LocalExecutorConfig = {\n userId: string;\n designSystemVersionId: string;\n remoteState: VersionRoomBaseYDocState;\n};\n\nexport class LocalDocsElementActionExecutor {\n private readonly userId: string;\n private readonly designSystemVersionId: string;\n\n private readonly pages: Map<string, Page>;\n private readonly groups: Map<string, Group>;\n private readonly approvalStates: Map<string, ApprovalState>;\n private readonly pageLiveblockRoomIds: Record<string, string>;\n\n constructor(config: LocalExecutorConfig) {\n const { designSystemVersionId, remoteState, userId } = config;\n\n this.userId = userId;\n this.designSystemVersionId = designSystemVersionId;\n\n // Seed the state with remote state\n this.pages = mapByUnique(remoteState.pages, p => p.persistentId);\n this.groups = mapByUnique(remoteState.groups, p => p.persistentId);\n this.approvalStates = mapByUnique(remoteState.approvals, a => a.pagePersistentId);\n this.pageLiveblockRoomIds = { ...remoteState.pageLiveblockRoomIds };\n }\n\n get localState() {\n return {\n pages: Array.from(this.pages.values()),\n groups: Array.from(this.groups.values()),\n approvals: Array.from(this.approvalStates.values()),\n pageLiveblockRoomIds: this.pageLiveblockRoomIds,\n };\n }\n\n applyActions(trx: DTOElementActionInput[]) {\n trx.forEach(trx => this.applyTransaction(trx));\n }\n\n applyTransaction(trx: DTOElementActionInput) {\n switch (trx.type) {\n // Groups\n case \"DocumentationGroupCreate\":\n return this.documentationGroupCreate(trx);\n case \"DocumentationGroupUpdate\":\n return this.documentationGroupUpdate(trx);\n case \"DocumentationGroupMove\":\n return this.documentationGroupMove(trx);\n\n // Groups - unsupported\n case \"DocumentationGroupDelete\":\n case \"DocumentationGroupDuplicate\":\n case \"DocumentationGroupRestore\":\n throw new Error(`Transaction type ${trx.type} is not yet implemented`);\n\n // Pages\n case \"DocumentationPageCreate\":\n return this.documentationPageCreate(trx);\n case \"DocumentationPageUpdate\":\n return this.documentationPageUpdate(trx);\n case \"DocumentationPageMove\":\n return this.documentationPageMove(trx);\n case \"DocumentationPageDelete\":\n return this.documentationPageDelete(trx);\n\n // Pages - unsupported\n case \"DocumentationPageApprovalStateChange\":\n return this.documentationApprovalStateUpdate(trx);\n\n case \"DocumentationPageDuplicate\":\n case \"DocumentationPageRestore\":\n throw new Error(`Transaction type ${trx.type} is not yet implemented`);\n\n // Tabs\n case \"DocumentationTabCreate\":\n return this.documentationTabCreate(trx);\n\n case \"DocumentationTabGroupDelete\":\n throw new Error(`Transaction type ${trx.type} is not yet implemented`);\n\n // Won't ever be supported\n case \"FigmaNodeRender\":\n case \"FigmaNodeRenderAsync\":\n throw new Error(`Transaction type ${trx.type} is not a documentation element action`);\n }\n }\n\n //\n // Pages\n //\n\n private documentationPageCreate(trx: DTOElementActionInputOfType<\"DocumentationPageCreate\">) {\n const { input } = trx;\n const { persistentId } = input;\n\n if (this.pages.has(input.persistentId)) {\n // TODO Artem: uncomment when this is synced with remote state\n // throw new Error(`Cannot create page: persistent id ${input.persistentId} already exists`);\n return;\n }\n\n if (!this.groups.has(input.parentPersistentId)) {\n throw new Error(`Cannot create page: parent persistent id ${input.parentPersistentId} was not found`);\n }\n\n const localPage: LocalDocsPage = {\n persistentId,\n createdAt: new Date(),\n parentPersistentId: input.parentPersistentId,\n shortPersistentId: generateShortPersistentId(),\n slug: slugify(input.title),\n meta: { name: input.title },\n updatedAt: new Date(),\n data: {\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? { ...defaultDocumentationItemConfigurationV2, ...input.configuration }\n : input.configuration,\n },\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n designSystemVersionId: this.designSystemVersionId,\n };\n\n this.pages.set(persistentId, localPage);\n\n const roomId = `${RoomType.DocumentationPage}:${this.designSystemVersionId}:${persistentId}`;\n this.pageLiveblockRoomIds[persistentId] = roomId;\n }\n\n private documentationPageUpdate(trx: DTOElementActionInputOfType<\"DocumentationPageUpdate\">) {\n const { input } = trx;\n\n const existingPage = this.pages.get(input.id);\n if (!existingPage) {\n throw new Error(`Cannot update page: page id ${input.id} was not found`);\n }\n\n const localPage: LocalDocsPage = {\n ...existingPage,\n userSlug: undefined,\n meta: {\n ...existingPage.meta,\n name: input.title ?? existingPage.meta.name,\n },\n data: {\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? { ...(existingPage.data.configuration ?? defaultDocumentationItemConfigurationV2), ...input.configuration }\n : existingPage.data.configuration,\n },\n };\n\n this.pages.set(localPage.persistentId, localPage);\n }\n\n private documentationPageMove(trx: DTOElementActionInputOfType<\"DocumentationPageMove\">) {\n const { input } = trx;\n\n if (!this.groups.has(input.parentPersistentId)) {\n throw new Error(`Cannot move page: page parent id ${input.parentPersistentId} was not found`);\n }\n\n const existingPage = this.pages.get(input.id);\n if (!existingPage) {\n throw new Error(`Cannot update page: page id ${input.id} was not found`);\n }\n\n const localPage: LocalDocsPage = {\n ...existingPage,\n userSlug: undefined,\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n parentPersistentId: input.parentPersistentId,\n };\n\n this.pages.set(localPage.persistentId, localPage);\n }\n\n private documentationPageDelete(trx: DTOElementActionInputOfType<\"DocumentationPageDelete\">) {\n const { input } = trx;\n\n if (!this.pages.delete(trx.input.id)) {\n throw new Error(`Cannot delete page: page id ${input.id} was not found`);\n }\n\n delete this.pageLiveblockRoomIds[trx.input.id];\n }\n\n //\n // Group\n //\n\n private documentationGroupCreate(trx: DTOElementActionInputOfType<\"DocumentationGroupCreate\">) {\n const { input } = trx;\n\n if (this.groups.has(input.persistentId)) {\n // TODO Artem: uncomment when this is synced with remote state\n // throw new Error(`Cannot create page: persistent id ${input.persistentId} already exists`);\n return;\n }\n\n const localGroup: LocalDocsPageGroup = {\n parentPersistentId: input.parentPersistentId,\n persistentId: input.persistentId,\n shortPersistentId: generateShortPersistentId(),\n slug: slugify(input.title),\n meta: { name: input.title },\n createdAt: new Date(),\n updatedAt: new Date(),\n data: {\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? { ...defaultDocumentationItemConfigurationV2, ...input.configuration }\n : input.configuration,\n },\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n designSystemVersionId: this.designSystemVersionId,\n };\n\n this.groups.set(localGroup.persistentId, localGroup);\n }\n\n private documentationGroupUpdate(trx: DTOElementActionInputOfType<\"DocumentationGroupUpdate\">) {\n const { input } = trx;\n\n const existingGroup = this.groups.get(input.id);\n if (!existingGroup) {\n throw new Error(`Cannot update group: group id ${input.id} was not found`);\n }\n\n const localGroup: LocalDocsPageGroup = {\n ...existingGroup,\n userSlug: undefined,\n meta: {\n ...existingGroup.meta,\n name: input.title ?? existingGroup.meta.name,\n },\n data: {\n ...existingGroup.data,\n\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? {\n ...(existingGroup.data?.configuration ?? defaultDocumentationItemConfigurationV2),\n ...input.configuration,\n }\n : existingGroup.data?.configuration,\n },\n };\n\n this.groups.set(localGroup.persistentId, localGroup);\n }\n\n private documentationGroupMove(trx: DTOElementActionInputOfType<\"DocumentationGroupMove\">) {\n const { input } = trx;\n\n if (!this.groups.has(input.parentPersistentId)) {\n throw new Error(`Cannot move group: group parent id ${input.parentPersistentId} was not found`);\n }\n\n const existingGroup = this.groups.get(input.id);\n if (!existingGroup) {\n throw new Error(`Cannot update group: group id ${input.id} was not found`);\n }\n\n const localGroup: LocalDocsPageGroup = {\n ...existingGroup,\n userSlug: undefined,\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n parentPersistentId: input.parentPersistentId,\n };\n\n this.groups.set(localGroup.persistentId, localGroup);\n }\n\n //\n // Tabs\n //\n\n private documentationTabCreate(trx: DTOElementActionInputOfType<\"DocumentationTabCreate\">) {\n const { input } = trx;\n\n const page = this.pages.get(input.fromItemPersistentId);\n if (!page) {\n throw new Error(`Cannot create tab: page id ${input.fromItemPersistentId} was not found`);\n }\n\n // Create tab group in place of the page\n const tabGroup: LocalDocsPageGroup = {\n parentPersistentId: page.parentPersistentId,\n persistentId: input.persistentId,\n shortPersistentId: generateShortPersistentId(),\n slug: page.slug,\n meta: page.meta,\n createdAt: new Date(),\n updatedAt: new Date(),\n data: {\n behavior: \"Tabs\",\n configuration: page?.data.configuration,\n },\n sortOrder: page.sortOrder,\n designSystemVersionId: this.designSystemVersionId,\n };\n this.groups.set(input.persistentId, tabGroup);\n\n const newLocalPage: LocalDocsPage = {\n ...page,\n userSlug: undefined,\n sortOrder: 0,\n parentPersistentId: input.persistentId,\n meta: { name: input.tabName },\n };\n this.pages.set(newLocalPage.persistentId, newLocalPage);\n }\n\n //\n // Approval states\n //\n\n private documentationApprovalStateUpdate(trx: DTOElementActionInputOfType<\"DocumentationPageApprovalStateChange\">) {\n const { input } = trx;\n\n const existingApproval = this.approvalStates.get(input.persistentId);\n\n if (input.approvalState) {\n this.approvalStates.set(input.persistentId, {\n approvalState: input.approvalState,\n createdAt: existingApproval?.createdAt ?? new Date(),\n designSystemVersionId: this.designSystemVersionId,\n pagePersistentId: input.persistentId,\n updatedAt: new Date(),\n updatedByUserId: this.userId,\n } satisfies LocalApproval);\n } else {\n this.approvalStates.delete(input.persistentId);\n }\n }\n\n //\n // Utils\n //\n\n private calculateSortOrder(parentPersistentId: string, afterPersistentId?: string | null): number {\n const sortOrderStep = Math.pow(2, 16);\n\n const neighbours = [\n ...Array.from(this.pages.values()).filter(p => p.parentPersistentId === parentPersistentId),\n ...Array.from(this.groups.values()).filter(g => g.parentPersistentId === parentPersistentId),\n ];\n\n // If no neighbors, just assign 0\n if (!neighbours.length) return 0;\n\n neighbours.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);\n\n // Null afterPersistentId means beginning\n if (afterPersistentId === null) return neighbours[0].sortOrder - sortOrderStep;\n\n // Undefined afterPersistentId means default behavior (end of the list)\n if (!afterPersistentId) return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;\n\n const index = neighbours.findIndex(e => e.persistentId === afterPersistentId);\n\n // If page is not found or adding after the last item is requested, assign last position\n if (index < 0 || index === neighbours.length - 1) {\n return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;\n }\n\n // Insert in between items\n const left = neighbours[index].sortOrder;\n const right = neighbours[index + 1]?.sortOrder ?? left + sortOrderStep * 2;\n\n return (right + left) / 2;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/backend/backend/packages/client/dist/index.js","../../model/src/asset-delete-schedule/asset-delete-schedule.ts","../../model/src/auth/plugin-oauth-request.ts","../../model/src/auth/request.ts","../../model/src/auth/session.ts","../../model/src/billing/card.ts","../../model/src/billing/checkoutSession.ts","../../model/src/billing/customer.ts","../../model/src/billing/features.ts","../../model/src/billing/invoice.ts","../../model/src/billing/portalSession.ts","../../model/src/billing/price.ts","../../model/src/billing/product.ts","../../model/src/billing/subscription.ts","../../model/src/chat-threads/chat-message.ts","../../model/src/chat-threads/chat-thread.ts","../../model/src/common/entity.ts","../../model/src/common/object-meta.ts","../../model/src/custom-domains/custom-domains.ts","../../model/src/data-dumps/code-integration-dump.ts","../../model/src/export/exporter.ts","../../model/src/export/git-providers.ts","../../model/src/export/pulsar.ts","../../model/src/export/export-configuration.ts","../../model/src/export/pipeline.ts","../../model/src/export/export-destinations.ts","../../model/src/dsm/assets/asset-dynamo-record.ts","../../model/src/dsm/assets/asset-reference.ts","../../model/src/dsm/assets/asset-value.ts","../../model/src/dsm/assets/asset.ts","../../model/src/dsm/code-components/code-component.ts","../../model/src/dsm/components/asset-rendering.ts","../../model/src/dsm/import/support/figma-files.ts","../../model/src/dsm/import/support/import-context.ts","../../model/src/dsm/data-sources/data-source.ts","../../model/src/dsm/import/warning.ts","../../model/src/dsm/data-sources/import-summary.ts","../../model/src/dsm/elements/data/base.ts","../../model/src/dsm/elements/data/blur.ts","../../model/src/dsm/elements/data/dimension.ts","../../model/src/dsm/elements/data/border-radius.ts","../../model/src/dsm/elements/data/border-width.ts","../../model/src/dsm/elements/data/border.ts","../../model/src/dsm/elements/data/color.ts","../../model/src/dsm/elements/data/opacity.ts","../../model/src/dsm/elements/data/component.ts","../../model/src/dsm/elements/component-properties.ts","../../model/src/dsm/elements/data/documentation-block-v1.ts","../../model/src/utils/content-loader-instruction.ts","../../model/src/utils/interop-pulsar-error.ts","../../model/src/utils/slugify.ts","../../model/src/dsm/properties/property-definition.ts","../../model/src/dsm/properties/property-value.ts","../../model/src/dsm/elements/primitives/point.ts","../../model/src/dsm/elements/primitives/size.ts","../../model/src/dsm/elements/raw-element.ts","../../model/src/dsm/elements/data/documentation-block-v2.ts","../../model/src/dsm/documentation/block-definitions/item.ts","../../model/src/dsm/documentation/block-definitions/aux.ts","../../model/src/dsm/documentation/block-definitions/variant.ts","../../model/src/dsm/elements/data/documentation-page-v1.ts","../../model/src/dsm/elements/data/documentation-v1.ts","../../model/src/dsm/elements/data/item-header-v1.ts","../../model/src/dsm/elements/data/item-header.ts","../../model/src/dsm/elements/data/documentation-page-v2.ts","../../model/src/dsm/elements/data/documentation-v2.ts","../../model/src/dsm/elements/data/item-header-v2.ts","../../model/src/dsm/elements/data/documentation-section-v2.ts","../../model/src/dsm/elements/page-block-v2.ts","../../model/src/dsm/elements/base.ts","../../model/src/dsm/elements/data/duration.ts","../../model/src/dsm/elements/data/figma-file-structure.ts","../../model/src/dsm/elements/data/figma-node-reference.ts","../../model/src/dsm/elements/data/font-family.ts","../../model/src/dsm/elements/data/font-size.ts","../../model/src/dsm/elements/data/font-weight.ts","../../model/src/dsm/elements/data/font.ts","../../model/src/dsm/elements/data/gradient.ts","../../model/src/dsm/elements/data/group.ts","../../model/src/dsm/elements/data/letter-spacing.ts","../../model/src/dsm/elements/data/line-height.ts","../../model/src/dsm/elements/data/paragraph-indent.ts","../../model/src/dsm/elements/data/paragraph-spacing.ts","../../model/src/dsm/elements/data/product-copy.ts","../../model/src/dsm/elements/data/safe-id.ts","../../model/src/dsm/elements/data/shadow.ts","../../model/src/dsm/elements/data/size.ts","../../model/src/dsm/elements/data/space.ts","../../model/src/dsm/elements/data/string.ts","../../model/src/dsm/elements/data/text-case.ts","../../model/src/dsm/elements/data/text-decoration.ts","../../model/src/dsm/elements/data/typography.ts","../../model/src/dsm/elements/data/visibility.ts","../../model/src/dsm/elements/data/z-index.ts","../../model/src/dsm/elements/documentation-page-v1.ts","../../model/src/dsm/elements/group.ts","../../model/src/dsm/elements/documentation-page-v2.ts","../../model/src/dsm/elements/figma-component.ts","../../model/src/dsm/elements/figma-file-structures.ts","../../model/src/dsm/elements/figma-node-reference.ts","../../model/src/dsm/elements/theme.ts","../../model/src/dsm/elements/tokens.ts","../../model/src/dsm/data-sources/figma.ts","../../model/src/dsm/data-sources/import-job.ts","../../model/src/dsm/import/support/import-model-collections.ts","../../model/src/dsm/import/collection.ts","../../model/src/dsm/collection.ts","../../model/src/dsm/import/component.ts","../../model/src/dsm/import/base.ts","../../model/src/dsm/import/image.ts","../../model/src/dsm/import/data-source.ts","../../model/src/dsm/import/figma-frames.ts","../../model/src/dsm/import/theme.ts","../../model/src/dsm/import/tokens.ts","../../model/src/dsm/documentation/approvals/approval-state.ts","../../model/src/dsm/documentation/approvals/approval.ts","../../model/src/dsm/documentation/block-definitions/definition.ts","../../model/src/dsm/documentation/group.ts","../../model/src/dsm/documentation/link-preview.ts","../../model/src/dsm/documentation/page-anchor.ts","../../model/src/dsm/documentation/page-content-backup.ts","../../model/src/dsm/documentation/page-content.ts","../../model/src/dsm/documentation/page-dependencies.ts","../../model/src/dsm/documentation/page.ts","../../model/src/dsm/documentation/redirects.ts","../../model/src/dsm/documentation/settings.ts","../../model/src/dsm/documentation/thread.ts","../../model/src/dsm/element-snapshots/base.ts","../../model/src/dsm/element-snapshots/documentation-page-snapshot.ts","../../model/src/dsm/figma-exporter/figma-exporter.ts","../../model/src/dsm/figma-node-renderer/renderer-payload.ts","../../model/src/dsm/figma-node-structures/structure-data.ts","../../model/src/dsm/figma-node-structures/structure.ts","../../model/src/dsm/membership/design-system-membership.ts","../../model/src/workspace/npm-registry-settings.ts","../../model/src/workspace/sso-provider.ts","../../model/src/workspace/untyped-data.ts","../../model/src/workspace/user-invite.ts","../../model/src/workspace/workspace-role.ts","../../model/src/workspace/workspace-configuration.ts","../../model/src/workspace/workspace.ts","../../model/src/workspace/workspace-context.ts","../../model/src/workspace/workspace-create.ts","../../model/src/workspace/workspace-invitations.ts","../../model/src/workspace/workspace-membership.ts","../../model/src/users/linked-integrations.ts","../../model/src/users/user-analytics-cleanup-schedule.ts","../../model/src/users/user-identity.ts","../../model/src/users/user-minified.ts","../../model/src/users/user-notification-settings.ts","../../model/src/users/user-profile.ts","../../model/src/users/user-test.ts","../../model/src/users/user.ts","../../model/src/dsm/membership/ds-role.ts","../../model/src/dsm/membership/invitations.ts","../../model/src/dsm/views/column.ts","../../model/src/dsm/views/view.ts","../../model/src/dsm/brand.ts","../../model/src/dsm/design-system.ts","../../model/src/dsm/exporter-property-values-collection.ts","../../model/src/dsm/published-doc-page-visits.ts","../../model/src/dsm/published-doc-page.ts","../../model/src/dsm/published-doc.ts","../../model/src/dsm/storybook-entry.ts","../../model/src/dsm/storybook-payload.ts","../../model/src/dsm/version.ts","../../model/src/data-dumps/design-system-dump.ts","../../model/src/data-dumps/design-system-version-dump.ts","../../model/src/liveblocks/rooms/design-system-version-room.ts","../../model/src/liveblocks/rooms/documentation-page-room.ts","../../model/src/liveblocks/rooms/room-type.ts","../../model/src/liveblocks/rooms/workspace-room.ts","../../model/src/data-dumps/published-docs-dump.ts","../../model/src/data-dumps/user-data-dump.ts","../../model/src/data-dumps/workspace-dump.ts","../../model/src/integrations/integration.ts","../../model/src/docs-server/session.ts","../../model/src/emails/design-system-invite.ts","../../model/src/emails/workspace-invite.ts","../../model/src/events/base.ts","../../model/src/events/data-source-imported.ts","../../model/src/events/version-released.ts","../../model/src/events/documentation-published.ts","../../model/src/export/export-runner/export-context.ts","../../model/src/export/export-runner/exporter-payload.ts","../../model/src/export/export-jobs.ts","../../model/src/export/exporter-list-query.ts","../../model/src/export/exporter-workspace-membership-role.ts","../../model/src/export/exporter-workspace-membership.ts","../../model/src/feature-flags/feature-flags.ts","../../model/src/integrations/external-oauth-request.ts","../../model/src/integrations/oauth-providers.ts","../../model/src/integrations/git.ts","../../model/src/integrations/oauth-token.ts","../../model/src/integrations/workspace-oauth-requests.ts","../../model/src/npm/npm-package.ts","../../model/src/npm/npm-proxy-token-payload.ts","../../model/src/portal/portal-settings.ts","../../model/src/tokens/personal-access-token.ts","../../model/src/helpers/db.ts","../../model/src/helpers/nullish-to-optional.ts","../../model/src/utils/errors.ts","../../model/src/utils/common.ts","../../model/src/utils/short-persistent-id.ts","../../model/src/utils/validation.ts","../../model/src/dsm/elements/utils.ts","../../model/src/dsm/element-snapshots/group-snapshot.ts","../src/api/conversion/analytics/page-visits-to-dto.ts","../src/api/conversion/analytics/page-visits-to-comparison-dto.ts","../src/api/conversion/analytics/page-visits-to-heatmap-dto.ts","../src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts","../src/api/conversion/documentation/documentation-page-to-dto-utils.ts","../src/api/conversion/documentation/documentation-group-v1-to-dto.ts","../src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts","../src/api/conversion/documentation/documentation-group-v2-to-dto.ts","../src/api/conversion/documentation/documentation-page-v1-to-dto.ts","../src/api/conversion/documentation/documentation-page-v2-to-dto.ts","../src/api/conversion/export/pipeline.ts","../src/api/conversion/integrations/git.ts","../src/api/conversion/integrations/integration.ts","../src/api/dto/access-tokens/access-token.ts","../src/api/dto/aux/color.ts","../src/api/dto/aux/meta.ts","../src/api/dto/aux/pagination.ts","../src/api/dto/bff/app-bootstrap-data.ts","../src/api/dto/design-systems/brand.ts","../src/api/dto/design-systems/code-component.ts","../src/api/dto/design-systems/component.ts","../src/api/dto/design-systems/contact.ts","../src/api/dto/users/authenticated-user.ts","../src/api/dto/users/user.ts","../src/api/dto/users/update.ts","../src/api/dto/design-systems/data-source.ts","../src/api/dto/design-systems/design-system.ts","../src/api/dto/design-systems/members.ts","../src/api/dto/design-systems/role.ts","../src/api/dto/design-systems/elements-diff.ts","../src/api/dto/design-systems/figma-variables.ts","../src/api/dto/design-systems/file.ts","../src/api/dto/design-systems/import-job.ts","../src/api/dto/design-systems/redirects.ts","../src/api/dto/design-systems/stats.ts","../src/api/dto/design-systems/storybook.ts","../src/api/dto/design-systems/user-design-systems.ts","../src/api/dto/workspaces/chat-threads.ts","../src/api/dto/workspaces/git.ts","../src/api/dto/workspaces/integrations.ts","../src/api/dto/workspaces/invitations.ts","../src/api/dto/workspaces/membership.ts","../src/api/dto/workspaces/workspace.ts","../src/api/dto/workspaces/npm-registry.ts","../src/api/dto/workspaces/untyped-data.ts","../src/api/dto/design-systems/version-room.ts","../src/api/dto/design-systems/version.ts","../src/api/payloads/design-systems/update-design-system.ts","../src/api/payloads/design-systems/version.ts","../src/api/payloads/documentation/analytics.ts","../src/api/payloads/documentation/block-definitions.ts","../src/api/dto/documentation/block-definition.ts","../src/api/payloads/documentation/design-data-doc-diff.ts","../src/api/payloads/export/pipeline.ts","../src/api/dto/export/exporter-property.ts","../src/api/payloads/liveblocks/auth.ts","../src/api/payloads/users/notifications/notification-settings.ts","../src/api/payloads/users/profile/update.ts","../src/api/payloads/workspaces/transfer-ownership.ts","../src/api/payloads/workspaces/workspace-configuration.ts","../src/api/payloads/workspaces/workspace-integrations.ts","../src/api/dto/design-systems/view.ts","../src/api/dto/collections/token-collection.ts","../src/api/dto/design-tokens/design-token.ts","../src/api/dto/documentation/analytics-v2.ts","../src/api/dto/documentation/analytics.ts","../src/api/dto/documentation/anchor.ts","../src/api/dto/documentation/approvals.ts","../src/api/dto/documentation/block.ts","../src/api/dto/documentation/documentation-page-snapshot.ts","../src/api/dto/elements/documentation/page-v2.ts","../src/api/dto/elements/documentation/draft-state.ts","../src/api/dto/elements/documentation/item-configuration-v2.ts","../src/api/dto/elements/documentation/metadata.ts","../src/api/dto/documentation/link-preview.ts","../src/api/dto/documentation/publish.ts","../src/api/dto/export/exporter.ts","../src/api/dto/export/filter.ts","../src/api/dto/export/job.ts","../src/api/dto/export/pipeline.ts","../src/api/dto/documentation/room.ts","../src/api/dto/elements/components/figma-component-group.ts","../src/api/dto/elements/components/figma-component.ts","../src/api/dto/elements/documentation/group-action.ts","../src/api/dto/elements/documentation/group-v2.ts","../src/api/dto/elements/documentation/group-v1.ts","../src/api/dto/elements/documentation/item-configuration-v1.ts","../src/api/dto/elements/documentation/hierarchy.ts","../src/api/dto/elements/documentation/page-actions-v2.ts","../src/api/dto/elements/documentation/page-content.ts","../src/api/dto/elements/documentation/page-dependencies.ts","../src/api/dto/elements/documentation/page-v1.ts","../src/api/dto/elements/documentation/settings.ts","../src/api/dto/elements/documentation/structure.ts","../src/api/dto/elements/figma-nodes/figma-node-structure.ts","../src/api/dto/elements/figma-nodes/figma-node-v1.ts","../src/api/dto/elements/figma-nodes/figma-node.ts","../src/api/dto/elements/figma-nodes/figma-node-v2.ts","../src/api/dto/elements/figma-nodes/node-actions-v2.ts","../src/api/dto/elements/frame-node-structures/frame-node-structure.ts","../src/api/dto/elements/properties/property-definitions.ts","../src/api/dto/elements/properties/property-values.ts","../src/api/dto/elements/elements-action-v2.ts","../src/api/dto/elements/get-elements-v2.ts","../src/api/dto/figma-components/assets/download.ts","../src/api/dto/figma-exporter/figma-node.ts","../src/api/dto/liveblocks/auth-response.ts","../src/api/dto/portal/portal-settings.ts","../src/api/dto/themes/override.ts","../src/api/dto/themes/theme.ts","../src/utils/figma.ts","../src/utils/hash.ts","../src/utils/query.ts","../src/utils/redirect-validation.ts","../src/api/endpoints/codegen/exporters.ts","../src/api/endpoints/codegen/jobs.ts","../src/api/endpoints/codegen/pipelines.ts","../src/api/endpoints/codegen/codegen.ts","../src/api/endpoints/design-system/versions/brands.ts","../src/api/endpoints/design-system/versions/code-components.ts","../src/api/endpoints/design-system/versions/documentation.ts","../src/api/endpoints/design-system/versions/ds-components.ts","../src/api/endpoints/design-system/versions/elements-action.ts","../src/api/endpoints/design-system/versions/elements.ts","../src/api/endpoints/design-system/versions/figma-component-groups.ts","../src/api/endpoints/design-system/versions/figma-components.ts","../src/api/endpoints/design-system/versions/figma-frame-structures.ts","../src/api/endpoints/design-system/versions/files.ts","../src/api/endpoints/design-system/versions/import-jobs.ts","../src/api/endpoints/design-system/versions/overrides.ts","../src/api/endpoints/design-system/versions/property-definitions.ts","../src/api/endpoints/design-system/versions/property-values.ts","../src/api/endpoints/design-system/versions/stats.ts","../src/api/endpoints/design-system/versions/themes.ts","../src/api/endpoints/design-system/versions/token-collections.ts","../src/api/endpoints/design-system/versions/token-groups.ts","../src/api/endpoints/design-system/versions/tokens.ts","../src/api/endpoints/design-system/versions/versions.ts","../src/api/endpoints/design-system/analytics.ts","../src/api/endpoints/design-system/bff.ts","../src/api/endpoints/design-system/contact.ts","../src/api/endpoints/design-system/design-systems.ts","../src/api/endpoints/design-system/figma-node-structures.ts","../src/api/endpoints/design-system/members.ts","../src/api/endpoints/design-system/redirects.ts","../src/api/endpoints/design-system/sources.ts","../src/api/endpoints/design-system/storybook.ts","../src/api/endpoints/design-system/storybook-hosting.ts","../src/api/endpoints/workspaces/chat-threads.ts","../src/api/endpoints/workspaces/integrations.ts","../src/api/endpoints/workspaces/invites.ts","../src/api/endpoints/workspaces/members.ts","../src/api/endpoints/workspaces/npm-register.ts","../src/api/endpoints/workspaces/workspaces.ts","../src/api/endpoints/liveblocks.ts","../src/api/endpoints/users.ts","../src/api/transport/request-executor-error.ts","../src/api/transport/request-executor.ts","../src/api/client.ts","../src/events/design-system.ts","../src/events/event.ts","../src/sync/docs-structure-repo.ts","../src/yjs/design-system-content/documentation-hierarchy.ts","../src/yjs/version-room/base.ts","../src/yjs/version-room/compute-dto.ts","../src/yjs/version-room/utils.ts","../src/yjs/version-room/frontend.ts","../src/yjs/design-system-content/item-configuration.ts","../src/yjs/docs-editor/model/block.ts","../src/yjs/docs-editor/model/page.ts","../src/yjs/docs-editor/prosemirror/inner-editor-schema.ts","../src/yjs/docs-editor/prosemirror/main-editor-schema.ts","../src/yjs/docs-editor/blocks-to-prosemirror.ts","../src/yjs/docs-editor/utils.ts","../src/yjs/docs-editor/list-tree-builder.ts","../src/yjs/docs-editor/mock.ts","../src/yjs/docs-editor/prosemirror-to-blocks.ts","../src/yjs/version-room/backend.ts","../src/sync/local-action-executor.ts"],"names":["z","GitProviderNames","rest","RoomTypeEnum","OAuthProviderNames","ObjectMeta","PrimitiveValue","ArrayValue","ObjectValue","SuccessPayload","CODE_NAME_REGEX","ParsedFigmaFileURLError","blocks","mapByUnique"],"mappings":"AAAA,qxBAAI,UAAU,EAAE,MAAM,CAAC,cAAc;AACrC,IAAI,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK;AAC/J,IAAI,cAAc,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,eAAe,CAAC,GAAG,EAAE,OAAO,IAAI,IAAI,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC;AAC9G;AACA;ACJA,oEAAkB;ACAlB;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACIA;ACJA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA,kGAAkC;ACAlC;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACIA;ACJA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA;ACAA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ACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACF;AAEmC;A0JjnBV;AzJCkB;AACA;AACF;AACGA;AAEpB;AAEc;AACpB,EAAA;AACjB;AAEY;AACE,EAAA;AACE,EAAA;AACE,EAAA;AAClB;AAE0C;A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A;AACF,IAAA;AACK,IAAA;AACM,MAAA;AACX,IAAA;AACW,IAAA;AACF,MAAA;AACC,MAAA;AACI,MAAA;AACF,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACG,MAAA;AACT,IAAA;AACY,IAAA;AACD,MAAA;AACF,MAAA;AACG,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACA,MAAA;AACE,QAAA;AACI,UAAA;AACX,QAAA;AACM,QAAA;AACK,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACC,IAAA;AACO,MAAA;AACJ,MAAA;AACC,QAAA;AACK,UAAA;AACX,QAAA;AACQ,QAAA;AACG,UAAA;AACX,QAAA;AACK,QAAA;AACM,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACM,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AACQ,IAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AACQ,IAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACI,UAAA;AACb,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACM,MAAA;AACJ,MAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AACF;AAE4C;AzXkkVR;AACA;A0XntVb;AAEF;AACV,EAAA;AACF,EAAA;AACM,IAAA;AACA,MAAA;AACF,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACgB,IAAA;AACP,MAAA;AACD,MAAA;AACK,MAAA;AACJ,MAAA;AACE,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACU,IAAA;AACG,MAAA;AACF,MAAA;AACC,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACO,IAAA;AACM,MAAA;AACF,MAAA;AACF,MAAA;AACI,MAAA;AACD,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACW,IAAA;AACE,MAAA;AACF,MAAA;AACE,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACU,QAAA;AACC,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACA,MAAA;AACF,MAAA;AACE,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACU,QAAA;AACC,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACgB,IAAA;AACL,MAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACD,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACW,IAAA;AACF,MAAA;AACC,MAAA;AACI,MAAA;AACF,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACG,MAAA;AACT,IAAA;AACS,IAAA;AACE,MAAA;AACF,MAAA;AACG,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACA,QAAA;AACO,UAAA;AACE,UAAA;AACE,YAAA;AACO,YAAA;AACH,YAAA;AACb,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA;AACU,IAAA;AACC,MAAA;AACC,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACY,IAAA;AACD,MAAA;AACF,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACgB,IAAA;AACP,MAAA;AACA,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACY,IAAA;AACD,MAAA;AACF,MAAA;AACI,MAAA;AACD,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACc,IAAA;AACH,MAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACE,UAAA;AACgB,YAAA;AACvB,UAAA;AACF,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACa,IAAA;AACF,MAAA;AACF,MAAA;AACD,MAAA;AACM,MAAA;AACD,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACmB,IAAA;AACR,MAAA;AACF,MAAA;AACD,MAAA;AACM,MAAA;AACD,MAAA;AACA,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACK,IAAA;AACM,MAAA;AACX,IAAA;AACS,IAAA;AACE,MAAA;AACF,MAAA;AACI,MAAA;AACD,MAAA;AACH,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACM,QAAA;AACK,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACO,IAAA;AACE,MAAA;AACD,MAAA;AACK,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACY,QAAA;AACD,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACW,IAAA;AACF,MAAA;AACD,MAAA;AACK,MAAA;AACJ,MAAA;AACD,QAAA;AACO,UAAA;AACX,QAAA;AACc,QAAA;AACH,UAAA;AACX,QAAA;AACW,QAAA;AACA,UAAA;AACX,QAAA;AACY,QAAA;AACD,UAAA;AACX,QAAA;AACS,QAAA;AACE,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACC,IAAA;AACO,MAAA;AACJ,MAAA;AACC,QAAA;AACK,UAAA;AACX,QAAA;AACQ,QAAA;AACG,UAAA;AACX,QAAA;AACK,QAAA;AACM,UAAA;AACX,QAAA;AACO,QAAA;AACI,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACkB,IAAA;AACT,MAAA;AACQ,QAAA;AACF,UAAA;AACX,QAAA;AACU,QAAA;AACC,UAAA;AACX,QAAA;AACF,MAAA;AACU,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACF,MAAA;AACF,IAAA;AACM,IAAA;AACM,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AACQ,IAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACS,UAAA;AACT,QAAA;AACF,MAAA;AACF,IAAA;AACQ,IAAA;AACI,MAAA;AACR,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAAA;AACO,UAAA;AACP,QAAA;AACA,QAA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;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACM,YAAA;AACE,YAAA;AACjB,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACW,YAAA;AACJ,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;A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AA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACF,UAAA;AAChB,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACF,UAAA;AAChB,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACI,YAAA;AACR,cAAA;AACA,cAAA;AACA,cAAA;AACF,YAAA;AACa,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACF,UAAA;AAChB,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACkB,MAAA;AAC9B,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AAER,QAAA;AACJ,MAAA;AACc,MAAA;AAChB,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACyB,IAAA;AACzB,IAAA;AAC0B,MAAA;AACJ,MAAA;AAChB,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACc,YAAA;AAC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;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AAC8B,IAAA;AACf,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACwB,IAAA;AACxB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACO,YAAA;AACD,YAAA;AACE,YAAA;AACC,YAAA;AAClB,UAAA;AACgB,UAAA;AACF,YAAA;AACM,cAAA;AACD,cAAA;AACF,cAAA;AACf,YAAA;AACF,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACY,YAAA;AACL,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACY,YAAA;AACL,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACH,MAAA;AACU,QAAA;AACH,QAAA;AACd,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO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,UAAA;AACC,UAAA;AACM,UAAA;AACa,UAAA;AACd,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACa,UAAA;AACd,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AAC8B,IAAA;AACf,IAAA;AACD,MAAA;AACA,QAAA;AAER,QAAA;AACJ,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACoB,IAAA;AACpB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACI,UAAA;AACZ,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACa,YAAA;AACN,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACa,YAAA;AACN,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACJ,UAAA;AACV,YAAA;AACF,UAAA;AACF,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACa,YAAA;AACN,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACJ,UAAA;AACV,YAAA;AACF,UAAA;AACF,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;A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A;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACA,QAAA;AACM,UAAA;AACE,UAAA;AACC,UAAA;AACM,UAAA;AACL,UAAA;AACA,YAAA;AACK,YAAA;AACE,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACA,MAAA;AACO,QAAA;AACF,QAAA;AACf,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AAER,QAAA;AACJ,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACuB,IAAA;AACvB,IAAA;AACQ,MAAA;AACV,QAAA;AACM,UAAA;AACE,UAAA;AACA,UAAA;AACG,UAAA;AACS,YAAA;AAChB,YAAA;AACF,UAAA;AACF,QAAA;AACF,MAAA;AACY,MAAA;AACE,QAAA;AACG,QAAA;AACjB,MAAA;AACU,MAAA;AACR,QAAA;AACM,UAAA;AACE,UAAA;AACE,UAAA;AACA,YAAA;AACK,YAAA;AACE,YAAA;AACG,YAAA;AACX,YAAA;AACP,UAAA;AACY,UAAA;AACI,UAAA;AACH,UAAA;AACf,QAAA;AACF,MAAA;AACmB,MAAA;AACrB,IAAA;AACU,IAAA;AACE,MAAA;AACA,MAAA;AACO,QAAA;AACF,QAAA;AACf,MAAA;AACF,IAAA;AACe,IAAA;AACD,MAAA;AACA,QAAA;AACS,QAAA;AACrB,MAAA;AACF,IAAA;AACY,IAAA;AACE,MAAA;AACG,MAAA;AACf,MAAA;AACyB,MAAA;AAC3B,IAAA;AACF,EAAA;AACA,EAAA;AACM,IAAA;AACE,IAAA;AACO,IAAA;AACH,IAAA;AACJ,IAAA;AACoB,IAAA;AACp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,IAAA;AAGiB,IAAA;AAClB,EAAA;AAEgC,EAAA;AACF,IAAA;AAC9B,EAAA;AAEU,EAAA;AACkB,IAAA;AAC5B,EAAA;AAEQ,EAAA;AACW,IAAA;AACnB,EAAA;AACF;AhXiheoC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/backend/backend/packages/client/dist/index.js","sourcesContent":[null,"import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../helpers\";\n\nconst AssetDeleteScheduleStatus = z.enum([\"InProgress\", \"Pending\"]);\nexport type AssetDeleteScheduleStatus = z.infer<typeof AssetDeleteScheduleStatus>;\n\n\nexport const AssetDeleteSchedule = z.object({\n id: z.string(),\n path: z.string(),\n createdAt: z.date(),\n deleteAt: z.date(),\n isFolder: z.boolean(),\n status: AssetDeleteScheduleStatus,\n});\n\nexport type AssetDeleteSchedule = z.infer<typeof AssetDeleteSchedule>;\n\nexport type AssetDeleteScheduleDbInput = DbCreateInputOmit<AssetDeleteSchedule>;\n\n","import { z } from \"zod\";\n\nexport const PluginOAuthRequestSchema = z.object({\n id: z.string(),\n codeChallenge: z.string(),\n readKey: z.string(),\n writeKey: z.string(),\n readKeyConsumed: z.boolean(),\n writeKeyConsumed: z.boolean(),\n oAuthCode: z.string().optional(),\n createdAt: z.coerce.date(),\n});\n\nexport type PluginOAuthRequest = z.infer<typeof PluginOAuthRequestSchema>;\n","import { z } from \"zod\";\n\nexport const AuthV2Request = z.object({\n code: z.string().optional(),\n state: z.string(),\n codeChallenge: z.string(),\n codeChallengeMethod: z.string(),\n redirectUri: z.string(),\n sessionId: z.string(),\n});\n\nexport type AuthV2Request = z.infer<typeof AuthV2Request>;\n","import { z } from \"zod\";\n\nexport const AuthV2Session = z.object({\n id: z.string(),\n refreshToken: z.string(),\n expiresAt: z.coerce.date(),\n createdAt: z.coerce.date(),\n});\n\nexport type AuthV2Session = z.infer<typeof AuthV2Session>;\n","import { z } from \"zod\";\n\nexport const CardSchema = z.object({\n cardId: z.string().nullish(),\n last4: z.string().length(4).nullish(),\n expiryMonth: z.string().nullish(),\n expiryYear: z.string().nullish(),\n brand: z.string().nullish(),\n name: z.string().nullish(),\n});\n\nexport type Card = z.infer<typeof CardSchema>;\n","import { z } from \"zod\";\n\nexport const PostStripeCheckoutBodyInputSchema = z.object({\n priceId: z.string(),\n successUrl: z.string().url(),\n cancelUrl: z.string().url(),\n quantity: z.number().int().min(1).optional(),\n});\n\nexport const PostStripeCheckoutOutputSchema = z.object({\n id: z.string(),\n url: z.string().nullish(),\n});\n\nexport type StripeCheckoutInput = z.infer<typeof PostStripeCheckoutBodyInputSchema>;\nexport type StripeCheckoutOutput = z.infer<typeof PostStripeCheckoutOutputSchema>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../helpers\";\n\nexport const Customer = z.object({\n id: z.string(),\n});\n\nexport const Address = z.object({\n street1: nullishToOptional(z.string()),\n street2: nullishToOptional(z.string()),\n city: nullishToOptional(z.string()),\n postal: nullishToOptional(z.string()),\n country: nullishToOptional(z.string()),\n state: nullishToOptional(z.string()),\n});\n\nexport const BillingDetails = z.object({\n address: nullishToOptional(Address),\n email: nullishToOptional(z.string()),\n companyName: nullishToOptional(z.string()),\n companyId: nullishToOptional(z.string()),\n notes: nullishToOptional(z.string()),\n vat: nullishToOptional(z.string()),\n poNumber: nullishToOptional(z.string()),\n});\n\nexport type Customer = z.infer<typeof Customer>;\nexport type Address = z.infer<typeof Address>;\nexport type BillingDetails = z.infer<typeof BillingDetails>;\n","import { z } from \"zod\";\n\nconst featureLimitedSchema = z.object({\n max: z.number().optional(),\n errorMessage: z.string(),\n errorReason: z.string(),\n});\n\nconst featureToggleSchema = z.object({\n enabled: z.boolean(),\n errorMessage: z.string(),\n errorReason: z.string(),\n});\n\nconst featureWithImportJobsSchema = featureLimitedSchema.extend({\n noImportJobsErrorMessage: z.string(),\n noImportJobsErrorReason: z.string(),\n});\n\nexport const FeaturesSummary = z.object({\n designSystems: featureLimitedSchema,\n designSystemSources: featureWithImportJobsSchema,\n designSystemVersions: featureLimitedSchema,\n themes: featureLimitedSchema,\n brands: featureLimitedSchema,\n codegenSchedules: featureLimitedSchema,\n publicDocumentation: featureToggleSchema,\n customDocumentationUrl: featureToggleSchema,\n customDocumentationViewButton: featureToggleSchema,\n designSystemSourceAutoImport: featureToggleSchema,\n designSystemSlug: featureToggleSchema,\n ipWhitelisting: featureToggleSchema,\n npmRegistry: featureToggleSchema,\n sso: featureToggleSchema,\n workspacePaidSeats: featureLimitedSchema,\n workspaceViewers: featureLimitedSchema,\n customDocumentationExporter: featureToggleSchema,\n protectedPages: featureToggleSchema,\n approvals: featureToggleSchema,\n selectivePublishing: featureToggleSchema,\n designSystemAccessModes: featureToggleSchema,\n designSystemRoles: featureToggleSchema,\n documentationPageRedirects: featureToggleSchema,\n analytics: featureLimitedSchema,\n designSystemFileSize: featureLimitedSchema,\n});\n\nexport type FeatureLimitedDetails = z.infer<typeof featureLimitedSchema>;\nexport type FeatureToggleDetails = z.infer<typeof featureToggleSchema>;\nexport type FeatureWithImportJobsDetails = z.infer<typeof featureWithImportJobsSchema>;\nexport type FeaturesSummary = z.infer<typeof FeaturesSummary>;\n","import { z } from \"zod\";\nimport { CardSchema } from \"./card\";\n\nexport const InvoiceSchema = z.object({\n id: z.string(),\n number: z.string(),\n amount_due: z.number(),\n date: z.coerce.date(),\n hostedUrl: z.string().url(),\n card: CardSchema.nullish(),\n});\n\nexport const PeriodSchema = z.object({\n start: z.coerce.date(),\n end: z.coerce.date(),\n});\n\nexport const InvoiceLineSchema = z.object({\n amount: z.number(),\n period: PeriodSchema,\n proration: z.boolean(),\n description: z.string(),\n type: z.string(),\n});\n\nexport const InvoiceCouponSchema = z.object({\n amount_off: z.number(),\n percent_off: z.number(),\n name: z.string(),\n});\n\nexport type Invoice = z.infer<typeof InvoiceSchema>;\nexport type InvoiceLine = z.infer<typeof InvoiceLineSchema>;\nexport type InvoiceCoupon = z.infer<typeof InvoiceCouponSchema>;\n","import { z } from \"zod\";\n\nexport const PostStripePortalUpdateSessionBodyInputSchema = z.object({\n priceId: z.string(),\n numberOfSeats: z.number().int(),\n});\nexport const PostStripePortalSessionBodyInputSchema = z.object({\n returnUrl: z.string().url(),\n update: PostStripePortalUpdateSessionBodyInputSchema.optional(),\n cancel: z.boolean().optional(),\n});\n\nexport const PostStripePortalSessionOutputSchema = z.object({\n id: z.string(),\n url: z.string().nullish(),\n});\n\nexport type StripePortalSessionInput = z.infer<typeof PostStripePortalSessionBodyInputSchema>;\nexport type StripePortalSessionOutput = z.infer<typeof PostStripePortalSessionOutputSchema>;\n","import { z } from \"zod\";\n\nexport const BillingIntervalSchema = z.enum([\"daily\", \"monthly\", \"weekly\", \"yearly\"]);\n\nexport const PriceSchema = z.object({\n stripePriceId: z.string(),\n stripeProductId: z.string(),\n stripeProductName: z.string().optional(),\n stripeProductDescription: z.string().optional(),\n active: z.boolean(),\n amount: z.number(),\n interval: BillingIntervalSchema,\n isPricePerCreator: z.boolean().optional(),\n isTrial: z.boolean().optional(),\n isHidden: z.boolean().optional(),\n minimumSeats: z.number().optional(),\n legacyVersion: z.string().optional(),\n featuresSet: z.string().optional(),\n stripeProductFeatures: z.array(z.string()).optional(),\n stripeProductAdditionalFeatures: z.array(z.string()).optional(),\n});\n\nexport type BillingInterval = z.infer<typeof BillingIntervalSchema>;\nexport type Price = z.infer<typeof PriceSchema>;\n","import { z } from \"zod\";\n\nexport const ProductCodeSchema = z.enum([\"free\", \"team\", \"company\", \"enterprise\"]);\nexport type ProductCode = z.infer<typeof ProductCodeSchema>;\nexport const ProductCode = ProductCodeSchema.enum;\n","import { CardSchema } from \"./card\";\nimport { ProductCodeSchema } from \"./product\";\nimport { FeaturesSummary } from \"./features\";\nimport { BillingIntervalSchema } from \"./price\";\nimport { z } from \"zod\";\nexport const StripeSubscriptionStatusSchema = z.enum([\n \"trialing\",\n \"active\",\n \"past_due\",\n \"canceled\",\n \"unpaid\",\n \"incomplete_expired\",\n \"incomplete\",\n \"unknown\",\n]);\n\nexport const InternalStatusSchema = z.enum([\"active\", \"suspended\", \"gracePeriod\", \"cancelled\", \"downgraded_to_free\"]);\n\nexport const BillingTypeSchema = z.enum([\"Auto\", \"Invoice\"]);\n\nexport type StripeSubscriptionStatus = z.infer<typeof StripeSubscriptionStatusSchema>;\nexport type InternalStatus = z.infer<typeof InternalStatusSchema>;\nexport type BillingType = z.infer<typeof BillingTypeSchema>;\n\nexport const StripeSubscriptionStatus = StripeSubscriptionStatusSchema.enum;\nexport const InternalStatus = InternalStatusSchema.enum;\nexport const BillingType = BillingTypeSchema.enum;\n\nexport const Subscription = z.object({\n stripeSubscriptionId: z.string().nullish(),\n stripeCustomerId: z.string().nullish(),\n\n status: InternalStatusSchema.optional(),\n subscriptionStatus: StripeSubscriptionStatusSchema.optional(), // the stripe API official status\n internalStatus: InternalStatusSchema.optional(), // TODO: delete when create/get workspace will stop using it in the former API\n\n product: ProductCodeSchema,\n featuresSummary: FeaturesSummary.optional(),\n stripeProductDescription: z.string().optional(),\n stripeProductFeatures: z.array(z.string()).optional(),\n stripeProductAdditionalFeatures: z.array(z.string()).optional(),\n stripeSubscriptionMainItemId: z.string().optional(),\n planPriceId: z.string(),\n planInterval: BillingIntervalSchema,\n isPricePerCreator: z.boolean().optional(),\n legacyVersion: z.string().optional(),\n\n seats: z.number(),\n seatLimit: z.number(),\n\n currentPeriodStart: z.string().optional(),\n currentPeriodEnd: z.string().optional(),\n subscriptionStatusUpdatedAt: z.string().optional(),\n cancelAt: z.string().nullish(),\n\n card: CardSchema.optional(),\n\n // New\n amount: z.number().nullish(),\n isTrial: z.boolean().optional(),\n billingType: BillingTypeSchema.optional(),\n daysUntilDue: z.number().optional(),\n});\n\nexport type Subscription = z.infer<typeof Subscription>;\n","import { z } from \"zod\";\n\n/**\n * Base ChatMessage schema and ChatMessageSenderType enum\n * Used by message-related endpoints\n */\nexport const ForgeChatMessageSenderType = z.enum([\"User\", \"Agent\"]);\nexport type ForgeChatMessageSenderType = z.infer<typeof ForgeChatMessageSenderType>;\n\nexport const ForgeChatMessageSender = z.discriminatedUnion(\"type\", [\n z.object({ type: z.literal(ForgeChatMessageSenderType.Values.User), userId: z.string() }),\n z.object({ type: z.literal(ForgeChatMessageSenderType.Values.Agent), persona: z.literal(\"Amy\") }),\n]);\n\nexport const ForgeChatMessage = z.object({\n id: z.string(),\n threadId: z.string(),\n payload: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n sender: ForgeChatMessageSender,\n});\n\nexport type ForgeChatMessageSender = z.infer<typeof ForgeChatMessageSender>;\nexport type ForgeChatMessage = z.infer<typeof ForgeChatMessage>;\n","import { z } from \"zod\";\n\n/**\n * Base ChatThread schema used across multiple endpoints\n * Also used for DELETE /api/v1/workspaces/{wsId}/chat-threads/{threadId}\n * (DELETE endpoint returns { ok: boolean } but references this model)\n */\nexport const ForgeChatThread = z.object({\n id: z.string(),\n title: z.string(),\n workspaceId: z.string(),\n userId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type ForgeChatThread = z.infer<typeof ForgeChatThread>;\n","import { z } from \"zod\";\n\nexport const Entity = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type Entity = z.infer<typeof Entity>;\n","import { z } from \"zod\";\n\nexport const ObjectMeta = z.object({\n name: z.string(),\n description: z.string().optional(),\n});\n\nexport type ObjectMeta = z.infer<typeof ObjectMeta>;\n","import { z } from \"zod\";\n\nexport type CustomDomainState =\n | \"Initial\"\n | \"DomainSetupInProgress\"\n | \"DomainSetupFailed\"\n | \"DomainSetupSuccess\"\n | \"SSLSetupInProgress\"\n | \"SSLSetupFailed\"\n | \"SSLSetupSuccess\";\n\nexport const CustomDomain = z.object({\n id: z.string(),\n designSystemId: z.string(),\n state: z.string(),\n\n supernovaDomain: z.string(),\n customerDomain: z.string().nullish(),\n\n error: z.string().nullish(),\n errorCode: z.string().nullish(),\n});\n\nexport type CustomDomain = z.infer<typeof CustomDomain>;\n","import { z } from \"zod\";\nimport { Exporter } from \"../export/exporter\";\nimport { Pipeline } from \"../export/pipeline\";\n\nexport const ExportJobDump = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n finishedAt: z.coerce.date(),\n exportArtefacts: z.string(),\n});\n\nexport const CodeIntegrationDump = z.object({\n exporters: Exporter.array(),\n pipelines: Pipeline.array(),\n exportJobs: ExportJobDump.array(),\n});\n\nexport type ExportJobDump = z.infer<typeof ExportJobDump>;\nexport type CodeIntegrationDump = z.infer<typeof CodeIntegrationDump>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../helpers\";\nimport { GitProvider } from \"./git-providers\";\nimport { PulsarContributionConfigurationProperty, PulsarContributionVariant, PulsarCustomBlock } from \"./pulsar\";\nimport { ExporterPropertyDefinition } from \"./export-configuration\";\n\nexport const ExporterType = z.enum([\"code\", \"documentation\"]);\nexport const ExporterSource = z.enum([\"git\", \"upload\"]);\nexport const ExporterTag = z.string();\n\nexport const ExporterPulsarDetails = z.object({\n description: z.string(),\n version: z.string(),\n routingVersion: nullishToOptional(z.string()),\n author: nullishToOptional(z.string()),\n organization: nullishToOptional(z.string()),\n homepage: nullishToOptional(z.string()),\n readme: nullishToOptional(z.string()),\n tags: nullishToOptional(z.array(ExporterTag)).default([]),\n packageId: nullishToOptional(z.string().max(255)),\n\n iconURL: nullishToOptional(z.string()),\n configurationProperties: nullishToOptional(z.array(PulsarContributionConfigurationProperty)).default([]),\n customBlocks: nullishToOptional(z.array(PulsarCustomBlock)).default([]),\n blockVariants: nullishToOptional(z.record(z.string(), z.array(PulsarContributionVariant))).default({}),\n properties: nullishToOptional(ExporterPropertyDefinition.array()),\n\n usesBrands: nullishToOptional(z.boolean()).default(false),\n usesThemes: nullishToOptional(z.boolean()).default(false),\n usesLocale: nullishToOptional(z.boolean()).default(false),\n});\n\nexport const ExporterDetails = ExporterPulsarDetails.extend({\n source: ExporterSource,\n\n gitProvider: nullishToOptional(GitProvider),\n gitUrl: nullishToOptional(z.string()),\n gitBranch: nullishToOptional(z.string()),\n gitDirectory: nullishToOptional(z.string()),\n});\n\nexport const Exporter = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n name: z.string(),\n isPrivate: z.boolean(),\n details: ExporterDetails,\n exporterType: nullishToOptional(ExporterType).default(\"code\"),\n storagePath: nullishToOptional(z.string()).default(\"\"),\n properties: nullishToOptional(ExporterPropertyDefinition.array()),\n isDeprecated: z.boolean().default(false),\n deprecationNote: nullishToOptional(z.string()),\n replacementExporterId: nullishToOptional(z.string()),\n});\n\nexport type ExporterType = z.infer<typeof ExporterType>;\nexport type ExporterSource = z.infer<typeof ExporterSource>;\nexport type ExporterTag = z.infer<typeof ExporterTag>;\nexport type ExporterPulsarDetails = z.infer<typeof ExporterPulsarDetails>;\nexport type ExporterDetails = z.infer<typeof ExporterDetails>;\nexport type Exporter = z.infer<typeof Exporter>;\n","import { z } from \"zod\";\n\nexport enum GitProviderNames {\n Azure = \"azure\",\n Github = \"github\",\n Gitlab = \"gitlab\",\n Bitbucket = \"bitbucket\",\n}\n\nexport const GitProvider = z.nativeEnum(GitProviderNames);\nexport type GitProvider = z.infer<typeof GitProvider>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../helpers\";\n\n//\n// Base\n//\n\nexport const PulsarPropertyType = z.enum([\n \"string\",\n \"number\",\n \"boolean\",\n \"image\",\n \"enum\",\n \"color\",\n \"typography\",\n \"component\",\n \"componentProperties\",\n \"tokenProperties\",\n \"tokenType\",\n]);\n\nexport const PulsarBaseProperty = z.object({\n label: z.string(),\n key: z.string(),\n description: z.string().nullish(),\n type: PulsarPropertyType,\n values: z.array(z.string()).nullish(),\n default: z.union([z.string(), z.boolean(), z.number()]).nullish(), // PulsarPropertyValueType //is optional?\n inputType: z.enum([\"code\", \"plain\"]).optional(), //is optional?\n isMultiline: z.boolean().nullish(),\n});\n\n//\n// Exporter custom properties\n//\n\nexport const PulsarContributionConfigurationProperty = PulsarBaseProperty.extend({\n category: z.string(),\n});\n\n//\n// Exporter custom blocks\n//\n\nexport const PulsarContributionVariant = z.object({\n key: z.string(),\n name: z.string(),\n isDefault: nullishToOptional(z.boolean()),\n description: nullishToOptional(z.string()),\n thumbnailURL: nullishToOptional(z.string()),\n});\n\nexport const PulsarCustomBlock = z.object({\n title: nullishToOptional(z.string()),\n key: z.string(),\n category: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n iconURL: nullishToOptional(z.string()),\n mode: nullishToOptional(z.enum([\"array\", \"block\"])),\n properties: nullishToOptional(z.array(PulsarBaseProperty)).transform(v => v ?? []),\n});\n\n//\n// Types\n//\n\nexport type PulsarContributionVariant = z.infer<typeof PulsarContributionVariant>;\nexport type PulsarPropertyType = z.infer<typeof PulsarPropertyType>;\nexport type PulsarBaseProperty = z.infer<typeof PulsarBaseProperty>;\nexport type PulsarCustomBlock = z.infer<typeof PulsarCustomBlock>;\nexport type PulsarContributionConfigurationProperty = z.infer<typeof PulsarContributionConfigurationProperty>;\n","import { z } from \"zod\";\n\n//\n// Primitives\n//\n\nconst PrimitiveValue = z.number().or(z.boolean()).or(z.string());\nconst ArrayValue = z.array(z.string());\nconst ObjectValue = z.record(z.string());\n\nexport const ExporterPropertyValue = PrimitiveValue.or(ArrayValue).or(ObjectValue);\nexport const ExporterPropertyType = z.enum([\"Enum\", \"Boolean\", \"String\", \"Number\", \"Array\", \"Object\", \"Code\"]);\n\nexport type ExporterPropertyDefinitionValue = z.infer<typeof ExporterPropertyValue>;\nexport type ExporterPropertyType = z.infer<typeof ExporterPropertyType>;\n\n//\n// Property\n//\n\nconst PropertyDefinitionBase = z.object({\n key: z.string(),\n title: z.string(),\n description: z.string(),\n category: z.string().optional(),\n dependsOn: z.record(z.boolean()).optional(),\n});\n\nexport const ExporterPropertyDefinitionEnumOption = z.object({\n label: z.string(),\n description: z.string(),\n});\n\nexport const ExporterPropertyDefinitionEnum = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Enum),\n options: z.record(ExporterPropertyDefinitionEnumOption),\n default: z.string(),\n});\n\nexport const ExporterPropertyDefinitionBoolean = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Boolean),\n default: z.boolean(),\n});\n\nexport const ExporterPropertyDefinitionString = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.String),\n default: z.string(),\n isMultiline: z.boolean().optional(),\n});\n\nexport const ExporterPropertyDefinitionNumber = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Number),\n default: z.number(),\n});\n\nexport const ExporterPropertyDefinitionArray = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Array),\n default: ArrayValue,\n});\n\nexport const ExporterPropertyDefinitionObject = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Object),\n default: ObjectValue,\n allowedKeys: z\n .object({\n options: z.string().array(),\n type: z.string(),\n })\n .optional(),\n allowedValues: z\n .object({\n type: z.string(),\n })\n .optional(),\n});\n\nexport const ExporterPropertyDefinitionCode = PropertyDefinitionBase.extend({\n type: z.literal(ExporterPropertyType.Enum.Code),\n default: z.string(),\n language: z.string(),\n});\n\nexport const ExporterPropertyDefinition = z.discriminatedUnion(\"type\", [\n ExporterPropertyDefinitionEnum,\n ExporterPropertyDefinitionBoolean,\n ExporterPropertyDefinitionString,\n ExporterPropertyDefinitionNumber,\n ExporterPropertyDefinitionArray,\n ExporterPropertyDefinitionObject,\n ExporterPropertyDefinitionCode,\n]);\n\nexport type ExporterPropertyDefinitionEnum = z.infer<typeof ExporterPropertyDefinitionEnum>;\nexport type ExporterPropertyDefinitionBoolean = z.infer<typeof ExporterPropertyDefinitionBoolean>;\nexport type ExporterPropertyDefinitionString = z.infer<typeof ExporterPropertyDefinitionString>;\nexport type ExporterPropertyDefinitionNumber = z.infer<typeof ExporterPropertyDefinitionNumber>;\nexport type ExporterPropertyDefinitionArray = z.infer<typeof ExporterPropertyDefinitionArray>;\nexport type ExporterPropertyDefinitionObject = z.infer<typeof ExporterPropertyDefinitionObject>;\nexport type ExporterPropertyDefinition = z.infer<typeof ExporterPropertyDefinition>;\nexport type ExporterPropertyDefinitionEnumOption = z.infer<typeof ExporterPropertyDefinitionEnumOption>;\n\n//\n// Value\n//\n\nexport const ExporterPropertyValueMap = z.record(ExporterPropertyValue);\nexport type ExporterPropertyValueMap = z.infer<typeof ExporterPropertyValueMap>;\n","import { z } from \"zod\";\nimport { ExporterPropertyValueMap } from \"./export-configuration\";\nimport { ExportDestinationsMap } from \"./export-destinations\";\n\nexport const PipelineEventType = z.enum([\n \"OnVersionReleased\",\n \"OnHeadChanged\",\n \"OnSourceUpdated\",\n \"OnDocumentationPublished\",\n \"None\",\n]);\n\nexport const PipelineDestinationGitType = z.enum([\"Github\", \"Gitlab\", \"Bitbucket\", \"Azure\"]);\nexport const PipelineDestinationExtraType = z.enum([\"WebhookUrl\", \"S3\", \"Documentation\"]);\nexport const PipelineDestinationType = z.union([PipelineDestinationGitType, PipelineDestinationExtraType]);\n\nexport const Pipeline = z.object({\n id: z.string(),\n\n name: z.string(),\n eventType: PipelineEventType,\n isEnabled: z.boolean(),\n\n workspaceId: z.string(),\n designSystemId: z.string(),\n exporterId: z.string(),\n\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n exporterPropertyValues: ExporterPropertyValueMap.optional(),\n\n isExporterDeprecated: z.boolean(),\n\n // Destinations\n ...ExportDestinationsMap.shape,\n});\n\nexport type PipelineEventType = z.infer<typeof PipelineEventType>;\nexport type PipelineDestinationGitType = z.infer<typeof PipelineDestinationGitType>;\nexport type PipelineDestinationExtraType = z.infer<typeof PipelineDestinationExtraType>;\nexport type PipelineDestinationType = z.infer<typeof PipelineDestinationType>;\n\nexport type Pipeline = z.infer<typeof Pipeline>;\n","import { z } from \"zod\";\nimport { PublishedDocEnvironment } from \"../dsm\";\nimport { nullishToOptional } from \"../helpers\";\n\nconst BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;\nconst BITBUCKET_MAX_LENGTH = 64;\n\nexport const ExportJobDocumentationChanges = z.object({\n pagePersistentIds: z.string().array(),\n groupPersistentIds: z.string().array(),\n});\n\nexport const ExporterDestinationDocs = z.object({\n environment: PublishedDocEnvironment,\n changes: nullishToOptional(ExportJobDocumentationChanges),\n});\n\nexport const GitCommonDestinationOptions = z.object({\n branch: z.string(),\n relativePath: nullishToOptional(z.string()),\n purgeDirectory: nullishToOptional(z.boolean()),\n commitAuthorName: nullishToOptional(z.string()),\n commitAuthorEmail: nullishToOptional(z.string()),\n commitMessage: nullishToOptional(z.string()),\n pullRequestTitle: nullishToOptional(z.string()),\n pullRequestDescription: nullishToOptional(z.string()),\n});\n\nexport const ExporterDestinationS3 = z.object({});\n\nexport const ExporterDestinationGithub = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n url: z.string(),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExporterDestinationAzure = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n organizationId: z.string(),\n projectId: z.string(),\n repositoryId: z.string(),\n\n // Maybe not needed\n url: nullishToOptional(z.string()),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExporterDestinationGitlab = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n projectId: z.string(),\n\n // Maybe not needed\n url: nullishToOptional(z.string()),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExporterDestinationBitbucket = z\n .object({\n credentialId: z.string().optional(),\n\n // Repository\n workspaceSlug: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),\n projectKey: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),\n repoSlug: z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),\n\n url: nullishToOptional(z.string()),\n\n // Legacy deprecated fields. Use `credentialId` instead\n connectionId: nullishToOptional(z.string()),\n userId: nullishToOptional(z.number()),\n })\n .extend(GitCommonDestinationOptions.shape);\n\nexport const ExportDestinationsMap = z.object({\n webhookUrl: z.string().optional(),\n destinationSnDocs: ExporterDestinationDocs.optional(),\n destinationS3: ExporterDestinationS3.optional(),\n destinationGithub: ExporterDestinationGithub.optional(),\n destinationAzure: ExporterDestinationAzure.optional(),\n destinationGitlab: ExporterDestinationGitlab.optional(),\n destinationBitbucket: ExporterDestinationBitbucket.optional(),\n});\n\nexport const ExportDestinationsMapUpdate = z.object({\n webhookUrl: z.string().nullish(),\n destinationSnDocs: ExporterDestinationDocs.nullish(),\n destinationS3: ExporterDestinationS3.nullish(),\n destinationGithub: ExporterDestinationGithub.nullish(),\n destinationAzure: ExporterDestinationAzure.nullish(),\n destinationGitlab: ExporterDestinationGitlab.nullish(),\n destinationBitbucket: ExporterDestinationBitbucket.nullish(),\n});\n\nexport type ExportJobDocumentationChanges = z.infer<typeof ExportJobDocumentationChanges>;\nexport type ExporterDestinationDocs = z.infer<typeof ExporterDestinationDocs>;\nexport type ExporterDestinationS3 = z.infer<typeof ExporterDestinationS3>;\nexport type ExporterDestinationGithub = z.infer<typeof ExporterDestinationGithub>;\nexport type ExporterDestinationAzure = z.infer<typeof ExporterDestinationAzure>;\nexport type ExporterDestinationGitlab = z.infer<typeof ExporterDestinationGitlab>;\nexport type ExporterDestinationBitbucket = z.infer<typeof ExporterDestinationBitbucket>;\nexport type ExportDestinationsMap = z.infer<typeof ExportDestinationsMap>;\nexport type ExportDestinationsMapUpdate = z.infer<typeof ExportDestinationsMapUpdate>;\n","import { z } from \"zod\";\n\nexport const AssetDynamoRecord = z.object({\n path: z.string(),\n id: z.string(),\n designSystemId: z.string(),\n expiresAt: z.number(),\n});\n\nexport type AssetDynamoRecord = z.infer<typeof AssetDynamoRecord>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../../helpers\";\n\nexport const AssetReference = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n assetId: z.string(),\n persistentId: z.string(),\n});\n\nexport type AssetReference = z.infer<typeof AssetReference>;\n\nexport type CreateAssetReference = DbCreateInputOmit<AssetReference>;\n\nexport type AssetReferenceDiff = {\n toCreate: CreateAssetReference[];\n toDelete: string[];\n};\n","import { z } from \"zod\";\n\nexport const AssetValue = z.object({});\n","import { z } from \"zod\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const AssetType = z.enum([\"Image\", \"Font\", \"Generic\"]);\nexport const AssetScope = z.enum([\n \"DocumentationFrame\",\n \"ComponentThumbnail\",\n \"DesignSystem\",\n \"Documentation\",\n \"DocumentationEmbed\",\n]);\n\nexport const AssetFontProperties = z.object({\n family: z.string(),\n subfamily: z.string(),\n});\n\nexport const AssetProperties = z.union([\n z.object({\n fontProperties: z.array(AssetFontProperties),\n }),\n z.object({\n width: z.number(),\n height: z.number(),\n }),\n]);\n\nexport const AssetOrigin = z.object({\n originKey: z.string(),\n});\n\nexport const Asset = z.object({\n id: z.string(),\n designSystemId: z.string().nullish(),\n type: AssetType,\n originalFileName: z.string().nullish(),\n filePath: z.string(),\n scope: AssetScope,\n properties: AssetProperties.nullish(),\n originKey: z.string().optional(),\n createdAt: z.coerce.date().optional(),\n pendingUpload: z.boolean().optional(),\n size: z.number().int().positive().optional(),\n checksum: z.string().optional(),\n});\n\nexport const ResolvedAsset = Asset.extend({\n url: z.string(),\n});\n\nexport type AssetType = z.infer<typeof AssetType>;\nexport type AssetScope = z.infer<typeof AssetScope>;\nexport type AssetFontProperties = z.infer<typeof AssetFontProperties>;\nexport type AssetProperties = z.infer<typeof AssetProperties>;\nexport type AssetOrigin = z.infer<typeof AssetOrigin>;\nexport type Asset = z.infer<typeof Asset>;\nexport type ResolvedAsset = z.infer<typeof ResolvedAsset>;\n\nexport type ImportedAsset = OmitStrict<Asset, \"originKey\"> & {\n originKey: string;\n};\n\nexport function isImportedAsset(asset: Asset): asset is ImportedAsset {\n return !!asset.originKey;\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const CodeComponentResolvedTypeKind = z.enum([\n \"string\",\n \"number\",\n \"numberLiteral\",\n \"boolean\",\n \"booleanLiteral\",\n \"object\",\n \"function\",\n \"stringLiteral\",\n \"union\",\n \"slot\",\n \"null\",\n \"undefined\",\n \"any\",\n]);\n\nexport const CodeComponentResolvedType: z.ZodType = z.lazy(() =>\n z.object({\n kind: CodeComponentResolvedTypeKind,\n raw: z.string().optional(),\n types: z.array(CodeComponentResolvedType).optional(),\n isArray: z.boolean().optional(),\n })\n);\n\nexport const CodeComponentParentType = z.object({\n fileName: z.string(),\n name: z.string(),\n});\n\nexport const CodeComponentProperty = z.object({\n defaultValue: z.string().optional(),\n name: z.string(),\n required: z.boolean(),\n type: CodeComponentResolvedType,\n declarations: z.array(CodeComponentParentType).optional(),\n tags: z.record(z.string(), z.string()).optional(),\n description: z.string(),\n});\n\nexport const CodeComponent = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n exportName: z.string(),\n componentPath: z.string(),\n description: z.string(),\n properties: z.record(z.string(), CodeComponentProperty),\n tags: z.record(z.string(), z.string()).nullable(),\n});\n\nexport const CodeComponentUpsertResponse = z.object({\n created: z.number().nonnegative(),\n updated: z.number().nonnegative(),\n deleted: z.number().nonnegative(),\n});\n\nexport type CodeComponentResolvedType = z.infer<typeof CodeComponentResolvedType>;\nexport type CodeComponentParentType = z.infer<typeof CodeComponentParentType>;\nexport type CodeComponentProperty = z.infer<typeof CodeComponentProperty>;\nexport type CodeComponent = z.infer<typeof CodeComponent>;\n\nexport type CodeComponentCreate = DbCreateInputOmit<CodeComponent>;\nexport type CodeComponentUpdate = DbUpdate<CodeComponent>;\nexport type CodeComponentUpsert = OmitStrict<CodeComponentCreate, \"persistentId\" | \"designSystemVersionId\">;\nexport type CodeComponentUpsertResponse = z.infer<typeof CodeComponentUpsertResponse>;\n\n//\n// Analyze\n//\n\nexport const RegistryType = z.enum([\"Npm\", \"Github\", \"Artifactory\", \"Azure\", \"Custom\"]);\n\nexport const Registry = z.object({\n type: RegistryType,\n url: z.string().optional(),\n accessToken: z.string().optional(),\n scope: z.string(),\n authConfig: z.record(z.string()).optional(),\n});\n\nexport const DependencyDefinition = z.object({\n name: z.string(),\n version: z.string().optional(),\n});\n\nexport const AnalyzeCodeComponentsInPackage = z.object({\n designSystemId: z.string(),\n versionId: z.string(),\n mainPackage: DependencyDefinition,\n dependencies: z.array(DependencyDefinition).optional(),\n registries: Registry.array(),\n userAccessToken: z.string(),\n});\n\nexport type Registry = z.infer<typeof Registry>;\nexport type DependencyDefinition = z.infer<typeof DependencyDefinition>;\nexport type AnalyzeCodeComponentsInPackage = z.infer<typeof AnalyzeCodeComponentsInPackage>;\n","import { z } from \"zod\";\nimport { FigmaRenderFormat } from \"../import\";\n\nexport const AssetRenderConfiguration = z.object({\n prefix: z.string().optional(),\n suffix: z.string().optional(),\n scale: z.number(),\n format: FigmaRenderFormat,\n});\n\nexport const RenderedAssetFile = z.object({\n assetPersistentId: z.string(),\n assetName: z.string(),\n\n renderedImageFileName: z.string(),\n renderedImageUrl: z.string(),\n\n settings: AssetRenderConfiguration,\n});\n\nexport type AssetRenderConfiguration = z.infer<typeof AssetRenderConfiguration>;\nexport type RenderedAssetFile = z.infer<typeof RenderedAssetFile>;\n","import { z } from \"zod\";\n\nexport const FigmaFileDownloadScope = z.object({\n styles: z.boolean(),\n components: z.boolean(),\n componentSets: z.boolean(),\n currentVersion: z.literal(\"__latest__\").nullable(),\n publishedVersion: z.string().nullable(),\n downloadChunkSize: z.number().optional(),\n maxFileDepth: z.number().optional(),\n});\n\nexport const FigmaFileAccessData = z.object({\n accessToken: z.string(),\n accessTokenType: z.enum([\"OAuth2\", \"PAT\"]).default(\"OAuth2\"),\n});\n\nexport type FigmaFileDownloadScope = z.infer<typeof FigmaFileDownloadScope>;\nexport type FigmaFileAccessData = z.infer<typeof FigmaFileAccessData>;\n","import { z } from \"zod\";\nimport { DataSourceFigmaImportMetadata, DataSourceFigmaRemote } from \"../../data-sources\";\nimport { ImportWarning } from \"../warning\";\nimport { FigmaFileAccessData, FigmaFileDownloadScope } from \"./figma-files\";\n\n//\n// Importer payload\n//\n\nexport const ImportFunctionInput = z.object({\n importJobId: z.string(),\n importContextId: z.string(),\n designSystemId: z.string(),\n});\n\nexport type ImportFunctionInput = z.infer<typeof ImportFunctionInput>;\n\n//\n// Base context\n//\n\nexport const ImportedFigmaSourceData = z.object({\n sourceId: z.string(),\n figmaRemote: DataSourceFigmaRemote,\n});\n\nexport const FigmaImportBaseContext = z.object({\n designSystemId: z.string(),\n\n /**\n * Data required for accessing Figma files. This should contain access data for all file ids\n * mentioned in the `importedSourceDataBySourceId`\n *\n * fileId: file data\n */\n fileAccessByFileId: z.record(FigmaFileAccessData),\n\n /**\n * Figma source data for which import was requested\n *\n * sourceId: source data\n */\n importedSourceDataBySourceId: z.record(ImportedFigmaSourceData),\n\n /**\n * Array of warnings that will be written into the import result summary at the end\n * of import job execution and displayed by the client.\n */\n importWarnings: z.record(ImportWarning.array()).default({}),\n});\n\nexport type ImportedFigmaSourceData = z.infer<typeof ImportedFigmaSourceData>;\nexport type FigmaImportBaseContext = z.infer<typeof FigmaImportBaseContext>;\n\n//\n// Context with source state updates\n//\n\nexport const FeatureFlagsKeepAliases = z.object({\n isNonCompatibleTypeChangesEnabled: z.boolean().default(false),\n isTypographyUseFontStyleEnabled: z.boolean().default(false),\n});\nexport type FeatureFlagsKeepAliases = z.infer<typeof FeatureFlagsKeepAliases>;\n\nexport const FigmaImportContextWithSourcesState = FigmaImportBaseContext.extend({\n sourcesWithMissingAccess: z.array(z.string()).default([]),\n featureFlagsKeepAliases: FeatureFlagsKeepAliases.default({}),\n});\n\nexport type FigmaImportContextWithSourcesState = z.infer<typeof FigmaImportContextWithSourcesState>;\n\n//\n// Context with file download scope\n//\n\nexport const ChangedImportedFigmaSourceData = ImportedFigmaSourceData.extend({\n importMetadata: DataSourceFigmaImportMetadata,\n});\n\nexport const FigmaImportContextWithDownloadScopes = FigmaImportContextWithSourcesState.extend({\n /**\n * Describes what to download from each file, this should contain all file id mentioned in\n * importMetadataBySourceId.\n *\n * File id -> file download scope\n */\n fileDownloadScopesByFileId: z.record(FigmaFileDownloadScope),\n\n /**\n * Sources filtered down to the ones that have changed since last import and therefore need to be\n * imported again.\n *\n * Source id -> import metadata\n */\n changedImportedSourceDataBySourceId: z.record(ChangedImportedFigmaSourceData),\n});\n\nexport type ChangedImportedFigmaSourceData = z.infer<typeof ChangedImportedFigmaSourceData>;\nexport type FigmaImportContextWithDownloadScopes = z.infer<typeof FigmaImportContextWithDownloadScopes>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { ImportWarning } from \"../import/warning\";\nimport { SourceImportStorybookSummary, SourceImportSummary } from \"./import-summary\";\n\n//\n// Enums\n//\n\nexport const DataSourceRemoteType = z.enum([\"Figma\", \"TokenStudio\", \"FigmaVariablesPlugin\", \"Storybook\"]);\nexport const DataSourceUploadRemoteSource = z.enum([\"TokenStudio\", \"FigmaVariablesPlugin\", \"Custom\"]);\nexport const DataSourceFigmaState = z.enum([\"Active\", \"MissingIntegration\", \"MissingFileAccess\", \"MissingFileOwner\"]);\nexport const DataSourceAutoImportMode = z.enum([\"Never\", \"Hourly\"]);\n\nexport type DataSourceRemoteType = z.infer<typeof DataSourceRemoteType>;\nexport type DataSourceUploadRemoteSource = z.infer<typeof DataSourceUploadRemoteSource>;\nexport type DataSourceFigmaState = z.infer<typeof DataSourceFigmaState>;\nexport type DataSourceAutoImportMode = z.infer<typeof DataSourceAutoImportMode>;\n\n//\n// Aux\n//\n\nexport const DataSourceStats = z.object({\n tokens: zeroNumberByDefault(),\n components: zeroNumberByDefault(),\n assets: zeroNumberByDefault(),\n frames: zeroNumberByDefault(),\n});\n\nexport type DataSourceStats = z.infer<typeof DataSourceStats>;\n\n//\n// Figma\n//\n\nexport const DataSourceFigmaFileData = z.object({\n lastUpdatedAt: z.coerce.date(),\n});\n\nexport const DataSourceFigmaFileVersionData = z.object({\n id: z.string(),\n label: z.string().optional(),\n description: z.string().optional(),\n createdAt: z.coerce.date(),\n});\n\nexport const DataSourceFigmaScope = z.object({\n assets: z.boolean(),\n components: z.boolean(),\n documentationFrames: z.boolean(),\n tokens: z.boolean(),\n themePersistentId: z.string().optional(),\n isUnpublishedContentFallbackEnabled: z.boolean(),\n});\n\nexport const DataSourceFigmaImportMetadata = z.object({\n fileData: DataSourceFigmaFileData.optional(),\n importedPublishedVersion: DataSourceFigmaFileVersionData.optional(),\n});\n\nexport const DataSourceFigmaRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.Figma),\n fileId: z.string(),\n preferredCredentialId: z.string().optional(),\n ownerId: z.string(), // todo remove or keep to reference who created data source\n ownerName: z.string(), // todo probably remove\n scope: DataSourceFigmaScope,\n state: DataSourceFigmaState,\n requiresSync: z\n .boolean()\n .optional()\n .transform(v => v ?? false),\n lastImportMetadata: DataSourceFigmaImportMetadata.optional(),\n downloadChunkSize: z.number().optional(),\n figmaRenderChunkSize: z.number().optional(),\n maxFileDepth: z.number().optional(),\n});\n\nexport type DataSourceFigmaFileData = z.infer<typeof DataSourceFigmaFileData>;\nexport type DataSourceFigmaFileVersionData = z.infer<typeof DataSourceFigmaFileVersionData>;\nexport type DataSourceFigmaScope = z.infer<typeof DataSourceFigmaScope>;\nexport type DataSourceFigmaImportMetadata = z.infer<typeof DataSourceFigmaImportMetadata>;\nexport type DataSourceFigmaRemote = z.infer<typeof DataSourceFigmaRemote>;\n\n//\n// Token Studio\n//\n\nexport const DataSourceTokenStudioRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.TokenStudio),\n});\n\nexport type DataSourceTokenStudioRemote = z.infer<typeof DataSourceTokenStudioRemote>;\n\n//\n// Figma Variables Plugin\n//\n\nexport const DataSourceUploadImportMetadata = z.record(z.any());\n\nexport const DataSourceUploadRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),\n remoteId: z.string(),\n remoteSourceType: DataSourceUploadRemoteSource,\n lastImportMetadata: DataSourceUploadImportMetadata.optional(),\n warnings: nullishToOptional(ImportWarning.array()),\n isTokenTypeSplitEnabled: z.boolean(),\n isCollectionsMigrationCompleted: z.boolean(),\n});\n\nexport type DataSourceUploadImportMetadata = z.infer<typeof DataSourceUploadImportMetadata>;\nexport type DataSourceUploadRemote = z.infer<typeof DataSourceUploadRemote>;\n\n//\n// Storybook\n//\n\nexport const DataSourceStorybookRemote = z.object({\n type: z.literal(DataSourceRemoteType.Enum.Storybook),\n indexUrl: z.string(),\n userUrl: z.string(),\n ownerId: z.string().optional(),\n lastImportedAt: z.coerce.date().optional(),\n lastImportedSuccessfully: z.coerce.date().optional(),\n lastImportedResult: SourceImportStorybookSummary.optional(),\n isFailed: z.boolean(),\n storiesCount: z.number(),\n docsCount: z.number(),\n description: z.string().optional(),\n isUsingVpn: z.boolean().optional(),\n});\n\nexport type DataSourceStorybookRemote = z.infer<typeof DataSourceStorybookRemote>;\n\n//\n// Base\n//\n\nexport const DataSourceRemote = z.discriminatedUnion(\"type\", [\n DataSourceFigmaRemote,\n DataSourceUploadRemote,\n DataSourceTokenStudioRemote,\n DataSourceStorybookRemote,\n]);\n\nexport const DataSource = z.object({\n id: z.string(),\n\n name: z.string(),\n thumbnailUrl: z.string().optional(),\n\n createdAt: z.coerce.date().optional(),\n\n lastImportedAt: z.coerce.date().optional(),\n lastImportSummary: SourceImportSummary.optional(),\n\n designSystemId: z.string(),\n brandPersistentId: z.string(),\n autoImportMode: DataSourceAutoImportMode,\n stats: DataSourceStats,\n\n remote: DataSourceRemote,\n\n sortOrder: z.number(),\n});\n\nexport const DataSourceVersion = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n label: z.string().nullish(),\n description: z.string().nullish(),\n});\n\nexport type DataSourceVersion = z.infer<typeof DataSourceVersion>;\n\nexport type DataSourceRemote = z.infer<typeof DataSourceRemote>;\nexport type DataSource = z.infer<typeof DataSource>;\nexport type DataSourceOfType<T extends DataSourceRemoteType> = DataSource & {\n remote: Extract<DataSourceRemote, { type: T }>;\n};\n\nexport function isDataSourceOfType<T extends DataSourceRemoteType>(\n dataSource: DataSource,\n type: T\n): dataSource is DataSourceOfType<T> {\n return dataSource.remote.type === type;\n}\n\nexport type CreateDataSource = OmitStrict<DbCreateInputOmit<DataSource>, \"sortOrder\">;\nexport type UpdateDataSource = OmitStrict<DbUpdate<DataSource>, \"brandPersistentId\" | \"designSystemId\">;\n\nfunction zeroNumberByDefault() {\n return z\n .number()\n .nullish()\n .transform(v => v ?? 0);\n}\n","import { z } from \"zod\";\n\nexport const ImportWarningType = z.enum([\n \"NoVersionFound\",\n\n \"UnsupportedFill\",\n \"UnsupportedStroke\",\n \"UnsupportedEffect\",\n\n \"NoPublishedElements\",\n \"NoPublishedStyles\",\n \"NoPublishedComponents\",\n \"NoPublishedAssets\",\n\n \"StyleNotApplied\",\n\n \"ComponentHasNoThumbnail\",\n\n \"DuplicateImportedStyleId\",\n \"DuplicateImportedStylePath\",\n\n \"NoUnpublishedStyles\",\n\n \"ReferenceResolutionFailed\",\n]);\n\nexport const ImportWarning = z.object({\n warningType: ImportWarningType,\n componentId: z.string().optional(),\n componentName: z.string().optional(),\n styleId: z.string().optional(),\n styleName: z.string().optional(),\n unsupportedStyleValueType: z.string().optional(),\n referenceId: z.string().optional(),\n});\n\nexport type ImportWarningType = z.infer<typeof ImportWarningType>;\nexport type ImportWarning = z.infer<typeof ImportWarning>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../helpers\";\nimport { DesignTokenType } from \"../elements\";\nimport { ImportWarning } from \"../import/warning\";\n\nexport const FileStructureStats = z.object({\n frames: zeroNumberByDefault(),\n components: zeroNumberByDefault(),\n componentSets: zeroNumberByDefault(),\n});\n\nconst SourceImportSummaryByTokenTypeKey = DesignTokenType.or(\n // Backward compatibility\n z.enum([\"Measure\", \"Radius\", \"GenericToken\", \"Font\", \"Text\"])\n);\n\nexport const SourceImportSummaryByTokenType = z.record(SourceImportSummaryByTokenTypeKey, z.number());\n\nexport const SourceImportTokenSummary = z.object({\n tokensCreated: zeroNumberByDefault(),\n tokensUpdated: zeroNumberByDefault(),\n tokensDeleted: zeroNumberByDefault(),\n tokensCreatedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),\n tokensUpdatedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),\n tokensDeletedPerType: SourceImportSummaryByTokenType.nullish().transform(v => v ?? {}),\n});\n\nexport const SourceImportComponentSummary = z.object({\n componentsCreated: zeroNumberByDefault(),\n componentsUpdated: zeroNumberByDefault(),\n componentsDeleted: zeroNumberByDefault(),\n componentAssetsCreated: zeroNumberByDefault(),\n componentAssetsUpdated: zeroNumberByDefault(),\n componentAssetsDeleted: zeroNumberByDefault(),\n});\n\nexport const SourceImportStorybookSummary = z.object({\n created: zeroNumberByDefault(),\n updated: zeroNumberByDefault(),\n deleted: zeroNumberByDefault(),\n});\n\nexport const SourceImportFrameSummary = z.object({\n assetsInFile: nullishToOptional(FileStructureStats.optional()),\n invalidReferencesCount: nullishToOptional(z.number().optional()),\n});\n\nexport const SourceImportSummary = z.object({\n sourceId: nullishToOptional(z.string()),\n brandId: nullishToOptional(z.string()),\n versionId: nullishToOptional(z.string()),\n error: nullishToOptional(z.any()),\n isFailed: z.boolean(),\n warnings: z\n .array(ImportWarning)\n .nullish()\n .transform(v => v ?? []),\n\n ...SourceImportTokenSummary.shape,\n ...SourceImportComponentSummary.shape,\n ...FileStructureStats.shape,\n});\n\nexport type FileStructureStats = z.infer<typeof FileStructureStats>;\nexport type SourceImportSummaryByTokenType = z.infer<typeof SourceImportSummaryByTokenType>;\nexport type SourceImportTokenSummary = z.infer<typeof SourceImportTokenSummary>;\nexport type SourceImportComponentSummary = z.infer<typeof SourceImportComponentSummary>;\nexport type SourceImportFrameSummary = z.infer<typeof SourceImportFrameSummary>;\nexport type SourceImportSummary = z.infer<typeof SourceImportSummary>;\nexport type SourceImportStorybookSummary = z.infer<typeof SourceImportStorybookSummary>;\n\nfunction zeroNumberByDefault() {\n return z\n .number()\n .nullish()\n .transform(v => v ?? 0);\n}\n","import { ZodSchema, ZodTypeDef, z } from \"zod\";\n\nexport const TokenDataAliasSchema = z.object({\n aliasTo: z\n .string()\n .optional()\n .nullable()\n .transform(v => v ?? undefined),\n});\n\nexport function tokenAliasOrValue<I, O>(value: ZodSchema<I, ZodTypeDef, O>) {\n return TokenDataAliasSchema.extend({\n value: value\n .optional()\n .nullable()\n .transform(v => (v ?? undefined) as z.output<typeof value> | undefined),\n });\n}\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionTokenData } from \"./dimension\";\n\nexport const BlurType = z.enum([\"Layer\", \"Background\"]);\n\nexport const BlurValue = z.object({\n type: BlurType,\n radius: DimensionTokenData,\n});\n\nexport const BlurTokenData = tokenAliasOrValue(BlurValue);\n\nexport type BlurType = z.infer<typeof BlurType>;\nexport type BlurValue = z.infer<typeof BlurValue>;\nexport type BlurTokenData = z.infer<typeof BlurTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const DimensionUnit = z.enum([\"Pixels\", \"Percent\", \"Rem\", \"Ms\", \"Raw\", \"Points\"]);\n\nexport const DimensionValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const DimensionTokenData = tokenAliasOrValue(DimensionValue);\n\nexport type DimensionUnit = z.infer<typeof DimensionUnit>;\nexport type DimensionValue = z.infer<typeof DimensionValue>;\nexport type DimensionTokenData = z.infer<typeof DimensionTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const BorderRadiusUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const BorderRadiusValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const BorderRadiusTokenData = tokenAliasOrValue(BorderRadiusValue);\n\nexport type BorderRadiusUnit = z.infer<typeof BorderRadiusUnit>;\nexport type BorderRadiusValue = z.infer<typeof BorderRadiusValue>;\nexport type BorderRadiusTokenData = z.infer<typeof BorderRadiusTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const BorderWidthUnit = z.enum([\"Pixels\"]);\n\nexport const BorderWidthValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const BorderWidthTokenData = tokenAliasOrValue(BorderWidthValue);\n\nexport type BorderWidthUnit = z.infer<typeof BorderWidthUnit>;\nexport type BorderWidthValue = z.infer<typeof BorderWidthValue>;\nexport type BorderWidthTokenData = z.infer<typeof BorderWidthTokenData>;\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport { BorderWidthTokenData } from \"./border-width\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const BorderPosition = z.enum([\"Inside\", \"Center\", \"Outside\"]);\nexport const BorderStyle = z.enum([\"Dashed\", \"Dotted\", \"Solid\", \"Groove\"]);\n\nexport const BorderValue = z.object({\n color: ColorTokenData,\n width: BorderWidthTokenData,\n position: BorderPosition,\n style: BorderStyle.optional(),\n});\n\nexport const BorderTokenData = tokenAliasOrValue(BorderValue);\n\nexport type BorderPosition = z.infer<typeof BorderPosition>;\nexport type BorderStyle = z.infer<typeof BorderStyle>;\nexport type BorderValue = z.infer<typeof BorderValue>;\nexport type BorderTokenData = z.infer<typeof BorderTokenData>;\n","import { z } from \"zod\";\nimport { TokenDataAliasSchema, tokenAliasOrValue } from \"./base\";\nimport { OpacityTokenData } from \"./opacity\";\n\nexport const ColorValue = z.object({\n opacity: OpacityTokenData,\n color: z.string().or(TokenDataAliasSchema),\n});\n\nexport const ColorTokenData = tokenAliasOrValue(ColorValue);\n\nexport type ColorValue = z.infer<typeof ColorValue>;\nexport type ColorTokenData = z.infer<typeof ColorTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const OpacityValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const OpacityTokenData = tokenAliasOrValue(OpacityValue);\n\nexport type OpacityValue = z.infer<typeof OpacityValue>;\nexport type OpacityTokenData = z.infer<typeof OpacityTokenData>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers/nullish-to-optional\";\nimport { FigmaComponentPropertyMap } from \"../component-properties\";\n\nexport const ComponentElementData = z.object({\n value: z.object({\n thumbnailImage: z.object({\n value: z.object({\n url: z.string(),\n assetId: z.string(),\n }),\n }),\n\n svg: z\n .object({\n value: z.object({\n url: z.string(),\n assetId: z.string(),\n }),\n })\n .optional(),\n\n parentComponentPersistentId: nullishToOptional(z.string()),\n componentPropertyDefinitions: nullishToOptional(FigmaComponentPropertyMap),\n variantPropertyValues: nullishToOptional(z.record(z.string())),\n renderNodeId: nullishToOptional(z.string()),\n }),\n});\n\nexport type ComponentElementData = z.infer<typeof ComponentElementData>;\n","import { z } from \"zod\";\n\nexport const FigmaComponentPropertyType = z.enum([\"Boolean\", \"InstanceSwap\", \"Variant\", \"Text\"]);\n\n//\n// Definitions\n//\n\nexport const FigmaComponentPropertyOrigin = z.object({\n id: z.string(),\n});\n\nconst FigmaComponentPropertyBase = z.object({\n id: z.string(),\n name: z.string(),\n});\n\nexport const FigmaComponentInstancePreview = z.object({\n componentName: z.string(),\n componentSetName: z.string().optional(),\n isRemote: z.boolean(),\n});\n\nexport const FigmaComponentBooleanProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.Boolean),\n defaultValue: z.boolean(),\n});\n\nexport const FigmaComponentInstanceSwapProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.InstanceSwap),\n defaultValue: z.string(),\n defaultValuePreview: FigmaComponentInstancePreview.optional(),\n});\n\nexport const FigmaComponentVariantProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.Variant),\n defaultValue: z.string(),\n options: z.array(z.string()),\n});\n\nexport const FigmaComponentTextProperty = FigmaComponentPropertyBase.extend({\n type: z.literal(FigmaComponentPropertyType.enum.Text),\n id: z.string(),\n defaultValue: z.string(),\n});\n\nexport const FigmaComponentProperty = z.discriminatedUnion(\"type\", [\n FigmaComponentBooleanProperty,\n FigmaComponentInstanceSwapProperty,\n FigmaComponentTextProperty,\n FigmaComponentVariantProperty,\n]);\n\nexport const FigmaComponentPropertyMap = z.record(z.string(), FigmaComponentProperty);\n\nexport type FigmaComponentInstancePreview = z.infer<typeof FigmaComponentInstancePreview>;\nexport type FigmaComponentPropertyType = z.infer<typeof FigmaComponentPropertyType>;\nexport type FigmaComponentBooleanProperty = z.infer<typeof FigmaComponentBooleanProperty>;\nexport type FigmaComponentInstanceSwapProperty = z.infer<typeof FigmaComponentInstanceSwapProperty>;\nexport type FigmaComponentVariantProperty = z.infer<typeof FigmaComponentVariantProperty>;\nexport type FigmaComponentTextProperty = z.infer<typeof FigmaComponentTextProperty>;\nexport type FigmaComponentProperty = z.infer<typeof FigmaComponentProperty>;\nexport type FigmaComponentPropertyMap = z.infer<typeof FigmaComponentPropertyMap>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers\";\nimport { areShallowObjectsEqual, mapByUnique } from \"../../../utils\";\nimport { ColorTokenInlineData } from \"../../properties\";\nimport { Size } from \"../primitives\";\nimport { DesignTokenType } from \"../raw-element\";\nimport { DimensionTokenData } from \"./dimension\";\n\n//\n// Enums\n//\n\nexport const PageBlockCalloutType = z.enum([\"Info\", \"Primary\", \"Success\", \"Warning\", \"Error\"]);\n\nexport const PageBlockTypeV1 = z.enum([\n \"Text\",\n \"Heading\",\n \"Code\",\n \"UnorderedList\",\n \"OrderedList\",\n \"Quote\",\n \"Callout\",\n \"Divider\",\n \"Image\",\n \"Embed\",\n \"Link\",\n \"Shortcuts\",\n \"FigmaEmbed\",\n \"YoutubeEmbed\",\n \"StorybookEmbed\",\n \"Token\",\n \"TokenGroup\",\n \"TokenList\",\n \"Component\",\n \"ComponentGroup\",\n \"Theme\",\n \"ComponentSandbox\",\n \"Custom\",\n \"FigmaFrames\",\n \"ComponentAssets\",\n \"ComponentAssetGroup\",\n \"RenderCode\",\n \"Tabs\",\n \"TabItem\",\n \"Table\",\n \"TableRow\",\n \"TableCell\",\n \"Guidelines\",\n \"Guideline\",\n \"FigmaComponents\",\n \"FigmaComponentPropsTable\",\n \"Files\",\n]);\n\nexport const PageBlockCodeLanguage = z.enum([\n \"Angular\",\n \"Bash\",\n \"C\",\n \"Cpp\",\n \"Csharp\",\n \"CSS\",\n \"Dart\",\n \"Handlebars\",\n \"HTML\",\n \"Java\",\n \"Javascript\",\n \"JSON\",\n \"ReactJSX\",\n \"ReactTSX\",\n \"Kotlin\",\n \"Lua\",\n \"Markdown\",\n \"ObjectiveC\",\n \"PHP\",\n \"Plain\",\n \"Python\",\n \"Ruby\",\n \"Rust\",\n \"Sass\",\n \"SCSS\",\n \"Svetle\",\n \"Swift\",\n \"Twig\",\n \"Typescript\",\n \"Vue\",\n \"XML\",\n \"YAML\",\n]);\n\nexport const PageBlockAlignment = z.enum([\"Left\", \"Center\", \"Stretch\", \"Right\"]);\nexport const PageBlockThemeType = z.enum([\"Override\", \"Comparison\"]);\nexport const PageBlockTokenNameFormat = z.enum([\"Name\", \"GroupAndName\", \"FullPath\", \"CustomProperty\"]);\nexport const PageBlockAssetType = z.enum([\"image\", \"figmaFrame\"]);\n\nexport const PageBlockTilesAlignment = z.enum([\"Center\", \"FrameHeight\"]);\n\nexport const PageBlockTilesLayout = z.enum([\"C8\", \"C7\", \"C6\", \"C5\", \"C4\", \"C3\", \"C2\", \"C1\", \"C1_75\"]);\n\n//\n// Support types\n//\n\nexport const PageBlockTheme = z.object({\n themeIds: z.array(z.string()),\n type: PageBlockThemeType,\n});\n\nexport const PageBlockSwatch = z.object({\n id: z.string(),\n selectedThemeIds: z.string().array(),\n});\n\nexport const PageBlockUrlPreview = z.object({\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n thumbnailUrl: nullishToOptional(z.string()),\n});\n\nexport const PageBlockFrameOrigin = z.object({\n sourceFileName: nullishToOptional(z.string()),\n title: nullishToOptional(z.string()),\n previewUrl: nullishToOptional(z.string()),\n valid: nullishToOptional(z.boolean()),\n referenceId: nullishToOptional(z.string()),\n assetId: nullishToOptional(z.string()),\n assetScale: nullishToOptional(z.number()),\n width: nullishToOptional(z.number()),\n height: nullishToOptional(z.number()),\n});\n\nexport const PageBlockFrame = z.object({\n persistentId: z.string(),\n sourceId: z.string(),\n sourceFrameId: z.string(),\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n origin: nullishToOptional(PageBlockFrameOrigin),\n});\n\nexport const PageBlockAsset = z.object({\n type: PageBlockAssetType,\n id: nullishToOptional(z.string()),\n url: nullishToOptional(z.string()),\n figmaFrame: nullishToOptional(PageBlockFrame),\n});\n\nexport const PageBlockLinkPreview = z.object({\n title: nullishToOptional(z.string()),\n valid: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockShortcut = z.object({\n persistentId: z.string(),\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n asset: nullishToOptional(PageBlockAsset),\n documentationItemId: nullishToOptional(z.string()),\n pageHeadingId: nullishToOptional(z.string()),\n url: nullishToOptional(z.string()),\n openInNewTab: nullishToOptional(z.boolean()),\n urlPreview: nullishToOptional(PageBlockUrlPreview),\n documentationItemPreview: nullishToOptional(PageBlockLinkPreview),\n});\n\nexport const PageBlockCustomBlockPropertyImageValue = z.object({\n asset: nullishToOptional(PageBlockAsset),\n assetId: nullishToOptional(z.string()),\n assetUrl: nullishToOptional(z.string()),\n});\n\nexport const PageBlockCustomBlockPropertyValue = z.object({\n key: z.string(),\n value: z.any(),\n});\n\nexport const PageBlockFigmaFrameProperties = z.object({\n color: nullishToOptional(\n z.object({\n value: z.string(),\n })\n ),\n alignment: PageBlockTilesAlignment,\n previewContainerHeight: nullishToOptional(z.number()),\n layout: PageBlockTilesLayout,\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n showTitles: z.boolean(),\n});\n\nexport const PageBlockRenderCodeProperties = z.object({\n showCode: z.boolean(),\n showControls: z.boolean().optional(),\n});\n\nexport const PageBlockAssetComponent = z.object({\n persistentId: z.string(),\n componentAssetId: z.string(),\n title: nullishToOptional(z.string()),\n description: nullishToOptional(z.string()),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n});\n\nexport const PageBlockTableColumn = z.object({\n id: z.string(),\n width: DimensionTokenData,\n});\n\nexport const PageBlockTableProperties = z.object({\n showBorders: z.boolean(),\n showHeaderRow: z.boolean(),\n showHeaderColumn: z.boolean(),\n columns: z.array(PageBlockTableColumn),\n});\n\nexport const PageBlockFigmaComponentBlockConfig = z.object({\n showComponentName: nullishToOptional(z.boolean()),\n showComponentDescription: nullishToOptional(z.boolean()),\n showPropertyList: nullishToOptional(z.boolean()),\n previewOrderIds: nullishToOptional(z.array(z.string())),\n previewContainerSize: nullishToOptional(z.enum([\"Centered\", \"NaturalHeight\"])),\n previewContainerHeight: nullishToOptional(z.number()),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n});\n\nexport const PageBlockTokenBlockConfig = z.object({\n tokenNameFormat: nullishToOptional(PageBlockTokenNameFormat),\n tokenNameCustomPropertyId: nullishToOptional(z.string()),\n});\n\nexport const PageBlockAssetBlockConfig = z.object({\n showSearch: nullishToOptional(z.boolean()),\n showAssetDescription: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockSelectedFigmaComponent = z.object({\n figmaComponentId: z.string(),\n selectedComponentProperties: z.string().array(),\n selectedComponentVariants: z.record(z.string().array()).optional(),\n});\n\nexport const PageBlockStorybookItem = z.object({\n entityId: z.string().optional(),\n embed: z\n .object({\n inputUrl: z.string(),\n embedUrl: z.string(),\n })\n .optional(),\n entityMeta: z\n .object({\n caption: z.string().optional(),\n height: z.number().optional(),\n hiddenProps: z.array(z.string()).optional(),\n propValues: z.record(z.unknown()).optional(),\n })\n .optional(),\n});\n\nexport const PageBlockStorybookBlockConfig = z.object({\n value: PageBlockStorybookItem.array(),\n\n showCode: z.boolean().optional(),\n showFooter: z.boolean().optional(),\n showProperties: z.boolean().optional(),\n showDescription: z.boolean().optional(),\n showDefaults: z.boolean().optional(),\n});\n\n//\n// Rich text\n//\n\nexport const PageBlockTextSpanAttributeType = z.enum([\"Bold\", \"Italic\", \"Link\", \"Strikethrough\", \"Code\", \"Comment\"]);\n\nexport const PageBlockTextSpanAttribute = z.object({\n type: PageBlockTextSpanAttributeType,\n\n // Link attributes\n link: nullishToOptional(z.string()),\n documentationItemId: nullishToOptional(z.string()),\n openInNewWindow: nullishToOptional(z.boolean()), // deprecated. use openInNewTab\n openInNewTab: nullishToOptional(z.boolean()),\n\n // Comment attributes\n commentHighlightId: nullishToOptional(z.string()),\n commentIsResolved: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockTextSpan = z.object({\n text: z.string(),\n attributes: z.array(PageBlockTextSpanAttribute),\n});\n\nexport const PageBlockText = z.object({\n spans: z.array(PageBlockTextSpan),\n});\n\nexport const PageBlockGuideline = z.object({\n description: nullishToOptional(z.string()),\n asset: nullishToOptional(PageBlockAsset),\n type: z.string(),\n imageAlt: nullishToOptional(z.string()),\n imageCaption: nullishToOptional(z.string()),\n imageAlignment: nullishToOptional(PageBlockAlignment),\n openLightbox: nullishToOptional(z.boolean()),\n isBordered: nullishToOptional(z.boolean()),\n});\n\nexport const PageBlockFile = z.object({\n entityId: z.string(),\n entityMeta: z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n })\n .optional(),\n});\n\nexport type PageBlockCalloutType = z.infer<typeof PageBlockCalloutType>;\nexport type PageBlockCodeLanguage = z.infer<typeof PageBlockCodeLanguage>;\nexport type PageBlockAlignment = z.infer<typeof PageBlockAlignment>;\nexport type PageBlockThemeType = z.infer<typeof PageBlockThemeType>;\nexport type PageBlockAssetType = z.infer<typeof PageBlockAssetType>;\nexport type PageBlockTilesAlignment = z.infer<typeof PageBlockTilesAlignment>;\nexport type PageBlockTilesLayout = z.infer<typeof PageBlockTilesLayout>;\nexport type PageBlockTextSpanAttributeType = z.infer<typeof PageBlockTextSpanAttributeType>;\n\nexport type PageBlockTypeV1 = z.infer<typeof PageBlockTypeV1>;\nexport type PageBlockTextSpanAttribute = z.infer<typeof PageBlockTextSpanAttribute>;\nexport type PageBlockTextSpan = z.infer<typeof PageBlockTextSpan>;\nexport type PageBlockText = z.infer<typeof PageBlockText>;\nexport type PageBlockGuideline = z.infer<typeof PageBlockGuideline>;\nexport type PageBlockFrame = z.infer<typeof PageBlockFrame>;\nexport type PageBlockFrameOrigin = z.infer<typeof PageBlockFrameOrigin>;\nexport type PageBlockAsset = z.infer<typeof PageBlockAsset>;\nexport type PageBlockTableColumn = z.infer<typeof PageBlockTableColumn>;\nexport type PageBlockTheme = z.infer<typeof PageBlockTheme>;\nexport type PageBlockSwatch = z.infer<typeof PageBlockSwatch>;\nexport type PageBlockShortcut = z.infer<typeof PageBlockShortcut>;\nexport type PageBlockCustomBlockPropertyValue = z.infer<typeof PageBlockCustomBlockPropertyValue>;\nexport type PageBlockCustomBlockPropertyImageValue = z.infer<typeof PageBlockCustomBlockPropertyImageValue>;\nexport type PageBlockFigmaComponentBlockConfig = z.infer<typeof PageBlockFigmaComponentBlockConfig>;\nexport type PageBlockTokenNameFormat = z.infer<typeof PageBlockTokenNameFormat>;\n\n//\n// Block\n//\n\nexport const PageBlockBaseV1 = z.object({\n persistentId: z.string(),\n type: PageBlockTypeV1,\n\n // V2 generic attributes\n numberOfColumns: nullishToOptional(z.number()),\n itemBackgroundColor: nullishToOptional(ColorTokenInlineData),\n\n // Element linking\n designObjectId: nullishToOptional(z.string()),\n designObjectIds: nullishToOptional(z.array(z.string())),\n tokenType: nullishToOptional(DesignTokenType.or(z.literal(\"Font\"))),\n showNestedGroups: nullishToOptional(z.boolean()),\n brandId: nullishToOptional(z.string()),\n\n // Rich text\n text: nullishToOptional(PageBlockText),\n caption: nullishToOptional(z.string()),\n headingType: nullishToOptional(z.number().min(1).max(3)),\n codeLanguage: nullishToOptional(PageBlockCodeLanguage),\n calloutType: nullishToOptional(PageBlockCalloutType),\n urlInput: nullishToOptional(z.string()),\n url: nullishToOptional(z.string()),\n urlPreview: nullishToOptional(PageBlockUrlPreview),\n\n // Image\n asset: nullishToOptional(PageBlockAsset),\n alignment: nullishToOptional(PageBlockAlignment),\n imageAlt: nullishToOptional(z.string()),\n openLightbox: nullishToOptional(z.boolean()),\n isBordered: nullishToOptional(z.boolean()),\n\n // Shortcuts block\n shortcuts: nullishToOptional(z.array(PageBlockShortcut)),\n\n // Guidelines\n guideline: nullishToOptional(PageBlockGuideline),\n\n // Custom blocks\n customBlockKey: nullishToOptional(z.string()),\n customBlockProperties: nullishToOptional(z.array(PageBlockCustomBlockPropertyValue)),\n variantKey: nullishToOptional(z.string()),\n\n // Figma frames\n figmaFrameProperties: nullishToOptional(PageBlockFigmaFrameProperties),\n figmaFrames: nullishToOptional(z.array(PageBlockFrame)),\n\n // Generic\n size: nullishToOptional(Size),\n backgroundColor: nullishToOptional(ColorTokenInlineData),\n\n // Render code\n renderCodeProperties: nullishToOptional(PageBlockRenderCodeProperties),\n\n // Component assets\n componentAssets: nullishToOptional(z.array(PageBlockAssetComponent)),\n\n // Tables\n tableProperties: nullishToOptional(PageBlockTableProperties),\n columnId: nullishToOptional(z.string()),\n\n // Design tokens\n theme: nullishToOptional(PageBlockTheme),\n swatches: nullishToOptional(PageBlockSwatch.array()),\n blacklistedElementProperties: nullishToOptional(z.array(z.string())),\n tokenBlockConfig: nullishToOptional(PageBlockTokenBlockConfig),\n\n // (Vector) assets\n assetBlockConfig: nullishToOptional(PageBlockAssetBlockConfig),\n\n // Figma components\n figmaComponentsBlockConfig: nullishToOptional(PageBlockFigmaComponentBlockConfig),\n selectedFigmaComponent: nullishToOptional(PageBlockSelectedFigmaComponent),\n selectedFigmaComponents: nullishToOptional(PageBlockSelectedFigmaComponent.array()),\n\n // Arbitrary\n userMetadata: nullishToOptional(z.string()),\n\n // Storybook\n storybookBlockConfig: nullishToOptional(PageBlockStorybookBlockConfig),\n\n // Files\n files: nullishToOptional(PageBlockFile.array()),\n});\n\ntype PageBlockV1Input = z.input<typeof PageBlockBaseV1> & {\n children: PageBlockV1Input[] | null | undefined;\n};\n\nexport const PageBlockV1: z.ZodType<PageBlockV1, z.ZodTypeDef, PageBlockV1Input> = PageBlockBaseV1.extend({\n children: z.lazy(\n () =>\n PageBlockV1.array()\n .nullish()\n .transform(t => t ?? []) as z.ZodType<PageBlockV1[], z.ZodTypeDef, PageBlockV1Input[]>\n ),\n});\n\nexport type PageBlockV1 = z.infer<typeof PageBlockBaseV1> & {\n children: PageBlockV1[];\n};\n\n//\n// Utility methods\n//\n\nexport function traversePageBlocksV1(blocks: PageBlockV1[], action: (block: PageBlockV1) => void) {\n for (const block of blocks) {\n action(block);\n traversePageBlocksV1(block.children, action);\n }\n}\n\nexport function removeCommentSpans(text: PageBlockText): PageBlockText {\n const { spans, ...rest } = text;\n\n const newSpans = spans.map(s => {\n return {\n ...s,\n attributes: s.attributes.filter(a => a.type !== \"Comment\"),\n };\n });\n\n const updatedRichText = {\n ...rest,\n spans: newSpans,\n };\n\n return joinRepeatingSpans(updatedRichText);\n}\n\nexport function joinRepeatingSpans(text: PageBlockText): PageBlockText {\n if (text.spans.length < 2) return text;\n\n // Make sure spans are clean before comparing them\n text = sanitizeSpans(text);\n const { spans, ...rest } = text;\n\n let previousSpan = { ...spans[0] };\n const newSpans = [previousSpan];\n\n for (let i = 1; i < spans.length; i++) {\n const span = spans[i];\n if (areAttributesEqual(span.attributes, previousSpan.attributes)) {\n previousSpan.text += span.text;\n } else {\n previousSpan = { ...span };\n newSpans.push(previousSpan);\n }\n }\n\n return {\n ...rest,\n spans: newSpans,\n };\n}\n\nfunction areAttributesEqual(lhs: PageBlockTextSpanAttribute[], rhs: PageBlockTextSpanAttribute[]) {\n if (lhs.length !== rhs.length) return false;\n\n const lhsMap = mapByUnique(lhs, i => i.type);\n for (const rhsAttribute of rhs) {\n const lhsAttribute = lhsMap.get(rhsAttribute.type);\n if (!areShallowObjectsEqual(lhsAttribute, rhsAttribute)) return false;\n }\n\n return true;\n}\n\nfunction sanitizeSpans(text: PageBlockText): PageBlockText {\n const { spans, ...rest } = text;\n\n return {\n ...rest,\n spans: spans.map(s => {\n const { attributes, ...rest } = s;\n\n return {\n ...rest,\n attributes: attributes.map(sanitizeSpanAttribute),\n };\n }),\n };\n}\n\nfunction sanitizeSpanAttribute(attribute: PageBlockTextSpanAttribute): PageBlockTextSpanAttribute {\n switch (attribute.type) {\n case \"Bold\":\n return { type: \"Bold\" };\n case \"Code\":\n return { type: \"Code\" };\n case \"Strikethrough\":\n return { type: \"Strikethrough\" };\n case \"Italic\":\n return { type: \"Italic\" };\n case \"Comment\":\n const { commentHighlightId, commentIsResolved } = attribute;\n const isCommentIsResolvedDefined = commentIsResolved !== undefined && commentIsResolved !== null;\n\n return {\n type: \"Comment\",\n ...(isCommentIsResolvedDefined && { commentIsResolved }),\n ...(commentHighlightId && { commentHighlightId }),\n };\n case \"Link\":\n const { documentationItemId, link, openInNewTab, openInNewWindow } = attribute;\n const isOpenInNewTabDefined = openInNewTab !== undefined && openInNewTab !== null;\n const isOpenInNewWindowDefined = openInNewWindow !== undefined && openInNewWindow !== null;\n\n return {\n type: \"Link\",\n ...(isOpenInNewTabDefined && { openInNewTab }),\n ...(isOpenInNewWindowDefined && { openInNewWindow }),\n ...(documentationItemId && { documentationItemId }),\n ...(link && { link }),\n };\n }\n}\n","import { z } from \"zod\";\n\nexport const ContentLoadInstruction = z.object({\n from: z.string(),\n to: z.string(),\n authorizationHeaderKvsId: z.string().optional(),\n timeout: z.number().optional(),\n});\n\nexport type ContentLoadInstruction = z.infer<typeof ContentLoadInstruction>;\n\nexport const ContentLoaderPayload = z\n .object({\n type: z.literal(\"Single\"),\n instruction: ContentLoadInstruction,\n })\n .or(\n z.object({\n type: z.literal(\"Multiple\"),\n loadingChunkSize: z.number().optional(),\n instructions: z.array(ContentLoadInstruction),\n })\n )\n .or(\n z.object({\n type: z.literal(\"S3\"),\n location: z.string(),\n })\n );\n\nexport type ContentLoaderPayload = z.infer<typeof ContentLoaderPayload>;\n","import { z } from \"zod\";\n\nexport const GitInteropPulsarError = z.object({\n errorType: z.string(),\n errorMessage: z.string(),\n trace: z.array(z.string()),\n});\nexport type GitInteropPulsarError = z.infer<typeof GitInteropPulsarError>;\n","import slugifyImplementation from \"@sindresorhus/slugify\";\n\nexport function slugify(str: string, options?: slugifyImplementation.Options): string {\n const slug = slugifyImplementation(str ?? \"\", options);\n return slug?.length > 0 ? slug : \"item\";\n}\n\nexport const RESERVED_SLUGS = [\n \"workspaces\",\n \"workspace\",\n \"api0\",\n \"api1\",\n \"api2\",\n \"custom\",\n \"x-sn-reserved\",\n // further elements copied from https://github.com/shouldbee/reserved-usernames/blob/master/reserved-usernames.json\n\n \"0\",\n \"about\",\n \"access\",\n \"account\",\n \"accounts\",\n \"activate\",\n \"activities\",\n \"activity\",\n \"ad\",\n \"add\",\n \"address\",\n \"adm\",\n \"admin\",\n \"administration\",\n \"administrator\",\n \"ads\",\n \"adult\",\n \"advertising\",\n \"affiliate\",\n \"affiliates\",\n \"ajax\",\n \"all\",\n \"alpha\",\n \"analysis\",\n \"analytics\",\n \"android\",\n \"anon\",\n \"anonymous\",\n \"api\",\n \"app\",\n \"apps\",\n \"archive\",\n \"archives\",\n \"article\",\n \"asct\",\n \"asset\",\n \"assets\",\n \"atom\",\n \"auth\",\n \"authentication\",\n \"avatar\",\n \"backup\",\n \"balancer-manager\",\n \"banner\",\n \"banners\",\n \"beta\",\n \"billing\",\n \"bin\",\n \"blog\",\n \"blogs\",\n \"board\",\n \"book\",\n \"bookmark\",\n \"bot\",\n \"bots\",\n \"bug\",\n \"business\",\n \"cache\",\n \"cadastro\",\n \"calendar\",\n \"call\",\n \"campaign\",\n \"cancel\",\n \"captcha\",\n \"career\",\n \"careers\",\n \"cart\",\n \"categories\",\n \"category\",\n \"cgi\",\n \"cgi-bin\",\n \"changelog\",\n \"chat\",\n \"check\",\n \"checking\",\n \"checkout\",\n \"client\",\n \"cliente\",\n \"clients\",\n \"code\",\n \"codereview\",\n \"comercial\",\n \"comment\",\n \"comments\",\n \"communities\",\n \"community\",\n \"company\",\n \"compare\",\n \"compras\",\n \"config\",\n \"configuration\",\n \"connect\",\n \"contact\",\n \"contact-us\",\n \"contact_us\",\n \"contactus\",\n \"contest\",\n \"contribute\",\n \"corp\",\n \"create\",\n \"css\",\n \"dashboard\",\n \"data\",\n \"db\",\n \"default\",\n \"delete\",\n \"demo\",\n \"design\",\n \"designer\",\n \"destroy\",\n \"dev\",\n \"devel\",\n \"developer\",\n \"developers\",\n \"diagram\",\n \"diary\",\n \"dict\",\n \"dictionary\",\n \"die\",\n \"dir\",\n \"direct_messages\",\n \"directory\",\n \"dist\",\n \"doc\",\n \"docs\",\n \"documentation\",\n \"domain\",\n \"download\",\n \"downloads\",\n \"ecommerce\",\n \"edit\",\n \"editor\",\n \"edu\",\n \"education\",\n \"email\",\n \"employment\",\n \"empty\",\n \"end\",\n \"enterprise\",\n \"entries\",\n \"entry\",\n \"error\",\n \"errors\",\n \"eval\",\n \"event\",\n \"exit\",\n \"explore\",\n \"facebook\",\n \"faq\",\n \"favorite\",\n \"favorites\",\n \"feature\",\n \"features\",\n \"feed\",\n \"feedback\",\n \"feeds\",\n \"file\",\n \"files\",\n \"first\",\n \"flash\",\n \"fleet\",\n \"fleets\",\n \"flog\",\n \"follow\",\n \"followers\",\n \"following\",\n \"forgot\",\n \"form\",\n \"forum\",\n \"forums\",\n \"founder\",\n \"free\",\n \"friend\",\n \"friends\",\n \"ftp\",\n \"gadget\",\n \"gadgets\",\n \"game\",\n \"games\",\n \"get\",\n \"ghost\",\n \"gift\",\n \"gifts\",\n \"gist\",\n \"github\",\n \"graph\",\n \"group\",\n \"groups\",\n \"guest\",\n \"guests\",\n \"help\",\n \"home\",\n \"homepage\",\n \"host\",\n \"hosting\",\n \"hostmaster\",\n \"hostname\",\n \"howto\",\n \"hpg\",\n \"html\",\n \"http\",\n \"httpd\",\n \"https\",\n \"i\",\n \"iamges\",\n \"icon\",\n \"icons\",\n \"id\",\n \"idea\",\n \"ideas\",\n \"image\",\n \"images\",\n \"imap\",\n \"img\",\n \"index\",\n \"indice\",\n \"info\",\n \"information\",\n \"inquiry\",\n \"instagram\",\n \"intranet\",\n \"invitations\",\n \"invite\",\n \"ipad\",\n \"iphone\",\n \"irc\",\n \"is\",\n \"issue\",\n \"issues\",\n \"it\",\n \"item\",\n \"items\",\n \"java\",\n \"javascript\",\n \"job\",\n \"jobs\",\n \"join\",\n \"js\",\n \"json\",\n \"jump\",\n \"knowledgebase\",\n \"language\",\n \"languages\",\n \"last\",\n \"ldap-status\",\n \"legal\",\n \"license\",\n \"link\",\n \"links\",\n \"linux\",\n \"list\",\n \"lists\",\n \"log\",\n \"log-in\",\n \"log-out\",\n \"log_in\",\n \"log_out\",\n \"login\",\n \"logout\",\n \"logs\",\n \"m\",\n \"mac\",\n \"mail\",\n \"mail1\",\n \"mail2\",\n \"mail3\",\n \"mail4\",\n \"mail5\",\n \"mailer\",\n \"mailing\",\n \"maintenance\",\n \"manager\",\n \"manual\",\n \"map\",\n \"maps\",\n \"marketing\",\n \"master\",\n \"me\",\n \"media\",\n \"member\",\n \"members\",\n \"message\",\n \"messages\",\n \"messenger\",\n \"microblog\",\n \"microblogs\",\n \"mine\",\n \"mis\",\n \"mob\",\n \"mobile\",\n \"movie\",\n \"movies\",\n \"mp3\",\n \"msg\",\n \"msn\",\n \"music\",\n \"musicas\",\n \"mx\",\n \"my\",\n \"mysql\",\n \"name\",\n \"named\",\n \"nan\",\n \"navi\",\n \"navigation\",\n \"net\",\n \"network\",\n \"new\",\n \"news\",\n \"newsletter\",\n \"nick\",\n \"nickname\",\n \"notes\",\n \"noticias\",\n \"notification\",\n \"notifications\",\n \"notify\",\n \"ns\",\n \"ns1\",\n \"ns10\",\n \"ns2\",\n \"ns3\",\n \"ns4\",\n \"ns5\",\n \"ns6\",\n \"ns7\",\n \"ns8\",\n \"ns9\",\n \"null\",\n \"oauth\",\n \"oauth_clients\",\n \"offer\",\n \"offers\",\n \"official\",\n \"old\",\n \"online\",\n \"openid\",\n \"operator\",\n \"order\",\n \"orders\",\n \"organization\",\n \"organizations\",\n \"overview\",\n \"owner\",\n \"owners\",\n \"page\",\n \"pager\",\n \"pages\",\n \"panel\",\n \"password\",\n \"payment\",\n \"perl\",\n \"phone\",\n \"photo\",\n \"photoalbum\",\n \"photos\",\n \"php\",\n \"phpmyadmin\",\n \"phppgadmin\",\n \"phpredisadmin\",\n \"pic\",\n \"pics\",\n \"ping\",\n \"plan\",\n \"plans\",\n \"plugin\",\n \"plugins\",\n \"policy\",\n \"pop\",\n \"pop3\",\n \"popular\",\n \"portal\",\n \"post\",\n \"postfix\",\n \"postmaster\",\n \"posts\",\n \"pr\",\n \"premium\",\n \"press\",\n \"price\",\n \"pricing\",\n \"privacy\",\n \"privacy-policy\",\n \"privacy_policy\",\n \"privacypolicy\",\n \"private\",\n \"product\",\n \"products\",\n \"profile\",\n \"project\",\n \"projects\",\n \"promo\",\n \"pub\",\n \"public\",\n \"purpose\",\n \"put\",\n \"python\",\n \"query\",\n \"random\",\n \"ranking\",\n \"read\",\n \"readme\",\n \"recent\",\n \"recruit\",\n \"recruitment\",\n \"register\",\n \"registration\",\n \"release\",\n \"remove\",\n \"replies\",\n \"report\",\n \"reports\",\n \"repositories\",\n \"repository\",\n \"req\",\n \"request\",\n \"requests\",\n \"reset\",\n \"roc\",\n \"root\",\n \"rss\",\n \"ruby\",\n \"rule\",\n \"sag\",\n \"sale\",\n \"sales\",\n \"sample\",\n \"samples\",\n \"save\",\n \"school\",\n \"script\",\n \"scripts\",\n \"search\",\n \"secure\",\n \"security\",\n \"self\",\n \"send\",\n \"server\",\n \"server-info\",\n \"server-status\",\n \"service\",\n \"services\",\n \"session\",\n \"sessions\",\n \"setting\",\n \"settings\",\n \"setup\",\n \"share\",\n \"shop\",\n \"show\",\n \"sign-in\",\n \"sign-up\",\n \"sign_in\",\n \"sign_up\",\n \"signin\",\n \"signout\",\n \"signup\",\n \"site\",\n \"sitemap\",\n \"sites\",\n \"smartphone\",\n \"smtp\",\n \"soporte\",\n \"source\",\n \"spec\",\n \"special\",\n \"sql\",\n \"src\",\n \"ssh\",\n \"ssl\",\n \"ssladmin\",\n \"ssladministrator\",\n \"sslwebmaster\",\n \"staff\",\n \"stage\",\n \"staging\",\n \"start\",\n \"stat\",\n \"state\",\n \"static\",\n \"stats\",\n \"status\",\n \"store\",\n \"stores\",\n \"stories\",\n \"style\",\n \"styleguide\",\n \"stylesheet\",\n \"stylesheets\",\n \"subdomain\",\n \"subscribe\",\n \"subscriptions\",\n \"suporte\",\n \"support\",\n \"svn\",\n \"swf\",\n \"sys\",\n \"sysadmin\",\n \"sysadministrator\",\n \"system\",\n \"tablet\",\n \"tablets\",\n \"tag\",\n \"talk\",\n \"task\",\n \"tasks\",\n \"team\",\n \"teams\",\n \"tech\",\n \"telnet\",\n \"term\",\n \"terms\",\n \"terms-of-service\",\n \"terms_of_service\",\n \"termsofservice\",\n \"test\",\n \"test1\",\n \"test2\",\n \"test3\",\n \"teste\",\n \"testing\",\n \"tests\",\n \"theme\",\n \"themes\",\n \"thread\",\n \"threads\",\n \"tmp\",\n \"todo\",\n \"tool\",\n \"tools\",\n \"top\",\n \"topic\",\n \"topics\",\n \"tos\",\n \"tour\",\n \"translations\",\n \"trends\",\n \"tutorial\",\n \"tux\",\n \"tv\",\n \"twitter\",\n \"undef\",\n \"unfollow\",\n \"unsubscribe\",\n \"update\",\n \"upload\",\n \"uploads\",\n \"url\",\n \"usage\",\n \"user\",\n \"username\",\n \"users\",\n \"usuario\",\n \"vendas\",\n \"ver\",\n \"version\",\n \"video\",\n \"videos\",\n \"visitor\",\n \"watch\",\n \"weather\",\n \"web\",\n \"webhook\",\n \"webhooks\",\n \"webmail\",\n \"webmaster\",\n \"website\",\n \"websites\",\n \"welcome\",\n \"widget\",\n \"widgets\",\n \"wiki\",\n \"win\",\n \"windows\",\n \"word\",\n \"work\",\n \"works\",\n \"workshop\",\n \"ww\",\n \"wws\",\n \"www\",\n \"www1\",\n \"www2\",\n \"www3\",\n \"www4\",\n \"www5\",\n \"www6\",\n \"www7\",\n \"wwws\",\n \"wwww\",\n \"xfn\",\n \"xml\",\n \"xmpp\",\n \"xpg\",\n \"xxx\",\n \"yaml\",\n \"year\",\n \"yml\",\n \"you\",\n \"yourdomain\",\n \"yourname\",\n \"yoursite\",\n \"yourusername\",\n \"latest\",\n \"live\",\n \"preview\",\n \"learn\",\n \"supernova\",\n \"super-nova\",\n];\n\nconst RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);\n\nexport const RESERVED_SLUG_PREFIX = \"x-sn-reserved-\";\n\nconst isSlugReservedInternal = (slug: string) => slug?.startsWith(RESERVED_SLUG_PREFIX);\nexport function isSlugReserved(slug: string) {\n return RESERVED_SLUGS_SET.has(slug) || isSlugReservedInternal(slug);\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const ElementPropertyTypeSchema = z.enum([\"Text\", \"Number\", \"Boolean\", \"Select\", \"Generic\", \"Link\", \"URL\"]);\nexport const ElementPropertyTargetType = z.enum([\"Token\", \"Component\", \"DocumentationPage\"]);\nexport const ElementPropertyLinkType = z.enum([\"FigmaComponent\", \"DocumentationPage\"]);\nexport const ElementPropertyImmutableType = z.enum([\"Collection\"]);\n\nconst CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;\n\nexport const ColorTokenInlineData = z.object({\n value: z.string(),\n});\n\nexport const ElementPropertyDefinitionOption = z.object({\n id: z.string(),\n name: z.string(),\n backgroundColor: ColorTokenInlineData.optional(),\n});\n\nexport const ElementPropertyDefinition = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n name: z.string(),\n codeName: z.string().regex(CODE_NAME_REGEX),\n description: z.string(),\n type: ElementPropertyTypeSchema,\n targetElementType: ElementPropertyTargetType,\n options: z.array(ElementPropertyDefinitionOption).optional(),\n linkElementType: ElementPropertyLinkType.optional(),\n});\n\nexport type ElementPropertyType = z.infer<typeof ElementPropertyTypeSchema>;\nexport const ElementPropertyType = ElementPropertyTypeSchema.enum;\n\nexport type ElementPropertyTargetType = z.infer<typeof ElementPropertyTargetType>;\nexport type ElementPropertyLinkType = z.infer<typeof ElementPropertyLinkType>;\nexport type ElementPropertyImmutableType = z.infer<typeof ElementPropertyImmutableType>;\nexport type ColorTokenInlineData = z.infer<typeof ColorTokenInlineData>;\nexport type ElementPropertyDefinitionOption = z.infer<typeof ElementPropertyDefinitionOption>;\nexport type ElementPropertyDefinition = z.infer<typeof ElementPropertyDefinition>;\n\nexport type CreateElementPropertyDefinition = DbCreateInputOmit<ElementPropertyDefinition> & {\n columnWidth?: number;\n};\n\nexport type UpdateElementPropertyDefinition = OmitStrict<\n DbUpdate<ElementPropertyDefinition>,\n \"designSystemVersionId\" | \"targetElementType\" | \"type\" | \"linkElementType\"\n>;\n\nexport type ElementPropertyDefinitionDiff = {\n toCreate: CreateElementPropertyDefinition[];\n toUpdate: UpdateElementPropertyDefinition[];\n};\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const ElementPropertyValue = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n targetElementPersistentId: z.string(),\n definitionPersistentId: z.string(),\n stringValue: z.string().nullish(),\n numberValue: z.number().nullish(),\n booleanValue: z.boolean().nullish(),\n referenceValue: z.string().nullish(),\n referenceValuePreview: z.string().optional(),\n});\n\nexport type ElementPropertyValue = z.infer<typeof ElementPropertyValue>;\n\nexport type CreateElementPropertyValue = DbCreateInputOmit<ElementPropertyValue>;\nexport type UpdateElementPropertyValue = OmitStrict<\n DbUpdate<ElementPropertyValue>,\n \"designSystemVersionId\" | \"definitionPersistentId\" | \"targetElementPersistentId\"\n>;\n\nexport type ElementPropertyValueDiff = {\n toCreate: CreateElementPropertyValue[];\n toUpdate: UpdateElementPropertyValue[];\n toDelete: ElementPropertyValue[];\n};\n","import { z } from \"zod\";\n\nexport const Point2D = z.object({\n x: z.number(),\n y: z.number(),\n});\n\nexport type Point2D = z.infer<typeof Point2D>;\n","import { z } from \"zod\";\n\nconst nullSize = { height: -1, width: -1 };\n\nfunction isNullSize(size: Size): boolean {\n return size.height === nullSize.height && size.width === nullSize.width;\n}\n\nexport const Size = z.object({\n width: z\n .number()\n .nullish()\n .transform(v => v ?? nullSize.width),\n\n height: z\n .number()\n .nullish()\n .transform(v => v ?? nullSize.height),\n});\n\nexport const SizeOrUndefined = Size.optional().transform(v => {\n if (!v) return undefined;\n if (isNullSize(v)) return undefined;\n\n return v;\n});\n\nexport type Size = z.infer<typeof Size>;\n","import { z } from \"zod\";\nimport { ObjectMeta } from \"../../common\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport type CreateDesignElement = DbCreateInputOmit<DesignElement>;\nexport type UpdateDesignElement = OmitStrict<\n DbUpdate<DesignElement>,\n \"brandPersistentId\" | \"childType\" | \"designSystemVersionId\" | \"shortPersistentId\"\n>;\n\n//\n// Token types\n//\n\nexport const DesignTokenType = z.enum([\n \"Color\",\n \"Border\",\n \"Gradient\",\n \"Shadow\",\n \"Dimension\",\n \"Duration\",\n \"Size\",\n \"Space\",\n \"Opacity\",\n \"FontSize\",\n \"LineHeight\",\n \"LetterSpacing\",\n \"ParagraphSpacing\",\n \"BorderWidth\",\n \"BorderRadius\",\n \"ZIndex\",\n \"Image\",\n \"String\",\n \"ProductCopy\",\n \"FontFamily\",\n \"FontWeight\",\n \"TextDecoration\",\n \"TextCase\",\n \"Visibility\",\n \"Typography\",\n \"Blur\",\n \"Font\",\n]);\n\nexport const tokenElementTypes: DesignTokenType[] = [...DesignTokenType.options.filter(v => v !== \"Font\")];\n\nexport type DesignTokenType = z.infer<typeof DesignTokenType>;\n\n//\n// Non-token types\n//\n\nexport const DesignElementType = DesignTokenType.or(\n z.enum([\n \"Component\",\n \"Theme\",\n \"Documentation\",\n \"DocumentationPage\",\n \"DesignSystemComponent\",\n \"ElementGroup\",\n \"FigmaNodeStructure\",\n \"FigmaNodeReference\",\n \"PageBlock\",\n ])\n);\n\nexport type DesignElementType = z.infer<typeof DesignElementType>;\n\nexport function isTokenType(type: DesignElementType): type is DesignTokenType {\n return DesignTokenType.safeParse(type).success;\n}\n\nconst numberTokenTypes: Set<DesignTokenType> = new Set([\n \"Dimension\",\n \"Duration\",\n \"Size\",\n \"Space\",\n \"Opacity\",\n \"FontSize\",\n \"LineHeight\",\n \"LetterSpacing\",\n \"ParagraphSpacing\",\n \"BorderWidth\",\n \"BorderRadius\",\n \"ZIndex\",\n] satisfies DesignTokenType[]);\n\nconst stringTokenTypes: Set<DesignTokenType> = new Set([\n \"String\",\n \"ProductCopy\",\n \"FontFamily\",\n \"FontWeight\",\n] satisfies DesignTokenType[]);\n\nconst fallbackNumberValue = 14;\n\nexport function areTokenTypesCompatible(\n lhs: DesignTokenType,\n rhs: DesignTokenType,\n isNonCompatibleTypeChangesEnabled = false\n): boolean {\n if (lhs === rhs) return true;\n if (numberTokenTypes.has(lhs) && numberTokenTypes.has(rhs)) return true;\n if (stringTokenTypes.has(lhs) && stringTokenTypes.has(rhs)) return true;\n\n if (isNonCompatibleTypeChangesEnabled && stringTokenTypes.has(lhs) && numberTokenTypes.has(rhs)) return true;\n\n return false;\n}\n\nexport function castStringToDimensionValue(lhs: DesignTokenType, rhs: DesignTokenType, value?: unknown) {\n if (stringTokenTypes.has(lhs) && numberTokenTypes.has(rhs) && value) {\n const newValue = Number.parseFloat(value?.toString() ?? \"\");\n const measure = Number.isNaN(newValue) ? fallbackNumberValue : newValue;\n return { unit: \"Pixels\", measure };\n }\n\n return value;\n}\n\n//\n// Element category\n//\n\nexport const DesignElementCategory = z.enum([\n \"Token\",\n \"Component\",\n \"DesignSystemComponent\",\n \"DocumentationPage\",\n \"Theme\",\n \"PageBlock\",\n]);\n\nexport type DesignElementCategory = z.infer<typeof DesignElementCategory>;\n\n// Elements\n\nexport const DesignSystemElementExportProps = z.object({\n isAsset: z\n .boolean()\n .nullish()\n .transform(v => v ?? false),\n\n codeName: z.string().nullish(),\n});\n\nexport type DesignSystemElementExportProps = z.infer<typeof DesignSystemElementExportProps>;\n\nexport const ShallowDesignElement = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n type: DesignElementType,\n brandPersistentId: z.string().optional(),\n collectionPersistentId: z.string().optional(),\n parentPersistentId: z.string().optional(),\n shortPersistentId: z.string().optional(),\n childType: DesignElementType.optional(),\n sortOrder: z.number(),\n origin: z.record(z.any()).optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DesignElement = ShallowDesignElement.extend({\n meta: ObjectMeta,\n slug: z.string().optional(),\n userSlug: z.string().optional(),\n exportProperties: DesignSystemElementExportProps.optional(),\n data: z.record(z.any()),\n origin: z.record(z.any()).optional(),\n});\n\nexport type ShallowDesignElement = z.infer<typeof ShallowDesignElement>;\nexport type DesignElement = z.infer<typeof DesignElement>;\n\nexport const HierarchicalElements = DesignTokenType.or(\n z.enum([\"Component\", \"DesignSystemComponent\", \"DocumentationPage\"])\n);\n\nexport type HierarchicalElements = z.infer<typeof HierarchicalElements>;\n","import { z } from \"zod\";\nimport { PageBlockDefinitionMultiRichTextPropertyStyle } from \"../../documentation/block-definitions/item\";\nimport { DesignTokenType } from \"../raw-element\";\nimport {\n PageBlockCalloutType,\n PageBlockCodeLanguage,\n PageBlockText,\n PageBlockTokenNameFormat,\n} from \"./documentation-block-v1\";\n\n//\n// Enums\n//\n\nexport const PageBlockLinkType = z.enum([\"DocumentationItem\", \"PageHeading\", \"Url\"]);\nexport const PageBlockImageType = z.enum([\"Resource\", \"FigmaNode\"]);\nexport const PageBlockImageAlignment = z.enum([\"Left\", \"Center\", \"Stretch\"]);\nexport const PageBlockTableCellAlignment = z.enum([\"Left\", \"Center\", \"Right\"]);\nexport const PageBlockPreviewContainerSize = z.enum([\"Centered\", \"NaturalHeight\"]);\nexport const PageBlockThemeDisplayMode = z.enum([\"Split\", \"Override\"]);\nexport const PageBlockTokenValueFormat = z.enum([\"ResolvedValue\", \"ReferenceName\", \"NoValue\"]);\n\nexport type PageBlockLinkType = z.infer<typeof PageBlockLinkType>;\nexport type PageBlockImageType = z.infer<typeof PageBlockImageType>;\nexport type PageBlockImageAlignment = z.infer<typeof PageBlockImageAlignment>;\nexport type PageBlockTableCellAlignment = z.infer<typeof PageBlockTableCellAlignment>;\nexport type PageBlockPreviewContainerSize = z.infer<typeof PageBlockPreviewContainerSize>;\nexport type PageBlockThemeDisplayMode = z.infer<typeof PageBlockThemeDisplayMode>;\nexport type PageBlockTokenValueFormat = z.infer<typeof PageBlockTokenValueFormat>;\n\n//\n// Definitions - Block\n//\n\nexport const PageBlockImageResourceReference = z.object({\n resourceId: z.string(),\n url: z.string(),\n});\n\nexport const PageBlockResourceFrameNodeReference = z.object({\n sourceId: z.string(),\n frameReferenceId: z.string(),\n});\n\nexport const PageBlockImageReference = z.object({\n type: PageBlockImageType,\n\n resource: PageBlockImageResourceReference.optional(),\n figmaNode: PageBlockResourceFrameNodeReference.optional(),\n});\n\nexport const PageBlockColorV2 = z.object({\n value: z.string(),\n referencedTokenId: z.string().optional(),\n});\n\nexport const PageBlockAssetEntityMeta = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n showNestedGroups: z.boolean().optional(),\n});\n\nexport const PageBlockFigmaComponentEntityMeta = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n selectedComponentProperties: z.array(z.string()).optional(),\n});\n\nexport const PageBlockFigmaNodeEntityMeta = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n});\n\nexport const PageBlockAppearanceV2 = z.object({\n itemBackgroundColor: PageBlockColorV2.optional(),\n numberOfColumns: z.number().optional(),\n});\n\nexport const PageBlockItemUntypedValue = z\n .object({\n value: z.any(),\n })\n .and(z.record(z.any()));\n\nexport const PageBlockLinkV2 = z.object({\n type: PageBlockLinkType,\n documentationItemId: z.string().optional(),\n pageHeadingId: z.string().optional(),\n url: z.string().optional(),\n openInNewTab: z.boolean().optional(),\n});\n\nexport const PageBlockItemV2 = z.object({\n id: z.string(),\n linksTo: PageBlockLinkV2.optional(),\n props: z.record(PageBlockItemUntypedValue),\n});\n\nexport const PageBlockDataV2 = z.object({\n packageId: z.string(),\n variantId: z.string().optional(),\n indentLevel: z.number(),\n appearance: PageBlockAppearanceV2.optional(),\n items: z.array(PageBlockItemV2),\n});\n\nexport type PageBlockImageResourceReference = z.infer<typeof PageBlockImageResourceReference>;\nexport type PageBlockResourceFrameNodeReference = z.infer<typeof PageBlockResourceFrameNodeReference>;\nexport type PageBlockImageReference = z.infer<typeof PageBlockImageReference>;\nexport type PageBlockColorV2 = z.infer<typeof PageBlockColorV2>;\nexport type PageBlockAssetEntityMeta = z.infer<typeof PageBlockAssetEntityMeta>;\nexport type PageBlockFigmaComponentEntityMeta = z.infer<typeof PageBlockFigmaComponentEntityMeta>;\nexport type PageBlockFigmaNodeEntityMeta = z.infer<typeof PageBlockFigmaNodeEntityMeta>;\nexport type PageBlockAppearanceV2 = z.infer<typeof PageBlockAppearanceV2>;\nexport type PageBlockItemUntypedValue = z.infer<typeof PageBlockItemUntypedValue>;\nexport type PageBlockLinkV2 = z.infer<typeof PageBlockLinkV2>;\nexport type PageBlockItemV2 = z.infer<typeof PageBlockItemV2>;\nexport type PageBlockDataV2 = z.infer<typeof PageBlockDataV2>;\n\n//\n// Definitions - Typed Values\n//\n\nexport const PageBlockItemAssetValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n showSearch: z.boolean().optional(),\n showAssetDescription: z.boolean().optional(),\n previewContainerSize: PageBlockPreviewContainerSize.optional(),\n previewContainerHeight: z.number().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"Asset\", \"AssetGroup\"]),\n entityMeta: PageBlockAssetEntityMeta.optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemAssetPropertyValue = z.object({\n value: z.array(z.string()).default([]),\n});\n\nexport const PageBlockItemFigmaComponentValue = z.object({\n showComponentName: z.boolean().optional(),\n showComponentDescription: z.boolean().optional(),\n showPropertyList: z.boolean().optional(),\n previewOrderIds: z.array(z.string()).optional(),\n previewContainerSize: PageBlockPreviewContainerSize.optional(),\n previewContainerHeight: z.number().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"FigmaComponent\"]),\n entityMeta: z\n .object({\n selectedComponentProperties: z.string().array().optional(),\n selectedComponentVariants: z.record(z.string().array()).optional(),\n })\n .optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemBooleanValue = z.object({\n value: z.boolean(),\n});\n\nexport const PageBlockItemCodeValue = z.object({\n format: PageBlockCodeLanguage.optional(),\n caption: z.string().optional(),\n value: z.string(),\n});\n\nexport const PageBlockItemSandboxValue = z.object({\n showCode: z.boolean().optional(),\n showControls: z.boolean().optional(),\n backgroundColor: z.string().optional(),\n alignPreview: z.enum([\"Left\", \"Center\"]).optional(),\n previewHeight: z.number().optional(),\n value: z.string(),\n});\n\nexport const PageBlockItemColorValue = z.record(z.any());\n\nexport const PageBlockItemComponentValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n selectedBrandId: z.string().optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"Component\", \"ComponentGroup\"]),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemComponentPropertyValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemDividerValue = z.object({});\n\nexport const PageBlockItemEmbedValue = z.object({\n value: z.string().optional(),\n caption: z.string().optional(),\n height: z.number().optional(),\n alt: z.string().optional(),\n openGraph: z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n imageUrl: z.string().optional(),\n })\n .optional(),\n});\n\nexport const PageBlockItemFigmaNodeValue = z.object({\n showSearch: z.boolean().optional(),\n previewContainerSize: PageBlockPreviewContainerSize.optional(),\n previewContainerHeight: z.number().optional(),\n backgroundColor: PageBlockColorV2.optional(),\n showFrameDetails: z.boolean().optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityMeta: PageBlockFigmaNodeEntityMeta.optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemImageValue = z.object({\n alt: z.string().optional(),\n caption: z.string().optional(),\n alignment: PageBlockImageAlignment.optional(),\n openLightbox: z.boolean().optional(),\n isBordered: z.boolean().optional(),\n value: PageBlockImageReference.optional(),\n});\n\nexport const PageBlockItemMarkdownValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemMultiRichTextValue = z.object({\n value: PageBlockText.array(),\n});\n\nexport const PageBlockItemMultiSelectValue = z.object({\n value: z.array(z.string()).default([]),\n});\n\nexport const PageBlockItemNumberValue = z.object({\n value: z.number(),\n});\n\nexport const PageBlockItemRichTextValue = z.object({\n value: PageBlockText,\n calloutType: PageBlockCalloutType.optional(),\n});\n\nexport const PageBlockItemSingleSelectValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemStorybookValueOld = z.object({\n value: z.string().optional(),\n caption: z.string().optional(),\n height: z.number().optional(),\n embedUrl: z.string().optional(),\n\n storyId: z.string().optional(),\n sourceId: z.string().optional(),\n});\n\nexport const PageBlockItemStorybookValue = z.object({\n value: z\n .array(\n z.object({\n entityId: z.string().optional(),\n embed: z\n .object({\n inputUrl: z.string(),\n embedUrl: z.string(),\n })\n .optional(),\n entityMeta: z\n .object({\n caption: z.string().optional(),\n height: z.number().optional(),\n hiddenProps: z.array(z.string()).optional(),\n propValues: z.record(z.unknown()).optional(),\n })\n .optional(),\n })\n )\n .optional(),\n showCode: z.boolean().optional(),\n showFooter: z.boolean().optional(),\n showProperties: z.boolean().optional(),\n showDescription: z.boolean().optional(),\n showDefaults: z.boolean().optional(),\n});\n\nexport const PageBlockItemTextValue = z.object({\n value: z.string(),\n});\n\nexport const PageBlockItemSwatch = z.object({\n id: z.string(),\n selectedThemeIds: z.string().array(),\n});\n\nexport const PageBlockItemTokenValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n selectedThemeIds: z.array(z.string()).optional(),\n swatches: z.array(PageBlockItemSwatch).optional(),\n themeDisplayMode: PageBlockThemeDisplayMode.optional(),\n tokenNameFormat: PageBlockTokenNameFormat.optional(),\n tokenNameCustomPropertyId: z.string().optional(),\n tokenValueFormat: PageBlockTokenValueFormat.optional(),\n value: z\n .array(\n z.object({\n entityId: z.string(),\n entityType: z.enum([\"Token\", \"TokenGroup\"]),\n entityMeta: z\n .object({\n showNestedGroups: z.boolean().optional(),\n })\n .optional(),\n })\n )\n .default([]),\n});\n\nexport const PageBlockItemFileValue = z.object({\n value: z\n .object({\n entityId: z.string(),\n entityMeta: z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n })\n .optional(),\n })\n .array(),\n});\n\nexport const PageBlockItemTokenPropertyValue = z.object({\n selectedPropertyIds: z.array(z.string()).optional(),\n selectedThemeIds: z.array(z.string()).optional(),\n value: z.array(z.string()).default([]),\n});\n\nexport const PageBlockItemTokenTypeValue = z.object({\n value: z.array(DesignTokenType).default([]),\n});\n\nexport const PageBlockItemUrlValue = z.object({\n value: z.string(),\n});\n\nexport type PageBlockItemAssetValue = z.infer<typeof PageBlockItemAssetValue>;\nexport type PageBlockItemAssetPropertyValue = z.infer<typeof PageBlockItemAssetPropertyValue>;\nexport type PageBlockItemFigmaComponentValue = z.infer<typeof PageBlockItemFigmaComponentValue>;\nexport type PageBlockItemBooleanValue = z.infer<typeof PageBlockItemBooleanValue>;\nexport type PageBlockItemCodeValue = z.infer<typeof PageBlockItemCodeValue>;\nexport type PageBlockItemSandboxValue = z.infer<typeof PageBlockItemSandboxValue>;\nexport type PageBlockItemColorValue = z.infer<typeof PageBlockItemColorValue>;\nexport type PageBlockItemComponentValue = z.infer<typeof PageBlockItemComponentValue>;\nexport type PageBlockItemComponentPropertyValue = z.infer<typeof PageBlockItemComponentPropertyValue>;\nexport type PageBlockItemDividerValue = z.infer<typeof PageBlockItemDividerValue>;\nexport type PageBlockItemEmbedValue = z.infer<typeof PageBlockItemEmbedValue>;\nexport type PageBlockItemFigmaNodeValue = z.infer<typeof PageBlockItemFigmaNodeValue>;\nexport type PageBlockItemImageValue = z.infer<typeof PageBlockItemImageValue>;\nexport type PageBlockItemMarkdownValue = z.infer<typeof PageBlockItemMarkdownValue>;\nexport type PageBlockItemMultiRichTextValue = z.infer<typeof PageBlockItemMultiRichTextValue>;\nexport type PageBlockItemMultiSelectValue = z.infer<typeof PageBlockItemMultiSelectValue>;\nexport type PageBlockItemNumberValue = z.infer<typeof PageBlockItemNumberValue>;\nexport type PageBlockItemRichTextValue = z.infer<typeof PageBlockItemRichTextValue>;\nexport type PageBlockItemSingleSelectValue = z.infer<typeof PageBlockItemSingleSelectValue>;\nexport type PageBlockItemStorybookValueOld = z.infer<typeof PageBlockItemStorybookValueOld>;\nexport type PageBlockItemStorybookValue = z.infer<typeof PageBlockItemStorybookValue>;\nexport type PageBlockItemTextValue = z.infer<typeof PageBlockItemTextValue>;\nexport type PageBlockItemSwatch = z.infer<typeof PageBlockItemSwatch>;\nexport type PageBlockItemTokenValue = z.infer<typeof PageBlockItemTokenValue>;\nexport type PageBlockItemTokenPropertyValue = z.infer<typeof PageBlockItemTokenPropertyValue>;\nexport type PageBlockItemTokenTypeValue = z.infer<typeof PageBlockItemTokenTypeValue>;\nexport type PageBlockItemUrlValue = z.infer<typeof PageBlockItemUrlValue>;\nexport type PageBlockItemFileValue = z.infer<typeof PageBlockItemFileValue>;\n\n//\n// Definitions - Rich text editor value\n//\n\nexport const PageBlockItemRichTextEditorParagraphNode = z.object({\n type: z.literal(\"Paragraph\"),\n value: PageBlockItemRichTextValue.shape.value,\n});\n\nexport const PageBlockItemRichTextEditorListNode = z.object({\n type: z.literal(\"List\"),\n listType: PageBlockDefinitionMultiRichTextPropertyStyle,\n value: PageBlockItemMultiRichTextValue.shape.value,\n});\n\nexport const PageBlockItemRichTextEditorNode = z.discriminatedUnion(\"type\", [\n PageBlockItemRichTextEditorParagraphNode,\n PageBlockItemRichTextEditorListNode,\n]);\n\nexport const PageBlockItemRichTextEditorValue = z.object({\n value: PageBlockItemRichTextEditorNode.array(),\n});\n\nexport type PageBlockItemRichTextEditorParagraphNode = z.infer<typeof PageBlockItemRichTextEditorParagraphNode>;\nexport type PageBlockItemRichTextEditorListNode = z.infer<typeof PageBlockItemRichTextEditorListNode>;\nexport type PageBlockItemRichTextEditorNode = z.infer<typeof PageBlockItemRichTextEditorNode>;\nexport type PageBlockItemRichTextEditorValue = z.infer<typeof PageBlockItemRichTextEditorValue>;\n\n//\n// Definitions - Table Value\n//\n\nexport const PageBlockItemTableRichTextNode = z.object({\n type: z.literal(\"RichText\"),\n id: z.string(),\n value: PageBlockItemRichTextValue.shape.value,\n});\n\nexport const PageBlockItemTableImageNode = z.object({\n type: z.literal(\"Image\"),\n id: z.string(),\n caption: PageBlockItemImageValue.shape.caption,\n alt: PageBlockItemImageValue.shape.alt,\n value: PageBlockItemImageValue.shape.value,\n alignment: PageBlockItemImageValue.shape.alignment,\n openLightbox: PageBlockItemImageValue.shape.openLightbox,\n isBordered: PageBlockItemImageValue.shape.isBordered,\n});\n\nexport const PageBlockItemTableNode = z.discriminatedUnion(\"type\", [\n PageBlockItemTableRichTextNode,\n PageBlockItemTableImageNode,\n]);\n\nexport const PageBlockItemTableCell = z.object({\n id: z.string(),\n nodes: z.array(PageBlockItemTableNode),\n columnWidth: z.number().optional(),\n alignment: PageBlockTableCellAlignment,\n});\n\nexport const PageBlockItemTableRow = z.object({\n cells: z.array(PageBlockItemTableCell),\n});\n\nexport const PageBlockItemTableValue = z.object({\n highlightHeaderColumn: z.boolean().optional(),\n highlightHeaderRow: z.boolean().optional(),\n showBorder: z.boolean().optional(),\n value: z.array(PageBlockItemTableRow).default([]),\n});\n\nexport type PageBlockItemTableRichTextNode = z.infer<typeof PageBlockItemTableRichTextNode>;\nexport type PageBlockItemTableImageNode = z.infer<typeof PageBlockItemTableImageNode>;\nexport type PageBlockItemTableNode = z.infer<typeof PageBlockItemTableNode>;\nexport type PageBlockItemTableCell = z.infer<typeof PageBlockItemTableCell>;\nexport type PageBlockItemTableRow = z.infer<typeof PageBlockItemTableRow>;\nexport type PageBlockItemTableValue = z.infer<typeof PageBlockItemTableValue>;\n\n//\n// Definitions - Conversion\n//\n\nexport function storybookValueFromOldValue(oldValue: PageBlockItemStorybookValueOld): PageBlockItemStorybookValue {\n return {\n value: [\n {\n // URLs\n ...(oldValue.embedUrl &&\n oldValue.value && {\n embed: {\n embedUrl: oldValue.embedUrl,\n inputUrl: oldValue.value,\n },\n }),\n\n // Meta\n entityMeta: {\n caption: oldValue.caption,\n height: oldValue.height,\n },\n },\n ],\n };\n}\n","import { z } from \"zod\";\nimport { PageBlockDefinitionAppearance } from \"./aux\";\nimport { PageBlockDefinitionVariant } from \"./variant\";\n\n//\n// Enums\n//\n\nexport const PageBlockDefinitionPropertyType = z.enum([\n \"RichText\",\n \"MultiRichText\",\n \"RichTextEditor\",\n \"Text\",\n \"Boolean\",\n \"Number\",\n \"SingleSelect\",\n \"MultiSelect\",\n \"Image\",\n \"Token\",\n \"TokenType\",\n \"TokenProperty\",\n \"Component\",\n \"ComponentProperty\",\n \"Asset\",\n \"AssetProperty\",\n \"FigmaNode\",\n \"EmbedURL\",\n \"URL\",\n \"Markdown\",\n \"Code\",\n \"CodeSandbox\",\n \"Table\",\n \"Divider\",\n \"Storybook\",\n \"Color\",\n \"FigmaComponent\",\n \"File\",\n]);\n\nexport const PageBlockDefinitionRichTextPropertyStyle = z.enum([\n \"Title1\",\n \"Title2\",\n \"Title3\",\n \"Title4\",\n \"Title5\",\n \"Quote\",\n \"Callout\",\n \"Default\",\n]);\n\nexport const PageBlockDefinitionMultiRichTextPropertyStyle = z.enum([\"OL\", \"UL\"]);\n\nexport const PageBlockDefinitionRichTextEditorPropertyStyle = z.enum([\n \"OL\",\n \"UL\",\n \"Bold\",\n \"Italic\",\n \"Link\",\n \"Strikethrough\",\n \"InlineCode\",\n]);\n\nexport const PageBlockDefinitionTextPropertyStyle = z.enum([\n \"Title1\",\n \"Title2\",\n \"Title3\",\n \"Title4\",\n \"Title5\",\n \"Default\",\n \"DefaultBold\",\n \"DefaultSemibold\",\n \"Small\",\n \"SmallBold\",\n \"SmallSemibold\",\n \"Custom\",\n]);\n\nexport const PageBlockDefinitionTextPropertyColor = z.enum([\"Neutral\", \"NeutralFaded\"]);\n\nexport const PageBlockDefinitionBooleanPropertyStyle = z.enum([\"SegmentedControl\", \"ToggleButton\", \"Checkbox\"]);\nexport const PageBlockDefinitionSingleSelectPropertyStyle = z.enum([\n \"SegmentedControl\",\n \"ToggleButton\",\n \"Select\",\n \"Checkbox\",\n]);\nexport const PageBlockDefinitionSingleSelectPropertyColor = z.enum([\n \"Green\",\n \"Red\",\n \"Yellow\",\n \"Blue\",\n \"Purple\",\n \"Orange\",\n \"Pink\",\n \"Teal\",\n \"Brown\",\n \"Grey\",\n \"LightGrey\",\n \"Cyan\",\n \"Fuchsia\",\n]);\n\nexport const IconSet = z.enum([\"CheckCircle\", \"CrossCircle\", \"Alert\"]);\n\nexport const PageBlockDefinitionMultiSelectPropertyStyle = z.enum([\"SegmentedControl\", \"Select\", \"Checkbox\"]);\n\nexport const PageBlockDefinitionImageAspectRatio = z.enum([\"Auto\", \"Square\", \"Landscape\", \"Portrait\", \"Wide\"]);\n\nexport const PageBlockDefinitionImageWidth = z.enum([\"Full\", \"Icon\", \"Small\", \"Medium\", \"Large\", \"Poster\"]);\n\nexport type PageBlockDefinitionPropertyType = z.infer<typeof PageBlockDefinitionPropertyType>;\nexport type PageBlockDefinitionRichTextPropertyStyle = z.infer<typeof PageBlockDefinitionRichTextPropertyStyle>;\nexport type PageBlockDefinitionMultiRichTextPropertyStyle = z.infer<\n typeof PageBlockDefinitionMultiRichTextPropertyStyle\n>;\nexport type PageBlockDefinitionTextPropertyStyle = z.infer<typeof PageBlockDefinitionTextPropertyStyle>;\nexport type PageBlockDefinitionTextPropertyColor = z.infer<typeof PageBlockDefinitionTextPropertyColor>;\nexport type PageBlockDefinitionBooleanPropertyStyle = z.infer<typeof PageBlockDefinitionBooleanPropertyStyle>;\nexport type PageBlockDefinitionSingleSelectPropertyStyle = z.infer<typeof PageBlockDefinitionSingleSelectPropertyStyle>;\nexport type PageBlockDefinitionMultiSelectPropertyStyle = z.infer<typeof PageBlockDefinitionMultiSelectPropertyStyle>;\nexport type PageBlockDefinitionImageAspectRatio = z.infer<typeof PageBlockDefinitionImageAspectRatio>;\nexport type PageBlockDefinitionImageWidth = z.infer<typeof PageBlockDefinitionImageWidth>;\n\n//\n// Aux\n//\n\nexport const PageBlockDefinitionSelectChoice = z.object({\n value: z.string(),\n name: z.string(),\n icon: IconSet.optional(),\n customIconUrl: z.string().optional(),\n color: PageBlockDefinitionSingleSelectPropertyColor.optional(),\n});\n\nexport type PageBlockDefinitionSelectChoice = z.infer<typeof PageBlockDefinitionSelectChoice>;\n\n//\n// Property options\n//\n\nexport const PageBlockDefinitionUntypedPropertyOptions = z.record(z.any());\n\nexport const PageBlockDefinitionRichTextOptions = z.object({\n richTextStyle: PageBlockDefinitionRichTextPropertyStyle.optional(),\n});\n\nexport const PageBlockDefinitionMutiRichTextOptions = z.object({\n multiRichTextStyle: PageBlockDefinitionMultiRichTextPropertyStyle.optional(),\n});\n\nexport const PageBlockDefinitionRichTextEditorOptions = z.object({\n placeholder: z.string().optional(),\n allowedInlineStyles: z.array(PageBlockDefinitionRichTextEditorPropertyStyle).optional(),\n});\n\nexport const PageBlockDefinitionTextOptions = z.object({\n placeholder: z.string().optional(),\n defaultValue: z.string().optional(),\n textStyle: PageBlockDefinitionTextPropertyStyle.optional(),\n color: PageBlockDefinitionTextPropertyColor.optional(),\n allowLineBreaks: z.boolean().optional(),\n});\n\nexport const PageBlockDefinitionSelectOptions = z.object({\n singleSelectStyle: PageBlockDefinitionSingleSelectPropertyStyle.optional(),\n defaultChoice: z.string(),\n choices: z.array(PageBlockDefinitionSelectChoice),\n});\n\nexport const PageBlockDefinitionImageOptions = z.object({\n width: PageBlockDefinitionImageWidth.optional(),\n aspectRatio: PageBlockDefinitionImageAspectRatio.optional(),\n allowCaption: z.boolean().optional(),\n recommendation: z.string().optional(),\n});\n\nexport const PageBlockDefinitionBooleanOptions = z.object({\n defaultvalue: z.boolean().optional(),\n booleanStyle: PageBlockDefinitionBooleanPropertyStyle.optional(),\n});\n\nexport const PageBlockDefinitionNumberOptions = z.object({\n defaultValue: z.number(),\n min: z.number().optional(),\n max: z.number().optional(),\n step: z.number().optional(),\n placeholder: z.string().optional(),\n});\n\nexport const PageBlockDefinitionComponentOptions = z.object({\n renderLayoutAs: z.enum([\"List\", \"Table\"]).optional(),\n allowPropertySelection: z.boolean().optional(),\n});\n\nexport const PageBlockDefinitionFigmaComponentOptions = z.object({\n renderLayoutAs: z.enum([\"Grid\", \"PropsTable\", \"Canvas\", \"Playground\"]),\n invertPropertySelection: z.boolean().optional(),\n});\n\nexport type PageBlockDefinitionUntypedPropertyOptions = z.infer<typeof PageBlockDefinitionUntypedPropertyOptions>;\nexport type PageBlockDefinitionRichTextOptions = z.infer<typeof PageBlockDefinitionRichTextOptions>;\nexport type PageBlockDefinitionMutiRichTextOptions = z.infer<typeof PageBlockDefinitionMutiRichTextOptions>;\nexport type PageBlockDefinitionRichTextEditorOptions = z.infer<typeof PageBlockDefinitionRichTextEditorOptions>;\nexport type PageBlockDefinitionTextOptions = z.infer<typeof PageBlockDefinitionTextOptions>;\nexport type PageBlockDefinitionSelectOptions = z.infer<typeof PageBlockDefinitionSelectOptions>;\nexport type PageBlockDefinitionImageOptions = z.infer<typeof PageBlockDefinitionImageOptions>;\nexport type PageBlockDefinitionBooleanOptions = z.infer<typeof PageBlockDefinitionBooleanOptions>;\nexport type PageBlockDefinitionNumberOptions = z.infer<typeof PageBlockDefinitionNumberOptions>;\nexport type PageBlockDefinitionComponentOptions = z.infer<typeof PageBlockDefinitionComponentOptions>;\nexport type PageBlockDefinitionFigmaComponentOptions = z.infer<typeof PageBlockDefinitionFigmaComponentOptions>;\n\n//\n// Definitions\n//\n\nexport const PageBlockDefinitionProperty = z.object({\n id: z.string(),\n name: z.string(),\n type: PageBlockDefinitionPropertyType,\n description: z.string().optional(),\n options: PageBlockDefinitionUntypedPropertyOptions.optional(),\n variantOptions: z.record(PageBlockDefinitionUntypedPropertyOptions).optional(),\n});\n\nexport const PageBlockDefinitionItem = z.object({\n properties: z.array(PageBlockDefinitionProperty),\n appearance: PageBlockDefinitionAppearance.optional(),\n variants: z.array(PageBlockDefinitionVariant),\n defaultVariantKey: z.string(),\n});\n\nexport type PageBlockDefinitionProperty = z.infer<typeof PageBlockDefinitionProperty>;\nexport type PageBlockDefinitionItem = z.infer<typeof PageBlockDefinitionItem>;\n","import { z } from \"zod\";\n\nexport const PageBlockDefinitionAppearance = z.object({\n isBordered: z.boolean().optional(),\n hasBackground: z.boolean().optional(),\n isEditorPresentationDifferent: z.boolean().optional(),\n showBlockHeaderInEditor: z.boolean().optional(),\n});\n\nexport type PageBlockDefinitionAppearance = z.infer<typeof PageBlockDefinitionAppearance>;\n","import { ZodTypeDef, z } from \"zod\";\nimport { PageBlockDefinitionAppearance } from \"./aux\";\n\n//\n// Enums\n//\n\nexport const PageBlockDefinitionLayoutType = z.enum([\"Column\", \"Row\"]);\nexport const PageBlockDefinitionLayoutGap = z.enum([\"Small\", \"Medium\", \"Large\", \"None\"]);\nexport const PageBlockDefinitionLayoutAlign = z.enum([\"Start\", \"Center\", \"End\"]);\nexport const PageBlockDefinitionLayoutResizing = z.enum([\"Fill\", \"Hug\"]);\n\nexport type PageBlockDefinitionLayoutType = z.infer<typeof PageBlockDefinitionLayoutType>;\nexport type PageBlockDefinitionLayoutGap = z.infer<typeof PageBlockDefinitionLayoutGap>;\nexport type PageBlockDefinitionLayoutAlign = z.infer<typeof PageBlockDefinitionLayoutAlign>;\nexport type PageBlockDefinitionLayoutResizing = z.infer<typeof PageBlockDefinitionLayoutResizing>;\n\n//\n// Definitions\n//\n\nexport const PageBlockDefinitionLayoutBase = z.object({\n type: PageBlockDefinitionLayoutType,\n gap: PageBlockDefinitionLayoutGap.optional(),\n columnAlign: PageBlockDefinitionLayoutAlign.optional(),\n columnResizing: PageBlockDefinitionLayoutResizing.optional(),\n});\n\nexport const PageBlockDefinitionLayout: z.ZodType<PageBlockDefinitionLayout, ZodTypeDef, PageBlockDefinitionLayout> =\n PageBlockDefinitionLayoutBase.extend({\n children: z.lazy(() => z.array(PageBlockDefinitionLayout.or(z.string()))),\n });\n\nexport const PageBlockDefinitionVariant = z.object({\n id: z.string(),\n name: z.string(),\n image: z.string().optional(),\n description: z.string().optional(),\n documentationLink: z.string().optional(),\n layout: PageBlockDefinitionLayout,\n maxColumns: z.number().optional(),\n defaultColumns: z.number().optional(),\n appearance: PageBlockDefinitionAppearance.optional(),\n});\n\nexport type PageBlockDefinitionVariant = z.infer<typeof PageBlockDefinitionVariant>;\nexport type PageBlockDefinitionLayout = z.infer<typeof PageBlockDefinitionLayoutBase> & {\n children: (PageBlockDefinitionLayout | string)[];\n};\n","import { z } from \"zod\";\nimport { DocumentationItemConfigurationV1 } from \"./documentation-v1\";\nimport { PageBlockV1 } from \"./documentation-block-v1\";\nimport { nullishToOptional } from \"../../../helpers\";\n\nexport const DocumentationPageDataV1 = z.object({\n blocks: z.array(PageBlockV1),\n configuration: nullishToOptional(DocumentationItemConfigurationV1),\n});\n","import { z } from \"zod\";\nimport { DocumentationItemHeaderV1, defaultDocumentationItemHeaderV1 } from \"./item-header-v1\";\n\nexport const DocumentationItemConfigurationV1 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean().optional(),\n isHidden: z.boolean().optional(),\n header: DocumentationItemHeaderV1,\n});\n\nexport type DocumentationItemConfigurationV1 = z.infer<typeof DocumentationItemConfigurationV1>;\n\nexport const defaultDocumentationItemConfigurationV1: DocumentationItemConfigurationV1 = {\n header: defaultDocumentationItemHeaderV1,\n showSidebar: true,\n};\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport {\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderAlignmentSchema,\n DocumentationItemHeaderImageScaleType,\n DocumentationItemHeaderImageScaleTypeSchema,\n} from \"./item-header\";\nimport { PageBlockAsset } from \"./documentation-block-v1\";\n\n//\n// Definitions\n//\n\nexport const DocumentationItemHeaderV1 = z.object({\n description: z.string(),\n alignment: DocumentationItemHeaderAlignmentSchema,\n foregroundColor: ColorTokenData.nullish(),\n backgroundColor: ColorTokenData.nullish(),\n backgroundImageAsset: PageBlockAsset.nullish(),\n backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,\n showBackgroundOverlay: z.boolean(),\n showCoverText: z.boolean(),\n minHeight: z.number().nullish(),\n});\n\nexport type DocumentationItemHeaderV1 = z.infer<typeof DocumentationItemHeaderV1>;\n\nexport const defaultDocumentationItemHeaderV1: DocumentationItemHeaderV1 = {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n};\n","//\n// Enums\n//\n\nimport { z } from \"zod\";\n\nexport const DocumentationItemHeaderAlignmentSchema = z.enum([\"Left\", \"Center\"]);\nexport const DocumentationItemHeaderImageScaleTypeSchema = z.enum([\"AspectFill\", \"AspectFit\"]);\n\nexport const DocumentationItemHeaderAlignment = DocumentationItemHeaderAlignmentSchema.enum;\nexport const DocumentationItemHeaderImageScaleType = DocumentationItemHeaderImageScaleTypeSchema.enum;\n\nexport type DocumentationItemHeaderImageScaleType = z.infer<typeof DocumentationItemHeaderImageScaleTypeSchema>;\nexport type DocumentationItemHeaderAlignment = z.infer<typeof DocumentationItemHeaderAlignmentSchema>;\n","import { z } from \"zod\";\nimport { DocumentationItemConfigurationV2 } from \"./documentation-v2\";\nimport { nullishToOptional } from \"../../../helpers\";\n\nexport const DocumentationPageDataV2 = z.object({\n configuration: nullishToOptional(DocumentationItemConfigurationV2),\n});\n","import { z } from \"zod\";\nimport { DocumentationItemHeaderV2, defaultDocumentationItemHeaderV2 } from \"./item-header-v2\";\n\nexport const DocumentationItemConfigurationV2 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean().optional(),\n isHidden: z.boolean().optional(),\n header: DocumentationItemHeaderV2,\n});\n\nexport type DocumentationItemConfigurationV2 = z.infer<typeof DocumentationItemConfigurationV2>;\n\nexport const defaultDocumentationItemConfigurationV2 = {\n header: defaultDocumentationItemHeaderV2,\n isHidden: false,\n isPrivate: false,\n showSidebar: true,\n} as const;\n","import { z } from \"zod\";\nimport {\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderAlignmentSchema,\n DocumentationItemHeaderImageScaleType,\n DocumentationItemHeaderImageScaleTypeSchema,\n} from \"./item-header\";\nimport { PageBlockColorV2, PageBlockImageReference } from \"./documentation-block-v2\";\n\n//\n// Definitions\n//\n\nexport const DocumentationItemHeaderV2 = z.object({\n description: z.string(),\n alignment: DocumentationItemHeaderAlignmentSchema,\n foregroundColor: PageBlockColorV2.nullish(),\n backgroundColor: PageBlockColorV2.nullish(),\n backgroundImageAsset: PageBlockImageReference.nullish(),\n backgroundImageScaleType: DocumentationItemHeaderImageScaleTypeSchema,\n showBackgroundOverlay: z.boolean(),\n showCoverText: z.boolean(),\n minHeight: z.number().nullish(),\n});\n\nexport type DocumentationItemHeaderV2 = z.infer<typeof DocumentationItemHeaderV2>;\n\nexport const defaultDocumentationItemHeaderV2: DocumentationItemHeaderV2 = {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n};\n","import { z } from \"zod\";\nimport { PageBlockEditorModelV2 } from \"../page-block-v2\";\nimport { PageBlockColorV2 } from \"./documentation-block-v2\";\n\nexport const PageSectionTypeV2 = z.enum([\"Tabs\"]);\n\nexport const PageSectionColumnV2 = z.object({\n id: z.string(),\n blocks: z.array(PageBlockEditorModelV2),\n});\n\nexport const PageSectionItemV2 = z.object({\n id: z.string(),\n title: z.string(),\n columns: z.array(PageSectionColumnV2),\n});\n\nexport const PageSectionPaddingV2 = z.object({\n top: z.number().optional(),\n bottom: z.number().optional(),\n left: z.number().optional(),\n right: z.number().optional(),\n});\n\nexport const PageSectionAppearanceV2 = z.object({\n expandToEdges: z.boolean(),\n contentExpandToEdges: z.boolean(),\n backgroundColor: PageBlockColorV2.optional(),\n foregroundColor: PageBlockColorV2.optional(),\n padding: PageSectionPaddingV2.optional(),\n});\n\nexport const PageSectionEditorModelV2 = z.object({\n id: z.string(),\n type: z.literal(\"Section\"),\n variantId: z.string().optional(),\n sectionType: PageSectionTypeV2,\n appearance: PageSectionAppearanceV2,\n items: z.array(PageSectionItemV2),\n});\n\nexport type PageSectionTypeV2 = z.infer<typeof PageSectionTypeV2>;\nexport type PageSectionColumnV2 = z.infer<typeof PageSectionColumnV2>;\nexport type PageSectionItemV2 = z.infer<typeof PageSectionItemV2>;\nexport type PageSectionPaddingV2 = z.infer<typeof PageSectionPaddingV2>;\nexport type PageSectionAppearanceV2 = z.infer<typeof PageSectionAppearanceV2>;\nexport type PageSectionEditorModelV2 = z.infer<typeof PageSectionEditorModelV2>;\n","import { z } from \"zod\";\nimport { DesignElementBase, DesignElementGroupableRequiredPart } from \"./base\";\nimport { PageBlockDataV2 } from \"./data\";\n\n//\n// Element\n//\n\nexport const PageBlockV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape).extend({\n data: PageBlockDataV2,\n});\n\nexport type PageBlockV2 = z.infer<typeof PageBlockV2>;\n\n//\n// Editor Model\n//\n\nexport const PageBlockEditorModelV2 = z.object({\n id: z.string(),\n type: z.literal(\"Block\"),\n data: PageBlockDataV2,\n});\n\nexport type PageBlockEditorModelV2 = z.infer<typeof PageBlockEditorModelV2>;\n","import { z } from \"zod\";\nimport { ObjectMeta } from \"../../common\";\n\nexport const DesignElementOrigin = z.object({\n id: z.string(),\n sourceId: z.string(),\n name: z.string(),\n});\n\nexport const DesignElementBase = z.object({\n id: z.string(),\n persistentId: z.string(),\n meta: ObjectMeta,\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DesignElementImportedBase = DesignElementBase.extend({\n origin: DesignElementOrigin,\n});\n\nexport const DesignElementGroupablePart = z.object({\n parentPersistentId: z.string().optional(),\n sortOrder: z.number(),\n});\n\nexport const DesignElementGroupableBase = DesignElementBase.extend(DesignElementGroupablePart.shape);\n\nexport const DesignElementGroupableRequiredPart = DesignElementGroupablePart.extend({\n parentPersistentId: z.string(),\n});\n\nexport const DesignElementBrandedPart = z.object({\n brandPersistentId: z.string(),\n});\n\nexport const DesignElementSlugPart = z.object({\n slug: z.string().optional(),\n userSlug: z.string().optional(),\n});\n\nexport type DesignElementOrigin = z.infer<typeof DesignElementOrigin>;\nexport type DesignElementBase = z.infer<typeof DesignElementBase>;\nexport type DesignElementGroupablePart = z.infer<typeof DesignElementGroupablePart>;\nexport type DesignElementGroupableBase = z.infer<typeof DesignElementGroupableBase>;\nexport type DesignElementGroupableRequiredPart = z.infer<typeof DesignElementGroupableRequiredPart>;\nexport type DesignElementBrandedPart = z.infer<typeof DesignElementBrandedPart>;\nexport type DesignElementSlugPart = z.infer<typeof DesignElementSlugPart>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const DurationUnit = z.enum([\"Ms\"]);\n\nexport const DurationValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const DurationTokenData = tokenAliasOrValue(DurationValue);\n\nexport type DurationUnit = z.infer<typeof DurationUnit>;\nexport type DurationValue = z.infer<typeof DurationValue>;\nexport type DurationTokenData = z.infer<typeof DurationTokenData>;\n","import { ZodTypeDef, z } from \"zod\";\nimport { Size, SizeOrUndefined } from \"../primitives/size\";\n\nexport const FigmaFileStructureNodeType = z.enum([\"DOCUMENT\", \"CANVAS\", \"FRAME\", \"COMPONENT\", \"COMPONENT_SET\"]);\n\nexport const FigmaFileStructureNodeBase = z.object({\n id: z.string(),\n name: z.string(),\n type: FigmaFileStructureNodeType,\n size: SizeOrUndefined,\n parentComponentSetId: z.string().optional(),\n});\n\nexport const FigmaFileStructureNode: z.ZodType<FigmaFileStructureNode, ZodTypeDef, FigmaFileStructureNodeBaseInput> =\n FigmaFileStructureNodeBase.extend({\n children: z.lazy(() => FigmaFileStructureNode.array()),\n });\n\ntype FigmaFileStructureNodeBaseInput = z.input<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNodeBaseInput[];\n};\n\nexport const FigmaFileStructureStatistics = z.object({\n frames: z\n .number()\n .nullable()\n .optional()\n .transform(v => v ?? 0),\n components: z\n .number()\n .nullable()\n .optional()\n .transform(v => v ?? 0),\n componentSets: z\n .number()\n .nullable()\n .optional()\n .transform(v => v ?? 0),\n});\n\nexport const FigmaFileStructureElementData = z.object({\n value: z.object({\n structure: FigmaFileStructureNode,\n assetsInFile: FigmaFileStructureStatistics,\n }),\n});\n\nexport type FigmaFileStructureNodeBase = z.infer<typeof FigmaFileStructureNodeBase>;\nexport type FigmaFileStructureNodeType = z.infer<typeof FigmaFileStructureStatistics>;\nexport type FigmaFileStructureNode = z.infer<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNode[];\n};\nexport type FigmaFileStructureStatistics = z.infer<typeof FigmaFileStructureStatistics>;\nexport type FigmaFileStructureElementData = z.infer<typeof FigmaFileStructureElementData>;\n\nexport function figmaFileStructureToMap(root: FigmaFileStructureNode): Map<string, FigmaFileStructureNode> {\n const map = new Map<string, FigmaFileStructureNode>();\n recursiveFigmaFileStructureToMap(root, map);\n return map;\n}\n\nfunction recursiveFigmaFileStructureToMap(node: FigmaFileStructureNode, map: Map<string, FigmaFileStructureNode>) {\n map.set(node.id, node);\n for (const child of node.children) recursiveFigmaFileStructureToMap(child, map);\n}\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers/nullish-to-optional\";\n\n//\n// Enums\n//\n\nexport const FigmaNodeRenderState = z.enum([\"InProgress\", \"Success\", \"Failed\"]);\nexport const FigmaNodeRenderFormat = z.enum([\"Png\", \"Svg\"]);\nexport const FigmaNodeRenderErrorType = z.enum([\"MissingIntegration\", \"NodeNotFound\", \"RenderError\"]);\n\nexport type FigmaNodeRenderState = z.infer<typeof FigmaNodeRenderState>;\nexport type FigmaNodeRenderFormat = z.infer<typeof FigmaNodeRenderFormat>;\nexport type FigmaNodeRenderErrorType = z.infer<typeof FigmaNodeRenderErrorType>;\n\n//\n// Definition\n//\n\nexport const FigmaNodeRelinkData = z.object({\n fileId: z.string(),\n});\n\nexport const FigmaNodeRenderedImage = z.object({\n resourceId: z.string(),\n format: FigmaNodeRenderFormat,\n scale: nullishToOptional(z.number()),\n\n width: nullishToOptional(z.number()),\n height: nullishToOptional(z.number()),\n url: nullishToOptional(z.string()),\n originKey: nullishToOptional(z.string()),\n});\n\nexport const FigmaNodeRenderError = z.object({\n type: FigmaNodeRenderErrorType,\n});\n\nexport const FigmaNodeReferenceData = z.object({\n sceneNodeId: z.string(),\n format: FigmaNodeRenderFormat,\n scale: nullishToOptional(z.number()),\n\n renderState: FigmaNodeRenderState,\n renderedImage: FigmaNodeRenderedImage.optional(),\n renderError: FigmaNodeRenderError.optional(),\n\n hasSource: z.boolean(),\n relinkData: FigmaNodeRelinkData.optional(),\n});\n\nexport type FigmaNodeRelinkData = z.infer<typeof FigmaNodeRelinkData>;\nexport type FigmaNodeRenderedImage = z.infer<typeof FigmaNodeRenderedImage>;\nexport type FigmaNodeRenderError = z.infer<typeof FigmaNodeRenderError>;\nexport type FigmaNodeReferenceData = z.infer<typeof FigmaNodeReferenceData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const FontFamilyValue = z.string();\nexport const FontFamilyTokenData = tokenAliasOrValue(FontFamilyValue);\n\nexport type FontFamilyValue = z.infer<typeof FontFamilyValue>;\nexport type FontFamilyTokenData = z.infer<typeof FontFamilyTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const FontSizeUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const FontSizeValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const FontSizeTokenData = tokenAliasOrValue(FontSizeValue);\n\nexport type FontSizeUnit = z.infer<typeof FontSizeUnit>;\nexport type FontSizeValue = z.infer<typeof FontSizeValue>;\nexport type FontSizeTokenData = z.infer<typeof FontSizeTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const FontWeightValue = z.string();\nexport const FontWeightTokenData = tokenAliasOrValue(FontWeightValue);\n\nexport type FontWeightValue = z.infer<typeof FontWeightValue>;\nexport type FontWeightTokenData = z.infer<typeof FontWeightTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const FontValue = z.unknown();\n\nexport const FontTokenData = tokenAliasOrValue(FontValue);\n\nexport type FontValue = z.infer<typeof FontValue>;\nexport type FontTokenData = z.infer<typeof FontTokenData>;\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { nullishToOptional } from \"../../../helpers\";\nimport { Point2D } from \"../primitives\";\n\nexport const GradientType = z.enum([\"Linear\", \"Radial\", \"Angular\"]);\n\nexport const GradientStop = z.object({\n position: z.number(),\n color: ColorTokenData,\n});\n\nexport const GradientLayerValue = z.object({\n from: Point2D,\n to: Point2D,\n type: GradientType,\n aspectRatio: nullishToOptional(z.number()), // z.number(),\n stops: z.array(GradientStop).min(2),\n});\n\nexport const GradientLayerData = tokenAliasOrValue(GradientLayerValue);\n\nexport const GradientTokenValue = z.array(GradientLayerData);\nexport const GradientTokenData = tokenAliasOrValue(GradientTokenValue);\n\nexport type GradientType = z.infer<typeof GradientType>;\nexport type GradientStop = z.infer<typeof GradientStop>;\nexport type GradientLayerValue = z.infer<typeof GradientLayerValue>;\nexport type GradientLayerData = z.infer<typeof GradientLayerData>;\nexport type GradientTokenValue = z.infer<typeof GradientTokenValue>;\nexport type GradientTokenData = z.infer<typeof GradientTokenData>;\n","import { z } from \"zod\";\nimport { nullishToOptional } from \"../../../helpers\";\nimport { DocumentationItemConfigurationV1 } from \"./documentation-v1\";\nimport { DocumentationItemConfigurationV2 } from \"./documentation-v2\";\n\nexport const DocumentationGroupBehavior = z.enum([\"Group\", \"Tabs\"]);\n\nexport const ElementGroupDataV1 = z.object({\n behavior: nullishToOptional(DocumentationGroupBehavior.optional()),\n configuration: nullishToOptional(DocumentationItemConfigurationV1),\n});\n\nexport const ElementGroupDataV2 = z.object({\n behavior: nullishToOptional(DocumentationGroupBehavior.optional()),\n configuration: nullishToOptional(DocumentationItemConfigurationV2),\n});\n\nexport type DocumentationGroupBehavior = z.infer<typeof DocumentationGroupBehavior>;\nexport type ElementGroupDataV1 = z.infer<typeof ElementGroupDataV1>;\nexport type ElementGroupDataV2 = z.infer<typeof ElementGroupDataV2>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const LetterSpacingUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const LetterSpacingValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const LetterSpacingTokenData = tokenAliasOrValue(LetterSpacingValue);\n\nexport type LetterSpacingUnit = z.infer<typeof LetterSpacingUnit>;\nexport type LetterSpacingValue = z.infer<typeof LetterSpacingValue>;\nexport type LetterSpacingTokenData = z.infer<typeof LetterSpacingTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const LineHeightUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\", \"Raw\"]);\n\nexport const LineHeightValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const LineHeightTokenData = tokenAliasOrValue(LineHeightValue);\n\nexport type LineHeightUnit = z.infer<typeof LineHeightUnit>;\nexport type LineHeightValue = z.infer<typeof LineHeightValue>;\nexport type LineHeightTokenData = z.infer<typeof LineHeightTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const ParagraphIndentUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const ParagraphIndentValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const ParagraphIndentTokenData = tokenAliasOrValue(ParagraphIndentValue);\n\nexport type ParagraphIndentUnit = z.infer<typeof ParagraphIndentUnit>;\nexport type ParagraphIndentValue = z.infer<typeof ParagraphIndentValue>;\nexport type ParagraphIndentTokenData = z.infer<typeof ParagraphIndentTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const ParagraphSpacingUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const ParagraphSpacingValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const ParagraphSpacingTokenData = tokenAliasOrValue(ParagraphSpacingValue);\n\nexport type ParagraphSpacingUnit = z.infer<typeof ParagraphSpacingUnit>;\nexport type ParagraphSpacingValue = z.infer<typeof ParagraphSpacingValue>;\nexport type ParagraphSpacingTokenData = z.infer<typeof ParagraphSpacingTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const ProductCopyValue = z.string();\nexport const ProductCopyTokenData = tokenAliasOrValue(ProductCopyValue);\n\nexport type ProductCopyValue = z.infer<typeof ProductCopyValue>;\nexport type ProductCopyTokenData = z.infer<typeof ProductCopyTokenData>;\n","import { z } from \"zod\";\n\nconst RESERVED_OBJECT_ID_PREFIX = \"x-sn-reserved-\";\n\n// Really only checks if the schema does not have the reserved prefix\nexport const SafeIdSchema = z.string().refine(\n value => {\n return !value.startsWith(RESERVED_OBJECT_ID_PREFIX);\n },\n {\n message: `ID value can't start with ${RESERVED_OBJECT_ID_PREFIX}`,\n }\n);\n","import { z } from \"zod\";\nimport { ColorTokenData } from \"./color\";\nimport { OpacityTokenData } from \"./opacity\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const ShadowType = z.enum([\"Drop\", \"Inner\"]);\n\nexport const ShadowLayerValue = z.object({\n color: ColorTokenData,\n x: z.number(),\n y: z.number(),\n radius: z.number(),\n spread: z.number(),\n opacity: OpacityTokenData.optional(),\n type: ShadowType,\n});\n\nconst ShadowTokenDataBase = tokenAliasOrValue(ShadowLayerValue);\nexport const ShadowValue = z.array(ShadowTokenDataBase);\nexport const ShadowTokenData = tokenAliasOrValue(z.array(ShadowTokenDataBase));\n\nexport type ShadowType = z.infer<typeof ShadowType>;\nexport type ShadowLayerValue = z.infer<typeof ShadowLayerValue>;\nexport type ShadowValue = z.infer<typeof ShadowValue>;\nexport type ShadowTokenData = z.infer<typeof ShadowTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const SizeUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const SizeValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const SizeTokenData = tokenAliasOrValue(SizeValue);\n\nexport type SizeUnit = z.infer<typeof SizeUnit>;\nexport type SizeValue = z.infer<typeof SizeValue>;\nexport type SizeTokenData = z.infer<typeof SizeTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const SpaceUnit = z.enum([\"Pixels\", \"Rem\", \"Percent\"]);\n\nexport const SpaceValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const SpaceTokenData = tokenAliasOrValue(SpaceValue);\n\nexport type SpaceUnit = z.infer<typeof SpaceUnit>;\nexport type SpaceValue = z.infer<typeof SpaceValue>;\nexport type SpaceTokenData = z.infer<typeof SpaceTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const StringValue = z.string();\nexport const StringTokenData = tokenAliasOrValue(StringValue);\n\nexport type StringValue = z.infer<typeof StringValue>;\nexport type StringTokenData = z.infer<typeof StringTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const TextCase = z.enum([\"Original\", \"Upper\", \"Lower\", \"Camel\", \"SmallCaps\"]);\nexport const TextCaseValue = TextCase;\nexport const TextCaseTokenData = tokenAliasOrValue(TextCaseValue);\n\nexport type TextCase = z.infer<typeof TextCase>;\nexport type TextCaseValue = z.infer<typeof TextCaseValue>;\nexport type TextCaseTokenData = z.infer<typeof TextCaseTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const TextDecoration = z.enum([\"None\", \"Underline\", \"Strikethrough\"]);\nexport const TextDecorationValue = TextDecoration;\nexport const TextDecorationTokenData = tokenAliasOrValue(TextDecorationValue);\n\nexport type TextDecoration = z.infer<typeof TextDecoration>;\nexport type TextDecorationValue = z.infer<typeof TextDecorationValue>;\nexport type TextDecorationTokenData = z.infer<typeof TextDecorationTokenData>;\n","import { z } from \"zod\";\nimport { FontSizeTokenData } from \"./font-size\";\nimport { FontFamilyTokenData } from \"./font-family\";\nimport { FontWeightTokenData } from \"./font-weight\";\nimport { TextDecorationTokenData } from \"./text-decoration\";\nimport { TextCaseTokenData } from \"./text-case\";\nimport { LetterSpacingTokenData } from \"./letter-spacing\";\nimport { LineHeightTokenData } from \"./line-height\";\nimport { ParagraphIndentTokenData } from \"./paragraph-indent\";\nimport { ParagraphSpacingTokenData } from \"./paragraph-spacing\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const TypographyValue = z.object({\n fontSize: FontSizeTokenData,\n fontFamily: FontFamilyTokenData,\n fontWeight: FontWeightTokenData,\n textDecoration: TextDecorationTokenData,\n textCase: TextCaseTokenData,\n letterSpacing: LetterSpacingTokenData.optional(),\n lineHeight: LineHeightTokenData.optional(),\n paragraphIndent: ParagraphIndentTokenData.optional(),\n paragraphSpacing: ParagraphSpacingTokenData.optional(),\n});\n\nexport const TypographyTokenData = tokenAliasOrValue(TypographyValue);\n\nexport type TypographyValue = z.infer<typeof TypographyValue>;\nexport type TypographyTokenData = z.infer<typeof TypographyTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\n\nexport const Visibility = z.enum([\"Hidden\", \"Visible\"]);\nexport const VisibilityValue = Visibility;\nexport const VisibilityTokenData = tokenAliasOrValue(VisibilityValue);\n\nexport type Visibility = z.infer<typeof Visibility>;\nexport type VisibilityValue = z.infer<typeof VisibilityValue>;\nexport type VisibilityTokenData = z.infer<typeof VisibilityTokenData>;\n","import { z } from \"zod\";\nimport { tokenAliasOrValue } from \"./base\";\nimport { DimensionUnit } from \"./dimension\";\n\nexport const ZIndexUnit = z.enum([\"Raw\"]);\n\nexport const ZIndexValue = z.object({\n unit: DimensionUnit,\n measure: z.number(),\n});\n\nexport const ZIndexTokenData = tokenAliasOrValue(ZIndexValue);\n\nexport type ZIndexUnit = z.infer<typeof ZIndexUnit>;\nexport type ZIndexValue = z.infer<typeof ZIndexValue>;\nexport type ZIndexTokenData = z.infer<typeof ZIndexTokenData>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementGroupableRequiredPart, DesignElementSlugPart } from \"./base\";\nimport { DocumentationPageDataV1, ElementGroupDataV1 } from \"./data\";\nimport { ElementGroup } from \"./group\";\n\n//\n// Documentation page\n//\n\nexport const DocumentationPageV1 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementSlugPart.shape)\n .extend({\n shortPersistentId: z.string(),\n data: DocumentationPageDataV1,\n });\n\nexport type DocumentationPageV1 = z.infer<typeof DocumentationPageV1>;\n\nexport type CreateDocumentationPageV1 = DbCreateInputOmit<DocumentationPageV1>;\nexport type UpdateDocumentationPageV1 = OmitStrict<DbUpdate<DocumentationPageV1>, \"designSystemVersionId\">;\n\n//\n// Documentation group (legacy)\n//\n\nexport const DocumentationGroupV1 = ElementGroup.omit({\n data: true,\n}).extend({\n data: ElementGroupDataV1.optional(),\n});\n\nexport type DocumentationGroupV1 = z.infer<typeof DocumentationGroupV1>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementBrandedPart, DesignElementGroupablePart, DesignElementSlugPart } from \"./base\";\nimport { ElementGroupDataV2 } from \"./data\";\nimport { DesignElementType } from \"./raw-element\";\n\nexport const ElementGroup = DesignElementBase.extend(DesignElementGroupablePart.shape)\n .extend(DesignElementSlugPart.shape)\n .extend(DesignElementBrandedPart.partial().shape)\n .extend({\n shortPersistentId: z.string().optional(),\n childType: DesignElementType,\n data: ElementGroupDataV2.optional(),\n });\n\nexport const BrandedElementGroup = ElementGroup.extend(DesignElementBrandedPart.shape);\n\nexport type ElementGroup = z.infer<typeof ElementGroup>;\nexport type BrandedElementGroup = z.infer<typeof BrandedElementGroup>;\n\nexport type CreateElementGroup = OmitStrict<DbCreateInputOmit<ElementGroup>, \"parentPersistentId\"> & {\n parentPersistentId: string;\n};\n\nexport type UpdateElementGroup = DbUpdate<\n OmitStrict<ElementGroup, \"brandPersistentId\" | \"childType\" | \"designSystemVersionId\" | \"parentPersistentId\"> & {\n parentPersistentId: string;\n }\n>;\n\nexport type RestoreElementGroup = OmitStrict<ElementGroup, \"parentPersistentId\"> & {\n parentPersistentId: string;\n};\n\nexport type ElementGroupsDiff = {\n toCreate: CreateElementGroup[];\n toUpdate: UpdateElementGroup[];\n toDelete: ElementGroup[\"id\"][];\n};\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementGroupableRequiredPart, DesignElementSlugPart } from \"./base\";\nimport { PageBlockV1 } from \"./data\";\nimport { DocumentationPageDataV2 } from \"./data/documentation-page-v2\";\n\nexport const DocumentationPageV2 = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementSlugPart.shape)\n .extend({\n shortPersistentId: z.string(),\n data: DocumentationPageDataV2.extend({\n oldBlocks: z.array(PageBlockV1).optional(),\n }),\n });\n\nexport type DocumentationPageV2 = z.infer<typeof DocumentationPageV2>;\n\nexport type CreateDocumentationPageV2 = DbCreateInputOmit<DocumentationPageV2>;\nexport type UpdateDocumentationPageV2 = OmitStrict<DbUpdate<DocumentationPageV2>, \"designSystemVersionId\">;\nexport type RestoreDocumentationPage = CreateDocumentationPageV2 & { id: string; createdAt: Date; updatedAt: Date };\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport {\n DesignElementBase,\n DesignElementBrandedPart,\n DesignElementGroupableRequiredPart,\n DesignElementOrigin,\n} from \"./base\";\nimport { FigmaComponentPropertyMap } from \"./component-properties\";\n\n//\n// Figma Component\n//\n\nexport const FigmaComponentOriginPart = z.object({\n nodeId: z.string().optional(),\n width: z.number().optional(),\n height: z.number().optional(),\n});\n\nconst FigmaComponentAsset = z.object({\n assetId: z.string(),\n assetPath: z.string(),\n});\n\nexport const FigmaComponentOrigin = DesignElementOrigin.extend(FigmaComponentOriginPart.shape);\n\nexport const FigmaComponent = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementBrandedPart.shape)\n .extend({\n origin: FigmaComponentOrigin.optional(),\n thumbnail: FigmaComponentAsset,\n componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),\n variantPropertyValues: z.record(z.string()).optional(),\n\n svg: FigmaComponentAsset.optional(),\n isAsset: z.boolean(),\n parentComponentPersistentId: nullishToOptional(z.string()),\n renderNodeId: z.string().optional(),\n });\n\nexport type FigmaComponentAsset = z.infer<typeof FigmaComponentAsset>;\nexport type FigmaComponent = z.infer<typeof FigmaComponent>;\nexport type FigmaComponentOrigin = z.infer<typeof FigmaComponentOrigin>;\nexport type ImportedFigmaComponent = OmitStrict<FigmaComponent, \"origin\"> & { origin: FigmaComponentOrigin };\n\n//\n// Support types\n//\n\nexport type CreateFigmaComponent = DbCreateInputOmit<FigmaComponent>;\nexport type UpdateFigmaComponent = OmitStrict<DbUpdate<FigmaComponent>, \"brandPersistentId\" | \"designSystemVersionId\">;\n\nexport type FigmaComponentDiff = {\n toCreate: CreateFigmaComponent[];\n toUpdate: UpdateFigmaComponent[];\n toDelete: FigmaComponent[\"id\"][];\n};\n\n//\n// Utils\n//\n\nexport function isImportedFigmaComponent(component: FigmaComponent): component is ImportedFigmaComponent {\n return !!component.origin;\n}\n","import { z } from \"zod\";\nimport { DesignElementBase } from \"./base\";\nimport { FigmaFileStructureNode, FigmaFileStructureStatistics } from \"./data/figma-file-structure\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const FigmaFileStructureOrigin = z.object({\n sourceId: z.string(),\n fileId: z.string().optional(),\n});\n\nexport const FigmaFileStructureData = z.object({\n rootNode: FigmaFileStructureNode,\n assetsInFile: FigmaFileStructureStatistics,\n});\n\nexport const FigmaFileStructure = DesignElementBase.extend({\n origin: FigmaFileStructureOrigin,\n data: FigmaFileStructureData,\n});\n\nexport type FigmaFileStructureOrigin = z.infer<typeof FigmaFileStructureOrigin>;\nexport type FigmaFileStructureData = z.infer<typeof FigmaFileStructureData>;\nexport type FigmaFileStructure = z.infer<typeof FigmaFileStructure>;\n\nexport type CreateFigmaFileStructure = DbCreateInputOmit<FigmaFileStructure>;\nexport type UpdateFigmaFileStructure = OmitStrict<DbUpdate<FigmaFileStructure>, \"designSystemVersionId\">;\n\nexport type FigmaFileStructureDiff = {\n toCreate: CreateFigmaFileStructure[];\n toUpdate: UpdateFigmaFileStructure[];\n};\n\nexport function traverseStructure(node: FigmaFileStructureNode, action: (node: FigmaFileStructureNode) => void) {\n action(node);\n\n for (const child of node.children) {\n traverseStructure(child, action);\n }\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase } from \"./base\";\nimport { FigmaNodeReferenceData } from \"./data/figma-node-reference\";\n\nexport const FigmaNodeReferenceOrigin = z.object({\n sourceId: z.string(),\n parentName: z.string().optional(),\n});\n\nexport const FigmaNodeReference = DesignElementBase.extend({\n data: FigmaNodeReferenceData,\n origin: FigmaNodeReferenceOrigin,\n});\n\nexport type FigmaNodeReferenceOrigin = z.infer<typeof FigmaNodeReferenceOrigin>;\nexport type FigmaNodeReference = z.infer<typeof FigmaNodeReference>;\n\nexport type CreateFigmaNodeReference = DbCreateInputOmit<FigmaNodeReference>;\nexport type UpdateFigmaNodeReference = OmitStrict<DbUpdate<FigmaNodeReference>, \"designSystemVersionId\">;\n\nexport type FigmaNodeReferenceDiff = {\n toUpdate: UpdateFigmaNodeReference[];\n};\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DesignElementBase, DesignElementBrandedPart } from \"./base\";\nimport { DesignTokenType } from \"./raw-element\";\nimport { DesignTokenOrigin, DesignTokenOriginPart, DesignTokenTypedData } from \"./tokens\";\n\n//\n// Overrides\n//\n\nexport const ThemeOverrideOriginPart = DesignTokenOriginPart;\nexport const ThemeOverrideOrigin = DesignTokenOrigin;\n\nexport const ThemeOverride = DesignTokenTypedData.and(\n z.object({\n tokenPersistentId: z.string(),\n origin: ThemeOverrideOrigin.optional()\n .nullable()\n .transform(v => v ?? undefined),\n })\n);\n\nexport type ThemeOverride = z.infer<typeof ThemeOverride>;\nexport type ThemeOverrideOfType<T extends DesignTokenType> = Extract<ThemeOverride, { type: T }>;\n\n//\n// Theme data\n//\n\nexport const ThemeElementData = z.object({\n value: z.object({\n overrides: z.array(ThemeOverride),\n }),\n});\n\nexport type ThemeElementData = z.infer<typeof ThemeElementData>;\n\n//\n// Theme\n//\n\nexport const ThemeOriginPart = z.object({});\n\nexport const ThemeOriginObject = z.object({\n id: z.string(),\n name: z.string(),\n});\n\nexport const ThemeOriginSource = z.object({\n sourceId: z.string(),\n sourceObjects: z.array(ThemeOriginObject),\n});\n\nexport const ThemeOrigin = z.object({\n sources: z.array(ThemeOriginSource),\n});\n\nexport const Theme = DesignElementBase.extend(DesignElementBrandedPart.shape).extend({\n origin: ThemeOrigin.optional(),\n overrides: z.array(ThemeOverride),\n codeName: z.string(),\n});\n\nexport type Theme = z.infer<typeof Theme>;\nexport type ThemeOrigin = z.infer<typeof ThemeOrigin>;\nexport type ThemeOriginSource = z.infer<typeof ThemeOriginSource>;\nexport type ThemeOriginObject = z.infer<typeof ThemeOriginObject>;\n\nexport type CreateTheme = DbCreateInputOmit<Theme>;\nexport type UpdateTheme = OmitStrict<DbUpdate<Theme>, \"brandPersistentId\" | \"designSystemVersionId\">;\n\nexport type ThemeDiff = {\n toCreate: CreateTheme[];\n toUpdate: UpdateTheme[];\n};\n","import { z } from \"zod\";\nimport { DbUpdate, zodCreateInputOmit, zodUpdateInputOmit } from \"../../helpers\";\nimport { OmitStrict, SupernovaException } from \"../../utils\";\nimport {\n DesignElementBase,\n DesignElementBrandedPart,\n DesignElementGroupableRequiredPart,\n DesignElementOrigin,\n} from \"./base\";\nimport {\n BlurTokenData,\n BorderRadiusTokenData,\n BorderTokenData,\n BorderWidthTokenData,\n ColorTokenData,\n DimensionTokenData,\n DurationTokenData,\n FontFamilyTokenData,\n FontSizeTokenData,\n FontTokenData,\n FontWeightTokenData,\n GradientTokenData,\n LetterSpacingTokenData,\n LineHeightTokenData,\n OpacityTokenData,\n ParagraphSpacingTokenData,\n ProductCopyTokenData,\n ShadowTokenData,\n SizeTokenData,\n SpaceTokenData,\n StringTokenData,\n TextCaseTokenData,\n TextDecorationTokenData,\n TypographyTokenData,\n VisibilityTokenData,\n ZIndexTokenData,\n} from \"./data\";\nimport { areTokenTypesCompatible, castStringToDimensionValue, DesignTokenType } from \"./raw-element\";\n\n//\n// Base\n//\n\nexport const DesignTokenOriginPart = z.object({\n referenceOriginId: z.string().optional(),\n referenceOriginKey: z.string().optional(),\n referenceOriginName: z.string().optional(),\n referenceOriginRemote: z.boolean().optional(),\n referencePersistentId: z.string().optional(),\n referenceResolutionFailed: z.boolean().optional(),\n key: z.string().optional(),\n sortOrder: z.number().optional(),\n});\n\nexport const DesignTokenOrigin = DesignElementOrigin.extend(DesignTokenOriginPart.shape);\n\nconst DesignTokenBase = DesignElementBase.extend(DesignElementGroupableRequiredPart.shape)\n .extend(DesignElementBrandedPart.shape)\n .extend({\n origin: DesignTokenOrigin.optional(),\n collectionPersistentId: z.string().optional(),\n });\n\nconst CreateDesignTokenBase = DesignTokenBase.omit(zodCreateInputOmit());\nconst UpdateDesignTokenBase = DesignTokenBase.omit({\n ...zodUpdateInputOmit(),\n brandPersistentId: true,\n designSystemVersionId: true,\n});\n\n//\n// Per type\n//\n\nconst BlurTokenTypedData = z.object({\n type: z.literal(\"Blur\"),\n data: BlurTokenData,\n});\n\nconst ColorTokenTypedData = z.object({\n type: z.literal(\"Color\"),\n data: ColorTokenData,\n});\n\nconst GradientTokenTypedData = z.object({\n type: z.literal(\"Gradient\"),\n data: GradientTokenData,\n});\n\nconst OpacityTokenTypedData = z.object({\n type: z.literal(\"Opacity\"),\n data: OpacityTokenData,\n});\n\nconst ShadowTokenTypedData = z.object({\n type: z.literal(\"Shadow\"),\n data: ShadowTokenData,\n});\n\nconst TypographyTokenTypedData = z.object({\n type: z.literal(\"Typography\"),\n data: TypographyTokenData,\n});\n\nconst StringTokenTypedData = z.object({\n type: z.literal(\"String\"),\n data: StringTokenData,\n});\n\nconst DimensionTokenTypedData = z.object({\n type: z.literal(\"Dimension\"),\n data: DimensionTokenData,\n});\n\nconst FontSizeTokenTypedData = z.object({\n type: z.literal(\"FontSize\"),\n data: FontSizeTokenData,\n});\n\nconst FontFamilyTokenTypedData = z.object({\n type: z.literal(\"FontFamily\"),\n data: FontFamilyTokenData,\n});\n\nconst FontWeightTokenTypedData = z.object({\n type: z.literal(\"FontWeight\"),\n data: FontWeightTokenData,\n});\n\nconst LetterSpacingTokenTypedData = z.object({\n type: z.literal(\"LetterSpacing\"),\n data: LetterSpacingTokenData,\n});\n\nconst LineHeightTokenTypedData = z.object({\n type: z.literal(\"LineHeight\"),\n data: LineHeightTokenData,\n});\n\nconst ParagraphSpacingTokenTypedData = z.object({\n type: z.literal(\"ParagraphSpacing\"),\n data: ParagraphSpacingTokenData,\n});\n\nconst TextCaseTokenTypedData = z.object({\n type: z.literal(\"TextCase\"),\n data: TextCaseTokenData,\n});\n\nconst TextDecorationTokenTypedData = z.object({\n type: z.literal(\"TextDecoration\"),\n data: TextDecorationTokenData,\n});\n\nconst BorderRadiusTokenTypedData = z.object({\n type: z.literal(\"BorderRadius\"),\n data: BorderRadiusTokenData,\n});\n\nconst BorderWidthTokenTypedData = z.object({\n type: z.literal(\"BorderWidth\"),\n data: BorderWidthTokenData,\n});\n\nconst BorderTypedData = z.object({\n type: z.literal(\"Border\"),\n data: BorderTokenData,\n});\n\nconst ProductCopyTypedData = z.object({\n type: z.literal(\"ProductCopy\"),\n data: ProductCopyTokenData,\n});\n\nconst SizeTypedData = z.object({\n type: z.literal(\"Size\"),\n data: SizeTokenData,\n});\n\nconst SpaceTypedData = z.object({\n type: z.literal(\"Space\"),\n data: SpaceTokenData,\n});\n\nconst VisibilityTypedData = z.object({\n type: z.literal(\"Visibility\"),\n data: VisibilityTokenData,\n});\n\nconst ZIndexTypedData = z.object({\n type: z.literal(\"ZIndex\"),\n data: ZIndexTokenData,\n});\n\nconst DurationTypedData = z.object({\n type: z.literal(\"Duration\"),\n data: DurationTokenData,\n});\n\nconst FontTypedData = z.object({\n type: z.literal(\"Font\"),\n data: FontTokenData,\n});\n\n//\n// Global types\n//\n\nexport const DesignTokenTypedData = z.discriminatedUnion(\"type\", [\n BlurTokenTypedData,\n BorderRadiusTokenTypedData,\n BorderWidthTokenTypedData,\n BorderTypedData,\n ColorTokenTypedData,\n\n DimensionTokenTypedData,\n DurationTypedData,\n FontSizeTokenTypedData,\n FontFamilyTokenTypedData,\n FontWeightTokenTypedData,\n\n GradientTokenTypedData,\n LetterSpacingTokenTypedData,\n LineHeightTokenTypedData,\n OpacityTokenTypedData,\n ParagraphSpacingTokenTypedData,\n\n ProductCopyTypedData,\n ShadowTokenTypedData,\n SizeTypedData,\n SpaceTypedData,\n StringTokenTypedData,\n\n TextCaseTokenTypedData,\n TextDecorationTokenTypedData,\n TypographyTokenTypedData,\n VisibilityTypedData,\n ZIndexTypedData,\n FontTypedData,\n]);\n\nexport type DesignTokenOriginPart = z.infer<typeof DesignTokenOriginPart>;\nexport type DesignTokenOrigin = z.infer<typeof DesignTokenOrigin>;\n\nexport type DesignTokenBase = z.infer<typeof DesignTokenBase>;\n\nexport const DesignToken = DesignTokenTypedData.and(DesignTokenBase);\nexport const CreateDesignToken = DesignTokenTypedData.and(CreateDesignTokenBase);\n\nexport type DesignTokenTypedData = z.infer<typeof DesignTokenTypedData>;\nexport type DesignTokenTypedDataOfType<T extends DesignTokenType> = Extract<DesignTokenTypedData, { type: T }>;\n\nexport type DesignToken = z.infer<typeof DesignToken>;\nexport type ImportedDesignToken = OmitStrict<DesignToken, \"origin\"> & { origin: DesignTokenOrigin };\n\nexport type DesignTokenOfType<T extends DesignTokenType> = Extract<DesignToken, { type: T }>;\nexport type ImportedDesignTokenOfType<T extends DesignTokenType> = Extract<ImportedDesignToken, { type: T }>;\n\nexport type CreateDesignToken = z.infer<typeof CreateDesignToken>;\nexport type UpdateDesignToken = OmitStrict<DbUpdate<DesignToken>, \"brandPersistentId\" | \"designSystemVersionId\">;\n\nexport type DesignTokensDiff = {\n toCreate: CreateDesignToken[];\n toUpdate: UpdateDesignToken[];\n};\n\n//\n// Utilities\n//\n\nexport function extractTokenTypedData<T extends DesignTokenType, I extends DesignTokenTypedDataOfType<T>>(\n source: I\n): DesignTokenTypedDataOfType<T> {\n return {\n type: source.type,\n data: source.data,\n } as DesignTokenTypedDataOfType<T>;\n}\n\nexport function convertTokenTypedData<I extends DesignTokenType, O extends DesignTokenType>(\n source: DesignTokenTypedDataOfType<I>,\n type: O,\n isNonCompatibleTypeChangesEnabled: boolean\n): DesignTokenTypedDataOfType<O> {\n if (!areTokenTypesCompatible(source.type, type, isNonCompatibleTypeChangesEnabled)) {\n throw SupernovaException.invalidOperation(`Cannot convert token from ${source.type} to ${type}`);\n }\n\n const data = source.data;\n if (isNonCompatibleTypeChangesEnabled) {\n data.value = castStringToDimensionValue(source.type, type, source.data.value);\n }\n\n return {\n type,\n data,\n } as DesignTokenTypedDataOfType<O>;\n}\n\nexport function isImportedDesignToken<T extends DesignTokenType>(\n designToken: DesignTokenOfType<T>\n): designToken is ImportedDesignTokenOfType<T> {\n return !!designToken.origin;\n}\n\nexport function isDesignTokenOfType<T extends DesignTokenType>(\n designToken: DesignToken,\n type: T\n): designToken is DesignTokenOfType<T> {\n return designToken.type === type;\n}\n\nexport function designTokenTypeFilter<T extends DesignTokenType>(\n type: T\n): (designToken: DesignToken) => designToken is DesignTokenOfType<T> {\n return (designToken): designToken is DesignTokenOfType<T> => isDesignTokenOfType(designToken, type);\n}\n","import { z } from \"zod\";\n\nexport const FigmaFile = z.object({\n id: z.string(),\n name: z.string(),\n lastModifiedAt: z.coerce.date(),\n thumbnailUrl: z.string().optional(),\n});\n\nexport type FigmaFile = z.infer<typeof FigmaFile>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DataSourceRemoteType } from \"./data-source\";\nimport { Entity } from \"../../common\";\n\nexport const ImportJobState = z.enum([\"PendingInput\", \"Queued\", \"InProgress\", \"Failed\", \"Success\"]);\nexport const ImportJobOperation = z.enum([\"Check\", \"Import\"]);\n\nexport const ImportJob = Entity.extend({\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n sourceIds: z.array(z.string()),\n state: ImportJobState,\n createdByUserId: z.string().optional(),\n importContextId: z.string(),\n error: z.string().optional(),\n sourceType: DataSourceRemoteType,\n importContextCleanedUp: z.boolean(),\n});\n\nexport type ImportJobState = z.infer<typeof ImportJobState>;\nexport type ImportJobOperation = z.infer<typeof ImportJobOperation>;\nexport type ImportJob = z.infer<typeof ImportJob>;\n\nexport type CreateImportJob = DbCreateInputOmit<ImportJob>;\nexport type UpdateImportJob = OmitStrict<\n DbUpdate<ImportJob>,\n \"designSystemId\" | \"createdByUserId\" | \"sourceIds\" | \"importContextId\"\n>;\n","import { z } from \"zod\";\nimport { CollectionImportModel, CollectionImportModelInput } from \"../collection\";\nimport { AssetImportModelInput, FigmaComponentImportModel, FigmaComponentImportModelInput } from \"../component\";\nimport { DataSourceImportModel } from \"../data-source\";\nimport { FigmaFileStructureImportModel, FigmaFileStructureImportModelInput } from \"../figma-frames\";\nimport { ThemeImportModel, ThemeImportModelInput, ThemeUpdateImportModel, ThemeUpdateImportModelInput } from \"../theme\";\nimport { DesignTokenImportModel, DesignTokenImportModelInput } from \"../tokens\";\n\n//\n// Collections\n//\n\nexport const ImportModelInputCollection = z.object({\n source: DataSourceImportModel,\n tokens: z.array(DesignTokenImportModelInput).default([]),\n components: z.array(FigmaComponentImportModelInput).default([]),\n assets: z.array(AssetImportModelInput).default([]),\n themeUpdates: z.array(ThemeUpdateImportModelInput).default([]),\n themes: z.array(ThemeImportModelInput).default([]),\n figmaFileStructure: FigmaFileStructureImportModelInput.optional(),\n collections: z.array(CollectionImportModelInput),\n});\n\nexport const ImportModelCollection = z.object({\n sources: z.array(DataSourceImportModel),\n tokens: z.array(DesignTokenImportModel).default([]),\n components: z.array(FigmaComponentImportModel).default([]),\n themeUpdates: z.array(ThemeUpdateImportModel).default([]),\n themes: z.array(ThemeImportModel).default([]),\n figmaFileStructures: z.array(FigmaFileStructureImportModel),\n collections: z.array(CollectionImportModel),\n});\n\nexport type ImportModelCollection = z.infer<typeof ImportModelCollection>;\nexport type ImportModelInputCollection = z.infer<typeof ImportModelInputCollection>;\n\nexport function addImportModelCollections(\n lhs: ImportModelCollection,\n rhs: ImportModelCollection\n): ImportModelCollection {\n return {\n sources: [...lhs.sources, ...rhs.sources],\n tokens: [...lhs.tokens, ...rhs.tokens],\n components: [...lhs.components, ...rhs.components],\n themeUpdates: [...lhs.themeUpdates, ...rhs.themeUpdates],\n themes: [...lhs.themes, ...rhs.themes],\n figmaFileStructures: [...lhs.figmaFileStructures, ...rhs.figmaFileStructures],\n collections: [...lhs.collections, ...rhs.collections],\n };\n}\n","import { z } from \"zod\";\nimport { CollectionOrigin } from \"../collection\";\n\nexport const CollectionImportModelInput = z.object({\n id: z.string(),\n name: z.string(),\n});\n\nexport const CollectionImportModel = z.object({\n id: z.string(),\n name: z.string(),\n origin: CollectionOrigin,\n});\n\nexport type CollectionImportModelInput = z.infer<typeof CollectionImportModelInput>;\nexport type CollectionImportModel = z.infer<typeof CollectionImportModel>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\nimport { ColorTokenInlineData } from \"./properties\";\n\nexport const CollectionOrigin = z.object({\n id: z.string(),\n sourceId: z.string(),\n});\n\nexport const Collection = z.object({\n id: z.string(),\n persistentId: z.string(),\n\n designSystemVersionId: z.string(),\n\n name: z.string(),\n description: z.string(),\n backgroundColor: ColorTokenInlineData.optional(),\n\n /**\n * ID of Select element property definition's option that corresponds to this collection.\n *\n * Each collection is represented by an option in a special kind of element property that\n * is present in each design system where a collections are present. The property is maintained\n * automatically and is not available to the user (see immutable element properties).\n *\n * Collections have an immutable element property that allows bridging places where element properites\n * can be selected (e.g. documentation blocks) with the concept of collection without having to add\n * specific logic for collection selection.\n */\n elementPropertyOptionId: z.string(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n sortOrder: z.string(),\n\n origin: CollectionOrigin.optional(),\n});\n\nexport type CollectionOrigin = z.infer<typeof CollectionOrigin>;\nexport type Collection = z.infer<typeof Collection>;\n\nexport type CreateCollection = OmitStrict<DbCreateInputOmit<Collection>, \"elementPropertyOptionId\">;\nexport type UpdateCollection = OmitStrict<\n DbUpdate<Collection>,\n \"designSystemVersionId\" | \"origin\" | \"elementPropertyOptionId\"\n> & {\n origin?: Partial<CollectionOrigin>;\n};\n","import { z } from \"zod\";\nimport { FigmaComponentOrigin, FigmaComponentOriginPart, FigmaComponentPropertyMap } from \"../elements\";\nimport { ImportModelBase, ImportModelInputBase } from \"./base\";\nimport { FigmaSvgRenderImportModel, ImageImportModel } from \"./image\";\n\n//\n// Import model\n//\n\nconst FigmaComponentImportModelPart = z.object({\n thumbnail: ImageImportModel,\n parentComponentId: z.string().optional(),\n componentPropertyDefinitions: FigmaComponentPropertyMap.optional(),\n variantPropertyValues: z.record(z.string()).optional(),\n renderNodeId: z.string(),\n svg: FigmaSvgRenderImportModel.optional(),\n});\n\nexport const FigmaComponentImportModel = ImportModelBase.extend(FigmaComponentImportModelPart.shape).extend({\n origin: FigmaComponentOrigin,\n isAsset: z.boolean(),\n});\n\nexport type FigmaComponentImportModel = z.infer<typeof FigmaComponentImportModel>;\n\n//\n// Import model input\n//\n\nexport const FigmaComponentImportModelInput = ImportModelInputBase.extend(FigmaComponentImportModelPart.shape).extend({\n originMetadata: FigmaComponentOriginPart,\n isAsset: z.boolean().optional(),\n});\n\nexport const AssetImportModelInput = FigmaComponentImportModelInput;\n\nexport type FigmaComponentImportModelInput = z.infer<typeof FigmaComponentImportModelInput>;\nexport type AssetImportModelInput = z.infer<typeof AssetImportModelInput>;\n","import { z } from \"zod\";\nimport { DesignElementOrigin } from \"../elements\";\nimport { ObjectMeta } from \"../../common\";\n\nexport const ImportModelBase = z.object({\n id: z.string(),\n meta: ObjectMeta,\n origin: DesignElementOrigin,\n brandPersistentId: z.string(),\n sortOrder: z.number(),\n});\n\nexport type ImportModelBase = z.infer<typeof ImportModelBase>;\n\nexport const ImportModelInputBase = ImportModelBase.omit({\n brandPersistentId: true,\n origin: true,\n sortOrder: true,\n}).extend({\n originId: z.string(),\n originMetadata: z.record(z.any()),\n});\n\nexport type ImportModelInputBase = z.infer<typeof ImportModelInputBase>;\n","import { z } from \"zod\";\nimport { AssetScope } from \"../assets\";\n\n//\n// Abstract\n//\n\nexport const ImageImportModelType = z.enum([\"Url\", \"FigmaRender\"]);\nexport type ImageImportModelType = z.infer<typeof ImageImportModelType>;\n\nconst ImageImportModelBase = z.object({\n scope: AssetScope,\n});\n\n//\n// Url\n//\n\nexport const UrlImageImportModel = ImageImportModelBase.extend({\n type: z.literal(ImageImportModelType.enum.Url),\n url: z.string(),\n originKey: z.string(),\n extension: z.string(),\n});\n\nexport type UrlImageImportModel = z.infer<typeof UrlImageImportModel>;\n\n//\n// Figma Render\n//\n\nexport const FigmaRenderFormat = z.enum([\"Svg\", \"Png\", \"Pdf\"]);\n\nconst FigmaRenderBase = ImageImportModelBase.extend({\n type: z.literal(ImageImportModelType.enum.FigmaRender),\n fileId: z.string(),\n fileVersionId: z.string().optional(),\n nodeId: z.string(),\n originKey: z.string(),\n});\n\nexport const FigmaPngRenderImportModel = FigmaRenderBase.extend({\n format: z.literal(FigmaRenderFormat.enum.Png),\n scale: z.number(),\n});\n\nexport const FigmaSvgRenderImportModel = FigmaRenderBase.extend({\n format: z.literal(FigmaRenderFormat.enum.Svg),\n});\n\nexport const FigmaRenderImportModel = z.discriminatedUnion(\"format\", [\n FigmaPngRenderImportModel,\n FigmaSvgRenderImportModel,\n]);\n\n//\n// Union\n//\n\n// Unfortunately discriminated union doesn't support inserting another discriminated union\nexport const ImageImportModel = z.union([UrlImageImportModel, FigmaRenderImportModel]);\n\n//\n// Types\n//\n\nexport type FigmaRenderFormat = z.infer<typeof FigmaRenderFormat>;\nexport type FigmaRenderBase = z.infer<typeof FigmaRenderBase>;\nexport type FigmaPngRenderImportModel = z.infer<typeof FigmaPngRenderImportModel>;\nexport type FigmaSvgRenderImportModel = z.infer<typeof FigmaSvgRenderImportModel>;\nexport type FigmaRenderImportModel = z.infer<typeof FigmaRenderImportModel>;\nexport type ImageImportModel = z.infer<typeof ImageImportModel>;\n\n//\n// Utils\n//\n\nexport function getFigmaRenderFormatFileExtension(format: FigmaRenderFormat): string {\n switch (format) {\n case \"Pdf\":\n return \"pdf\";\n case \"Png\":\n return \"png\";\n case \"Svg\":\n return \"svg\";\n }\n}\n","import { z } from \"zod\";\n\nexport const DataSourceImportModel = z.object({\n id: z.string(),\n fileName: z.string().optional(),\n thumbnailUrl: z.string().optional(),\n});\n\nexport type DataSourceImportModel = z.infer<typeof DataSourceImportModel>;\n","import { ZodTypeDef, z } from \"zod\";\nimport { FigmaFileStructureNodeBase, FigmaFileStructureOrigin, FigmaFileStructureStatistics } from \"../elements\";\nimport { ImportModelBase, ImportModelInputBase } from \"./base\";\n\n//\n// Nodes Import Model\n//\n\nexport const FigmaFileStructureNodeImportModel: z.ZodType<\n FigmaFileStructureNodeImportModel,\n ZodTypeDef,\n FigmaFileStructureNodeImportModelBaseInput\n> = FigmaFileStructureNodeBase.extend({\n children: z.lazy(() => FigmaFileStructureNodeImportModel.array()),\n});\n\ntype FigmaFileStructureNodeImportModelBaseInput = z.input<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNodeImportModelBaseInput[];\n};\n\nexport type FigmaFileStructureNodeImportModel = z.infer<typeof FigmaFileStructureNodeBase> & {\n children: FigmaFileStructureNodeImportModel[];\n};\n\n//\n// Structure Import Model\n//\n\nconst FigmaFileStructureImportModelPart = z.object({\n data: z.object({\n rootNode: FigmaFileStructureNodeImportModel,\n assetsInFile: FigmaFileStructureStatistics,\n }),\n});\n\nexport const FigmaFileStructureImportModel = ImportModelBase.extend(FigmaFileStructureImportModelPart.shape).extend({\n origin: FigmaFileStructureOrigin,\n});\n\nexport type FigmaFileStructureImportModel = z.infer<typeof FigmaFileStructureImportModel>;\n\n//\n// Import model input\n//\n\nexport const FigmaFileStructureImportModelInput = ImportModelInputBase.extend(\n FigmaFileStructureImportModelPart.shape\n).extend({\n fileVersionId: z.string(),\n});\n\nexport type FigmaFileStructureImportModelInput = z.infer<typeof FigmaFileStructureImportModelInput>;\n\nexport function figmaFileStructureImportModelToMap(\n root: FigmaFileStructureNodeImportModel\n): Map<string, FigmaFileStructureNodeImportModel> {\n const map = new Map<string, FigmaFileStructureNodeImportModel>();\n recursiveFigmaFileStructureToMap(root, map);\n return map;\n}\n\nfunction recursiveFigmaFileStructureToMap(\n node: FigmaFileStructureNodeImportModel,\n map: Map<string, FigmaFileStructureNodeImportModel>\n) {\n map.set(node.id, node);\n for (const child of node.children) recursiveFigmaFileStructureToMap(child, map);\n}\n","import { z } from \"zod\";\nimport {\n DesignTokenTypedData,\n DesignTokenType,\n ThemeOriginObject,\n ThemeOriginSource,\n ThemeOverrideOrigin,\n ThemeOverrideOriginPart,\n} from \"../elements\";\nimport { ObjectMeta } from \"../../common\";\n\n//\n// Overrides\n//\n\nexport const ThemeOverrideImportModelBase = DesignTokenTypedData.and(\n z.object({\n id: z.string(),\n meta: ObjectMeta,\n })\n);\n\nexport const ThemeOverrideImportModel = ThemeOverrideImportModelBase.and(\n z.object({\n origin: ThemeOverrideOrigin,\n })\n);\n\nexport const ThemeOverrideImportModelInput = ThemeOverrideImportModelBase.and(\n z.object({\n originId: z.string(),\n originMetadata: ThemeOverrideOriginPart,\n })\n);\n\nexport type ThemeOverrideImportModel = z.infer<typeof ThemeOverrideImportModel>;\nexport type ThemeOverrideImportModelOfType<T extends DesignTokenType> = Extract<ThemeOverrideImportModel, { type: T }>;\n\nexport type ThemeOverrideImportModelInput = z.infer<typeof ThemeOverrideImportModelInput>;\nexport type ThemeOverrideImportModelInputOfType<T extends DesignTokenType> = Extract<\n ThemeOverrideImportModelInput,\n { type: T }\n>;\n\n//\n// Themes\n//\n\nexport const ThemeImportModel = z.object({\n meta: ObjectMeta,\n brandPersistentId: z.string(),\n originSource: ThemeOriginSource,\n overrides: z.array(ThemeOverrideImportModel),\n sortOrder: z.number(),\n});\n\nexport const ThemeImportModelInput = z.object({\n meta: ObjectMeta,\n originObjects: z.array(ThemeOriginObject),\n overrides: z.array(ThemeOverrideImportModelInput),\n});\n\nexport type ThemeImportModel = z.infer<typeof ThemeImportModel>;\nexport type ThemeImportModelInput = z.infer<typeof ThemeImportModelInput>;\n\n//\n// Theme Update\n//\n\nexport const ThemeUpdateImportModel = z.object({\n themePersistentId: z.string(),\n overrides: z.array(ThemeOverrideImportModel),\n});\n\nexport const ThemeUpdateImportModelInput = z.object({\n themePersistentId: z.string(),\n overrides: z.array(ThemeOverrideImportModelInput),\n});\n\nexport type ThemeUpdateImportModel = z.infer<typeof ThemeUpdateImportModel>;\nexport type ThemeUpdateImportModelInput = z.infer<typeof ThemeUpdateImportModelInput>;\n","import { z } from \"zod\";\nimport { DesignTokenOrigin, DesignTokenOriginPart, DesignTokenType, DesignTokenTypedData } from \"../elements\";\nimport { ImportModelBase, ImportModelInputBase } from \"./base\";\n\n//\n// Base\n//\n\nconst DesignTokenImportModelPart = z.object({\n collectionId: z.string().optional(),\n codeSyntax: z.record(z.coerce.string()).optional(),\n scopes: z.array(z.string()).optional(),\n});\n\nexport const DesignTokenImportModelBase = ImportModelBase.extend(DesignTokenImportModelPart.shape).extend({\n origin: DesignTokenOrigin,\n});\n\nexport const DesignTokenImportModelInputBase = ImportModelInputBase.extend(DesignTokenImportModelPart.shape).extend({\n originMetadata: DesignTokenOriginPart,\n});\n\n//\n// Import models\n//\n\nexport const DesignTokenImportModel = DesignTokenTypedData.and(DesignTokenImportModelBase);\nexport const DesignTokenImportModelInput = DesignTokenTypedData.and(DesignTokenImportModelInputBase);\n\nexport type DesignTokenImportModelInputBase = z.infer<typeof DesignTokenImportModelInputBase>;\n\nexport type DesignTokenImportModel = z.infer<typeof DesignTokenImportModel>;\nexport type DesignTokenImportModelOfType<T extends DesignTokenType> = Extract<DesignTokenImportModel, { type: T }>;\n\nexport type DesignTokenImportModelInput = z.infer<typeof DesignTokenImportModelInput>;\nexport type DesignTokenImportModelInputOfType<T extends DesignTokenType> = Extract<DesignTokenImportModel, { type: T }>;\n\nexport function isDesignTokenImportModelOfType<T extends DesignTokenType>(\n designToken: DesignTokenImportModel,\n type: T\n): designToken is DesignTokenImportModelOfType<T> {\n return designToken.type === type;\n}\n\nexport function designTokenImportModelTypeFilter<T extends DesignTokenType>(\n type: T\n): (designToken: DesignTokenImportModel) => designToken is DesignTokenImportModelOfType<T> {\n return (designToken): designToken is DesignTokenImportModelOfType<T> =>\n isDesignTokenImportModelOfType(designToken, type);\n}\n","import { z } from \"zod\";\n\nexport const DocumentationPageApprovalState = z.enum([\"ReadyForReview\", \"ChangesRequested\", \"Approved\"]);\nexport type DocumentationPageApprovalState = z.infer<typeof DocumentationPageApprovalState>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../../../helpers/db\";\nimport { DocumentationPageApprovalState } from \"../approvals/approval-state\";\n\nexport const DocumentationPageApproval = z.object({\n id: z.string(),\n approvalState: DocumentationPageApprovalState,\n persistentId: z.string(),\n pageId: z.string(),\n pagePersistentId: z.string(),\n updatedByUserId: z.string(),\n designSystemVersionId: z.string(),\n updatedAt: z.coerce.date(),\n createdAt: z.coerce.date(),\n});\n\nexport type CreateDocumentationPageApproval = DbCreateInputOmit<DocumentationPageApproval>;\nexport type DocumentationPageApproval = z.infer<typeof DocumentationPageApproval>;\n","import { z } from \"zod\";\nimport { PageBlockDefinitionAppearance } from \"./aux\";\nimport { PageBlockDefinitionItem } from \"./item\";\n\n//\n// Enums\n//\n\nexport const PageBlockCategory = z.enum([\n \"Text\",\n \"Layout\",\n \"Media\",\n \"Embed\",\n \"Figma\",\n \"Code\",\n \"Guidelines\",\n \"Tokens\",\n \"Components\",\n \"Assets\",\n \"Data\",\n \"Other\",\n]);\n\nexport const PageBlockBehaviorDataType = z.enum([\n \"Item\",\n \"Token\",\n \"Asset\",\n \"Component\",\n \"FigmaNode\",\n \"FigmaComponent\",\n \"File\",\n]);\n\nexport const PageBlockBehaviorSelectionType = z.enum([\"Entity\", \"Group\", \"EntityAndGroup\"]);\n\nexport type PageBlockCategory = z.infer<typeof PageBlockCategory>;\nexport type PageBlockBehaviorDataType = z.infer<typeof PageBlockBehaviorDataType>;\nexport type PageBlockBehaviorSelectionType = z.infer<typeof PageBlockBehaviorSelectionType>;\n\n//\n// Definitions\n//\n\nexport const PageBlockDefinitionBehavior = z.object({\n dataType: PageBlockBehaviorDataType,\n items: z\n .object({\n numberOfItems: z.number(),\n allowLinks: z.boolean(),\n newItemLabel: z.string().optional(),\n })\n .optional(),\n entities: z\n .object({\n selectionType: PageBlockBehaviorSelectionType,\n maxSelected: z.number(),\n })\n .optional(),\n});\n\nexport const PageBlockDefinitionOnboarding = z.object({\n helpText: z.string(),\n documentationLink: z.string().optional(),\n});\n\nexport const PageBlockDefinition = z.object({\n id: z.string(),\n name: z.string(),\n description: z.string(),\n category: PageBlockCategory,\n icon: z.string().optional(),\n documentationLink: z.string().optional(),\n searchKeywords: z.array(z.string()).optional(),\n item: PageBlockDefinitionItem,\n behavior: PageBlockDefinitionBehavior,\n editorOptions: z.object({\n onboarding: PageBlockDefinitionOnboarding.optional(),\n newItemLabel: z.string().optional(),\n }),\n appearance: PageBlockDefinitionAppearance.optional(),\n});\n\nexport type PageBlockDefinitionBehavior = z.infer<typeof PageBlockDefinitionBehavior>;\nexport type PageBlockDefinitionOnboarding = z.infer<typeof PageBlockDefinitionOnboarding>;\nexport type PageBlockDefinition = z.infer<typeof PageBlockDefinition>;\n","import { z } from \"zod\";\n\nexport const DocumentationPageGroup = z.object({\n type: z.literal(\"ElementGroup\"),\n childType: z.literal(\"DocumentationPage\"),\n id: z.string(),\n persistentId: z.string(),\n shortPersistentId: z.string(),\n designSystemVersionId: z.string(),\n parentPersistentId: z.string().nullish(),\n sortOrder: z.number(),\n title: z.string(),\n slug: z.string(),\n userSlug: z.string().nullish(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DocumentationPageGroup = z.infer<typeof DocumentationPageGroup>;\n","import { z } from \"zod\";\nimport { PageBlockImageReference } from \"../elements\";\n\nexport const DocumentationLinkPreview = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n thumbnail: PageBlockImageReference.optional(),\n});\n\nexport type DocumentationLinkPreview = z.infer<typeof DocumentationLinkPreview>;\n","import { z } from \"zod\";\n\nexport const DocumentationPageAnchor = z.object({\n blockId: z.string(),\n level: z.number(),\n text: z.string(),\n});\n\nexport type DocumentationPageAnchor = z.infer<typeof DocumentationPageAnchor>;\n","import { z } from \"zod\";\n\nexport const DocumentationPageContentBackup = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n documentationPageName: z.string(),\n storagePath: z.string(),\n});\n\nexport type DocumentationPageContentBackup = z.infer<typeof DocumentationPageContentBackup>;\n","import { z } from \"zod\";\nimport { PageBlockEditorModelV2, PageSectionEditorModelV2 } from \"../elements\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const DocumentationPageContentItem = z.discriminatedUnion(\"type\", [\n PageBlockEditorModelV2,\n PageSectionEditorModelV2,\n]);\n\nexport const DocumentationPageContentData = z.object({\n items: z.array(DocumentationPageContentItem),\n});\n\nexport const DocumentationPageContent = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n data: DocumentationPageContentData,\n});\n\nexport type DocumentationPageContentItem = z.infer<typeof DocumentationPageContentItem>;\nexport type DocumentationPageContentData = z.infer<typeof DocumentationPageContentData>;\nexport type DocumentationPageContent = z.infer<typeof DocumentationPageContent>;\n\nexport type CreateDocumentationPageContent = DbCreateInputOmit<DocumentationPageContent>;\nexport type UpdateDocumentationPageContent = OmitStrict<\n DbUpdate<DocumentationPageContent>,\n \"designSystemVersionId\" | \"documentationPageId\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const DocumentationPageDependencies = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n\n tokenPersistentIds: z.set(z.string()),\n figmaComponentPersistentIds: z.set(z.string()),\n componentPersistentIds: z.set(z.string()),\n figmaNodePersistentIds: z.set(z.string()),\n groupPersistentIds: z.set(z.string()),\n propertyPersistentIds: z.set(z.string()),\n themePersistentIds: z.set(z.string()),\n documentationPagePersistentIds: z.set(z.string()),\n storybookEntriesStoryIds: z.array(z.string()),\n});\n\nexport type PageContentDependencies = {\n tokenPersistentIds: Set<string>;\n figmaComponentPersistentIds: Set<string>;\n componentPersistentIds: Set<string>;\n figmaNodePersistentIds: Set<string>;\n groupPersistentIds: Set<string>;\n propertyPersistentIds: Set<string>;\n themePersistentIds: Set<string>;\n documentationPagePersistentIds: Set<string>;\n storybookEntriesStoryIds: Array<string>;\n};\nexport type PagesContentDependencies = Map<string, PageContentDependencies>;\n\nexport type DocumentationPageDependencies = z.infer<typeof DocumentationPageDependencies>;\n\nexport type CreateDocumentationPageDependencies = DbCreateInputOmit<DocumentationPageDependencies>;\nexport type UpdateDocumentationPageDependencies = OmitStrict<\n DbUpdate<DocumentationPageDependencies>,\n \"designSystemVersionId\" | \"documentationPageId\"\n>;\n","import { z } from \"zod\";\n\nexport const DocumentationPage = z.object({\n type: z.literal(\"DocumentationPage\"),\n id: z.string(),\n persistentId: z.string(),\n shortPersistentId: z.string(),\n designSystemVersionId: z.string(),\n parentPersistentId: z.string().nullish(),\n sortOrder: z.number(),\n title: z.string(),\n slug: z.string(),\n userSlug: z.string().nullish(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DocumentationPage = z.infer<typeof DocumentationPage>;\n","import { z } from \"zod\";\n\nexport const PageRedirect = z.object({\n id: z.string(),\n pagePersistentId: z.string(),\n path: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n designSystemId: z.string(),\n});\n\nexport type PageRedirect = z.infer<typeof PageRedirect>;\n","import { z } from \"zod\";\n\nexport const DocumentationSettings = z.object({\n // Basic\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n // Configuration\n isTabbedLayoutEnabled: z.boolean(),\n storybookEmbedErrorMessage: z.string().optional(),\n renderCodePackageJson: z.string().optional(),\n selectedBrandPersistentId: z.string().optional(),\n serveDefaultVersionOnly: z.boolean(),\n isPublic: z.boolean(),\n});\n\nexport type DocumentationSettings = z.infer<typeof DocumentationSettings>;\n","import { z } from \"zod\";\n\nexport const DocumentationComment = z.object({\n id: z.string(),\n\n authorId: z.string(),\n threadId: z.string(),\n roomId: z.string(),\n\n createdAt: z.coerce.date(),\n editedAt: z.coerce.date().optional(),\n deletedAt: z.coerce.date().optional(),\n\n body: z.string(),\n});\n\nexport const DocumentationCommentThread = z.object({\n id: z.string(),\n\n roomId: z.string(),\n\n pagePersistentId: z.string(),\n brandId: z.string(),\n designSystemVersionId: z.string(),\n designSystemId: z.string(),\n\n blockId: z.string().optional(),\n resolved: z.boolean(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DocumentationComment = z.infer<typeof DocumentationComment>;\nexport type DocumentationCommentThread = z.infer<typeof DocumentationCommentThread>;\n","import { z } from \"zod\";\nimport { groupBy } from \"../../utils\";\n\nexport const DesignElementSnapshotReason = z.enum([\"Publish\", \"Deletion\"]);\n\nexport const DesignElementSnapshotBase = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n reason: DesignElementSnapshotReason,\n createdByUserId: z.string(),\n});\n\nexport type DesignElementSnapshotBase = z.infer<typeof DesignElementSnapshotBase>;\nexport type DesignElementSnapshotReason = z.infer<typeof DesignElementSnapshotReason>;\n\n//\n// Util functions\n//\n\nexport function pickLatestSnapshots<T extends DesignElementSnapshotBase>(\n snapshots: T[],\n getSnapshotElementId: (snapshot: T) => string\n): T[] {\n const groupedSnapshots = groupBy(snapshots, getSnapshotElementId);\n\n return Array.from(groupedSnapshots.entries()).map(([_, snapshots]) => {\n // Sort snapshots by created at date desc\n const sorted = snapshots.sort((lhs, rhs) => rhs.createdAt.getTime() - lhs.createdAt.getTime());\n return sorted[0];\n });\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { DocumentationPageV2 } from \"../elements\";\nimport { DesignElementSnapshotBase, pickLatestSnapshots } from \"./base\";\n\n/**\n * Snapshot of a documentation page.\n *\n * Please note that existence of snapshot's references (including parent persistent id) is not guaranteed.\n */\nexport const DocumentationPageSnapshot = DesignElementSnapshotBase.extend({\n page: DocumentationPageV2,\n pageContentHash: z.string(),\n pageContentStorageKey: z.string(),\n});\n\nexport type DocumentationPageSnapshot = z.infer<typeof DocumentationPageSnapshot>;\n\nexport type CreateDocumentationPageSnapshot = DbCreateInputOmit<DocumentationPageSnapshot>;\nexport type UpdateDocumentationPageSnapshot = OmitStrict<DbUpdate<DocumentationPageSnapshot>, \"designSystemVersionId\">;\n\n//\n// Util functions\n//\n\nexport function pickLatestPageSnapshots(snapshots: DocumentationPageSnapshot[]): DocumentationPageSnapshot[] {\n return pickLatestSnapshots(snapshots, s => s.page.id);\n}\n","import { z } from \"zod\";\n\nconst FigmaExporterProcessedStylesSchema = z.object({\n display: z\n .union([\n z.literal(\"block\"),\n z.literal(\"inline-block\"),\n z.literal(\"inline\"),\n z.literal(\"flex\"),\n z.literal(\"grid\"),\n z.literal(\"none\"),\n ])\n .optional(),\n position: z\n .union([z.literal(\"absolute\"), z.literal(\"relative\"), z.literal(\"fixed\"), z.literal(\"static\"), z.literal(\"sticky\")])\n .optional(),\n top: z.string().optional(),\n right: z.string().optional(),\n bottom: z.string().optional(),\n left: z.string().optional(),\n width: z.string().optional(),\n height: z.string().optional(),\n minWidth: z.string().optional(),\n minHeight: z.string().optional(),\n maxWidth: z.string().optional(),\n maxHeight: z.string().optional(),\n zIndex: z.number().optional(),\n overflow: z\n .union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"scroll\"), z.literal(\"auto\"), z.literal(\"clip\")])\n .optional(),\n overflowX: z\n .union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"scroll\"), z.literal(\"auto\"), z.literal(\"clip\")])\n .optional(),\n overflowY: z\n .union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"scroll\"), z.literal(\"auto\"), z.literal(\"clip\")])\n .optional(),\n aspectRatio: z.string().optional(),\n flexDirection: z\n .union([z.literal(\"row\"), z.literal(\"row-reverse\"), z.literal(\"column\"), z.literal(\"column-reverse\")])\n .optional(),\n justifyContent: z\n .union([\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"space-between\"),\n z.literal(\"space-around\"),\n z.literal(\"space-evenly\"),\n ])\n .optional(),\n alignItems: z\n .union([\n z.literal(\"stretch\"),\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"baseline\"),\n ])\n .optional(),\n alignSelf: z\n .union([\n z.literal(\"auto\"),\n z.literal(\"stretch\"),\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"baseline\"),\n ])\n .optional(),\n flexGrow: z.number().optional(),\n flexShrink: z.number().optional(),\n flexBasis: z.string().optional(),\n flexWrap: z.union([z.literal(\"nowrap\"), z.literal(\"wrap\"), z.literal(\"wrap-reverse\")]).optional(),\n gap: z.string().optional(),\n rowGap: z.string().optional(),\n columnGap: z.string().optional(),\n gridTemplateColumns: z.string().optional(),\n gridTemplateRows: z.string().optional(),\n gridColumn: z.string().optional(),\n gridRow: z.string().optional(),\n gridAutoFlow: z\n .union([\n z.literal(\"row\"),\n z.literal(\"column\"),\n z.literal(\"dense\"),\n z.literal(\"row dense\"),\n z.literal(\"column dense\"),\n ])\n .optional(),\n alignContent: z\n .union([\n z.literal(\"flex-start\"),\n z.literal(\"flex-end\"),\n z.literal(\"center\"),\n z.literal(\"space-between\"),\n z.literal(\"space-around\"),\n z.literal(\"stretch\"),\n ])\n .optional(),\n padding: z.string().optional(),\n paddingTop: z.string().optional(),\n paddingRight: z.string().optional(),\n paddingBottom: z.string().optional(),\n paddingLeft: z.string().optional(),\n margin: z.string().optional(),\n marginTop: z.string().optional(),\n marginRight: z.string().optional(),\n marginBottom: z.string().optional(),\n marginLeft: z.string().optional(),\n border: z.string().optional(),\n borderWidth: z.string().optional(),\n borderStyle: z.string().optional(),\n borderColor: z.string().optional(),\n borderTop: z.string().optional(),\n borderRight: z.string().optional(),\n borderBottom: z.string().optional(),\n borderLeft: z.string().optional(),\n borderRadius: z.string().optional(),\n borderTopLeftRadius: z.string().optional(),\n borderTopRightRadius: z.string().optional(),\n borderBottomRightRadius: z.string().optional(),\n borderBottomLeftRadius: z.string().optional(),\n backgroundColor: z.string().optional(),\n backgroundImage: z.string().optional(),\n backgroundSize: z.string().optional(),\n backgroundPosition: z.string().optional(),\n backgroundRepeat: z.string().optional(),\n backgroundClip: z\n .union([z.literal(\"border-box\"), z.literal(\"padding-box\"), z.literal(\"content-box\"), z.literal(\"text\")])\n .optional(),\n backgroundOrigin: z.union([z.literal(\"border-box\"), z.literal(\"padding-box\"), z.literal(\"content-box\")]).optional(),\n opacity: z.number().optional(),\n boxShadow: z.string().optional(),\n filter: z.string().optional(),\n backdropFilter: z.string().optional(),\n mixBlendMode: z\n .union([\n z.literal(\"normal\"),\n z.literal(\"multiply\"),\n z.literal(\"screen\"),\n z.literal(\"overlay\"),\n z.literal(\"darken\"),\n z.literal(\"lighten\"),\n z.literal(\"color-dodge\"),\n z.literal(\"color-burn\"),\n z.literal(\"hard-light\"),\n z.literal(\"soft-light\"),\n z.literal(\"difference\"),\n z.literal(\"exclusion\"),\n z.literal(\"hue\"),\n z.literal(\"saturation\"),\n z.literal(\"color\"),\n z.literal(\"luminosity\"),\n z.literal(\"plus-lighter\"),\n ])\n .optional(),\n transform: z.string().optional(),\n transformOrigin: z.string().optional(),\n rotate: z.string().optional(),\n clipPath: z.string().optional(),\n color: z.string().optional(),\n fontFamily: z.string().optional(),\n fontSize: z.string().optional(),\n fontWeight: z.union([z.string(), z.number()]).optional(),\n fontStyle: z.union([z.literal(\"normal\"), z.literal(\"italic\"), z.literal(\"oblique\")]).optional(),\n fontStretch: z.string().optional(),\n fontVariantCaps: z\n .union([\n z.literal(\"normal\"),\n z.literal(\"small-caps\"),\n z.literal(\"all-small-caps\"),\n z.literal(\"petite-caps\"),\n z.literal(\"all-petite-caps\"),\n z.literal(\"unicase\"),\n z.literal(\"titling-caps\"),\n ])\n .optional(),\n lineHeight: z.union([z.string(), z.number()]).optional(),\n letterSpacing: z.string().optional(),\n textAlign: z\n .union([\n z.literal(\"left\"),\n z.literal(\"center\"),\n z.literal(\"right\"),\n z.literal(\"justify\"),\n z.literal(\"start\"),\n z.literal(\"end\"),\n ])\n .optional(),\n textDecorationLine: z\n .union([z.literal(\"none\"), z.literal(\"underline\"), z.literal(\"overline\"), z.literal(\"line-through\")])\n .optional(),\n textDecorationColor: z.string().optional(),\n textDecorationStyle: z\n .union([z.literal(\"solid\"), z.literal(\"double\"), z.literal(\"dotted\"), z.literal(\"dashed\"), z.literal(\"wavy\")])\n .optional(),\n textDecorationThickness: z.string().optional(),\n textTransform: z\n .union([\n z.literal(\"none\"),\n z.literal(\"uppercase\"),\n z.literal(\"lowercase\"),\n z.literal(\"capitalize\"),\n z.literal(\"full-width\"),\n ])\n .optional(),\n whiteSpace: z\n .union([\n z.literal(\"normal\"),\n z.literal(\"nowrap\"),\n z.literal(\"pre\"),\n z.literal(\"pre-wrap\"),\n z.literal(\"pre-line\"),\n z.literal(\"break-spaces\"),\n ])\n .optional(),\n wordBreak: z\n .union([z.literal(\"normal\"), z.literal(\"break-all\"), z.literal(\"keep-all\"), z.literal(\"break-word\")])\n .optional(),\n textOverflow: z.union([z.literal(\"clip\"), z.literal(\"ellipsis\")]).optional(),\n WebkitLineClamp: z.number().optional(),\n WebkitBoxOrient: z.literal(\"vertical\").optional(),\n fontFeatureSettings: z.string().optional(),\n fill: z.string().optional(),\n stroke: z.string().optional(),\n strokeWidth: z.string().optional(),\n strokeLinecap: z.union([z.literal(\"butt\"), z.literal(\"round\"), z.literal(\"square\")]).optional(),\n strokeLinejoin: z.union([z.literal(\"miter\"), z.literal(\"round\"), z.literal(\"bevel\")]).optional(),\n strokeDasharray: z.string().optional(),\n strokeDashoffset: z.string().optional(),\n transition: z.string().optional(),\n animation: z.string().optional(),\n cursor: z.string().optional(),\n userSelect: z.union([z.literal(\"auto\"), z.literal(\"none\"), z.literal(\"text\"), z.literal(\"all\")]).optional(),\n pointerEvents: z\n .union([\n z.literal(\"auto\"),\n z.literal(\"none\"),\n z.literal(\"visiblePainted\"),\n z.literal(\"visibleFill\"),\n z.literal(\"visibleStroke\"),\n z.literal(\"visible\"),\n z.literal(\"painted\"),\n z.literal(\"fill\"),\n z.literal(\"stroke\"),\n z.literal(\"all\"),\n z.literal(\"inherit\"),\n ])\n .optional(),\n visibility: z.union([z.literal(\"visible\"), z.literal(\"hidden\"), z.literal(\"collapse\")]).optional(),\n});\n\ntype ProcessedStyles = z.infer<typeof FigmaExporterProcessedStylesSchema>;\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Schema Definitions\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\nconst FigmaExporterDesignNodeTypeSchema = z.union([\n z.literal(\"FRAME\"),\n z.literal(\"TEXT\"),\n z.literal(\"SVG\"),\n z.literal(\"COMPONENT_INSTANCE\"),\n]);\n\n// Base schema without children for extension\nconst baseDesignNodeObjectSchema = z.object({\n id: z.string(),\n type: FigmaExporterDesignNodeTypeSchema,\n parentId: z.string().nullable(),\n styles: FigmaExporterProcessedStylesSchema.partial(),\n});\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Individual node schemas extending the base\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\nconst frameNodeObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"FRAME\"),\n});\n\nconst textNodeObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"TEXT\"),\n characters: z.string(),\n});\n\nconst svgNodeObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"SVG\"),\n svgString: z.string(),\n});\n\nconst componentInstanceObjectSchema = baseDesignNodeObjectSchema.extend({\n type: z.literal(\"COMPONENT_INSTANCE\"),\n supernovaId: z.string(),\n componentSetName: z.string(),\n componentSetDescription: z.string(),\n componentName: z.string(),\n componentDescription: z.string(),\n props: z.record(z.string(), z.union([z.string(), z.boolean()])),\n});\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Final Node Types with children\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\ntype FrameNode = z.infer<typeof frameNodeObjectSchema> & {\n children: AnyDesignNode[];\n};\n\ntype TextNode = z.infer<typeof textNodeObjectSchema>;\n\ntype SvgNode = z.infer<typeof svgNodeObjectSchema>;\n\ntype ComponentInstanceNode = z.infer<typeof componentInstanceObjectSchema> & {\n children: AnyDesignNode[];\n};\n\ntype AnyDesignNode = FrameNode | TextNode | SvgNode | ComponentInstanceNode;\n\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n// MARK: - Final Schemas with children\n// --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n\nconst frameNodeSchema: z.ZodType<FrameNode> = z.lazy(() =>\n frameNodeObjectSchema.extend({\n children: FigmaExporterAnyDesignNodeSchema.array(),\n })\n);\n\n// Text nodes don't have children\nconst textNodeSchema = textNodeObjectSchema;\n\nconst svgNodeSchema: z.ZodType<SvgNode> = z.lazy(() =>\n svgNodeObjectSchema.extend({\n children: FigmaExporterAnyDesignNodeSchema.array(),\n })\n);\n\nconst componentInstanceNodeSchema: z.ZodType<ComponentInstanceNode> = z.lazy(() =>\n componentInstanceObjectSchema.extend({\n children: FigmaExporterAnyDesignNodeSchema.array(),\n })\n);\n\nexport const FigmaExporterAnyDesignNodeSchema = z.union([\n frameNodeSchema,\n textNodeSchema,\n svgNodeSchema,\n componentInstanceNodeSchema,\n]);\n\n// Exported types - exported like this to avoid naming conflicts and unnecessarily long names\nexport type FigmaExporter = {\n AnyDesignNode: AnyDesignNode;\n FrameNode: FrameNode;\n TextNode: TextNode;\n SvgNode: SvgNode;\n ComponentInstanceNode: ComponentInstanceNode;\n ProcessedStyles: ProcessedStyles;\n};\n","import { z } from \"zod\";\n\nexport const FigmaNodeRendererPayload = z.object({\n designSystemId: z.string(),\n versionId: z.string(),\n figmaNodePersistentIds: z.string().array(),\n});\n\nexport type FigmaNodeRendererPayload = z.infer<typeof FigmaNodeRendererPayload>;\n","import { z } from \"zod\";\nimport { FigmaFileStructureNodeImportModel } from \"../import/figma-frames\";\n\nexport const FigmaNodeStructureDataV2 = z.object({\n rootNode: FigmaFileStructureNodeImportModel,\n assetsInFile: z.object({\n components: z.number(),\n componentSets: z.number(),\n frames: z.number(),\n }),\n});\n\nexport type FigmaNodeStructureDataV2 = z.infer<typeof FigmaNodeStructureDataV2>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const FigmaNodeStructureStateV2 = z.enum([\"InProgress\", \"Success\", \"Failed\"]);\n\nexport const FigmaNodeStructureV2 = z.object({\n id: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n storagePath: z.string().optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n importState: FigmaNodeStructureStateV2,\n error: z.string().optional(),\n chunkSize: z.number().optional(),\n\n // TODO Artem: remove after migration\n isFromLegacyStorage: z.boolean(),\n});\n\nexport type FigmaNodeStructureStateV2 = z.infer<typeof FigmaNodeStructureStateV2>;\nexport type FigmaNodeStructureV2 = z.infer<typeof FigmaNodeStructureV2>;\n\nexport type CreateFigmaNodeStructureV2 = OmitStrict<DbCreateInputOmit<FigmaNodeStructureV2>, \"isFromLegacyStorage\">;\nexport type UpdateFigmaNodeStructureV2 = OmitStrict<\n DbUpdate<FigmaNodeStructureV2>,\n \"designSystemId\" | \"sourceId\" | \"isFromLegacyStorage\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { WorkspaceRoleSchema } from \"../../workspace\";\nimport { DesignSystemRole } from \"./ds-role\";\nimport { DesignSystemInvitation } from \"./invitations\";\n\nexport const DesignSystemMembership = z.object({\n id: z.string(),\n userId: z.string(),\n designSystemId: z.string(),\n designSystemRole: DesignSystemRole.optional(),\n workspaceMembershipId: z.string(),\n workspaceRole: WorkspaceRoleSchema,\n});\n\nexport type DesignSystemMembership = z.infer<typeof DesignSystemMembership>;\n\nexport type CreateDesignSystemMembership = DbCreateInputOmit<DesignSystemMembership>;\nexport type UpdateDesignSystemMembership = OmitStrict<\n DbUpdate<DesignSystemMembership>,\n \"designSystemId\" | \"userId\" | \"workspaceMembershipId\"\n>;\n\nexport const DesignSystemMembers = z.object({\n members: DesignSystemMembership.array(),\n invitations: DesignSystemInvitation.array(),\n});\n\nexport const DesignSystemPendingMemberInvitation = z.object({\n inviteId: z.string(),\n\n /**\n * Role that the user will have in the design system, undefined\n * if it should be inherited from the workspace\n */\n designSystemRole: DesignSystemRole.optional(),\n});\n\nexport const DesignSystemUserInvitation = z.object({\n userId: z.string(),\n\n /**\n * Role that the user will have in the design system, undefined\n * if it should be inherited from the workspace\n */\n designSystemRole: DesignSystemRole.optional(),\n});\n\nexport const DesignSystemInvite = z.object({\n email: z.string(),\n workspaceRole: WorkspaceRoleSchema,\n\n /**\n * Role that the user will have in the design system, undefined\n * if it should be inherited from the workspace\n */\n designSystemRole: DesignSystemRole.optional(),\n});\n\nexport const DesignSystemMemberUpdate = z.object({\n userId: z.string(),\n designSystemRole: DesignSystemRole.nullable(),\n});\n\nexport const DesignSystemInviteUpdate = z.object({\n /**\n * Workspace invitation id\n */\n inviteId: z.string(),\n designSystemRole: DesignSystemRole.nullable(),\n});\n\nexport const DesignSystemMembershipUpdates = z.object({\n usersToInvite: DesignSystemUserInvitation.array().optional(),\n invitesToInvite: DesignSystemPendingMemberInvitation.array().optional(),\n emailsToInvite: DesignSystemInvite.array().optional(),\n\n usersToUpdate: DesignSystemMemberUpdate.array().optional(),\n invitesToUpdate: DesignSystemInviteUpdate.array().optional(),\n\n removeUserIds: z.string().array().optional(),\n deleteInvitationIds: z.string().array().optional(),\n});\n\nexport type DesignSystemMembers = z.infer<typeof DesignSystemMembers>;\nexport type DesignSystemInvite = z.infer<typeof DesignSystemInvite>;\nexport type DesignSystemMemberUpdate = z.infer<typeof DesignSystemMemberUpdate>;\nexport type DesignSystemInviteUpdate = z.infer<typeof DesignSystemInviteUpdate>;\nexport type DesignSystemPendingMemberInvite = z.infer<typeof DesignSystemPendingMemberInvitation>;\nexport type DesignSystemUserInvitation = z.infer<typeof DesignSystemUserInvitation>;\nexport type DesignSystemMembershipUpdates = z.infer<typeof DesignSystemMembershipUpdates>;\n","import { z } from \"zod\";\n\nexport const NpmRegistryAuthType = z.enum([\"Basic\", \"Bearer\", \"None\", \"Custom\"]);\nexport const NpmRegistryType = z.enum([\"NPMJS\", \"GitHub\", \"AzureDevOps\", \"Artifactory\", \"Custom\"]);\n\nexport const NpmRegistryBasicAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.Basic),\n username: z.string(),\n password: z.string(),\n});\n\nexport const NpmRegistryBearerAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.Bearer),\n accessToken: z.string(),\n});\n\nexport const NpmRegistryNoAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.None),\n});\n\nexport const NpmRegistrCustomAuthConfig = z.object({\n authType: z.literal(NpmRegistryAuthType.Enum.Custom),\n authHeaderName: z.string(),\n authHeaderValue: z.string(),\n});\n\nexport const NpmRegistryAuthConfig = z.discriminatedUnion(\"authType\", [\n NpmRegistryBasicAuthConfig,\n NpmRegistryBearerAuthConfig,\n NpmRegistryNoAuthConfig,\n NpmRegistrCustomAuthConfig,\n]);\n\nconst NpmRegistryConfigBase = z.object({\n registryType: NpmRegistryType,\n enabledScopes: z.array(z.string()),\n customRegistryUrl: z.string().optional(),\n bypassProxy: z.boolean().default(false),\n npmProxyRegistryConfigId: z.string().optional(),\n npmProxyVersion: z.number().optional(),\n});\n\nexport const NpmRegistryConfig = NpmRegistryConfigBase.and(NpmRegistryAuthConfig);\n\nexport type NpmRegistryConfig = z.infer<typeof NpmRegistryConfig>;\n","import { z } from \"zod\";\nexport const SsoProvider = z.object({\n providerId: z.string(),\n defaultAutoInviteValue: z.boolean(),\n autoInviteDomains: z.record(z.string(), z.boolean()),\n skipDocsSupernovaLogin: z.boolean(),\n areInvitesDisabled: z.boolean(),\n isTestMode: z.boolean(),\n emailDomains: z.array(z.string()),\n metadataXml: z.string().nullish(),\n});\n\nexport type SsoProvider = z.infer<typeof SsoProvider>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const WorkspaceUntypedData = z.object({\n id: z.string(),\n workspaceId: z.string(),\n value: z.unknown(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type WorkspaceUntypedData = z.infer<typeof WorkspaceUntypedData>;\n\nexport type WorkspaceUntypedDataCreate = DbCreateInputOmit<WorkspaceUntypedData>;\nexport type WorkspaceUntypedDataUpdate = OmitStrict<DbUpdate<WorkspaceUntypedData>, \"id\" | \"workspaceId\">;\n","import { z } from \"zod\";\nimport { WorkspaceRoleSchema } from \"./workspace-role\";\n\nexport const MAX_MEMBERS_COUNT = 100;\n\nexport const UserInvite = z.object({\n email: z\n .string()\n .email()\n .trim()\n .transform(value => value.toLowerCase()),\n role: WorkspaceRoleSchema,\n});\n\nexport const UserInvites = z.array(UserInvite).max(MAX_MEMBERS_COUNT);\n\nexport type UserInvite = z.infer<typeof UserInvite>;\nexport type UserInvites = z.infer<typeof UserInvites>;\n","import { z } from \"zod\";\n\nexport const WorkspaceRoleSchema = z.enum([\"Owner\", \"Admin\", \"Creator\", \"Viewer\", \"Billing\", \"Guest\", \"Contributor\"]);\n\nexport type WorkspaceRole = z.infer<typeof WorkspaceRoleSchema>;\nexport const WorkspaceRole = WorkspaceRoleSchema.enum;\n","import { z } from \"zod\";\nimport { SsoProvider } from \"./sso-provider\";\nimport { WorkspaceIpSettings, WorkspaceProfileUpdate } from \"./workspace\";\nimport { NpmRegistryConfig } from \"./npm-registry-settings\";\n\nexport const WorkspaceConfigurationUpdate = z.object({\n id: z.string(),\n ipWhitelist: WorkspaceIpSettings.optional(),\n sso: SsoProvider.optional(),\n npmRegistrySettings: NpmRegistryConfig.optional(),\n profile: WorkspaceProfileUpdate.optional(),\n});\n\nexport type WorkspaceConfigurationUpdate = z.infer<typeof WorkspaceConfigurationUpdate>;\n","import IPCIDR from \"ip-cidr\";\nimport { z } from \"zod\";\nimport { BillingDetails, Subscription } from \"../billing\";\nimport { DesignSystem } from \"../dsm\";\nimport { DbCreateInputOmit, DbUpdateInputOmit, nullishToOptional } from \"../helpers\";\nimport { NpmRegistryConfig } from \"./npm-registry-settings\";\nimport { SsoProvider } from \"./sso-provider\";\n\nconst isValidCIDR = (value: string) => {\n return IPCIDR.isValidAddress(value);\n};\n\nexport const WorkspaceIpWhitelistEntry = z.object({\n isEnabled: z.boolean(),\n name: z.string(),\n range: z.string().refine(isValidCIDR, {\n message: \"Invalid IP CIDR\",\n }),\n});\n\nexport const WorkspaceIpSettings = z.object({\n isEnabledForCloud: z.boolean(),\n isEnabledForDocs: z.boolean(),\n entries: z.array(WorkspaceIpWhitelistEntry),\n});\n\nexport const WorkspaceProfile = z.object({\n name: z.string(),\n handle: z.string(),\n color: z.string(),\n avatar: nullishToOptional(z.string()),\n billingDetails: nullishToOptional(BillingDetails),\n});\n\nexport const WorkspaceProfileUpdate = WorkspaceProfile.omit({\n avatar: true,\n});\n\nexport type WorkspaceProfileUpdate = z.infer<typeof WorkspaceProfileUpdate>;\n\nexport const Workspace = z.object({\n id: z.string(),\n profile: WorkspaceProfile,\n subscription: Subscription,\n ipWhitelist: nullishToOptional(WorkspaceIpSettings),\n sso: nullishToOptional(SsoProvider),\n npmRegistrySettings: nullishToOptional(NpmRegistryConfig),\n});\n\nexport const WorkspaceWithDesignSystems = z.object({\n workspace: Workspace,\n designSystems: z.array(DesignSystem),\n});\n\nexport type CreateWorkspaceDbInput = DbCreateInputOmit<Workspace>;\nexport type UpdateWorkspaceDbInput = DbUpdateInputOmit<Workspace>;\n\nexport type WorkspaceIpWhitelistEntry = z.infer<typeof WorkspaceIpWhitelistEntry>;\nexport type WorkspaceIpSettings = z.infer<typeof WorkspaceIpSettings>;\nexport type WorkspaceProfile = z.infer<typeof WorkspaceProfile>;\nexport type Workspace = z.infer<typeof Workspace>;\nexport type WorkspaceWithDesignSystems = z.infer<typeof WorkspaceWithDesignSystems>;\n","import { z } from \"zod\";\nimport { ProductCodeSchema } from \"../billing\";\nimport { WorkspaceIpSettings } from \"./workspace\";\nimport { nullishToOptional } from \"../helpers\";\n\nexport const WorkspaceContext = z.object({\n workspaceId: z.string(),\n product: ProductCodeSchema,\n ipWhitelist: nullishToOptional(WorkspaceIpSettings),\n publicDesignSystem: z.boolean().optional(),\n});\n\nexport type WorkspaceContext = z.infer<typeof WorkspaceContext>;\n","import { z } from \"zod\";\nimport { UserInvites } from \"./user-invite\";\nimport { BillingIntervalSchema, CardSchema, InternalStatusSchema, ProductCodeSchema } from \"../billing\";\nimport { slugRegex } from \"../utils/validation\";\nimport { SsoProvider } from \"./sso-provider\";\nimport { NpmRegistryConfig } from \"./npm-registry-settings\";\nimport { WorkspaceIpSettings } from \"./workspace\";\n\nconst WORKSPACE_NAME_MIN_LENGTH: number = 2;\nconst WORKSPACE_NAME_MAX_LENGTH: number = 64;\nexport const HANDLE_MIN_LENGTH = 2;\nexport const HANDLE_MAX_LENGTH = 64;\n\nexport const CreateWorkspaceInput = z.object({\n name: z.string().min(WORKSPACE_NAME_MIN_LENGTH).max(WORKSPACE_NAME_MAX_LENGTH).trim(),\n handle: z\n .string()\n .regex(slugRegex)\n .min(HANDLE_MIN_LENGTH)\n .max(HANDLE_MAX_LENGTH)\n .refine(value => value?.length > 0)\n .optional(),\n});\n\nexport type CreateWorkspaceInput = z.infer<typeof CreateWorkspaceInput>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\nimport { WorkspaceRole } from \"./workspace-role\";\n\nexport const WorkspaceInvitation = z.object({\n id: z.string(),\n email: z.string().email(),\n createdAt: z.coerce.date(),\n resentAt: z.coerce.date().nullish(),\n role: z.nativeEnum(WorkspaceRole),\n workspaceId: z.string(),\n invitedBy: z.string(),\n});\n\nexport type WorkspaceInvitation = z.infer<typeof WorkspaceInvitation>;\n\nexport type CreateWorkspaceInvitation = DbCreateInputOmit<WorkspaceInvitation>;\nexport type UpdateWorkspaceInvitation = OmitStrict<\n DbUpdate<WorkspaceInvitation>,\n \"email\" | \"invitedBy\" | \"workspaceId\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { UserNotificationSettings } from \"../users\";\nimport { OmitStrict } from \"../utils\";\nimport { WorkspaceRole } from \"./workspace-role\";\n\nexport const WorkspaceMembership = z.object({\n id: z.string(),\n userId: z.string(),\n workspaceId: z.string(),\n workspaceRole: z.nativeEnum(WorkspaceRole),\n notificationSettings: UserNotificationSettings,\n isPrimaryOwner: z.boolean().nullish(),\n});\n\nexport type WorkspaceMembership = z.infer<typeof WorkspaceMembership>;\n\nexport type CreateWorkspaceMembership = DbCreateInputOmit<WorkspaceMembership>;\nexport type UpdateWorkspaceMembership = OmitStrict<DbUpdate<WorkspaceMembership>, \"userId\" | \"workspaceId\">;\n\nexport const UpdateMembershipRolesInput = z.object({\n members: z.array(\n z.object({\n userId: z.string(),\n role: z.nativeEnum(WorkspaceRole),\n isPrimaryOwner: z.boolean().optional(),\n })\n ),\n});\n\nexport type UpdateMembershipRolesInput = z.infer<typeof UpdateMembershipRolesInput>;\n","import { z } from \"zod\";\n\nexport const IntegrationAuthType = z.union([z.literal(\"OAuth2\"), z.literal(\"PAT\")]);\n\nexport type IntegrationAuthType = z.infer<typeof IntegrationAuthType>;\n\nexport const ExternalServiceType = z.union([\n z.literal(\"figma\"),\n z.literal(\"github\"),\n z.literal(\"azure\"),\n z.literal(\"gitlab\"),\n z.literal(\"bitbucket\"),\n]);\n\nexport type ExternalServiceType = z.infer<typeof ExternalServiceType>;\n\nexport const IntegrationUserInfo = z.object({\n id: z.string(),\n handle: z.string().optional(),\n avatarUrl: z.string().optional(),\n email: z.string().optional(),\n authType: IntegrationAuthType.optional(),\n customUrl: z.string().optional(),\n});\n\nexport type IntegrationUserInfo = z.infer<typeof IntegrationUserInfo>;\n\nexport const UserLinkedIntegrations = z.object({\n figma: IntegrationUserInfo.optional(),\n github: IntegrationUserInfo.array().optional(),\n azure: IntegrationUserInfo.array().optional(),\n gitlab: IntegrationUserInfo.array().optional(),\n bitbucket: IntegrationUserInfo.array().optional(),\n});\n\nexport type UserLinkedIntegrations = z.infer<typeof UserLinkedIntegrations>;\n","import { z } from \"zod\";\n\nexport const UserAnalyticsCleanupSchedule = z.object({\n userId: z.string(),\n createdAt: z.coerce.date(),\n deleteAt: z.coerce.date(),\n});\n\nexport type UserAnalyticsCleanupSchedule = z.infer<typeof UserAnalyticsCleanupSchedule>;\n\nexport const UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({\n createdAt: true,\n});\n\nexport type UserAnalyticsCleanupScheduleDbInput = z.infer<typeof UserAnalyticsCleanupScheduleDbInput>;\n","import { z } from \"zod\";\n\nexport const UserIdentity = z.object({\n id: z.string(),\n userId: z.string(),\n});\n\nexport type UserIdentity = z.infer<typeof UserIdentity>;\n","import { z } from \"zod\";\n\nexport const UserMinified = z.object({\n id: z.string(),\n name: z.string(),\n email: z.string(),\n avatar: z.string().optional(),\n});\n\nexport type UserMinified = z.infer<typeof UserMinified>;\n","import { z } from \"zod\";\n\nexport const LiveblocksNotificationSettings = z.object({\n sendCommentNotificationEmails: z.boolean(),\n});\nexport type LiveblocksNotificationSettings = z.infer<typeof LiveblocksNotificationSettings>;\n\nexport const UserNotificationSettings = z.object({\n liveblocksNotificationSettings: LiveblocksNotificationSettings,\n});\n\nexport type UserNotificationSettings = z.infer<typeof UserNotificationSettings>;\n\nexport const defaultNotificationSettings: UserNotificationSettings = {\n liveblocksNotificationSettings: {\n sendCommentNotificationEmails: true,\n }\n} as const;\n","import { z } from \"zod\";\n\nexport const UserOnboardingDepartment = z.enum([\"Design\", \"Engineering\", \"Product\", \"Brand\", \"Other\"]);\nexport const UserOnboardingJobLevel = z.enum([\"Executive\", \"Manager\", \"IndividualContributor\", \"Other\"]);\n\nexport const UserTheme = z.object({\n preset: z\n .enum([\n \"Custom\",\n \"Default\",\n \"HighContrast\",\n \"DefaultDark\",\n \"HighContrastDark\",\n \"SpaceBlue\",\n \"DarkGrey\",\n \"SystemPreference\",\n \"Sepia\",\n ])\n .optional(),\n backgroundColor: z.string().optional(),\n accentColor: z.string().optional(),\n contrast: z.number().min(16).max(100).optional(),\n isSecondaryEnabled: z.boolean().optional(),\n secondaryBackgroundColor: z.string().optional(),\n secondaryContrast: z.number().min(16).max(100).optional(),\n isEditorWhite: z.boolean().optional(),\n});\n\nexport const UserOnboarding = z.object({\n companyName: z.string().optional(),\n numberOfPeopleInOrg: z.string().optional(),\n numberOfPeopleInDesignTeam: z.string().optional(),\n department: UserOnboardingDepartment.optional(),\n jobTitle: z.string().optional(),\n phase: z.string().optional(),\n jobLevel: UserOnboardingJobLevel.optional(),\n designSystemName: z.string().optional(),\n defaultDestination: z.string().optional(),\n figmaUrl: z.string().optional(),\n isPageDraftOnboardingFinished: z.boolean().optional(),\n isApprovalsOnboardingFinished: z.boolean().optional(),\n});\n\nexport const UserProfile = z.object({\n name: z.string(),\n avatar: z.string().optional(),\n nickname: z.string().optional(),\n onboarding: UserOnboarding.optional(),\n theme: UserTheme.optional(),\n});\n\nexport type UserOnboardingDepartment = z.infer<typeof UserOnboardingDepartment>;\nexport type UserOnboardingJobLevel = z.infer<typeof UserOnboardingJobLevel>;\nexport type UserOnboarding = z.infer<typeof UserOnboarding>;\nexport type UserTheme = z.infer<typeof UserTheme>;\nexport type UserProfile = z.infer<typeof UserProfile>;\n\n//\n// TO DELETE\n//\n\nexport const UserProfileUpdate = UserProfile.partial().omit({\n avatar: true,\n});\n\nexport type UserProfileUpdate = z.infer<typeof UserProfileUpdate>;\n","import { z } from \"zod\";\n\nexport const UserTest = z.object({\n id: z.string(),\n email: z.string(),\n});\n\nexport type UserTest = z.infer<typeof UserTest>;\n","import { z } from \"zod\";\nimport { UserProfile } from \"./user-profile\";\n\nexport const UserSource = z.enum([\"SignUp\", \"Invite\", \"SSO\"]);\n\nexport const User = z.object({\n id: z.string(),\n email: z.string(),\n createdAt: z.coerce.date(),\n profile: UserProfile,\n loggedOutAt: z.coerce.date().optional(),\n isProtected: z.boolean(),\n source: UserSource.optional(),\n});\n\nexport type UserSource = z.infer<typeof UserSource>;\nexport type User = z.infer<typeof User>;\n","import { z } from \"zod\";\nimport { WorkspaceRole } from \"../../workspace\";\nimport { SupernovaException } from \"../../utils\";\n\nexport const DesignSystemRole = z.enum([\n WorkspaceRole.Admin,\n WorkspaceRole.Contributor,\n WorkspaceRole.Creator,\n WorkspaceRole.Viewer,\n]);\nexport type DesignSystemRole = z.infer<typeof DesignSystemRole>;\n\nexport function workspaceRoleToDesignSystemRole(role: WorkspaceRole): DesignSystemRole {\n switch (role) {\n case \"Owner\":\n case \"Admin\":\n return \"Admin\";\n case \"Creator\":\n return \"Creator\";\n case \"Contributor\":\n return \"Contributor\";\n case \"Billing\":\n case \"Viewer\":\n return \"Viewer\";\n case \"Guest\":\n throw SupernovaException.shouldNotHappen(`Illegal role ${role}`);\n }\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { WorkspaceRoleSchema } from \"../../workspace\";\nimport { DesignSystemRole } from \"./ds-role\";\n\nexport const DesignSystemInvitation = z.object({\n id: z.string(),\n designSystemId: z.string(),\n workspaceInvitationId: z.string(),\n designSystemRole: DesignSystemRole.optional(),\n workspaceRole: WorkspaceRoleSchema,\n});\n\nexport type DesignSystemInvitation = z.infer<typeof DesignSystemInvitation>;\n\nexport type CreateDesignSystemInvitation = DbCreateInputOmit<DesignSystemInvitation>;\nexport type UpdateDesignSystemInvitation = OmitStrict<\n DbUpdate<DesignSystemInvitation>,\n \"designSystemId\" | \"workspaceInvitationId\"\n>;\n","import { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { z } from \"zod\";\n\nexport const ElementViewBaseColumnType = z.enum([\"Name\", \"Description\", \"Value\", \"UpdatedAt\"]);\n\nexport const ElementViewColumnType = z.union([\n z.literal(\"BaseProperty\"),\n z.literal(\"PropertyDefinition\"),\n z.literal(\"Theme\"),\n]);\n\nexport const ElementViewColumnSharedAttributes = z.object({\n id: z.string(),\n persistentId: z.string(),\n elementDataViewId: z.string(),\n sortPosition: z.number(),\n width: z.number(),\n});\n\nexport const ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({\n type: z.literal(\"BaseProperty\"),\n basePropertyType: ElementViewBaseColumnType,\n});\n\nexport const ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({\n type: z.literal(\"PropertyDefinition\"),\n propertyDefinitionId: z.string(),\n});\n\nexport const ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({\n type: z.literal(\"Theme\"),\n themeId: z.string(),\n});\n\nexport const ElementViewColumn = z.discriminatedUnion(\"type\", [\n ElementViewBasePropertyColumn,\n ElementViewPropertyDefinitionColumn,\n ElementViewThemeColumn,\n]);\n\nexport type ElementViewBaseColumnType = z.infer<typeof ElementViewBaseColumnType>;\nexport type ElementViewBasePropertyColumn = z.infer<typeof ElementViewBasePropertyColumn>;\nexport type ElementViewPropertyDefinitionColumn = z.infer<typeof ElementViewPropertyDefinitionColumn>;\nexport type ElementViewThemeColumn = z.infer<typeof ElementViewThemeColumn>;\nexport type ElementViewColumn = z.infer<typeof ElementViewColumn>;\nexport type ElementViewColumnSharedAttributes = z.infer<typeof ElementViewColumnSharedAttributes>;\nexport type ElementViewColumnType = z.infer<typeof ElementViewColumn>[\"type\"];\n\nexport type CreateElementViewColumn =\n | DbCreateInputOmit<ElementViewBasePropertyColumn>\n | DbCreateInputOmit<ElementViewPropertyDefinitionColumn>\n | DbCreateInputOmit<ElementViewThemeColumn>;\n\nexport type UpdateElementViewColumn =\n | OmitStrict<DbUpdate<ElementViewBasePropertyColumn>, \"elementDataViewId\">\n | OmitStrict<DbUpdate<ElementViewPropertyDefinitionColumn>, \"elementDataViewId\">\n | OmitStrict<DbUpdate<ElementViewThemeColumn>, \"elementDataViewId\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { ElementPropertyTargetType } from \"../properties\";\n\nexport const ElementView = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n name: z.string(),\n description: z.string(),\n targetElementType: ElementPropertyTargetType,\n isDefault: z.boolean(),\n});\n\nexport type ElementView = z.infer<typeof ElementView>;\n\nexport type CreateElementView = DbCreateInputOmit<ElementView>;\nexport type UpdateElementView = OmitStrict<DbUpdate<ElementView>, \"designSystemVersionId\" | \"targetElementType\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../helpers\";\n\nexport const Brand = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n name: z.string(),\n description: z.string(),\n});\n\nexport type Brand = z.infer<typeof Brand>;\nexport type CreateBrand = DbCreateInputOmit<Brand>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\n//\n// Enums\n//\n\nexport const DesignSystemAccessMode = z.enum([\"Open\", \"InviteOnly\"]);\nexport type DesignSystemAccessMode = z.infer<typeof DesignSystemAccessMode>;\n\n//\n// Model\n//\n\nexport const DesignSystemSwitcher = z.object({\n isEnabled: z.boolean(),\n designSystemIds: z.array(z.string()),\n});\n\nexport const DesignSystem = z.object({\n id: z.string(),\n workspaceId: z.string(),\n name: z.string(),\n description: z.string(),\n docExporterId: nullishToOptional(z.string()),\n docSlug: z.string(),\n docUserSlug: nullishToOptional(z.string()),\n docSlugDeprecated: z.string(),\n isMultibrand: z.boolean(),\n docViewUrl: nullishToOptional(z.string()),\n basePrefixes: z.array(z.string()),\n designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),\n isApprovalFeatureEnabled: z.boolean(),\n approvalRequiredForPublishing: z.boolean(),\n accessMode: DesignSystemAccessMode,\n membersGenerated: z.boolean(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type DesignSystemSwitcher = z.infer<typeof DesignSystemSwitcher>;\nexport type DesignSystem = z.infer<typeof DesignSystem>;\n\nexport type CreateDesignSystem = DbCreateInputOmit<DesignSystem>;\nexport type UpdateDesignSystem = OmitStrict<DbUpdate<DesignSystem>, \"workspaceId\" | \"docSlug\" | \"docSlugDeprecated\">;\n","import { z } from \"zod\";\nimport { ColorTokenData, PageBlockAsset, TypographyTokenData } from \"./elements\";\n\nexport const ExporterPropertyImageValue = z.object({\n asset: PageBlockAsset.optional(),\n assetId: z.string().optional(),\n assetUrl: z.string().optional(),\n});\n\nexport const ExporterConfigurationPropertyValue = z.object({\n key: z.string(),\n value: z.union([\n z.number(),\n z.string(),\n z.boolean(),\n ExporterPropertyImageValue,\n ColorTokenData,\n TypographyTokenData,\n ]),\n});\n\nexport const ExporterPropertyValuesCollection = z.object({\n id: z.string(),\n designSystemId: z.string(),\n exporterId: z.string(),\n values: z.array(ExporterConfigurationPropertyValue),\n});\n\nexport type ExporterPropertyImageValue = z.infer<typeof ExporterPropertyImageValue>;\nexport type ExporterConfigurationPropertyValue = z.infer<typeof ExporterConfigurationPropertyValue>;\nexport type ExporterPropertyValuesCollection = z.infer<typeof ExporterPropertyValuesCollection>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, nullishToOptional } from \"../helpers\";\n\nexport const PublishedDocPageVisitsEntry = z.object({\n id: z.string(),\n versionId: z.string(),\n pagePersistentId: z.string(),\n locale: z.string().optional(),\n timestamp: z.coerce.date(),\n visits: z.number(),\n userId: nullishToOptional(z.string()),\n anonymousId: nullishToOptional(z.string()),\n});\n\nexport type PublishedDocPageVisitsEntry = z.infer<typeof PublishedDocPageVisitsEntry>;\n\nexport type CreatePublishedDocPageVisitsEntry = DbCreateInputOmit<PublishedDocPageVisitsEntry>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const SHORT_PERSISTENT_ID_LENGTH = 8;\n\nexport function tryParseShortPersistentId(url = \"/\") {\n const lastUrlPart = url.split(\"/\").pop() || \"\";\n const shortPersistentId = lastUrlPart.split(\"-\").pop()?.replaceAll(\".html\", \"\") || null;\n\n return shortPersistentId?.length === SHORT_PERSISTENT_ID_LENGTH ? shortPersistentId : null;\n}\n\nexport const PublishedDocPage = z.object({\n id: z.string(),\n publishedDocId: z.string(),\n pageShortPersistentId: z.string(),\n pagePersistentId: z.string().optional(),\n pathV1: z.string(),\n pathV2: z.string(),\n storagePath: z.string(),\n locale: z.string().optional(),\n\n isPrivate: z.boolean(),\n isHidden: z.boolean(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type PublishedDocPage = z.infer<typeof PublishedDocPage>;\n\nexport type CreatePublishedDocPage = DbCreateInputOmit<PublishedDocPage> & {\n pagePersistentId: string;\n};\n\nexport type UpdatePublishedDocPage = DbUpdate<OmitStrict<PublishedDocPage, \"pageShortPersistentId\" | \"publishedDocId\">>;\n","import { z } from \"zod\";\n\nexport const publishedDocEnvironments = [\"Live\", \"Preview\"] as const;\nexport const PublishedDocEnvironment = z.enum(publishedDocEnvironments);\n\nexport const PublishedDocsChecksums = z.record(z.string());\n\nexport const PublishedDocRoutingVersion = z.enum([\"1\", \"2\"]);\n\nexport const PublishedDoc = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n lastPublishedAt: z.coerce.date(),\n isDefault: z.boolean(),\n isPublic: z.boolean(),\n environment: PublishedDocEnvironment,\n checksums: PublishedDocsChecksums,\n storagePath: z.string(),\n wasMigrated: z.boolean(),\n routingVersion: PublishedDocRoutingVersion,\n usesLocalizations: z.boolean(),\n wasPublishedWithLocalizations: z.boolean(),\n tokenCount: z.number(),\n assetCount: z.number(),\n});\n\nexport type PublishedDocEnvironment = z.infer<typeof PublishedDocEnvironment>;\nexport type PublishedDocsChecksums = z.infer<typeof PublishedDocsChecksums>;\nexport type PublishedDocRoutingVersion = z.infer<typeof PublishedDocRoutingVersion>;\nexport type PublishedDoc = z.infer<typeof PublishedDoc>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const StorybookEntryOrigin = z.object({\n id: z.string(),\n type: z.enum([\"story\", \"docs\"]),\n name: z.string(),\n title: z.string(), // Same as 'kind' for v3\n index: z.number().optional(),\n});\n\nexport const StorybookEntry = z.object({\n id: z.string(),\n storyId: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n aliases: z.array(z.string()).optional(),\n\n url: z.string(),\n isDeleted: z.boolean().optional(),\n\n origin: StorybookEntryOrigin,\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type StorybookEntry = z.infer<typeof StorybookEntry>;\nexport type StorybookEntryOrigin = z.infer<typeof StorybookEntryOrigin>;\nexport type CreateStorybookEntry = OmitStrict<DbCreateInputOmit<StorybookEntry>, \"storyId\">;\nexport type UpdateStorybookEntry = OmitStrict<\n DbUpdate<StorybookEntry>,\n \"sourceId\" | \"designSystemId\" | \"storyId\" | \"id\"\n>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const StorybookPayload = z.object({\n id: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n payload: z.any(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type StorybookPayload = z.infer<typeof StorybookPayload>;\nexport type CreateStorybookPayload = DbCreateInputOmit<StorybookPayload>;\nexport type UpdateStorybookPayload = OmitStrict<DbUpdate<StorybookPayload>, \"designSystemId\" | \"sourceId\" | \"id\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { OmitStrict } from \"../utils\";\n\nexport const DesignSystemVersion = z.object({\n id: z.string(),\n version: z.string(),\n createdAt: z.coerce.date(),\n designSystemId: z.string(),\n name: z.string(),\n comment: z.string(),\n isReadonly: z.boolean(),\n changeLog: z.string(),\n parentId: z.string().optional(),\n isDraftsFeatureAdopted: z.boolean(),\n});\n\nexport type DesignSystemVersion = z.infer<typeof DesignSystemVersion>;\n\nexport type CreateDesignSystemVersion = DbCreateInputOmit<DesignSystemVersion>;\n\nexport type UpdateDesignSystemVersion = OmitStrict<\n DbUpdate<DesignSystemVersion>,\n \"designSystemId\" | \"isReadonly\" | \"version\" | \"parentId\"\n>;\n\n// Jobs\nexport const VersionCreationJobStatus = z.enum([\"Success\", \"InProgress\", \"Error\"]);\n\nexport type VersionCreationJobStatus = z.infer<typeof VersionCreationJobStatus>;\n\nexport const VersionCreationJob = z.object({\n id: z.string(),\n version: z.string(),\n designSystemId: z.string(),\n designSystemVersionId: nullishToOptional(z.string()),\n status: VersionCreationJobStatus,\n errorMessage: nullishToOptional(z.string()),\n});\n\nexport type VersionCreationJob = z.infer<typeof VersionCreationJob>;\n","import { z } from \"zod\";\nimport { CustomDomain } from \"../custom-domains\";\nimport { Asset } from \"../dsm/assets/asset\";\nimport { DataSource } from \"../dsm/data-sources/data-source\";\nimport { DesignSystem } from \"../dsm/design-system\";\nimport { DesignSystemVersionDump } from \"./design-system-version-dump\";\n\nexport const DesignSystemDump = z.object({\n designSystem: DesignSystem,\n dataSources: DataSource.array(),\n versions: DesignSystemVersionDump.array(),\n customDomain: CustomDomain.optional(),\n files: Asset.array(),\n});\n\nexport type DesignSystemDump = z.infer<typeof DesignSystemDump>;\n","import { z } from \"zod\";\nimport { AssetReference } from \"../dsm/assets/asset-reference\";\nimport { Brand } from \"../dsm/brand\";\nimport { DocumentationPageContent } from \"../dsm/documentation/page-content\";\nimport { DocumentationComment, DocumentationCommentThread } from \"../dsm/documentation/thread\";\nimport { DesignElement } from \"../dsm/elements/raw-element\";\nimport { ElementPropertyDefinition } from \"../dsm/properties/property-definition\";\nimport { ElementPropertyValue } from \"../dsm/properties/property-value\";\nimport { DesignSystemVersion } from \"../dsm/version\";\nimport { ElementViewColumn } from \"../dsm/views/column\";\nimport { ElementView } from \"../dsm/views/view\";\nimport { DocumentationPageRoom } from \"../liveblocks\";\nimport { PublishedDocsDump } from \"./published-docs-dump\";\n\nexport const DocumentationThreadDump = z.object({\n thread: DocumentationCommentThread,\n comments: DocumentationComment.array(),\n});\n\nexport const DocumentationPageRoomDump = z.object({\n room: DocumentationPageRoom,\n threads: DocumentationThreadDump.array(),\n});\n\nexport const DesignSystemVersionMultiplayerDump = z.object({\n documentationPages: DocumentationPageRoomDump.array(),\n});\n\nexport const DesignSystemVersionDump = z.object({\n version: DesignSystemVersion,\n brands: Brand.array(),\n elements: DesignElement.array(),\n elementPropertyDefinitions: ElementPropertyDefinition.array(),\n elementPropertyValues: ElementPropertyValue.array(),\n elementViews: ElementView.array(),\n elementColumns: ElementViewColumn.array(),\n documentationPageContents: DocumentationPageContent.array(),\n documentationPageRooms: DocumentationPageRoomDump.array(),\n publishedDocumentations: PublishedDocsDump.array(),\n assetReferences: AssetReference.array(),\n});\n\nexport type DocumentationThreadDump = z.infer<typeof DocumentationThreadDump>;\nexport type DocumentationPageRoomDump = z.infer<typeof DocumentationPageRoomDump>;\nexport type DesignSystemVersionDump = z.infer<typeof DesignSystemVersionDump>;\n","import { z } from \"zod\";\nimport { Entity } from \"../../common/entity\";\nimport { DocumentationPageApproval, DocumentationPageSnapshot, ElementGroupSnapshot } from \"../../dsm\";\nimport { DocumentationPageV2 } from \"../../dsm/elements/documentation-page-v2\";\nimport { ElementGroup } from \"../../dsm/elements/group\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\n\n//\n// Room\n//\n\nexport const DesignSystemVersionRoom = Entity.extend({\n designSystemVersionId: z.string(),\n liveblocksId: z.string(),\n});\n\nexport type DesignSystemVersionRoom = z.infer<typeof DesignSystemVersionRoom>;\n\nexport type CreateDesignSystemVersionRoom = DbCreateInputOmit<DesignSystemVersionRoom>;\nexport type UpdateDesignSystemVersionRoom = DbUpdate<DesignSystemVersionRoom>;\n\n//\n// Room state\n//\n\nexport const DesignSystemVersionRoomInternalSettings = z.object({\n routingVersion: z.string(),\n isDraftFeatureAdopted: z.boolean(),\n isApprovalFeatureEnabled: z.boolean(),\n approvalRequiredForPublishing: z.boolean(),\n});\n\nexport const DesignSystemVersionRoomInitialState = z.object({\n pages: z.array(DocumentationPageV2),\n groups: z.array(ElementGroup),\n\n pageSnapshots: z.array(DocumentationPageSnapshot),\n groupSnapshots: z.array(ElementGroupSnapshot),\n\n pageApprovals: z.array(DocumentationPageApproval),\n internalSettings: DesignSystemVersionRoomInternalSettings,\n\n pageHashes: z.record(z.string()).optional(),\n});\n\nexport const DesignSystemVersionRoomUpdate = z.object({\n pages: z.array(DocumentationPageV2),\n groups: z.array(ElementGroup),\n pageIdsToDelete: z.array(z.string()),\n groupIdsToDelete: z.array(z.string()),\n\n pageSnapshots: z.array(DocumentationPageSnapshot),\n groupSnapshots: z.array(ElementGroupSnapshot),\n pageSnapshotIdsToDelete: z.array(z.string()),\n groupSnapshotIdsToDelete: z.array(z.string()),\n pageHashesToUpdate: z.record(z.string(), z.string()),\n\n pageApprovals: z.array(DocumentationPageApproval),\n pageApprovalIdsToDelete: z.array(z.string()),\n executedTransactionIds: z.array(z.string()),\n});\n\nexport type DesignSystemVersionRoomInternalSettings = z.infer<typeof DesignSystemVersionRoomInternalSettings>;\nexport type DesignSystemVersionRoomInitialState = z.infer<typeof DesignSystemVersionRoomInitialState>;\nexport type DesignSystemVersionRoomUpdate = z.infer<typeof DesignSystemVersionRoomUpdate>;\n","import { z } from \"zod\";\nimport { Entity } from \"../../common/entity\";\nimport { DocumentationPageContentData } from \"../../dsm\";\nimport { PageBlockDefinition } from \"../../dsm/documentation/block-definitions/definition\";\nimport { PageSectionEditorModelV2 } from \"../../dsm/elements/data/documentation-section-v2\";\nimport { DocumentationItemConfigurationV2 } from \"../../dsm/elements/data/documentation-v2\";\nimport { DocumentationPageV2 } from \"../../dsm/elements/documentation-page-v2\";\nimport { ElementGroup } from \"../../dsm/elements/group\";\nimport { PageBlockEditorModelV2 } from \"../../dsm/elements/page-block-v2\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\n\nexport const DocumentationPageRoom = Entity.extend({\n designSystemVersionId: z.string(),\n documentationPageId: z.string(),\n liveblocksId: z.string(),\n isDirty: z.boolean(),\n});\n\nexport type DocumentationPageRoom = z.infer<typeof DocumentationPageRoom>;\n\nexport type CreateDocumentationPageRoom = DbCreateInputOmit<DocumentationPageRoom>;\nexport type UpdateDocumentationPageRoom = OmitStrict<\n DbUpdate<DocumentationPageRoom>,\n \"designSystemVersionId\" | \"documentationPageId\" | \"liveblocksId\"\n>;\n\n//\n// Room content\n//\n\nexport const DocumentationPageRoomState = z.object({\n pageItems: z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),\n});\n\nexport const DocumentationPageRoomRoomUpdate = z.object({\n page: DocumentationPageV2,\n pageParent: ElementGroup,\n});\n\nexport const DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({\n pageItems: z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),\n blockDefinitions: z.array(PageBlockDefinition),\n});\n\nexport const RestoredDocumentationPage = z.object({\n page: DocumentationPageV2,\n pageParent: ElementGroup,\n pageContent: DocumentationPageContentData,\n contentHash: z.string(),\n});\n\nexport const RestoredDocumentationGroup = z.object({\n group: ElementGroup,\n parent: ElementGroup,\n});\n\nexport type DocumentationPageRoomState = z.infer<typeof DocumentationPageRoomState>;\nexport type DocumentationPageRoomRoomUpdate = z.infer<typeof DocumentationPageRoomRoomUpdate>;\nexport type DocumentationPageRoomInitialStateUpdate = z.infer<typeof DocumentationPageRoomInitialStateUpdate>;\nexport type RestoredDocumentationPage = z.infer<typeof RestoredDocumentationPage>;\nexport type RestoredDocumentationGroup = z.infer<typeof RestoredDocumentationGroup>;\n","import { z } from \"zod\";\n\nexport enum RoomTypeEnum {\n DocumentationPageOld = \"documentation-page\",\n DocumentationPage = \"doc-page\",\n DesignSystemVersion = \"design-system-version\",\n Workspace = \"workspace\",\n}\n\nexport const RoomTypeSchema = z.nativeEnum(RoomTypeEnum);\n\nexport type RoomType = z.infer<typeof RoomTypeSchema>;\nexport const RoomType = RoomTypeSchema.enum;\n\n//\n// Room owners\n//\n\nexport type WorkspaceRoomOwner = {\n type: \"Workspace\";\n workspaceId: string;\n};\n\nexport type VersionRoomOwner = {\n type: \"DesignSystemVersion\";\n workspaceId: string;\n designSystemId: string;\n designSystemVersionId: string;\n};\n\nexport type RoomOwner = WorkspaceRoomOwner | VersionRoomOwner;\n\n//\n// Room ids\n//\n\nexport type WorkspaceParsedRoomId = {\n type: RoomTypeEnum.Workspace;\n raw: string;\n};\n\nexport type DesignSystemVersionParsedRoomId = {\n type: RoomTypeEnum.DesignSystemVersion;\n raw: string;\n};\n\nexport type DocumentationPageOldParsedRoomId = {\n type: RoomTypeEnum.DocumentationPageOld;\n raw: string;\n};\n\nexport type DocumentationPageParsedRoomId = {\n type: RoomTypeEnum.DocumentationPage;\n raw: string;\n\n /**\n * Id of DS version, cannot be a wildcard (always a specific ID)\n */\n designSystemVersionId: string;\n\n /**\n * Documentation page persistent ID or wildcard `*`\n */\n pagePersistentId: string;\n};\n\nexport type ParsedRoomId =\n | WorkspaceParsedRoomId\n | DesignSystemVersionParsedRoomId\n | DocumentationPageOldParsedRoomId\n | DocumentationPageParsedRoomId;\n","//\n// Room\n//\n\nimport { z } from \"zod\";\nimport { Entity } from \"../../common/entity\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers/db\";\n\nexport const WorkspaceRoom = Entity.extend({\n workspaceId: z.string(),\n liveblocksId: z.string(),\n});\n\nexport type WorkspaceRoom = z.infer<typeof WorkspaceRoom>;\nexport type CreateWorkspaceRoom = DbCreateInputOmit<WorkspaceRoom>;\nexport type UpdateWorkspaceRoom = DbUpdate<WorkspaceRoom>;\n","import { z } from \"zod\";\nimport { PublishedDoc } from \"../dsm/published-doc\";\nimport { PublishedDocPage } from \"../dsm/published-doc-page\";\n\nexport const PublishedDocsDump = z.object({\n documentation: PublishedDoc,\n pages: PublishedDocPage.array(),\n});\n\nexport type PublishedDocsDump = z.infer<typeof PublishedDocsDump>;\n","import { z } from \"zod\";\nimport { User } from \"../users\";\nimport { WorkspaceDump } from \"./workspace-dump\";\n\nexport const UserDump = z.object({\n user: User,\n workspaces: WorkspaceDump.array(),\n});\n\nexport type UserDump = z.infer<typeof UserDump>;\n","import { z } from \"zod\";\nimport { Integration } from \"../integrations/integration\";\nimport { Workspace } from \"../workspace/workspace\";\nimport { CodeIntegrationDump } from \"./code-integration-dump\";\nimport { DesignSystemDump } from \"./design-system-dump\";\n\nexport const WorkspaceDump = z.object({\n workspace: Workspace,\n designSystems: DesignSystemDump.array(),\n codeIntegration: CodeIntegrationDump,\n integrations: Integration.array(),\n});\n\nexport type WorkspaceDump = z.infer<typeof WorkspaceDump>;\n","import { z } from \"zod\";\nimport { DbUpdate, nullishToOptional } from \"../helpers\";\nimport { UserMinified } from \"../users/user-minified\";\nimport { OmitStrict, tryParseUrl } from \"../utils\";\n\nexport const IntegrationDesignSystem = z.object({\n designSystemId: z.string(),\n brandId: z.string(),\n title: z.string().optional(),\n userId: z.string().optional(),\n date: z.coerce.date().optional(),\n});\n\nexport type IntegrationDesignSystem = z.infer<typeof IntegrationDesignSystem>;\n\nexport const IntegrationCredentialsType = z.enum([\"OAuth2\", \"PAT\"]);\nexport type IntegrationCredentialsType = z.infer<typeof IntegrationCredentialsType>;\n\nexport const IntegrationCredentialsState = z.enum([\"Active\", \"Inactive\"]);\nexport type IntegrationCredentialsState = z.infer<typeof IntegrationCredentialsState>;\n\nexport const IntegrationCredentialsProfile = z.object({\n id: nullishToOptional(z.string()),\n email: nullishToOptional(z.string()),\n handle: nullishToOptional(z.string()),\n type: nullishToOptional(z.string()),\n avatarUrl: nullishToOptional(z.string()),\n organization: nullishToOptional(z.string()),\n collection: nullishToOptional(z.string()),\n});\n\nexport type IntegrationCredentialsProfile = z.infer<typeof IntegrationCredentialsProfile>;\n\nexport const IntegrationCredentials = z.object({\n id: z.string(),\n type: IntegrationCredentialsType,\n integrationId: z.string(),\n accessToken: z.string(),\n userId: z.string(),\n createdAt: z.coerce.date(),\n refreshToken: z.string().optional(),\n tokenName: z.string().optional(),\n expiresAt: z.coerce.date().optional(),\n refreshedAt: z.coerce.date().optional(),\n username: z.string().optional(),\n appInstallationId: z.string().optional(),\n profile: IntegrationCredentialsProfile.optional(),\n customUrl: z.string().optional(),\n state: IntegrationCredentialsState,\n\n user: UserMinified.optional(),\n});\n\nexport type IntegrationCredentials = z.infer<typeof IntegrationCredentials>;\n\nexport type UpdateIntegrationCredential = OmitStrict<\n DbUpdate<IntegrationCredentials>,\n \"id\" | \"integrationId\" | \"appInstallationId\" | \"type\"\n>;\n\nexport const ExtendedIntegrationType = z.enum([\n \"Figma\",\n \"Github\",\n \"Gitlab\",\n \"Bitbucket\",\n \"Azure\",\n \"TokenStudio\",\n \"FigmaVariablesPlugin\",\n]);\nexport type ExtendedIntegrationType = z.infer<typeof ExtendedIntegrationType>;\n\nexport const IntegrationType = ExtendedIntegrationType.exclude([\"TokenStudio\", \"FigmaVariablesPlugin\"]);\nexport type IntegrationType = z.infer<typeof IntegrationType>;\n\nexport const GitIntegrationType = IntegrationType.exclude([\"Figma\"]);\nexport type GitIntegrationType = z.infer<typeof GitIntegrationType>;\n\nexport const Integration = z.object({\n id: z.string(),\n workspaceId: z.string(),\n type: IntegrationType,\n createdAt: z.coerce.date(),\n integrationCredentials: z.array(IntegrationCredentials).optional(),\n});\nexport type Integration = z.infer<typeof Integration>;\nexport type ExtendedIntegration = Omit<Integration, \"type\"> & {\n type: ExtendedIntegrationType;\n integrationDesignSystems?: IntegrationDesignSystem[];\n};\n\nexport const IntegrationToken = z\n .object({\n access_token: z.string(),\n refresh_token: z.string().optional(),\n expires_in: z.union([z.number().optional(), z.string().optional()]),\n token_type: z.string().optional(),\n token_name: z.string().optional(),\n token_azure_organization_name: z.string().optional(), // Azure Cloud PAT only\n token_azure_collection_name: z.string().optional(), // Azure Server PAT only\n token_bitbucket_username: z.string().optional(), // Bitbucket only\n custom_url: z\n .string()\n .optional()\n .transform(value => {\n if (!value?.trim()) return undefined;\n return formatCustomUrl(value);\n }),\n })\n .refine(data => {\n return !data.custom_url || tryParseUrl(data.custom_url);\n }, \"Custom URL must be a valid URL\")\n .refine(data => {\n if (data.custom_url && data.token_azure_organization_name) {\n return false;\n }\n return true;\n }, \"Custom URL and Azure organization name cannot be present at the same time\")\n .transform(data => {\n return {\n accessToken: data.access_token,\n refreshToken: data.refresh_token,\n expiresIn: typeof data.expires_in === \"string\" ? Number(data.expires_in) : data.expires_in,\n tokenType: data.token_type,\n tokenName: data.token_name,\n tokenBitbucketUsername: data.token_bitbucket_username,\n tokenAzureOrganizationName: data.token_azure_organization_name,\n tokenAzureCollection: data.token_azure_collection_name,\n customUrl: data.custom_url,\n };\n });\n\nexport type IntegrationToken = z.infer<typeof IntegrationToken>;\n\n// Custom URL validation\nconst forbiddenCustomUrlDomainList = [\"github.com\", \"gitlab.com\", \"bitbucket.org\", \"figma.com\", \"dev.azure.com\"];\n\nfunction formatCustomUrl(url: string): string | undefined {\n let formattedUrl = url.trim().toLowerCase();\n if (!formattedUrl.startsWith(\"http://\") && !formattedUrl.startsWith(\"https://\")) {\n formattedUrl = \"https://\" + formattedUrl;\n }\n if (formattedUrl.endsWith(\"/\")) {\n formattedUrl = formattedUrl.slice(0, -1);\n }\n\n // do not store default urls that we incorrectly provided as custom urls\n return forbiddenCustomUrlDomainList.some(domain => formattedUrl.includes(domain)) ? undefined : formattedUrl;\n}\n","import { z } from \"zod\";\nimport { User } from \"../users\";\n\nexport const NpmProxyToken = z.object({\n access: z.string(),\n expiresAt: z.number(),\n});\n\nexport type NpmProxyToken = z.infer<typeof NpmProxyToken>;\n\nexport const SessionData = z.object({\n returnToUrl: z.string().optional(),\n npmProxyToken: NpmProxyToken.optional(),\n});\n\nexport type SessionData = z.infer<typeof SessionData>;\n\nexport const Session = z.object({\n id: z.string(),\n expiresAt: z.coerce.date(),\n userId: z.string().nullable(),\n anonymousId: z.string().nullable(),\n data: SessionData,\n});\n\nexport type Session = z.infer<typeof Session>;\n\nexport const AuthTokens = z.object({\n access: z.string(),\n refresh: z.string(),\n});\n\nexport type AuthTokens = z.infer<typeof AuthTokens>;\n\nexport const UserSession = z.object({\n session: Session,\n user: User.nullable(),\n});\n\nexport type UserSession = z.infer<typeof UserSession>;\n","import { z } from \"zod\";\nimport { DesignSystem } from \"../dsm/design-system\";\nimport { User } from \"../users/user\";\nimport { Workspace } from \"../workspace\";\nimport { WorkspaceRoleSchema } from \"../workspace/workspace-role\";\n\n/**\n * Object describing who is going to receive the email.\n *\n * Normally recepient is just an email, however in some cases email can be tailored\n * for who receives it. In this case the email has cutomization based on the role of the\n * recepient in the workspace (or design design system).\n */\nexport const DesignSystemInviteEmailRecipient = z.object({\n email: z.string(),\n role: WorkspaceRoleSchema,\n});\n\n/**\n * Object describing the necessary data to send an email notifying a user that\n * they've been added to a design system.\n */\nexport const DesignSystemInviteEmailData = z.object({\n workspace: Workspace,\n designSystem: DesignSystem,\n invitedBy: User,\n documentationDomain: z.string().optional(),\n});\n\nexport type DesignSystemInviteEmailRecipient = z.infer<typeof DesignSystemInviteEmailRecipient>;\nexport type DesignSystemInviteEmailData = z.infer<typeof DesignSystemInviteEmailData>;\n","import { z } from \"zod\";\nimport { User } from \"../users/user\";\nimport { Workspace } from \"../workspace/workspace\";\nimport { WorkspaceRoleSchema } from \"../workspace/workspace-role\";\n\n/**\n * Object describing who is going to receive the email.\n *\n * Normally recepient is just an email, however in some cases email can be tailored\n * for who receives it. In this case the email has cutomization based on the role of the\n * recepient in the workspace.\n */\nexport const WorkspaceInviteEmailRecipient = z.object({\n email: z.string(),\n role: WorkspaceRoleSchema,\n});\n\n/**\n * Object describing the necessary data to send an email notifying a user that\n * they've been added to a workspace.\n */\nexport const WorkspaceInviteEmailData = z.object({\n workspace: Workspace,\n invitedBy: User,\n documentationDomain: z.string().optional(),\n});\n\nexport type WorkspaceInviteEmailRecipient = z.infer<typeof WorkspaceInviteEmailRecipient>;\nexport type WorkspaceInviteEmailData = z.infer<typeof WorkspaceInviteEmailData>;\n","import { z } from \"zod\";\nimport { EventDataSourceImported } from \"./data-source-imported\";\nimport { EventVersionReleased } from \"./version-released\";\nimport { EventDocumentationPublished } from \"./documentation-published\";\n\nexport const Event = z.discriminatedUnion(\"type\", [\n EventVersionReleased,\n EventDataSourceImported,\n EventDocumentationPublished,\n]);\n\nexport type Event = z.infer<typeof Event>;\n","import { z } from \"zod\";\n\nexport const EventDataSourceImported = z.object({\n type: z.literal(\"DataSourceImported\"),\n workspaceId: z.string(),\n designSystemId: z.string(),\n});\n\nexport type EventDataSourceImported = z.infer<typeof EventDataSourceImported>;\n","import { z } from \"zod\";\n\nexport const EventVersionReleased = z.object({\n type: z.literal(\"DesignSystemVersionReleased\"),\n workspaceId: z.string(),\n designSystemId: z.string(),\n versionId: z.string(),\n});\n\nexport type EventVersionReleased = z.infer<typeof EventVersionReleased>;\n","import { z } from \"zod\";\n\nexport const EventDocumentationPublished = z.object({\n type: z.literal(\"DocumentationPublished\"),\n workspaceId: z.string(),\n designSystemId: z.string(),\n versionId: z.string(),\n});\n\nexport type EventDocumentationPublished = z.infer<typeof EventDocumentationPublished>;\n","import { z } from \"zod\";\nimport { ExporterConfigurationPropertyValue, PublishedDocEnvironment } from \"../../dsm\";\nimport { ExporterPropertyValueMap } from \"../export-configuration\";\n\nexport const ExportJobDocumentationContext = z.object({\n isSingleVersionDocs: z.boolean(),\n versionSlug: z.string(),\n environment: PublishedDocEnvironment,\n});\n\nexport const ExportJobDebugContext = z.object({\n debugMode: z.boolean().optional(),\n concurrency: z.number().optional(),\n preloadData: z.string().optional(),\n concurrencyMode: z.string().optional(),\n cacheSdk: z.string().optional(),\n logSdkNetwork: z.boolean().optional(),\n profilerMode: z.string().optional(),\n});\n\nexport const ExportJobContext = z.object({\n apiUrl: z.string(),\n accessToken: z.string(),\n\n designSystemId: z.string(),\n designSystemName: z.string(),\n exporterId: z.string(),\n versionId: z.string(),\n brandId: z.string().optional(),\n themeId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n previewMode: z.boolean().optional(),\n\n exporterName: z.string(),\n\n documentation: ExportJobDocumentationContext.optional(),\n debug: ExportJobDebugContext.optional(),\n});\n\nexport const ExportJobExporterConfiguration = z.object({\n exporterPackageUrl: z.string(),\n exporterPropertyValues: ExporterConfigurationPropertyValue.array(),\n exporterPropertyValuesV2: ExporterPropertyValueMap.optional(),\n});\n\nexport type ExportJobDocumentationContext = z.infer<typeof ExportJobDocumentationContext>;\nexport type ExportJobDebugContext = z.infer<typeof ExportJobDebugContext>;\nexport type ExportJobExporterConfiguration = z.infer<typeof ExportJobExporterConfiguration>;\nexport type ExportJobContext = z.infer<typeof ExportJobContext>;\n","import { z } from \"zod\";\n\nexport const ExporterFunctionPayload = z.object({\n exportJobId: z.string(),\n exportContextId: z.string(),\n designSystemId: z.string(),\n workspaceId: z.string(),\n exporterId: z.string(),\n});\n\nexport type ExporterFunctionPayload = z.infer<typeof ExporterFunctionPayload>;\n","import { z } from \"zod\";\nimport { PublishedDocEnvironment } from \"../dsm\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { ExporterPropertyValueMap } from \"./export-configuration\";\nimport { ExportDestinationsMap } from \"./export-destinations\";\n\n//\n// Enums\n//\n\nexport const ExportJobDestinationType = z.enum([\n \"s3\",\n \"webhookUrl\",\n \"github\",\n \"documentation\",\n \"azure\",\n \"gitlab\",\n \"bitbucket\",\n]);\nexport const ExportJobStatus = z.enum([\"InProgress\", \"Success\", \"Failed\", \"Timeout\"]);\nexport const ExportJobLogEntryType = z.enum([\"success\", \"info\", \"warning\", \"error\", \"user\"]);\n\nexport type ExportJobDestinationType = z.infer<typeof ExportJobDestinationType>;\nexport type ExportJobStatus = z.infer<typeof ExportJobStatus>;\nexport type ExportJobLogEntryType = z.infer<typeof ExportJobLogEntryType>;\n\n//\n// Results\n//\n\nexport const ExportJobLogEntry = z.object({\n id: z.string().optional(),\n time: z.coerce.date(),\n type: ExportJobLogEntryType,\n message: z.string(),\n});\n\nexport const ExportJobPullRequestDestinationResult = z.object({\n pullRequestUrl: z.string(),\n});\n\nexport const ExportJobS3DestinationResult = z.object({\n bucket: z.string(),\n urlPrefix: z.string().optional(),\n path: z.string(),\n files: z.array(z.string()),\n\n url: nullishToOptional(z.string()),\n urls: nullishToOptional(z.string().array()),\n});\n\nexport const ExportJobDocsDestinationResult = z.object({\n url: z.string(),\n});\n\nexport const ExportJobResult = z.object({\n error: z.string().optional(),\n s3: nullishToOptional(ExportJobS3DestinationResult),\n github: nullishToOptional(ExportJobPullRequestDestinationResult),\n azure: nullishToOptional(ExportJobPullRequestDestinationResult),\n gitlab: nullishToOptional(ExportJobPullRequestDestinationResult),\n bitbucket: nullishToOptional(ExportJobPullRequestDestinationResult),\n sndocs: nullishToOptional(ExportJobDocsDestinationResult),\n logs: nullishToOptional(ExportJobLogEntry.array()),\n});\n\nexport type ExportJobLogEntry = z.infer<typeof ExportJobLogEntry>;\nexport type ExportJobPullRequestDestinationResult = z.infer<typeof ExportJobPullRequestDestinationResult>;\nexport type ExportJobS3DestinationResult = z.infer<typeof ExportJobS3DestinationResult>;\nexport type ExportJobDocsDestinationResult = z.infer<typeof ExportJobDocsDestinationResult>;\nexport type ExportJobResult = z.infer<typeof ExportJobResult>;\n\n//\n// Job\n//\n\nexport const ExportJob = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n finishedAt: z.coerce.date().optional(),\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n workspaceId: z.string(),\n scheduleId: z.string().nullish(),\n exporterId: z.string(),\n brandId: z.string().optional(),\n themeId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n estimatedExecutionTime: z.number().optional(),\n status: ExportJobStatus,\n result: ExportJobResult.optional(),\n createdByUserId: z.string().optional(),\n exporterPropertyValues: ExporterPropertyValueMap.optional(),\n previewMode: z.boolean().optional(),\n exportContextId: z.string().optional().nullable(),\n\n // Destinations\n ...ExportDestinationsMap.shape,\n});\n\nexport type ExportJob = z.infer<typeof ExportJob>;\n\nexport type CreateExportJob = DbCreateInputOmit<ExportJob>;\nexport type UpdateExportJob = Pick<DbUpdate<ExportJob>, \"id\" | \"status\" | \"result\" | \"finishedAt\">;\n\n//\n// Support\n//\n\nexport const ExportJobFindByFilter = ExportJob.pick({\n exporterId: true,\n designSystemVersionId: true,\n createdByUserId: true,\n status: true,\n scheduleId: true,\n designSystemId: true,\n themeId: true,\n brandId: true,\n})\n .extend({\n destinations: z.array(ExportJobDestinationType),\n docsEnvironment: PublishedDocEnvironment,\n })\n .partial();\n\nexport type ExportJobFindByFilter = z.infer<typeof ExportJobFindByFilter>;\n","import { z } from \"zod\";\n\nconst ExporterType = z.enum([\"documentation\", \"code\"]);\n\nexport const ListExporterQuery = z.object({\n limit: z.number().optional(),\n offset: z.number().optional(),\n type: ExporterType.optional(),\n search: z.string().optional(),\n});\n\nexport type ListExporterQuery = z.infer<typeof ListExporterQuery>;\n","import { z } from \"zod\";\n\nexport const ExporterWorkspaceMembershipRole = z.enum([\"Owner\", \"OwnerArchived\", \"User\"]);\nexport type ExporterWorkspaceMembershipRole = z.infer<typeof ExporterWorkspaceMembershipRole>;\n","import { z } from \"zod\";\nimport { ExporterWorkspaceMembershipRole } from \"./exporter-workspace-membership-role\";\nimport { DbCreateInputOmit } from \"../helpers\";\n\nexport const ExporterWorkspaceMembership = z.object({\n id: z.string(),\n workspaceId: z.string(),\n exporterId: z.string(),\n role: ExporterWorkspaceMembershipRole,\n});\n\nexport type ExporterWorkspaceMembership = z.infer<typeof ExporterWorkspaceMembership>;\n\nexport type CreateExporterMembership = DbCreateInputOmit<ExporterWorkspaceMembership>;\n","import { z } from \"zod\";\n\nexport const FlaggedFeature = z.enum([\n \"FigmaImporterV2\",\n \"DisableImporter\",\n \"VariablesOrder\",\n \"TypographyPropsKeepAliases\",\n \"GradientPropsKeepAliases\",\n \"ShadowPropsKeepAliases\",\n \"NonCompatibleTypeChanges\",\n \"TypographyUseFontStyle\",\n \"FigmaImporterV3\",\n\n \"PulsarDebugMode\",\n \"PulsarLogSdkNetwork\",\n \"PulsarCacheSdk\",\n \"PulsarPreloadData\",\n \"PulsarConcurrencyMode\",\n \"PulsarConcurrency\",\n \"PulsarProfilerMode\",\n]);\n\nexport const FeatureFlagMap = z.record(FlaggedFeature, z.boolean());\nexport const FeatureFlag = z.object({\n id: z.string(),\n feature: FlaggedFeature,\n createdAt: z.coerce.date(),\n enabled: z.boolean(),\n designSystemId: z.string().optional(),\n data: z.record(z.any()).nullable().optional(),\n});\n\nexport type FlaggedFeature = z.infer<typeof FlaggedFeature>;\nexport type FeatureFlagMap = z.infer<typeof FeatureFlagMap>;\nexport type FeatureFlag = z.infer<typeof FeatureFlag>;\n","import { z } from \"zod\";\nimport { OAuthProviderSchema } from \"./oauth-providers\";\n\nexport const ExternalOAuthRequest = z.object({\n id: z.string(),\n provider: OAuthProviderSchema,\n userId: z.string(),\n state: z.string(),\n createdAt: z.coerce.date(),\n});\n\nexport type ExternalOAuthRequest = z.infer<typeof ExternalOAuthRequest>;\n","import { z } from \"zod\";\n\nexport enum OAuthProviderNames {\n Figma = \"figma\",\n Azure = \"azure\",\n Github = \"github\",\n Gitlab = \"gitlab\",\n Bitbucket = \"bitbucket\",\n}\n\nexport const OAuthProviderSchema = z.nativeEnum(OAuthProviderNames);\nexport type OAuthProvider = z.infer<typeof OAuthProviderSchema>;\nexport const OAuthProvider = OAuthProviderSchema.enum;\n","import { z } from \"zod\";\n\nexport const GitObjectsQuery = z.object({\n organization: z.string().optional(), // Azure Organization | Bitbucket Workspace slug | Gitlab Group | Github Account (User or Organization)\n project: z.string().optional(), // Only for Bitbucket and Azure\n repository: z.string().optional(), // For all providers. For Gitlab, it's called \"project\".\n branch: z.string().optional(), // For all providers.\n user: z.string().optional(), // Gitlab user\n});\n\nexport type GitObjectsQuery = z.infer<typeof GitObjectsQuery>;\n\nexport const GitOrganization = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\n\nexport const GitProject = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\n\nexport const GitRepository = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n\n /**\n * Can be undefined when:\n * - there are no branches in the repository yet\n * - Git provider doesn't expose this information on a repository via their API\n */\n defaultBranch: z.string().optional(),\n});\n\nexport const GitBranch = z.object({\n name: z.string(),\n lastCommitId: z.string(),\n});\n\nexport type GitOrganization = z.infer<typeof GitOrganization>;\nexport type GitProject = z.infer<typeof GitProject>;\nexport type GitRepository = z.infer<typeof GitRepository>;\nexport type GitBranch = z.infer<typeof GitBranch>;\n","import { z } from \"zod\";\nimport { OAuthProviderSchema } from \"./oauth-providers\";\n\nexport const IntegrationTokenSchemaOld = z.object({\n id: z.string(),\n provider: OAuthProviderSchema,\n scope: z.string(),\n userId: z.string(),\n accessToken: z.string(),\n refreshToken: z.string(),\n expiresAt: z.coerce.date(),\n externalUserId: z.string().nullish(),\n});\n\n// Renamed because will be deleted later after full migration / end of project\nexport type IntegrationTokenOld = z.infer<typeof IntegrationTokenSchemaOld>;\n","import { z } from \"zod\";\nimport { OAuthProviderSchema } from \"./oauth-providers\";\n\nexport const WorkspaceOAuthRequestSchema = z.object({\n id: z.string(),\n workspaceId: z.string(),\n provider: OAuthProviderSchema,\n userId: z.string(),\n createdAt: z.coerce.date(),\n});\n\nexport type WorkspaceOAuthRequest = z.infer<typeof WorkspaceOAuthRequestSchema>;\n","import { z } from \"zod\";\n\nconst AnyRecord = z.record(z.any());\n\nconst NpmPackageVersionDist = AnyRecord.and(\n z.object({\n tarball: z.string(),\n })\n);\n\nconst NpmPackageVersion = AnyRecord.and(\n z.object({\n dist: NpmPackageVersionDist,\n })\n);\n\nexport const NpmPackage = AnyRecord.and(\n z.object({\n _id: z.string(),\n name: z.string(),\n\n // e.g. \"latest\": \"1.2.3\"\n \"dist-tags\": z.record(z.string(), z.string()),\n\n // \"1.2.3\": {...}\n versions: z.record(NpmPackageVersion),\n })\n);\n\nexport type NpmPackage = z.infer<typeof NpmPackage>;\n","import { z } from \"zod\";\n\nexport const NpmProxyTokenPayload = z.object({\n npmProxyRegistryConfigId: z.string(),\n});\n\nexport type NpmProxyTokenPayload = z.infer<typeof NpmProxyTokenPayload>;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate, nullishToOptional } from \"../helpers\";\nimport { UserTheme } from \"../users\";\nimport { OmitStrict } from \"../utils\";\n\nexport const PortalSettingsTheme = nullishToOptional(UserTheme);\n\nexport const PortalSettings = z.object({\n id: z.string(),\n workspaceId: z.string(),\n\n enabledDesignSystemIds: z.array(z.string()),\n enabledBrandPersistentIds: z.array(z.string()),\n\n theme: PortalSettingsTheme,\n sidebar: nullishToOptional(z.any()),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport type PortalSettingsTheme = z.infer<typeof PortalSettingsTheme>;\nexport type PortalSettings = z.infer<typeof PortalSettings>;\nexport type CreatePortalSettings = DbCreateInputOmit<PortalSettings>;\nexport type UpdatePortalSettings = OmitStrict<DbUpdate<PortalSettings>, \"workspaceId\">;\n","import { z } from \"zod\";\nimport { DbCreateInputOmit } from \"../helpers\";\nimport { WorkspaceRoleSchema } from \"../workspace\";\n\nexport const PersonalAccessToken = z.object({\n id: z.string(),\n userId: z.string(),\n\n workspaceId: z.string().optional(),\n designSystemId: z.string().optional(),\n workspaceRole: WorkspaceRoleSchema.optional(),\n\n name: z.string(),\n hidden: z.boolean(),\n\n token: z.string(),\n scope: z.string().optional(),\n\n createdAt: z.coerce.date(),\n expireAt: z.coerce.date().optional(),\n});\n\nexport type PersonalAccessToken = z.infer<typeof PersonalAccessToken>;\n\nexport type CreatePersonalAccessToken = DbCreateInputOmit<PersonalAccessToken>;\n","import { OptionalToNullable } from \"../utils\";\n\nexport type DbCreateInputOmit<T> = Omit<T, \"id\" | \"createdAt\" | \"updatedAt\">;\n\nexport type DbUpdateInputOmit<T> = Omit<T, \"createdAt\" | \"updatedAt\" | \"persistentId\">;\n\nexport type DbUpdate<T extends { id: string }> = Partial<OptionalToNullable<DbUpdateInputOmit<Omit<T, \"id\">>>> &\n Pick<T, \"id\">;\n\nexport function zodCreateInputOmit() {\n return {\n id: true,\n createdAt: true,\n updatedAt: true,\n } as const;\n}\n\nexport function zodUpdateInputOmit() {\n return {\n id: true,\n createdAt: true,\n updatedAt: true,\n persistentId: true,\n } as const;\n}\n","import { ZodType, ZodTypeDef } from \"zod\";\n\n/**\n * Allows both null and undefined as input values in addition to the actual value,\n * but coerces them both to undefined.\n */\nexport function nullishToOptional<I, O>(type: ZodType<I, ZodTypeDef, O>) {\n return type.nullish().transform(t => t ?? undefined);\n}\n","export type SupernovaExceptionType =\n | \"AccessDenied\"\n | \"ResourceNotFound\"\n | \"WrongFormat\"\n | \"TooMuchWork\"\n | \"Timeout\"\n | \"Conflict\"\n | \"NotImplemented\"\n | \"BadRequest\"\n | \"WrongActionOrder\"\n | \"InvalidOperation\"\n | \"UnexpectedError\"\n | \"IPRestricted\"\n | \"PlanRestricted\"\n | \"MissingWorkspacePermission\"\n | \"MissingExporterPermission\"\n | \"MissingIntegration\"\n | \"MissingIntegrationAccess\"\n | \"NoAccess\"\n | \"MissingCredentials\"\n | \"ValidationError\"\n | \"ThirdPartyError\";\n\nexport class SupernovaException extends Error {\n static wrongFormat(message?: string): SupernovaException {\n return new SupernovaException(\"WrongFormat\", message);\n }\n\n static validationError(message?: string): SupernovaException {\n return new SupernovaException(\"ValidationError\", message);\n }\n\n static accessDenied(message?: string): SupernovaException {\n return new SupernovaException(\"AccessDenied\", message);\n }\n\n static tooMuchWork(message?: string): SupernovaException {\n return new SupernovaException(\"TooMuchWork\", message);\n }\n\n static notFound(message?: string): SupernovaException {\n return new SupernovaException(\"ResourceNotFound\", message);\n }\n\n static timeout(message?: string): SupernovaException {\n return new SupernovaException(\"Timeout\", message);\n }\n\n static conflict(message?: string): SupernovaException {\n return new SupernovaException(\"Conflict\", message);\n }\n\n static notImplemented(message?: string): SupernovaException {\n return new SupernovaException(\"NotImplemented\", message);\n }\n\n static wrongActionOrder(message?: string): SupernovaException {\n return new SupernovaException(\"WrongActionOrder\", message);\n }\n\n static invalidOperation(message?: string): SupernovaException {\n return new SupernovaException(\"InvalidOperation\", message);\n }\n\n static shouldNotHappen(message?: string): SupernovaException {\n return new SupernovaException(\"UnexpectedError\", message);\n }\n\n static ipRestricted(message?: string): SupernovaException {\n return new SupernovaException(\"IPRestricted\", message);\n }\n\n static planRestricted(message?: string): SupernovaException {\n return new SupernovaException(\"PlanRestricted\", message);\n }\n\n static missingWorkspacePermission(message?: string): SupernovaException {\n return new SupernovaException(\"MissingWorkspacePermission\", message);\n }\n\n static missingExporterPermission(message?: string): SupernovaException {\n return new SupernovaException(\"MissingExporterPermission\", message);\n }\n\n static missingIntegration(message?: string): SupernovaException {\n return new SupernovaException(\"MissingIntegration\", message);\n }\n\n static missingIntegrationAccess(message?: string): SupernovaException {\n return new SupernovaException(\"MissingIntegrationAccess\", message);\n }\n\n static noAccess(message?: string): SupernovaException {\n return new SupernovaException(\"NoAccess\", message);\n }\n\n static missingCredentials(message?: string): SupernovaException {\n return new SupernovaException(\"MissingCredentials\", message);\n }\n\n static thirdPartyError(message?: string): SupernovaException {\n return new SupernovaException(\"ThirdPartyError\", message);\n }\n\n //\n // To refactor\n //\n\n static badRequest(message?: string): SupernovaException {\n return new SupernovaException(\"BadRequest\", message);\n }\n\n //\n // Properties\n //\n\n constructor(readonly type: SupernovaExceptionType, message?: string) {\n const fullMessage = message || `${type}: something went wrong`;\n super(fullMessage);\n }\n}\n","import { SupernovaException } from \"./errors\";\n\nexport type OmitStrict<T, K extends keyof T> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;\n\nexport type Nullish<T> = T | null | undefined;\n\nexport type ExplicitPartial<T> = { [P in keyof T]: T[P] | undefined };\n\n// Magic as far as I'm concerned.\n// Taken from https://stackoverflow.com/a/50375286/3229534\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;\n\n// This utility lets T be indexed by any key\ntype Indexify<T> = T & { [str: string]: undefined };\n\n// To make a type where all values are undefined, so that in AllUnionKeys<T>\n// TS doesn't remove the keys whose values are incompatible, e.g. string & number\ntype UndefinedVals<T> = { [K in keyof T]: undefined };\n\n// This returns a union of all keys present across all members of the union T\ntype AllUnionKeys<T> = keyof UnionToIntersection<UndefinedVals<T>>;\n\n// Where the (rest of the) magic happens ✨\nexport type AllFields<T> = { [K in AllUnionKeys<T> & string]: Indexify<T>[K] };\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type Defined<T> = T extends null | undefined ? never : T;\n\n// Makes specific properties in the type required\nexport type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };\n\ntype PickOptional<T> = {\n [P in keyof T as undefined extends T[P] ? P : never]: T[P];\n};\n\ntype PickNotOptional<T> = {\n [P in keyof T as undefined extends T[P] ? never : P]: T[P];\n};\n\nexport type OptionalToNullable<T> = {\n [K in keyof PickOptional<T>]-?: Exclude<T[K], undefined> | null;\n} & {\n [K in keyof PickNotOptional<T>]: T[K];\n};\n\nexport function forceUnwrapNullish<T>(value: Nullish<T>): T {\n if (value === null) throw new Error(\"Illegal null\");\n if (value === undefined) throw new Error(\"Illegal undefined\");\n return value;\n}\n\nexport function trimLeadingSlash(string: string): string {\n return string.startsWith(\"/\") ? string.substring(1) : string;\n}\n\nexport function trimTrailingSlash(string: string): string {\n return string.endsWith(\"/\") ? string.substring(0, string.length - 1) : string;\n}\n\nexport function tryParseUrl(url: string): URL | null {\n try {\n return parseUrl(url);\n } catch (e) {\n console.error(`Error parsing URL ${url}`);\n console.error(e);\n return null;\n }\n}\n\nexport function parseUrl(url: string): URL {\n return new URL(url.startsWith(\"https://\") || url.startsWith(\"http://\") ? url : `https://${url}`);\n}\n\nexport function mapByUnique<V, K>(items: Iterable<V>, keyFn: (item: V) => K): Map<K, V> {\n const result = new Map<K, V>();\n for (const item of items) {\n result.set(keyFn(item), item);\n }\n return result;\n}\n\nexport function groupBy<V, K>(items: V[], keyFn: (item: V) => K): Map<K, V[]> {\n const result = new Map<K, V[]>();\n\n for (const item of items) {\n const key = keyFn(item);\n const array = result.get(key);\n if (array) {\n array.push(item);\n } else {\n result.set(key, [item]);\n }\n }\n\n return result;\n}\n\nexport function filterNonNullish<T>(items: Nullish<T>[]): T[] {\n return items.filter(Boolean) as T[];\n}\n\nexport function nonNullishFilter<T>(item: Nullish<T>): item is T {\n return !!item;\n}\n\nexport function nonNullFilter<T>(item: T | null): item is T {\n return item !== null;\n}\n\nexport type ArrayElementType<T extends Default[], Default = any> = T extends (infer U)[] ? U : Default;\n\nexport function buildConstantEnum<Inferred extends ArrayElementType<Passed>[], Passed extends string[]>(\n values: Inferred\n): { [key in Inferred[number]]: key } {\n const constMap = values.reduce((acc, code) => ({ ...acc, [code]: code }), {});\n\n return constMap as { [key in Inferred[number]]: key };\n}\n\nexport async function promiseWithTimeout<T>(\n timeoutMs: number,\n promise: () => Promise<T>,\n onTimeout?: () => Error\n): Promise<T> {\n let timeoutHandle: NodeJS.Timeout | undefined;\n const timeoutPromise = new Promise<never>((_, reject) => {\n timeoutHandle = setTimeout(() => reject(onTimeout?.() ?? SupernovaException.timeout()), timeoutMs);\n });\n\n const result = await Promise.race([promise(), timeoutPromise]);\n\n clearTimeout(timeoutHandle);\n return result;\n}\n\nexport async function sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nexport function uniqueBy<K, V>(items: V[], prop: (v: V) => K): V[] {\n return Array.from(mapByUnique(items, prop).values());\n}\n\nexport function areShallowObjectsEqual<T extends object>(lhs: T | undefined, rhs: T | undefined) {\n if ((lhs === undefined) !== (rhs === undefined)) return false;\n if (lhs === undefined || rhs === undefined) return true;\n\n if ((lhs === null) !== (rhs === null)) return false;\n if (lhs === null || rhs === null) return true;\n\n for (const key in lhs) {\n if (!(key in rhs) || lhs[key] !== rhs[key]) {\n return false;\n }\n }\n\n for (const key in rhs) {\n if (!(key in lhs)) {\n return false;\n }\n }\n\n return true;\n}\n\nexport function isNotNullish<T>(value: T | null | undefined): value is T {\n return !isNullish(value);\n}\n\nexport function isNullish<T>(value: T | null | undefined): value is null | undefined {\n return value === null || value === undefined;\n}\n\nexport function hasProperty<K extends string>(prop: K) {\n return <T extends { [key in K]?: unknown }>(obj: T): obj is T & Required<Pick<T, K>> => {\n return obj[prop] !== null && obj[prop] !== undefined;\n };\n}\n\nexport function chunkedArray<V>(array: V[], chunkSize: number): V[][] {\n const result: V[][] = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n result.push(array.slice(i, i + chunkSize));\n }\n return result;\n}\n\nexport function recordToMap<V>(record: Record<string, V>): Map<string, V> {\n const map = new Map<string, V>();\n for (const [k, v] of Object.entries(record)) map.set(k, v);\n return map;\n}\n\n/**\n * Applies direct properties from `update` to `object`.\n *\n * - In case a property is not defined in `update`, it `object` will retain the current one\n * - In case a property is null in `update`, it will be removed from `object`\n *\n * @param object base object to perform updates on\n * @param update source of property updates\n * @returns object by merging updates from `update` into `object`\n */\nexport function applyShallowObjectUpdate<T>(object: T, update: Partial<OptionalToNullable<T>>): T {\n const objectShallowCopy = { ...object };\n\n for (const [key, value] of Object.entries(update)) {\n if (value === null) {\n // @ts-expect-error it's very hard to get typescript to believe that the types will match\n objectShallowCopy[key] = undefined;\n } else if (value !== undefined) {\n // @ts-expect-error it's very hard to get typescript to believe that the types will match\n objectShallowCopy[key] = value;\n }\n }\n\n return objectShallowCopy;\n}\n\nexport type Pagination = {\n skip?: number;\n take?: number;\n};\n","const shortPersistentIdLength = 8;\nconst alphanumeric = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\nexport function generateShortPersistentId() {\n return generateAlphanumericId(shortPersistentIdLength);\n}\n\nfunction generateAlphanumericId(length: number): string {\n let randomString = \"\";\n\n for (let i = 0; i < length; i++) {\n const randomIndex = Math.floor(Math.random() * alphanumeric.length);\n randomString += alphanumeric.charAt(randomIndex);\n }\n\n return randomString;\n}\n","// Consists of lowercased letters, digits and hyphens.\n// Can not start or end with hyphen.\n// Warning: does not forbid consecutive hyphens\nexport const slugRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;\n","import { DocumentationPageContentItem, PageBlockDefinition, PageBlockDefinitionProperty } from \"../documentation\";\nimport { PageBlockItemUntypedValue, PageBlockItemV2 } from \"./data\";\nimport { PageBlockEditorModelV2 } from \"./page-block-v2\";\n\n//\n// Traverse\n//\n\n/**\n * Pay attention to correct types!\n */\nexport function mapPageBlockItemValuesV2(\n pageItems: DocumentationPageContentItem[],\n definitionsMap: PageBlockDefinitionsMap,\n fn: (\n block: PageBlockEditorModelV2,\n item: PageBlockItemV2,\n property: PageBlockDefinitionProperty,\n value: PageBlockItemUntypedValue\n ) => PageBlockItemUntypedValue\n) {\n traversePageBlockItemsV2(pageItems, (block, item) => {\n Object.entries(item.props).forEach(([propKey, value]) => {\n const property = definitionsMap.getDefinitionProperty(block.data.packageId, propKey);\n if (!property) return;\n\n item.props[propKey] = fn(block, item, property, value);\n });\n });\n}\n\nexport function traversePageBlockItemValuesV2(\n pageItems: DocumentationPageContentItem[],\n definitionsMap: PageBlockDefinitionsMap,\n fn: (\n block: PageBlockEditorModelV2,\n item: PageBlockItemV2,\n property: PageBlockDefinitionProperty,\n value: PageBlockItemUntypedValue\n ) => void\n) {\n traversePageBlockItemsV2(pageItems, (block, item) => {\n Object.entries(item.props).forEach(([propKey, value]) => {\n const property = definitionsMap.getDefinitionProperty(block.data.packageId, propKey);\n if (!property) return;\n\n fn(block, item, property, value);\n });\n });\n}\n\nexport function traversePageBlockItemsV2(\n pageItems: DocumentationPageContentItem[],\n fn: (block: PageBlockEditorModelV2, item: PageBlockItemV2) => void\n) {\n traversePageItemsV2(pageItems, block => {\n block.data.items.forEach(item => {\n fn(block, item);\n });\n });\n}\n\nexport function traversePageItemsV2(\n pageItems: DocumentationPageContentItem[],\n fn: (item: PageBlockEditorModelV2) => void\n): void {\n for (const item of pageItems) {\n switch (item.type) {\n case \"Block\":\n fn(item);\n\n break;\n\n case \"Section\":\n item.items.forEach(i => {\n i.columns.forEach(c => {\n traversePageItemsV2(c.blocks, fn);\n });\n });\n\n break;\n }\n }\n}\n\n//\n// Definitions map\n//\n\nexport class PageBlockDefinitionsMap {\n private definitionsMap = new Map<string, PageBlockDefinition>();\n private propertiesMap = new Map<string, PageBlockDefinitionProperty>();\n\n constructor(definitions: PageBlockDefinition[]) {\n definitions.forEach(d => {\n this.definitionsMap.set(d.id, d);\n d.item.properties.forEach(p => {\n this.propertiesMap.set(this.propertyKey(d.id, p.id), p);\n });\n });\n }\n\n getDefinition(id: string): PageBlockDefinition | undefined {\n return this.definitionsMap.get(id);\n }\n\n getDefinitionProperty(defId: string, propId: string): PageBlockDefinitionProperty | undefined {\n return this.propertiesMap.get(this.propertyKey(defId, propId));\n }\n\n private propertyKey(defId: string, propId: string): string {\n return `${defId}.${propId}`;\n }\n}\n","import { z } from \"zod\";\nimport { DbCreateInputOmit, DbUpdate } from \"../../helpers\";\nimport { OmitStrict } from \"../../utils\";\nimport { ElementGroup } from \"../elements\";\nimport { DesignElementSnapshotBase, pickLatestSnapshots } from \"./base\";\n\n/**\n * Snapshot of an element group.\n *\n * Please note that existence of snapshot's references (including parent persistent id) is not guaranteed.\n */\nexport const ElementGroupSnapshot = DesignElementSnapshotBase.extend({\n group: ElementGroup,\n});\n\nexport type ElementGroupSnapshot = z.infer<typeof ElementGroupSnapshot>;\n\nexport type CreateElementGroupSnapshot = DbCreateInputOmit<ElementGroupSnapshot>;\nexport type UpdateElementGroupSnapshot = OmitStrict<DbUpdate<ElementGroupSnapshot>, \"designSystemVersionId\">;\n\n//\n// Util functions\n//\n\nexport function pickLatestGroupSnapshots(snapshots: ElementGroupSnapshot[]): ElementGroupSnapshot[] {\n return pickLatestSnapshots(snapshots, s => s.group.id);\n}\n","import { groupBy, nonNullishFilter, PublishedDocPageVisitsEntry } from \"@supernova-studio/model\";\nimport { DTOPublishedDocPageVisitData, DTOPublishedDocVisitData } from \"../../dto\";\n\n//\n// Analytics data conversion\n//\n\nexport function documentationAnalyticsToGlobalDto(entries: PublishedDocPageVisitsEntry[]): DTOPublishedDocVisitData[] {\n return squashAndConvertToDto(entries);\n}\n\n//\n// Analytics data per page conversion\n//\n\nexport function documentationAnalyticsToPageDto(\n entries: PublishedDocPageVisitsEntry[]\n): DTOPublishedDocPageVisitData[] {\n // Group by page id\n const byPageIdEntries = Array.from(groupBy(entries, e => e.pagePersistentId).entries());\n byPageIdEntries.sort((lhs, rhs) => lhs[0].localeCompare(rhs[0]));\n\n return byPageIdEntries.flatMap(([pagePersistentId, entries]) => {\n const dtoWithoutPageId = squashAndConvertToDto(entries);\n return dtoWithoutPageId.map(dto => ({ ...dto, pagePersistentId }));\n });\n}\n\n//\n// Base\n//\n\nfunction squashAndConvertToDto(entries: PublishedDocPageVisitsEntry[]): DTOPublishedDocVisitData[] {\n // Group by beginning of day\n const byDay = groupBy(entries, e => getStartOfUTCDay(e.timestamp));\n\n const obj = Object.fromEntries(\n Array.from(byDay.entries()).map(([date, values]) => [new Date(date).toISOString(), values.length])\n );\n\n // Convert model to DTO by squashing model entries that belong to the same day\n return Array.from(byDay.entries()).map(([startOfDay, dayEntries]) => {\n const firstEntry = dayEntries[0];\n\n // Sessions are number of unique user IDs who visited the page during that day\n const uniqueSessions = new Set(dayEntries.map(e => e.anonymousId).filter(nonNullishFilter)).size;\n\n // Visits are sum of all recorded visits of the page during that day\n const visitsSum = dayEntries.reduce((prev, curr) => prev + curr.visits, 0);\n\n return {\n versionId: firstEntry.versionId,\n timestamp: new Date(startOfDay),\n sessions: uniqueSessions,\n visits: visitsSum,\n\n ...(firstEntry.locale && { locale: firstEntry.locale }),\n };\n });\n}\n\nfunction getStartOfUTCDay(date: Date): number {\n const year = date.getUTCFullYear();\n const month = date.getUTCMonth();\n const day = date.getUTCDate();\n\n return Date.UTC(year, month, day, 0, 0, 0, 0);\n}\n","import { PublishedDocPageVisitsEntry, SupernovaException } from \"@supernova-studio/model\";\nimport {\n DTODocumentationAnalyticsTimeFrame,\n DTOPublishedDocAnalyticsComparisonData,\n DTOPublishedDocPageAnalyticsComparisonData,\n} from \"../../dto\";\nimport { documentationAnalyticsToGlobalDto } from \"./page-visits-to-dto\";\n\n//\n// Page analytics\n//\n\ntype PageAnalyticsInput = {\n pagePersistentId: string;\n priorDataPoints: PublishedDocPageVisitsEntry[];\n currentDataPoints: PublishedDocPageVisitsEntry[];\n timeFrame: DTODocumentationAnalyticsTimeFrame;\n};\n\nexport function documentationAnalyticsToPageComparisonDto(\n input: PageAnalyticsInput\n): DTOPublishedDocPageAnalyticsComparisonData {\n const { pagePersistentId } = input;\n\n function validateDataPoint(dataPoint: PublishedDocPageVisitsEntry) {\n if (dataPoint.pagePersistentId !== pagePersistentId) {\n throw SupernovaException.shouldNotHappen(`Tried to include invalid analytics data point!`);\n }\n }\n\n input.priorDataPoints.forEach(validateDataPoint);\n input.currentDataPoints.forEach(validateDataPoint);\n\n return {\n ...documentationAnalyticsToComparisonDto(input),\n pagePersistentId,\n };\n}\n\n//\n// Global analytics\n//\n\ntype GlobalAnalyticsInput = {\n priorDataPoints: PublishedDocPageVisitsEntry[];\n currentDataPoints: PublishedDocPageVisitsEntry[];\n timeFrame: DTODocumentationAnalyticsTimeFrame;\n};\n\nexport function documentationAnalyticsToComparisonDto(\n input: GlobalAnalyticsInput\n): DTOPublishedDocAnalyticsComparisonData {\n const { timeFrame } = input;\n\n const priorDataPoints = documentationAnalyticsToGlobalDto(input.priorDataPoints);\n const currentDataPoints = documentationAnalyticsToGlobalDto(input.currentDataPoints);\n\n return {\n timeFrame,\n priorSessionCount: priorDataPoints.reduce((sum, d) => sum + d.sessions, 0),\n priorVisitCount: priorDataPoints.reduce((sum, d) => sum + d.visits, 0),\n currentSessionCount: currentDataPoints.reduce((sum, d) => sum + d.sessions, 0),\n currentVisitCount: currentDataPoints.reduce((sum, d) => sum + d.visits, 0),\n };\n}\n","import { groupBy, PublishedDocPageVisitsEntry } from \"@supernova-studio/model\";\nimport { DTODocumentationAnalyticsTimeFrame, DTOPublishedDocVisitHeatMapWeek } from \"../../dto\";\n\nexport function documentationAnalyticsToHeatMapDto(\n entries: PublishedDocPageVisitsEntry[],\n timeFrame: DTODocumentationAnalyticsTimeFrame\n): DTOPublishedDocVisitHeatMapWeek {\n const byWeekDay = groupBy(entries, e => e.timestamp.getUTCDay());\n\n return {\n timeFrame,\n mon: entriesToHeatmapDay(byWeekDay.get(1)),\n tue: entriesToHeatmapDay(byWeekDay.get(2)),\n wed: entriesToHeatmapDay(byWeekDay.get(3)),\n thu: entriesToHeatmapDay(byWeekDay.get(4)),\n fri: entriesToHeatmapDay(byWeekDay.get(5)),\n sat: entriesToHeatmapDay(byWeekDay.get(6)),\n sun: entriesToHeatmapDay(byWeekDay.get(7)),\n };\n}\n\nfunction entriesToHeatmapDay(entries: PublishedDocPageVisitsEntry[] | undefined): number[] {\n const byHour = groupBy(entries ?? [], e => e.timestamp.getUTCHours());\n\n return [\n sumVisits(byHour.get(0), byHour.get(1)), // 0am-2am\n sumVisits(byHour.get(2), byHour.get(3)), // 2am-4am\n sumVisits(byHour.get(4), byHour.get(5)), // 4am-6am\n sumVisits(byHour.get(6), byHour.get(7)), // 6am-6am\n sumVisits(byHour.get(8), byHour.get(9)), // 8am-6am\n sumVisits(byHour.get(10), byHour.get(11)), // 10am-12pm\n sumVisits(byHour.get(12), byHour.get(13)), // 12pm-2pm\n sumVisits(byHour.get(14), byHour.get(15)), // 2pm-4pm\n sumVisits(byHour.get(16), byHour.get(17)), // 4pm-6pm\n sumVisits(byHour.get(18), byHour.get(19)), // 6pm-8pm\n sumVisits(byHour.get(20), byHour.get(21)), // 8pm-10pm\n sumVisits(byHour.get(22), byHour.get(23)), // 10pm-12pm\n ];\n}\n\nfunction sumVisits(...entryArrays: (PublishedDocPageVisitsEntry[] | undefined)[]) {\n let sum = 0;\n\n entryArrays.forEach(a => {\n a?.forEach(e => (sum += e.visits));\n });\n\n return sum;\n}\n","import {\n ColorTokenData,\n DocumentationItemConfigurationV1,\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderImageScaleType,\n} from \"@supernova-studio/model\";\nimport { DTODocumentationItemConfigurationV1 } from \"../../dto\";\n\nexport const getDtoDefaultItemConfigurationV1 = () =>\n ({\n showSidebar: true,\n isHidden: false,\n isPrivate: false,\n header: {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n },\n } as const);\n\nexport function documentationItemConfigurationToDTOV1(\n config: DocumentationItemConfigurationV1 | undefined\n): DTODocumentationItemConfigurationV1 {\n const dtoDefaultItemConfigurationV1 = getDtoDefaultItemConfigurationV1();\n if (!config) return dtoDefaultItemConfigurationV1;\n\n const { backgroundColor, foregroundColor, ...headerRest } = config.header;\n\n return {\n showSidebar: config.showSidebar,\n isHidden: config.isHidden ?? dtoDefaultItemConfigurationV1.isHidden,\n isPrivate: config.isPrivate ?? dtoDefaultItemConfigurationV1.isPrivate,\n header: {\n ...headerRest,\n backgroundColor: colorToDTOV1(backgroundColor ?? undefined),\n foregroundColor: colorToDTOV1(foregroundColor ?? undefined),\n },\n };\n}\n\nfunction colorToDTOV1(color: ColorTokenData | undefined) {\n if (!color) return undefined;\n if (color.aliasTo) return { aliasTo: color.aliasTo };\n if (!color.value) return undefined;\n\n if (typeof color.value === \"string\") return { value: color.value };\n if (typeof color.value.color === \"string\") return { value: color.value.color };\n\n return undefined;\n}\n","import {\n DocumentationGroupV1,\n DocumentationItemConfigurationV1,\n DocumentationItemConfigurationV2,\n DocumentationPageV1,\n mapByUnique,\n} from \"@supernova-studio/model\";\nimport { LocalDocsPage, LocalDocsPageGroup } from \"../../../sync/types\";\nimport { VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../../../yjs/version-room/types\";\n\ntype GroupLike = {\n persistentId: string;\n parentPersistentId?: string;\n};\n\ntype DocsPage = LocalDocsPage | VersionRoomDocsPage;\ntype DocsPageGroup = LocalDocsPageGroup | VersionRoomDocsPageGroup;\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function buildDocPagePublishPaths(\n groups: (DocsPageGroup | DocumentationGroupV1)[],\n pages: (DocsPage | DocumentationPageV1)[],\n routingVersion: string\n): Map<string, string> {\n const groupPersistentIdToGroupMap = mapByUnique(groups, group => group.persistentId);\n const result = new Map<string, string>();\n\n for (const page of pages) {\n const parentChain = calculateElementParentChain(page.parentPersistentId, groupPersistentIdToGroupMap);\n\n let pathV1 = `${page.userSlug || page.slug}.html`;\n let pathV2 = `${page.slug}-${page.shortPersistentId}`;\n\n for (const parent of parentChain) {\n if (!parent.parentPersistentId) continue;\n\n pathV1 = `${parent.userSlug || parent.slug || \"root\"}/${pathV1}`;\n pathV2 = `${parent.slug || \"root\"}/${pathV2}`;\n }\n\n pathV1 = `/${pathV1}`;\n pathV2 = `/${pathV2}`;\n\n if (routingVersion === \"2\") {\n result.set(page.persistentId, pathV2);\n } else {\n result.set(page.persistentId, pathV1);\n }\n }\n\n return result;\n}\n\nexport function calculateElementParentChain<T extends GroupLike>(\n elementParentPersistentId: string,\n groupPersistentIdToGroupMap: Map<string, T>\n): T[] {\n const result: T[] = [];\n\n let parentId: string | undefined = elementParentPersistentId;\n while (parentId) {\n const parent = groupPersistentIdToGroupMap.get(parentId);\n if (parent) result.push(parent);\n\n parentId = parent?.parentPersistentId;\n }\n\n return result;\n}\n\nexport function applyPrivacyConfigurationToNestedItems<\n PageType extends DocumentationPageV1 | DocsPage,\n GroupType extends DocumentationGroupV1 | DocsPageGroup,\n ItemConfigurationType extends DocumentationItemConfigurationV1 | DocumentationItemConfigurationV2\n>(\n pages: PageType[],\n groups: GroupType[],\n getDefaultItemConfiguration: () => ItemConfigurationType\n): { pages: PageType[]; groups: GroupType[] } {\n // copy groups to mutate them later\n const fixedGroups = groups.map(group => ({\n ...group,\n data: {\n ...group.data,\n configuration: group.data?.configuration ?? getDefaultItemConfiguration(),\n },\n }));\n const groupPersistentIdToGroupMap = mapByUnique(fixedGroups, group => group.persistentId);\n\n for (const groupToFix of fixedGroups) {\n let isHidden = groupToFix.data.configuration.isHidden;\n let isPrivate = groupToFix.data.configuration.isPrivate;\n\n let nextParentId: string | undefined = groupToFix.parentPersistentId;\n while ((!isHidden || !isPrivate) && nextParentId) {\n const parent = groupPersistentIdToGroupMap.get(nextParentId);\n if (!parent) break;\n\n isHidden = isHidden || parent.data?.configuration?.isHidden || false;\n isPrivate = isPrivate || parent.data?.configuration?.isPrivate || false;\n\n nextParentId = parent.parentPersistentId;\n }\n\n groupToFix.data.configuration.isHidden = isHidden;\n groupToFix.data.configuration.isPrivate = isPrivate;\n }\n\n const fixedPages: PageType[] = [];\n // set isHidden and isPrivate configuration fields based on page and parents value\n for (const page of pages) {\n const configuration = page.data?.configuration ?? getDefaultItemConfiguration();\n const parent = groupPersistentIdToGroupMap.get(page.parentPersistentId);\n\n fixedPages.push({\n ...page,\n data: {\n ...page.data,\n configuration: {\n ...configuration,\n isHidden: configuration.isHidden || parent?.data?.configuration?.isHidden || false,\n isPrivate: configuration.isPrivate || parent?.data?.configuration?.isPrivate || false,\n },\n },\n });\n }\n\n return { pages: fixedPages, groups: fixedGroups };\n}\n","import {\n DocumentationGroupV1,\n DocumentationItemConfigurationV1,\n DocumentationPageV1,\n DocumentationPageV2,\n groupBy,\n} from \"@supernova-studio/model\";\nimport { DTODocumentationGroupStructureV1, DTODocumentationGroupV1 } from \"../../dto/elements/documentation/group-v1\";\nimport {\n documentationItemConfigurationToDTOV1,\n getDtoDefaultItemConfigurationV1,\n} from \"./documentation-item-configuration-v1-to-dto\";\nimport { applyPrivacyConfigurationToNestedItems } from \"./documentation-page-to-dto-utils\";\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function elementGroupsToDocumentationGroupStructureDTOV1(\n groups: DocumentationGroupV1[],\n pages: (DocumentationPageV1 | DocumentationPageV2)[]\n): DTODocumentationGroupStructureV1[] {\n const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);\n\n return groups.map(group => elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap));\n}\n\nexport function elementGroupsToDocumentationGroupDTOV1(\n groups: DocumentationGroupV1[],\n pages: (DocumentationPageV1 | DocumentationPageV2)[]\n): DTODocumentationGroupV1[] {\n const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);\n\n return groups.map(group => {\n return {\n ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),\n configuration: documentationItemConfigurationToDTOV1(group.data?.configuration),\n };\n });\n}\n\nexport function elementGroupsToDocumentationGroupFixedConfigurationDTOV1(\n groups: DocumentationGroupV1[],\n pages: (DocumentationPageV1 | DocumentationPageV2)[]\n): DTODocumentationGroupV1[] {\n const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);\n\n const { groups: fixedGroups } = applyPrivacyConfigurationToNestedItems<\n DocumentationPageV1 | DocumentationPageV2,\n DocumentationGroupV1,\n DocumentationItemConfigurationV1\n >(pages, groups, getDtoDefaultItemConfigurationV1);\n\n return fixedGroups.map(group => {\n const configuration = documentationItemConfigurationToDTOV1(group.data?.configuration);\n\n return {\n ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),\n // backward compatibility with custom doc exporters, anyway these groups will not be shown, so we can adjust title\n title: configuration.isHidden && !group.meta.name.startsWith(\"_\") ? \"_\" + group.meta.name : group.meta.name,\n configuration,\n };\n });\n}\n\nfunction elementGroupToDocumentationGroupStructureDTOV1(\n group: DocumentationGroupV1,\n childrenIdsMap: Map<string, string[]>\n): DTODocumentationGroupStructureV1 {\n const childrenIds = childrenIdsMap.get(group.persistentId) ?? [];\n\n if (!group.shortPersistentId) {\n throw new Error(`Short persistent id is required for docs groups, group id: ${group.id}`);\n }\n\n return {\n id: group.id,\n designSystemVersionId: group.designSystemVersionId,\n persistentId: group.persistentId,\n slug: group.slug,\n userSlug: group.userSlug,\n createdAt: group.createdAt,\n updatedAt: group.updatedAt,\n title: group.meta.name,\n childrenIds: childrenIds,\n isRoot: !group.parentPersistentId,\n groupBehavior: group.data?.behavior ?? \"Group\",\n shortPersistentId: group.shortPersistentId,\n type: \"Group\",\n };\n}\n\nfunction calculateChildrenIdsMapV1(\n elements: { persistentId: string; parentPersistentId: string; sortOrder: number }[],\n groups: DocumentationGroupV1[]\n): Map<string, string[]> {\n const byParentId = groupBy([...elements, ...groups], e => e.parentPersistentId);\n\n const childrenIdsMap = new Map<string, string[]>();\n\n for (const [parentPersistentId, children] of byParentId) {\n if (!parentPersistentId) continue;\n children.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);\n\n childrenIdsMap.set(\n parentPersistentId,\n children.map(c => c.persistentId)\n );\n }\n\n return childrenIdsMap;\n}\n","import {\n DocumentationItemConfigurationV2,\n DocumentationItemHeaderAlignment,\n DocumentationItemHeaderImageScaleType,\n} from \"@supernova-studio/model\";\nimport { DTODocumentationItemConfigurationV2 } from \"../../dto/elements/documentation/item-configuration-v2\";\n\nexport const getDtoDefaultItemConfigurationV2 = () =>\n ({\n showSidebar: true,\n isHidden: false,\n isPrivate: false,\n header: {\n alignment: DocumentationItemHeaderAlignment.Left,\n backgroundImageScaleType: DocumentationItemHeaderImageScaleType.AspectFill,\n description: \"\",\n showBackgroundOverlay: false,\n showCoverText: true,\n },\n } as const);\n\nexport function documentationItemConfigurationToDTOV2(\n config: DocumentationItemConfigurationV2 | undefined\n): DTODocumentationItemConfigurationV2 {\n const dtoDefaultItemConfigurationV2 = getDtoDefaultItemConfigurationV2();\n if (!config) return dtoDefaultItemConfigurationV2;\n\n return {\n header: config.header,\n isHidden: config.isHidden ?? dtoDefaultItemConfigurationV2.isHidden,\n isPrivate: config.isPrivate ?? dtoDefaultItemConfigurationV2.isPrivate,\n showSidebar: config.showSidebar,\n };\n}\n","import { DocumentationItemConfigurationV2, DocumentationPageV1, groupBy } from \"@supernova-studio/model\";\nimport { VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../../../yjs/version-room/types\";\nimport { LocalDocsPage, LocalDocsPageGroup } from \"../../../sync/types\";\nimport { DTODocumentationGroupV2 } from \"../../dto\";\nimport {\n documentationItemConfigurationToDTOV2,\n getDtoDefaultItemConfigurationV2,\n} from \"./documentation-item-configuration-v2-to-dto\";\nimport { applyPrivacyConfigurationToNestedItems } from \"./documentation-page-to-dto-utils\";\n\ntype DocsPage = LocalDocsPage | VersionRoomDocsPage;\ntype DocsPageGroup = LocalDocsPageGroup | VersionRoomDocsPageGroup;\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function elementGroupsToDocumentationGroupDTOV2(\n groups: DocsPageGroup[],\n pages: (DocumentationPageV1 | DocsPage)[]\n): DTODocumentationGroupV2[] {\n const childrenIdsMap = calculateChildrenIdsMapV2(pages, groups);\n\n return groups.map(group => elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap));\n}\n\nexport function elementGroupsToDocumentationGroupFixedConfigurationDTOV2(\n groups: DocsPageGroup[],\n pages: (DocumentationPageV1 | DocsPage)[]\n): DTODocumentationGroupV2[] {\n const childrenIdsMap = calculateChildrenIdsMapV2(pages, groups);\n\n const { groups: fixedGroups } = applyPrivacyConfigurationToNestedItems<\n DocumentationPageV1 | DocsPage,\n DocsPageGroup,\n DocumentationItemConfigurationV2\n >(pages, groups, getDtoDefaultItemConfigurationV2);\n\n return fixedGroups.map(group => elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap));\n}\n\nfunction elementGroupToDocumentationGroupStructureDTOV2(\n group: DocsPageGroup,\n childrenIdsMap: Map<string, string[]>\n): DTODocumentationGroupV2 {\n const childrenIds = childrenIdsMap.get(group.persistentId) ?? [];\n\n if (!group.shortPersistentId) {\n throw new Error(`Short persistent id is required for docs groups, group id: ${group.persistentId}`);\n }\n\n return {\n id: \"to_be_removed\",\n designSystemVersionId: group.designSystemVersionId,\n persistentId: group.persistentId,\n slug: group.slug,\n userSlug: group.userSlug,\n createdAt: group.createdAt,\n updatedAt: group.updatedAt,\n title: group.meta.name,\n configuration: documentationItemConfigurationToDTOV2(group?.data?.configuration),\n childrenIds: childrenIds,\n isRoot: !group.parentPersistentId,\n groupBehavior: group.data?.behavior ?? \"Group\",\n shortPersistentId: group.shortPersistentId,\n type: \"Group\",\n };\n}\n\nfunction calculateChildrenIdsMapV2(\n elements: { persistentId: string; parentPersistentId: string; sortOrder: number }[],\n groups: DocsPageGroup[]\n): Map<string, string[]> {\n const byParentId = groupBy([...elements, ...groups], e => e.parentPersistentId);\n\n const childrenIdsMap = new Map<string, string[]>();\n\n for (const [parentPersistentId, children] of byParentId) {\n if (!parentPersistentId) continue;\n children.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);\n\n childrenIdsMap.set(\n parentPersistentId,\n children.map(c => c.persistentId)\n );\n }\n\n return childrenIdsMap;\n}\n","import {\n DocumentationGroupV1,\n DocumentationItemConfigurationV1,\n DocumentationPageV1,\n SupernovaException,\n} from \"@supernova-studio/model\";\nimport { DocumentationPageV1DTO } from \"../../dto\";\nimport {\n documentationItemConfigurationToDTOV1,\n getDtoDefaultItemConfigurationV1,\n} from \"./documentation-item-configuration-v1-to-dto\";\nimport { buildDocPagePublishPaths, applyPrivacyConfigurationToNestedItems } from \"./documentation-page-to-dto-utils\";\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function documentationPagesToDTOV1(\n pages: DocumentationPageV1[],\n groups: DocumentationGroupV1[],\n routingVersion: string\n): DocumentationPageV1DTO[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n\n return pages.map(page => documentationPageToDTOV1(page, pathsMap));\n}\n\nexport function documentationPagesFixedConfigurationToDTOV1(\n pages: DocumentationPageV1[],\n groups: DocumentationGroupV1[],\n routingVersion: string\n): DocumentationPageV1DTO[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n\n const { pages: fixedPages } = applyPrivacyConfigurationToNestedItems<\n DocumentationPageV1,\n DocumentationGroupV1,\n DocumentationItemConfigurationV1\n >(pages, groups, getDtoDefaultItemConfigurationV1);\n\n return fixedPages.map((page: DocumentationPageV1) => documentationPageToDTOV1(page, pathsMap));\n}\n\nfunction documentationPageToDTOV1(page: DocumentationPageV1, pagePathMap: Map<string, string>): DocumentationPageV1DTO {\n let path = pagePathMap.get(page.persistentId);\n if (!path) throw SupernovaException.conflict(`Path for page ${page.id} was not calculated`);\n\n if (path.startsWith(\"/\")) path = path.substring(1);\n\n const configuration = documentationItemConfigurationToDTOV1(page.data.configuration);\n\n return {\n id: page.id,\n designSystemVersionId: page.designSystemVersionId,\n persistentId: page.persistentId,\n shortPersistentId: page.shortPersistentId,\n // backward compatibility with custom doc exporters, anyway these pages will not be shown, so we can adjust title\n title: configuration.isHidden && !page.meta.name.startsWith(\"_\") ? \"_\" + page.meta.name : page.meta.name,\n blocks: page.data.blocks,\n slug: page.slug,\n userSlug: page.userSlug,\n configuration,\n createdAt: page.createdAt,\n updatedAt: page.updatedAt,\n path: path,\n };\n}\n","import { DocumentationItemConfigurationV2 } from \"@supernova-studio/model\";\nimport { LocalDocsPage, LocalDocsPageGroup } from \"../../../sync/types\";\nimport { VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../../../yjs/version-room/types\";\nimport { DTODocumentationPageV2 } from \"../../dto\";\nimport {\n documentationItemConfigurationToDTOV2,\n getDtoDefaultItemConfigurationV2,\n} from \"./documentation-item-configuration-v2-to-dto\";\nimport { applyPrivacyConfigurationToNestedItems, buildDocPagePublishPaths } from \"./documentation-page-to-dto-utils\";\n\ntype DocsPage = LocalDocsPage | VersionRoomDocsPage;\ntype DocsPageGroup = LocalDocsPageGroup | VersionRoomDocsPageGroup;\n\n// The fact that DTO conversion is located here instead of main backend code is due to the fact\n// that we store page and group data in YJS documents in the same way as they are stored in the database.\n// Therefore, we need to expose this conversion to the client so that it can consume data from YJS documents.\n//\n// Please do not put more DTO conversion here unless you know what you're doing.\n\nexport function documentationPageToDTOV2(\n page: DocsPage,\n groups: DocsPageGroup[],\n routingVersion: string,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2 {\n const pathsMap = buildDocPagePublishPaths(groups, [page], routingVersion);\n return _documentationPageToDTOV2(page, pathsMap, pageLiveblocksRoomIdMap);\n}\n\nexport function documentationPagesToDTOV2(\n pages: DocsPage[],\n groups: DocsPageGroup[],\n routingVersion: string,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n return pages.map(page => _documentationPageToDTOV2(page, pathsMap, pageLiveblocksRoomIdMap));\n}\n\nexport function documentationPagesFixedConfigurationToDTOV2(\n pages: DocsPage[],\n groups: DocsPageGroup[],\n routingVersion: string,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2[] {\n const pathsMap = buildDocPagePublishPaths(groups, pages, routingVersion);\n\n const { pages: fixedPages } = applyPrivacyConfigurationToNestedItems<\n DocsPage,\n DocsPageGroup,\n DocumentationItemConfigurationV2\n >(pages, groups, getDtoDefaultItemConfigurationV2);\n\n return fixedPages.map(page => _documentationPageToDTOV2(page, pathsMap, pageLiveblocksRoomIdMap));\n}\n\nfunction _documentationPageToDTOV2(\n page: DocsPage,\n pagePathMap: Map<string, string>,\n pageLiveblocksRoomIdMap: Map<string, string>\n): DTODocumentationPageV2 {\n let path = pagePathMap.get(page.persistentId);\n if (!path) throw new Error(`Path for page ${page.persistentId} was not calculated`);\n\n if (path.startsWith(\"/\")) path = path.substring(1);\n\n const liveblocksRoomId = pageLiveblocksRoomIdMap.get(page.persistentId);\n\n return {\n id: \"to_be_removed\",\n designSystemVersionId: page.designSystemVersionId,\n persistentId: page.persistentId,\n shortPersistentId: page.shortPersistentId,\n title: page.meta.name,\n slug: page.slug,\n userSlug: page.userSlug,\n configuration: documentationItemConfigurationToDTOV2(page.data.configuration),\n createdAt: page.createdAt,\n updatedAt: page.updatedAt,\n path: path,\n type: \"Page\",\n ...(liveblocksRoomId && { liveblocksRoomId }),\n };\n}\n","import { Pipeline } from \"@supernova-studio/model\";\nimport { DTOPipeline } from \"../../dto/export/pipeline\";\n\nexport function pipelineToDto(pipeline: Pipeline): DTOPipeline {\n return {\n id: pipeline.id,\n name: pipeline.name,\n eventType: pipeline.eventType,\n isEnabled: pipeline.isEnabled,\n workspaceId: pipeline.workspaceId,\n designSystemId: pipeline.designSystemId,\n exporterId: pipeline.exporterId,\n brandPersistentId: pipeline.brandPersistentId,\n themePersistentId: pipeline.themePersistentId,\n themePersistentIds: pipeline.themePersistentIds,\n destinationAzure: pipeline.destinationAzure,\n destinationBitbucket: pipeline.destinationBitbucket,\n destinationSnDocs: pipeline.destinationSnDocs,\n destinationGithub: pipeline.destinationGithub,\n destinationGitlab: pipeline.destinationGitlab,\n destinationS3: pipeline.destinationS3,\n exporterPropertyValues: pipeline.exporterPropertyValues,\n webhookUrl: pipeline.webhookUrl,\n latestJobs: [],\n isExporterDeprecated: pipeline.isExporterDeprecated,\n };\n}\n","import { GitBranch, GitOrganization, GitProject, GitRepository } from \"@supernova-studio/model\";\nimport { DTOGitBranch, DTOGitOrganization, DTOGitProject, DTOGitRepository } from \"../../dto\";\n\nexport function gitOrganizationToDto(org: GitOrganization): DTOGitOrganization {\n return {\n id: org.id,\n name: org.name,\n url: org.url,\n slug: org.slug,\n };\n}\n\nexport function gitProjectToDto(project: GitProject): DTOGitProject {\n return {\n id: project.id,\n name: project.name,\n url: project.url,\n slug: project.slug,\n };\n}\n\nexport function gitRepositoryToDto(repo: GitRepository): DTOGitRepository {\n return {\n id: repo.id,\n name: repo.name,\n url: repo.url,\n slug: repo.slug,\n defaultBranch: repo.defaultBranch,\n };\n}\n\nexport function gitBranchToDto(branch: GitBranch): DTOGitBranch {\n return {\n name: branch.name,\n lastCommitId: branch.lastCommitId,\n };\n}\n","import { ExtendedIntegration, IntegrationCredentials } from \"@supernova-studio/model\";\nimport { DTOIntegration, DTOIntegrationCredentials } from \"../../dto\";\n\nexport function integrationToDto(integration: ExtendedIntegration): DTOIntegration {\n return {\n id: integration.id,\n workspaceId: integration.workspaceId,\n type: integration.type,\n createdAt: integration.createdAt,\n integrationCredentials: integration.integrationCredentials?.map(integrationCredentialToDto),\n integrationDesignSystems: integration.integrationDesignSystems ?? undefined,\n };\n}\n\nexport function integrationCredentialToDto(credential: IntegrationCredentials): DTOIntegrationCredentials {\n return {\n id: credential.id,\n\n createdAt: credential.createdAt,\n refreshedAt: credential.refreshedAt,\n expiresAt: credential.expiresAt,\n\n integrationId: credential.integrationId,\n type: credential.type,\n\n userId: credential.userId,\n user: credential.user,\n\n customUrl: credential.customUrl,\n\n profile: credential.profile,\n tokenName: credential.tokenName,\n username: credential.username,\n appInstallationId: credential.appInstallationId,\n state: credential.state,\n };\n}\n","import { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOAccessToken = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n name: z.string(),\n scope: z.string().optional(),\n});\n\nexport const DTOAccessTokenFull = DTOAccessToken.extend({\n token: z.string(),\n});\n\nexport const DTOAccessTokenListResponse = z.object({\n tokens: DTOAccessToken.array(),\n});\n\nexport const DTOAccessTokenResponse = z.object({\n token: DTOAccessToken,\n});\n\nexport const DTOAccessTokenFullResponse = z.object({\n token: DTOAccessTokenFull,\n});\n\nexport type DTOAccessToken = z.infer<typeof DTOAccessToken>;\nexport type DTOAccessTokenFull = z.infer<typeof DTOAccessTokenFull>;\nexport type DTOAccessTokenListResponse = z.infer<typeof DTOAccessTokenListResponse>;\nexport type DTOAccessTokenResponse = z.infer<typeof DTOAccessTokenResponse>;\nexport type DTOAccessTokenFullResponse = z.infer<typeof DTOAccessTokenFullResponse>;\n\n//\n// Write\n//\n\nexport const DTOAccessTokenCreatePayload = z.object({\n name: z.string(),\n scope: z.string().optional(),\n});\n\nexport type DTOAccessTokenCreatePayload = z.infer<typeof DTOAccessTokenCreatePayload>;\n","import { z } from \"zod\";\n\nexport const DTOColorTokenInlineData = z.object({\n value: z.string().regex(/^#[a-f0-9]{6,8}$/),\n});\n\nexport type DTOColorTokenInlineData = z.infer<typeof DTOColorTokenInlineData>;\n","import { z } from \"zod\";\n\nexport const DTOObjectMeta = z.object({\n name: z.string().max(512),\n description: z.string().max(2048).optional(),\n});\n\nexport type DTOObjectMeta = z.infer<typeof DTOObjectMeta>;\n","import { z } from \"zod\";\n\nexport const DTOPagination = z.object({\n limit: z.string().optional(),\n offset: z.string().optional(),\n});\n\nexport type DTOPagination = z.infer<typeof DTOPagination>;\n","import { z } from \"zod\";\nimport { DTOBrand, DTODesignSystem, DTODesignSystemVersion } from \"../design-systems\";\nimport { DTOUserWorkspaceMembership } from \"../workspaces\";\n\nexport const DTOAppBootstrapDataQuery = z.object({\n preferredWorkspaceId: z.string().optional(),\n preferredDesignSystemId: z.string().optional(),\n preferredVersionId: z.string().optional(),\n preferredBrandId: z.string().optional(),\n});\n\nexport const DTOAppBootstrapDataResponse = z.object({\n workspaceMembership: DTOUserWorkspaceMembership.optional(),\n designSystem: DTODesignSystem.optional(),\n version: DTODesignSystemVersion.optional(),\n brand: DTOBrand.optional(),\n});\n\nexport type DTOAppBootstrapDataQuery = z.infer<typeof DTOAppBootstrapDataQuery>;\nexport type DTOAppBootstrapDataResponse = z.infer<typeof DTOAppBootstrapDataResponse>;\n","import { ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOObjectMeta } from \"../aux\";\n\n//\n// Read\n//\n\nexport const DTOBrand = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n meta: ObjectMeta,\n});\n\nexport const DTOBrandGetResponse = z.object({ brand: DTOBrand });\n\nexport const DTOBrandCreateResponse = z.object({\n brand: DTOBrand,\n});\n\nexport const DTOBrandsListResponse = z.object({ brands: z.array(DTOBrand) });\n\nexport type DTOBrand = z.infer<typeof DTOBrand>;\nexport type DTOBrandGetResponse = z.infer<typeof DTOBrandGetResponse>;\nexport type DTOBrandCreateResponse = z.infer<typeof DTOBrandCreateResponse>;\nexport type DTOBrandsListResponse = z.infer<typeof DTOBrandsListResponse>;\n\n//\n// Write\n//\n\nexport const DTOBrandCreatePayload = z.object({\n persistentId: z.string().uuid(),\n meta: DTOObjectMeta,\n});\n\nexport const DTOBrandUpdatePayload = z.object({\n meta: DTOObjectMeta.optional(),\n persistentId: z.string(),\n});\n\nexport type DTOBrandCreatePayload = z.infer<typeof DTOBrandCreatePayload>;\nexport type DTOBrandUpdatePayload = z.infer<typeof DTOBrandUpdatePayload>;\n","import {\n AnalyzeCodeComponentsInPackage,\n CodeComponent,\n CodeComponentParentType,\n CodeComponentProperty,\n CodeComponentResolvedType,\n CodeComponentResolvedTypeKind,\n CodeComponentUpsertResponse,\n DependencyDefinition,\n Registry,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOCodeComponentResolvedTypeKind = CodeComponentResolvedTypeKind;\n\nexport const DTOCodeComponentResolvedType = CodeComponentResolvedType;\n\nexport const DTOCodeComponentParentType = CodeComponentParentType;\n\nexport const DTOCodeComponentProperty = CodeComponentProperty;\n\nexport const DTOCodeComponent = CodeComponent;\n\nexport const DTOCodeComponentResponse = z.object({\n codeComponent: DTOCodeComponent,\n});\n\nexport const DTOCodeComponentListResponse = z.object({\n codeComponents: DTOCodeComponent.array(),\n});\n\nexport type DTOCodeComponentResolvedTypeKind = z.infer<typeof DTOCodeComponentResolvedTypeKind>;\nexport type DTOCodeComponentResolvedType = z.infer<typeof DTOCodeComponentResolvedType>;\nexport type DTOCodeComponentParentType = z.infer<typeof DTOCodeComponentParentType>;\nexport type DTOCodeComponentProperty = z.infer<typeof DTOCodeComponentProperty>;\nexport type DTOCodeComponent = z.infer<typeof DTOCodeComponent>;\nexport type DTOCodeComponentResponse = z.infer<typeof DTOCodeComponentResponse>;\nexport type DTOCodeComponentListResponse = z.infer<typeof DTOCodeComponentListResponse>;\n\n//\n// Write\n//\n\nexport const DTOCodeComponentCreateInput = z.object({\n persistentId: z.string(),\n exportName: z.string(),\n componentPath: z.string(),\n description: z.string(),\n properties: z.record(z.string(), DTOCodeComponentProperty),\n tags: z.record(z.string(), z.string()).nullable(),\n});\n\nexport const DTOCodeComponentsCreateInput = z.object({\n codeComponents: DTOCodeComponentCreateInput.array(),\n});\n\nexport const DTOCodeComponentUpsertResponse = CodeComponentUpsertResponse;\n\nexport type DTOCodeComponentCreateInput = z.infer<typeof DTOCodeComponentCreateInput>;\nexport type DTOCodeComponentsCreateInput = z.infer<typeof DTOCodeComponentsCreateInput>;\nexport type DTOCodeComponentUpsertResponse = z.infer<typeof DTOCodeComponentUpsertResponse>;\n\n//\n// Analyze\n//\n\nexport const DTOAnalyzeCodeComponentsInPackage = AnalyzeCodeComponentsInPackage;\nexport const DTODependencyDefinition = DependencyDefinition;\nexport const DTORegistry = Registry;\n\nexport const DTOAnalyzeCodeComponentsInPackageResponse = z.object({\n ok: z.literal(true),\n});\n\nexport const DTOAnalyzeCodeComponentsInPackageInput = AnalyzeCodeComponentsInPackage.omit({\n designSystemId: true,\n versionId: true,\n userAccessToken: true,\n});\n\nexport type DTOAnalyzeCodeComponentsInPackageInput = z.infer<typeof DTOAnalyzeCodeComponentsInPackageInput>;\nexport type DTOAnalyzeCodeComponentsInPackageResponse = z.infer<typeof DTOAnalyzeCodeComponentsInPackageResponse>;\nexport type DTOAnalyzeCodeComponentsInPackage = AnalyzeCodeComponentsInPackage;\nexport type DTODependencyDefinition = DependencyDefinition;\nexport type DTORegistry = Registry;\n","import { z } from \"zod\";\nimport { DTOObjectMeta } from \"../aux\";\n\n//\n// Read\n//\n\nexport const DTODesignSystemComponent = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n brandId: z.string(),\n meta: DTOObjectMeta,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTODesignSystemComponentResponse = z.object({\n designSystemComponent: DTODesignSystemComponent,\n});\n\nexport const DTODesignSystemComponentListResponse = z.object({\n designSystemComponents: DTODesignSystemComponent.array(),\n});\n\nexport type DTODesignSystemComponent = z.infer<typeof DTODesignSystemComponent>;\nexport type DTODesignSystemComponentResponse = z.infer<typeof DTODesignSystemComponentResponse>;\nexport type DTODesignSystemComponentListResponse = z.infer<typeof DTODesignSystemComponentListResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignSystemComponentCreateInput = z.object({\n brandId: z.string(), // Persistent ID,\n persistentId: z.string(),\n meta: DTOObjectMeta,\n});\n\nexport type DTODesignSystemComponentCreateInput = z.infer<typeof DTODesignSystemComponentCreateInput>;\n","import { z } from \"zod\";\nimport { DTOUser } from \"../users\";\n\nexport const DTODesignSystemContactsResponse = z.object({\n contacts: z.object({\n workspace: z.array(DTOUser),\n designSystem: z.array(DTOUser),\n }),\n});\n\nexport type DTODesignSystemContactsResponse = z.infer<typeof DTODesignSystemContactsResponse>;\n","import { UserOnboardingDepartment, UserOnboardingJobLevel, UserSource, UserTheme } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOUser, DTOUserProfile } from \"./user\";\n\nexport const DTOUserOnboardingDepartment = UserOnboardingDepartment;\nexport const DTOUserOnboardingJobLevel = UserOnboardingJobLevel;\nexport const DTOUserSource = UserSource;\nexport const DTOUserTheme = UserTheme;\n\nexport const DTOUserOnboarding = z.object({\n companyName: z.string().optional(),\n numberOfPeopleInOrg: z.string().optional(),\n numberOfPeopleInDesignTeam: z.string().optional(),\n department: DTOUserOnboardingDepartment.optional(),\n jobTitle: z.string().optional(),\n phase: z.string().optional(),\n jobLevel: DTOUserOnboardingJobLevel.optional(),\n designSystemName: z.string().optional(),\n defaultDestination: z.string().optional(),\n isPageDraftOnboardingFinished: z.boolean().optional(),\n});\n\nexport const DTOAuthenticatedUserProfile = DTOUserProfile.extend({\n onboarding: DTOUserOnboarding.optional(),\n theme: DTOUserTheme.optional(),\n});\n\nexport const DTOAuthenticatedUser = DTOUser.extend({\n profile: DTOAuthenticatedUserProfile,\n createdAt: z.coerce.date(),\n loggedOutAt: z.coerce.date().optional(),\n source: DTOUserSource.optional(),\n});\n\nexport const DTOAuthenticatedUserResponse = z.object({\n user: DTOAuthenticatedUser,\n});\n\nexport type DTOUserOnboardingDepartment = z.infer<typeof DTOUserOnboardingDepartment>;\nexport type DTOUserOnboardingJobLevel = z.infer<typeof DTOUserOnboardingJobLevel>;\nexport type DTOUserSource = z.infer<typeof DTOUserSource>;\nexport type DTOUserTheme = z.infer<typeof DTOUserTheme>;\nexport type DTOUserOnboarding = z.infer<typeof DTOUserOnboarding>;\nexport type DTOAuthenticatedUserProfile = z.infer<typeof DTOAuthenticatedUserProfile>;\nexport type DTOAuthenticatedUser = z.infer<typeof DTOAuthenticatedUser>;\nexport type DTOAuthenticatedUserResponse = z.infer<typeof DTOAuthenticatedUserResponse>;\n","import { UserProfileUpdate } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n/**\n * Definition of a user profile as inspectable by other users (i.e. reduced version)\n */\nexport const DTOUserProfile = z.object({\n name: z.string(),\n nickname: z.string().optional(),\n avatar: z.string().optional(),\n});\n\n/**\n * Definition of a user as inspectable by other users (i.e. reduced version)\n */\nexport const DTOUser = z.object({\n id: z.string(),\n email: z.string(),\n profile: DTOUserProfile,\n});\n\nexport const DTOUserGetResponse = z.object({\n user: DTOUser,\n});\n\nexport const DTOUserProfileUpdate = UserProfileUpdate;\n\nexport type DTOUserProfile = z.infer<typeof DTOUserProfile>;\nexport type DTOUser = z.infer<typeof DTOUser>;\nexport type DTOUserGetResponse = z.infer<typeof DTOUserGetResponse>;\nexport type DTOUserProfileUpdate = z.infer<typeof DTOUserProfileUpdate>;\n","import { User } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOUserProfileUpdateResponse = z.object({\n user: User,\n});\n\nexport type DTOUserProfileUpdateResponse = z.infer<typeof DTOUserProfileUpdateResponse>;\n","import {\n DataSourceAutoImportMode,\n DataSourceFigmaScope,\n DataSourceFigmaState,\n DataSourceRemoteType,\n DataSourceStats,\n DataSourceUploadImportMetadata,\n DataSourceUploadRemoteSource,\n SourceImportStorybookSummary,\n SourceImportSummary,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODataSourceFigmaScope = DataSourceFigmaScope;\n\nconst DTODataSourceFigmaFileVersion = z.object({\n id: z.string(),\n created_at: z.coerce.date(),\n label: z.string(),\n description: z.string(),\n});\n\nexport const DTODataSourceFigmaCloud = z.object({\n fileId: z.string(),\n state: DataSourceFigmaState,\n autoImportMode: DataSourceAutoImportMode,\n fileThumbnailUrl: z.string().optional(),\n lastImportResult: SourceImportSummary.nullish(),\n lastImportedAt: z.coerce.date().nullish(),\n lastImportedVersion: DTODataSourceFigmaFileVersion.nullish(),\n lastUpdatesCheckedAt: z.date().nullish(),\n ownerId: z.string(),\n ownerUserName: z.string().optional(),\n preferredCredentialId: z.string().optional(),\n stats: DataSourceStats,\n});\n\nexport const DTODataSourceFigma = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.Figma),\n fileName: z.string(),\n scope: DTODataSourceFigmaScope,\n brandId: z.string(),\n themeId: z.string().nullish(),\n cloud: DTODataSourceFigmaCloud.nullish(),\n sortOrder: z.number().optional(),\n});\n\n// TS is not yet implemented in new BE\nexport const DTODataSourceTokenStudio = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.TokenStudio),\n fileName: z.string(),\n brandId: z.string(),\n themeId: z.string().nullish(),\n sortOrder: z.number().optional(),\n tokenStudio: z.object({\n settings: z.object({\n dryRun: z.boolean(),\n verbose: z.boolean(),\n preciseCopy: z.boolean(),\n }),\n connectionName: z.string(),\n lastImportedAt: z.coerce.date(),\n lastImportedResults: z.array(\n z.object({\n mapping: z.object({\n tokenSets: z.array(z.string()),\n supernovaBrand: z.string(),\n supernovaTheme: z.string().optional(),\n }),\n isFailed: z.boolean(),\n tokensCreated: z.number(),\n tokensDeleted: z.number(),\n tokensUpdated: z.number(),\n })\n ),\n }),\n});\n\nexport const DTODataSourceFigmaVariablesPlugin = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),\n fileName: z.string(),\n brandId: z.string(),\n sortOrder: z.number().optional(),\n upload: z.object({\n remoteId: z.string(),\n remoteSourceType: DataSourceUploadRemoteSource,\n lastImportedAt: z.coerce.date().optional(),\n lastImportMetadata: DataSourceUploadImportMetadata.optional(),\n isTokenTypeSplitEnabled: z.boolean(),\n }),\n figmaVariablesPlugin: z.object({\n fileId: z.string(),\n lastImportedAt: z.coerce.date().optional(),\n lastImportMetadata: DataSourceUploadImportMetadata.optional(),\n isTokenTypeSplitEnabled: z.boolean(),\n isCollectionsMigrationCompleted: z.boolean().default(false),\n }),\n});\n\nexport const DTODataSourceStorybook = z.object({\n id: z.string(),\n type: z.literal(DataSourceRemoteType.Enum.Storybook),\n fileName: z.string(),\n brandId: z.string(),\n sortOrder: z.number().optional(),\n storybook: z.object({\n indexUrl: z.string(),\n userUrl: z.string(),\n lastImportedAt: z.coerce.date().optional(),\n lastImportedResult: SourceImportStorybookSummary.optional(),\n lastImportedSuccessfully: z.coerce.date().optional(),\n isFailed: z.boolean(),\n storiesCount: z.number(),\n docsCount: z.number(),\n description: z.string().optional(),\n isUsingVpn: z.boolean().optional(),\n }),\n});\n\nexport const DTODataSourcesStorybookResponse = z.object({\n isFailed: z.boolean(),\n storiesCount: z.number(),\n docsCount: z.number(),\n created: z.array(z.string()).optional(),\n updated: z.array(z.string()).optional(),\n deleted: z.array(z.string()).optional(),\n});\n\nexport const DTODataSource = z.discriminatedUnion(\"type\", [\n DTODataSourceFigma,\n DTODataSourceFigmaVariablesPlugin,\n DTODataSourceTokenStudio,\n DTODataSourceStorybook,\n]);\n\nexport const DTODataSourcesListResponse = z.object({\n sources: z.array(DTODataSource),\n});\n\nexport const DTODataSourceResponse = z.object({\n source: DTODataSource,\n});\n\nexport type DTODataSourceFigma = z.infer<typeof DTODataSourceFigma>;\nexport type DTODataSourceTokenStudio = z.infer<typeof DTODataSourceTokenStudio>;\nexport type DTODataSourceFigmaVariablesPlugin = z.infer<typeof DTODataSourceFigmaVariablesPlugin>;\nexport type DTODataSourceStorybook = z.infer<typeof DTODataSourceStorybook>;\nexport type DTODataSource = z.infer<typeof DTODataSource>;\nexport type DTODataSourceResponse = z.infer<typeof DTODataSourceResponse>;\nexport type DTODataSourcesListResponse = z.infer<typeof DTODataSourcesListResponse>;\nexport type DTODataSourcesStorybookResponse = z.infer<typeof DTODataSourcesStorybookResponse>;\n\n//\n// Write\n//\n\nexport const DTODataSourceFigmaCreatePayload = z.object({\n brandPersistentId: z.string(),\n figmaFileUrl: z.string(),\n scope: DTODataSourceFigmaScope,\n autoImportMode: DataSourceAutoImportMode,\n});\n\nexport const DTODataSourceFigmaImportPayload = z.object({\n sourceIds: z.array(z.string()),\n});\n\nexport const DTODataSourceStorybookCreatePayload = z.object({\n brandPersistentId: z.string(),\n fileName: z.string().optional(),\n userUrl: z.string(),\n indexUrl: z.string(),\n payload: z.unknown(),\n type: z.literal(DataSourceRemoteType.Enum.Storybook),\n description: z.string().optional(),\n isUsingVpn: z.boolean().optional(),\n});\n\nexport const DTOStorybookImportPayload = z.object({\n sourceId: z.string(),\n payload: z.unknown(),\n});\n\nexport const DTOStorybookSourceUpdatePayload = z.object({\n description: z.string().nullish().optional(),\n isUsingVpn: z.boolean().optional(),\n fileName: z.string().optional(),\n});\n\nexport const DTOFigmaSourceUpdatePayload = z.object({\n themeId: z.string().optional(),\n scope: DataSourceFigmaScope.optional(),\n autoImportMode: DataSourceAutoImportMode.optional(),\n});\n\nexport type DTODataSourceFigmaScope = z.infer<typeof DTODataSourceFigmaScope>;\nexport type DTODataSourceFigmaCreatePayload = z.infer<typeof DTODataSourceFigmaCreatePayload>;\nexport type DTODataSourceStorybookCreatePayload = z.infer<typeof DTODataSourceStorybookCreatePayload>;\nexport type DTODataSourceFigmaImportPayload = z.infer<typeof DTODataSourceFigmaImportPayload>;\nexport type DTOStorybookImportPayload = z.infer<typeof DTOStorybookImportPayload>;\nexport type DTOStorybookSourceUpdatePayload = z.infer<typeof DTOStorybookSourceUpdatePayload>;\nexport type DTOFigmaSourceUpdatePayload = z.infer<typeof DTOFigmaSourceUpdatePayload>;\n","import { DesignSystem, DesignSystemAccessMode, ObjectMeta, WorkspaceRoleSchema } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODesignSystemMembersUpdatePayload } from \"./members\";\nimport { DTODesignSystemRole } from \"./role\";\n\n//\n// Read\n//\n\nexport const DTODesignSystem = DesignSystem.omit({\n name: true,\n description: true,\n docExporterId: true,\n}).extend({\n meta: ObjectMeta,\n docExporterId: z.string(),\n sources: z.array(z.any()),\n isPublic: z.literal(true),\n\n /**\n * Whether or not user who is requesting the design system\n * has access to the design system's contents.\n */\n isAvailableToUser: z.boolean(),\n\n /**\n * @deprecated\n */\n role: WorkspaceRoleSchema.optional(),\n\n /**\n * User's role within the design system that can come either from\n * the design system or workspace.\n */\n effectiveRole: DTODesignSystemRole.optional(),\n});\n\nexport const DTODesignSystemResponse = z.object({\n designSystem: DTODesignSystem,\n});\n\nexport const DTODesignSystemsListResponse = z.object({\n designSystems: DTODesignSystem.array(),\n});\n\nexport type DTODesignSystem = z.infer<typeof DTODesignSystem>;\nexport type DTODesignSystemResponse = z.infer<typeof DTODesignSystemResponse>;\nexport type DTODesignSystemsListResponse = z.infer<typeof DTODesignSystemsListResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignSystemCreateInput = z.object({\n workspaceId: z.string(),\n meta: ObjectMeta.optional(),\n name: z.string().min(2).max(64).optional(),\n description: z.string().max(1024).optional(),\n accessMode: DesignSystemAccessMode.optional(),\n\n invites: DTODesignSystemMembersUpdatePayload.pick({\n usersToInvite: true,\n invitesToInvite: true,\n emailsToInvite: true,\n }).optional(),\n});\n\nexport type DTODesignSystemCreateInput = z.infer<typeof DTODesignSystemCreateInput>;\n","import { DesignSystemMembershipUpdates } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODesignSystemRole } from \"./role\";\n\n//\n// Read\n//\n\nexport const DTODesignSystemMember = z.object({\n userId: z.string(),\n\n /**\n * Role that the member has in the design system,\n * undefined if set to inherit from workspace\n */\n designSystemRole: DTODesignSystemRole.optional(),\n});\n\nexport const DTODesignSystemInvitation = z.object({\n id: z.string(),\n workspaceInvitationId: z.string(),\n\n /**\n * Role that the invitation has in the design system,\n * undefined if set to inherit from workspace\n */\n designSystemRole: DTODesignSystemRole.optional(),\n});\n\nexport const DTODesignSystemMemberListResponse = z.object({\n members: DTODesignSystemMember.array(),\n invitations: DTODesignSystemInvitation.array(),\n});\n\nexport const DTODesignSystemMembersUpdateResponse = z.object({\n ok: z.literal(true),\n});\n\nexport type DTODesignSystemMember = z.infer<typeof DTODesignSystemMember>;\nexport type DTODesignSystemInvitation = z.infer<typeof DTODesignSystemInvitation>;\nexport type DTODesignSystemMemberListResponse = z.infer<typeof DTODesignSystemMemberListResponse>;\nexport type DTODesignSystemMembersUpdateResponse = z.infer<typeof DTODesignSystemMembersUpdateResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignSystemMembersUpdatePayload = DesignSystemMembershipUpdates;\n\nexport type DTODesignSystemMembersUpdatePayload = z.infer<typeof DTODesignSystemMembersUpdatePayload>;\n","import { WorkspaceRole } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODesignSystemRole = z.enum([\n WorkspaceRole.Admin,\n WorkspaceRole.Contributor,\n WorkspaceRole.Creator,\n WorkspaceRole.Viewer,\n]);\n\nexport type DTODesignSystemRole = z.infer<typeof DTODesignSystemRole>;\n","import { z } from \"zod\";\n\nexport const DTODiffCountBase = z.object({\n created: z.number(),\n updated: z.number(),\n deleted: z.number(),\n});\n\nexport const DTODesignElementsDataDiffResponse = z.object({\n tokens: DTODiffCountBase,\n assets: DTODiffCountBase,\n});\n\nexport type DTODesignElementsDataDiffResponse = z.infer<typeof DTODesignElementsDataDiffResponse>;\n","import { z } from \"zod\";\n\nconst DimensionsVariableScopeSchema = z.enum([\n \"CORNER_RADIUS\",\n \"WIDTH_HEIGHT\",\n \"GAP\",\n \"STROKE_FLOAT\",\n \"EFFECT_FLOAT\",\n \"OPACITY\",\n \"FONT_SIZE\",\n \"LINE_HEIGHT\",\n \"LETTER_SPACING\",\n \"PARAGRAPH_SPACING\",\n \"PARAGRAPH_INDENT\",\n \"FONT_WEIGHT\",\n]);\n\nconst StringVariableScopeSchema = z.enum([\"TEXT_CONTENT\", \"FONT_FAMILY\", \"FONT_STYLE\"]);\n\nexport type DimensionsVariableScopeType = z.infer<typeof DimensionsVariableScopeSchema>;\nexport const DimensionsVariableScopeType = DimensionsVariableScopeSchema.enum;\n\nexport type StringVariableScopeType = z.infer<typeof StringVariableScopeSchema>;\nexport const StringVariableScopeType = StringVariableScopeSchema.enum;\n\nconst VariableScope = z.string();\n\nconst ReferencedVariableOrigin = z.object({\n name: z.string(),\n remote: z.boolean(),\n});\n\nexport const RGB = z.object({\n r: z.number(),\n g: z.number(),\n b: z.number(),\n});\n\nexport const RGBA = RGB.extend({\n a: z.number(),\n});\n\nexport const VariableAlias = z.object({\n type: z.literal(\"VARIABLE_ALIAS\"),\n id: z.string(),\n resolvedValue: z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).optional(),\n referenceOrigin: ReferencedVariableOrigin.optional().or(z.null()),\n});\n\nexport const VariableValue = z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).or(VariableAlias);\nexport const ResolvedVariableType = z.enum([\"BOOLEAN\", \"FLOAT\", \"STRING\", \"COLOR\"]);\n\nexport const Variable = z.object({\n id: z.string(),\n name: z.string(),\n key: z.string(),\n variableCollectionId: z.string(),\n resolvedType: ResolvedVariableType,\n valuesByMode: z.record(VariableValue),\n remote: z.boolean(),\n description: z.string(),\n hiddenFromPublishing: z.boolean(),\n scopes: z.array(VariableScope),\n codeSyntax: z.record(z.any()).optional(),\n});\n\nexport const VariableMode = z.object({\n modeId: z.string(),\n name: z.string(),\n});\n\nexport const Collection = z.object({\n id: z.string(),\n name: z.string(),\n modes: z.array(VariableMode),\n defaultModeId: z.string(),\n remote: z.boolean(),\n hiddenFromPublishing: z.boolean(),\n});\n\nexport const VariablesMapping = z.object({\n variableCollections: z.array(z.string()).min(1),\n variableMode: z.string().min(1),\n supernovaBrand: z.string().min(1),\n supernovaTheme: z.string().min(1).optional().or(z.null()),\n});\n\nexport const FormattedCollections = z.object({\n variables: z.record(z.string(), Variable),\n variableCollections: z.record(z.string(), Collection),\n mappings: z.array(VariablesMapping).optional(),\n variablesOrder: z.string().array().optional(),\n});\n\n//\n// Types\n//\n\nexport type RGB = z.infer<typeof RGB>;\nexport type RGBA = z.infer<typeof RGBA>;\nexport type ResolvedVariableType = z.infer<typeof ResolvedVariableType>;\nexport type Variable = z.infer<typeof Variable>;\nexport type VariableAlias = z.infer<typeof VariableAlias>;\nexport type VariableValue = z.infer<typeof VariableValue>;\nexport type VariableMode = z.infer<typeof VariableMode>;\nexport type Collection = z.infer<typeof Collection>;\nexport type VariablesMapping = z.infer<typeof VariablesMapping>;\nexport type FormattedCollections = z.infer<typeof FormattedCollections>;\n","import { AssetScope } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOAssetScope = AssetScope;\n\nexport const DTOFileUploadItem = z.object({\n size: z.number(),\n name: z.string(),\n checksum: z.string(),\n scope: DTOAssetScope.exclude([\"ComponentThumbnail\", \"DocumentationFrame\"]).optional(),\n});\n\nexport const DTOFileUploadPayload = z.object({\n files: z.array(DTOFileUploadItem),\n});\n\nexport const DTOFileUploadResponseItem = z.object({\n fileId: z.string(),\n referencePersistentId: z.string(),\n name: z.string(),\n checksum: z.string(),\n pendingUpload: z.boolean().optional(),\n url: z.string(),\n size: z.number(),\n});\n\nexport const DTOFileResponseItem = DTOFileUploadResponseItem;\n\nexport const DTOUploadUrlItem = z.object({\n fileId: z.string(),\n uploadUrl: z.string(),\n});\n\nexport const DTOFileUploadResponse = z.object({\n files: z.array(DTOFileUploadResponseItem),\n uploadUrls: z.array(DTOUploadUrlItem),\n});\n\n/**\n * @deprecated Use GET method with DTOFilesGetQuery\n */\nexport const DTOFilesGetPayload = z.object({\n persistentIds: z.string().array().optional(),\n});\n\nexport const DTOFilesGetQuery = z.object({\n includeScope: DTOAssetScope.optional(),\n});\n\nexport const DTOFilesResponse = z.object({\n files: z.array(DTOFileResponseItem),\n});\n\nexport const DTOFileUploadFinalizePayload = z.object({\n fileIds: z.array(z.string()),\n});\n\nexport const DTOFileUploadFinalizeResponse = z.object({ ok: z.literal(true) });\n\nexport type DTOFileUploadItem = z.infer<typeof DTOFileUploadItem>;\nexport type DTOFileUploadPayload = z.infer<typeof DTOFileUploadPayload>;\nexport type DTOFileUploadResponseItem = z.infer<typeof DTOFileUploadResponseItem>;\nexport type DTOUploadUrlItem = z.infer<typeof DTOUploadUrlItem>;\nexport type DTOFileUploadResponse = z.infer<typeof DTOFileUploadResponse>;\nexport type DTOFileUploadFinalizePayload = z.infer<typeof DTOFileUploadFinalizePayload>;\nexport type DTOFileUploadFinalizeResponse = z.infer<typeof DTOFileUploadFinalizeResponse>;\nexport type DTOFileResponseItem = z.infer<typeof DTOFileResponseItem>;\nexport type DTOFilesGetPayload = z.infer<typeof DTOFilesGetPayload>;\nexport type DTOFilesResponse = z.infer<typeof DTOFilesResponse>;\nexport type DTOFilesGetQuery = z.infer<typeof DTOFilesGetQuery>;\nexport type DTOAssetScope = z.infer<typeof DTOAssetScope>;\n","import {\n DataSourceAutoImportMode,\n DataSourceFigmaScope,\n DataSourceRemoteType,\n ImportJobState,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOImportJob = z.object({\n id: z.string(),\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n operation: z.literal(\"Import\"),\n createdAt: z.coerce.date(),\n stateChangedAt: z.coerce.date(),\n state: ImportJobState,\n sourceIds: z.string().array(),\n});\n\nexport const DTOImportJobResponse = z.object({\n job: DTOImportJob,\n});\n\nexport type DTOImportJob = z.infer<typeof DTOImportJob>;\nexport type DTOImportJobResponse = z.infer<typeof DTOImportJobResponse>;\n\n//\n// Write\n//\n\nexport const DTOBffFigmaImportRequestBody = z.object({\n type: z.literal(DataSourceRemoteType.Enum.Figma),\n brandPersistentId: z.string().optional(),\n fileId: z.string(),\n scope: DataSourceFigmaScope,\n autoImportMode: DataSourceAutoImportMode,\n});\n\nexport const DTOBffUploadImportRequestBody = z.object({\n type: z\n .enum([DataSourceRemoteType.Enum.FigmaVariablesPlugin, \"Upload\"])\n .transform(v => DataSourceRemoteType.Enum.FigmaVariablesPlugin),\n brandPersistentId: z.string().optional(),\n sourceName: z.string().optional(),\n remoteId: z.string(),\n isTokenTypeSplitEnabled: z.boolean().optional(),\n payload: z.any(),\n});\n\nexport const DTOBffImportRequestBody = z.discriminatedUnion(\"type\", [\n DTOBffFigmaImportRequestBody,\n DTOBffUploadImportRequestBody,\n]);\n\nexport type DTOBffFigmaImportRequestBody = z.infer<typeof DTOBffFigmaImportRequestBody>;\nexport type DTOBffUploadImportRequestBody = z.infer<typeof DTOBffUploadImportRequestBody>;\nexport type DTOBffImportRequestBody = z.infer<typeof DTOBffImportRequestBody>;\n","import { z } from \"zod\";\n\nexport const DTOPageRedirectCreateBody = z.object({\n pagePersistentId: z.string(),\n path: z.string(),\n});\n\nexport const DTOPageRedirectUpdateBody = DTOPageRedirectCreateBody.partial();\n\nexport const DTOPageRedirect = z.object({\n id: z.string(),\n pagePersistentId: z.string(),\n path: z.string(),\n});\n\nexport const DTOPageRedirectListResponse = z.object({\n redirects: DTOPageRedirect.array(),\n});\n\nexport const DTOPageRedirectResponse = z.object({\n redirect: DTOPageRedirect,\n});\n\nexport const DTOPageRedirectDeleteResponse = z.object({\n success: z.boolean(),\n});\n\nexport type DTOPageRedirectCreateBody = z.infer<typeof DTOPageRedirectCreateBody>;\nexport type DTOPageRedirectUpdateBody = z.infer<typeof DTOPageRedirectUpdateBody>;\nexport type DTOPageRedirect = z.infer<typeof DTOPageRedirect>;\nexport type DTOPageRedirectListResponse = z.infer<typeof DTOPageRedirectListResponse>;\nexport type DTOPageRedirectResponse = z.infer<typeof DTOPageRedirectResponse>;\nexport type DTOPageRedirectDeleteResponse = z.infer<typeof DTOPageRedirectDeleteResponse>;\n","import { z } from \"zod\";\n\nexport const DTODesignSystemVersionStats = z.object({\n tokens: z.number(),\n designSystemComponents: z.number(),\n assets: z.number(),\n documentationPages: z.number(),\n figmaComponents: z.number(),\n});\n\nexport const DTODesignSystemVersionStatsQuery = z.object({\n /**\n * Unique ID across versions (non-persistent ID)\n */\n brandId: z.string().optional(),\n});\n\nexport type DTODesignSystemVersionStats = z.infer<typeof DTODesignSystemVersionStats>;\nexport type DTODesignSystemVersionStatsQuery = z.infer<typeof DTODesignSystemVersionStatsQuery>;\n","import { z } from \"zod\";\n\nexport const DTOStorybookUploadUrlRequest = z.object({\n name: z.string(),\n});\n\nexport const DTOStorybookUploadUrlResponse = z.object({\n signedUrl: z.string(),\n storybookUploadId: z.string(),\n});\n\nexport const DTOStorybookAccessTokenResponse = z.object({\n accessToken: z.string(),\n});\n\nexport const DTOStorybookAccessTokenPayload = z.object({\n designSystemId: z.string(),\n storybookUploadId: z.string(),\n});\n\nexport const DTOStorybookUploadStatus = z.object({\n status: z.enum([\"Failed\", \"InProgress\", \"Completed\", \"Unknown\"]),\n timestamp: z.number().optional(),\n reason: z.string().optional(),\n});\n\nexport const DTOStorybookEntryOrigin = z.object({\n id: z.string(),\n type: z.enum([\"story\", \"docs\"]),\n name: z.string(),\n title: z.string(),\n});\n\nexport const DTOStorybookEntry = z.object({\n id: z.string(),\n storyId: z.string(),\n designSystemId: z.string(),\n sourceId: z.string(),\n aliases: z.array(z.string()).optional(),\n url: z.string(),\n isDeleted: z.boolean().optional(),\n origin: DTOStorybookEntryOrigin,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTOStorybookEntryReplaceAction = z.object({\n newStoryId: z.string(),\n});\n\nexport const DTOStorybookEntryListResponse = z.object({ entries: z.array(DTOStorybookEntry) });\nexport const DTOStorybookEntryResponse = z.object({ entry: DTOStorybookEntry });\n\nexport type DTOStorybookEntry = z.infer<typeof DTOStorybookEntry>;\nexport type DTOStorybookEntryOrigin = z.infer<typeof DTOStorybookEntryOrigin>;\nexport type DTOStorybookEntryReplaceAction = z.infer<typeof DTOStorybookEntryReplaceAction>;\nexport type DTOStorybookEntryListResponse = z.infer<typeof DTOStorybookEntryListResponse>;\nexport type DTOStorybookEntryResponse = z.infer<typeof DTOStorybookEntryResponse>;\nexport type DTOStorybookUploadUrlRequest = z.infer<typeof DTOStorybookUploadUrlRequest>;\nexport type DTOStorybookUploadUrlResponse = z.infer<typeof DTOStorybookUploadUrlResponse>;\nexport type DTOStorybookAccessTokenResponse = z.infer<typeof DTOStorybookAccessTokenResponse>;\nexport type DTOStorybookAccessTokenPayload = z.infer<typeof DTOStorybookAccessTokenPayload>;\nexport type DTOStorybookUploadStatus = z.infer<typeof DTOStorybookUploadStatus>;\n","import { z } from \"zod\";\nimport { DTODesignSystem } from \"./design-system\";\nimport { DTOWorkspace } from \"../workspaces\";\n\nexport const DTOUserDesignSystemsResponse = z.object({\n designSystems: DTODesignSystem.array(),\n workspaces: DTOWorkspace.array(),\n});\n\nexport type DTOUserDesignSystemsResponse = z.infer<typeof DTOUserDesignSystemsResponse>;\n","import {\n ForgeChatMessage,\n ForgeChatMessageSender,\n ForgeChatMessageSenderType,\n ForgeChatThread,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOForgeChatMessage = ForgeChatMessage;\nexport type DTOForgeChatMessage = z.infer<typeof DTOForgeChatMessage>;\n\nexport const DTOForgeChatThread = ForgeChatThread;\nexport type DTOForgeChatThread = z.infer<typeof DTOForgeChatThread>;\n\nexport const DTOForgeChatMessageSenderType = ForgeChatMessageSenderType;\nexport type DTOForgeChatMessageSenderType = z.infer<typeof DTOForgeChatMessageSenderType>;\n\nexport const DTOForgeChatMessageSender = ForgeChatMessageSender;\nexport type DTOForgeChatMessageSender = z.infer<typeof DTOForgeChatMessageSender>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/chat-threads\n */\nexport const DTOForgeChatThreadCreateInput = z.object({\n title: z.string().optional(),\n});\nexport type DTOForgeChatThreadCreateInput = z.infer<typeof DTOForgeChatThreadCreateInput>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/threads\n */\nexport const DTOForgeChatThreadCreateResponse = z.object({\n thread: DTOForgeChatThread,\n});\nexport type DTOForgeChatThreadCreateResponse = z.infer<typeof DTOForgeChatThreadCreateResponse>;\n\n/**\n * PUT /api/v1/workspaces/{wsId}/forge/threads/{threadId}\n */\nexport const DTOForgeChatThreadUpdateInput = z.object({\n title: z.string(),\n});\nexport type DTOForgeChatThreadUpdateInput = z.infer<typeof DTOForgeChatThreadUpdateInput>;\n\n/**\n * PUT /api/v1/workspaces/{wsId}/forge/threads/{threadId}\n */\nexport const DTOForgeChatThreadUpdateResponse = z.object({\n thread: DTOForgeChatThread,\n});\nexport type DTOForgeChatThreadUpdateResponse = z.infer<typeof DTOForgeChatThreadUpdateResponse>;\n\n/**\n * DELETE /api/v1/workspaces/{wsId}/forge/threads/{threadId}\n */\nexport const DTOForgeChatThreadDeleteResponse = z.object({\n success: z.boolean(),\n});\nexport type DTOForgeChatThreadDeleteResponse = z.infer<typeof DTOForgeChatThreadDeleteResponse>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads\n */\nexport const DTOForgeChatThreadListQuery = z.object({\n limit: z.number().optional(),\n offset: z.number().optional(),\n});\nexport type DTOForgeChatThreadListQuery = z.infer<typeof DTOForgeChatThreadListQuery>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads\n */\nexport const DTOForgeChatThreadListResponse = z.object({\n threads: z.array(DTOForgeChatThread),\n pagination: z.object({\n offset: z.number(),\n limit: z.number(),\n total: z.number(),\n }),\n});\nexport type DTOForgeChatThreadListResponse = z.infer<typeof DTOForgeChatThreadListResponse>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageCreateInput = z.object({\n payload: z.string(),\n sender: DTOForgeChatMessageSender.optional(),\n});\n\nexport type DTOForgeChatMessageCreateInput = z.infer<typeof DTOForgeChatMessageCreateInput>;\n\n/**\n * POST /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageCreateResponse = z.object({\n message: DTOForgeChatMessage,\n});\nexport type DTOForgeChatMessageCreateResponse = z.infer<typeof DTOForgeChatMessageCreateResponse>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageListQuery = z.object({\n limit: z\n .string()\n .optional()\n .transform(val => (val ? parseInt(val, 10) : undefined)),\n offset: z\n .string()\n .optional()\n .transform(val => (val ? parseInt(val, 10) : undefined)),\n});\n\nexport type DTOForgeChatMessageListQuery = z.infer<typeof DTOForgeChatMessageListQuery>;\n\n/**\n * GET /api/v1/workspaces/{wsId}/forge/threads/{threadId}/messages\n */\nexport const DTOForgeChatMessageListResponse = z.object({\n messages: z.array(DTOForgeChatMessage),\n totalCount: z.number(),\n hasMore: z.boolean(),\n});\n\nexport type DTOForgeChatMessageListResponse = z.infer<typeof DTOForgeChatMessageListResponse>;\n","import { z } from \"zod\";\n\nexport const DTOGitOrganization = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\nexport type DTOGitOrganization = z.infer<typeof DTOGitOrganization>;\n\nexport const DTOGitProject = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n});\nexport type DTOGitProject = z.infer<typeof DTOGitProject>;\n\nexport const DTOGitRepository = z.object({\n id: z.string(),\n name: z.string(),\n url: z.string(),\n slug: z.string(),\n defaultBranch: z.string().optional(),\n});\nexport type DTOGitRepository = z.infer<typeof DTOGitRepository>;\n\nexport const DTOGitBranch = z.object({\n name: z.string(),\n lastCommitId: z.string(),\n});\nexport type DTOGitBranch = z.infer<typeof DTOGitBranch>;\n","import { ExtendedIntegrationType, IntegrationCredentials, IntegrationDesignSystem } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOIntegrationCredentials = IntegrationCredentials.omit({\n accessToken: true,\n refreshToken: true,\n});\n\nexport const DTOIntegration = z.object({\n id: z.string(),\n workspaceId: z.string(),\n type: ExtendedIntegrationType,\n createdAt: z.coerce.date(),\n integrationCredentials: z.array(DTOIntegrationCredentials).optional(),\n integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),\n});\n\nexport const DTOIntegrationOAuthGetResponse = z.object({\n url: z.string(),\n});\n\nexport const DTOIntegrationPostResponse = z.object({\n integration: DTOIntegration,\n});\n\nexport const DTOIntegrationsGetListResponse = z.object({\n integrations: DTOIntegration.array(),\n});\n\nexport type DTOIntegration = z.infer<typeof DTOIntegration>;\nexport type DTOIntegrationCredentials = z.infer<typeof DTOIntegrationCredentials>;\nexport type DTOIntegrationOAuthGetResponse = z.infer<typeof DTOIntegrationOAuthGetResponse>;\nexport type DTOIntegrationPostResponse = z.infer<typeof DTOIntegrationPostResponse>;\nexport type DTOIntegrationsGetListResponse = z.infer<typeof DTOIntegrationsGetListResponse>;\n","import { WorkspaceInvitation, WorkspaceRoleSchema } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOWorkspaceInvitationInput = z.object({\n email: z.string().email(),\n role: WorkspaceRoleSchema,\n});\n\nexport const DTOWorkspaceInvitationsListInput = z.object({\n invites: DTOWorkspaceInvitationInput.array().max(100),\n designSystemId: z.string().optional(),\n});\n\nexport const DTOWorkspaceInvitationsResponse = z.object({\n invitations: WorkspaceInvitation.array(),\n});\n\nexport const DTOWorkspaceInviteUpdate = z.object({\n role: WorkspaceRoleSchema,\n});\n\nexport const DTOWorkspaceInvitationUpdateResponse = z.object({\n invitation: WorkspaceInvitation,\n});\n\nexport type DTOWorkspaceInvitationInput = z.infer<typeof DTOWorkspaceInvitationInput>;\nexport type DTOWorkspaceInvitationsListInput = z.infer<typeof DTOWorkspaceInvitationsListInput>;\nexport type DTOWorkspaceInvitationsResponse = z.infer<typeof DTOWorkspaceInvitationsResponse>;\nexport type DTOWorkspaceInviteUpdate = z.infer<typeof DTOWorkspaceInviteUpdate>;\nexport type DTOWorkspaceInvitationUpdateResponse = z.infer<typeof DTOWorkspaceInvitationUpdateResponse>;\n","import { z } from \"zod\";\nimport { DTOWorkspace } from \"./workspace\";\nimport { User, WorkspaceRoleSchema } from \"@supernova-studio/model\";\n\n//\n// Read\n//\n\nexport const DTOWorkspaceRole = z.enum([\"Owner\", \"Admin\", \"Creator\", \"Viewer\", \"Billing\", \"Contributor\"]);\n\nexport const DTOUserWorkspaceMembership = z.object({\n // Workspace the user is a member of\n workspace: DTOWorkspace,\n\n // Assigned role the user has in the workspace\n role: DTOWorkspaceRole,\n\n // Role that determines actual permissions the user has in the workspace\n // E.g. this is different from the default role when editors are downgraded to viewers\n // when a workspace's subscription is downgraded to free tier\n effectiveRole: DTOWorkspaceRole,\n});\n\nexport const DTOWorkspaceMember = z.object({\n user: User,\n role: WorkspaceRoleSchema,\n effectiveRole: WorkspaceRoleSchema,\n});\n\nexport const DTOUserWorkspaceMembershipsResponse = z.object({\n membership: z.array(DTOUserWorkspaceMembership),\n});\n\nexport const DTOWorkspaceMembersListResponse = z.object({\n members: z.array(DTOWorkspaceMember),\n});\n\nexport type DTOWorkspaceRole = z.infer<typeof DTOWorkspaceRole>;\nexport type DTOUserWorkspaceMembership = z.infer<typeof DTOUserWorkspaceMembership>;\nexport type DTOUserWorkspaceMembershipsResponse = z.infer<typeof DTOUserWorkspaceMembershipsResponse>;\nexport type DTOWorkspaceMembersListResponse = z.infer<typeof DTOWorkspaceMembersListResponse>;\n","import { Subscription, WorkspaceProfile } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTONpmRegistryConfig } from \"./npm-registry\";\n\n//\n// Read\n//\n\nexport const DTOWorkspaceProfile = WorkspaceProfile;\n\nexport const DTOWorkspace = z.object({\n id: z.string(),\n profile: DTOWorkspaceProfile,\n subscription: Subscription,\n npmRegistry: DTONpmRegistryConfig.optional(),\n});\n\nexport type DTOWorkspaceProfile = z.infer<typeof DTOWorkspaceProfile>;\nexport type DTOWorkspace = z.infer<typeof DTOWorkspace>;\n\n//\n// Write\n//\n\nexport const DTOWorkspaceCreateInput = z.object({\n name: z.string(),\n});\n\nexport const DTOWorkspaceResponse = z.object({\n workspace: DTOWorkspace,\n});\n\nexport type DTOWorkspaceCreateInput = z.infer<typeof DTOWorkspaceCreateInput>;\nexport type DTOWorkspaceResponse = z.infer<typeof DTOWorkspaceResponse>;\n","import { NpmRegistryAuthType, NpmRegistryType, nullishToOptional } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTONpmRegistryConfigConstants = {\n passwordPlaceholder: \"redacted\",\n};\n\nexport const DTONpmRegistryConfig = z.object({\n // Registry basic configuration\n registryType: NpmRegistryType,\n registryUrl: z.string(),\n customRegistryUrl: z.string().optional(),\n\n // URL of Supernova NPM packages proxy\n proxyUrl: z.string(),\n\n // Auth configuration\n authType: NpmRegistryAuthType,\n accessToken: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),\n username: z.string().optional(),\n password: z.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),\n\n // NPM package scopes for whih the proxy should be enabled\n enabledScopes: z.array(z.string()),\n\n // True if client should bypass Supernova proxy and connect directly to the registry\n // (e.g. when the NPM registry is behind a VPN or firewall which prevents Supernova from accessing it)\n bypassProxy: z.boolean(),\n});\n\nexport const DTONpmRegistryAccessTokenResponse = z.object({\n version: z.number(),\n accessToken: z.string().optional(),\n registryUrl: z.string(),\n});\n\nexport const DTOUpdateRegistryInput = z.object({\n registryType: nullishToOptional(NpmRegistryType),\n authType: nullishToOptional(NpmRegistryAuthType),\n enabledScopes: nullishToOptional(z.array(z.string())),\n customRegistryUrl: nullishToOptional(z.string()),\n bypassProxy: nullishToOptional(z.boolean()),\n npmProxyVersion: nullishToOptional(z.number()),\n authHeaderName: nullishToOptional(z.string()),\n authHeaderValue: nullishToOptional(z.string()),\n accessToken: nullishToOptional(z.string()),\n username: nullishToOptional(z.string()),\n password: nullishToOptional(z.string()),\n});\n\nexport const DTOUpdateRegistryOutput = z.object({\n npmRegistrySettings: DTONpmRegistryConfig,\n});\n\nexport type DTONpmRegistryConfig = z.infer<typeof DTONpmRegistryConfig>;\nexport type DTONpmRegistryAccessTokenResponse = z.infer<typeof DTONpmRegistryAccessTokenResponse>;\nexport type DTOUpdateRegistryInput = z.infer<typeof DTOUpdateRegistryInput>;\nexport type DTOUpdateRegistryOutput = z.infer<typeof DTOUpdateRegistryOutput>;\n","import { WorkspaceUntypedData } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOWorkspaceUntypedData = WorkspaceUntypedData;\n\nexport const DTOWorkspaceUntypedDataListResponse = z.object({\n data: DTOWorkspaceUntypedData.array(),\n});\n\nexport const DTOWorkspaceUntypedDataResponse = z.object({\n data: DTOWorkspaceUntypedData,\n});\n\nexport type DTOWorkspaceUntypedData = z.infer<typeof DTOWorkspaceUntypedData>;\nexport type DTOWorkspaceUntypedDataListResponse = z.infer<typeof DTOWorkspaceUntypedDataListResponse>;\nexport type DTOWorkspaceUntypedDataResponse = z.infer<typeof DTOWorkspaceUntypedDataResponse>;\n\n//\n// Write\n//\n\nexport const DTOWorkspaceUntypedDataCreatePayload = z.object({\n value: z.unknown(),\n});\n\nexport const DTOWorkspaceUntypedDataUpdatePayload = z.object({\n value: z.unknown(),\n});\n\nexport type DTOWorkspaceUntypedDataCreatePayload = z.infer<typeof DTOWorkspaceUntypedDataCreatePayload>;\nexport type DTOWorkspaceUntypedDataUpdatePayload = z.infer<typeof DTOWorkspaceUntypedDataUpdatePayload>;\n","import { z } from \"zod\";\n\nexport const DTODesignSystemVersionRoom = z.object({\n id: z.string(),\n});\n\nexport const DTODesignSystemVersionRoomResponse = z.object({\n room: DTODesignSystemVersionRoom,\n});\n\nexport type DTODesignSystemVersionRoom = z.infer<typeof DTODesignSystemVersionRoom>;\nexport type DTODesignSystemVersionRoomResponse = z.infer<typeof DTODesignSystemVersionRoomResponse>;\n","import { ObjectMeta, VersionCreationJob } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOCreateVersionInput } from \"../../payloads\";\n\nexport const DTODesignSystemVersion = z.object({\n id: z.string(),\n createdAt: z.coerce.date(),\n meta: ObjectMeta,\n version: z.string(),\n isReadonly: z.boolean(),\n changeLog: z.string(),\n designSystemId: z.string(),\n});\n\nexport const DTODesignSystemVersionsListResponse = z.object({\n designSystemVersions: z.array(DTODesignSystemVersion),\n});\n\nexport const DTODesignSystemVersionGetResponse = z.object({\n designSystemVersion: DTODesignSystemVersion,\n});\n\nexport const DTODesignSystemVersionCreationResponse = z.object({\n meta: ObjectMeta,\n version: z.string(),\n changeLog: z.string(),\n isReadOnly: z.boolean(),\n designSystemId: z.string(),\n jobId: z.string(),\n});\n\nexport const VersionSQSPayload = z.object({\n jobId: z.string(),\n designSystemId: z.string(),\n input: DTOCreateVersionInput,\n});\n\nexport type VersionSQSPayload = z.infer<typeof VersionSQSPayload>;\n\nexport type DTODesignSystemVersionCreationResponse = z.infer<typeof DTODesignSystemVersionCreationResponse>;\nexport type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;\nexport type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;\nexport type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;\n\nexport const DTODesignSystemVersionJobsResponse = z.object({\n jobs: z.array(VersionCreationJob),\n});\n\nexport type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;\n\n// Creation job status response\nexport const DTODesignSystemVersionJobStatusResponse = z.object({\n job: VersionCreationJob,\n});\n\nexport type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;\n","import { DesignSystem, DesignSystemAccessMode, ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODesignSystemUpdateInput = DesignSystem.partial()\n .omit({\n id: true,\n workspaceId: true,\n createdAt: true,\n updatedAt: true,\n docSlug: true,\n docViewUrl: true,\n accessMode: true,\n })\n .extend({\n meta: ObjectMeta.partial().optional(),\n });\n\nexport const DTODesignSystemUpdateAccessModeInput = z.object({\n accessMode: DesignSystemAccessMode,\n retain: z\n .object({\n userIds: z.string().array(),\n inviteIds: z.string().array(),\n })\n .optional(),\n});\n\nexport type DTODesignSystemUpdateInput = z.infer<typeof DTODesignSystemUpdateInput>;\nexport type DTODesignSystemUpdateAccessModeInput = z.infer<typeof DTODesignSystemUpdateAccessModeInput>;\n","import { z } from \"zod\";\n\nexport const ObjectMeta = z.object({\n name: z.string().max(150).optional(),\n description: z.string().max(2000).optional(),\n});\n\nexport function validateDesignSystemVersion(version: string) {\n const urlCompliantRegex = /^[a-zA-Z0-9+.-]+$/;\n return urlCompliantRegex.test(version);\n}\n\nexport const DTOCreateVersionInput = z.object({\n meta: ObjectMeta,\n version: z.string().refine(validateDesignSystemVersion, {\n message: \"Invalid semantic versioning format\",\n }),\n changeLog: z.string().optional(),\n});\n\nexport type DTOCreateVersionInput = z.infer<typeof DTOCreateVersionInput>;\n\nexport const DTOUpdateVersionInput = z.object({\n meta: ObjectMeta,\n version: z.string(), // required for PUT, but not editable\n changeLog: z.string(),\n});\n\nexport type DTOUpdateVersionInput = z.infer<typeof DTOUpdateVersionInput>;\n","import { z } from \"zod\";\n\n//\n// TO DELETE!\n//\n\n/**\n * @deprecated\n */\nexport const DTODocumentationAnalyticsTimeFrameComparison = z.object({\n referencePeriod: z.object({\n start: z.coerce.date(),\n end: z.coerce.date().optional(),\n }),\n baselinePeriod: z.object({\n start: z.coerce.date(),\n end: z.coerce.date().optional(),\n }),\n});\n\n/**\n * @deprecated\n */\nexport const DTODocumentationAnalyticsDiffPayload = z.object({\n timeFrames: z.array(DTODocumentationAnalyticsTimeFrameComparison),\n});\n\n/**\n * @deprecated\n */\nexport type DTODocumentationAnalyticsTimeFrameComparison = z.infer<typeof DTODocumentationAnalyticsTimeFrameComparison>;\n\n/**\n * @deprecated\n */\nexport type DTODocumentationAnalyticsDiffPayload = z.infer<typeof DTODocumentationAnalyticsDiffPayload>;\n","import { z } from \"zod\";\nimport { DTOPageBlockDefinition } from \"../../dto/documentation/block-definition\";\n\n//\n// Read\n//\n\nexport const DTOGetBlockDefinitionsQuery = z.object({\n files: z.coerce.boolean().optional(),\n});\n\nexport const DTOGetBlockDefinitionsOutput = z.object({\n definitions: z.array(DTOPageBlockDefinition),\n});\n\nexport type DTOGetBlockDefinitionsOutput = z.infer<typeof DTOGetBlockDefinitionsOutput>;\nexport type DTOGetBlockDefinitionsQuery = z.infer<typeof DTOGetBlockDefinitionsQuery>;\n","import {\n PageBlockColorV2,\n PageBlockDefinition,\n PageBlockDefinitionBehavior,\n PageBlockDefinitionItem,\n PageBlockDefinitionLayout,\n PageBlockDefinitionProperty,\n PageBlockDefinitionVariant,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOPageBlockDefinitionBehavior = PageBlockDefinitionBehavior;\nexport const DTOPageBlockDefinitionItem = PageBlockDefinitionItem;\nexport const DTOPageBlockDefinitionLayout = PageBlockDefinitionLayout;\nexport const DTOPageBlockDefinitionVariant = PageBlockDefinitionVariant;\nexport const DTOPageBlockDefinitionProperty = PageBlockDefinitionProperty;\nexport const DTOPageBlockColorV2 = PageBlockColorV2;\n\nexport const DTOPageBlockDefinition = PageBlockDefinition;\n\nexport type DTOPageBlockDefinitionBehavior = z.infer<typeof DTOPageBlockDefinitionBehavior>;\nexport type DTOPageBlockDefinitionItem = z.infer<typeof DTOPageBlockDefinitionItem>;\nexport type DTOPageBlockDefinitionLayout = z.infer<typeof DTOPageBlockDefinitionLayout>;\nexport type DTOPageBlockDefinitionVariant = z.infer<typeof DTOPageBlockDefinitionVariant>;\nexport type DTOPageBlockDefinitionProperty = z.infer<typeof DTOPageBlockDefinitionProperty>;\nexport type DTOPageBlockColorV2 = z.infer<typeof DTOPageBlockColorV2>;\n\nexport type DTOPageBlockDefinition = z.infer<typeof DTOPageBlockDefinition>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationPublishTypeQueryParams = z.object({\n environment: z.enum([\"Live\", \"Preview\"]),\n});\n\nexport type DTODocumentationPublishTypeQueryParams = z.infer<typeof DTODocumentationPublishTypeQueryParams>;\n","import {\n ExporterDestinationAzure,\n ExporterDestinationBitbucket,\n ExporterDestinationDocs,\n ExporterDestinationGithub,\n ExporterDestinationGitlab,\n ExporterDestinationS3,\n GitObjectsQuery,\n PipelineDestinationType,\n PipelineEventType,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyValueMap } from \"../../dto/export/exporter-property\";\n\nexport const GitDestinationOptions = z.object({\n branch: z.string().min(1).nullish(),\n commitMessage: z.string().min(1).nullish(),\n commitAuthorName: z.string().min(1).nullish(),\n commitAuthorEmail: z.string().email().nullish(),\n pullRequestTitle: z.string().min(1).nullish(),\n pullRequestDescription: z.string().min(1).nullish(),\n relativePath: z.string().nullish(),\n purgeDirectory: z.boolean().nullish(),\n});\n\nexport const DTOPipelineCreateBody = z.object({\n name: z.string(),\n exporterId: z.string(),\n designSystemId: z.string(),\n isEnabled: z.boolean(),\n eventType: PipelineEventType,\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n\n destination: PipelineDestinationType.optional(),\n gitQuery: GitObjectsQuery,\n destinations: z.object({\n s3: ExporterDestinationS3.nullish(),\n azure: ExporterDestinationAzure.nullish(),\n bitbucket: ExporterDestinationBitbucket.nullish(),\n github: ExporterDestinationGithub.nullish(),\n gitlab: ExporterDestinationGitlab.nullish(),\n documentation: ExporterDestinationDocs.nullish(),\n webhookUrl: z.string().nullish(),\n }),\n});\n\nexport const DTOPipelineUpdateBody = z.object({\n exporterId: z.string().optional(),\n name: z.string().optional(),\n isEnabled: z.boolean().optional(),\n eventType: PipelineEventType.optional(),\n\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n\n destination: PipelineDestinationType.optional(),\n gitQuery: GitObjectsQuery.optional(),\n\n destinations: z\n .object({\n s3: ExporterDestinationS3.nullish(),\n azure: ExporterDestinationAzure.nullish(),\n bitbucket: ExporterDestinationBitbucket.nullish(),\n github: ExporterDestinationGithub.nullish(),\n gitlab: ExporterDestinationGitlab.nullish(),\n documentation: ExporterDestinationDocs.nullish(),\n webhookUrl: z.string().nullish(),\n })\n .optional(),\n gitDestinationOptions: GitDestinationOptions.partial().optional(),\n});\n\nexport const DTOPipelineTriggerBody = z.object({\n designSystemVersionId: z.string(),\n});\n\nexport type GitDestinationOptions = z.infer<typeof GitDestinationOptions>;\nexport type DTOPipelineCreateBody = z.infer<typeof DTOPipelineCreateBody>;\nexport type DTOPipelineUpdateBody = z.infer<typeof DTOPipelineUpdateBody>;\nexport type DTOPipelineTriggerBody = z.infer<typeof DTOPipelineTriggerBody>;\n","import { z } from \"zod\";\n\n//\n// Primitives\n//\n\nconst PrimitiveValue = z.number().or(z.boolean()).or(z.string());\nconst ArrayValue = z.array(z.string());\nconst ObjectValue = z.record(z.string());\n\nexport const DTOExporterPropertyValue = PrimitiveValue.or(ArrayValue).or(ObjectValue);\nexport const DTOExporterPropertyType = z.enum([\"Enum\", \"Boolean\", \"String\", \"Number\", \"Array\", \"Object\", \"Code\"]);\n\nexport type DTOExporterPropertyDefinitionValue = z.infer<typeof DTOExporterPropertyValue>;\nexport type DTOExporterPropertyType = z.infer<typeof DTOExporterPropertyType>;\n\n//\n// Property\n//\n\nconst PropertyDefinitionBase = z.object({\n key: z.string(),\n title: z.string(),\n description: z.string(),\n category: z.string().optional(),\n dependsOn: z.record(z.boolean()).optional(),\n});\n\nexport type DTOPropertyDefinitionBase = z.infer<typeof PropertyDefinitionBase>;\nexport const DTOExporterPropertyDefinitionEnumOption = z.object({\n label: z.string(),\n description: z.string(),\n});\n\nexport const DTOExporterPropertyDefinitionEnum = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Enum),\n options: z.record(DTOExporterPropertyDefinitionEnumOption),\n default: z.string(),\n});\n\nexport const DTOExporterPropertyDefinitionBoolean = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Boolean),\n default: z.boolean(),\n});\n\nexport const DTOExporterPropertyDefinitionString = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.String),\n default: z.string(),\n isMultiline: z.boolean().optional(),\n});\n\nexport const DTOExporterPropertyDefinitionNumber = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Number),\n default: z.number(),\n});\n\nexport const DTOExporterPropertyDefinitionArray = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Array),\n default: ArrayValue,\n});\n\nexport const DTOExporterPropertyDefinitionObject = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Object),\n default: ObjectValue,\n allowedKeys: z\n .object({\n options: z.string().array(),\n type: z.string(),\n })\n .optional(),\n allowedValues: z\n .object({\n type: z.string(),\n })\n .optional(),\n});\n\nexport const DTOExporterPropertyDefinitionCode = PropertyDefinitionBase.extend({\n type: z.literal(DTOExporterPropertyType.Enum.Code),\n language: z.string(),\n default: z.string(),\n});\n\nexport const DTOExporterPropertyDefinition = z.discriminatedUnion(\"type\", [\n DTOExporterPropertyDefinitionEnum,\n DTOExporterPropertyDefinitionBoolean,\n DTOExporterPropertyDefinitionString,\n DTOExporterPropertyDefinitionNumber,\n DTOExporterPropertyDefinitionArray,\n DTOExporterPropertyDefinitionObject,\n DTOExporterPropertyDefinitionCode,\n]);\n\nexport const DTOExporterPropertyDefinitionsResponse = z.object({\n properties: DTOExporterPropertyDefinition.array(),\n});\n\nexport type DTOExporterPropertyDefinitionEnum = z.infer<typeof DTOExporterPropertyDefinitionEnum>;\nexport type DTOExporterPropertyDefinitionBoolean = z.infer<typeof DTOExporterPropertyDefinitionBoolean>;\nexport type DTOExporterPropertyDefinitionString = z.infer<typeof DTOExporterPropertyDefinitionString>;\nexport type DTOExporterPropertyDefinitionNumber = z.infer<typeof DTOExporterPropertyDefinitionNumber>;\nexport type DTOExporterPropertyDefinitionArray = z.infer<typeof DTOExporterPropertyDefinitionArray>;\nexport type DTOExporterPropertyDefinitionObject = z.infer<typeof DTOExporterPropertyDefinitionObject>;\nexport type DTOExporterPropertyDefinitionCode = z.infer<typeof DTOExporterPropertyDefinitionCode>;\nexport type DTOExporterPropertyDefinition = z.infer<typeof DTOExporterPropertyDefinition>;\nexport type DTOExporterPropertyDefinitionEnumOption = z.infer<typeof DTOExporterPropertyDefinitionEnumOption>;\nexport type DTOExporterPropertyDefinitionsResponse = z.infer<typeof DTOExporterPropertyDefinitionsResponse>;\n\n//\n// Value\n//\n\nexport const DTOExporterPropertyValueMap = z.record(DTOExporterPropertyValue);\nexport type DTOExporterPropertyValueMap = z.infer<typeof DTOExporterPropertyValueMap>;\n","import { z } from \"zod\";\n\nexport const DTOLiveblocksAuthRequest = z.object({\n room: z.string().optional(),\n});\n\nexport type DTOLiveblocksAuthRequest = z.infer<typeof DTOLiveblocksAuthRequest>;\n","import { UserNotificationSettings } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOUpdateUserNotificationSettingsPayload = z.object({\n notificationSettings: UserNotificationSettings,\n});\n\nexport type DTOUpdateUserNotificationSettingsPayload = z.infer<typeof DTOUpdateUserNotificationSettingsPayload>;\n\n\nexport const DTOUserNotificationSettingsResponse = z.object({\n userId: z.string(),\n workspaceId: z.string(),\n notificationSettings: UserNotificationSettings,\n});\n\nexport type DTOUserNotificationSettingsResponse = z.infer<typeof DTOUserNotificationSettingsResponse>;\n","import { UserProfileUpdate } from \"@supernova-studio/model\";\n\n\nexport const DTOUserProfileUpdatePayload = UserProfileUpdate;\n","import { z } from \"zod\";\n\nexport const DTOTransferOwnershipPayload = z.object({\n newOwnerId: z.string(),\n});\n\nexport type DTOTransferOwnershipPayload = z.infer<typeof DTOTransferOwnershipPayload>;\n","import { z } from \"zod\";\nimport { SsoProvider, WorkspaceIpSettings, WorkspaceProfile } from \"@supernova-studio/model\";\n\nconst prohibitedSsoKeys = [\"providerId\", \"metadataXml\", \"emailDomains\"];\n\nexport function validateSsoPayload(ssoPayload: Partial<SsoProvider> | undefined) {\n const keys = [];\n let valid = true;\n if (!ssoPayload) {\n valid = true;\n return {\n valid,\n keys: [],\n };\n }\n for (const key of Object.keys(ssoPayload)) {\n if (prohibitedSsoKeys.includes(key)) {\n keys.push(key);\n valid = false;\n }\n }\n return {\n valid,\n keys,\n };\n}\n\nexport const NpmRegistryInput = z.object({\n enabledScopes: z.array(z.string()),\n customRegistryUrl: z.string().optional(),\n bypassProxy: z.boolean().optional(),\n npmProxyRegistryConfigId: z.string().optional(),\n npmProxyVersion: z.number().optional(),\n registryType: z.string(),\n authType: z.string(),\n authHeaderName: z.string(),\n authHeaderValue: z.string(),\n accessToken: z.string(),\n username: z.string(),\n password: z.string(),\n});\n\nexport const WorkspaceConfigurationPayload = z.object({\n ipWhitelist: WorkspaceIpSettings.partial().optional(),\n sso: SsoProvider.partial().optional(),\n npmRegistrySettings: NpmRegistryInput.partial().optional(),\n profile: WorkspaceProfile.partial().optional(),\n});\n\nexport type WorkspaceConfigurationPayload = z.infer<typeof WorkspaceConfigurationPayload>;\n","import { IntegrationToken, IntegrationType } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOWorkspaceIntegrationOauthInput = z.object({\n type: IntegrationType,\n});\n\nexport type DTOWorkspaceIntegrationOauthInput = z.infer<typeof DTOWorkspaceIntegrationOauthInput>;\n\nexport const DTOWorkspaceIntegrationPATInput = z.object({\n type: IntegrationType,\n token: IntegrationToken,\n});\n\nexport type DTOWorkspaceIntegrationPATInput = z.infer<typeof DTOWorkspaceIntegrationPATInput>;\n\nexport const DTOWorkspaceIntegrationGetGitObjectsInput = z.object({\n organization: z.string().optional(), // Azure Organization | Bitbucket Workspace slug | Gitlab Group and Sub-Groups | Github Account (User or Organization)\n project: z.string().optional(), // Only for Bitbucket and Azure\n repository: z.string().optional(), // For all providers. Pay attention for Gitlab, they call repositories \"projects\".\n branch: z.string().optional(), // For all providers, useful for PR creations.\n user: z.string().optional(), // Only for Gitlab User Repositories\n});\n\nexport type DTOWorkspaceIntegrationGetGitObjectsInput = z.infer<typeof DTOWorkspaceIntegrationGetGitObjectsInput>;\n","import { z } from \"zod\";\nimport { ElementPropertyTargetType, ElementViewBaseColumnType, ObjectMeta } from \"@supernova-studio/model\";\n\nexport const DTOElementViewColumnSharedAttributes = z.object({\n id: z.string(),\n persistentId: z.string(),\n width: z.number(),\n});\n\nexport const DTOElementViewBasePropertyColumn = DTOElementViewColumnSharedAttributes.extend({\n type: z.literal(\"BaseProperty\"),\n basePropertyType: ElementViewBaseColumnType,\n});\n\nexport const DTOElementViewPropertyDefinitionColumn = DTOElementViewColumnSharedAttributes.extend({\n type: z.literal(\"PropertyDefinition\"),\n propertyDefinitionId: z.string(),\n});\n\nexport const DTOElementViewThemeColumn = DTOElementViewColumnSharedAttributes.extend({\n type: z.literal(\"Theme\"),\n themeId: z.string(),\n});\n\nexport const DTOElementViewColumn = z.discriminatedUnion(\"type\", [\n DTOElementViewBasePropertyColumn,\n DTOElementViewPropertyDefinitionColumn,\n DTOElementViewThemeColumn,\n]);\n\nexport const DTOElementView = z.object({\n meta: ObjectMeta,\n persistentId: z.string(),\n targetElementType: ElementPropertyTargetType,\n id: z.string(),\n isDefault: z.boolean(),\n columns: z.array(DTOElementViewColumn),\n});\n\nexport const DTOElementViewsListResponse = z.object({\n elementDataViews: z.array(DTOElementView),\n});\n\nexport type DTOElementView = z.infer<typeof DTOElementView>;\nexport type DTOElementViewsListResponse = z.infer<typeof DTOElementViewsListResponse>;\n","import { CollectionOrigin, ColorTokenInlineData, ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOTokenCollection = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n\n meta: ObjectMeta,\n backgroundColor: ColorTokenInlineData.optional(),\n elementPropertyOptionId: z.string(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n origin: CollectionOrigin.optional(),\n});\n\nexport const DTOTokenCollectionsListReponse = z.object({\n collections: DTOTokenCollection.array(),\n});\n\nexport type DTOTokenCollection = z.infer<typeof DTOTokenCollection>;\nexport type DTOTokenCollectionsListReponse = z.infer<typeof DTOTokenCollectionsListReponse>;\n","import { DesignTokenOrigin, DesignTokenType, DesignTokenTypedData, ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODesignToken = DesignTokenTypedData.and(\n z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n meta: ObjectMeta,\n originStyle: DesignTokenOrigin.optional(),\n brandId: z.string(),\n collectionId: z.string().optional(),\n updatedAt: z.coerce.date(),\n })\n);\n\nexport const DTODesignTokenListResponse = z.object({\n tokens: DTODesignToken.array(),\n});\n\nexport const DTODesignTokenResponse = z.object({\n token: DTODesignToken,\n});\n\nexport const DTODesignTokenGroup = z.object({\n id: z.string(),\n tokenType: DesignTokenType,\n persistentId: z.string(),\n isRoot: z.boolean(),\n brandId: z.string(),\n meta: ObjectMeta,\n childrenIds: z.string().array(),\n});\n\nexport const DTODesignTokenGroupListResponse = z.object({\n groups: DTODesignTokenGroup.array(),\n});\n\nexport const DTODesignTokenGroupResponse = z.object({\n group: DTODesignTokenGroup,\n});\n\nexport type DTODesignToken = z.infer<typeof DTODesignToken>;\nexport type DTODesignTokenResponse = z.infer<typeof DTODesignTokenResponse>;\nexport type DTODesignTokenListResponse = z.infer<typeof DTODesignTokenListResponse>;\n\nexport type DTODesignTokenGroup = z.infer<typeof DTODesignTokenGroup>;\nexport type DTODesignTokenGroupListResponse = z.infer<typeof DTODesignTokenGroupListResponse>;\nexport type DTODesignTokenGroupResponse = z.infer<typeof DTODesignTokenGroupResponse>;\n\n//\n// Write\n//\n\nexport const DTODesignTokenCreatePayload = DesignTokenTypedData.and(\n z.object({\n persistentId: z.string(),\n meta: ObjectMeta,\n brandId: z.string(),\n groupPersistentId: z.string().optional(),\n })\n);\n\nexport const DTODesignTokenGroupCreatePayload = z.object({\n persistentId: z.string(),\n meta: ObjectMeta,\n brandId: z.string(),\n parentId: z.string().optional(),\n tokenType: DesignTokenType,\n childrenIds: z.string().array(),\n});\n\nexport type DTODesignTokenCreatePayload = z.infer<typeof DTODesignTokenCreatePayload>;\nexport type DTODesignTokenGroupCreatePayload = z.infer<typeof DTODesignTokenGroupCreatePayload>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationAnalyticsTimeFrame = z.object({\n start: z.coerce.date(),\n end: z.coerce.date().optional(),\n});\n\nexport type DTODocumentationAnalyticsTimeFrame = z.infer<typeof DTODocumentationAnalyticsTimeFrame>;\n\n//\n// Read\n//\n\nexport const DTOPublishedDocVisitData = z.object({\n timestamp: z.coerce.date(),\n versionId: z.string(),\n locale: z.string().optional(),\n visits: z.number(),\n sessions: z.number(),\n});\n\nexport const DTOPublishedDocPageVisitData = DTOPublishedDocVisitData.extend({\n pagePersistentId: z.string(),\n});\n\n/**\n * Array of values per 2 hours (0, 2, 4, 6, etc)\n */\nconst DTOPublishedDocVisitHeatMapDay = z.number().array().length(12);\n\nexport const DTOPublishedDocVisitHeatMapWeek = z.object({\n /**\n * For which timeframe it was calculated\n */\n timeFrame: DTODocumentationAnalyticsTimeFrame,\n\n mon: DTOPublishedDocVisitHeatMapDay,\n tue: DTOPublishedDocVisitHeatMapDay,\n wed: DTOPublishedDocVisitHeatMapDay,\n thu: DTOPublishedDocVisitHeatMapDay,\n fri: DTOPublishedDocVisitHeatMapDay,\n sat: DTOPublishedDocVisitHeatMapDay,\n sun: DTOPublishedDocVisitHeatMapDay,\n});\n\nexport const DTOPublishedDocAnalyticsComparisonData = z.object({\n /**\n * For which timeframe it was calculated\n */\n timeFrame: DTODocumentationAnalyticsTimeFrame,\n\n priorVisitCount: z.number(),\n priorSessionCount: z.number(),\n currentVisitCount: z.number(),\n currentSessionCount: z.number(),\n});\n\nexport const DTOPublishedDocPageAnalyticsComparisonData = DTOPublishedDocAnalyticsComparisonData.extend({\n pagePersistentId: z.string(),\n});\n\nexport const DTODocumentationPageAnalyticsResponse = z.object({\n globalAnalytics: DTOPublishedDocVisitData.array(),\n pageAnalytics: DTOPublishedDocPageVisitData.array(),\n heatMapData: DTOPublishedDocVisitHeatMapWeek.array(),\n comparisonData: DTOPublishedDocAnalyticsComparisonData.array(),\n pageComparisonData: DTOPublishedDocPageAnalyticsComparisonData.array(),\n});\n\nexport const DTODocumentationAnalyticsRequest = z.object({\n timeFrames: z.array(DTODocumentationAnalyticsTimeFrame),\n});\n\nexport type DTOPublishedDocVisitHeatMapWeek = z.infer<typeof DTOPublishedDocVisitHeatMapWeek>;\nexport type DTOPublishedDocPageVisitData = z.infer<typeof DTOPublishedDocPageVisitData>;\nexport type DTOPublishedDocVisitData = z.infer<typeof DTOPublishedDocVisitData>;\nexport type DTOPublishedDocAnalyticsComparisonData = z.infer<typeof DTOPublishedDocAnalyticsComparisonData>;\nexport type DTOPublishedDocPageAnalyticsComparisonData = z.infer<typeof DTOPublishedDocPageAnalyticsComparisonData>;\nexport type DTODocumentationPageAnalyticsResponse = z.infer<typeof DTODocumentationPageAnalyticsResponse>;\nexport type DTODocumentationAnalyticsRequest = z.infer<typeof DTODocumentationAnalyticsRequest>;\n","import { z } from \"zod\";\n\n//\n// Difference\n//\n\n/**\n * @deprecated\n */\nexport const DTODocumentationPageAnalyticsDifference = z.object({\n startDate: z.coerce.date(),\n endDate: z.coerce.date().optional(),\n currentVisitCount: z.number(),\n currentSessionCount: z.number(),\n priorVisitCount: z.number(),\n priorSessionCount: z.number(),\n});\n\n/**\n * @deprecated\n */\nexport const DTODocumentationPageIntervalDifferenceResponse = z.object({\n differences: z.array(DTODocumentationPageAnalyticsDifference),\n});\n\n/**\n * @deprecated\n */\nexport type DTODocumentationPageAnalyticsDifference = z.infer<typeof DTODocumentationPageAnalyticsDifference>;\nexport type DTODocumentationPageIntervalDifferenceResponse = z.infer<\n typeof DTODocumentationPageIntervalDifferenceResponse\n>;\n","import { DocumentationPageAnchor } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageAnchor = DocumentationPageAnchor;\n\nexport const DTOGetDocumentationPageAnchorsResponse = z.object({\n anchors: z.array(DTODocumentationPageAnchor),\n});\n\nexport type DTODocumentationPageAnchor = z.infer<typeof DTODocumentationPageAnchor>;\nexport type DTOGetDocumentationPageAnchorsResponse = z.infer<typeof DTOGetDocumentationPageAnchorsResponse>;\n","import { DocumentationPageApprovalState } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODocumentationPageApprovalState = z.object({\n approvalState: DocumentationPageApprovalState,\n pagePersistentId: z.string(),\n updatedByUserId: z.string(),\n designSystemVersionId: z.string(),\n updatedAt: z.coerce.date(),\n createdAt: z.coerce.date(),\n});\n\nexport const DTODocumentationGroupApprovalState = z.object({\n persistentId: z.string(),\n groupPersistentId: z.string(),\n designSystemVersionId: z.string(),\n approvalState: DocumentationPageApprovalState,\n});\n\nexport type DTODocumentationPageApprovalState = z.infer<typeof DTODocumentationPageApprovalState>;\nexport type DTODocumentationGroupApprovalState = z.infer<typeof DTODocumentationGroupApprovalState>;\n","import { PageBlockItemV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOPageBlockItemV2 = PageBlockItemV2;\n\nexport type DTOPageBlockItemV2 = z.infer<typeof DTOPageBlockItemV2>;\n","import { DesignElementSnapshotReason } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationPageV2 } from \"../elements/documentation/page-v2\";\n\nexport const DTODocumentationPageSnapshot = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n\n createdAt: z.string(),\n updatedAt: z.string(),\n\n documentationPage: DTODocumentationPageV2,\n pageContentHash: z.string(),\n\n reason: DesignElementSnapshotReason,\n});\n\nexport type DTODocumentationPageSnapshot = z.infer<typeof DTODocumentationPageSnapshot>;\n","import { DocumentationPageApprovalState, DocumentationPageContentItem } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationPageApprovalState } from \"../../documentation\";\nimport { DTODocumentationDraftState } from \"./draft-state\";\nimport { DTODocumentationItemConfigurationV2 } from \"./item-configuration-v2\";\nimport { DTODocumentationPublishMetadata } from \"./metadata\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageV2 = z.object({\n id: z.string(),\n persistentId: z.string(),\n\n designSystemVersionId: z.string(),\n\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2,\n\n shortPersistentId: z.string(),\n\n slug: z.string().optional(),\n userSlug: z.string().optional(),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n path: z.string(),\n\n /** Defined when a page has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n\n /** Defined if a page was published at least once and contains metadata about last publish */\n publishMetadata: DTODocumentationPublishMetadata.optional(),\n\n /** Defines the approval state of the documentation page */\n approvalState: DTODocumentationPageApprovalState.optional(),\n\n /** Id of the page document room */\n liveblocksRoomId: z.string().optional(),\n\n // Backward compatibility\n type: z.literal(\"Page\"),\n});\n\nexport type DTODocumentationPageV2 = z.infer<typeof DTODocumentationPageV2>;\n\n//\n// Write\n//\n\nexport const DTOCreateDocumentationPageInputV2 = z.object({\n // Identifier\n persistentId: z.string(),\n\n // Page properties\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n\n // Page placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTOUpdateDocumentationPageInputV2 = z.object({\n // Identifier of the page to update\n id: z.string(),\n\n // Page properties\n title: z.string().optional(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n});\n\nexport const DTOUpdateDocumentationPageDocumentInputV2 = z.object({\n // Identifier of the page to update\n id: z.string(),\n\n // Page properties\n documentItems: z.array(DocumentationPageContentItem),\n});\n\nexport const DTOMoveDocumentationPageInputV2 = z.object({\n // Identifier of the group to update\n id: z.string(),\n\n // Page placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTODuplicateDocumentationPageInputV2 = z.object({\n // Identifier of the page to duplicate from\n id: z.string(),\n\n // New page persistent id\n persistentId: z.string(),\n\n // Page placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTODeleteDocumentationPageInputV2 = z.object({\n // Identifier\n id: z.string(),\n});\n\nexport const DTORestoreDocumentationPageInput = z.object({\n persistentId: z.string(),\n snapshotId: z.string().optional(),\n});\n\nexport const DTORestoreDocumentationGroupInput = z.object({\n persistentId: z.string(),\n snapshotId: z.string().optional(),\n});\n\nexport const DTODocumentationPageApprovalStateChangeInput = z.object({\n persistentId: z.string(),\n approvalState: DocumentationPageApprovalState.optional(),\n});\n\nexport type DTOCreateDocumentationPageInputV2 = z.infer<typeof DTOCreateDocumentationPageInputV2>;\nexport type DTOUpdateDocumentationPageInputV2 = z.infer<typeof DTOUpdateDocumentationPageInputV2>;\nexport type DTOUpdateDocumentationPageDocumentInputV2 = z.infer<typeof DTOUpdateDocumentationPageDocumentInputV2>;\nexport type DTOMoveDocumentationPageInputV2 = z.infer<typeof DTOMoveDocumentationPageInputV2>;\nexport type DTODuplicateDocumentationPageInputV2 = z.infer<typeof DTODuplicateDocumentationPageInputV2>;\nexport type DTODeleteDocumentationPageInputV2 = z.infer<typeof DTODeleteDocumentationPageInputV2>;\nexport type DTORestoreDocumentationPageInput = z.infer<typeof DTORestoreDocumentationPageInput>;\nexport type DTORestoreDocumentationGroupInput = z.infer<typeof DTORestoreDocumentationGroupInput>;\nexport type DTODocumentationPageApprovalStateChangeInput = z.infer<typeof DTODocumentationPageApprovalStateChangeInput>;\n","import { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV2 } from \"./item-configuration-v2\";\n\nexport const DTODocumentationDraftChangeType = z.enum([\"Created\", \"Updated\", \"Deleted\"]);\n\nexport const DTODocumentationDraftStateCreated = z.object({\n changeType: z.literal(DTODocumentationDraftChangeType.enum.Created),\n});\n\nexport const DTODocumentationDraftStateUpdated = z.object({\n changeType: z.literal(DTODocumentationDraftChangeType.enum.Updated),\n changes: z.object({\n previousTitle: z.string().optional(),\n previousConfiguration: DTODocumentationItemConfigurationV2.optional(),\n previousContentHash: z.string().optional(),\n }),\n});\n\nexport const DTODocumentationDraftStateDeleted = z.object({\n changeType: z.literal(DTODocumentationDraftChangeType.enum.Deleted),\n deletedAt: z.coerce.date(),\n deletedByUserId: z.string(),\n});\n\nexport const DTODocumentationDraftState = z.discriminatedUnion(\"changeType\", [\n DTODocumentationDraftStateCreated,\n DTODocumentationDraftStateUpdated,\n DTODocumentationDraftStateDeleted,\n]);\n\nexport type DTODocumentationDraftChangeType = z.infer<typeof DTODocumentationDraftChangeType>;\n\nexport type DTODocumentationDraftStateCreated = z.infer<typeof DTODocumentationDraftStateCreated>;\nexport type DTODocumentationDraftStateUpdated = z.infer<typeof DTODocumentationDraftStateUpdated>;\nexport type DTODocumentationDraftStateDeleted = z.infer<typeof DTODocumentationDraftStateDeleted>;\n\nexport type DTODocumentationDraftState = z.infer<typeof DTODocumentationDraftState>;\n","import { DocumentationItemHeaderV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTODocumentationItemHeaderV2 = DocumentationItemHeaderV2;\n\nexport const DTODocumentationItemConfigurationV2 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean(),\n isHidden: z.boolean(),\n header: DTODocumentationItemHeaderV2,\n});\n\nexport type DTODocumentationItemHeaderV2 = z.infer<typeof DTODocumentationItemHeaderV2>;\nexport type DTODocumentationItemConfigurationV2 = z.infer<typeof DTODocumentationItemConfigurationV2>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationPublishMetadata = z.object({\n lastPublishedByUserId: z.string(),\n lastPublishedAt: z.coerce.date(),\n});\n\nexport type DTODocumentationPublishMetadata = z.infer<typeof DTODocumentationPublishMetadata>;\n","import { DocumentationLinkPreview } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationLinkPreviewResponse = z.object({\n linkPreview: DocumentationLinkPreview,\n});\n\nexport type DTODocumentationLinkPreviewResponse = z.infer<typeof DTODocumentationLinkPreviewResponse>;\n\n//\n// Write\n//\n\nexport const DTODocumentationLinkPreviewRequest = z.object({\n url: z.string().optional(),\n documentationItemPersistentId: z.string().optional(),\n});\n\nexport type DTODocumentationLinkPreviewRequest = z.infer<typeof DTODocumentationLinkPreviewRequest>;\n","import { ExportJobDocumentationChanges, PublishedDocEnvironment } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExportJob } from \"../export\";\n\nexport const DTOPublishDocumentationChanges = ExportJobDocumentationChanges;\n\nexport const DTOPublishDocumentationRequest = z.object({\n environment: PublishedDocEnvironment,\n\n /**\n * If defined, this allows narrowing down what is published to a set of specific pages and groups\n * If undefined, everything will be published.\n */\n changes: DTOPublishDocumentationChanges.optional(),\n});\n\nexport const DTOPublishDocumentationResponse = z.object({\n job: DTOExportJob,\n});\n\nexport type DTOPublishDocumentationChanges = z.infer<typeof DTOPublishDocumentationChanges>;\nexport type DTOPublishDocumentationRequest = z.infer<typeof DTOPublishDocumentationRequest>;\nexport type DTOPublishDocumentationResponse = z.infer<typeof DTOPublishDocumentationResponse>;\n","import {\n nullishToOptional,\n PulsarContributionConfigurationProperty,\n PulsarContributionVariant,\n PulsarCustomBlock,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyDefinition } from \"./exporter-property\";\n\n//\n// Read\n//\n\nexport const DTOExporterType = z.enum([\"documentation\", \"code\"]);\nexport const DTOExporterSource = z.enum([\"git\", \"upload\"]);\nexport const DTOExporterMembershipRole = z.enum([\"Owner\", \"OwnerArchived\", \"User\"]);\n\nexport const DTOExporterListQuery = z.object({\n limit: z.coerce.number().optional(),\n offset: z.coerce.number().optional(),\n type: DTOExporterType.optional(),\n search: z.string().optional(),\n});\n\nexport const DTOExporter = z.object({\n id: z.string(),\n name: z.string(),\n isPrivate: z.boolean(),\n exporterType: DTOExporterType,\n isDefaultDocumentationExporter: z.boolean(),\n\n iconURL: z.string().optional(),\n configurationProperties: PulsarContributionConfigurationProperty.array(),\n properties: DTOExporterPropertyDefinition.array().optional(),\n customBlocks: PulsarCustomBlock.array(),\n blockVariants: z.record(z.string(), PulsarContributionVariant.array()),\n\n homepage: z.string().optional(),\n organization: z.string().optional(),\n packageId: z.string().optional(),\n tags: z.array(z.string()),\n author: z.string().optional(),\n version: z.string(),\n description: z.string(),\n\n usesLocale: z.boolean(),\n usesBrands: z.boolean(),\n usesThemes: z.boolean(),\n\n readme: z.string().optional(),\n routingVersion: z.string().optional(),\n\n source: DTOExporterSource,\n\n gitProvider: z.string().optional(),\n gitUrl: nullishToOptional(z.string()),\n gitBranch: nullishToOptional(z.string()),\n gitDirectory: nullishToOptional(z.string()),\n\n isDeprecated: z.boolean(),\n deprecationNote: z.string().optional(),\n replacementExporterId: z.string().optional(),\n});\n\nexport const DTOExporterMembership = z.object({\n workspaceId: z.string(),\n exporterId: z.string(),\n role: DTOExporterMembershipRole,\n});\n\nexport const DTOExporterResponse = z.object({\n exporter: DTOExporter,\n membership: DTOExporterMembership,\n});\n\nexport const DTOExporterListResponse = z.object({\n exporters: DTOExporter.array(),\n membership: DTOExporterMembership.array(),\n total: z.number(),\n});\n\nexport type DTOExporterListQuery = z.infer<typeof DTOExporterListQuery>;\nexport type DTOExporterType = z.infer<typeof DTOExporterType>;\nexport type DTOExporterSource = z.infer<typeof DTOExporterSource>;\nexport type DTOExporterMembershipRole = z.infer<typeof DTOExporterMembershipRole>;\nexport type DTOExporter = z.infer<typeof DTOExporter>;\nexport type DTOExporterMembership = z.infer<typeof DTOExporterMembership>;\nexport type DTOExporterResponse = z.infer<typeof DTOExporterResponse>;\nexport type DTOExporterListResponse = z.infer<typeof DTOExporterListResponse>;\n\n//\n// Write\n//\n\nexport const DTOExporterGitProviderEnum = z.enum([\"github\", \"gitlab\", \"bitbucket\", \"azure\"]);\n\nexport const DTOExporterCreateInput = z.object({\n url: z.string(),\n provider: DTOExporterGitProviderEnum,\n});\n\nexport const DTOExporterUpdateInput = z.object({\n url: z.string().optional(),\n});\n\nexport const DTOExporterDeprecationInput = z.object({\n isDeprecated: z.boolean(),\n deprecationNote: z.string().optional(),\n replacementExporterId: z.string().optional(),\n});\n\nexport type DTOExporterGitProviderEnum = z.infer<typeof DTOExporterGitProviderEnum>;\nexport type DTOExporterCreateInput = z.infer<typeof DTOExporterCreateInput>;\nexport type DTOExporterUpdateInput = z.infer<typeof DTOExporterUpdateInput>;\nexport type DTOExporterDeprecationInput = z.infer<typeof DTOExporterDeprecationInput>;\n","import { ExportJobFindByFilter } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOExportJobsListFilter = ExportJobFindByFilter;\n\nexport type DTOExportJobsListFilter = z.infer<typeof DTOExportJobsListFilter>;\n","import {\n ExportJobDocsDestinationResult,\n ExportJobResult,\n ExportJobStatus,\n ExporterDestinationAzure,\n ExporterDestinationBitbucket,\n ExporterDestinationDocs,\n ExporterDestinationGithub,\n ExporterDestinationGitlab,\n ExporterDestinationS3,\n ObjectMeta,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyValueMap } from \"./exporter-property\";\n\nexport const DTOExportJobCreatedBy = z.object({\n userId: z.string(),\n userName: z.string(),\n});\n\nexport const DTOExportJobDesignSystemPreview = z.object({\n id: z.string(),\n meta: ObjectMeta,\n});\n\nexport const DTOExportJobDesignSystemVersionPreview = z.object({\n id: z.string(),\n meta: ObjectMeta,\n version: z.string(),\n isReadonly: z.boolean(),\n});\n\nexport const DTOExportJobDestinations = z.object({\n s3: ExporterDestinationS3.optional(),\n azure: ExporterDestinationAzure.optional(),\n bitbucket: ExporterDestinationBitbucket.optional(),\n github: ExporterDestinationGithub.optional(),\n gitlab: ExporterDestinationGitlab.optional(),\n documentation: ExporterDestinationDocs.optional(),\n webhookUrl: z.string().optional(),\n});\n\nexport const DTOExportJobResult = ExportJobResult.omit({\n sndocs: true,\n}).extend({\n documentation: ExportJobDocsDestinationResult.optional(),\n});\n\nexport const DTOExportJob = z.object({\n id: z.string(),\n\n createdAt: z.coerce.date(),\n finishedAt: z.coerce.date().optional(),\n\n index: z.number().optional(),\n status: ExportJobStatus,\n estimatedExecutionTime: z.number().optional(),\n\n createdBy: DTOExportJobCreatedBy.optional(),\n designSystem: DTOExportJobDesignSystemPreview,\n designSystemVersion: DTOExportJobDesignSystemVersionPreview,\n\n destinations: DTOExportJobDestinations,\n\n exporterId: z.string(),\n scheduleId: z.string().optional(),\n\n result: DTOExportJobResult.optional(),\n\n brandPersistentId: z.string().optional(),\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n});\n\nexport const DTOExportJobResponse = z.object({\n job: DTOExportJob,\n});\n\n// Deprecated: Use only for test purposes and extend if only necessary. This defines the BE response for an export job.\nexport const DTOExportJobResponseLegacy = z.object({\n job: z.object({\n id: z.string(),\n status: ExportJobStatus,\n }),\n});\n\nexport type DTOExportJobResponseLegacy = z.infer<typeof DTOExportJobResponseLegacy>;\nexport type DTOExportJobCreatedBy = z.infer<typeof DTOExportJobCreatedBy>;\nexport type DTOExportJobDesignSystemPreview = z.infer<typeof DTOExportJobDesignSystemPreview>;\nexport type DTOExportJobDesignSystemVersionPreview = z.infer<typeof DTOExportJobDesignSystemVersionPreview>;\nexport type DTOExportJobDestinations = z.infer<typeof DTOExportJobDestinations>;\nexport type DTOExportJobResult = z.infer<typeof DTOExportJobResult>;\nexport type DTOExportJob = z.infer<typeof DTOExportJob>;\nexport type DTOExportJobResponse = z.infer<typeof DTOExportJobResponse>;\n\n//\n// Write\n//\n\nexport const DTOExportJobCreateInput = z.object({\n designSystemId: z.string(),\n designSystemVersionId: z.string(),\n exporterId: z.string(),\n brandId: z.string().optional(),\n themeId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n destinations: DTOExportJobDestinations,\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n previewMode: z.boolean().optional(),\n});\n\nexport type DTOExportJobCreateInput = z.infer<typeof DTOExportJobCreateInput>;\n","import { ExportDestinationsMap, PipelineEventType } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOExporterPropertyValueMap } from \"./exporter-property\";\nimport { DTOExportJob } from \"./job\";\n\nexport const DTOPipelineListQuery = z.object({\n designSystemId: z.string().optional(),\n exporterId: z.string().optional(),\n latestJobsLimit: z.coerce.number().optional(),\n});\n\nexport const DTOPipeline = z.object({\n id: z.string(),\n name: z.string(),\n eventType: PipelineEventType,\n isEnabled: z.boolean(),\n workspaceId: z.string(),\n designSystemId: z.string(),\n exporterId: z.string(),\n brandPersistentId: z.string().optional(),\n\n themePersistentId: z.string().optional(),\n themePersistentIds: z.string().array().optional(),\n\n exporterPropertyValues: DTOExporterPropertyValueMap.optional(),\n\n ...ExportDestinationsMap.shape,\n\n latestJobs: DTOExportJob.array(),\n\n isExporterDeprecated: z.boolean(),\n});\n\nexport const DTOPipelineListResponse = z.object({\n pipelines: DTOPipeline.array(),\n});\n\nexport const DTOPipelineResponse = z.object({\n pipeline: DTOPipeline,\n});\n\nexport type DTOPipelineListQuery = z.infer<typeof DTOPipelineListQuery>;\nexport type DTOPipeline = z.infer<typeof DTOPipeline>;\nexport type DTOPipelineResponse = z.infer<typeof DTOPipelineResponse>;\nexport type DTOPipelineListResponse = z.infer<typeof DTOPipelineListResponse>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationPageRoom = z.object({\n id: z.string(),\n});\n\nexport const DTODocumentationPageRoomResponse = z.object({\n room: DTODocumentationPageRoom,\n});\n\nexport type DTODocumentationPageRoom = z.infer<typeof DTODocumentationPageRoom>;\nexport type DTODocumentationPageRoomResponse = z.infer<typeof DTODocumentationPageRoomResponse>;\n","import z from \"zod\";\nimport { DTOObjectMeta } from \"../../aux/meta\";\n\nexport const DTOFigmaComponentGroup = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n persistentId: z.string(),\n isRoot: z.boolean(),\n brandId: z.string(),\n meta: DTOObjectMeta,\n childrenIds: z.string().array(),\n});\n\nexport const DTOFigmaComponentGroupListResponse = z.object({\n groups: DTOFigmaComponentGroup.array(),\n});\n\nexport type DTOFigmaComponentGroup = z.infer<typeof DTOFigmaComponentGroup>;\nexport type DTOFigmaComponentGroupListResponse = z.infer<typeof DTOFigmaComponentGroupListResponse>;\n","import {\n FigmaComponentBooleanProperty,\n FigmaComponentInstanceSwapProperty,\n FigmaComponentOrigin,\n FigmaComponentProperty,\n FigmaComponentTextProperty,\n FigmaComponentVariantProperty,\n ObjectMeta,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nconst DTOFigmaComponentBooleanProperty = FigmaComponentBooleanProperty;\nconst DTOFigmaComponentInstanceSwapProperty = FigmaComponentInstanceSwapProperty;\nconst DTOFigmaComponentTextProperty = FigmaComponentTextProperty;\nconst DTOFigmaComponentVariantProperty = FigmaComponentVariantProperty;\nconst DTOFigmaComponentProperty = FigmaComponentProperty;\nconst DTOFigmaComponentPropertyMap = z.record(DTOFigmaComponentProperty);\n\nexport const DTOFigmaComponent = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n brandId: z.string(),\n thumbnailUrl: z.string().optional(),\n svgUrl: z.string().optional(),\n\n exportProperties: z.object({\n isAsset: z.boolean(),\n }),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n\n meta: ObjectMeta,\n originComponent: FigmaComponentOrigin.optional(),\n\n parentComponentPersistentId: z.string().optional(),\n childrenPersistentIds: z.string().array().optional(),\n\n componentPropertyDefinitions: DTOFigmaComponentPropertyMap.optional(),\n variantPropertyValues: z.record(z.string()).optional(),\n});\n\nexport const DTOFigmaComponentListResponse = z.object({\n components: DTOFigmaComponent.array(),\n});\n\nexport type DTOFigmaComponentBooleanProperty = z.infer<typeof DTOFigmaComponentBooleanProperty>;\nexport type DTOFigmaComponentInstanceSwapProperty = z.infer<typeof DTOFigmaComponentInstanceSwapProperty>;\nexport type DTOFigmaComponentTextProperty = z.infer<typeof DTOFigmaComponentTextProperty>;\nexport type DTOFigmaComponentVariantProperty = z.infer<typeof DTOFigmaComponentVariantProperty>;\nexport type DTOFigmaComponentProperty = z.infer<typeof DTOFigmaComponentProperty>;\nexport type DTOFigmaComponentPropertyMap = z.infer<typeof DTOFigmaComponentPropertyMap>;\n\nexport type DTOFigmaComponent = z.infer<typeof DTOFigmaComponent>;\nexport type DTOFigmaComponentListResponse = z.infer<typeof DTOFigmaComponentListResponse>;\n","import { z } from \"zod\";\nimport {\n DTOCreateDocumentationGroupInput,\n DTOCreateDocumentationTabInput,\n DTODeleteDocumentationGroupInput,\n DTODeleteDocumentationTabGroupInput,\n DTODuplicateDocumentationGroupInput,\n DTOMoveDocumentationGroupInput,\n DTOUpdateDocumentationGroupInput,\n} from \"./group-v2\";\n\n//\n// Read\n//\n\nconst SuccessPayload = z.object({\n success: z.literal(true),\n});\n\nexport const DTODocumentationGroupCreateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupCreate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationTabCreateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationTabCreate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupUpdateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupUpdate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupMoveActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupMove\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupDuplicateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupDuplicate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupDeleteActionOutputV2 = z.object({\n type: z.literal(\"DocumentationGroupDelete\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationTabGroupDeleteActionOutputV2 = z.object({\n type: z.literal(\"DocumentationTabGroupDelete\"),\n output: SuccessPayload,\n});\n\nexport type DTODocumentationGroupCreateActionOutputV2 = z.infer<typeof DTODocumentationGroupCreateActionOutputV2>;\nexport type DTODocumentationTabCreateActionOutputV2 = z.infer<typeof DTODocumentationTabCreateActionOutputV2>;\nexport type DTODocumentationGroupUpdateActionOutputV2 = z.infer<typeof DTODocumentationGroupUpdateActionOutputV2>;\nexport type DTODocumentationGroupMoveActionOutputV2 = z.infer<typeof DTODocumentationGroupMoveActionOutputV2>;\nexport type DTODocumentationGroupDuplicateActionOutputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionOutputV2>;\nexport type DTODocumentationGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationGroupDeleteActionOutputV2>;\nexport type DTODocumentationTabGroupDeleteActionOutputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionOutputV2>;\n\n//\n// Write\n//\n\nexport const DTODocumentationGroupCreateActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupCreate\"),\n input: DTOCreateDocumentationGroupInput,\n});\n\nexport const DTODocumentationTabCreateActionInputV2 = z.object({\n type: z.literal(\"DocumentationTabCreate\"),\n input: DTOCreateDocumentationTabInput,\n});\n\nexport const DTODocumentationGroupUpdateActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupUpdate\"),\n input: DTOUpdateDocumentationGroupInput,\n});\n\nexport const DTODocumentationGroupMoveActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupMove\"),\n input: DTOMoveDocumentationGroupInput,\n});\n\nexport const DTODocumentationGroupDuplicateActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupDuplicate\"),\n input: DTODuplicateDocumentationGroupInput,\n});\n\nexport const DTODocumentationGroupDeleteActionInputV2 = z.object({\n type: z.literal(\"DocumentationGroupDelete\"),\n input: DTODeleteDocumentationGroupInput,\n});\n\nexport const DTODocumentationTabGroupDeleteActionInputV2 = z.object({\n type: z.literal(\"DocumentationTabGroupDelete\"),\n input: DTODeleteDocumentationTabGroupInput,\n});\n\nexport type DTODocumentationGroupCreateActionInputV2 = z.infer<typeof DTODocumentationGroupCreateActionInputV2>;\nexport type DTODocumentationTabGroupCreateActionInputV2 = z.infer<typeof DTODocumentationTabCreateActionInputV2>;\nexport type DTODocumentationGroupUpdateActionInputV2 = z.infer<typeof DTODocumentationGroupUpdateActionInputV2>;\nexport type DTODocumentationGroupMoveActionInputV2 = z.infer<typeof DTODocumentationGroupMoveActionInputV2>;\nexport type DTODocumentationGroupDuplicateActionInputV2 = z.infer<typeof DTODocumentationGroupDuplicateActionInputV2>;\nexport type DTODocumentationGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationGroupDeleteActionInputV2>;\nexport type DTODocumentationTabGroupDeleteActionInputV2 = z.infer<typeof DTODocumentationTabGroupDeleteActionInputV2>;\n","import { DocumentationGroupBehavior, ElementGroup } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationDraftState } from \"./draft-state\";\nimport { DTODocumentationItemConfigurationV2 } from \"./item-configuration-v2\";\nimport { DTODocumentationPublishMetadata } from \"./metadata\";\nimport { DTODocumentationGroupApprovalState } from \"../../documentation\";\n\n//\n// Read\n//\n\nexport const DTODocumentationGroupV2 = ElementGroup.omit({\n sortOrder: true,\n parentPersistentId: true,\n brandPersistentId: true,\n meta: true,\n childType: true,\n data: true,\n shortPersistentId: true,\n}).extend({\n title: z.string(),\n isRoot: z.boolean(),\n childrenIds: z.array(z.string()),\n groupBehavior: DocumentationGroupBehavior,\n shortPersistentId: z.string(),\n configuration: DTODocumentationItemConfigurationV2,\n type: z.literal(\"Group\"),\n\n /** Defined when a group has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n\n /** Defined if a group was published at least once and contains metadata about last publish */\n publishMetadata: DTODocumentationPublishMetadata.optional(),\n\n //** An approval state for frontend to utilize. */\n approvalState: DTODocumentationGroupApprovalState.optional(),\n});\n\nexport type DTODocumentationGroupV2 = z.infer<typeof DTODocumentationGroupV2>;\n\n//\n// Write\n//\n\nexport const DTOCreateDocumentationGroupInput = z.object({\n // Identifier\n persistentId: z.string(),\n\n // Group properties\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n\n // Group placement properties\n afterPersistentId: z.string().nullish(),\n parentPersistentId: z.string(),\n});\n\nexport const DTOUpdateDocumentationGroupInput = z.object({\n // Identifier of the group to update\n id: z.string(),\n\n // Group properties\n title: z.string().optional(),\n configuration: DTODocumentationItemConfigurationV2.partial().optional(),\n});\n\nexport const DTOMoveDocumentationGroupInput = z.object({\n // Identifier of the group to update\n id: z.string(),\n\n // Group placement properties\n parentPersistentId: z.string(),\n afterPersistentId: z.string().nullish(),\n});\n\nexport const DTODuplicateDocumentationGroupInput = z.object({\n // Identifier of the group to duplicate from\n id: z.string(),\n\n // New group persistent id\n persistentId: z.string(),\n\n // Group placement properties\n afterPersistentId: z.string().nullish(),\n parentPersistentId: z.string(),\n});\n\nexport const DTOCreateDocumentationTabInput = z.object({\n // New group persistent id\n persistentId: z.string(),\n\n // If this is page, we will attempt to convert it to tab\n // If this is tab group, we will add a new tab to it\n fromItemPersistentId: z.string(),\n tabName: z.string(),\n});\n\nexport const DTODeleteDocumentationTabGroupInput = z.object({\n // Deleted group id\n id: z.string(),\n});\n\nexport const DTODeleteDocumentationGroupInput = z.object({\n // Identifier\n id: z.string(),\n\n // Deletion options\n deleteSubtree: z.boolean().default(false),\n});\n\nexport type DTOCreateDocumentationGroupInput = z.infer<typeof DTOCreateDocumentationGroupInput>;\nexport type DTOUpdateDocumentationGroupInput = z.infer<typeof DTOUpdateDocumentationGroupInput>;\nexport type DTOMoveDocumentationGroupInput = z.infer<typeof DTOMoveDocumentationGroupInput>;\nexport type DTODuplicateDocumentationGroupInput = z.infer<typeof DTODuplicateDocumentationGroupInput>;\nexport type DTOCreateDocumentationTabInput = z.infer<typeof DTOCreateDocumentationTabInput>;\nexport type DTODeleteDocumentationTabGroupInput = z.infer<typeof DTODeleteDocumentationTabGroupInput>;\nexport type DTODeleteDocumentationGroupInput = z.infer<typeof DTODeleteDocumentationGroupInput>;\n","import { DocumentationGroupBehavior, ElementGroup } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV1 } from \"./item-configuration-v1\";\n\n//\n// Read\n//\n\n/**\n * Structure DTO is element properties minus element data (in other words data required\n * to display the element in the left panel)\n */\nexport const DTODocumentationGroupStructureV1 = ElementGroup.omit({\n sortOrder: true,\n parentPersistentId: true,\n brandPersistentId: true,\n meta: true,\n childType: true,\n data: true,\n shortPersistentId: true,\n}).extend({\n title: z.string(),\n isRoot: z.boolean(),\n childrenIds: z.array(z.string()),\n groupBehavior: DocumentationGroupBehavior,\n shortPersistentId: z.string(),\n type: z.literal(\"Group\"),\n});\n\nexport const DTODocumentationGroupV1 = DTODocumentationGroupStructureV1.extend({\n configuration: DTODocumentationItemConfigurationV1,\n});\n\nexport type DTODocumentationGroupStructureV1 = z.infer<typeof DTODocumentationGroupStructureV1>;\nexport type DTODocumentationGroupV1 = z.infer<typeof DTODocumentationGroupV1>;\n","import { DocumentationItemHeaderV1 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nconst DocumentationColorV1 = z.object({\n aliasTo: z.string().optional(),\n value: z.string().optional(),\n});\n\nconst DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({\n foregroundColor: true,\n backgroundColor: true,\n}).extend({\n foregroundColor: DocumentationColorV1.optional(),\n backgroundColor: DocumentationColorV1.optional(),\n});\n\nexport const DTODocumentationItemConfigurationV1 = z.object({\n showSidebar: z.boolean(),\n isPrivate: z.boolean(),\n isHidden: z.boolean(),\n header: DTODocumentationItemHeaderV1,\n});\n\nexport type DTODocumentationItemConfigurationV1 = z.infer<typeof DTODocumentationItemConfigurationV1>;\n","import { z } from \"zod\";\nimport { DTODocumentationDraftState } from \"./draft-state\";\nimport { DTODocumentationGroupV2 } from \"./group-v2\";\nimport { DTODocumentationPageV2 } from \"./page-v2\";\n\nexport const DTODocumentationHierarchyV2 = z.object({\n pages: z.array(\n DTODocumentationPageV2.extend({\n /** Defined when a page has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n })\n ),\n\n groups: z.array(\n DTODocumentationGroupV2.extend({\n /** Defined when a page has changed since last publish and can be included into a partial publish */\n draftState: DTODocumentationDraftState.optional(),\n })\n ),\n\n /** True if the documentation was already published, false otherwise. */\n hasPublishedDocumentationContent: z.boolean(),\n});\n\nexport type DTODocumentationHierarchyV2 = z.infer<typeof DTODocumentationHierarchyV2>;\n","import { z } from \"zod\";\nimport {\n DTOCreateDocumentationPageInputV2,\n DTODeleteDocumentationPageInputV2,\n DTODocumentationPageApprovalStateChangeInput,\n DTODuplicateDocumentationPageInputV2,\n DTOMoveDocumentationPageInputV2,\n DTORestoreDocumentationGroupInput,\n DTORestoreDocumentationPageInput,\n DTOUpdateDocumentationPageDocumentInputV2,\n DTOUpdateDocumentationPageInputV2,\n} from \"./page-v2\";\n\n//\n// Read\n//\n\nconst SuccessPayload = z.object({\n success: z.literal(true),\n});\n\nexport const DTODocumentationPageCreateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageCreate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageUpdateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageUpdateDocumentActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdateDocument\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageMoveActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageMove\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageDuplicateActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageDuplicate\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageDeleteActionOutputV2 = z.object({\n type: z.literal(\"DocumentationPageDelete\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageRestoreActionOutput = z.object({\n type: z.literal(\"DocumentationPageRestore\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationGroupRestoreActionOutput = z.object({\n type: z.literal(\"DocumentationGroupRestore\"),\n output: SuccessPayload,\n});\n\nexport const DTODocumentationPageApprovalStateChangeActionOutput = z.object({\n type: z.literal(\"DocumentationPageApprovalStateChange\"),\n output: SuccessPayload,\n});\n\nexport type DTODocumentationPageCreateActionOutputV2 = z.infer<typeof DTODocumentationPageCreateActionOutputV2>;\nexport type DTODocumentationPageUpdateActionOutputV2 = z.infer<typeof DTODocumentationPageUpdateActionOutputV2>;\nexport type DTODocumentationPageUpdateDocumentActionOutputV2 = z.infer<\n typeof DTODocumentationPageUpdateDocumentActionOutputV2\n>;\nexport type DTODocumentationPageMoveActionOutputV2 = z.infer<typeof DTODocumentationPageMoveActionOutputV2>;\nexport type DTODocumentationPageDuplicateActionOutputV2 = z.infer<typeof DTODocumentationPageDuplicateActionOutputV2>;\nexport type DTODocumentationPageDeleteActionOutputV2 = z.infer<typeof DTODocumentationPageDeleteActionOutputV2>;\nexport type DTODocumentationPageRestoreActionOutput = z.infer<typeof DTODocumentationPageRestoreActionOutput>;\nexport type DTODocumentationGroupRestoreActionOutput = z.infer<typeof DTODocumentationGroupRestoreActionOutput>;\nexport type DTODocumentationPageApprovalStateChangeActionOutput = z.infer<\n typeof DTODocumentationPageApprovalStateChangeActionOutput\n>;\n\n// Write\n//\n\nexport const DTODocumentationPageCreateActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageCreate\"),\n input: DTOCreateDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageUpdateActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdate\"),\n input: DTOUpdateDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageUpdateDocumentActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageUpdateDocument\"),\n input: DTOUpdateDocumentationPageDocumentInputV2,\n});\n\nexport const DTODocumentationPageMoveActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageMove\"),\n input: DTOMoveDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageDuplicateActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageDuplicate\"),\n input: DTODuplicateDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageDeleteActionInputV2 = z.object({\n type: z.literal(\"DocumentationPageDelete\"),\n input: DTODeleteDocumentationPageInputV2,\n});\n\nexport const DTODocumentationPageRestoreActionInput = z.object({\n type: z.literal(\"DocumentationPageRestore\"),\n input: DTORestoreDocumentationPageInput,\n});\n\nexport const DTODocumentationGroupRestoreActionInput = z.object({\n type: z.literal(\"DocumentationGroupRestore\"),\n input: DTORestoreDocumentationGroupInput,\n});\n\nexport const DTODocumentationPageApprovalStateChangeActionInput = z.object({\n type: z.literal(\"DocumentationPageApprovalStateChange\"),\n input: DTODocumentationPageApprovalStateChangeInput,\n});\n\nexport type DTODocumentationPageCreateActionInputV2 = z.infer<typeof DTODocumentationPageCreateActionInputV2>;\nexport type DTODocumentationPageUpdateActionInputV2 = z.infer<typeof DTODocumentationPageUpdateActionInputV2>;\nexport type DTODocumentationPageUpdateDocumentActionInputV2 = z.infer<\n typeof DTODocumentationPageUpdateDocumentActionInputV2\n>;\nexport type DTODocumentationPageMoveActionInputV2 = z.infer<typeof DTODocumentationPageMoveActionInputV2>;\nexport type DTODocumentationPageDuplicateActionInputV2 = z.infer<typeof DTODocumentationPageDuplicateActionInputV2>;\nexport type DTODocumentationPageDeleteActionInputV2 = z.infer<typeof DTODocumentationPageDeleteActionInputV2>;\nexport type DTODocumentationPageRestoreActionInput = z.infer<typeof DTODocumentationPageRestoreActionInput>;\nexport type DTODocumentationGroupRestoreActionInput = z.infer<typeof DTODocumentationGroupRestoreActionInput>;\n","import { DocumentationPageContent } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageContent = DocumentationPageContent;\n\nexport const DTODocumentationPageContentGetResponse = z.object({\n pageContent: DTODocumentationPageContent,\n});\n\nexport type DTODocumentationPageContent = z.infer<typeof DTODocumentationPageContent>;\nexport type DTODocumentationPageContentGetResponse = z.infer<typeof DTODocumentationPageContentGetResponse>;\n","import { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTODocumentationPageDependencies = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n documentationPageId: z.string(),\n\n tokenPersistentIds: z.array(z.string()),\n figmaComponentPersistentIds: z.array(z.string()),\n componentPersistentIds: z.array(z.string()),\n figmaNodePersistentIds: z.array(z.string()),\n groupPersistentIds: z.array(z.string()),\n propertyPersistentIds: z.array(z.string()),\n themePersistentIds: z.array(z.string()),\n documentationPagePersistentIds: z.array(z.string()),\n storybookEntriesStoryIds: z.array(z.string()),\n});\n\nexport const DTODocumentationPageDependenciesGetResponse = z.object({\n dependencies: z.array(DTODocumentationPageDependencies),\n});\n\nexport type DTODocumentationPageDependencies = z.infer<typeof DTODocumentationPageDependencies>;\nexport type DTODocumentationPageDependenciesGetResponse = z.infer<typeof DTODocumentationPageDependenciesGetResponse>;\n","import { DocumentationPageV1, PageBlockV1 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV1 } from \"./item-configuration-v1\";\n\n//\n// Read\n//\n\nexport const DocumentationPageV1DTO = DocumentationPageV1.omit({\n data: true,\n meta: true,\n parentPersistentId: true,\n sortOrder: true,\n}).extend({\n configuration: DTODocumentationItemConfigurationV1,\n blocks: z.array(PageBlockV1),\n title: z.string(),\n path: z.string(),\n});\n\nexport type DocumentationPageV1DTO = z.infer<typeof DocumentationPageV1DTO>;\n","import { z } from \"zod\";\n\nexport const DTODocumentationSettings = z.object({\n isDraftFeatureAdopted: z.boolean(),\n isApprovalsFeatureEnabled: z.boolean(),\n isApprovalRequiredForPublishing: z.boolean(),\n});\n\nexport type DTODocumentationSettings = z.infer<typeof DTODocumentationSettings>;\n","import { z } from \"zod\";\n\nconst DTODocumentationStructureItemType = z.enum([\"Group\", \"Page\"]);\n\nconst DTODocumentationStructureItemBase = z.object({\n type: DTODocumentationStructureItemType,\n id: z.string(),\n designSystemVersionId: z.string(),\n shortPersistentId: z.string(),\n persistentId: z.string(),\n title: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTODocumentationStructureGroupItem = DTODocumentationStructureItemBase.extend({\n type: z.literal(DTODocumentationStructureItemType.enum.Group),\n groupBehavior: z.string(),\n childrenIds: z.string().array(),\n isRoot: z.boolean(),\n});\n\nexport const DTODocumentationStructurePageItem = DTODocumentationStructureItemBase.extend({\n type: z.literal(DTODocumentationStructureItemType.enum.Page),\n path: z.string(),\n});\n\nexport const DTODocumentationStructureItem = z.discriminatedUnion(\"type\", [\n DTODocumentationStructureGroupItem,\n DTODocumentationStructurePageItem,\n]);\nexport const DTODocumentationStructure = z.object({\n items: z.array(DTODocumentationStructureItem),\n});\n\nexport type DTODocumentationStructureItem = z.infer<typeof DTODocumentationStructureItem>;\nexport type DTODocumentationStructure = z.infer<typeof DTODocumentationStructure>;\n","import { FigmaFileStructureNode, FigmaNodeStructureStateV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOFigmaNodeStructure = z.object({\n id: z.string(),\n sourceId: z.string(),\n importState: FigmaNodeStructureStateV2,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTOFigmaNodeStructureDetail = DTOFigmaNodeStructure.extend({\n rootNode: FigmaFileStructureNode,\n});\n\nexport const DTOFigmaNodeStructureListResponse = z.object({\n structures: DTOFigmaNodeStructure.array(),\n});\n\nexport const DTOFigmaNodeStructureDetailResponse = z.object({\n structure: DTOFigmaNodeStructureDetail,\n});\n\nexport type DTOFigmaNodeStructure = z.infer<typeof DTOFigmaNodeStructure>;\nexport type DTOFigmaNodeStructureDetail = z.infer<typeof DTOFigmaNodeStructureDetail>;\nexport type DTOFigmaNodeStructureListResponse = z.infer<typeof DTOFigmaNodeStructureListResponse>;\nexport type DTOFigmaNodeStructureDetailResponse = z.infer<typeof DTOFigmaNodeStructureDetailResponse>;\n","import { FigmaNodeReference } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOFigmaNodeOrigin, DTOFigmaNodeRenderFormat } from \"./figma-node\";\n\nexport const DTOFigmaNodeData = z.object({\n // Id of the node in the Figma file\n figmaNodeId: z.string(),\n\n // Validity\n isValid: z.boolean(),\n\n // Asset data\n assetId: z.string(),\n assetUrl: z.string(),\n assetFormat: DTOFigmaNodeRenderFormat,\n\n // Asset metadata\n assetScale: z.number(),\n assetWidth: z.number().optional(),\n assetHeight: z.number().optional(),\n});\n\nexport const DTOFigmaNode = FigmaNodeReference.omit({\n data: true,\n origin: true,\n}).extend({\n data: DTOFigmaNodeData,\n origin: DTOFigmaNodeOrigin,\n});\n\nexport type DTOFigmaNodeData = z.infer<typeof DTOFigmaNodeData>;\nexport type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;\n","import { FigmaNodeRenderFormat } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Enums\n//\n\nexport const DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;\nexport type DTOFigmaNodeRenderFormat = z.infer<typeof DTOFigmaNodeRenderFormat>;\n\n//\n// Read\n//\n\nexport const DTOFigmaNodeOrigin = z.object({\n sourceId: z.string(),\n fileId: z.string().optional(),\n parentName: z.string().optional(),\n});\n\nexport type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;\n\n//\n// Write\n//\n\n/**\n * Properties that are available on all types of Figma node render requests\n */\nconst DTOFigmaNodeRenderInputBase = z.object({\n /**\n * Format in which the node must be rendered, png by default.\n */\n format: FigmaNodeRenderFormat.default(\"Png\"),\n\n /**\n * Scale to apply to PNG images, can be between 1 and 4. Scale is ignored for other image formats.\n */\n scale: z.number().optional(),\n});\n\n/**\n * Figma node render request that uses source ID + node ID to identify the requested\n * node to render. The node ID can be obtained from the source's Figma node structure.\n */\nexport const DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({\n inputType: z\n .literal(\"NodeId\")\n .optional()\n .transform(v => v ?? \"NodeId\"),\n\n /**\n * Id of a design system's data source representing a linked Figma file\n */\n sourceId: z.string(),\n\n /**\n * Id of a node within the Figma file\n */\n figmaFileNodeId: z.string(),\n});\n\n/**\n * Figma node render request that uses Figma URL to identify the requested\n * node to render. The URL can be obtained by the user directly from the Figma app.\n */\nexport const DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({\n inputType: z.literal(\"URL\"),\n\n /**\n * Id of a design system's data source representing a linked Figma file\n */\n figmaNodeUrl: z.string(),\n\n /**\n * Brand persistent id to use in case a source has to be created for this render\n */\n brandPersistentId: z.string(),\n});\n\n/**\n * Figma node render request that uses Figma URL to identify the requested\n * node to render. The URL can be obtained by the user directly from the Figma app.\n */\nexport const DTOFigmaNodeRerenderInput = z.object({\n inputType: z.literal(\"Rerender\"),\n\n /**\n * Persistent ID of an existing Figma node\n */\n figmaNodePersistentId: z.string(),\n});\n\nexport const DTOFigmaNodeRenderInput = z.discriminatedUnion(\"inputType\", [\n DTOFigmaNodeRenderIdInput,\n DTOFigmaNodeRenderUrlInput,\n DTOFigmaNodeRerenderInput,\n]);\n\nexport type DTOFigmaNodeRenderIdInput = z.infer<typeof DTOFigmaNodeRenderIdInput>;\nexport type DTOFigmaNodeRenderUrlInput = z.infer<typeof DTOFigmaNodeRenderUrlInput>;\nexport type DTOFigmaNodeRerenderInput = z.infer<typeof DTOFigmaNodeRerenderInput>;\nexport type DTOFigmaNodeRenderInput = z.infer<typeof DTOFigmaNodeRenderInput>;\n","import {\n FigmaNodeReference,\n FigmaNodeRenderedImage,\n FigmaNodeRenderError,\n FigmaNodeRenderFormat,\n FigmaNodeRenderState,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOFigmaNodeOrigin } from \"./figma-node\";\n\nexport const DTOFigmaNodeDataV2 = z.object({\n sceneNodeId: z.string(),\n format: FigmaNodeRenderFormat,\n scale: z.number().optional(),\n\n renderState: FigmaNodeRenderState,\n renderedImage: FigmaNodeRenderedImage.optional(),\n renderError: FigmaNodeRenderError.optional(),\n\n hasSource: z.boolean(),\n});\n\nexport const DTOFigmaNodeV2 = FigmaNodeReference.omit({\n data: true,\n origin: true,\n}).extend({\n data: DTOFigmaNodeDataV2,\n origin: DTOFigmaNodeOrigin,\n});\n\nexport type DTOFigmaNodeDataV2 = z.infer<typeof DTOFigmaNodeDataV2>;\nexport type DTOFigmaNodeV2 = z.infer<typeof DTOFigmaNodeV2>;\n","import { z } from \"zod\";\nimport { DTOFigmaNodeRenderIdInput, DTOFigmaNodeRenderInput } from \"./figma-node\";\nimport { DTOFigmaNode } from \"./figma-node-v1\";\nimport { DTOFigmaNodeV2 } from \"./figma-node-v2\";\n\n//\n// Read\n//\n\n/**\n * @deprecated Please use FigmaNodeRenderAsync (DTOFigmaNodeRenderAsyncActionOutput)\n */\nexport const DTOFigmaNodeRenderActionOutput = z.object({\n type: z.literal(\"FigmaNodeRender\"),\n figmaNodes: z.array(DTOFigmaNode),\n});\n\nexport const DTOFigmaNodeRenderAsyncActionOutput = z.object({\n type: z.literal(\"FigmaNodeRenderAsync\"),\n figmaNodes: z.array(DTOFigmaNodeV2),\n});\n\nexport type DTOFigmaNodeRenderActionOutput = z.infer<typeof DTOFigmaNodeRenderActionOutput>;\nexport type DTOFigmaNodeRenderAsyncActionOutput = z.infer<typeof DTOFigmaNodeRenderAsyncActionOutput>;\n\n//\n// Read\n//\n\n/**\n * @deprecated Please use FigmaNodeRenderAsync (DTOFigmaNodeRenderAsyncActionInput)\n */\nexport const DTOFigmaNodeRenderActionInput = z.object({\n type: z.literal(\"FigmaNodeRender\"),\n input: DTOFigmaNodeRenderIdInput.array(),\n});\n\nexport const DTOFigmaNodeRenderAsyncActionInput = z.object({\n type: z.literal(\"FigmaNodeRenderAsync\"),\n nodes: DTOFigmaNodeRenderInput.array(),\n});\n\nexport type DTOFigmaNodeRenderActionInput = z.infer<typeof DTOFigmaNodeRenderActionInput>;\nexport type DTOFigmaNodeRenderAsyncActionInput = z.infer<typeof DTOFigmaNodeRenderAsyncActionInput>;\n","import { FigmaFileStructureOrigin, FigmaFileStructureStatistics } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOFrameNodeStructure = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n origin: FigmaFileStructureOrigin,\n assetsInFile: FigmaFileStructureStatistics,\n});\n\nexport const DTOFrameNodeStructureListResponse = z.object({\n structures: DTOFrameNodeStructure.array(),\n});\n\nexport type DTOFrameNodeStructure = z.infer<typeof DTOFrameNodeStructure>;\nexport type DTOFrameNodeStructureListResponse = z.infer<typeof DTOFrameNodeStructureListResponse>;\n","import {\n ElementPropertyImmutableType,\n ElementPropertyLinkType,\n ElementPropertyTargetType,\n ElementPropertyTypeSchema,\n nullishToOptional,\n} from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOColorTokenInlineData } from \"../../aux\";\nimport { DTOObjectMeta } from \"../../aux/meta\";\n\nconst CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9-]{1,99}$/;\n\nexport const DTOElementPropertyDefinitionOption = z.object({\n id: z.string(),\n name: z.string(),\n backgroundColor: DTOColorTokenInlineData.optional(),\n});\n\n// DTO Object\nexport const DTOElementPropertyDefinition = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n meta: DTOObjectMeta,\n persistentId: z.string(),\n type: ElementPropertyTypeSchema,\n targetElementType: ElementPropertyTargetType,\n codeName: z.string().regex(CODE_NAME_REGEX),\n options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),\n linkElementType: nullishToOptional(ElementPropertyLinkType),\n isImmutable: z.boolean(),\n immutablePropertyType: ElementPropertyImmutableType.optional(),\n});\n\nexport type DTOElementPropertyDefinitionOption = z.infer<typeof DTOElementPropertyDefinitionOption>;\nexport type DTOElementPropertyDefinition = z.infer<typeof DTOElementPropertyDefinition>;\n\n//\n// Read\n//\n\nexport const DTOElementPropertyDefinitionListResponse = z.object({\n definitions: z.array(DTOElementPropertyDefinition),\n});\n\nexport const DTOElementPropertyDefinitionResponse = z.object({\n definition: DTOElementPropertyDefinition,\n});\n\nexport type DTOElementPropertyDefinitionListResponse = z.infer<typeof DTOElementPropertyDefinitionListResponse>;\nexport type DTOElementPropertyDefinitionResponse = z.infer<typeof DTOElementPropertyDefinitionResponse>;\n\n//\n// Write\n//\n\nexport const DTOElementPropertyDefinitionCreatePayload = z.object({\n meta: DTOObjectMeta,\n persistentId: z.string(),\n type: ElementPropertyTypeSchema,\n targetElementType: ElementPropertyTargetType,\n codeName: z.string().regex(CODE_NAME_REGEX),\n options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),\n linkElementType: nullishToOptional(ElementPropertyLinkType),\n columnWidth: z.number().max(1024).optional(),\n});\n\nexport const DTOElementPropertyDefinitionUpdatePayload = z.object({\n meta: DTOObjectMeta.optional(),\n codeName: z.string().regex(CODE_NAME_REGEX).optional(),\n options: z.array(DTOElementPropertyDefinitionOption).optional(),\n});\n\nexport type DTOElementPropertyDefinitionCreatePayload = z.infer<typeof DTOElementPropertyDefinitionCreatePayload>;\nexport type DTOElementPropertyDefinitionUpdatePayload = z.infer<typeof DTOElementPropertyDefinitionUpdatePayload>;\n","import { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOElementPropertyValue = z.object({\n id: z.string(),\n designSystemVersionId: z.string(),\n definitionId: z.string(),\n targetElementId: z.string(),\n value: z.union([z.string(), z.number(), z.boolean()]).optional(),\n valuePreview: z.string().optional(),\n});\n\nexport const DTOElementPropertyValueListResponse = z.object({\n values: z.array(DTOElementPropertyValue),\n});\n\nexport const DTOElementPropertyValueResponse = z.object({\n value: DTOElementPropertyValue,\n});\n\nexport const DTOElementPropertyValuesEditActionOutput = z.object({\n type: z.literal(\"ElementPropertyValuesEdit\"),\n output: z.object({ success: z.literal(true) }),\n});\n\nexport type DTOElementPropertyValue = z.infer<typeof DTOElementPropertyValue>;\nexport type DTOElementPropertyValueListResponse = z.infer<typeof DTOElementPropertyValueListResponse>;\nexport type DTOElementPropertyValueResponse = z.infer<typeof DTOElementPropertyValueResponse>;\nexport type DTOElementPropertyValuesEditActionOutput = z.infer<typeof DTOElementPropertyValuesEditActionOutput>;\n\n//\n// Write\n//\n\nexport const DTOElementPropertyValueUpsertPaylod = z.object({\n definitionId: z.string(),\n targetElementId: z.string(),\n value: z.string().or(z.number()).or(z.boolean()).nullable(),\n});\n\nexport const DTOElementPropertyValuesEditActionInput = z.object({\n type: z.literal(\"ElementPropertyValuesEdit\"),\n values: DTOElementPropertyValueUpsertPaylod.array(),\n});\n\nexport type DTOElementPropertyValueUpsertPaylod = z.infer<typeof DTOElementPropertyValueUpsertPaylod>;\nexport type DTOElementPropertyValuesEditActionInput = z.infer<typeof DTOElementPropertyValuesEditActionInput>;\n","import { z } from \"zod\";\nimport {\n DTODocumentationGroupCreateActionInputV2,\n DTODocumentationGroupCreateActionOutputV2,\n DTODocumentationGroupDeleteActionInputV2,\n DTODocumentationGroupDeleteActionOutputV2,\n DTODocumentationGroupDuplicateActionInputV2,\n DTODocumentationGroupDuplicateActionOutputV2,\n DTODocumentationGroupMoveActionInputV2,\n DTODocumentationGroupMoveActionOutputV2,\n DTODocumentationGroupUpdateActionInputV2,\n DTODocumentationGroupUpdateActionOutputV2,\n DTODocumentationTabCreateActionInputV2,\n DTODocumentationTabCreateActionOutputV2,\n DTODocumentationTabGroupDeleteActionInputV2,\n DTODocumentationTabGroupDeleteActionOutputV2,\n} from \"./documentation/group-action\";\nimport {\n DTODocumentationGroupRestoreActionInput,\n DTODocumentationGroupRestoreActionOutput,\n DTODocumentationPageApprovalStateChangeActionInput,\n DTODocumentationPageApprovalStateChangeActionOutput,\n DTODocumentationPageCreateActionInputV2,\n DTODocumentationPageCreateActionOutputV2,\n DTODocumentationPageDeleteActionInputV2,\n DTODocumentationPageDeleteActionOutputV2,\n DTODocumentationPageDuplicateActionInputV2,\n DTODocumentationPageDuplicateActionOutputV2,\n DTODocumentationPageMoveActionInputV2,\n DTODocumentationPageMoveActionOutputV2,\n DTODocumentationPageRestoreActionInput,\n DTODocumentationPageRestoreActionOutput,\n DTODocumentationPageUpdateActionInputV2,\n DTODocumentationPageUpdateActionOutputV2,\n DTODocumentationPageUpdateDocumentActionInputV2,\n DTODocumentationPageUpdateDocumentActionOutputV2,\n} from \"./documentation/page-actions-v2\";\nimport {\n DTOFigmaNodeRenderActionInput,\n DTOFigmaNodeRenderActionOutput,\n DTOFigmaNodeRenderAsyncActionInput,\n DTOFigmaNodeRenderAsyncActionOutput,\n} from \"./figma-nodes/node-actions-v2\";\nimport { DTOElementPropertyValuesEditActionInput, DTOElementPropertyValuesEditActionOutput } from \"./properties\";\n\n//\n// Read\n//\n\nexport const DTOElementActionOutput = z.discriminatedUnion(\"type\", [\n // Documentation pages\n DTODocumentationPageCreateActionOutputV2,\n DTODocumentationPageUpdateActionOutputV2,\n DTODocumentationPageUpdateDocumentActionOutputV2,\n DTODocumentationPageMoveActionOutputV2,\n DTODocumentationPageDuplicateActionOutputV2,\n DTODocumentationPageDeleteActionOutputV2,\n\n // Documentation groups\n DTODocumentationGroupCreateActionOutputV2,\n DTODocumentationTabCreateActionOutputV2,\n DTODocumentationGroupUpdateActionOutputV2,\n DTODocumentationGroupMoveActionOutputV2,\n DTODocumentationGroupDuplicateActionOutputV2,\n DTODocumentationGroupDeleteActionOutputV2,\n DTODocumentationTabGroupDeleteActionOutputV2,\n\n // Figma frames\n DTOFigmaNodeRenderActionOutput,\n DTOFigmaNodeRenderAsyncActionOutput,\n\n // Restore\n DTODocumentationPageRestoreActionOutput,\n DTODocumentationGroupRestoreActionOutput,\n\n // Approvals\n DTODocumentationPageApprovalStateChangeActionOutput,\n\n // Element properties\n DTOElementPropertyValuesEditActionOutput,\n]);\n\nexport type DTOElementActionOutput = z.infer<typeof DTOElementActionOutput>;\n\n//\n// Write\n//\n\nexport const DTOElementActionInput = z\n .discriminatedUnion(\"type\", [\n // Documentation pages\n DTODocumentationPageCreateActionInputV2,\n DTODocumentationPageUpdateActionInputV2,\n DTODocumentationPageUpdateDocumentActionInputV2,\n DTODocumentationPageMoveActionInputV2,\n DTODocumentationPageDuplicateActionInputV2,\n DTODocumentationPageDeleteActionInputV2,\n\n // Documentation groups\n DTODocumentationGroupCreateActionInputV2,\n DTODocumentationTabCreateActionInputV2,\n DTODocumentationGroupUpdateActionInputV2,\n DTODocumentationGroupMoveActionInputV2,\n DTODocumentationGroupDuplicateActionInputV2,\n DTODocumentationGroupDeleteActionInputV2,\n DTODocumentationTabGroupDeleteActionInputV2,\n\n // Figma frames\n DTOFigmaNodeRenderActionInput,\n DTOFigmaNodeRenderAsyncActionInput,\n\n // Restore\n DTODocumentationPageRestoreActionInput,\n DTODocumentationGroupRestoreActionInput,\n\n // Approval\n DTODocumentationPageApprovalStateChangeActionInput,\n\n // Element properties\n DTOElementPropertyValuesEditActionInput,\n ])\n .and(\n z.object({\n tId: z.string().optional(),\n })\n );\n\nexport type DTOElementActionInput = z.infer<typeof DTOElementActionInput>;\nexport type DTOElementActionInputOfType<T extends DTOElementActionInput[\"type\"]> = Extract<\n DTOElementActionInput,\n { type: T }\n>;\n","import { z } from \"zod\";\nimport { DTOFigmaNode, DTOFigmaNodeV2 } from \"./figma-nodes\";\n\n//\n// Read\n//\n\nexport const DTOElementsGetTypeFilter = z.enum([\"FigmaNode\"]);\n\nexport const DTOElementsGetQuerySchema = z.object({\n types: z.string().transform(val => val.split(\",\").map(v => DTOElementsGetTypeFilter.parse(v))),\n responseVersion: z.coerce.number().default(1),\n});\n\nexport const DTOElementsGetOutput = z.object({\n figmaNodes: z.array(DTOFigmaNode).optional(),\n});\n\nexport const DTOElementsGetOutputV2 = z.object({\n figmaNodes: z.array(DTOFigmaNodeV2).optional(),\n});\n\nexport type DTOElementsGetOutput = z.infer<typeof DTOElementsGetOutput>;\nexport type DTOElementsGetOutputV2 = z.infer<typeof DTOElementsGetOutputV2>;\nexport type DTOElementsGetQueryRaw = z.input<typeof DTOElementsGetQuerySchema>;\nexport type DTOElementsGetQueryParsed = z.output<typeof DTOElementsGetQuerySchema>;\nexport type DTOElementsGetTypeFilter = z.infer<typeof DTOElementsGetTypeFilter>;\n","import { z } from \"zod\";\n\nexport const DTOAssetRenderConfiguration = z.object({\n prefix: z.string().optional(),\n suffix: z.string().optional(),\n scale: z.enum([\"x1\", \"x2\", \"x3\", \"x4\"]),\n format: z.enum([\"png\", \"pdf\", \"svg\"]),\n});\n\nexport const DTORenderedAssetFile = z.object({\n assetId: z.string(),\n fileName: z.string(),\n sourceUrl: z.string(),\n settings: DTOAssetRenderConfiguration,\n originalName: z.string(),\n});\n\nexport const DTODownloadAssetsRequest = z.object({\n persistentIds: z.array(z.string().uuid()).optional(),\n settings: DTOAssetRenderConfiguration.array(),\n});\n\nexport const DTODownloadAssetsResponse = z.object({\n items: DTORenderedAssetFile.array(),\n});\n\nexport type DTOAssetRenderConfiguration = z.infer<typeof DTOAssetRenderConfiguration>;\nexport type DTORenderedAssetFile = z.infer<typeof DTORenderedAssetFile>;\nexport type DTODownloadAssetsRequest = z.infer<typeof DTODownloadAssetsRequest>;\nexport type DTODownloadAssetsResponse = z.infer<typeof DTODownloadAssetsResponse>;\n","import { type FigmaExporter, FigmaExporterAnyDesignNodeSchema } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOFigmaNodeResponse: z.ZodType<{\n nodes: FigmaExporter[\"AnyDesignNode\"];\n}> = z.object({\n nodes: FigmaExporterAnyDesignNodeSchema,\n});\n\nexport type DTOFigmaNodeResponse = {\n nodes: FigmaExporter[\"AnyDesignNode\"];\n};\n","import { z } from \"zod\";\n\nexport const DTOLiveblocksAuthResponse = z.object({\n token: z.string(),\n})\n\nexport type DTOLiveblocksAuthResponse = z.infer<typeof DTOLiveblocksAuthResponse>;\n","import { nullishToOptional, PortalSettingsTheme } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOPortalSettingsTheme = PortalSettingsTheme;\n\nexport const DTOPortalSettings = z.object({\n id: z.string(),\n workspaceId: z.string(),\n\n enabledDesignSystemIds: z.array(z.string()),\n enabledBrandPersistentIds: z.array(z.string()),\n\n theme: nullishToOptional(DTOPortalSettingsTheme),\n sidebar: nullishToOptional(z.any()),\n\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n});\n\nexport const DTOPortalSettingsGetResponse = z.object({\n portalSettings: DTOPortalSettings,\n});\n\nexport const DTOPortalSettingsUpdatePayload = z.object({\n enabledDesignSystemIds: z.array(z.string()).optional(),\n enabledBrandPersistentIds: z.array(z.string()).optional(),\n theme: DTOPortalSettingsTheme.optional(),\n sidebar: z.any().optional(),\n});\n\nexport type DTOPortalSettingsTheme = z.infer<typeof DTOPortalSettingsTheme>;\nexport type DTOPortalSettings = z.infer<typeof DTOPortalSettings>;\nexport type DTOPortalSettingsGetResponse = z.infer<typeof DTOPortalSettingsGetResponse>;\nexport type DTOPortalSettingsUpdatePayload = z.infer<typeof DTOPortalSettingsUpdatePayload>;\n","import { DesignTokenTypedData, ThemeOverrideOrigin } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\n//\n// Read\n//\n\nexport const DTOThemeOverride = DesignTokenTypedData.and(\n z.object({\n tokenPersistentId: z.string(),\n origin: ThemeOverrideOrigin.optional(),\n })\n);\n\nexport type DTOThemeOverride = z.infer<typeof DTOThemeOverride>;\n\n//\n// Write\n//\n\nexport const DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(\n z.object({\n tokenPersistentId: z.string(),\n })\n);\n\nexport type DTOThemeOverrideCreatePayload = z.infer<typeof DTOThemeOverrideCreatePayload>;\n","import { ObjectMeta } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOThemeOverride } from \"./override\";\n\n//\n// Read\n//\n\nexport const DTOTheme = z.object({\n id: z.string(),\n persistentId: z.string(),\n designSystemVersionId: z.string(),\n brandId: z.string(),\n\n meta: ObjectMeta,\n codeName: z.string(),\n\n overrides: DTOThemeOverride.array(),\n});\n\nexport const DTOThemeResponse = z.object({\n theme: DTOTheme,\n});\n\nexport const DTOThemeListResponse = z.object({\n themes: DTOTheme.array(),\n});\n\nexport type DTOTheme = z.infer<typeof DTOTheme>;\nexport type DTOThemeResponse = z.infer<typeof DTOThemeResponse>;\nexport type DTOThemeListResponse = z.infer<typeof DTOThemeListResponse>;\n\n//\n// Write\n//\n\nexport const DTOThemeCreatePayload = z.object({\n meta: ObjectMeta,\n persistentId: z.string(),\n brandId: z.string(),\n codeName: z.string(),\n overrides: DTOThemeOverride.array(),\n});\n\nexport type DTOThemeCreatePayload = z.infer<typeof DTOThemeCreatePayload>;\n","const figmaFileIdRegex = /^[0-9a-zA-Z]{22,128}$/;\nconst nodeIdRegex = /^\\d+-\\d+$/;\nconst nodeTypeRegex = /^[0-9a-zA-Z]^/;\n\nexport enum ParsedFigmaFileURLError {\n InvalidUrl = \"InvalidUrl\",\n InvalidFigmaFileId = \"InvalidFigmaFileId\",\n}\n\ntype ParsedFigmaFileURL =\n | {\n status: \"Success\";\n fileId: string;\n fileName: string | null;\n nodeId: string | null;\n nodeType: string | null;\n }\n | {\n status: \"Error\";\n error: ParsedFigmaFileURLError;\n };\n\nexport const FigmaUtils = {\n tryParseFigmaFileURL(urlString: string): ParsedFigmaFileURL {\n if (!URL.canParse(urlString)) {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidUrl };\n }\n\n // Validate that this is a Figma URL\n const url = new URL(urlString);\n if (!url.hostname.endsWith(\"figma.com\")) {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidUrl };\n }\n\n // Validate that the URL type is the correct one (pointing to a design file)\n const pathSegments = url.pathname.split(\"/\");\n if (pathSegments[1] !== \"design\" && pathSegments[1] !== \"file\") {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidUrl };\n }\n\n // Validate Figma file ID\n const fileId = pathSegments[2];\n if (!fileId || !fileId.match(figmaFileIdRegex)) {\n return { status: \"Error\", error: ParsedFigmaFileURLError.InvalidFigmaFileId };\n }\n\n // Parse Figma file name\n let fileName: string | null = null;\n const rawFileName = pathSegments[3];\n if (rawFileName) {\n fileName = rawFileName.replaceAll(\"-\", \" \");\n }\n\n // Parse node id\n let nodeId: string | null = null;\n const nodeIdRaw = url.searchParams.get(\"node-id\");\n if (nodeIdRaw && nodeIdRaw.match(nodeIdRegex)) {\n nodeId = nodeIdRaw.replace(\"-\", \":\");\n }\n\n // Parse node type\n let nodeType: string | null = null;\n const nodeTypeRaw = url.searchParams.get(\"node-type\");\n if (nodeTypeRaw && nodeTypeRaw.match(nodeTypeRegex)) {\n nodeType = nodeTypeRaw;\n }\n\n return { status: \"Success\", fileId, fileName, nodeId, nodeType };\n },\n};\n\n// https://www.figma.com/design/U3Mg3I8WbvqF6CcZtRJM7w?node-id=2-3&t=9Qev2vhsldyFMhuE-1\n","function hash(input: string): string {\n return farmhash(input).toString(16);\n}\n\nfunction farmhash(input: string): number {\n const seed = 0x9e3779b9;\n let hash = seed;\n\n for (let i = 0; i < input.length; i++) {\n const charCode = input.charCodeAt(i);\n hash ^= charCode;\n hash = Math.imul(hash, 0x5bd1e995);\n hash ^= hash >>> 15;\n }\n\n hash = Math.imul(hash, 0x5bd1e995);\n hash ^= hash >>> 13;\n hash = Math.imul(hash, 0x5bd1e995);\n hash ^= hash >>> 15;\n\n return hash >>> 0;\n}\n\nfunction prepareObject(obj: any): any {\n if (obj === null || typeof obj !== \"object\") {\n return obj;\n }\n if (Array.isArray(obj)) {\n return obj.map(prepareObject);\n }\n const sortedObj: any = {};\n for (const key of Object.keys(obj).sort()) {\n if (obj[key] === null || obj[key] === undefined) {\n continue;\n }\n sortedObj[key] = prepareObject(obj[key]);\n }\n return sortedObj;\n}\n\nexport function generateHash(input: object | string, debug = false): string {\n if (typeof input === \"object\") {\n const sanitized = JSON.stringify(prepareObject(input));\n if (debug) {\n console.log(\"Hashing sanitized string:\");\n console.log(sanitized);\n }\n return hash(sanitized);\n } else {\n try {\n const obj = JSON.parse(input);\n const sanitized = JSON.stringify(prepareObject(obj));\n if (debug) {\n console.log(\"Hashing sanitized string:\");\n console.log(sanitized);\n }\n return hash(sanitized);\n } catch {\n return hash(input);\n }\n }\n}\n","type CompatibleValue = number | string | boolean | undefined;\ntype QueryObject = Record<string, CompatibleValue | CompatibleValue[]>;\n\nexport function serializeQuery(query: QueryObject): URLSearchParams {\n const queryWithStrings = Object.fromEntries(\n Object.entries(query)\n .filter(e => !!e[1])\n .map(([k, v]) => {\n if (Array.isArray(v)) {\n return [k, v.join(\", \")];\n } else {\n return [k, v!.toString()];\n }\n })\n );\n\n return new URLSearchParams(queryWithStrings);\n}\n","export const exhaustiveInvalidUriPaths = {\n emptyPath: \"\",\n spacesInPath: \"/invalid path/with spaces\",\n specialCharacter1: \"/path/with|invalid>characters\",\n specialCharacter2: \"/path/with<invalid*characters\",\n specialCharacter3: \"/path/{invalid}?characters\",\n consecutiveSlashes: \"/path//with///too/many/slashes\",\n unencodedPercent: \"/path/with/unencoded%percent\",\n unencodedSpaces: \"/path/with unencoded spaces\",\n fragmentIdentifier: \"/path/with#fragment\",\n queryParameters: \"/path/with?query=parameter\",\n nullCharacter: \"/path/with/\\u0000nullcharacter\",\n onlySlash: \"/\",\n controlCharacter: \"/path/with/control\\0character\",\n extremelyLongPath: \"/\" + \"a\".repeat(2047),\n invalidStartCharacter: \"///path/starting/with/slashes\",\n invalidStartCharacterColon: \":/path/starting/with/colon\",\n invalidTrailingDot: \"/path/ending/with/dot.\",\n invalidPercentEncoding1: \"/path/with/%2\",\n invalidPercentEncoding2: \"/path/with/%ZZ\",\n invalidPercentEncoding3: \"/path/with/%G1\",\n reservedCharacter1: \"/path/with?<reserved>\",\n reservedCharacter2: '/path/with/\"quotes\"',\n reservedCharacter3: \"/path/with/[brackets]\",\n reservedCharacter4: \"/path/with/\\\\backslashes\",\n nonAscii1: \"/path/with/你好\",\n nonAscii2: \"/path/with/emoji/😃\",\n mixedEncodingPath: \"/path/%41A%42B%C3%28\",\n directoryTraversal1: \"/path/../../etc/passwd\",\n directoryTraversal2: \"/path/./././\",\n};\n\ntype ValidationErrorReason = \"TooLong\" | \"InvalidURI\" | \"Empty\" | \"ContainsQuery\" | \"ContainsFragment\";\n\nexport function isValidRedirectPath(path: string): { isValid: boolean; reason: ValidationErrorReason | undefined } {\n const trimmedPath = path.toLowerCase().trim();\n const url = \"https://www.example.com\" + trimmedPath;\n if (url.length > 2048) {\n return {\n isValid: false,\n reason: \"TooLong\",\n };\n }\n if (trimmedPath === \"\") {\n return {\n isValid: false,\n reason: \"Empty\",\n };\n }\n if (url === \"/\") {\n return {\n isValid: false,\n reason: \"Empty\",\n };\n }\n\n if (url.includes(\"?\")) {\n return {\n isValid: false,\n reason: \"ContainsQuery\",\n };\n }\n if (url.includes(\"#\")) {\n return {\n isValid: false,\n reason: \"ContainsFragment\",\n };\n }\n\n const regex = /^\\/[A-Za-z0-9_-]+(\\/[A-Za-z0-9_-]+)*$/;\n const isValid = regex.test(trimmedPath);\n return {\n isValid: regex.test(trimmedPath),\n reason: !isValid ? \"InvalidURI\" : undefined,\n };\n}\n","import { serializeQuery } from \"../../../utils\";\nimport { z } from \"zod\";\nimport {\n DTOExporterCreateInput,\n DTOExporterResponse,\n DTOExporterListQuery,\n DTOExporterListResponse,\n DTOExporterDeprecationInput,\n DTOExporter,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class ExportersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n add(workspaceId: string, body: DTOExporterCreateInput) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterResponse, {\n body,\n method: \"POST\",\n });\n }\n\n list(workspaceId: string, query?: DTOExporterListQuery) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters`, DTOExporterListResponse, {\n query: query ? serializeQuery(query) : undefined,\n });\n }\n\n get(workspaceId: string, exporterId: string) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/exporters/${exporterId}`, DTOExporterResponse);\n }\n\n deprecate(workspaceId: string, exporterId: string, body: DTOExporterDeprecationInput) {\n return this.requestExecutor.json(\n `/codegen/workspaces/${workspaceId}/exporters/${exporterId}/deprecation`,\n DTOExporter,\n {\n body,\n method: \"PUT\",\n }\n );\n }\n\n pullChanges(workspaceId: string, exporterId: string) {\n return this.requestExecutor.json(\n `/codegen/workspaces/${workspaceId}/exporters/${exporterId}`,\n DTOExporterResponse,\n {\n body: {},\n method: \"PUT\",\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport { DTOExportJobResponseLegacy } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class ExporterJobsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`, z.any());\n }\n\n get(workspaceId: string, jobId: string) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs/${jobId}`, DTOExportJobResponseLegacy);\n }\n}\n","import { DTOExportJobResponse, DTOPipelineListQuery, DTOPipelineListResponse, DTOPipelineResponse } from \"../../dto\";\nimport { DTOPipelineCreateBody, DTOPipelineTriggerBody, DTOPipelineUpdateBody } from \"../../payloads\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class PipelinesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string, query: DTOPipelineListQuery) {\n const queryWithStrings = Object.fromEntries(\n Object.entries(query)\n .filter(e => !!e[1])\n .map(([k, v]) => [k, v.toString()])\n );\n\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineListResponse, {\n query: new URLSearchParams(queryWithStrings),\n });\n }\n\n create(workspaceId: string, payload: DTOPipelineCreateBody) {\n return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/pipelines`, DTOPipelineResponse, {\n body: payload,\n method: \"POST\",\n });\n }\n\n update(designSystemId: string, pipelineId: string, payload: DTOPipelineUpdateBody) {\n return this.requestExecutor.json(`/design-systems/${designSystemId}/pipelines/${pipelineId}`, DTOPipelineResponse, {\n body: payload,\n method: \"PUT\",\n });\n }\n\n trigger(workspaceId: string, pipelineId: string, payload: DTOPipelineTriggerBody) {\n return this.requestExecutor.json(\n `/codegen/workspaces/${workspaceId}/pipelines/${pipelineId}/trigger`,\n DTOExportJobResponse,\n {\n body: payload,\n method: \"POST\",\n }\n );\n }\n}\n","import { RequestExecutor } from \"../../transport\";\nimport { ExportersEndpoint } from \"./exporters\";\nimport { ExporterJobsEndpoint } from \"./jobs\";\nimport { PipelinesEndpoint } from \"./pipelines\";\n\nexport class CodegenEndpoint {\n readonly exporters: ExportersEndpoint;\n readonly pipelines: PipelinesEndpoint;\n readonly jobs: ExporterJobsEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.pipelines = new PipelinesEndpoint(requestExecutor);\n this.exporters = new ExportersEndpoint(requestExecutor);\n this.jobs = new ExporterJobsEndpoint(requestExecutor);\n }\n}\n","import { z } from \"zod\";\nimport { DTOBrandCreatePayload, DTOBrandGetResponse, DTOBrandsListResponse, DTOBrandUpdatePayload } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class BrandsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(designSystemId: string, versionId: string, brandId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/brands/${brandId}`,\n DTOBrandGetResponse\n );\n }\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/brands`,\n DTOBrandsListResponse\n );\n }\n\n create(designSystemId: string, versionId: string, body: DTOBrandCreatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/brands`,\n DTOBrandGetResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n update(dsId: string, vId: string, brandId: string, body: DTOBrandUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, DTOBrandGetResponse, {\n method: \"PUT\",\n body,\n });\n }\n\n delete(dsId: string, vId: string, brandId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z.any(), {\n method: \"DELETE\",\n });\n }\n}\n","import {\n DTOAnalyzeCodeComponentsInPackageInput,\n DTOAnalyzeCodeComponentsInPackageResponse,\n DTOCodeComponentListResponse,\n DTOCodeComponentsCreateInput,\n DTOCodeComponentUpsertResponse,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class CodeComponentsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async import(dsId: string, vId: string, body: DTOCodeComponentsCreateInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components`,\n DTOCodeComponentUpsertResponse,\n {\n body,\n method: \"POST\",\n }\n );\n }\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components`,\n DTOCodeComponentListResponse\n );\n }\n\n async deleteAll(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components`,\n DTOCodeComponentListResponse,\n {\n method: \"DELETE\",\n }\n );\n }\n\n async analyzePackage(dsId: string, vId: string, body: DTOAnalyzeCodeComponentsInPackageInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/code-components/analyze-package`,\n DTOAnalyzeCodeComponentsInPackageResponse,\n {\n body,\n method: \"POST\",\n }\n );\n }\n}\n","import {\n DTODocumentationPageRoomResponse,\n DTODocumentationStructure,\n DTOPublishDocumentationRequest,\n DTOPublishDocumentationResponse,\n} from \"../../../dto\";\nimport { DTOGetBlockDefinitionsOutput } from \"../../../payloads\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class DocumentationEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async getStructure(designSystemId: string, versionId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/documentation/structure`,\n DTODocumentationStructure\n );\n }\n\n async getDocStructure(dsId: string, vId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/structure`,\n DTODocumentationStructure\n );\n }\n\n async getPageRoom(dsId: string, vId: string, pageId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/pages/${pageId}/room`,\n DTODocumentationPageRoomResponse\n );\n }\n\n async getBlockDefinitions(dsId: string, vId: string) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/block-definitions`,\n DTOGetBlockDefinitionsOutput\n );\n }\n\n async publish(dsId: string, vId: string, body: DTOPublishDocumentationRequest) {\n return await this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/documentation/publish`,\n DTOPublishDocumentationResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n}\n","import {\n DTODesignSystemComponentCreateInput,\n DTODesignSystemComponentListResponse,\n DTODesignSystemComponentResponse,\n} from \"../../../dto/design-systems/component\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class DesignSystemComponentEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/design-system-components`,\n DTODesignSystemComponentListResponse\n );\n }\n\n async create(dsId: string, vId: string, body: DTODesignSystemComponentCreateInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/design-system-components`,\n DTODesignSystemComponentResponse,\n {\n body,\n method: \"POST\",\n }\n );\n }\n}\n","import {\n DTOCreateDocumentationGroupInput,\n DTOCreateDocumentationPageInputV2,\n DTOCreateDocumentationTabInput,\n DTOElementActionInput,\n DTOElementActionOutput,\n DTOElementPropertyValueUpsertPaylod,\n DTOFigmaNodeRenderIdInput,\n DTOFigmaNodeRenderInput,\n DTOMoveDocumentationGroupInput,\n DTOUpdateDocumentationGroupInput,\n DTOUpdateDocumentationPageDocumentInputV2,\n DTOUpdateDocumentationPageInputV2,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ElementsActionEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async createDocPage(dsId: string, vId: string, input: DTOCreateDocumentationPageInputV2) {\n return this.action(dsId, vId, { type: \"DocumentationPageCreate\", input });\n }\n\n async createDocGroup(dsId: string, vId: string, input: DTOCreateDocumentationGroupInput) {\n return this.action(dsId, vId, { type: \"DocumentationGroupCreate\", input });\n }\n\n async moveDocGroup(dsId: string, vId: string, input: DTOMoveDocumentationGroupInput) {\n return this.action(dsId, vId, { type: \"DocumentationGroupMove\", input });\n }\n\n async updateDocPage(dsId: string, vId: string, input: DTOUpdateDocumentationPageInputV2) {\n return this.action(dsId, vId, { type: \"DocumentationPageUpdate\", input });\n }\n\n async updateDocPageDocument(dsId: string, vId: string, input: DTOUpdateDocumentationPageDocumentInputV2) {\n return this.action(dsId, vId, { type: \"DocumentationPageUpdateDocument\", input });\n }\n\n async updateDocGroup(dsId: string, vId: string, input: DTOUpdateDocumentationGroupInput) {\n return this.action(dsId, vId, { type: \"DocumentationGroupUpdate\", input });\n }\n\n async createDocTab(dsId: string, vId: string, input: DTOCreateDocumentationTabInput) {\n return this.action(dsId, vId, { type: \"DocumentationTabCreate\", input });\n }\n\n async renderNodes(dsId: string, vId: string, input: DTOFigmaNodeRenderIdInput[]) {\n return this.action(dsId, vId, { type: \"FigmaNodeRender\", input });\n }\n\n async renderNodesAsync(dsId: string, vId: string, nodes: DTOFigmaNodeRenderInput[]) {\n return this.action(dsId, vId, { type: \"FigmaNodeRenderAsync\", nodes });\n }\n\n async bulkEditPropertyValues(dsId: string, vId: string, values: DTOElementPropertyValueUpsertPaylod[]) {\n return this.action(dsId, vId, { type: \"ElementPropertyValuesEdit\", values });\n }\n\n private async action(dsId: string, vId: string, input: DTOElementActionInput) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/elements-action`,\n DTOElementActionOutput,\n {\n body: input,\n method: \"POST\",\n }\n );\n }\n}\n","import { OmitStrict } from \"@supernova-studio/model\";\nimport { serializeQuery } from \"../../../../utils\";\nimport { DTOElementsGetOutput, DTOElementsGetOutputV2, DTOElementsGetQueryParsed } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\ntype GetElementsQuery = OmitStrict<DTOElementsGetQueryParsed, \"responseVersion\">;\n\nexport class ElementsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getElementsV1(dsId: string, vId: string, query: GetElementsQuery) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/elements`, DTOElementsGetOutput, {\n query: serializeQuery(query),\n });\n }\n\n getElementsV2(dsId: string, vId: string, query: GetElementsQuery) {\n const fullQuery: DTOElementsGetQueryParsed = {\n ...query,\n responseVersion: 2,\n };\n\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/elements`, DTOElementsGetOutputV2, {\n query: serializeQuery(fullQuery),\n });\n }\n}\n","import { DTOFigmaComponentGroupListResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class FigmaComponentGroupsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/component-groups`,\n DTOFigmaComponentGroupListResponse\n );\n }\n}\n","import { DTOFigmaComponentListResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class FigmaComponentsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n async list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/components`,\n DTOFigmaComponentListResponse\n );\n }\n}\n","import { DTOFrameNodeStructureListResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class FigmaFrameStructuresEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/figma-frames/node-structures`,\n DTOFrameNodeStructureListResponse\n );\n }\n}\n","import {\n DTOFilesGetQuery,\n DTOFilesResponse,\n DTOFileUploadFinalizePayload,\n DTOFileUploadFinalizeResponse,\n DTOFileUploadPayload,\n DTOFileUploadResponse,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport\";\n\nexport class FilesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n upload(designSystemId: string, versionId: string, body: DTOFileUploadPayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/files/upload`,\n DTOFileUploadResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n finalize(designSystemId: string, versionId: string, body: DTOFileUploadFinalizePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/files/finalize`,\n DTOFileUploadFinalizeResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n get(designSystemId: string, versionId: string, query?: DTOFilesGetQuery) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/files`,\n DTOFilesResponse,\n { query: query ? new URLSearchParams(query) : undefined }\n );\n }\n}\n","import { DTOImportJobResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ImportJobsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(designSystemId: string, versionId: string, jobId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/import-jobs/${jobId}`,\n DTOImportJobResponse\n );\n }\n}\n","import { z } from \"zod\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class OverridesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, versionId: string, themeId: string, body: any) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/themes/${themeId}/overrides`,\n z.any(),\n {\n method: \"POST\",\n body,\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport {\n DTOElementPropertyDefinitionCreatePayload,\n DTOElementPropertyDefinitionListResponse,\n DTOElementPropertyDefinitionResponse,\n DTOElementPropertyDefinitionUpdatePayload,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ElementPropertyDefinitionsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions`,\n DTOElementPropertyDefinitionListResponse\n );\n }\n\n create(designSystemId: string, versionId: string, body: DTOElementPropertyDefinitionCreatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions`,\n DTOElementPropertyDefinitionResponse,\n { method: \"POST\", body }\n );\n }\n\n update(designSystemId: string, versionId: string, defId: string, body: DTOElementPropertyDefinitionUpdatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,\n DTOElementPropertyDefinitionResponse,\n { method: \"PUT\", body }\n );\n }\n\n delete(designSystemId: string, versionId: string, defId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,\n z.any(),\n { method: \"DELETE\" }\n );\n }\n}\n","import {\n DTOElementPropertyValueListResponse,\n DTOElementPropertyValueResponse,\n DTOElementPropertyValueUpsertPaylod,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class ElementPropertyValuesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/values`,\n DTOElementPropertyValueListResponse\n );\n }\n\n upsert(designSystemId: string, versionId: string, body: DTOElementPropertyValueUpsertPaylod) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/element-properties/values`,\n DTOElementPropertyValueResponse,\n { method: \"POST\", body }\n );\n }\n}\n","import { DTODesignSystemVersionStats, DTODesignSystemVersionStatsQuery } from \"../../../dto/design-systems/stats\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class VersionStatsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(dsId: string, vId: string, query: DTODesignSystemVersionStatsQuery = {}) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/stats`, DTODesignSystemVersionStats, {\n query: new URLSearchParams(query),\n });\n }\n}\n","import { z } from \"zod\";\nimport { DTOThemeCreatePayload, DTOThemeListResponse, DTOThemeResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\nimport { OverridesEndpoint } from \"./overrides\";\n\nexport class ThemesEndpoint {\n readonly overrides: OverridesEndpoint;\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.overrides = new OverridesEndpoint(requestExecutor);\n }\n\n list(dsId: string, versionId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes`, DTOThemeListResponse);\n }\n\n get(dsId: string, versionId: string, themeId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`,\n DTOThemeResponse\n );\n }\n\n create(dsId: string, versionId: string, body: DTOThemeCreatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes`, DTOThemeResponse, {\n method: \"POST\",\n body,\n });\n }\n\n delete(dsId: string, versionId: string, themeId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z.any(), {\n method: \"DELETE\",\n });\n }\n}\n","import { DTOTokenCollectionsListReponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class TokenCollectionsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(designSystemId: string, versionId: string) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/token-collections`,\n DTOTokenCollectionsListReponse\n );\n }\n}\n","import {\n DTODesignTokenGroupCreatePayload,\n DTODesignTokenGroupListResponse,\n DTODesignTokenGroupResponse,\n} from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class TokenGroupsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, versionId: string, body: DTODesignTokenGroupCreatePayload) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/token-groups`,\n DTODesignTokenGroupResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n\n list(dsId: string, versionId: string): Promise<DTODesignTokenGroupListResponse> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/token-groups`,\n DTODesignTokenGroupListResponse\n );\n }\n}\n","import { DTODesignTokenCreatePayload, DTODesignTokenListResponse, DTODesignTokenResponse } from \"../../../dto\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\n\nexport class TokensEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, versionId: string, body: DTODesignTokenCreatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/tokens`, DTODesignTokenResponse, {\n method: \"POST\",\n body,\n });\n }\n\n list(dsId: string, versionId: string): Promise<DTODesignTokenListResponse> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/tokens`,\n DTODesignTokenListResponse\n );\n }\n\n get(dsId: string, versionId: string, tokenId: string): Promise<DTODesignTokenListResponse> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/tokens/${tokenId}`,\n DTODesignTokenListResponse\n );\n }\n}\n","import {\n DTODesignSystemVersionCreationResponse,\n DTODesignSystemVersionJobStatusResponse,\n DTODesignSystemVersionRoomResponse,\n DTODesignSystemVersionsListResponse,\n} from \"../../../dto\";\nimport { DTOCreateVersionInput } from \"../../../payloads\";\nimport { RequestExecutor } from \"../../../transport/request-executor\";\nimport { BrandsEndpoint } from \"./brands\";\nimport { DocumentationEndpoint } from \"./documentation\";\nimport { DesignSystemComponentEndpoint } from \"./ds-components\";\nimport { ElementsEndpoint } from \"./elements\";\nimport { ElementsActionEndpoint } from \"./elements-action\";\nimport { FigmaComponentGroupsEndpoint } from \"./figma-component-groups\";\nimport { FigmaComponentsEndpoint } from \"./figma-components\";\nimport { FigmaFrameStructuresEndpoint } from \"./figma-frame-structures\";\nimport { ImportJobsEndpoint } from \"./import-jobs\";\nimport { ElementPropertyDefinitionsEndpoint } from \"./property-definitions\";\nimport { ElementPropertyValuesEndpoint } from \"./property-values\";\nimport { VersionStatsEndpoint } from \"./stats\";\nimport { ThemesEndpoint } from \"./themes\";\nimport { TokenCollectionsEndpoint } from \"./token-collections\";\nimport { TokenGroupsEndpoint } from \"./token-groups\";\nimport { TokensEndpoint } from \"./tokens\";\nimport { CodeComponentsEndpoint } from \"./code-components\";\nimport { FilesEndpoint } from \"./files\";\n\nexport class DesignSystemVersionsEndpoint {\n readonly themes: ThemesEndpoint;\n readonly brands: BrandsEndpoint;\n readonly tokenCollections: TokenCollectionsEndpoint;\n readonly importJobs: ImportJobsEndpoint;\n readonly tokens: TokensEndpoint;\n readonly tokenGroups: TokenGroupsEndpoint;\n readonly figmaComponents: FigmaComponentsEndpoint;\n readonly figmaComponentGroups: FigmaComponentGroupsEndpoint;\n readonly figmaFrameStructures: FigmaFrameStructuresEndpoint;\n readonly stats: VersionStatsEndpoint;\n readonly elementPropertyDefinitions: ElementPropertyDefinitionsEndpoint;\n readonly elementPropertyValues: ElementPropertyValuesEndpoint;\n readonly elementsAction: ElementsActionEndpoint;\n readonly elements: ElementsEndpoint;\n readonly designSystemComponents: DesignSystemComponentEndpoint;\n readonly documentation: DocumentationEndpoint;\n readonly codeComponents: CodeComponentsEndpoint;\n readonly files: FilesEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.themes = new ThemesEndpoint(requestExecutor);\n this.brands = new BrandsEndpoint(requestExecutor);\n this.tokenCollections = new TokenCollectionsEndpoint(requestExecutor);\n this.importJobs = new ImportJobsEndpoint(requestExecutor);\n this.tokens = new TokensEndpoint(requestExecutor);\n this.tokenGroups = new TokenGroupsEndpoint(requestExecutor);\n this.figmaComponents = new FigmaComponentsEndpoint(requestExecutor);\n this.figmaComponentGroups = new FigmaComponentGroupsEndpoint(requestExecutor);\n this.figmaFrameStructures = new FigmaFrameStructuresEndpoint(requestExecutor);\n this.stats = new VersionStatsEndpoint(requestExecutor);\n this.elementPropertyDefinitions = new ElementPropertyDefinitionsEndpoint(requestExecutor);\n this.elementPropertyValues = new ElementPropertyValuesEndpoint(requestExecutor);\n this.elementsAction = new ElementsActionEndpoint(requestExecutor);\n this.elements = new ElementsEndpoint(requestExecutor);\n this.designSystemComponents = new DesignSystemComponentEndpoint(requestExecutor);\n this.documentation = new DocumentationEndpoint(requestExecutor);\n this.codeComponents = new CodeComponentsEndpoint(requestExecutor);\n this.files = new FilesEndpoint(requestExecutor);\n }\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions`, DTODesignSystemVersionsListResponse);\n }\n\n commit(dsId: string, body: DTOCreateVersionInput) {\n return this.requestExecutor.json(`/design-systems/${dsId}/head/commit`, DTODesignSystemVersionCreationResponse, {\n method: \"POST\",\n body,\n });\n }\n\n job(dsId: string, jobId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/jobs/${jobId}`,\n DTODesignSystemVersionJobStatusResponse\n );\n }\n\n room(dsId: string, vId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${vId}/room`,\n DTODesignSystemVersionRoomResponse\n );\n }\n}\n","import { DTODocumentationAnalyticsRequest, DTODocumentationPageAnalyticsResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemAnalyticsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n get(designSystemId: string, versionId: string, body: DTODocumentationAnalyticsRequest) {\n return this.requestExecutor.json(\n `/design-systems/${designSystemId}/versions/${versionId}/documentation/analytics`,\n DTODocumentationPageAnalyticsResponse,\n { method: \"POST\", body }\n );\n }\n}\n","import { DTOBffImportRequestBody, DTOImportJobResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemBffEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n import(dsId: string, payload: DTOBffImportRequestBody) {\n return this.requestExecutor.json(`/design-systems/${dsId}/bff/import`, DTOImportJobResponse, {\n method: \"POST\",\n body: payload,\n });\n }\n}\n","import { DTODesignSystemContactsResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemContactsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/contacts`, DTODesignSystemContactsResponse, {\n method: \"GET\",\n });\n }\n}\n","import { z } from \"zod\";\nimport {\n DTODesignSystemCreateInput,\n DTODesignSystemResponse,\n DTODesignSystemsListResponse,\n DTOUserDesignSystemsResponse,\n} from \"../../dto\";\nimport { DTODesignSystemUpdateAccessModeInput, DTODesignSystemUpdateInput } from \"../../payloads\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\nimport { DesignSystemBffEndpoint } from \"./bff\";\nimport { DesignSystemContactsEndpoint } from \"./contact\";\nimport { FigmaNodeStructuresEndpoint } from \"./figma-node-structures\";\nimport { DesignSystemMembersEndpoint } from \"./members\";\nimport { DesignSystemPageRedirectsEndpoint } from \"./redirects\";\nimport { DesignSystemSourcesEndpoint } from \"./sources\";\nimport { StorybookEntriesEndpoint } from \"./storybook\";\nimport { DesignSystemVersionsEndpoint } from \"./versions/versions\";\nimport { DesignSystemAnalyticsEndpoint } from \"./analytics\";\nimport { StorybookHostingEndpoint } from \"./storybook-hosting\";\n\nexport class DesignSystemsEndpoint {\n readonly members: DesignSystemMembersEndpoint;\n readonly versions: DesignSystemVersionsEndpoint;\n readonly bff: DesignSystemBffEndpoint;\n readonly sources: DesignSystemSourcesEndpoint;\n readonly storybook: StorybookEntriesEndpoint;\n readonly storybookHosting: StorybookHostingEndpoint;\n readonly contacts: DesignSystemContactsEndpoint;\n readonly redirects: DesignSystemPageRedirectsEndpoint;\n readonly figmaNodeStructures: FigmaNodeStructuresEndpoint;\n readonly analytics: DesignSystemAnalyticsEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.members = new DesignSystemMembersEndpoint(requestExecutor);\n this.versions = new DesignSystemVersionsEndpoint(requestExecutor);\n this.bff = new DesignSystemBffEndpoint(requestExecutor);\n this.sources = new DesignSystemSourcesEndpoint(requestExecutor);\n this.storybook = new StorybookEntriesEndpoint(requestExecutor);\n this.storybookHosting = new StorybookHostingEndpoint(requestExecutor);\n this.contacts = new DesignSystemContactsEndpoint(requestExecutor);\n this.redirects = new DesignSystemPageRedirectsEndpoint(requestExecutor);\n this.figmaNodeStructures = new FigmaNodeStructuresEndpoint(requestExecutor);\n this.analytics = new DesignSystemAnalyticsEndpoint(requestExecutor);\n }\n\n create(body: DTODesignSystemCreateInput) {\n return this.requestExecutor.json(\"/design-systems\", DTODesignSystemResponse, { method: \"POST\", body });\n }\n\n list(wsId: string) {\n return this.requestExecutor.json(`/workspaces/${wsId}/design-systems`, DTODesignSystemsListResponse);\n }\n\n listUserDesignSystems() {\n return this.requestExecutor.json(\"/design-systems\", DTOUserDesignSystemsResponse);\n }\n\n get(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);\n }\n\n delete(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}`, z.any(), { method: \"DELETE\" });\n }\n\n update(dsId: string, body: DTODesignSystemUpdateInput) {\n return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {\n method: \"PUT\",\n body,\n });\n }\n\n updateAccessMode(dsId: string, body: DTODesignSystemUpdateAccessModeInput) {\n return this.requestExecutor.json(`/design-systems/${dsId}/access-mode`, DTODesignSystemResponse, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { DTOFigmaNodeStructureDetailResponse, DTOFigmaNodeStructureListResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class FigmaNodeStructuresEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/figma-node-structures`,\n DTOFigmaNodeStructureListResponse\n );\n }\n\n get(dsId: string, structureId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/figma-node-structures/${structureId}`,\n DTOFigmaNodeStructureDetailResponse\n );\n }\n}\n","import {\n DTODesignSystemMemberListResponse,\n DTODesignSystemMembersUpdatePayload,\n DTODesignSystemMembersUpdateResponse,\n DTOUserGetResponse,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemMembersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMemberListResponse, {\n method: \"GET\",\n });\n }\n\n update(dsId: string, body: DTODesignSystemMembersUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMembersUpdateResponse, {\n method: \"POST\",\n body,\n });\n }\n}\n","import {\n DTOPageRedirectDeleteResponse,\n DTOPageRedirectListResponse,\n DTOPageRedirectResponse,\n DTOPageRedirectCreateBody,\n DTOPageRedirectUpdateBody,\n} from \"../../dto/design-systems/redirects\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemPageRedirectsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, body: DTOPageRedirectCreateBody) {\n return this.requestExecutor.json(`/design-systems/${dsId}/documentation/redirects`, DTOPageRedirectResponse, {\n body,\n method: \"POST\",\n });\n }\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/documentation/redirects`, DTOPageRedirectListResponse, {\n method: \"GET\",\n });\n }\n\n update(dsId: string, redirectId: string, body: DTOPageRedirectUpdateBody) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/documentation/redirects/${redirectId}`,\n DTOPageRedirectResponse,\n {\n body,\n method: \"PUT\",\n }\n );\n }\n\n delete(dsId: string, redirectId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/documentation/redirects/${redirectId}`,\n DTOPageRedirectDeleteResponse,\n {\n method: \"DELETE\",\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport {\n DTODataSourceFigmaCreatePayload,\n DTODataSourceFigmaImportPayload,\n DTODataSourceResponse,\n DTODataSourcesListResponse,\n DTODataSourcesStorybookResponse,\n DTODataSourceStorybookCreatePayload,\n DTOFigmaSourceUpdatePayload,\n DTOImportJobResponse,\n DTOStorybookImportPayload,\n DTOStorybookSourceUpdatePayload,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class DesignSystemSourcesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n create(dsId: string, payload: DTODataSourceFigmaCreatePayload | DTODataSourceStorybookCreatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourceResponse, {\n method: \"POST\",\n body: payload,\n });\n }\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);\n }\n\n get(dsId: string, sourceId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse);\n }\n\n delete(dsId: string, sourceId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z.any(), { method: \"DELETE\" });\n }\n\n updateFigmaSource(dsId: string, sourceId: string, payload: DTOFigmaSourceUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse, {\n method: \"PUT\",\n body: payload,\n });\n }\n\n updateStorybookSource(dsId: string, sourceId: string, payload: DTOStorybookSourceUpdatePayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse, {\n method: \"PUT\",\n body: payload,\n });\n }\n\n figmaImport(dsId: string, payload: DTODataSourceFigmaImportPayload) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/cloud-import`, DTOImportJobResponse, {\n method: \"POST\",\n body: payload,\n });\n }\n\n storybookImport(dsId: string, payload: DTOStorybookImportPayload) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/head/storybook-import`,\n DTODataSourcesStorybookResponse,\n {\n method: \"POST\",\n body: payload,\n }\n );\n }\n\n updateStorybookImport(dsId: string, versionId: string, payload: DTOStorybookImportPayload) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/${versionId}/storybook-import`,\n DTODataSourcesStorybookResponse,\n {\n method: \"POST\",\n body: payload,\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport { DTOStorybookEntryListResponse, DTOStorybookEntryReplaceAction } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class StorybookEntriesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(dsId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook`, DTOStorybookEntryListResponse);\n }\n\n replace(dsId: string, entryId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/versions/head/storybook/${entryId}`,\n DTOStorybookEntryReplaceAction,\n { method: \"PUT\" }\n );\n }\n\n delete(dsId: string, entryId: string) {\n return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook/${entryId}`, z.any(), {\n method: \"DELETE\",\n });\n }\n}\n","import { z } from \"zod\";\nimport {\n DTOStorybookAccessTokenResponse,\n DTOStorybookUploadStatus,\n DTOStorybookUploadUrlRequest,\n DTOStorybookUploadUrlResponse,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class StorybookHostingEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getSignedUploadUrl(dsId: string, body: DTOStorybookUploadUrlRequest): Promise<DTOStorybookUploadUrlResponse> {\n return this.requestExecutor.json(`/design-systems/${dsId}/storybook/upload`, DTOStorybookUploadUrlResponse, {\n body,\n method: \"POST\",\n });\n }\n\n delete(dsId: string, storybookUploadId: string): Promise<{ ok: boolean }> {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/storybook/${storybookUploadId}`,\n z.object({ ok: z.boolean() }),\n {\n method: \"DELETE\",\n }\n );\n }\n\n getUploadStatus(dsId: string, storybookUploadId: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/storybook/${storybookUploadId}/status`,\n DTOStorybookUploadStatus\n );\n }\n\n getAccessToken(dsId: string, name: string) {\n return this.requestExecutor.json(\n `/design-systems/${dsId}/storybook/alias/${name}/access-token`,\n DTOStorybookAccessTokenResponse\n );\n }\n}\n","import { z } from \"zod\";\nimport {\n DTOForgeChatMessageCreateInput,\n DTOForgeChatMessageCreateResponse,\n DTOForgeChatMessageListQuery,\n DTOForgeChatMessageListResponse,\n DTOForgeChatThreadCreateInput,\n DTOForgeChatThreadCreateResponse,\n DTOForgeChatThreadDeleteResponse,\n DTOForgeChatThreadListQuery,\n DTOForgeChatThreadListResponse,\n DTOForgeChatThreadUpdateInput,\n DTOForgeChatThreadUpdateResponse,\n} from \"../../dto/workspaces/chat-threads\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class WorkspaceChatThreadsEndpoint {\n readonly messages: ChatThreadMessagesEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.messages = new ChatThreadMessagesEndpoint(requestExecutor);\n }\n\n create(workspaceId: string, body: DTOForgeChatThreadCreateInput) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads`, DTOForgeChatThreadCreateResponse, {\n method: \"POST\",\n body,\n });\n }\n\n list(workspaceId: string, query?: DTOForgeChatThreadListQuery) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads`, DTOForgeChatThreadListResponse, {\n query: query\n ? new URLSearchParams({\n ...(query.limit !== undefined && { limit: query.limit.toString() }),\n ...(query.offset !== undefined && { offset: query.offset.toString() }),\n })\n : undefined,\n });\n }\n\n update(workspaceId: string, threadId: string, body: DTOForgeChatThreadUpdateInput) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/forge/threads/${threadId}`,\n DTOForgeChatThreadUpdateResponse,\n {\n method: \"PUT\",\n body,\n }\n );\n }\n\n delete(workspaceId: string, threadId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads/${threadId}`, z.any(), {\n method: \"DELETE\",\n });\n }\n}\n\nexport class ChatThreadMessagesEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string, threadId: string, query?: DTOForgeChatMessageListQuery) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/forge/threads/${threadId}/messages`,\n DTOForgeChatMessageListResponse,\n {\n query: query\n ? new URLSearchParams({\n ...(query.limit !== undefined && { limit: query.limit.toString() }),\n ...(query.offset !== undefined && { offset: query.offset.toString() }),\n })\n : undefined,\n }\n );\n }\n\n create(workspaceId: string, threadId: string, body: DTOForgeChatMessageCreateInput) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/forge/threads/${threadId}/messages`,\n DTOForgeChatMessageCreateResponse,\n {\n method: \"POST\",\n body,\n }\n );\n }\n}\n","import { z } from \"zod\";\nimport { DTOIntegrationsGetListResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\n\nexport class WorkspaceIntegrationsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(wsId: string) {\n return this.requestExecutor.json(`/workspaces/${wsId}/integrations`, DTOIntegrationsGetListResponse);\n }\n\n delete(wsId: string, iId: string) {\n return this.requestExecutor.json(`/workspaces/${wsId}/integrations/${iId}`, z.unknown(), { method: \"DELETE\" });\n }\n}\n","import {\n DTOWorkspaceInvitationsResponse,\n DTOWorkspaceInvitationUpdateResponse,\n DTOWorkspaceInviteUpdate,\n DTOWorkspaceResponse,\n} from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class WorkspaceInvitationsEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n update(workspaceId: string, invitationId: string, body: DTOWorkspaceInviteUpdate) {\n return this.requestExecutor.json(\n `/workspaces/${workspaceId}/invitations/${invitationId}/role`,\n DTOWorkspaceInvitationUpdateResponse,\n {\n method: \"PUT\",\n body,\n }\n );\n }\n\n list(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/invitations`, DTOWorkspaceInvitationsResponse, {\n method: \"GET\",\n });\n }\n\n delete(workspaceId: string, invitationId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/invitations/${invitationId}`, DTOWorkspaceResponse, {\n method: \"DELETE\",\n });\n }\n}\n","import { UpdateMembershipRolesInput } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\nimport { DTOWorkspaceInvitationsListInput, DTOWorkspaceMembersListResponse, DTOWorkspaceResponse } from \"../../dto\";\nimport { RequestExecutor } from \"../../transport\";\n\nexport class WorkspaceMembersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n list(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, DTOWorkspaceMembersListResponse, {\n method: \"GET\",\n });\n }\n\n update(workspaceId: string, body: UpdateMembershipRolesInput) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members/role`, DTOWorkspaceResponse, {\n method: \"PUT\",\n body,\n });\n }\n\n invite(workspaceId: string, body: DTOWorkspaceInvitationsListInput) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z.any(), { method: \"POST\", body });\n }\n\n delete(workspaceId: string, userId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/members/${userId}`, DTOWorkspaceResponse, {\n method: \"DELETE\",\n });\n }\n}\n","import { RequestExecutor } from \"../../transport/request-executor\";\nimport { DTONpmRegistryAccessTokenResponse, DTOUpdateRegistryInput, DTOUpdateRegistryOutput } from \"../../dto\";\n\nexport class WorkspaceNpmRegistryEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getAccessToken(wsId: string) {\n return this.requestExecutor.json(\n `/workspaces/${wsId}/npm-registry/access-token`,\n DTONpmRegistryAccessTokenResponse\n );\n }\n\n update(wsId: string, body: DTOUpdateRegistryInput) {\n return this.requestExecutor.json(`/workspaces/${wsId}/npm-registry`, DTOUpdateRegistryOutput, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { z } from \"zod\";\nimport { DTOUserWorkspaceMembershipsResponse, DTOWorkspaceCreateInput, DTOWorkspaceResponse } from \"../../dto\";\nimport { DTOTransferOwnershipPayload } from \"../../payloads\";\nimport { RequestExecutor } from \"../../transport/request-executor\";\nimport { WorkspaceChatThreadsEndpoint } from \"./chat-threads\";\nimport { WorkspaceIntegrationsEndpoint } from \"./integrations\";\nimport { WorkspaceInvitationsEndpoint } from \"./invites\";\nimport { WorkspaceMembersEndpoint } from \"./members\";\nimport { WorkspaceNpmRegistryEndpoint } from \"./npm-register\";\n\n// TODO Response types\nexport class WorkspacesEndpoint {\n public members: WorkspaceMembersEndpoint;\n public invitations: WorkspaceInvitationsEndpoint;\n public npmRegistry: WorkspaceNpmRegistryEndpoint;\n public chatThreads: WorkspaceChatThreadsEndpoint;\n integrations: WorkspaceIntegrationsEndpoint;\n\n constructor(private readonly requestExecutor: RequestExecutor) {\n this.members = new WorkspaceMembersEndpoint(requestExecutor);\n this.invitations = new WorkspaceInvitationsEndpoint(requestExecutor);\n this.integrations = new WorkspaceIntegrationsEndpoint(requestExecutor);\n this.npmRegistry = new WorkspaceNpmRegistryEndpoint(requestExecutor);\n this.chatThreads = new WorkspaceChatThreadsEndpoint(requestExecutor);\n }\n\n create(body: DTOWorkspaceCreateInput) {\n return this.requestExecutor.json(\"/workspaces\", DTOWorkspaceResponse, {\n method: \"POST\",\n body: {\n ...body,\n product: \"free\",\n priceId: \"yearly\",\n },\n });\n }\n\n list() {\n return this.requestExecutor.json(`/workspaces`, DTOUserWorkspaceMembershipsResponse, { method: \"GET\" });\n }\n\n get(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}`, DTOWorkspaceResponse, { method: \"GET\" });\n }\n\n delete(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}`, z.any(), { method: \"DELETE\" });\n }\n\n subscription(workspaceId: string) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z.any(), { method: \"GET\" });\n }\n\n transferOwnership(workspaceId: string, body: DTOTransferOwnershipPayload) {\n return this.requestExecutor.json(`/workspaces/${workspaceId}/ownership`, DTOWorkspaceResponse, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { DTOLiveblocksAuthResponse } from \"../dto\";\nimport { DTOLiveblocksAuthRequest } from \"../payloads\";\nimport { RequestExecutor } from \"../transport/request-executor\";\n\nexport class LiveblocksEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n auth(body: DTOLiveblocksAuthRequest) {\n return this.requestExecutor.json(\"/liveblocks/auth\", DTOLiveblocksAuthResponse, {\n method: \"POST\",\n body,\n });\n }\n}\n","import { DTOUserProfileUpdate, DTOUserWorkspaceMembershipsResponse } from \"../dto\";\nimport { DTOAuthenticatedUserResponse } from \"../dto/users/authenticated-user\";\nimport { RequestExecutor } from \"../transport/request-executor\";\n\nexport class UsersEndpoint {\n constructor(private readonly requestExecutor: RequestExecutor) {}\n\n getMe() {\n return this.requestExecutor.json(\"/users/me\", DTOAuthenticatedUserResponse);\n }\n\n listWorkspaces(uid: string) {\n return this.requestExecutor.json(`/users/${uid}/workspaces`, DTOUserWorkspaceMembershipsResponse);\n }\n\n delete(uid: string) {\n return this.requestExecutor.json(`/users/${uid}`, DTOAuthenticatedUserResponse, { method: \"DELETE\" });\n }\n\n updateProfile(uid: string, body: DTOUserProfileUpdate) {\n return this.requestExecutor.json(`/users/${uid}/profile`, DTOAuthenticatedUserResponse, {\n method: \"PUT\",\n body,\n });\n }\n}\n","import { SupernovaExceptionType } from \"@supernova-studio/model\";\n\nexport type RequestExecutorErrorType = \"ServerError\" | \"ResponseParsingError\";\nexport type RequestEexecutorServerErrorCode = SupernovaExceptionType | undefined;\n\nexport class RequestExecutorError extends Error {\n readonly type: RequestExecutorErrorType;\n readonly errorCode: RequestEexecutorServerErrorCode | undefined;\n readonly serverErrorType: SupernovaExceptionType | undefined;\n\n static tryParseErrorCode(body: string) {\n try {\n const errorObj = JSON.parse(body);\n if (errorObj && typeof errorObj.errorCode === \"string\") {\n return errorObj.errorCode;\n }\n return null;\n } catch (e) {\n return null;\n }\n }\n\n static tryParseServerErrorType(body: string) {\n try {\n const errorObj = JSON.parse(body);\n if (errorObj && typeof errorObj.errorCode === \"string\") {\n return errorObj.type;\n }\n return null;\n } catch (e) {\n return null;\n }\n }\n\n static serverError(endpoint: string, status: number, bodyText: string) {\n return new RequestExecutorError(\n \"ServerError\",\n `Endpoint ${endpoint} returned ${status}\\n${bodyText}`,\n this.tryParseErrorCode(bodyText),\n this.tryParseServerErrorType(bodyText)\n );\n }\n\n static responseParsingError(endpoint: string, cause: Error) {\n return new RequestExecutorError(\n \"ResponseParsingError\",\n `Endpoint ${endpoint} returned incompatible JSON`,\n undefined,\n undefined,\n cause\n );\n }\n\n private constructor(\n type: RequestExecutorErrorType,\n message: string,\n errorCode: RequestEexecutorServerErrorCode | undefined,\n serverErrorType?: SupernovaExceptionType | undefined,\n cause?: unknown\n ) {\n super(`${type}: ${message}`, { cause });\n this.type = type;\n this.errorCode = errorCode;\n this.serverErrorType = serverErrorType;\n }\n}\n","import fetch, { RequestInit } from \"node-fetch\";\nimport { z, ZodSchema, ZodTypeDef } from \"zod\";\nimport { RequestExecutorError } from \"./request-executor-error\";\n\nexport type RequestExecutorConfig = {\n host: string;\n accessToken?: string;\n};\n\nexport type RequestExecutorJSONRequest = Omit<RequestInit, \"body\"> & {\n body?: object;\n query?: URLSearchParams;\n};\n\nconst ResponseWrapper = z.object({\n result: z.record(z.any()),\n});\n\nexport class RequestExecutor {\n private readonly testServerConfig: RequestExecutorConfig;\n\n constructor(testServerConfig: RequestExecutorConfig) {\n this.testServerConfig = testServerConfig;\n }\n\n async json<O, I>(\n path: `/${string}`,\n schema: ZodSchema<O, ZodTypeDef, I>,\n requestInit: RequestExecutorJSONRequest = {}\n ) {\n // Headers\n const defaultHeaders: Record<string, string> = {\n Accept: \"application/json\",\n };\n\n if (requestInit.body) defaultHeaders[\"Content-Type\"] = \"application/json\";\n if (this.testServerConfig.accessToken) {\n defaultHeaders[\"Authorization\"] = `Bearer ${this.testServerConfig.accessToken}`;\n }\n\n // Body\n let body: string | undefined;\n if (requestInit.body && typeof requestInit.body === \"object\") body = JSON.stringify(requestInit.body);\n\n const response = await fetch(this.fullUrl(path, requestInit.query), {\n ...requestInit,\n headers: {\n ...requestInit.headers,\n ...defaultHeaders,\n },\n body: body,\n });\n\n const endpoint = `${requestInit.method ?? \"GET\"} ${path}`;\n\n if (!response.ok) {\n const bodyString = await response.text();\n throw RequestExecutorError.serverError(endpoint, response.status, bodyString);\n }\n\n const json = await response.json();\n const wrapperParseResult = ResponseWrapper.safeParse(json);\n if (!wrapperParseResult.success) {\n console.error(`Response was:`);\n console.error(json);\n throw RequestExecutorError.responseParsingError(endpoint, wrapperParseResult.error);\n }\n\n const responseParseResult = schema.safeParse(wrapperParseResult.data.result);\n if (!responseParseResult.success) {\n console.error(`Response was:`);\n console.error(wrapperParseResult.data.result);\n throw RequestExecutorError.responseParsingError(endpoint, responseParseResult.error);\n }\n\n return responseParseResult.data;\n }\n\n private fullUrl(path: string, query: URLSearchParams | undefined): string {\n let url = `https://${this.testServerConfig.host}/api/v2${path}`;\n\n const queryString = query?.toString();\n if (queryString) url += `?${queryString}`;\n\n return url;\n }\n}\n","import { CodegenEndpoint, WorkspacesEndpoint } from \"./endpoints\";\nimport { DesignSystemsEndpoint } from \"./endpoints/design-system\";\nimport { LiveblocksEndpoint } from \"./endpoints/liveblocks\";\nimport { UsersEndpoint } from \"./endpoints/users\";\nimport { RequestExecutor } from \"./transport/request-executor\";\n\ntype SupernovaApiClientConfig = {\n host: string;\n accessToken: string;\n};\n\nexport class SupernovaApiClient {\n readonly users: UsersEndpoint;\n readonly workspaces: WorkspacesEndpoint;\n readonly designSystems: DesignSystemsEndpoint;\n readonly codegen: CodegenEndpoint;\n readonly liveblocks: LiveblocksEndpoint;\n\n constructor(readonly config: SupernovaApiClientConfig) {\n const requestExecutor = new RequestExecutor({\n host: config.host,\n accessToken: config.accessToken,\n });\n\n this.users = new UsersEndpoint(requestExecutor);\n this.workspaces = new WorkspacesEndpoint(requestExecutor);\n this.designSystems = new DesignSystemsEndpoint(requestExecutor);\n this.codegen = new CodegenEndpoint(requestExecutor);\n this.liveblocks = new LiveblocksEndpoint(requestExecutor);\n }\n}\n","import { DataSourceRemoteType } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DTOEventFigmaNodesRendered = z.object({\n type: z.literal(\"DesignSystem.FigmaNodesRendered\"),\n designSystemId: z.string(),\n versionId: z.string(),\n figmaNodePersistentIds: z.string().array(),\n});\n\nexport const DTOEventDataSourcesImported = z.object({\n type: z.literal(\"DesignSystem.ImportJobFinished\"),\n designSystemId: z.string(),\n versionId: z.string(),\n importJobId: z.string(),\n dataSourceType: DataSourceRemoteType,\n dataSourceIds: z.string().array(),\n});\n\nexport type DTOEventFigmaNodesRendered = z.infer<typeof DTOEventFigmaNodesRendered>;\nexport type DTOEventDataSourcesImported = z.infer<typeof DTOEventDataSourcesImported>;\n","import { z } from \"zod\";\nimport { DTOEventDataSourcesImported, DTOEventFigmaNodesRendered } from \"./design-system\";\n\nexport const DTOEvent = z.discriminatedUnion(\"type\", [DTOEventDataSourcesImported, DTOEventFigmaNodesRendered]);\n\nexport type DTOEvent = z.infer<typeof DTOEvent>;\n","import { OmitStrict } from \"@supernova-studio/model\";\nimport PQueue from \"p-queue\";\nimport * as Y from \"yjs\";\nimport {\n DTODocumentationHierarchyV2,\n DTODocumentationSettings,\n DTOElementActionInput,\n DTOElementActionInputOfType,\n DTOPageBlockDefinition,\n} from \"../api\";\nimport { DocumentationPageEditorModel, generatePageContentHash, VersionRoomBaseYDoc } from \"../yjs\";\nimport { computeDocsHierarchy } from \"../yjs/version-room/compute-dto\";\nimport { VersionRoomBaseYDocState } from \"../yjs/version-room/types\";\nimport { applyActionsLocally } from \"./local-action-executor\";\nimport { SupportedActionType } from \"./types\";\n\ntype YObserver = () => void;\ntype HierarchyObserver = (hierarchy: DTODocumentationHierarchyV2) => void;\ntype SettingsObserver = (settings: DTODocumentationSettings) => void;\ntype ErrorObserver<T> = (error: unknown, actionMetadata: T | undefined) => void;\n\ntype TransactionExecutor = (trx: DTOElementActionInput) => Promise<void>;\ntype InternalTransactionExecutor<T> = (trx: InternalAction<T>) => Promise<void>;\ntype TransactionIdGenerator = () => string;\n\ntype Action = DTOElementActionInputOfType<SupportedActionType>;\ntype InputAction<T> = OmitStrict<Action, \"tId\">;\ntype InternalAction<T> = { action: Action; metadata?: T };\n\nexport class DocsStructureRepository<T> {\n private userId: string;\n private designSystemVersionId: string;\n\n private readonly yDoc: Y.Doc;\n private readonly yObserver: YObserver;\n private _yState: VersionRoomBaseYDocState | undefined;\n\n private _currentHierarchy: DTODocumentationHierarchyV2 | undefined;\n private _currentSettings: DTODocumentationSettings | undefined;\n\n private localActions: DTOElementActionInput[] = [];\n private readonly actionQueue: TransactionQueue<T>;\n private readonly hierarchyObservers = new Set<HierarchyObserver>();\n private readonly settingsObservers = new Set<SettingsObserver>();\n private readonly errorObservers = new Set<ErrorObserver<T>>();\n private readonly initCallbacks = new Set<() => void>();\n\n private readonly transactionIdGenerator: TransactionIdGenerator;\n private readonly transactionExecutor: TransactionExecutor;\n\n constructor(config: {\n userId: string;\n designSystemVersionId: string;\n yDoc: Y.Doc;\n transactionExecutor: TransactionExecutor;\n transactionIdGenerator: TransactionIdGenerator;\n }) {\n this.userId = config.userId;\n this.designSystemVersionId = config.designSystemVersionId;\n this.yDoc = config.yDoc;\n\n this.yObserver = this.yDoc.on(\"update\", () => this.onYUpdate()) as YObserver;\n this.onYUpdate();\n\n this.transactionExecutor = config.transactionExecutor;\n this.transactionIdGenerator = config.transactionIdGenerator;\n\n this.actionQueue = new TransactionQueue(action => this.executeInternalAction(action));\n }\n\n //\n // Lifecycle\n //\n\n get isInitialized(): boolean {\n return !!this._currentHierarchy;\n }\n\n onInitialized(): Promise<void> {\n if (this.isInitialized) return Promise.resolve();\n return new Promise(resolve => {\n this.initCallbacks.add(resolve);\n });\n }\n\n addHierarchyObserver(observer: HierarchyObserver) {\n this.hierarchyObservers.add(observer);\n if (this._currentHierarchy) observer(this._currentHierarchy);\n }\n\n removeHierarchyObserver(observer: HierarchyObserver) {\n this.hierarchyObservers.delete(observer);\n }\n\n addSettingsObserver(observer: SettingsObserver) {\n this.settingsObservers.add(observer);\n if (this._currentSettings) observer(this._currentSettings);\n }\n\n removeSettingsObserver(observer: SettingsObserver) {\n this.settingsObservers.delete(observer);\n }\n\n addErrorObserver(observer: ErrorObserver<T>) {\n this.errorObservers.add(observer);\n }\n\n removeErrorObserver(observer: ErrorObserver<T>) {\n this.errorObservers.delete(observer);\n }\n\n dispose() {\n this.yDoc.off(\"update\", this.yObserver);\n this.hierarchyObservers.clear();\n this.settingsObservers.clear();\n this.errorObservers.clear();\n this.actionQueue.clear();\n }\n\n //\n // Accessors\n //\n\n get currentHierarchy(): DTODocumentationHierarchyV2 {\n const hierarchy = this._currentHierarchy;\n if (!hierarchy) throw new Error(`Hierarchy cannot be accessed while it's still loading`);\n return hierarchy;\n }\n\n //\n // Actions\n //\n\n executeAction(action: InputAction<T>, metadata?: T) {\n void this.executeActionPromise(action, metadata);\n }\n\n executeActionPromise(action: InputAction<T>, metadata?: T) {\n const fullAction: DTOElementActionInput = { ...action, tId: this.transactionIdGenerator() };\n this.localActions.push(fullAction);\n this.refreshHierarchy();\n return this.actionQueue.enqueue({ action: fullAction, metadata });\n }\n\n notifyPageContentUpdated(\n pagePersistentId: string,\n content: DocumentationPageEditorModel,\n definitions: DTOPageBlockDefinition[]\n ) {\n const pageContentHash = generatePageContentHash(content, definitions);\n new VersionRoomBaseYDoc(this.yDoc).updateDocumentationPageContentHashes({\n [pagePersistentId]: pageContentHash,\n });\n }\n\n private async executeInternalAction(action: InternalAction<T>) {\n try {\n return await this.transactionExecutor(action.action);\n } catch (e: unknown) {\n // Remove this action from local actions and reload hierarchy\n this.localActions = this.localActions.filter(a => a.tId !== action.action.tId);\n this.refreshHierarchy();\n\n this.errorObservers.forEach(o => o(e, action.metadata));\n }\n }\n\n //\n // Reactions\n //\n\n private refreshState() {\n this.refreshHierarchy();\n this.refreshSettings();\n }\n\n private refreshSettings() {\n const yState = this._yState;\n if (!yState) return;\n\n // Calculate new settings\n const newSettings: DTODocumentationSettings = {\n isApprovalRequiredForPublishing: yState.settings.approvalRequiredForPublishing,\n isApprovalsFeatureEnabled: yState.settings.isApprovalFeatureEnabled,\n isDraftFeatureAdopted: yState.settings.isDraftFeatureAdopted,\n };\n\n // Only invoke when changed\n if (\n !this._currentSettings ||\n newSettings.isApprovalRequiredForPublishing !== this._currentSettings.isApprovalRequiredForPublishing ||\n newSettings.isApprovalsFeatureEnabled !== this._currentSettings.isApprovalsFeatureEnabled ||\n newSettings.isDraftFeatureAdopted !== this._currentSettings.isDraftFeatureAdopted\n ) {\n this._currentSettings = newSettings;\n\n // Invoke observers\n this.settingsObservers.forEach(o => o(newSettings));\n }\n }\n\n private refreshHierarchy() {\n const yState = this._yState;\n if (!yState) return;\n\n // Calculate new hierarchy\n const hierarchy = this.calculateHierarchy(yState);\n if (!hierarchy) return;\n this._currentHierarchy = hierarchy;\n\n // Invoke observers\n this.hierarchyObservers.forEach(o => o(hierarchy));\n }\n\n private calculateHierarchy(yState: VersionRoomBaseYDocState) {\n // Remove local actions that have been applied remotely\n const executedTransactionIds = new Set(yState.executedTransactionIds);\n const localActions = this.localActions.filter(a => a.tId && !executedTransactionIds.has(a.tId));\n this.localActions = localActions;\n\n // Apply local actions onto the Yjs state\n const { pages, groups, approvals, pageLiveblockRoomIds } = applyActionsLocally({\n userId: this.userId,\n designSystemVersionId: this.designSystemVersionId,\n remoteState: yState,\n actions: localActions,\n });\n\n const hierarchy = computeDocsHierarchy(\n {\n // Merged remote + local\n pages,\n groups,\n approvals,\n pageLiveblockRoomIds,\n\n // Remote only\n groupSnapshots: yState.groupSnapshots,\n pageContentHashes: yState.pageContentHashes,\n pageSnapshots: yState.pageSnapshots,\n settings: yState.settings,\n },\n { includeDeletedContent: true }\n );\n\n return hierarchy;\n }\n\n private onYUpdate() {\n const newState = new VersionRoomBaseYDoc(this.yDoc).getState();\n if (newState.groups.length) {\n this._yState = newState;\n this.refreshState();\n\n // Flush init callbacks\n this.initCallbacks.forEach(f => f());\n this.initCallbacks.clear();\n }\n }\n}\n\nclass TransactionQueue<T> {\n private readonly executor: InternalTransactionExecutor<T>;\n private readonly queue = new PQueue({\n concurrency: 1,\n });\n\n constructor(executor: InternalTransactionExecutor<T>) {\n this.executor = executor;\n }\n\n enqueue(trx: InternalAction<T>) {\n return this.queue.add(() => this.executor(trx));\n }\n\n onEmpty() {\n return this.queue.onEmpty();\n }\n\n clear() {\n this.queue.clear();\n }\n}\n","import * as Y from \"yjs\";\nimport { z } from \"zod\";\nimport { DTODocumentationHierarchyV2 } from \"../../api\";\nimport { FrontendVersionRoomYDoc } from \"../version-room/frontend\";\n\n// We store pages and groups in the same way they are stored in the database.\n// This means that instead of groups having childrenIds array, all items have\n// parentPersistentId property that points to the parent item in the tree.\n// Upon read this gets converted to the format that client expects, which is\n// ordered childrenIds array on all groups.\n//\n// The decision behind it is that we potentially want to get rid of childrenIds\n// array entirely because it makes group updates more complicated. For now\n// resolving it on fly is a tradeoff for not rewriting client to stop relying\n// on children ids array.\n\n//\n// Types\n//\n\nexport const DocumentationHierarchySettings = z.object({\n routingVersion: z.string(),\n isDraftFeatureAdopted: z.boolean(),\n isApprovalFeatureEnabled: z.boolean(),\n approvalRequiredForPublishing: z.boolean(),\n});\n\nexport type DocumentationHierarchySettings = z.infer<typeof DocumentationHierarchySettings>;\n\n/**\n * @deprecated - Use FrontendVersionRoomYDoc.getDocumentationHierarchy\n */\nexport function yjsToDocumentationHierarchy(doc: Y.Doc): DTODocumentationHierarchyV2 {\n return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();\n}\n","import {\n DocumentationPageApproval,\n DocumentationPageSnapshot,\n DocumentationPageV2,\n ElementGroup,\n ElementGroupSnapshot,\n} from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { ZodSchema, ZodTypeDef } from \"zod\";\nimport { DocumentationHierarchySettings } from \"../design-system-content\";\nimport { VersionRoomBaseYDocState } from \"./types\";\n\ntype YJSSerializable = { id: string };\n\nexport class VersionRoomBaseYDoc {\n private readonly yDoc: Y.Doc;\n\n constructor(yDoc: Y.Doc) {\n this.yDoc = yDoc;\n }\n\n getState(): VersionRoomBaseYDocState {\n // For backward compatibility we are using groups array to determine if Y doc content\n // was loaded: if the content was loaded there has to be at least one (root) group in\n // the doc. To be improved later if needed.\n\n const groups = this.getGroups();\n const isLoaded = !!groups.length;\n\n return {\n isLoaded,\n groups,\n pages: this.getPages(),\n approvals: this.getApprovals(),\n groupSnapshots: this.getGroupSnapshots(),\n pageContentHashes: this.getDocumentationPageContentHashes(),\n pageSnapshots: this.getPageSnapshots(),\n settings: this.getDocumentationInternalSettings(),\n pageLiveblockRoomIds: this.getDocumentationPageLiveblocksRoomIds(),\n executedTransactionIds: this.getExecutedTransactionIds(),\n };\n }\n\n //\n // Pages\n //\n\n getPages(): DocumentationPageV2[] {\n return this.getObjects(this.pagesYMap, DocumentationPageV2);\n }\n\n updatePages(pages: DocumentationPageV2[]) {\n pages = pages.map(page => {\n // We remove blocks from the payload here because it will not get parsed anyway\n return {\n ...page,\n data: {\n configuration: page.data.configuration,\n },\n };\n });\n\n this.setObjects(this.pagesYMap, pages);\n }\n\n deletePages(ids: string[]) {\n this.deleteObjects(this.pagesYMap, ids);\n }\n\n private get pagesYMap() {\n return this.yDoc.getMap<object>(\"documentationPages\");\n }\n\n //\n // Groups\n //\n\n getGroups(): ElementGroup[] {\n return this.getObjects(this.groupsYMap, ElementGroup);\n }\n\n updateGroups(groups: ElementGroup[]) {\n this.setObjects(this.groupsYMap, groups);\n }\n\n deleteGroups(ids: string[]) {\n this.deleteObjects(this.groupsYMap, ids);\n }\n\n private get groupsYMap() {\n return this.yDoc.getMap<object>(\"documentationGroups\");\n }\n\n //\n // Documentation internal settings\n //\n\n getDocumentationInternalSettings(): DocumentationHierarchySettings {\n const map = this.internalSettingsYMap;\n\n const rawSettings: Record<keyof DocumentationHierarchySettings, any> = {\n routingVersion: map.get(\"routingVersion\"),\n isDraftFeatureAdopted: map.get(\"isDraftFeatureAdopted\") ?? false,\n isApprovalFeatureEnabled: map.get(\"isApprovalFeatureEnabled\") ?? false,\n approvalRequiredForPublishing: map.get(\"approvalRequiredForPublishing\") ?? false,\n };\n\n const settingsParseResult = DocumentationHierarchySettings.safeParse(rawSettings);\n if (!settingsParseResult.success) {\n return {\n routingVersion: \"2\",\n isDraftFeatureAdopted: false,\n isApprovalFeatureEnabled: false,\n approvalRequiredForPublishing: false,\n };\n }\n\n return settingsParseResult.data;\n }\n\n updateDocumentationInternalSettings(settings: Partial<DocumentationHierarchySettings>) {\n const map = this.internalSettingsYMap;\n map.set(\"routingVersion\", settings.routingVersion ?? map.get(\"routingVersion\"));\n map.set(\"isDraftFeatureAdopted\", settings.isDraftFeatureAdopted ?? map.get(\"isDraftFeatureAdopted\"));\n map.set(\"isApprovalFeatureEnabled\", settings.isApprovalFeatureEnabled ?? map.get(\"isApprovalFeatureEnabled\"));\n map.set(\n \"approvalRequiredForPublishing\",\n settings.approvalRequiredForPublishing ?? map.get(\"approvalRequiredForPublishing\")\n );\n }\n\n private get internalSettingsYMap() {\n return this.yDoc.getMap<unknown>(\"documentationInternalSettings\");\n }\n\n //\n // Documentation page snapshot\n //\n\n getPageSnapshots(): DocumentationPageSnapshot[] {\n return this.getObjects(this.documentationPagePublishedStatesYMap, DocumentationPageSnapshot);\n }\n\n updatePageSnapshots(snapshots: DocumentationPageSnapshot[]) {\n this.setObjects(this.documentationPagePublishedStatesYMap, snapshots);\n }\n\n deletePageSnapshots(ids: string[]) {\n this.deleteObjects(this.documentationPagePublishedStatesYMap, ids);\n }\n\n private get documentationPagePublishedStatesYMap() {\n return this.yDoc.getMap<object>(\"documentationPageSnapshots\");\n }\n\n //\n // Documentation group snapshots\n //\n\n getGroupSnapshots(): ElementGroupSnapshot[] {\n return this.getObjects(this.documentationGroupPublishedStatesYMap, ElementGroupSnapshot);\n }\n\n updateGroupSnapshots(snapshots: ElementGroupSnapshot[]) {\n this.setObjects(this.documentationGroupPublishedStatesYMap, snapshots);\n }\n\n deleteGroupSnapshots(ids: string[]) {\n this.deleteObjects(this.documentationGroupPublishedStatesYMap, ids);\n }\n\n private get documentationGroupPublishedStatesYMap() {\n return this.yDoc.getMap<object>(\"documentationGroupSnapshots\");\n }\n\n //\n // Utils\n //\n\n private getObjects<T extends YJSSerializable, I>(map: Y.Map<object>, schema: ZodSchema<T, ZodTypeDef, I>): T[] {\n const results: T[] = [];\n map.forEach(object => results.push(schema.parse(object)));\n return results;\n }\n\n private setObjects<T extends YJSSerializable>(map: Y.Map<object>, objects: T[]) {\n objects.forEach(o => map.set(o.id, JSON.parse(JSON.stringify(o))));\n }\n\n private deleteObjects(map: Y.Map<object>, ids: string[]) {\n ids.forEach(id => map.delete(id));\n }\n\n //\n // Documentation page content hashes\n //\n\n getDocumentationPageContentHashes(): Record<string, string> {\n const map = this.documentationPageContentHashesYMap;\n\n const result: Record<string, string> = {};\n map.forEach((hash, key) => {\n if (typeof hash === \"string\") result[key] = hash;\n });\n\n return result;\n }\n\n getDocumentationPageLiveblocksRoomIds(): Record<string, string> {\n const map = this.documentationPageLiveblocksRoomIdsYMap;\n\n const result: Record<string, string> = {};\n map.forEach((hash, key) => {\n if (typeof hash === \"string\") result[key] = hash;\n });\n\n return result;\n }\n\n private get documentationPageLiveblocksRoomIdsYMap() {\n return this.yDoc.getMap<string>(\"documentationPageLiveblocksRoomIds\");\n }\n\n updateDocumentationPageContentHashes(hashes: Record<string, string>) {\n const map = this.documentationPageContentHashesYMap;\n Object.entries(hashes).forEach(([key, hash]) => map.set(key, hash));\n }\n\n private get documentationPageContentHashesYMap() {\n return this.yDoc.getMap<string>(\"documentationPageHashes\");\n }\n\n //\n // Approval states\n //\n\n updateApprovalStates(updates: DocumentationPageApproval[]) {\n this.setObjects(this.documentationPageApprovalsMap, updates);\n }\n\n removeApprovalStates(ids: string[]) {\n this.deleteObjects(this.documentationPageApprovalsMap, ids);\n }\n\n getApprovals() {\n return this.getObjects(this.documentationPageApprovalsMap, DocumentationPageApproval);\n }\n\n private get documentationPageApprovalsMap() {\n return this.yDoc.getMap<object>(\"documentationPageApprovals\");\n }\n\n //\n // Executed transactions\n //\n\n updateExecutedTransactionIds(transactionIds: string[]) {\n transactionIds = Array.from(new Set(transactionIds));\n if (!transactionIds.length) return;\n\n const array = this.executedTransactionIdsArray;\n\n // Append transactions at the end\n array.push(transactionIds);\n\n // Trim from the beginning in case it contains more than 100\n if (array.length > 100) {\n array.delete(0, array.length - 100);\n }\n }\n\n getExecutedTransactionIds(): string[] {\n const array = this.executedTransactionIdsArray;\n\n // Y.Array doesn't support filtering\n const transactionIds: string[] = [];\n array.forEach(e => typeof e === \"string\" && transactionIds.push(e));\n\n return transactionIds;\n }\n\n private get executedTransactionIdsArray() {\n return this.yDoc.getArray<unknown>(\"executedTransactionIds\");\n }\n}\n","import {\n DocumentationItemConfigurationV2,\n DocumentationPageSnapshot,\n ElementGroupSnapshot,\n defaultDocumentationItemConfigurationV2,\n mapByUnique,\n pickLatestGroupSnapshots,\n pickLatestPageSnapshots,\n recordToMap,\n} from \"@supernova-studio/model\";\nimport {\n DTODocumentationDraftState,\n DTODocumentationDraftStateUpdated,\n DTODocumentationGroupApprovalState,\n DTODocumentationHierarchyV2,\n documentationItemConfigurationToDTOV2,\n documentationPagesToDTOV2,\n elementGroupsToDocumentationGroupDTOV2,\n} from \"../../api\";\nimport { DTODocumentationPublishMetadata } from \"../../api/dto/elements/documentation/metadata\";\nimport { LocalApproval, LocalDocsPage, LocalDocsPageGroup } from \"../../sync/types\";\nimport { generateHash } from \"../../utils\";\nimport { DocumentationHierarchySettings } from \"../design-system-content\";\nimport { VersionRoomApproval, VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"./types\";\n\ntype ItemState = {\n title: string;\n configuration: DocumentationItemConfigurationV2;\n contentHash: string;\n};\n\ntype DocsPage = VersionRoomDocsPage | LocalDocsPage;\ntype DocsPageGroup = VersionRoomDocsPageGroup | LocalDocsPageGroup;\ntype Approval = VersionRoomApproval | LocalApproval;\n\ntype Input = {\n pages: DocsPage[];\n pageSnapshots: DocumentationPageSnapshot[];\n pageContentHashes: Record<string, string>;\n pageLiveblockRoomIds: Record<string, string>;\n\n groups: DocsPageGroup[];\n groupSnapshots: ElementGroupSnapshot[];\n\n approvals: Approval[];\n settings: DocumentationHierarchySettings;\n};\n\nexport function computeDocsHierarchy(\n input: Input,\n options: { includeDeletedContent?: boolean; debug?: boolean } = {}\n): DTODocumentationHierarchyV2 {\n const includeDeletedContent = options.includeDeletedContent ?? false;\n const debug = options.debug ?? false;\n\n // Read current room data\n const { pages, groups, pageSnapshots, groupSnapshots, settings, pageContentHashes, approvals, pageLiveblockRoomIds } =\n input;\n\n if (settings.isDraftFeatureAdopted && includeDeletedContent) {\n pages.push(...getDeletedPages(pages, pageSnapshots));\n groups.push(...getDeletedGroups(groups, groupSnapshots));\n }\n\n // Convert pages to DTOs\n const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion, recordToMap(pageLiveblockRoomIds));\n const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);\n\n // Calculate hasPublishedDocumentationContent\n const hasPublishedPages = pageSnapshots.some(s => s.reason === \"Publish\");\n const hasPublishedGroups = groupSnapshots.some(s => s.reason === \"Publish\");\n const hasPublishedDocumentationContent = hasPublishedPages || hasPublishedGroups;\n\n // If draft feature is not yet adopted, no snapshot-based features should not be provided\n if (!settings.isDraftFeatureAdopted) {\n return {\n hasPublishedDocumentationContent,\n pages: pageDTOs,\n groups: groupDTOs,\n };\n }\n\n const pageDraftStates = buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots, pageContentHashes, debug);\n const pageDraftDeletedStates = buildPageDraftDeletedStates(pages, pageSnapshots);\n const pagePublishedMetadata = buildPagePublishedMetadata(pages, pageSnapshots);\n const pageApprovalStates = mapByUnique(approvals, a => a.pagePersistentId);\n\n pageDTOs.forEach(p => {\n // Assign draft state\n const draftState = pageDraftDeletedStates.get(p.persistentId) ?? pageDraftStates.get(p.persistentId);\n draftState && (p.draftState = draftState);\n\n // Assign publish metadata\n const publishMetadata = pagePublishedMetadata.get(p.persistentId);\n publishMetadata && (p.publishMetadata = publishMetadata);\n\n // Assign approval state\n const approvalState = pageApprovalStates.get(p.persistentId);\n approvalState && (p.approvalState = approvalState);\n });\n\n const groupDraftStates = buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots, debug);\n const groupDraftDeletedStates = buildGroupDraftDeletedStates(groups, groupSnapshots);\n const groupPublishedMetadata = buildGroupPublishedMetadata(groups, groupSnapshots);\n const groupApprovalStates = buildGroupApprovalStates(groups, groupSnapshots);\n groupDTOs.forEach(g => {\n // Assign draft state\n const draftState = groupDraftDeletedStates.get(g.persistentId) ?? groupDraftStates.get(g.persistentId);\n draftState && (g.draftState = draftState);\n\n // Assign publish metadata\n const publishMetadata = groupPublishedMetadata.get(g.persistentId);\n publishMetadata && (g.publishMetadata = publishMetadata);\n\n const approvalState = groupApprovalStates.get(g.persistentId);\n approvalState && (g.approvalState = approvalState);\n });\n\n return {\n hasPublishedDocumentationContent,\n pages: pageDTOs,\n groups: groupDTOs,\n };\n}\n\nfunction getDeletedPages(pages: DocsPage[], pageSnapshots: DocumentationPageSnapshot[]): DocsPage[] {\n const existingPagePersistentIds = new Set(pages.map(p => p.persistentId));\n const latestSnapshots = pickLatestPageSnapshots(pageSnapshots);\n return latestSnapshots.filter(s => !existingPagePersistentIds.has(s.page.persistentId)).map(s => s.page);\n}\n\nfunction getDeletedGroups(groups: DocsPageGroup[], groupSnapshots: ElementGroupSnapshot[]): DocsPageGroup[] {\n const existingGroupPersistentIds = new Set(groups.map(p => p.persistentId));\n const latestSnapshots = pickLatestGroupSnapshots(groupSnapshots);\n return latestSnapshots.filter(s => !existingGroupPersistentIds.has(s.group.persistentId)).map(s => s.group);\n}\n\nfunction buildPageDraftCreatedAndUpdatedStates(\n pages: DocsPage[],\n pageSnapshots: DocumentationPageSnapshot[],\n pageHashes: Record<string, string>,\n debug: boolean\n): Map<string, DTODocumentationDraftState> {\n // Read room data\n const publishedSnapshots = pickLatestPageSnapshots(pageSnapshots.filter(s => s.reason === \"Publish\"));\n const publishedSnapshotsByPagePersistentId = mapByUnique(publishedSnapshots, s => s.page.persistentId);\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n pages.forEach(page => {\n // Published state\n const snapshot = publishedSnapshotsByPagePersistentId.get(page.persistentId);\n let publishedState: ItemState | undefined;\n if (snapshot) {\n publishedState = itemStateFromPage(snapshot.page, snapshot.pageContentHash);\n }\n\n // Current state - if content hash is undefined, it means that the page hasn't changed\n const currentPageContentHash = pageHashes[page.persistentId] ?? snapshot?.pageContentHash ?? \"\";\n const currentState: ItemState = itemStateFromPage(page, currentPageContentHash);\n\n // Calculate draft\n const draftState = createDraftState(page.persistentId, currentState, publishedState, debug);\n if (draftState) result.set(page.persistentId, draftState);\n });\n\n return result;\n}\n\nfunction itemStateFromPage(page: DocsPage, pageContentHash: string): ItemState {\n return {\n title: page.meta.name,\n configuration: page.data.configuration ?? defaultDocumentationItemConfigurationV2,\n contentHash: pageContentHash,\n };\n}\n\nfunction buildPagePublishedMetadata(\n pages: DocsPage[],\n pageSnapshots: DocumentationPageSnapshot[]\n): Map<string, DTODocumentationPublishMetadata> {\n const publishedPageSnapshotsByPersistentId = mapByUnique(\n pickLatestPageSnapshots(pageSnapshots.filter(s => s.reason === \"Publish\")),\n s => s.page.persistentId\n );\n\n const result = new Map<string, DTODocumentationPublishMetadata>();\n\n pages.forEach(p => {\n const publishedSnapshot = publishedPageSnapshotsByPersistentId.get(p.persistentId);\n if (!publishedSnapshot) return;\n\n result.set(p.persistentId, {\n lastPublishedAt: publishedSnapshot.createdAt,\n lastPublishedByUserId: publishedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n\nfunction createDraftState(\n itemPersistentId: string,\n currentState: ItemState,\n publishedState: ItemState | undefined,\n debug: boolean\n): DTODocumentationDraftState | undefined {\n if (!publishedState) {\n // New item (hasn't been published yet)\n return { changeType: \"Created\" };\n }\n\n // Compare current item state to the published state\n const updatedDraftState: DTODocumentationDraftStateUpdated = {\n changeType: \"Updated\",\n changes: {},\n };\n\n if (currentState.title !== publishedState.title) {\n if (debug) {\n console.log(`Item ${itemPersistentId} (${currentState.title}): updated title`);\n }\n\n updatedDraftState.changes.previousTitle = publishedState.title;\n }\n\n const currentConfigHash = generateHash(currentState.configuration, debug);\n const publishedConfigHash = generateHash(publishedState.configuration, debug);\n\n if (currentConfigHash !== publishedConfigHash) {\n if (debug) {\n console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);\n }\n\n const configurationDto = documentationItemConfigurationToDTOV2(publishedState.configuration);\n updatedDraftState.changes.previousConfiguration = configurationDto;\n }\n\n if (currentState.contentHash !== publishedState.contentHash) {\n if (debug) {\n console.log(`Item ${itemPersistentId} (${currentState.title}): updated content hash`);\n }\n\n updatedDraftState.changes.previousContentHash = publishedState.contentHash;\n }\n\n if (Object.keys(updatedDraftState.changes).length) {\n // Item has at least one of the draft changes\n return updatedDraftState;\n }\n\n // Item has no draft changes compared to the published item\n return undefined;\n}\n\nfunction buildGroupApprovalStates(groups: DocsPageGroup[], groupSnapshots: ElementGroupSnapshot[]) {\n const result = new Map<string, DTODocumentationGroupApprovalState>();\n const allGroups = [...groups, ...groupSnapshots];\n for (const g of allGroups) {\n const approvalState: DTODocumentationGroupApprovalState = {\n approvalState: \"Approved\",\n designSystemVersionId: g.designSystemVersionId,\n persistentId: g.persistentId,\n groupPersistentId: g.persistentId,\n };\n result.set(g.persistentId, approvalState);\n }\n return result;\n}\n\nfunction buildPageDraftDeletedStates(\n pages: DocsPage[],\n pageSnapshots: DocumentationPageSnapshot[]\n): Map<string, DTODocumentationDraftState> {\n const deletedSnapshotsByPagePersistentId = mapByUnique(\n pickLatestPageSnapshots(pageSnapshots.filter(s => s.reason === \"Deletion\")),\n s => s.page.persistentId\n );\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n pages.forEach(page => {\n const deletedSnapshot = deletedSnapshotsByPagePersistentId.get(page.persistentId);\n if (!deletedSnapshot) return;\n\n result.set(page.persistentId, {\n changeType: \"Deleted\",\n deletedAt: deletedSnapshot.createdAt,\n deletedByUserId: deletedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n\nfunction buildGroupDraftDeletedStates(\n groups: DocsPageGroup[],\n groupSnapshots: ElementGroupSnapshot[]\n): Map<string, DTODocumentationDraftState> {\n const deletedSnapshotsByGroupPersistentId = mapByUnique(\n pickLatestGroupSnapshots(groupSnapshots.filter(s => s.reason === \"Deletion\")),\n s => s.group.persistentId\n );\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n groups.forEach(group => {\n if (!group.parentPersistentId) return;\n\n const deletedSnapshot = deletedSnapshotsByGroupPersistentId.get(group.persistentId);\n if (!deletedSnapshot) return;\n\n result.set(group.persistentId, {\n changeType: \"Deleted\",\n deletedAt: deletedSnapshot.createdAt,\n deletedByUserId: deletedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n\nfunction buildGroupDraftCreatedAndUpdatedStates(\n groups: DocsPageGroup[],\n groupSnapshots: ElementGroupSnapshot[],\n debug: boolean\n): Map<string, DTODocumentationDraftState> {\n // Read room data\n const publishedSnapshots = pickLatestGroupSnapshots(groupSnapshots.filter(s => s.reason === \"Publish\"));\n const publishedSnapshotsByGroupPersistent = mapByUnique(publishedSnapshots, s => s.group.persistentId);\n\n const result = new Map<string, DTODocumentationDraftState>();\n\n groups.forEach(group => {\n if (!group.parentPersistentId) return;\n\n // Current state\n const currentState: ItemState = itemStateFromGroup(group);\n\n // Published state\n const snapshot = publishedSnapshotsByGroupPersistent.get(group.persistentId);\n let publishedState: ItemState | undefined;\n if (snapshot) {\n publishedState = itemStateFromGroup(snapshot.group);\n }\n\n // Calculate draft\n const draftState = createDraftState(group.persistentId, currentState, publishedState, debug);\n if (draftState) result.set(group.persistentId, draftState);\n });\n\n return result;\n}\n\nfunction itemStateFromGroup(group: DocsPageGroup): ItemState {\n return {\n title: group.meta.name,\n configuration: group.data?.configuration ?? defaultDocumentationItemConfigurationV2,\n contentHash: \"-\",\n };\n}\n\nfunction buildGroupPublishedMetadata(\n groups: DocsPageGroup[],\n groupSnapshots: ElementGroupSnapshot[]\n): Map<string, DTODocumentationPublishMetadata> {\n const publishedGroupSnapshotsByPersistentId = mapByUnique(\n pickLatestGroupSnapshots(groupSnapshots.filter(s => s.reason === \"Publish\")),\n s => s.group.persistentId\n );\n\n const result = new Map<string, DTODocumentationPublishMetadata>();\n\n groups.forEach(g => {\n if (!g.parentPersistentId) return;\n\n const publishedSnapshot = publishedGroupSnapshotsByPersistentId.get(g.persistentId);\n if (!publishedSnapshot) return;\n\n result.set(g.persistentId, {\n lastPublishedAt: publishedSnapshot.createdAt,\n lastPublishedByUserId: publishedSnapshot.createdByUserId,\n });\n });\n\n return result;\n}\n","import {\n PageBlockDefinition,\n PageBlockDefinitionsMap,\n PageBlockItemMultiRichTextValue,\n PageBlockItemRichTextValue,\n PageBlockItemTableValue,\n PageBlockText,\n mapPageBlockItemValuesV2,\n removeCommentSpans,\n} from \"@supernova-studio/model\";\nimport { generateHash } from \"../../utils\";\nimport { DocumentationPageEditorModel } from \"../docs-editor\";\n\nexport function generatePageContentHash(\n content: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[],\n debug = false\n) {\n let sanitizedContent = structuredClone(content);\n\n // Remove comment spans\n sanitizedContent = sanitizePageContents(sanitizedContent, definitions);\n\n // Make sure hashes of empty pages always match\n if (isPageContentEmpty(sanitizedContent)) {\n sanitizedContent = { blocks: [] };\n }\n\n return generateHash(sanitizedContent, debug);\n}\n\n/**\n * Empty page content can be one of the following:\n * - page without any blocks\n * - page with a single block, the block is a paragraph whithout any text\n */\nfunction isPageContentEmpty(content: DocumentationPageEditorModel): boolean {\n if (content.blocks.length > 1) return false;\n if (content.blocks.length < 1) return true;\n\n const singleBlock = content.blocks[0];\n if (singleBlock.type !== \"Block\" || singleBlock.data.packageId !== \"io.supernova.block.rich-text\") {\n return false;\n }\n\n const singleItem = singleBlock.data.items[0];\n\n // Block has no value, effectively the same as empty value\n if (!singleItem || !singleItem.props[\"text\"]) return true;\n\n const textValue = singleItem.props[\"text\"] as PageBlockItemRichTextValue;\n return !textValue.value.spans.length;\n}\n\nfunction sanitizePageContents(\n content: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[]\n): DocumentationPageEditorModel {\n const defMap = new PageBlockDefinitionsMap(definitions);\n\n mapPageBlockItemValuesV2(content.blocks, defMap, (block, item, prop, value) => {\n if (prop.type === \"RichText\") {\n const richTextValue = value as PageBlockItemRichTextValue;\n return {\n ...richTextValue,\n value: sanitizeRichText(richTextValue.value),\n };\n }\n\n if (prop.type === \"MultiRichText\") {\n const multiRichTextValue = value as PageBlockItemMultiRichTextValue;\n return {\n ...multiRichTextValue,\n value: multiRichTextValue.value.map(sanitizeRichText),\n };\n }\n\n if (prop.type === \"Table\") {\n const tableValue = value as PageBlockItemTableValue;\n tableValue.value.forEach(r => {\n r.cells.forEach(c => {\n c.nodes.forEach(n => {\n if (n.type === \"RichText\") {\n n.value = sanitizeRichText(n.value);\n }\n });\n });\n });\n\n return tableValue;\n }\n\n return value;\n });\n\n return content;\n}\n\nfunction sanitizeRichText(richText: PageBlockText): PageBlockText {\n return sortSpanAttributes(removeCommentSpans(richText));\n}\n\nfunction sortSpanAttributes(richText: PageBlockText) {\n richText.spans.forEach(s => {\n s.attributes.sort((lhs, rhs) => lhs.type.localeCompare(rhs.type));\n });\n\n return richText;\n}\n","import { PageBlockDefinition } from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { DTODocumentationHierarchyV2 } from \"../../api\";\nimport { DocumentationPageEditorModel } from \"../docs-editor\";\nimport { VersionRoomBaseYDoc } from \"./base\";\nimport { computeDocsHierarchy } from \"./compute-dto\";\nimport { generatePageContentHash } from \"./utils\";\n\nexport class FrontendVersionRoomYDoc {\n private readonly yDoc: Y.Doc;\n\n constructor(yDoc: Y.Doc, private readonly debug = false) {\n this.yDoc = yDoc;\n }\n\n //\n // Hierarchy\n //\n\n getDocumentationHierarchy(\n options: { includeDeletedContent?: boolean; debug?: boolean } = {}\n ): DTODocumentationHierarchyV2 {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n return computeDocsHierarchy(doc.getState(), options);\n }\n\n //\n // Update page content hash\n //\n\n notifyDocumentationPageContentUpdated(\n pageId: string,\n content: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[]\n ) {\n const pageContentHash = generatePageContentHash(content, definitions, this.debug);\n if (this.debug) {\n console.log(`Will set page content hash: '${pageId}' : '${pageContentHash}'`);\n }\n\n new VersionRoomBaseYDoc(this.yDoc).updateDocumentationPageContentHashes({\n [pageId]: pageContentHash,\n });\n }\n\n //\n // Misc\n //\n\n isDraftFeatureAdopted() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n const settings = doc.getDocumentationInternalSettings();\n return settings.isDraftFeatureAdopted;\n }\n\n hasPublishedDocumentationContent() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n\n return (\n doc.getPageSnapshots().filter(s => s.reason === \"Publish\").length > 0 ||\n doc.getGroupSnapshots().filter(s => s.reason === \"Publish\").length > 0\n );\n }\n\n isApprovalsFeatureEnabled() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n const settings = doc.getDocumentationInternalSettings();\n return settings.isApprovalFeatureEnabled;\n }\n\n isApprovalRequiredForPublishing() {\n const doc = new VersionRoomBaseYDoc(this.yDoc);\n const settings = doc.getDocumentationInternalSettings();\n return settings.approvalRequiredForPublishing;\n }\n}\n","import { DocumentationItemHeaderV2 } from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { z } from \"zod\";\nimport { DTODocumentationItemConfigurationV2 } from \"../../api/dto/elements/documentation/item-configuration-v2\";\n\n//\n// Types\n//\n\nexport const DTODocumentationPageRoomHeaderData = z.object({\n title: z.string(),\n configuration: DTODocumentationItemConfigurationV2,\n});\n\nexport const DTODocumentationPageRoomHeaderDataUpdate = z.object({\n title: z.string().optional(),\n configuration: DTODocumentationItemConfigurationV2.omit({ header: true })\n .extend({ header: DocumentationItemHeaderV2.partial() })\n .optional(),\n});\n\nexport type DTODocumentationPageRoomHeaderData = z.infer<typeof DTODocumentationPageRoomHeaderData>;\nexport type DTODocumentationPageRoomHeaderDataUpdate = z.infer<typeof DTODocumentationPageRoomHeaderDataUpdate>;\n\n//\n// YJS Bindings\n//\n\nexport function itemConfigurationToYjs(yDoc: Y.Doc, item: DTODocumentationPageRoomHeaderDataUpdate) {\n yDoc.transact(trx => {\n const { title, configuration } = item;\n\n const header = configuration?.header;\n\n if (title !== undefined) {\n const headerYMap = trx.doc.getMap(\"itemTitle\");\n headerYMap.set(\"title\", title);\n }\n\n if (header) {\n const headerYMap = trx.doc.getMap(\"itemHeader\");\n\n header.description !== undefined && headerYMap.set(\"description\", header.description);\n header.alignment !== undefined && headerYMap.set(\"alignment\", header.alignment);\n header.foregroundColor !== undefined && headerYMap.set(\"foregroundColor\", header.foregroundColor);\n header.backgroundColor !== undefined && headerYMap.set(\"backgroundColor\", header.backgroundColor);\n header.backgroundImageAsset !== undefined && headerYMap.set(\"backgroundImageAsset\", header.backgroundImageAsset);\n header.backgroundImageScaleType !== undefined &&\n headerYMap.set(\"backgroundImageScaleType\", header.backgroundImageScaleType);\n header.showBackgroundOverlay !== undefined &&\n headerYMap.set(\"showBackgroundOverlay\", header.showBackgroundOverlay);\n header.showCoverText !== undefined && headerYMap.set(\"showCoverText\", header.showCoverText);\n header.minHeight !== undefined && headerYMap.set(\"minHeight\", header.minHeight);\n }\n\n const configYMap = trx.doc.getMap(\"itemConfiguration\");\n\n configuration?.showSidebar !== undefined && configYMap.set(\"showSidebar\", configuration.showSidebar);\n configuration?.isHidden !== undefined && configYMap.set(\"isHidden\", configuration.isHidden);\n configuration?.isPrivate !== undefined && configYMap.set(\"isPrivate\", configuration.isPrivate);\n });\n}\n","import { PageBlockEditorModelV2, PageSectionEditorModelV2 } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const PageBlockEditorModel = PageBlockEditorModelV2;\nexport type PageBlockEditorModel = z.infer<typeof PageBlockEditorModel>;\n\nexport const PageSectionEditorModel = PageSectionEditorModelV2;\nexport type PageSectionEditorModel = z.infer<typeof PageSectionEditorModel>;\n","import { DocumentationPageContentItem } from \"@supernova-studio/model\";\nimport { z } from \"zod\";\n\nexport const DocumentationPageEditorModel = z.object({\n blocks: z.array(DocumentationPageContentItem),\n});\n\nexport type DocumentationPageEditorModel = z.infer<typeof DocumentationPageEditorModel>;\n","import { Schema } from \"prosemirror-model\";\n\nconst pmSchemaJson = {\n topNode: \"doc\",\n nodes: {\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n parseDOM: [\n {\n tag: \"p\",\n },\n ],\n },\n listItem: {\n content: \"paragraph\",\n defining: true,\n parseDOM: [\n {\n tag: \"li\",\n },\n ],\n },\n doc: {\n content: \"block+\",\n },\n hardBreak: {\n group: \"inline\",\n inline: true,\n selectable: false,\n parseDOM: [\n {\n tag: \"br\",\n },\n ],\n },\n text: {\n group: \"inline\",\n },\n bulletList: {\n content: \"listItem+\",\n group: \"block list\",\n parseDOM: [\n {\n tag: \"ul\",\n },\n ],\n },\n orderedList: {\n content: \"listItem+\",\n group: \"block list\",\n attrs: {\n start: {\n default: 1,\n },\n type: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"ol\",\n },\n ],\n },\n },\n marks: {\n link: {\n inclusive: false,\n attrs: {\n href: {\n default: null,\n },\n target: {\n default: \"_blank\",\n },\n rel: {\n default: \"noopener noreferrer nofollow\",\n },\n class: {\n default: \"tiptap-link\",\n },\n },\n parseDOM: [\n {\n tag: \"a[href]\",\n },\n ],\n },\n bold: {\n parseDOM: [\n {\n tag: \"strong\",\n },\n {\n tag: \"b\",\n },\n {\n style: \"font-weight\",\n },\n ],\n },\n italic: {\n parseDOM: [\n {\n tag: \"em\",\n },\n {\n tag: \"i\",\n },\n {\n style: \"font-style=italic\",\n },\n ],\n },\n strike: {\n parseDOM: [\n {\n tag: \"s\",\n },\n {\n tag: \"del\",\n },\n {\n tag: \"strike\",\n },\n {\n style: \"text-decoration\",\n consuming: false,\n },\n ],\n },\n code: {\n excludes: \"bold code italic strike link\",\n code: true,\n parseDOM: [\n {\n tag: \"code\",\n },\n ],\n },\n },\n} as const;\n\nexport const innerEditorProsemirrorSchema = new Schema(pmSchemaJson);\n","import { Schema } from \"prosemirror-model\";\n\nconst pmSchemaJson = {\n topNode: \"doc\",\n nodes: {\n paragraph: {\n content: \"inline*\",\n group: \"block\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.rich-text\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"p\",\n },\n ],\n },\n reactComponent: {\n group: \"block\",\n atom: true,\n draggable: true,\n attrs: {\n count: {\n default: 0,\n },\n },\n parseDOM: [\n {\n tag: \"react-component\",\n },\n ],\n },\n tableRow: {\n tableRole: \"row\",\n content: \"(tableCell | tableHeader)*\",\n parseDOM: [\n {\n tag: \"tr\",\n },\n ],\n },\n table: {\n tableRole: \"table\",\n content: \"tableRow+\",\n group: \"defaultTable\",\n isolating: true,\n parseDOM: [\n {\n tag: \"table\",\n },\n ],\n },\n tableCell: {\n tableRole: \"cell\",\n content: \"(paragraph|image)+\",\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n textAlign: {\n default: \"left\",\n },\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"td\",\n },\n ],\n },\n tableHeader: {\n tableRole: \"header_cell\",\n content: \"(paragraph|image)+\",\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n textAlign: {\n default: \"left\",\n },\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"th\",\n },\n ],\n },\n tableContainer: {\n content: \"table\",\n group: \"block\",\n atom: true,\n draggable: false,\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.table\",\n },\n variantId: {\n default: \"default\",\n },\n hasBorder: {\n default: true,\n },\n },\n parseDOM: [\n {\n tag: \"tableContainer\",\n },\n ],\n },\n hardBreak: {\n group: \"inline\",\n inline: true,\n selectable: false,\n parseDOM: [\n {\n tag: \"br\",\n },\n ],\n },\n text: {\n group: \"inline\",\n },\n heading: {\n content: \"inline*\",\n group: \"block\",\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n level: {\n default: 1,\n },\n definitionId: {\n default: null,\n },\n variantId: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"h1\",\n attrs: {\n level: 1,\n definitionId: \"io.supernova.block.title1\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h2\",\n attrs: {\n level: 2,\n definitionId: \"io.supernova.block.title2\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h3\",\n attrs: {\n level: 3,\n definitionId: \"io.supernova.block.title3\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h4\",\n attrs: {\n level: 4,\n definitionId: \"io.supernova.block.title4\",\n variantId: \"default\",\n },\n },\n {\n tag: \"h5\",\n attrs: {\n level: 5,\n definitionId: \"io.supernova.block.title5\",\n variantId: \"default\",\n },\n },\n ],\n },\n listItem: {\n content: \"paragraph list{0,1}\",\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"li\",\n },\n ],\n },\n orderedList: {\n content: \"listItem+\",\n group: \"block list\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.ordered-list\",\n },\n variantId: {\n default: \"default\",\n },\n start: {\n default: 1,\n },\n },\n parseDOM: [\n {\n tag: \"ol\",\n },\n ],\n },\n bulletList: {\n content: \"listItem+\",\n group: \"block list\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.unordered-list\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"ul\",\n },\n ],\n },\n horizontalRule: {\n group: \"block\",\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.divider\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"div.node-horizontalRule\",\n },\n {\n tag: \"hr\",\n },\n ],\n },\n blockquote: {\n content: \"inline*\",\n group: \"block\",\n draggable: true,\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.blockquote\",\n },\n variantId: {\n default: \"default\",\n },\n },\n parseDOM: [\n {\n tag: \"blockquote\",\n },\n ],\n },\n plainSection: {\n content: \"sectionItem\",\n group: \"section\",\n atom: true,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"section\",\n attrs: {\n \"data-section-type\": \"plain\",\n },\n },\n ],\n },\n tabsSection: {\n content: \"sectionItem+\",\n group: \"section\",\n atom: true,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n variantId: {\n default: \"Tabs\",\n },\n },\n parseDOM: [\n {\n tag: \"div\",\n },\n ],\n },\n sectionItem: {\n content: \"sectionItemColumn{1, 3}\",\n group: \"sectionItem\",\n atom: true,\n selectable: false,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n title: {\n default: \"\",\n },\n },\n parseDOM: [\n {\n tag: \"section-item\",\n },\n ],\n },\n sectionItemColumn: {\n content: \"block+\",\n group: \"sectionItemColumn\",\n atom: true,\n selectable: false,\n draggable: false,\n isolating: true,\n attrs: {\n id: {\n default: null,\n },\n },\n parseDOM: [\n {\n tag: \"section-item-column\",\n },\n ],\n },\n doc: {\n content: \"(block|section)+\",\n },\n callout: {\n content: \"inline*\",\n group: \"block\",\n draggable: true,\n defining: true,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: \"io.supernova.block.callout\",\n },\n variantId: {\n default: \"default\",\n },\n type: {\n default: \"neutral\",\n },\n },\n parseDOM: [\n {\n tag: \"callout\",\n },\n ],\n },\n image: {\n group: \"block customBlock\",\n atom: true,\n draggable: false,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: null,\n },\n variantId: {\n default: null,\n },\n appearance: {\n default: \"{}\",\n },\n columns: {\n default: 1,\n },\n items: {\n default: \"[]\",\n },\n },\n parseDOM: [\n {\n tag: \"block-node\",\n },\n ],\n },\n blockNode: {\n group: \"block customBlock\",\n atom: true,\n draggable: false,\n attrs: {\n id: {\n default: null,\n },\n definitionId: {\n default: null,\n },\n variantId: {\n default: null,\n },\n appearance: {\n default: \"{}\",\n },\n columns: {\n default: 1,\n },\n items: {\n default: \"[]\",\n },\n },\n parseDOM: [\n {\n tag: \"block-node\",\n },\n ],\n },\n },\n marks: {\n link: {\n inclusive: false,\n attrs: {\n href: {\n default: null,\n },\n target: {\n default: \"_blank\",\n },\n rel: {\n default: \"noopener noreferrer nofollow\",\n },\n class: {\n default: \"tiptap-link\",\n },\n },\n parseDOM: [\n {\n tag: 'a[href]:not([href *= \"javascript:\" i])',\n },\n ],\n },\n commentHighlight: {\n attrs: {\n highlightId: {\n default: null,\n },\n resolved: {\n default: false,\n },\n },\n parseDOM: [\n {\n tag: \"commenthighlight\",\n },\n ],\n },\n bold: {\n parseDOM: [\n {\n tag: \"strong\",\n },\n {\n tag: \"b\",\n },\n {\n style: \"font-weight\",\n },\n ],\n },\n italic: {\n parseDOM: [\n {\n tag: \"em\",\n },\n {\n tag: \"i\",\n },\n {\n style: \"font-style=italic\",\n },\n ],\n },\n strike: {\n parseDOM: [\n {\n tag: \"s\",\n },\n {\n tag: \"del\",\n },\n {\n tag: \"strike\",\n },\n {\n style: \"text-decoration\",\n consuming: false,\n },\n ],\n },\n code: {\n excludes: \"bold code italic strike link\",\n code: true,\n parseDOM: [\n {\n tag: \"code\",\n },\n ],\n },\n },\n} as const;\n\nexport const mainEditorProsemirrorSchema = new Schema(pmSchemaJson);\n","import {\n PageBlockCalloutType,\n PageBlockDefinition,\n PageBlockDefinitionProperty,\n PageBlockDefinitionRichTextOptions,\n PageBlockItemImageValue,\n PageBlockItemRichTextEditorListNode,\n PageBlockItemRichTextEditorNode,\n PageBlockItemRichTextEditorParagraphNode,\n PageBlockItemRichTextEditorValue,\n PageBlockItemRichTextValue,\n PageBlockItemTableCell,\n PageBlockItemTableNode,\n PageBlockItemTableRow,\n PageBlockItemTableValue,\n PageBlockTableCellAlignment,\n PageBlockText,\n PageBlockTextSpan,\n PageBlockTextSpanAttribute,\n PageSectionColumnV2,\n PageSectionItemV2,\n SupernovaException,\n mapByUnique,\n} from \"@supernova-studio/model\";\nimport { prosemirrorJSONToYXmlFragment } from \"y-prosemirror\";\nimport * as Y from \"yjs\";\nimport { ListNode, ListTreeBuilder } from \"./list-tree-builder\";\nimport { DocumentationPageEditorModel } from \"./model\";\nimport { PageBlockEditorModel, PageSectionEditorModel } from \"./model/block\";\nimport { mainEditorProsemirrorSchema } from \"./prosemirror\";\nimport { ProsemirrorMark, ProsemirrorNode } from \"./prosemirror/types\";\nimport { BlockDefinitionUtils, BlockParsingUtils } from \"./utils\";\n\n//\n// Types\n//\n\ntype BaseInput = {\n block: PageBlockEditorModel;\n definition: PageBlockDefinition;\n};\n\ntype InputWithProperty = BaseInput & {\n property: PageBlockDefinitionProperty;\n};\n\ntype RichTextInputWithValue = InputWithProperty & {\n richTextPropertyValue: PageBlockItemRichTextValue;\n};\n\n//\n// Implementation\n//\n\nexport function pageToYDoc(doc: Y.Doc, page: DocumentationPageEditorModel, definitions: PageBlockDefinition[]) {\n pageToYXmlFragment(page, definitions, doc.getXmlFragment(\"default\"));\n}\n\nexport function pageToYXmlFragment(\n page: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[],\n fragment: Y.XmlFragment\n): Y.XmlFragment {\n const doc = pageToProsemirrorDoc(page, definitions);\n // console.log(JSON.stringify(doc, null, 2));\n return prosemirrorJSONToYXmlFragment(mainEditorProsemirrorSchema, doc, fragment);\n}\n\nexport function pageToProsemirrorDoc(\n page: DocumentationPageEditorModel,\n definitions: PageBlockDefinition[]\n): ProsemirrorNode {\n const definitionsMap = mapByUnique(definitions, d => d.id);\n\n const children: ProsemirrorNode[] = [];\n let blockBuffer: PageBlockEditorModel[] = [];\n\n page.blocks.forEach(b => {\n if (b.type === \"Block\") {\n blockBuffer.push(b);\n } else if (b.type === \"Section\") {\n if (blockBuffer.length) {\n children.push(...internalBlocksToProsemirrorNodes(blockBuffer, definitionsMap));\n blockBuffer = [];\n }\n\n children.push(internalSectionToProsemirrorNode(b, definitionsMap));\n }\n });\n\n if (blockBuffer.length) {\n children.push(...internalBlocksToProsemirrorNodes(blockBuffer, definitionsMap));\n }\n\n return {\n type: \"doc\",\n content: children,\n };\n}\n\nexport function blockToProsemirrorNode(\n block: PageBlockEditorModel,\n definition: PageBlockDefinition\n): ProsemirrorNode | null {\n const definitionsMap = new Map<string, PageBlockDefinition>([[definition.id, definition]]);\n const nodes = internalBlocksToProsemirrorNodes([block], definitionsMap);\n return nodes[0] ?? null;\n}\n\nexport function richTextPropertyValueToProsemirror(\n richTextEditorValue: PageBlockItemRichTextEditorValue\n): ProsemirrorNode {\n return {\n type: \"doc\",\n content: richTextEditorValue.value.map(node => {\n return serializeRichTextEditorNode(node);\n }),\n };\n}\n\nfunction serializeRichTextEditorNode(node: PageBlockItemRichTextEditorNode): ProsemirrorNode {\n switch (node.type) {\n case \"Paragraph\":\n return serializeRichTextEditorParagraphNode(node);\n\n case \"List\":\n return serializeRichTextEditorListNode(node);\n }\n}\n\nfunction serializeRichTextEditorParagraphNode(node: PageBlockItemRichTextEditorParagraphNode): ProsemirrorNode {\n const content = serializeRichText(node.value);\n return {\n type: \"paragraph\",\n ...(content.length && { content }),\n };\n}\n\nfunction serializeRichTextEditorListNode(node: PageBlockItemRichTextEditorListNode): ProsemirrorNode {\n const type = node.listType === \"OL\" ? \"orderedList\" : \"bulletList\";\n const attrs = node.listType === \"OL\" ? { start: 1 } : undefined;\n const richTexts = node.value.length ? node.value : [{ spans: [] }];\n\n return {\n type,\n ...(attrs && { attrs }),\n content: richTexts.map(n => {\n const content = serializeRichText(n);\n\n return {\n type: \"listItem\",\n content: [\n {\n type: \"paragraph\",\n ...(content.length && { content }),\n },\n ],\n };\n }),\n };\n}\n\n//\n// Sections\n//\n\nfunction internalSectionToProsemirrorNode(\n section: PageSectionEditorModel,\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode {\n return {\n type: \"tabsSection\",\n attrs: {\n id: section.id,\n ...(section.variantId && { variantId: section.variantId }),\n },\n content: section.items.map(item => sectionItemToProsemirrorNode(item, definitionsMap)),\n };\n}\n\nfunction sectionItemToProsemirrorNode(\n sectionItem: PageSectionItemV2,\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode {\n return {\n type: \"sectionItem\",\n attrs: {\n id: sectionItem.id,\n title: sectionItem.title,\n },\n content: sectionItem.columns.map(column => sectionColumnToProsemirrorNode(column, definitionsMap)),\n };\n}\n\nfunction sectionColumnToProsemirrorNode(\n sectionColumn: PageSectionColumnV2,\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode {\n const blocks = internalBlocksToProsemirrorNodes(sectionColumn.blocks, definitionsMap);\n\n if (!blocks.length) {\n blocks.push({\n type: \"paragraph\",\n attrs: {\n id: \"id\",\n definitionId: \"io.supernova.block.rich-text\",\n },\n });\n }\n\n return {\n type: \"sectionItemColumn\",\n attrs: {\n id: sectionColumn.id,\n },\n content: blocks,\n };\n}\n\n//\n// Blocks\n//\n\nfunction internalBlocksToProsemirrorNodes(\n blocks: PageBlockEditorModel[],\n definitionsMap: Map<string, PageBlockDefinition>\n): ProsemirrorNode[] {\n const result: ProsemirrorNode[] = [];\n\n const listTreeBuilder = new ListTreeBuilder();\n\n blocks.forEach(b => {\n const definition = definitionsMap.get(b.data.packageId);\n if (!definition) {\n console.warn(`Could not find definition for ${b.id} (${b.data.packageId})`);\n return;\n }\n\n const multiRichTextProp = BlockDefinitionUtils.firstMultiRichTextProperty(definition);\n\n if (multiRichTextProp) {\n // This is list\n const node = listTreeBuilder.addWithProperty(b, multiRichTextProp);\n if (node) {\n result.push(serializeAsMultiRichTextBlock(node));\n }\n } else {\n // This is not a list\n // Flush the tree builder to inject a non-tree block after it\n const tree = listTreeBuilder.flush();\n if (tree) {\n result.push(serializeAsMultiRichTextBlock(tree));\n }\n\n const node = internalBlockToProsemirrorNode(b, definition);\n node && result.push(node);\n }\n });\n\n const tree = listTreeBuilder.flush();\n if (tree) {\n result.push(serializeAsMultiRichTextBlock(tree));\n }\n\n return result;\n}\n\nfunction internalBlockToProsemirrorNode(\n block: PageBlockEditorModel,\n definition: PageBlockDefinition\n): ProsemirrorNode | null {\n // Single rich text\n const richTextProperty = BlockDefinitionUtils.firstRichTextProperty(definition);\n if (richTextProperty) {\n return serializeAsRichTextBlock({\n block: block,\n definition: definition,\n property: richTextProperty,\n });\n }\n\n const tableProperty = BlockDefinitionUtils.firstTableProperty(definition);\n if (tableProperty) {\n return serializeAsTable({\n block: block,\n definition: definition,\n property: tableProperty,\n });\n }\n\n // Divider\n if (block.data.packageId === \"io.supernova.block.divider\") {\n return serializeAsDivider({\n block: block,\n definition: definition,\n });\n }\n\n return serializeAsCustomBlock(block, definition);\n}\n\n//\n// Single rich text blocks\n//\n\nfunction serializeAsRichTextBlock(input: InputWithProperty): ProsemirrorNode {\n const { block, definition, property: richTextProperty } = input;\n\n const blockItem = BlockParsingUtils.singleBlockItem(block);\n const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);\n\n const enrichedInput: RichTextInputWithValue = { ...input, richTextPropertyValue: textPropertyValue };\n\n const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);\n const style = parsedOptions?.richTextStyle ?? \"Default\";\n\n switch (style) {\n case \"Callout\":\n return serializeAsCallout(enrichedInput);\n case \"Default\":\n return serializeAsParagraph(enrichedInput);\n\n case \"Quote\":\n return serializeAsBlockquote(enrichedInput);\n\n case \"Title1\":\n case \"Title2\":\n case \"Title3\":\n case \"Title4\":\n case \"Title5\":\n return serializeAsHeading(enrichedInput);\n }\n}\n\nfunction serializeAsParagraph(input: RichTextInputWithValue): ProsemirrorNode {\n return {\n type: \"paragraph\",\n attrs: serializeBlockNodeAttributes(input.block),\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\nfunction serializeAsHeading(input: RichTextInputWithValue): ProsemirrorNode {\n return {\n type: \"heading\",\n attrs: {\n ...serializeBlockNodeAttributes(input.block),\n level: richTextHeadingLevel(input.property),\n },\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\nfunction serializeAsBlockquote(input: RichTextInputWithValue): ProsemirrorNode {\n return {\n type: \"blockquote\",\n attrs: serializeBlockNodeAttributes(input.block),\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\nfunction serializeAsCallout(input: RichTextInputWithValue): ProsemirrorNode {\n const calloutType = input.richTextPropertyValue.calloutType ?? \"Info\";\n\n return {\n type: \"callout\",\n attrs: {\n ...serializeBlockNodeAttributes(input.block),\n type: serializeCalloutType(calloutType),\n },\n ...serializeRichTextNodePart(input.richTextPropertyValue.value),\n };\n}\n\n//\n// Multi rich text blocks\n//\n\nfunction serializeAsMultiRichTextBlock(node: ListNode): ProsemirrorNode {\n switch (node.listType) {\n case \"Ordered\":\n return serializeAsOrderedList(node);\n\n case \"Unordered\":\n return serializeAsUnorderedList(node);\n }\n}\n\nfunction serializeAsOrderedList(tree: ListNode): ProsemirrorNode {\n return {\n type: \"orderedList\",\n attrs: {\n ...serializeBlockNodeAttributes(tree.block),\n start: \"1\",\n },\n content: serializeListContent(tree),\n };\n}\n\nfunction serializeAsUnorderedList(tree: ListNode): ProsemirrorNode {\n return {\n type: \"bulletList\",\n attrs: {\n ...serializeBlockNodeAttributes(tree.block),\n },\n content: serializeListContent(tree),\n };\n}\n\nfunction serializeListContent(tree: ListNode): ProsemirrorNode[] {\n const result: ProsemirrorNode[] = tree.leadingChildren.map(i => serializeAsTextListItem(i.text));\n\n for (const child of tree.children) {\n if (child.type === \"ListItem\") {\n // Text list item\n\n result.push(serializeAsTextListItem(child.text));\n } else if (child.type === \"List\") {\n // List list item\n\n const previousNode = result[result.length - 1];\n if (!previousNode) {\n throw SupernovaException.shouldNotHappen(\"List node without previous node\");\n }\n if (!previousNode.content) {\n throw SupernovaException.shouldNotHappen(\"List item node has no content\");\n }\n\n const serializedList = serializeAsMultiRichTextBlock(child);\n previousNode.content.push(serializedList);\n } else {\n // Should noit happen\n\n throw SupernovaException.shouldNotHappen(`Unknown list node type: ${child}`);\n }\n }\n\n return result;\n}\n\nfunction serializeAsTextListItem(text: PageBlockText): ProsemirrorNode {\n return {\n type: \"listItem\",\n content: [\n {\n type: \"paragraph\",\n attrs: {\n definitionId: \"io.supernova.block.rich-text\",\n variantId: \"default\",\n },\n content: serializeRichText(text),\n },\n ],\n };\n}\n\n//\n// Tables\n//\n\nfunction serializeAsTable(input: InputWithProperty): ProsemirrorNode {\n const { block, definition, property: tableProperty } = input;\n\n const blockItem = BlockParsingUtils.singleBlockItem(block);\n const table = BlockParsingUtils.tablePropertyValue(blockItem, tableProperty.id);\n\n return {\n type: \"tableContainer\",\n attrs: {\n ...serializeBlockNodeAttributes(input.block),\n hasBorder: table.showBorder ?? true,\n },\n\n content: [\n {\n type: \"table\",\n content: serializeTableRows(table),\n },\n ],\n };\n}\n\nfunction serializeTableRows(table: PageBlockItemTableValue): ProsemirrorNode[] {\n // If no rows are present, we have to generate a least one empty row\n const rows: PageBlockItemTableRow[] = table.value.length ? table.value : [{ cells: [] }];\n\n return rows.map<ProsemirrorNode>((row, rowIndex) => {\n const isHeaderRow = rowIndex === 0 && table.highlightHeaderRow === true;\n\n // If no cells are present, we have to generate at least one cell\n const cells: PageBlockItemTableCell[] = row.cells.length ? row.cells : [{ id: \"\", alignment: \"Left\", nodes: [] }];\n\n return {\n type: \"tableRow\",\n content: cells.map<ProsemirrorNode>((cell, cellIndex) => {\n const isHeaderColumn = cellIndex === 0 && table.highlightHeaderColumn === true;\n\n return {\n type: isHeaderRow || isHeaderColumn ? \"tableHeader\" : \"tableCell\",\n attrs: {\n ...(cell.id && { id: cell.id }),\n textAlign: serializeTableCellAlignment(cell.alignment),\n colspan: 1,\n rowspan: 1,\n ...(cell.columnWidth && { colwidth: [cell.columnWidth] }),\n },\n content: serializeTableCellNodes(cell),\n };\n }),\n };\n });\n}\n\nfunction serializeTableCellAlignment(alignment: PageBlockTableCellAlignment) {\n switch (alignment) {\n case \"Left\":\n return \"left\";\n case \"Center\":\n return \"center\";\n case \"Right\":\n return \"right\";\n\n default:\n return \"left\";\n }\n}\n\nfunction serializeTableCellNodes(cell: PageBlockItemTableCell): ProsemirrorNode[] {\n const result = cell.nodes.map(serializeTableNode);\n\n if (result.length) {\n return result;\n } else {\n return [{ type: \"paragraph\" }];\n }\n}\n\nfunction serializeTableNode(node: PageBlockItemTableNode): ProsemirrorNode {\n switch (node.type) {\n case \"RichText\":\n return {\n type: \"paragraph\",\n attrs: {\n id: node.id,\n definitionId: \"io.supernova.block.rich-text\",\n },\n ...serializeRichTextNodePart(node.value),\n };\n\n case \"Image\":\n return {\n type: \"image\",\n attrs: {\n id: node.id,\n definitionId: \"io.supernova.block.image\",\n items: JSON.stringify([\n {\n id: node.id,\n props: {\n image: {\n ...(node.alt && { alt: node.alt }),\n ...(node.caption && { caption: node.caption }),\n ...(node.alignment && { alignment: node.alignment }),\n value: node.value,\n } satisfies PageBlockItemImageValue,\n },\n },\n ]),\n },\n };\n }\n}\n\n//\n// Divider\n//\n\nfunction serializeAsDivider(input: BaseInput): ProsemirrorNode {\n return {\n type: \"horizontalRule\",\n attrs: serializeBlockNodeAttributes(input.block),\n };\n}\n\n//\n// Attributes\n//\n\nfunction serializeBlockNodeAttributes(block: PageBlockEditorModel) {\n return {\n id: block.id,\n definitionId: block.data.packageId,\n ...(block.data.variantId && { variantId: block.data.variantId }),\n };\n}\n\nfunction richTextHeadingLevel(property: PageBlockDefinitionProperty): number | undefined {\n const style = property.options?.richTextStyle;\n if (!style) return undefined;\n\n switch (style) {\n case \"Title1\":\n return 1;\n case \"Title2\":\n return 2;\n case \"Title3\":\n return 3;\n case \"Title4\":\n return 4;\n case \"Title5\":\n return 5;\n case \"Callout\":\n case \"Default\":\n case \"Quote\":\n return undefined;\n }\n}\n\nfunction serializeCalloutType(calloutType: PageBlockCalloutType) {\n switch (calloutType) {\n case \"Error\":\n return \"critical\";\n case \"Info\":\n return \"neutral\";\n case \"Success\":\n return \"positive\";\n case \"Warning\":\n return \"warning\";\n case \"Primary\":\n return \"primary\";\n }\n}\n\n//\n// Rich text\n//\n\nfunction serializeRichTextNodePart(richText: PageBlockText): Pick<ProsemirrorNode, \"content\"> {\n const spans = serializeRichText(richText);\n if (spans.length) return { content: spans };\n return {};\n}\n\nfunction serializeRichText(richText: PageBlockText) {\n return richText.spans.map(serializeTextSpan).flat();\n}\n\nfunction serializeTextSpan(span: PageBlockTextSpan): ProsemirrorNode[] {\n const hardBreakType = \"hardBreak\";\n\n const marks = span.attributes.map(serializeTextSpanAttribute);\n\n const textParts = span.text.split(\"\\n\");\n const interspersed: ProsemirrorNode[] = [\n {\n type: \"text\",\n text: textParts[0],\n\n ...(marks.length && { marks: marks }),\n },\n ];\n\n for (let i = 1; i < textParts.length; i++) {\n interspersed.push(\n {\n type: hardBreakType,\n },\n {\n type: \"text\",\n text: textParts[i],\n\n ...(marks.length && { marks: marks }),\n }\n );\n }\n\n return interspersed.filter(t => t.type === hardBreakType || !!t.text);\n}\n\nfunction serializeTextSpanAttribute(spanAttribute: PageBlockTextSpanAttribute): ProsemirrorMark {\n switch (spanAttribute.type) {\n case \"Bold\":\n return { type: \"bold\", attrs: {} };\n case \"Italic\":\n return { type: \"italic\", attrs: {} };\n case \"Strikethrough\":\n return { type: \"strike\", attrs: {} };\n case \"Code\":\n return { type: \"code\", attrs: {} };\n case \"Comment\":\n return {\n type: \"commentHighlight\",\n attrs: {\n highlightId: spanAttribute.commentHighlightId,\n resolved: spanAttribute.commentIsResolved,\n },\n };\n case \"Link\":\n if (spanAttribute.link) {\n return serializeLinkMark(\n spanAttribute.link,\n spanAttribute.openInNewTab ?? spanAttribute.openInNewWindow ?? false\n );\n } else if (spanAttribute.documentationItemId) {\n return serializeLinkMark(\n `@page:${spanAttribute.documentationItemId}`,\n spanAttribute.openInNewTab ?? spanAttribute.openInNewWindow ?? false\n );\n } else {\n return serializeLinkMark(\"about:blank\", spanAttribute.openInNewTab ?? spanAttribute.openInNewWindow ?? false);\n }\n }\n}\n\nfunction serializeLinkMark(href: string, openInNewTab: boolean): ProsemirrorMark {\n return {\n type: \"link\",\n attrs: {\n href: href,\n target: openInNewTab ? \"_blank\" : \"_self\",\n rel: \"noopener noreferrer nofollow\",\n class: \"tiptap-link\",\n },\n };\n}\n\nexport function serializeAsCustomBlock(block: PageBlockEditorModel, definition: PageBlockDefinition): ProsemirrorNode {\n const items = block.data.items.map(i => {\n return {\n id: i.id,\n props: i.props,\n linksTo: i.linksTo,\n };\n });\n\n const columns = block.data.appearance?.numberOfColumns;\n\n return {\n type: serializeCustomBlockNodeType(block, definition),\n attrs: {\n id: block.id,\n definitionId: block.data.packageId,\n ...(block.data.variantId && { variantId: block.data.variantId }),\n items: JSON.stringify(items),\n\n ...(block.data.appearance && { appearance: JSON.stringify(block.data.appearance) }),\n ...(columns && { columns: columns }),\n },\n };\n}\n\nfunction serializeCustomBlockNodeType(block: PageBlockEditorModel, definition: PageBlockDefinition): string {\n switch (block.data.packageId) {\n case \"io.supernova.block.image\":\n return \"image\";\n\n default:\n return \"blockNode\";\n }\n}\n\nfunction nonNullFilter<T>(item: T | null): item is T {\n return !!item;\n}\n","import { PageBlockEditorModel } from \"./model/block\";\nimport {\n PageBlockDefinition,\n PageBlockDefinitionPropertyType,\n PageBlockItemEmbedValue,\n PageBlockItemMultiRichTextValue,\n PageBlockItemRichTextValue,\n PageBlockItemTableValue,\n PageBlockItemUntypedValue,\n PageBlockItemV2,\n PageBlockText,\n} from \"@supernova-studio/model\";\n\nexport const BlockParsingUtils = {\n singleBlockItem(block: PageBlockEditorModel) {\n if (!block.data.items.length) throw new Error(`Block ${block.id} has no items`);\n if (block.data.items.length > 1) throw new Error(`Block ${block.id} has more than 1 item`);\n\n return block.data.items[0]!;\n },\n\n richTextPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemRichTextValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const richText = PageBlockItemRichTextValue.parse(objectValue);\n\n return richText;\n },\n\n multiRichTextPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemMultiRichTextValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const richText = PageBlockItemMultiRichTextValue.parse(objectValue);\n\n return richText;\n },\n\n tablePropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemTableValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const table = PageBlockItemTableValue.parse(objectValue);\n\n return table;\n },\n\n embedPropertyValue(item: PageBlockItemV2, propertyKey: string): PageBlockItemEmbedValue {\n const objectValue = this.objectPropertyValue(item, propertyKey);\n const embed = PageBlockItemEmbedValue.parse(objectValue);\n\n return embed;\n },\n\n objectPropertyValue(item: PageBlockItemV2, propertyKey: string) {\n const value = this.propertyValueOrThrow(item, propertyKey);\n\n if (typeof value !== \"object\") {\n throw new Error(`Value for property ${propertyKey} is expected to be an object, but instead is ${typeof value}`);\n }\n\n return value;\n },\n\n propertyValueOrThrow(item: PageBlockItemV2, propertyKey: string): PageBlockItemUntypedValue {\n const value = item.props[propertyKey];\n if (!value) throw new Error(`Property ${propertyKey} is not defined on block item`);\n\n return value;\n },\n};\n\nexport const BlockDefinitionUtils = {\n firstRichTextProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"RichText\");\n if (property) return property;\n return undefined;\n },\n\n firstMultiRichTextProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"MultiRichText\");\n if (property) return property;\n return undefined;\n },\n\n firstTableProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"Table\");\n if (property) return property;\n return undefined;\n },\n\n firstEmbedProperty(definition: PageBlockDefinition) {\n const property = definition.item.properties.find(p => p.type === \"EmbedURL\");\n if (property) return property;\n return undefined;\n },\n\n richTextProperty(definition: PageBlockDefinition, propertyKey: string) {\n return this.property(definition, propertyKey, \"RichText\");\n },\n\n property(\n definition: PageBlockDefinition,\n propertyKey: string,\n expectedPropertyType?: PageBlockDefinitionPropertyType\n ) {\n const property = definition.item.properties.find(p => p.id === propertyKey);\n if (!property) {\n throw new Error(`Definition ${definition.id} doesn't contain property ${propertyKey}`);\n }\n\n if (expectedPropertyType && property.type !== expectedPropertyType) {\n throw new Error(\n `Property ${propertyKey} of definition ${definition.id} expected to be ${expectedPropertyType} but was ${property.type}`\n );\n }\n\n return property;\n },\n};\n","import {\n PageBlockDefinitionMultiRichTextPropertyStyle,\n PageBlockDefinitionMutiRichTextOptions,\n PageBlockDefinitionProperty,\n PageBlockText,\n} from \"@supernova-studio/model\";\nimport { PageBlockEditorModel } from \"./model\";\nimport { BlockParsingUtils } from \"./utils\";\n\ntype Node = ListNode | ListItemNode;\n\nexport type ListNode = {\n type: \"List\";\n listType: \"Ordered\" | \"Unordered\";\n block: PageBlockEditorModel;\n leadingChildren: ListItemNode[];\n children: Node[];\n};\n\nexport type ListItemNode = {\n type: \"ListItem\";\n text: PageBlockText;\n};\n\nexport class ListTreeBuilder {\n private rootNode: ListNode | undefined;\n\n addWithProperty(\n block: PageBlockEditorModel,\n multiRichTextProperty: PageBlockDefinitionProperty\n ): ListNode | undefined {\n const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);\n return this.add(block, multiRichTextProperty.id, parsedOptions?.multiRichTextStyle || \"OL\");\n }\n\n add(\n block: PageBlockEditorModel,\n multiRichTextPropertyId: string,\n multiRichTextPropertyStyle: PageBlockDefinitionMultiRichTextPropertyStyle\n ) {\n const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);\n\n // No root\n if (!this.rootNode) {\n this.rootNode = list;\n return undefined;\n }\n\n // Inserting at the root\n if (block.data.indentLevel <= 0) {\n const flushed = this.flush();\n this.rootNode = list;\n return flushed;\n }\n\n // Inserting at a depth\n const listParent = this.getParentOfDepth(block.data.indentLevel);\n\n const lastChild = listParent.children[listParent.children.length - 1];\n if (lastChild?.type === \"List\") {\n // Merge items into the current list\n lastChild.children.push(...list.leadingChildren);\n return;\n } else {\n // We can add this list as a child of another list\n listParent.children.push(list);\n }\n }\n\n flush(): ListNode | undefined {\n const node = this.rootNode;\n this.rootNode = undefined;\n return node;\n }\n\n private getParentOfDepth(depth: number): ListNode {\n if (!this.rootNode || depth <= 0) throw new Error(\"Invalid state\");\n\n let currentNode = this.rootNode;\n let currentDepth = depth - 1;\n\n while (currentDepth > 0) {\n // Check if we can go any lower\n if (currentNode.children.length === 0) return currentNode;\n\n const lastChild = currentNode.children[currentNode.children.length - 1];\n if (lastChild.type !== \"List\") {\n // Cannot go lower if last child is not a list\n return currentNode;\n }\n\n currentNode = lastChild;\n currentDepth--;\n }\n\n return currentNode;\n }\n\n private createList(\n block: PageBlockEditorModel,\n multiRichTextPropertyId: string,\n multiRichTextPropertyStyle: PageBlockDefinitionMultiRichTextPropertyStyle\n ): ListNode {\n // private createList(block: PageBlockEditorModel, multiRichTextProperty: PageBlockDefinitionProperty): ListNode {\n const blockItem = BlockParsingUtils.singleBlockItem(block);\n const multiRichTextValue = BlockParsingUtils.multiRichTextPropertyValue(blockItem, multiRichTextPropertyId);\n\n const leadingChildren: ListNode[\"leadingChildren\"] = multiRichTextValue.value.map(t => {\n return {\n type: \"ListItem\",\n text: t,\n };\n });\n\n if (!leadingChildren.length) {\n leadingChildren.push({ type: \"ListItem\", text: { spans: [] } });\n }\n\n return {\n type: \"List\",\n listType: multiRichTextPropertyStyle === \"OL\" ? \"Ordered\" : \"Unordered\",\n leadingChildren: leadingChildren,\n block: block,\n children: [],\n };\n }\n}\n","import { PageBlockDefinition } from \"@supernova-studio/model\";\n\nexport function getMockPageBlockDefinitions(): PageBlockDefinition[] {\n return blocks.map(block => {\n return {\n ...block,\n item: {\n ...block.item,\n\n // Make sure variatns array is copied\n variants: [...block.item.variants],\n },\n };\n });\n}\n\nconst blocks: PageBlockDefinition[] = [\n {\n id: \"io.supernova.block.rich-text\",\n name: \"Text\",\n description: \"Plain text\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/text.svg\",\n searchKeywords: [\"paragraph\", \"rich text\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n richTextStyle: \"Default\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {\n isEditorPresentationDifferent: false,\n },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use rich text block to write text and add additional formatting to it.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/text-HxZ9ssJR\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title1\",\n name: \"Heading 1\",\n description: \"Main sections within the page\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-1.svg\",\n searchKeywords: [\"title\", \"h1\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 1\",\n richTextStyle: \"Title1\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for main sections within the page, introducing broad topics or themes.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title2\",\n name: \"Heading 2\",\n description: \"Section subheadings\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-2.svg\",\n searchKeywords: [\"title\", \"h2\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 2\",\n richTextStyle: \"Title2\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for subheadings, indicating major subsections under the main sections.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title3\",\n name: \"Heading 3\",\n description: \"Further subsections\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-3.svg\",\n searchKeywords: [\"title\", \"h3\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 3\",\n richTextStyle: \"Title3\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for further subsections, detailing specific topics within the major subsections.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title4\",\n name: \"Heading 4\",\n description: \"Details in subsections\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-4.svg\",\n searchKeywords: [\"title\", \"h4\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 4\",\n richTextStyle: \"Title4\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: 1, allowLinks: false },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for sub-divisions, elaborating on details within the subsections.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.title5\",\n name: \"Heading 5\",\n description: \"Nuanced details or sub-points\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/title-5.svg\",\n searchKeywords: [\"title\", \"h5\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: {\n placeholder: \"Heading 5\",\n richTextStyle: \"Title5\",\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: 1, allowLinks: false },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use for nuanced details or specific sub-points within sub-divisions.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/heading-MUKlJ7dY\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.ordered-list\",\n name: \"Numbered list\",\n description: \"An ordered list with numbers\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/list-ordered.svg\",\n searchKeywords: [\"ol\", \"ordered\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"MultiRichText\",\n options: { multiRichTextStyle: \"OL\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Display a sequence of numbers or letters to indicate order.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/list-UC5iPZLK\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.unordered-list\",\n name: \"Bulleted list\",\n description: \"A list with bullet points\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/list-unordered.svg\",\n searchKeywords: [\"ul\", \"bullet points\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"MultiRichText\",\n options: { multiRichTextStyle: \"UL\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"text\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"A list of items displayed with bullet points without a specific sequence.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/list-UC5iPZLK\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.do-dont-guidelines\",\n name: \"Guidelines\",\n description: \"Document your Do's and Don'ts.\",\n category: \"Guidelines\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/guidelines.svg\",\n searchKeywords: [\"do\", \"dont\", \"caution\", \"rules\"],\n item: {\n properties: [\n {\n id: \"block.do-dont-guidelines.property.image\",\n name: \"Image\",\n type: \"Image\",\n options: { allowCaption: true },\n },\n {\n id: \"block.do-dont-guidelines.property.type\",\n name: \"Type\",\n type: \"SingleSelect\",\n options: {\n defaultChoice: \"do\",\n choices: [\n { value: \"do\", name: \"Do\", color: \"Green\", icon: \"CheckCircle\" },\n { value: \"dont\", name: \"Don't\", color: \"Red\", icon: \"CrossCircle\" },\n { value: \"caution\", name: \"Caution\", color: \"Orange\", icon: \"Alert\" },\n ],\n singleSelectStyle: \"ToggleButton\",\n },\n },\n {\n id: \"block.do-dont-guidelines.property.description\",\n name: \"Description\",\n type: \"RichTextEditor\",\n options: {\n allowedInlineStyles: [\"Bold\", \"Italic\", \"Strikethrough\", \"UL\", \"OL\", \"Link\", \"InlineCode\"],\n placeholder: \"Add description\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"simple\",\n name: \"Simple\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-simple.svg\",\n description: \"With a minimalist badge at the top, this design is great for content guidelines.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 2,\n appearance: {},\n },\n {\n id: \"prominent\",\n name: \"Prominent\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-prominent.svg\",\n description: \"Recommended when you need guidelines that need to stand out.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n {\n id: \"contained\",\n name: \"Contained\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-contained.svg\",\n description: \"Perfect for component guidelines with spacious images.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n {\n id: \"side-border\",\n name: \"Side border\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/guidelines-side-border.svg\",\n description: \"The side border makes this variant well-suited for longer text guidelines.\",\n layout: {\n type: \"Column\",\n children: [\n \"block.do-dont-guidelines.property.type\",\n \"block.do-dont-guidelines.property.image\",\n \"block.do-dont-guidelines.property.description\",\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 3,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"simple\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: -1, allowLinks: false, newItemLabel: \"Add guideline\" },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use link block to document your Do/Don't guidelines for your components and patterns.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/links/shortcuts/general-jVfNifo4\",\n },\n newItemLabel: \"Add guideline\",\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.divider\",\n name: \"Divider\",\n description: \"A section divider\",\n category: \"Layout\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/divider.svg\",\n searchKeywords: [\"hr\", \"line\", \"rule\", \"separator\"],\n item: {\n properties: [{ id: \"divider\", name: \"Divider\", type: \"Divider\", options: {} }],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"divider\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"A thematic break or horizontal rule, often used to separate content or define a change in topic.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/divider-tLuxooLH\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.blockquote\",\n name: \"Quote\",\n description: \"Display a quotation\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/blockquote.svg\",\n searchKeywords: [\"cite\", \"blockquote\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: { placeholder: \"Write a quote...\", richTextStyle: \"Quote\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"text\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use a blockquote to set off a quotation or cited content from the main text.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/blockquote-zYWAsb6X\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.callout\",\n name: \"Callout\",\n description: \"Highlight a section of text\",\n category: \"Text\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/callout.svg\",\n searchKeywords: [\"banner\", \"alert\", \"note\", \"tip\", \"warning\"],\n item: {\n properties: [\n {\n id: \"text\",\n name: \"Text\",\n type: \"RichText\",\n options: { placeholder: \"Highlight some information...\", richTextStyle: \"Callout\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"text\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use to highlight a section of text.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/text/callout-ZPlZObD1\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.image\",\n name: \"Image\",\n description: \"Display an image or Figma image\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/image.svg\",\n searchKeywords: [\"image\", \"figma\", \"frame\", \"picture\", \"photo\"],\n item: {\n properties: [\n {\n id: \"image\",\n name: \"Image\",\n type: \"Image\",\n options: { allowCaption: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"image\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use to display an image or Figma image.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/image-Ue8VdT8B\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.shortcut-links\",\n name: \"Shortcut links\",\n description: \"Link to a page or external URL\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/shortcuts.svg\",\n searchKeywords: [\"url\", \"page\", \"card\"],\n item: {\n properties: [\n {\n id: \"block.links.property.image\",\n name: \"Image\",\n type: \"Image\",\n options: { aspectRatio: \"Landscape\", allowCaption: false },\n variantOptions: {\n iconOnTop: { width: \"Icon\", aspectRatio: \"Square\" },\n imageOnLeft: { width: \"Medium\" },\n iconOnLeft: { width: \"Icon\", aspectRatio: \"Square\" },\n },\n },\n {\n id: \"block.links.property.title\",\n name: \"Title\",\n type: \"Text\",\n options: { textStyle: \"Title5\", placeholder: \"Add title\", allowLineBreaks: false },\n },\n {\n id: \"block.links.property.description\",\n name: \"Short description\",\n type: \"Text\",\n options: { textStyle: \"Default\", color: \"NeutralFaded\", placeholder: \"Add description\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"imageOnTop\",\n name: \"Image on top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-image-on-top.svg\",\n layout: {\n type: \"Column\",\n children: [\"block.links.property.image\", \"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 3,\n appearance: {},\n },\n {\n id: \"imageOnLeft\",\n name: \"Image on left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-leading-image.svg\",\n layout: {\n type: \"Row\",\n children: [\n {\n type: \"Column\",\n children: [\"block.links.property.image\"],\n columnAlign: \"Start\",\n columnResizing: \"Hug\",\n gap: \"Medium\",\n },\n {\n type: \"Column\",\n children: [\"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Small\",\n },\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"iconOnTop\",\n name: \"Icon on top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-icon-on-top.svg\",\n layout: {\n type: \"Column\",\n children: [\"block.links.property.image\", \"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"iconOnLeft\",\n name: \"Icon on left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/shortcuts-leading-icon.svg\",\n layout: {\n type: \"Row\",\n children: [\n {\n type: \"Column\",\n children: [\"block.links.property.image\"],\n columnAlign: \"Start\",\n columnResizing: \"Hug\",\n gap: \"Medium\",\n },\n {\n type: \"Column\",\n children: [\"block.links.property.title\", \"block.links.property.description\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Small\",\n },\n ],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 2,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"imageOnTop\",\n },\n behavior: {\n dataType: \"Item\",\n items: { numberOfItems: -1, allowLinks: true, newItemLabel: \"Add shortcut\" },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Use link block to create single or multiple links to places in or out of your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/links/shortcuts/general-jVfNifo4\",\n },\n newItemLabel: \"Add shortcut\",\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.embed-figma\",\n name: \"Figma embed\",\n description: \"Embed a Figma canvas or prototype\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/embed-figma.svg\",\n searchKeywords: [\"embed\", \"figma\", \"design\", \"prototype\", \"canvas\"],\n item: {\n properties: [\n {\n id: \"embed\",\n name: \"Figma URL\",\n type: \"EmbedURL\",\n options: {\n allowCaption: false,\n allowResize: true,\n defaultHeight: 400,\n urlValidationRegex: \"^(https?://)?(www.)?(figma.com)/.+$\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"embed\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a Figma canvas or prototype to your documentation.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/figma/embed-figma-GPNJsT8A\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.storybook\",\n name: \"Storybook\",\n description: \"Embed Storybook canvas\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/storybook.svg\",\n searchKeywords: [\"storybook\", \"story\", \"stories\", \"example\", \"preview\", \"code\", \"react\"],\n item: {\n properties: [\n {\n id: \"embed\",\n name: \"Storybook URL\",\n type: \"Storybook\",\n options: {\n allowCaption: true,\n allowResize: true,\n defaultHeight: 400,\n renderLayoutAs: \"Iframe\",\n },\n variantOptions: {\n playground: {\n renderLayoutAs: \"Playground\",\n defaultHeight: 400,\n allowResize: true,\n },\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"playground\",\n name: \"Playground\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/storybook-playground.svg\",\n description: \"Embed a Storybook story with a preview of the component and controls to adjust the props.\",\n layout: {\n type: \"Column\",\n children: [\"embed\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"default\",\n name: \"HTML iframe\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/storybook-iframe.svg\",\n description: \"Embed a Storybook story in an iframe.\",\n layout: {\n type: \"Column\",\n children: [\"embed\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"playground\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a Storybook story to your documentation.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/code/storybook-1EGPhwBl\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.embed-youtube\",\n name: \"YouTube\",\n description: \"Embed a Youtube video\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/embed-youtube.svg\",\n searchKeywords: [\"embed\", \"video\", \"player\", \"upload\"],\n item: {\n properties: [\n {\n id: \"embed\",\n name: \"Youtube URL\",\n type: \"EmbedURL\",\n options: {\n allowCaption: false,\n allowResize: false,\n defaultHeight: 400,\n urlValidationRegex: \"^(https?://)?(www.)?(youtube.com|youtu.?be)/.+$\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"embed\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a YouTube video to your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/youtube-Gh8VUrSF\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.embed-lottie\",\n name: \"Lottie animation\",\n description: \"Preview a Lottie animation\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/lottie.svg\",\n searchKeywords: [\"embed\", \"lottie\", \"animation\", \"rive\", \"json\"],\n item: {\n properties: [\n {\n id: \"url\",\n name: \"Lottie URL\",\n type: \"URL\",\n description: \"Add URL to your Lottie animation file. We support .json and .lottie file extensions.\",\n options: { urlValidationRegex: \"^(http|https)://.*.(json|lottie)$\" },\n },\n {\n id: \"height\",\n name: \"Height\",\n type: \"Number\",\n options: { defaultValue: 270 },\n },\n {\n id: \"width\",\n name: \"Width\",\n type: \"Number\",\n options: { defaultValue: 400 },\n },\n {\n id: \"autoplay\",\n name: \"Autoplay\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n {\n id: \"loop\",\n name: \"Loop\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n {\n id: \"playerControls\",\n name: \"Show player controls\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/lottie-player.svg\",\n description: \"Embed a Lottie animation to your documentation.\",\n layout: {\n type: \"Column\",\n children: [\"url\", \"height\", \"width\", \"autoplay\", \"loop\", \"playerControls\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed a Lottie animation to your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/lottie-preview-7CqFdGv9\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: true,\n showBlockHeaderInEditor: true,\n },\n },\n {\n id: \"io.supernova.block.embed\",\n name: \"Embed\",\n description: \"Embed a generic URL\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/embed.svg\",\n searchKeywords: [\"embed\", \"url\", \"iframe\", \"site\", \"import\"],\n item: {\n properties: [\n {\n id: \"embedUrl\",\n name: \"Embed URL\",\n type: \"EmbedURL\",\n options: {\n allowCaption: true,\n allowResize: true,\n defaultHeight: 400,\n urlValidationRegex: \"^(https?://)?(www.)?.+$\",\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"embedUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Embed any page to your documentation as an iframe.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/embed/public-url-2ZeRQ332\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.markdown\",\n name: \"Markdown\",\n description: \"Render Markdown URL\",\n category: \"Other\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/markdown.svg\",\n searchKeywords: [\"md\", \"embed\", \"api\", \"props\", \"mdx\"],\n item: {\n properties: [\n {\n id: \"markdownUrl\",\n name: \"Markdown URL\",\n type: \"Markdown\",\n options: { urlValidationRegex: \"^(https?://)?(www\\\\.)?.+\\\\.md(\\\\?.*)?$\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"plain\",\n name: \"Plain\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/markdown-plain.svg\",\n layout: {\n type: \"Column\",\n children: [\"markdownUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"bordered\",\n name: \"Bordered\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/markdown-bordered.svg\",\n layout: {\n type: \"Column\",\n children: [\"markdownUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"boxed\",\n name: \"Boxed\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/markdown-boxed.svg\",\n layout: {\n type: \"Column\",\n children: [\"markdownUrl\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"plain\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Render any markdown file directly inside of your documentation.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/code/markdown/general-B8wQVOem\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: true,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.table\",\n name: \"Table\",\n description: \"Display a simple table\",\n category: \"Layout\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/table.svg\",\n searchKeywords: [\"grid\", \"data\", \"spreadsheet\", \"api\"],\n item: {\n properties: [{ id: \"table\", name: \"Table\", type: \"Table\", options: {} }],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: { type: \"Column\", children: [\"table\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Use for displaying data in a tabular format.\",\n documentationLink: \"https://learn.supernova.io/latest/documentation/types-of-blocks/layout/table-R8KGnxej\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.design-tokens\",\n name: \"Design tokens\",\n description: \"A list of design tokens\",\n category: \"Tokens\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/design-tokens.svg\",\n searchKeywords: [\n \"tokens\",\n \"color\",\n \"typography\",\n \"spacing\",\n \"grid\",\n \"material\",\n \"theme\",\n \"token list\",\n \"token group\",\n ],\n item: {\n properties: [\n {\n id: \"tokens\",\n name: \"Tokens\",\n type: \"Token\",\n options: { renderLayoutAs: \"List\", defaultTheme: \"none\", defaultValuePreview: \"Split\" },\n variantOptions: { grid: { renderLayoutAs: \"Grid\" } },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"table\",\n name: \"Table\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/tokens-table.svg\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"grid\",\n name: \"Grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/tokens-grid.svg\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"table\",\n },\n behavior: { dataType: \"Token\", entities: { selectionType: \"EntityAndGroup\", maxSelected: 0 } },\n editorOptions: {\n onboarding: {\n helpText: \"Show a group of design tokens. Automatically display all subgroups too.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/token/tokens/general-84NRgxGl#section-token-group-09\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.token-color-ramps\",\n name: \"Color ramps\",\n description: \"The best way to display colors\",\n category: \"Tokens\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/color-ramp.svg\",\n searchKeywords: [\"tokens\", \"ramp\", \"shades\", \"palette\", \"spectrum\", \"stack\", \"range\", \"swatch\"],\n item: {\n properties: [\n {\n id: \"tokens\",\n name: \"Tokens\",\n type: \"Token\",\n options: { allowedTypes: [\"Color\"], allowPropertySelection: false, allowThemeSelection: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/tokens-color-stack.svg\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 2,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Token\", entities: { selectionType: \"EntityAndGroup\", maxSelected: 0 } },\n editorOptions: {\n onboarding: { helpText: \"The best way to display colors\", documentationLink: \"https://learn.supernova.io\" },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.color-accessibility-grid\",\n name: \"Accessibility color grid\",\n description: \"Visualize accessibility of your color tokens\",\n category: \"Tokens\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/token-accessibility-grid.svg\",\n searchKeywords: [\"tokens\", \"color\", \"accessibility\", \"grid\", \"contrast\"],\n item: {\n properties: [\n {\n id: \"tokens\",\n name: \"Tokens\",\n type: \"Token\",\n options: { allowedTypes: [\"Color\"], allowPropertySelection: false, allowThemeSelection: false },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/contrast-grid-large.svg\",\n description:\n \"Visualize accessibility of your colors by automatically calculating their color contrast ratio.\",\n layout: { type: \"Column\", children: [\"tokens\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Token\", entities: { selectionType: \"EntityAndGroup\", maxSelected: 0 } },\n editorOptions: {\n onboarding: {\n helpText: \"Visualize accessibility of your colors by automatically calculating their color contrast ratio.\",\n documentationLink: \"https://learn.supernova.io\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.code\",\n name: \"Code\",\n description: \"Display simple code examples\",\n category: \"Code\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/code.svg\",\n searchKeywords: [\"code\"],\n item: {\n properties: [\n {\n id: \"code\",\n name: \"Code\",\n type: \"Code\",\n options: {},\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"code\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Item\",\n items: {\n numberOfItems: 1,\n allowLinks: false,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display simple code examples\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.code-react\",\n name: \"React code\",\n description: \"Render a code snippet\",\n category: \"Code\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v3/code-react.svg\",\n searchKeywords: [\"code\", \"react\", \"snippet\", \"storybook\", \"editor\", \"example\", \"sandbox\"],\n item: {\n properties: [\n {\n id: \"code\",\n name: \"Code\",\n type: \"CodeSandbox\",\n options: { renderLayoutAs: \"PreviewOnTop\" },\n variantOptions: {\n codeTop: { renderLayoutAs: \"PreviewOnBottom\" },\n codeLeft: { renderLayoutAs: \"PreviewOnRight\" },\n codeRight: { renderLayoutAs: \"PreviewOnLeft\" },\n },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"codeBottom\",\n name: \"Full width, code bottom\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-bottom.svg\",\n description: \"Full-width block of code, with a preview on top.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"codeTop\",\n name: \"Full width, code top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-top.svg\",\n description: \"Full-width block of code, with a preview on bottom.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"codeLeft\",\n name: \"Side by side, code left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-left.svg\",\n description: \"Side-by-side preview and code, with code on the left.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"codeRight\",\n name: \"Side by side, code right\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/react-code-right.svg\",\n description: \"Side-by-side preview and code, with code on the right.\",\n layout: { type: \"Column\", children: [\"code\"], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"codeBottom\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Display rendered code example\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/code/render-react-code-vxufnkFm\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.assets\",\n name: \"Vector assets\",\n description: \"Display icons or illustrations\",\n category: \"Assets\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/assets.svg\",\n searchKeywords: [\"icons\", \"illustrations\", \"grid\", \"svg\", \"logos\", \"vectors\"],\n item: {\n properties: [\n {\n id: \"assets\",\n name: \"Assets\",\n type: \"Asset\",\n options: {},\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Simple grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/assets-simple-grid.svg\",\n description: \"A simple grid. Both the title and description are displayed below the preview.\",\n layout: {\n type: \"Column\",\n children: [\"assets\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 4,\n appearance: {},\n },\n {\n id: \"square-grid\",\n name: \"Square grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/assets-square-grid.svg\",\n description: \"Bordered square grid tailored for displaying icon assets.\",\n layout: {\n type: \"Column\",\n children: [\"assets\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 4,\n appearance: {\n isEditorPresentationDifferent: true,\n },\n },\n {\n id: \"borderless-grid\",\n name: \"Borderless grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/assets-borderless-grid.svg\",\n description: \"Borderless grid, perfect for displaying vector assets of the same height.\",\n layout: {\n type: \"Column\",\n children: [\"assets\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 4,\n appearance: {\n isEditorPresentationDifferent: true,\n },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"Asset\",\n entities: {\n selectionType: \"EntityAndGroup\",\n maxSelected: 0,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display a grid of icons or illustrations.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/media-and-assets/asset/general-xa6EgXb2\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.figma-frames\",\n name: \"Figma images\",\n description: \"Generate images from Figma layers\",\n category: \"Figma\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/figma-frames.svg\",\n searchKeywords: [\"figma\", \"frames\", \"image\", \"layer\"],\n item: {\n properties: [\n {\n id: \"figmaNodes\",\n name: \"Figma Frames\",\n type: \"FigmaNode\",\n options: {},\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"bordered\",\n name: \"Bordered\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-nodes-boxed.svg\",\n description: \"Tiles with background and border, great for larger sets of frames.\",\n layout: {\n type: \"Column\",\n children: [\"figmaNodes\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"plain\",\n name: \"Plain\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-nodes-plain.svg\",\n description: \"Frame as it is in Figma with no extra formatting, great for single images.\",\n layout: {\n type: \"Column\",\n children: [\"figmaNodes\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 8,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"bordered\",\n },\n behavior: { dataType: \"FigmaNode\", entities: { selectionType: \"Entity\", maxSelected: 0 } },\n editorOptions: {\n onboarding: {\n helpText: \"Generate images from Figma layers\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/figma/figma-frames/general-f3IYC5dg\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.release-notes\",\n name: \"Release notes\",\n description: \"Show version release notes\",\n category: \"Other\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/release-notes.svg\",\n searchKeywords: [\"version\", \"changelog\", \"history\"],\n item: {\n properties: [],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/release-notes-2.svg\",\n description: \"Show formatted release notes from all previously released versions.\",\n layout: { type: \"Column\", children: [], columnAlign: \"Start\", columnResizing: \"Fill\", gap: \"Medium\" },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Item\", items: { numberOfItems: 1, allowLinks: false } },\n editorOptions: {\n onboarding: {\n helpText: \"Show formatted release notes from all previously released versions.\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: true,\n showBlockHeaderInEditor: true,\n },\n },\n {\n id: \"io.supernova.block.component-checklist\",\n name: \"Component checklist\",\n description: \"Highlight specific component properties\",\n category: \"Components\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/component-checklist.svg\",\n searchKeywords: [\"components\", \"health\", \"properties\", \"overview\", \"status\"],\n item: {\n properties: [\n {\n id: \"components\",\n name: \"Components\",\n type: \"Component\",\n options: { renderLayoutAs: \"List\" },\n },\n {\n id: \"title\",\n name: \"Title\",\n type: \"Text\",\n options: { defaultValue: \"Component checklist\" },\n },\n {\n id: \"showDescription\",\n name: \"Show description\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/component-checklist.svg\",\n layout: {\n type: \"Column\",\n children: [\"components\", \"showDescription\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Component\", entities: { selectionType: \"Entity\", maxSelected: 1 } },\n editorOptions: {\n onboarding: {\n helpText: \"Highlight specific component properties\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-checklist-NXepPIpZ\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.component-checklist-all\",\n name: \"Component overview table\",\n description: \"Show an overview of all components\",\n category: \"Components\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/component-overview-table.svg\",\n searchKeywords: [\"components\", \"health\", \"overview\", \"status\"],\n item: {\n properties: [\n {\n id: \"components\",\n name: \"Components\",\n type: \"Component\",\n options: { renderLayoutAs: \"Table\" },\n },\n {\n id: \"showLastUpdatedColumn\",\n name: \"Show last updated column\",\n type: \"Boolean\",\n options: { defaultValue: true },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/component-overview-table.svg\",\n layout: {\n type: \"Column\",\n children: [\"components\", \"showLastUpdatedColumn\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Component\", entities: { selectionType: \"Group\", maxSelected: 1 } },\n editorOptions: {\n onboarding: {\n helpText: \"Show an overview of all your components\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-overview-table-W8eOtJ5t\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.component-health\",\n name: \"Component health\",\n description: \"Show component health and other attributes\",\n category: \"Components\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/v2/component-health.svg\",\n searchKeywords: [\"components\", \"health\", \"properties\", \"overview\", \"status\"],\n item: {\n properties: [\n {\n id: \"components\",\n name: \"Components\",\n type: \"Component\",\n options: { renderLayoutAs: \"List\" },\n },\n ],\n appearance: { isBordered: true, hasBackground: false },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/component-health.svg\",\n layout: {\n type: \"Column\",\n children: [\"components\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: { isEditorPresentationDifferent: true },\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: { dataType: \"Component\", entities: { selectionType: \"Entity\", maxSelected: 1 } },\n editorOptions: {\n onboarding: {\n helpText: \"Show component health and additional attributes\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/component/component-health-sezSxEED\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.figma-components\",\n name: \"Figma component\",\n description: \"Display components and variants from Figma\",\n category: \"Figma\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/figma-component.svg\",\n searchKeywords: [\"variants\", \"properties\"],\n item: {\n properties: [\n {\n id: \"figmaComponent\",\n name: \"Figma component\",\n type: \"FigmaComponent\",\n options: {\n renderLayoutAs: \"Grid\",\n },\n variantOptions: {\n canvas: {\n renderLayoutAs: \"Canvas\",\n },\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"grid\",\n name: \"Grid\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-component-grid.svg\",\n description: \"Components or variants will be rendered individually in a grid layout\",\n layout: {\n type: \"Column\",\n children: [\"figmaComponent\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"canvas\",\n name: \"Canvas\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/figma-component-canvas.svg\",\n description: \"Components or variants will be rendered on a single canvas\",\n layout: {\n type: \"Column\",\n children: [\"figmaComponent\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"grid\",\n },\n behavior: {\n dataType: \"FigmaComponent\",\n entities: {\n selectionType: \"Entity\",\n maxSelected: 0,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display Figma component variants or group of components.\",\n documentationLink:\n \"https://learn.supernova.io/latest/documentation/types-of-blocks/token/tokens/general-84NRgxGl#section-token-group-09\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.figma-components-propstable\",\n name: \"Figma component properties\",\n description: \"Display list of Figma component properties\",\n category: \"Figma\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/figma-component-properties.svg\",\n searchKeywords: [\"variants\", \"properties\", \"props\", \"table\"],\n item: {\n properties: [\n {\n id: \"figmaComponent\",\n name: \"Figma component\",\n type: \"FigmaComponent\",\n options: {\n renderLayoutAs: \"PropsTable\",\n invertPropertySelection: true,\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"default\",\n name: \"Default\",\n layout: {\n type: \"Column\",\n children: [\"figmaComponent\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 1,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"default\",\n },\n behavior: {\n dataType: \"FigmaComponent\",\n entities: {\n selectionType: \"Entity\",\n maxSelected: 1,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display properties based on Figma component data.\",\n documentationLink: \"\",\n },\n },\n appearance: {\n isBordered: true,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n {\n id: \"io.supernova.block.files\",\n name: \"File upload\",\n description: \"Display attachments for download\",\n category: \"Media\",\n icon: \"https://cdn-assets.supernova.io/blocks/icons/files.svg\",\n searchKeywords: [\"files\", \"attachments\", \"download\", \"upload\"],\n item: {\n properties: [\n {\n id: \"files\",\n name: \"Files\",\n type: \"File\",\n options: {\n renderLayoutAs: \"iconOnLeft\",\n },\n variantOptions: {\n iconOnTop: {\n renderLayoutAs: \"iconOnTop\",\n },\n iconOnLeft: {\n renderLayoutAs: \"iconOnLeft\",\n },\n },\n },\n ],\n appearance: {\n isBordered: true,\n hasBackground: false,\n },\n variants: [\n {\n id: \"iconOnTop\",\n name: \"Icon on top\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/files-icon-on-top.svg\",\n layout: {\n type: \"Column\",\n children: [\"files\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 4,\n defaultColumns: 1,\n appearance: {},\n },\n {\n id: \"iconOnLeft\",\n name: \"Icon on left\",\n image: \"https://cdn-assets.supernova.io/blocks/variants/files-leading-icon.svg\",\n layout: {\n type: \"Column\",\n children: [\"files\"],\n columnAlign: \"Start\",\n columnResizing: \"Fill\",\n gap: \"Medium\",\n },\n maxColumns: 2,\n defaultColumns: 1,\n appearance: {},\n },\n ],\n defaultVariantKey: \"iconOnTop\",\n },\n behavior: {\n dataType: \"File\",\n entities: {\n selectionType: \"Entity\",\n maxSelected: 0,\n },\n },\n editorOptions: {\n onboarding: {\n helpText: \"Display attachments for download\",\n documentationLink: \"https://learn.supernova.io/file-upload-block\",\n },\n },\n appearance: {\n isBordered: false,\n hasBackground: false,\n isEditorPresentationDifferent: false,\n showBlockHeaderInEditor: false,\n },\n },\n];\n","import {\n PageBlockAppearanceV2,\n PageBlockCalloutType,\n PageBlockColorV2,\n PageBlockDefinition,\n PageBlockDefinitionProperty,\n PageBlockDefinitionPropertyType,\n PageBlockItemAssetPropertyValue,\n PageBlockItemAssetValue,\n PageBlockItemBooleanValue,\n PageBlockItemCodeValue,\n PageBlockItemColorValue,\n PageBlockItemComponentPropertyValue,\n PageBlockItemComponentValue,\n PageBlockItemDividerValue,\n PageBlockItemEmbedValue,\n PageBlockItemFigmaComponentValue,\n PageBlockItemFigmaNodeValue,\n PageBlockItemFileValue,\n PageBlockItemImageValue,\n PageBlockItemMarkdownValue,\n PageBlockItemMultiRichTextValue,\n PageBlockItemMultiSelectValue,\n PageBlockItemNumberValue,\n PageBlockItemRichTextEditorListNode,\n PageBlockItemRichTextEditorNode,\n PageBlockItemRichTextEditorParagraphNode,\n PageBlockItemRichTextEditorValue,\n PageBlockItemRichTextValue,\n PageBlockItemSandboxValue,\n PageBlockItemSingleSelectValue,\n PageBlockItemStorybookValue,\n PageBlockItemStorybookValueOld,\n PageBlockItemTableCell,\n PageBlockItemTableNode,\n PageBlockItemTableValue,\n PageBlockItemTextValue,\n PageBlockItemTokenPropertyValue,\n PageBlockItemTokenTypeValue,\n PageBlockItemTokenValue,\n PageBlockItemUntypedValue,\n PageBlockItemUrlValue,\n PageBlockItemV2,\n PageBlockTableCellAlignment,\n PageBlockText,\n PageBlockTextSpan,\n PageBlockTextSpanAttribute,\n PageSectionColumnV2,\n PageSectionItemV2,\n nullishToOptional,\n storybookValueFromOldValue,\n} from \"@supernova-studio/model\";\nimport { yXmlFragmentToProsemirrorJSON } from \"y-prosemirror\";\nimport * as Y from \"yjs\";\nimport { ZodSchema, ZodTypeDef, z } from \"zod\";\nimport { PageBlockEditorModel, PageSectionEditorModel } from \"./model/block\";\nimport { DocumentationPageEditorModel } from \"./model/page\";\nimport { ProsemirrorMark, ProsemirrorNode } from \"./prosemirror/types\";\nimport { BlockDefinitionUtils } from \"./utils\";\n\nexport function yDocToPage(yDoc: Y.Doc, definitions: PageBlockDefinition[]): DocumentationPageEditorModel {\n return yXmlFragmentToPage(yDoc.getXmlFragment(\"default\"), definitions);\n}\n\nexport function yXmlFragmentToPage(\n fragment: Y.XmlFragment,\n definitions: PageBlockDefinition[]\n): DocumentationPageEditorModel {\n const prosemirrorJson = yXmlFragmentToProsemirrorJSON(fragment) as ProsemirrorNode;\n return prosemirrorDocToPage(prosemirrorJson, definitions);\n}\n\nexport function prosemirrorDocToPage(\n prosemirrorDoc: ProsemirrorNode,\n definitions: PageBlockDefinition[]\n): DocumentationPageEditorModel {\n const definitionsById = mapByUnique(definitions, d => d.id);\n\n return {\n blocks: internalProsemirrorNodesToPageItems(prosemirrorDoc.content ?? [], definitionsById),\n };\n}\n\nexport function shallowProsemirrorNodeToBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n return (\n prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, new Map([[definition.id, definition]]), 0)[0] ??\n null\n );\n}\n\nexport function prosemirrorDocToRichTextPropertyValue(\n prosemirrorNode: ProsemirrorNode\n): PageBlockItemRichTextEditorValue {\n return {\n value: (prosemirrorNode.content ?? [])\n .map(n => prosemirrorNodeToRichTextEditorPropertyNode(n))\n .filter(nonNullFilter),\n };\n}\n\nfunction prosemirrorNodeToRichTextEditorPropertyNode(\n prosemirrorNode: ProsemirrorNode\n): PageBlockItemRichTextEditorNode | null {\n switch (prosemirrorNode.type) {\n case \"paragraph\":\n return parseAsParagraphNode(prosemirrorNode);\n\n case \"orderedList\":\n case \"bulletList\":\n return parseAsListNode(prosemirrorNode);\n\n default:\n return null;\n }\n}\n\nfunction parseAsParagraphNode(prosemirrorNode: ProsemirrorNode): PageBlockItemRichTextEditorParagraphNode {\n return {\n type: \"Paragraph\",\n value: parseRichText(prosemirrorNode.content ?? []),\n };\n}\n\nfunction parseAsListNode(prosemirrorNode: ProsemirrorNode): PageBlockItemRichTextEditorListNode {\n return {\n type: \"List\",\n listType: prosemirrorNode.type === \"orderedList\" ? \"OL\" : \"UL\",\n value: (prosemirrorNode.content ?? []).map(parseAsListNodeItem).filter(nonNullFilter),\n };\n}\n\nfunction parseAsListNodeItem(prosemirrorNode: ProsemirrorNode): PageBlockText | null {\n if (prosemirrorNode.type !== \"listItem\") return null;\n\n const firstChild = prosemirrorNode.content?.[0];\n if (!firstChild || firstChild.type !== \"paragraph\") return null;\n\n return parseRichText(firstChild.content ?? []);\n}\n\n//\n// Sections\n//\n\nexport function prosemirrorNodeToSection(\n prosemirrorNode: ProsemirrorNode,\n definitions: PageBlockDefinition[]\n): PageSectionEditorModel | null {\n const definitionsById = mapByUnique(definitions, d => d.id);\n return internalProsemirrorNodeToSection(prosemirrorNode, definitionsById);\n}\n\nfunction internalProsemirrorNodeToSection(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>\n): PageSectionEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n return {\n id: id,\n type: \"Section\",\n variantId: getProsemirrorBlockVariantId(prosemirrorNode),\n sectionType: \"Tabs\",\n appearance: {\n contentExpandToEdges: true,\n expandToEdges: true,\n },\n items: (prosemirrorNode.content ?? [])\n .filter(c => c.type === \"sectionItem\")\n .map(c => prosemirrorNodeToSectionItem(c, definitionsMap))\n .filter(nonNullFilter),\n };\n}\n\nfunction prosemirrorNodeToSectionItem(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>\n): PageSectionItemV2 | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n return {\n id: id,\n title: getProsemirrorAttribute(prosemirrorNode, \"title\", z.string()) ?? \"\",\n columns: (prosemirrorNode.content ?? [])\n .filter(c => c.type === \"sectionItemColumn\")\n .map(c => prosemirrorNodeToSectionColumns(c, definitionsMap))\n .filter(nonNullFilter),\n };\n}\n\nfunction prosemirrorNodeToSectionColumns(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>\n): PageSectionColumnV2 | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n return {\n id: id,\n blocks: internalProsemirrorNodesToBlocks(prosemirrorNode.content ?? [], definitionsMap, 0),\n };\n}\n\n//\n// Blocks\n//\n\nexport function prosemirrorNodesToBlocks(prosemirrorNodes: ProsemirrorNode[], definitions: PageBlockDefinition[]) {\n const definitionsById = mapByUnique(definitions, d => d.id);\n return internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsById, 0);\n}\n\nfunction internalProsemirrorNodesToPageItems(\n prosemirrorNodes: ProsemirrorNode[],\n definitionsMap: Map<string, PageBlockDefinition>\n): (PageBlockEditorModel | PageSectionEditorModel)[] {\n const result: (PageBlockEditorModel | PageSectionEditorModel)[] = [];\n\n for (const prosemirrorNode of prosemirrorNodes) {\n if (prosemirrorNode.type === \"tabsSection\") {\n // Section\n const section = prosemirrorNodeToSection(prosemirrorNode, Array.from(definitionsMap.values()));\n section && result.push(section);\n } else {\n // Block\n result.push(...internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, 0));\n }\n }\n\n return result;\n}\n\nfunction internalProsemirrorNodesToBlocks(\n prosemirrorNodes: ProsemirrorNode[],\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n return prosemirrorNodes.flatMap(prosemirrorNode => {\n return internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth);\n });\n}\n\nfunction internalProsemirrorNodeToBlock(\n prosemirrorNode: ProsemirrorNode,\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n const definitionId = getProsemirrorAttribute(prosemirrorNode, \"definitionId\", z.string());\n if (!definitionId) {\n console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);\n\n return [];\n }\n\n const definition = definitionsMap.get(definitionId);\n if (!definition) {\n console.warn(\n `Block definitionId \"${definitionId}\" (prosemirror node ${prosemirrorNode.type}) is not among available definitions`\n );\n console.warn(prosemirrorNode);\n return [];\n }\n\n return prosemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition, definitionsMap, depth);\n}\n\nfunction prosemirrorNodeAndDefinitionToBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n const multiRichTextProperty = BlockDefinitionUtils.firstMultiRichTextProperty(definition);\n if (multiRichTextProperty) {\n return parseAsMultiRichText(prosemirrorNode, definition, multiRichTextProperty, definitionsMap, depth);\n }\n\n const block = shallowProsemirrorNodeAndDefinitionToBlock(prosemirrorNode, definition);\n return block ? [block] : [];\n}\n\nfunction shallowProsemirrorNodeAndDefinitionToBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n const richTextProperty = BlockDefinitionUtils.firstRichTextProperty(definition);\n if (richTextProperty) {\n return parseAsRichText(prosemirrorNode, definition, richTextProperty);\n }\n\n const tableProperty = BlockDefinitionUtils.firstTableProperty(definition);\n if (tableProperty) {\n return parseAsTable(prosemirrorNode, definition, tableProperty);\n }\n\n if (definition.id === \"io.supernova.block.divider\") {\n return parseAsDivider(prosemirrorNode, definition);\n }\n\n return parseAsCustomBlock(prosemirrorNode, definition);\n}\n\n//\n// Single rich text\n//\n\nfunction parseAsRichText(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n property: PageBlockDefinitionProperty\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, \"type\", z.string().optional()));\n\n return {\n id: id,\n type: \"Block\",\n\n data: {\n packageId: definition.id,\n indentLevel: 0,\n ...(variantId && { variantId: variantId }),\n items: [\n {\n id: id,\n props: {\n [property.id]: {\n // Required\n value: parseRichText(prosemirrorNode.content ?? []),\n\n // Optional\n ...(calloutType && { calloutType: calloutType }),\n } satisfies PageBlockItemRichTextValue,\n },\n },\n ],\n },\n };\n}\n\nfunction parseCalloutType(prosemirrorCalloutType: unknown): PageBlockCalloutType | undefined {\n if (!prosemirrorCalloutType) return undefined;\n\n switch (prosemirrorCalloutType) {\n case \"critical\":\n return \"Error\";\n case \"neutral\":\n return \"Info\";\n case \"positive\":\n return \"Success\";\n case \"warning\":\n return \"Warning\";\n case \"primary\":\n return \"Primary\";\n }\n}\n\n//\n// Multi rich text\n//\n\nfunction parseAsMultiRichText(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n property: PageBlockDefinitionProperty,\n definitionsMap: Map<string, PageBlockDefinition>,\n depth: number\n): PageBlockEditorModel[] {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return [];\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n const result: PageBlockEditorModel[] = [];\n\n // Flatten items\n const listItems: ProsemirrorNode[] = [];\n prosemirrorNode.content?.forEach(c => {\n // Illegal child of a list\n if (c.type !== \"listItem\") return;\n\n c.content?.forEach(cc => {\n listItems.push(cc);\n });\n });\n\n // Text list items buffering\n let bufferedTextItems: ProsemirrorNode[] = [];\n function flushBufferedTextItems() {\n if (!bufferedTextItems.length) return;\n\n const idSuffix = result.length ? `-${result.length}` : \"\";\n\n result.push({\n id: id + idSuffix,\n type: \"Block\",\n data: {\n packageId: definition.id,\n indentLevel: depth,\n ...(variantId && { variantId: variantId }),\n items: [\n {\n id: id + idSuffix,\n props: {\n [property.id]: {\n value: bufferedTextItems.map(paragraph => {\n return parseRichText(paragraph.content ?? []);\n }),\n } satisfies PageBlockItemMultiRichTextValue,\n },\n },\n ],\n },\n });\n\n bufferedTextItems = [];\n }\n\n listItems.forEach(item => {\n if (item.type === \"paragraph\") {\n bufferedTextItems.push(item);\n return;\n }\n\n // This is not a paragraph, flush text items first\n flushBufferedTextItems();\n\n result.push(...internalProsemirrorNodeToBlock(item, definitionsMap, depth + 1));\n });\n\n // Flush text items at the end\n flushBufferedTextItems();\n\n return result;\n}\n\n//\n// Rich text\n//\n\nfunction parseRichText(spans: ProsemirrorNode[]): PageBlockText {\n return {\n spans: spans.map(parseRichTextSpan).filter(nonNullFilter),\n };\n}\n\nfunction parseRichTextSpan(span: ProsemirrorNode): PageBlockTextSpan | null {\n if (span.type === \"hardBreak\") {\n return { text: \"\\n\", attributes: [] };\n }\n\n if (span.type !== \"text\" || !span.text) return null;\n\n const marks = span.marks ?? [];\n\n return {\n text: span.text,\n attributes: marks.map(parseRichTextAttribute).filter(nonNullFilter),\n };\n}\n\nfunction parseRichTextAttribute(mark: ProsemirrorMark): PageBlockTextSpanAttribute | null {\n switch (mark.type) {\n case \"bold\":\n return { type: \"Bold\" };\n case \"italic\":\n return { type: \"Italic\" };\n case \"strike\":\n return { type: \"Strikethrough\" };\n case \"code\":\n return { type: \"Code\" };\n case \"link\":\n return parseProsemirrorLink(mark);\n case \"commentHighlight\":\n return parseProsemirrorCommentHighlight(mark);\n }\n\n return null;\n}\n\nfunction parseProsemirrorLink(mark: ProsemirrorMark): PageBlockTextSpanAttribute | null {\n const href = getProsemirrorAttribute(mark, \"href\", z.string().optional());\n if (!href) return null;\n\n const target = getProsemirrorAttribute(mark, \"target\", z.string().optional());\n const openInNewTab = target === \"_blank\";\n\n if (href.startsWith(\"@\")) {\n return {\n type: \"Link\",\n openInNewWindow: openInNewTab,\n openInNewTab: openInNewTab,\n documentationItemId: href.split(\":\")[1],\n };\n } else {\n return {\n type: \"Link\",\n openInNewWindow: openInNewTab,\n openInNewTab: openInNewTab,\n link: href,\n };\n }\n}\n\nfunction parseProsemirrorCommentHighlight(mark: ProsemirrorMark): PageBlockTextSpanAttribute | null {\n const highlightId = getProsemirrorAttribute(mark, \"highlightId\", z.string().optional());\n if (!highlightId) return null;\n\n const isResolved = getProsemirrorAttribute(mark, \"resolved\", z.boolean().optional()) ?? false;\n\n return {\n type: \"Comment\",\n commentHighlightId: highlightId,\n commentIsResolved: isResolved,\n };\n}\n\n//\n// Embed\n//\n\nfunction parseAsTable(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition,\n property: PageBlockDefinitionProperty\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n const hasBorder = getProsemirrorAttribute(prosemirrorNode, \"hasBorder\", z.boolean().optional()) !== false;\n\n const tableChild = prosemirrorNode.content?.find(c => c.type === \"table\");\n if (!tableChild) {\n return emptyTable(id, variantId, 0);\n }\n\n // Nodes can are considered rows if they have correct node type + their content is non-empty\n const rows = tableChild.content?.filter(c => c.type === \"tableRow\" && !!c.content?.length) ?? [];\n if (!rows.length) {\n return emptyTable(id, variantId, 0);\n }\n\n const rowHeaderCells = rows[0].content?.filter(c => c.type === \"tableHeader\").length ?? 0;\n const columnHeaderCells = rows.filter(r => r.content?.[0]?.type === \"tableHeader\").length;\n\n const hasHeaderRow = rows[0].content?.length === rowHeaderCells;\n const hasHeaderColumn = rows.length === columnHeaderCells;\n\n const tableValue: PageBlockItemTableValue = {\n showBorder: hasBorder,\n highlightHeaderRow: hasHeaderRow,\n highlightHeaderColumn: hasHeaderColumn,\n value: [],\n };\n\n tableValue.value = rows.map(row => {\n return {\n cells: (row.content ?? []).map(parseAsTableCell).filter(nonNullFilter),\n };\n });\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: \"io.supernova.block.table\",\n indentLevel: 0,\n variantId: \"default\",\n\n ...(variantId && { variantId: variantId }),\n\n items: [\n {\n id: id,\n props: {\n table: tableValue,\n },\n },\n ],\n },\n };\n}\n\nfunction parseAsTableCell(prosemirrorNode: ProsemirrorNode): PageBlockItemTableCell | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const textAlign = getProsemirrorAttribute(prosemirrorNode, \"textAlign\", z.string().optional());\n\n let columnWidth: number | undefined;\n const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, \"colwidth\", z.array(z.number()).nullish());\n if (columnWidthArray) {\n columnWidth = roundDimension(columnWidthArray[0]);\n }\n\n const tableNodes = (prosemirrorNode.content ?? []).map(parseAsTableNode).filter(nonNullFilter);\n\n return {\n id: id,\n alignment: parseTableCellAlignment(textAlign),\n ...(columnWidth && { columnWidth }),\n nodes: tableNodes.length ? tableNodes : emptyTableCellContent(),\n };\n}\n\nfunction parseTableCellAlignment(alignment: unknown): PageBlockTableCellAlignment {\n if (!alignment) return \"Left\";\n\n switch (alignment) {\n case \"left\":\n return \"Left\";\n case \"center\":\n return \"Center\";\n case \"right\":\n return \"Right\";\n\n default:\n return \"Left\";\n }\n}\n\nfunction parseAsTableNode(prosemirrorNode: ProsemirrorNode): PageBlockItemTableNode | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n switch (prosemirrorNode.type) {\n case \"paragraph\":\n return {\n type: \"RichText\",\n id: id,\n value: parseRichText(prosemirrorNode.content ?? []),\n };\n\n case \"image\":\n const items = getProsemirrorAttribute(prosemirrorNode, \"items\", z.string());\n if (!items) return null;\n\n const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));\n if (!parsedItems.success) return null;\n\n const rawImagePropertyValue = parsedItems.data[0]?.props.image;\n if (!rawImagePropertyValue) return null;\n\n const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);\n if (!imagePropertyValueParseResult.success) return null;\n\n const { value, caption, alt, alignment } = imagePropertyValueParseResult.data;\n\n return {\n type: \"Image\",\n id,\n value,\n ...(alt && { alt }),\n ...(caption && { caption }),\n ...(alignment && { alignment }),\n };\n\n default:\n return null;\n }\n}\n\nfunction emptyTable(id: string, variantId?: string, indentLevel?: number): PageBlockEditorModel {\n const tableValue: PageBlockItemTableValue = {\n showBorder: true,\n highlightHeaderColumn: false,\n highlightHeaderRow: false,\n value: [],\n };\n\n for (let i = 0; i < 2; i++) {\n tableValue.value.push({\n cells: [],\n });\n\n for (let j = 0; j < 3; j++) {\n tableValue.value[i].cells.push({\n id: \"\",\n alignment: \"Left\",\n nodes: emptyTableCellContent(),\n });\n }\n }\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: \"io.supernova.block.table\",\n indentLevel: indentLevel ?? 0,\n variantId: variantId,\n items: [\n {\n id: id,\n props: {\n table: tableValue,\n },\n },\n ],\n },\n };\n}\n\nfunction emptyTableCellContent(): PageBlockItemTableNode[] {\n return [\n {\n type: \"RichText\",\n id: \"\",\n value: { spans: [] },\n },\n ];\n}\n\n//\n// Divider\n//\n\nfunction parseAsDivider(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: definition.id,\n indentLevel: 0,\n\n ...(variantId && { variantId: variantId }),\n\n items: [{ id: id, props: {} }],\n },\n };\n}\n\n//\n// Custom block\n//\n\nfunction parseAsCustomBlock(\n prosemirrorNode: ProsemirrorNode,\n definition: PageBlockDefinition\n): PageBlockEditorModel | null {\n const id = getProsemirrorBlockId(prosemirrorNode);\n if (!id) return null;\n\n const variantId = getProsemirrorBlockVariantId(prosemirrorNode);\n\n const appearance = parseAppearance(prosemirrorNode);\n\n const parsedItems = parseBlockItems(prosemirrorNode, definition) ?? [];\n\n // Some blocks can expect at least one item to be always present. In such case we fallback to an item\n // without any properties defined which should be a valid item for any combination of block settings.\n if (!parsedItems.length && definitionExpectsPlaceholderItem(definition)) {\n parsedItems.push({\n id: id,\n props: {},\n });\n }\n\n return {\n id: id,\n type: \"Block\",\n data: {\n packageId: definition.id,\n indentLevel: 0,\n\n ...(variantId && { variantId: variantId }),\n ...(appearance && { appearance: appearance }),\n\n items: parsedItems,\n },\n };\n}\n\nfunction definitionExpectsPlaceholderItem(definition: PageBlockDefinition): boolean {\n return (\n // Block needs an item when it's a data block (tokens, components, etc)\n !definition.behavior.items ||\n // Block needs an item when number of items is expected to be 1\n definition.behavior.items.numberOfItems === 1\n );\n}\n\nfunction parseBlockItems(prosemirrorNode: ProsemirrorNode, definition: PageBlockDefinition): PageBlockItemV2[] | null {\n const itemsString = getProsemirrorAttribute(prosemirrorNode, \"items\", z.string());\n if (!itemsString) return null;\n\n const itemsJson: unknown = JSON.parse(itemsString);\n if (!Array.isArray(itemsJson)) {\n console.error(\"Block `items` property must be a json array\");\n return null;\n }\n\n return itemsJson.map(i => parseItem(i, definition)).filter(nonNullFilter);\n}\n\nfunction parseAppearance(prosemirrorNode: ProsemirrorNode): PageBlockAppearanceV2 | undefined {\n let appearance: PageBlockAppearanceV2 = {};\n\n const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, \"appearance\", z.string().optional());\n if (rawAppearanceString) {\n const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));\n if (parsedAppearance.success) {\n appearance = parsedAppearance.data;\n }\n }\n\n const columns = getProsemirrorAttribute(prosemirrorNode, \"columns\", z.number().optional());\n if (columns) {\n appearance.numberOfColumns = columns;\n }\n\n const backgroundColor = getProsemirrorAttribute(prosemirrorNode, \"backgroundColor\", z.string().optional());\n if (backgroundColor) {\n const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));\n if (parsedColor.success) {\n appearance.itemBackgroundColor = parsedColor.data;\n }\n }\n\n if (!Object.keys(appearance).length) return undefined;\n\n return appearance;\n}\n\nfunction parseItem(rawItem: unknown, definition: PageBlockDefinition): PageBlockItemV2 | null {\n const parsedItem = PageBlockItemV2.safeParse(rawItem);\n if (!parsedItem.success) {\n return null;\n }\n\n const sanitizedProps: Record<string, PageBlockItemUntypedValue> = {};\n\n for (const property of definition.item.properties) {\n const value = parsedItem.data.props[property.id];\n if (!value) {\n continue;\n }\n\n const valueSchema = valueSchemaForPropertyType(property.type);\n const validationResult = valueSchema.safeParse(value);\n\n if (validationResult.success) {\n sanitizedProps[property.id] = validationResult.data;\n } else {\n // Migration - Storybook\n if (property.type === \"Storybook\") {\n const oldParsed = PageBlockItemStorybookValueOld.safeParse(value);\n if (oldParsed.success) {\n sanitizedProps[property.id] = storybookValueFromOldValue(oldParsed.data);\n }\n }\n }\n }\n\n return {\n id: parsedItem.data.id,\n ...(parsedItem.data.linksTo && { linksTo: parsedItem.data.linksTo }),\n props: sanitizedProps,\n };\n}\n\nfunction valueSchemaForPropertyType(type: PageBlockDefinitionPropertyType) {\n switch (type) {\n case \"RichText\":\n return PageBlockItemRichTextValue;\n case \"MultiRichText\":\n return PageBlockItemMultiRichTextValue;\n case \"Text\":\n return PageBlockItemTextValue;\n case \"Boolean\":\n return PageBlockItemBooleanValue;\n case \"Number\":\n return PageBlockItemNumberValue;\n case \"SingleSelect\":\n return PageBlockItemSingleSelectValue;\n case \"MultiSelect\":\n return PageBlockItemMultiSelectValue;\n case \"Image\":\n return PageBlockItemImageValue;\n case \"Token\":\n return PageBlockItemTokenValue;\n case \"TokenType\":\n return PageBlockItemTokenTypeValue;\n case \"TokenProperty\":\n return PageBlockItemTokenPropertyValue;\n case \"Component\":\n return PageBlockItemComponentValue;\n case \"ComponentProperty\":\n return PageBlockItemComponentPropertyValue;\n case \"Asset\":\n return PageBlockItemAssetValue;\n case \"AssetProperty\":\n return PageBlockItemAssetPropertyValue;\n case \"FigmaNode\":\n return PageBlockItemFigmaNodeValue;\n case \"EmbedURL\":\n return PageBlockItemEmbedValue;\n case \"URL\":\n return PageBlockItemUrlValue;\n case \"Markdown\":\n return PageBlockItemMarkdownValue;\n case \"Code\":\n return PageBlockItemCodeValue;\n case \"CodeSandbox\":\n return PageBlockItemSandboxValue;\n case \"Table\":\n return PageBlockItemTableValue;\n case \"Divider\":\n return PageBlockItemDividerValue;\n case \"Storybook\":\n return PageBlockItemStorybookValue;\n case \"Color\":\n return PageBlockItemColorValue;\n case \"FigmaComponent\":\n return PageBlockItemFigmaComponentValue;\n case \"RichTextEditor\":\n return PageBlockItemRichTextEditorValue;\n case \"File\":\n return PageBlockItemFileValue;\n }\n}\n\n//\n// Attributes\n//\n\nfunction getProsemirrorBlockId(prosemirrorNode: ProsemirrorNode): string | undefined {\n const id = getProsemirrorAttribute(prosemirrorNode, \"id\", z.string());\n if (!id) console.warn(`Prosemirror attribute \"id\" on ${prosemirrorNode.type} is required`);\n return id;\n}\n\nfunction getProsemirrorBlockVariantId(prosemirrorNode: ProsemirrorNode): string | undefined {\n return getProsemirrorAttribute(prosemirrorNode, \"variantId\", nullishToOptional(z.string()));\n}\n\nfunction getProsemirrorAttribute<I, O>(\n prosemirrorNode: ProsemirrorNode,\n attributeName: string,\n validationSchema: ZodSchema<O, ZodTypeDef, I>\n): O | undefined {\n const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);\n if (parsedAttr.success) {\n return parsedAttr.data;\n } else {\n console.warn(`Prosemirror attribute ${attributeName} on ${prosemirrorNode.type} is invalid`);\n console.warn(parsedAttr.error.flatten());\n return undefined;\n }\n}\n\n//\n// Utils\n//\n\nfunction nonNullFilter<T>(item: T | null): item is T {\n return item !== null;\n}\n\nfunction mapByUnique<V, K>(items: V[], keyFn: (item: V) => K): Map<K, V> {\n const result = new Map<K, V>();\n for (const item of items) {\n result.set(keyFn(item), item);\n }\n return result;\n}\n\nfunction roundDimension(dimension: number) {\n return Math.round(dimension * 100) / 100;\n}\n","import {\n DocumentationPageApproval,\n DocumentationPageSnapshot,\n DocumentationPageV2,\n ElementGroup,\n ElementGroupSnapshot,\n} from \"@supernova-studio/model\";\nimport * as Y from \"yjs\";\nimport { DocumentationHierarchySettings } from \"../design-system-content\";\nimport { VersionRoomBaseYDoc } from \"./base\";\n\ntype DocumentationHierarchyTransaction = {\n pages?: DocumentationPageV2[];\n pageIdsToDelete?: string[];\n\n groups?: ElementGroup[];\n groupIdsToDelete?: string[];\n\n pageSnapshots?: DocumentationPageSnapshot[];\n pageSnapshotIdsToDelete?: string[];\n\n groupSnapshots?: ElementGroupSnapshot[];\n groupSnapshotIdsToDelete?: string[];\n\n internalSettings?: Partial<DocumentationHierarchySettings>;\n\n pageHashesToUpdate?: Record<string, string>;\n\n pageApprovals?: DocumentationPageApproval[];\n pageApprovalIdsToDelete?: string[];\n\n executedTransactionIds?: string[];\n};\n\nexport class BackendVersionRoomYDoc {\n private readonly yDoc: Y.Doc;\n\n constructor(yDoc: Y.Doc) {\n this.yDoc = yDoc;\n }\n\n updateDocumentationHierarchy(transaction: DocumentationHierarchyTransaction) {\n this.yDoc.transact(trx => {\n const yDoc = new VersionRoomBaseYDoc(trx.doc);\n\n // Pages\n transaction.pageIdsToDelete && yDoc.deletePages(transaction.pageIdsToDelete);\n transaction.pages && yDoc.updatePages(transaction.pages);\n\n // Groups\n transaction.groupIdsToDelete && yDoc.deleteGroups(transaction.groupIdsToDelete);\n transaction.groups && yDoc.updateGroups(transaction.groups);\n\n // Page snapshots\n transaction.pageSnapshotIdsToDelete && yDoc.deletePageSnapshots(transaction.pageSnapshotIdsToDelete);\n transaction.pageSnapshots && yDoc.updatePageSnapshots(transaction.pageSnapshots);\n\n // Snapshots - published groups\n transaction.groupSnapshotIdsToDelete && yDoc.deleteGroupSnapshots(transaction.groupSnapshotIdsToDelete);\n transaction.groupSnapshots && yDoc.updateGroupSnapshots(transaction.groupSnapshots);\n\n // Settings\n transaction.internalSettings && yDoc.updateDocumentationInternalSettings(transaction.internalSettings);\n transaction.pageHashesToUpdate && yDoc.updateDocumentationPageContentHashes(transaction.pageHashesToUpdate);\n transaction.pageApprovals && yDoc.updateApprovalStates(transaction.pageApprovals);\n transaction.pageApprovalIdsToDelete && yDoc.removeApprovalStates(transaction.pageApprovalIdsToDelete);\n\n // Executed transaction ids\n transaction.executedTransactionIds && yDoc.updateExecutedTransactionIds(transaction.executedTransactionIds);\n });\n }\n\n getDocumentationPageContentHashes() {\n const versionDoc = new VersionRoomBaseYDoc(this.yDoc);\n\n // Limit each hash string by 100 characters\n const validHashes = Object.entries(versionDoc.getDocumentationPageContentHashes()).filter(e => {\n return e[1].length < 100;\n });\n\n return Object.fromEntries(validHashes);\n }\n}\n","import {\n defaultDocumentationItemConfigurationV2,\n generateShortPersistentId,\n mapByUnique,\n RoomType,\n slugify,\n} from \"@supernova-studio/model\";\nimport { DTOElementActionInput, DTOElementActionInputOfType } from \"../api\";\nimport { VersionRoomApproval, VersionRoomBaseYDocState, VersionRoomDocsPage, VersionRoomDocsPageGroup } from \"../yjs\";\nimport { LocalApproval, LocalDocsPage, LocalDocsPageGroup } from \"./types\";\n\n//\n// Types\n//\n\ntype Page = LocalDocsPage | VersionRoomDocsPage;\ntype Group = LocalDocsPageGroup | VersionRoomDocsPageGroup;\ntype ApprovalState = LocalApproval | VersionRoomApproval;\n\n//\n// Interface\n//\n\ntype Input = LocalExecutorConfig & {\n actions: DTOElementActionInput[];\n};\n\nexport function applyActionsLocally(input: Input) {\n const actionExecutor = new LocalDocsElementActionExecutor(input);\n actionExecutor.applyActions(input.actions);\n return actionExecutor.localState;\n}\n\n//\n// Executor\n//\n\ntype LocalExecutorConfig = {\n userId: string;\n designSystemVersionId: string;\n remoteState: VersionRoomBaseYDocState;\n};\n\nexport class LocalDocsElementActionExecutor {\n private readonly userId: string;\n private readonly designSystemVersionId: string;\n\n private readonly pages: Map<string, Page>;\n private readonly groups: Map<string, Group>;\n private readonly approvalStates: Map<string, ApprovalState>;\n private readonly pageLiveblockRoomIds: Record<string, string>;\n\n constructor(config: LocalExecutorConfig) {\n const { designSystemVersionId, remoteState, userId } = config;\n\n this.userId = userId;\n this.designSystemVersionId = designSystemVersionId;\n\n // Seed the state with remote state\n this.pages = mapByUnique(remoteState.pages, p => p.persistentId);\n this.groups = mapByUnique(remoteState.groups, p => p.persistentId);\n this.approvalStates = mapByUnique(remoteState.approvals, a => a.pagePersistentId);\n this.pageLiveblockRoomIds = { ...remoteState.pageLiveblockRoomIds };\n }\n\n get localState() {\n return {\n pages: Array.from(this.pages.values()),\n groups: Array.from(this.groups.values()),\n approvals: Array.from(this.approvalStates.values()),\n pageLiveblockRoomIds: this.pageLiveblockRoomIds,\n };\n }\n\n applyActions(trx: DTOElementActionInput[]) {\n trx.forEach(trx => this.applyTransaction(trx));\n }\n\n applyTransaction(trx: DTOElementActionInput) {\n switch (trx.type) {\n // Groups\n case \"DocumentationGroupCreate\":\n return this.documentationGroupCreate(trx);\n case \"DocumentationGroupUpdate\":\n return this.documentationGroupUpdate(trx);\n case \"DocumentationGroupMove\":\n return this.documentationGroupMove(trx);\n\n // Groups - unsupported\n case \"DocumentationGroupDelete\":\n case \"DocumentationGroupDuplicate\":\n case \"DocumentationGroupRestore\":\n throw new Error(`Transaction type ${trx.type} is not yet implemented`);\n\n // Pages\n case \"DocumentationPageCreate\":\n return this.documentationPageCreate(trx);\n case \"DocumentationPageUpdate\":\n return this.documentationPageUpdate(trx);\n case \"DocumentationPageMove\":\n return this.documentationPageMove(trx);\n case \"DocumentationPageDelete\":\n return this.documentationPageDelete(trx);\n\n // Pages - unsupported\n case \"DocumentationPageApprovalStateChange\":\n return this.documentationApprovalStateUpdate(trx);\n\n case \"DocumentationPageDuplicate\":\n case \"DocumentationPageRestore\":\n throw new Error(`Transaction type ${trx.type} is not yet implemented`);\n\n // Tabs\n case \"DocumentationTabCreate\":\n return this.documentationTabCreate(trx);\n\n case \"DocumentationTabGroupDelete\":\n throw new Error(`Transaction type ${trx.type} is not yet implemented`);\n\n // Won't ever be supported\n case \"FigmaNodeRender\":\n case \"FigmaNodeRenderAsync\":\n throw new Error(`Transaction type ${trx.type} is not a documentation element action`);\n }\n }\n\n //\n // Pages\n //\n\n private documentationPageCreate(trx: DTOElementActionInputOfType<\"DocumentationPageCreate\">) {\n const { input } = trx;\n const { persistentId } = input;\n\n if (this.pages.has(input.persistentId)) {\n // TODO Artem: uncomment when this is synced with remote state\n // throw new Error(`Cannot create page: persistent id ${input.persistentId} already exists`);\n return;\n }\n\n if (!this.groups.has(input.parentPersistentId)) {\n throw new Error(`Cannot create page: parent persistent id ${input.parentPersistentId} was not found`);\n }\n\n const localPage: LocalDocsPage = {\n persistentId,\n createdAt: new Date(),\n parentPersistentId: input.parentPersistentId,\n shortPersistentId: generateShortPersistentId(),\n slug: slugify(input.title),\n meta: { name: input.title },\n updatedAt: new Date(),\n data: {\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? { ...defaultDocumentationItemConfigurationV2, ...input.configuration }\n : input.configuration,\n },\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n designSystemVersionId: this.designSystemVersionId,\n };\n\n this.pages.set(persistentId, localPage);\n\n const roomId = `${RoomType.DocumentationPage}:${this.designSystemVersionId}:${persistentId}`;\n this.pageLiveblockRoomIds[persistentId] = roomId;\n }\n\n private documentationPageUpdate(trx: DTOElementActionInputOfType<\"DocumentationPageUpdate\">) {\n const { input } = trx;\n\n const existingPage = this.pages.get(input.id);\n if (!existingPage) {\n throw new Error(`Cannot update page: page id ${input.id} was not found`);\n }\n\n const localPage: LocalDocsPage = {\n ...existingPage,\n userSlug: undefined,\n meta: {\n ...existingPage.meta,\n name: input.title ?? existingPage.meta.name,\n },\n data: {\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? { ...(existingPage.data.configuration ?? defaultDocumentationItemConfigurationV2), ...input.configuration }\n : existingPage.data.configuration,\n },\n };\n\n this.pages.set(localPage.persistentId, localPage);\n }\n\n private documentationPageMove(trx: DTOElementActionInputOfType<\"DocumentationPageMove\">) {\n const { input } = trx;\n\n if (!this.groups.has(input.parentPersistentId)) {\n throw new Error(`Cannot move page: page parent id ${input.parentPersistentId} was not found`);\n }\n\n const existingPage = this.pages.get(input.id);\n if (!existingPage) {\n throw new Error(`Cannot update page: page id ${input.id} was not found`);\n }\n\n const localPage: LocalDocsPage = {\n ...existingPage,\n userSlug: undefined,\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n parentPersistentId: input.parentPersistentId,\n };\n\n this.pages.set(localPage.persistentId, localPage);\n }\n\n private documentationPageDelete(trx: DTOElementActionInputOfType<\"DocumentationPageDelete\">) {\n const { input } = trx;\n\n if (!this.pages.delete(trx.input.id)) {\n throw new Error(`Cannot delete page: page id ${input.id} was not found`);\n }\n\n delete this.pageLiveblockRoomIds[trx.input.id];\n }\n\n //\n // Group\n //\n\n private documentationGroupCreate(trx: DTOElementActionInputOfType<\"DocumentationGroupCreate\">) {\n const { input } = trx;\n\n if (this.groups.has(input.persistentId)) {\n // TODO Artem: uncomment when this is synced with remote state\n // throw new Error(`Cannot create page: persistent id ${input.persistentId} already exists`);\n return;\n }\n\n const localGroup: LocalDocsPageGroup = {\n parentPersistentId: input.parentPersistentId,\n persistentId: input.persistentId,\n shortPersistentId: generateShortPersistentId(),\n slug: slugify(input.title),\n meta: { name: input.title },\n createdAt: new Date(),\n updatedAt: new Date(),\n data: {\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? { ...defaultDocumentationItemConfigurationV2, ...input.configuration }\n : input.configuration,\n },\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n designSystemVersionId: this.designSystemVersionId,\n };\n\n this.groups.set(localGroup.persistentId, localGroup);\n }\n\n private documentationGroupUpdate(trx: DTOElementActionInputOfType<\"DocumentationGroupUpdate\">) {\n const { input } = trx;\n\n const existingGroup = this.groups.get(input.id);\n if (!existingGroup) {\n throw new Error(`Cannot update group: group id ${input.id} was not found`);\n }\n\n const localGroup: LocalDocsPageGroup = {\n ...existingGroup,\n userSlug: undefined,\n meta: {\n ...existingGroup.meta,\n name: input.title ?? existingGroup.meta.name,\n },\n data: {\n ...existingGroup.data,\n\n // TODO Artem: move somewhere reusable\n configuration: input.configuration\n ? {\n ...(existingGroup.data?.configuration ?? defaultDocumentationItemConfigurationV2),\n ...input.configuration,\n }\n : existingGroup.data?.configuration,\n },\n };\n\n this.groups.set(localGroup.persistentId, localGroup);\n }\n\n private documentationGroupMove(trx: DTOElementActionInputOfType<\"DocumentationGroupMove\">) {\n const { input } = trx;\n\n if (!this.groups.has(input.parentPersistentId)) {\n throw new Error(`Cannot move group: group parent id ${input.parentPersistentId} was not found`);\n }\n\n const existingGroup = this.groups.get(input.id);\n if (!existingGroup) {\n throw new Error(`Cannot update group: group id ${input.id} was not found`);\n }\n\n const localGroup: LocalDocsPageGroup = {\n ...existingGroup,\n userSlug: undefined,\n sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),\n parentPersistentId: input.parentPersistentId,\n };\n\n this.groups.set(localGroup.persistentId, localGroup);\n }\n\n //\n // Tabs\n //\n\n private documentationTabCreate(trx: DTOElementActionInputOfType<\"DocumentationTabCreate\">) {\n const { input } = trx;\n\n const page = this.pages.get(input.fromItemPersistentId);\n if (!page) {\n throw new Error(`Cannot create tab: page id ${input.fromItemPersistentId} was not found`);\n }\n\n // Create tab group in place of the page\n const tabGroup: LocalDocsPageGroup = {\n parentPersistentId: page.parentPersistentId,\n persistentId: input.persistentId,\n shortPersistentId: generateShortPersistentId(),\n slug: page.slug,\n meta: page.meta,\n createdAt: new Date(),\n updatedAt: new Date(),\n data: {\n behavior: \"Tabs\",\n configuration: page?.data.configuration,\n },\n sortOrder: page.sortOrder,\n designSystemVersionId: this.designSystemVersionId,\n };\n this.groups.set(input.persistentId, tabGroup);\n\n const newLocalPage: LocalDocsPage = {\n ...page,\n userSlug: undefined,\n sortOrder: 0,\n parentPersistentId: input.persistentId,\n meta: { name: input.tabName },\n };\n this.pages.set(newLocalPage.persistentId, newLocalPage);\n }\n\n //\n // Approval states\n //\n\n private documentationApprovalStateUpdate(trx: DTOElementActionInputOfType<\"DocumentationPageApprovalStateChange\">) {\n const { input } = trx;\n\n const existingApproval = this.approvalStates.get(input.persistentId);\n\n if (input.approvalState) {\n this.approvalStates.set(input.persistentId, {\n approvalState: input.approvalState,\n createdAt: existingApproval?.createdAt ?? new Date(),\n designSystemVersionId: this.designSystemVersionId,\n pagePersistentId: input.persistentId,\n updatedAt: new Date(),\n updatedByUserId: this.userId,\n } satisfies LocalApproval);\n } else {\n this.approvalStates.delete(input.persistentId);\n }\n }\n\n //\n // Utils\n //\n\n private calculateSortOrder(parentPersistentId: string, afterPersistentId?: string | null): number {\n const sortOrderStep = Math.pow(2, 16);\n\n const neighbours = [\n ...Array.from(this.pages.values()).filter(p => p.parentPersistentId === parentPersistentId),\n ...Array.from(this.groups.values()).filter(g => g.parentPersistentId === parentPersistentId),\n ];\n\n // If no neighbors, just assign 0\n if (!neighbours.length) return 0;\n\n neighbours.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);\n\n // Null afterPersistentId means beginning\n if (afterPersistentId === null) return neighbours[0].sortOrder - sortOrderStep;\n\n // Undefined afterPersistentId means default behavior (end of the list)\n if (!afterPersistentId) return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;\n\n const index = neighbours.findIndex(e => e.persistentId === afterPersistentId);\n\n // If page is not found or adding after the last item is requested, assign last position\n if (index < 0 || index === neighbours.length - 1) {\n return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;\n }\n\n // Insert in between items\n const left = neighbours[index].sortOrder;\n const right = neighbours[index + 1]?.sortOrder ?? left + sortOrderStep * 2;\n\n return (right + left) / 2;\n }\n}\n"]}
|