@supernova-studio/client 1.96.5 → 1.96.7
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 +101428 -143199
- package/dist/index.d.ts +101428 -143199
- package/dist/index.js +489 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5607 -5217
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -9
- package/src/api/client.ts +62 -0
- package/src/api/conversion/analytics/index.ts +3 -0
- package/src/api/conversion/analytics/page-visits-to-comparison-dto.ts +65 -0
- package/src/api/conversion/analytics/page-visits-to-dto.ts +68 -0
- package/src/api/conversion/analytics/page-visits-to-heatmap-dto.ts +49 -0
- package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +114 -0
- package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +91 -0
- package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +52 -0
- package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +34 -0
- package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +134 -0
- package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +69 -0
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +84 -0
- package/src/api/conversion/documentation/documentation-settings-to-dto.ts +14 -0
- package/src/api/conversion/documentation/index.ts +8 -0
- package/src/api/conversion/export/index.ts +1 -0
- package/src/api/conversion/export/pipeline.ts +27 -0
- package/src/api/conversion/index.ts +4 -0
- package/src/api/conversion/integrations/git.ts +37 -0
- package/src/api/conversion/integrations/index.ts +2 -0
- package/src/api/conversion/integrations/integration.ts +37 -0
- package/src/api/dto/access-tokens/access-token.ts +45 -0
- package/src/api/dto/access-tokens/index.ts +1 -0
- package/src/api/dto/aux/color.ts +7 -0
- package/src/api/dto/aux/index.ts +4 -0
- package/src/api/dto/aux/meta.ts +8 -0
- package/src/api/dto/aux/object-metadata.ts +29 -0
- package/src/api/dto/aux/pagination.ts +8 -0
- package/src/api/dto/bff/app-bootstrap-data.ts +20 -0
- package/src/api/dto/bff/index.ts +1 -0
- package/src/api/dto/collections/index.ts +1 -0
- package/src/api/dto/collections/token-collection.ts +32 -0
- package/src/api/dto/design-systems/brand.ts +44 -0
- package/src/api/dto/design-systems/code-component-usage.ts +52 -0
- package/src/api/dto/design-systems/code-component.ts +101 -0
- package/src/api/dto/design-systems/code-history.ts +43 -0
- package/src/api/dto/design-systems/code-scan.ts +29 -0
- package/src/api/dto/design-systems/code-snapshots.ts +46 -0
- package/src/api/dto/design-systems/component.ts +40 -0
- package/src/api/dto/design-systems/contact.ts +11 -0
- package/src/api/dto/design-systems/data-source.ts +216 -0
- package/src/api/dto/design-systems/design-system.ts +75 -0
- package/src/api/dto/design-systems/documentation-search.ts +31 -0
- package/src/api/dto/design-systems/elements-diff.ts +14 -0
- package/src/api/dto/design-systems/figma-variables.ts +122 -0
- package/src/api/dto/design-systems/file.ts +71 -0
- package/src/api/dto/design-systems/import-job.ts +62 -0
- package/src/api/dto/design-systems/index.ts +24 -0
- package/src/api/dto/design-systems/members.ts +52 -0
- package/src/api/dto/design-systems/redirects.ts +33 -0
- package/src/api/dto/design-systems/role.ts +11 -0
- package/src/api/dto/design-systems/stats.ts +20 -0
- package/src/api/dto/design-systems/storybook.ts +45 -0
- package/src/api/dto/design-systems/user-design-systems.ts +10 -0
- package/src/api/dto/design-systems/version-room.ts +12 -0
- package/src/api/dto/design-systems/version.ts +56 -0
- package/src/api/dto/design-systems/view.ts +45 -0
- package/src/api/dto/design-tokens/design-token.ts +78 -0
- package/src/api/dto/design-tokens/index.ts +1 -0
- package/src/api/dto/documentation/analytics-v2.ts +80 -0
- package/src/api/dto/documentation/analytics.ts +32 -0
- package/src/api/dto/documentation/anchor.ts +15 -0
- package/src/api/dto/documentation/approvals.ts +21 -0
- package/src/api/dto/documentation/block-definition.ts +28 -0
- package/src/api/dto/documentation/block.ts +6 -0
- package/src/api/dto/documentation/documentation-page-snapshot.ts +18 -0
- package/src/api/dto/documentation/documentation.ts +34 -0
- package/src/api/dto/documentation/index.ts +11 -0
- package/src/api/dto/documentation/link-preview.ts +23 -0
- package/src/api/dto/documentation/publish.ts +23 -0
- package/src/api/dto/documentation/room.ts +12 -0
- package/src/api/dto/elements/components/figma-component-group.ts +19 -0
- package/src/api/dto/elements/components/figma-component.ts +56 -0
- package/src/api/dto/elements/components/index.ts +2 -0
- package/src/api/dto/elements/documentation/configuration.ts +20 -0
- package/src/api/dto/elements/documentation/draft-state.ts +37 -0
- package/src/api/dto/elements/documentation/group-action.ts +108 -0
- package/src/api/dto/elements/documentation/group-v1.ts +35 -0
- package/src/api/dto/elements/documentation/group-v2.ts +117 -0
- package/src/api/dto/elements/documentation/hierarchy.ts +25 -0
- package/src/api/dto/elements/documentation/index.ts +16 -0
- package/src/api/dto/elements/documentation/item-configuration-v1.ts +24 -0
- package/src/api/dto/elements/documentation/item-configuration-v2.ts +14 -0
- package/src/api/dto/elements/documentation/metadata.ts +8 -0
- package/src/api/dto/elements/documentation/page-actions-v2.ts +138 -0
- package/src/api/dto/elements/documentation/page-content.ts +15 -0
- package/src/api/dto/elements/documentation/page-dependencies.ts +30 -0
- package/src/api/dto/elements/documentation/page-v1.ts +21 -0
- package/src/api/dto/elements/documentation/page-v2.ts +132 -0
- package/src/api/dto/elements/documentation/settings.ts +9 -0
- package/src/api/dto/elements/documentation/structure.ts +37 -0
- package/src/api/dto/elements/elements-action-v2.ts +125 -0
- package/src/api/dto/elements/figma-nodes/figma-node-structure.ts +27 -0
- package/src/api/dto/elements/figma-nodes/figma-node-v1.ts +32 -0
- package/src/api/dto/elements/figma-nodes/figma-node-v2.ts +32 -0
- package/src/api/dto/elements/figma-nodes/figma-node.ts +103 -0
- package/src/api/dto/elements/figma-nodes/index.ts +5 -0
- package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +25 -0
- package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +17 -0
- package/src/api/dto/elements/frame-node-structures/index.ts +1 -0
- package/src/api/dto/elements/get-elements-v2.ts +27 -0
- package/src/api/dto/elements/index.ts +7 -0
- package/src/api/dto/elements/properties/index.ts +2 -0
- package/src/api/dto/elements/properties/property-definitions.ts +75 -0
- package/src/api/dto/elements/properties/property-values.ts +50 -0
- package/src/api/dto/events/forge-project.ts +51 -0
- package/src/api/dto/events/index.ts +2 -0
- package/src/api/dto/events/workspace.ts +81 -0
- package/src/api/dto/export/exporter-property.ts +114 -0
- package/src/api/dto/export/exporter.ts +115 -0
- package/src/api/dto/export/filter.ts +20 -0
- package/src/api/dto/export/index.ts +5 -0
- package/src/api/dto/export/job.ts +114 -0
- package/src/api/dto/export/pipeline.ts +60 -0
- package/src/api/dto/figma-components/assets/download.ts +30 -0
- package/src/api/dto/figma-components/assets/index.ts +1 -0
- package/src/api/dto/figma-components/index.ts +1 -0
- package/src/api/dto/figma-exporter/figma-node.ts +11 -0
- package/src/api/dto/figma-exporter/index.ts +1 -0
- package/src/api/dto/files/files.ts +94 -0
- package/src/api/dto/files/index.ts +1 -0
- package/src/api/dto/forge/agent.ts +38 -0
- package/src/api/dto/forge/artifact.ts +94 -0
- package/src/api/dto/forge/feature-messages.ts +551 -0
- package/src/api/dto/forge/feature-room.ts +12 -0
- package/src/api/dto/forge/figma-node.ts +117 -0
- package/src/api/dto/forge/index.ts +28 -0
- package/src/api/dto/forge/iteration-message-old.ts +43 -0
- package/src/api/dto/forge/knowledge-item.ts +67 -0
- package/src/api/dto/forge/memory.ts +67 -0
- package/src/api/dto/forge/participant.ts +44 -0
- package/src/api/dto/forge/project-action.ts +123 -0
- package/src/api/dto/forge/project-artifact-room.ts +12 -0
- package/src/api/dto/forge/project-artifact.ts +85 -0
- package/src/api/dto/forge/project-context-feedback.ts +141 -0
- package/src/api/dto/forge/project-context-override.ts +41 -0
- package/src/api/dto/forge/project-context-scope.ts +23 -0
- package/src/api/dto/forge/project-context-v2.ts +228 -0
- package/src/api/dto/forge/project-context.ts +72 -0
- package/src/api/dto/forge/project-feature.ts +86 -0
- package/src/api/dto/forge/project-figma-node.ts +9 -0
- package/src/api/dto/forge/project-file.ts +48 -0
- package/src/api/dto/forge/project-invitation.ts +46 -0
- package/src/api/dto/forge/project-iteration-old.ts +54 -0
- package/src/api/dto/forge/project-member.ts +67 -0
- package/src/api/dto/forge/project-room.ts +12 -0
- package/src/api/dto/forge/project-section.ts +37 -0
- package/src/api/dto/forge/project.ts +105 -0
- package/src/api/dto/forge/relation.ts +34 -0
- package/src/api/dto/forge/threads.ts +153 -0
- package/src/api/dto/index.ts +25 -0
- package/src/api/dto/liveblocks/auth-response.ts +7 -0
- package/src/api/dto/liveblocks/index.ts +1 -0
- package/src/api/dto/mcp/index.ts +1 -0
- package/src/api/dto/mcp/stream.ts +17 -0
- package/src/api/dto/notifications/index.ts +2 -0
- package/src/api/dto/notifications/notifications.ts +65 -0
- package/src/api/dto/notifications/settings.ts +10 -0
- package/src/api/dto/portal/index.ts +1 -0
- package/src/api/dto/portal/portal-settings.ts +45 -0
- package/src/api/dto/sandboxes/index.ts +1 -0
- package/src/api/dto/sandboxes/template.ts +143 -0
- package/src/api/dto/storybook-sites/index.ts +1 -0
- package/src/api/dto/storybook-sites/storybook-sites.ts +60 -0
- package/src/api/dto/themes/index.ts +2 -0
- package/src/api/dto/themes/override.ts +27 -0
- package/src/api/dto/themes/theme.ts +53 -0
- package/src/api/dto/threads/index.ts +1 -0
- package/src/api/dto/threads/threads.ts +280 -0
- package/src/api/dto/trail-events/index.ts +1 -0
- package/src/api/dto/trail-events/trail-events.ts +172 -0
- package/src/api/dto/users/authenticated-user.ts +92 -0
- package/src/api/dto/users/index.ts +2 -0
- package/src/api/dto/users/user.ts +27 -0
- package/src/api/dto/workspaces/billing.ts +156 -0
- package/src/api/dto/workspaces/enums.ts +13 -0
- package/src/api/dto/workspaces/git.ts +32 -0
- package/src/api/dto/workspaces/index.ts +15 -0
- package/src/api/dto/workspaces/integrations.ts +34 -0
- package/src/api/dto/workspaces/invitations.ts +47 -0
- package/src/api/dto/workspaces/ip-whitelist.ts +33 -0
- package/src/api/dto/workspaces/knowledge-items-search.ts +37 -0
- package/src/api/dto/workspaces/login-screen.ts +42 -0
- package/src/api/dto/workspaces/membership.ts +55 -0
- package/src/api/dto/workspaces/npm-registry.ts +62 -0
- package/src/api/dto/workspaces/products.ts +45 -0
- package/src/api/dto/workspaces/subscription.ts +170 -0
- package/src/api/dto/workspaces/transfer-ownership.ts +7 -0
- package/src/api/dto/workspaces/untyped-data.ts +35 -0
- package/src/api/dto/workspaces/workspace.ts +49 -0
- package/src/api/endpoints/auth-tokens.ts +28 -0
- package/src/api/endpoints/codegen/codegen.ts +16 -0
- package/src/api/endpoints/codegen/ds-pipelines.ts +37 -0
- package/src/api/endpoints/codegen/exporters.ts +54 -0
- package/src/api/endpoints/codegen/index.ts +5 -0
- package/src/api/endpoints/codegen/jobs.ts +15 -0
- package/src/api/endpoints/codegen/pipelines.ts +55 -0
- package/src/api/endpoints/design-system/analytics.ts +14 -0
- package/src/api/endpoints/design-system/bff.ts +13 -0
- package/src/api/endpoints/design-system/code-snapshots.ts +47 -0
- package/src/api/endpoints/design-system/contact.ts +12 -0
- package/src/api/endpoints/design-system/design-systems.ts +90 -0
- package/src/api/endpoints/design-system/figma-node-structures.ts +20 -0
- package/src/api/endpoints/design-system/index.ts +11 -0
- package/src/api/endpoints/design-system/members.ts +24 -0
- package/src/api/endpoints/design-system/redirects.ts +46 -0
- package/src/api/endpoints/design-system/sources.ts +80 -0
- package/src/api/endpoints/design-system/storybook.ts +28 -0
- package/src/api/endpoints/design-system/versions/brands.ts +45 -0
- package/src/api/endpoints/design-system/versions/documentation.ts +107 -0
- package/src/api/endpoints/design-system/versions/ds-components.ts +30 -0
- package/src/api/endpoints/design-system/versions/elements-action.ts +65 -0
- package/src/api/endpoints/design-system/versions/elements.ts +27 -0
- package/src/api/endpoints/design-system/versions/figma-component-groups.ts +13 -0
- package/src/api/endpoints/design-system/versions/figma-components.ts +15 -0
- package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +13 -0
- package/src/api/endpoints/design-system/versions/files.ts +43 -0
- package/src/api/endpoints/design-system/versions/import-jobs.ts +13 -0
- package/src/api/endpoints/design-system/versions/index.ts +19 -0
- package/src/api/endpoints/design-system/versions/overrides.ts +17 -0
- package/src/api/endpoints/design-system/versions/property-definitions.ts +43 -0
- package/src/api/endpoints/design-system/versions/property-values.ts +25 -0
- package/src/api/endpoints/design-system/versions/stats.ts +12 -0
- package/src/api/endpoints/design-system/versions/themes.ts +35 -0
- package/src/api/endpoints/design-system/versions/token-collections.ts +13 -0
- package/src/api/endpoints/design-system/versions/token-groups.ts +30 -0
- package/src/api/endpoints/design-system/versions/tokens.ts +29 -0
- package/src/api/endpoints/design-system/versions/versions.ts +90 -0
- package/src/api/endpoints/feedback.ts +60 -0
- package/src/api/endpoints/files.ts +25 -0
- package/src/api/endpoints/forge/agents.ts +54 -0
- package/src/api/endpoints/forge/artifacts.ts +54 -0
- package/src/api/endpoints/forge/documents.ts +18 -0
- package/src/api/endpoints/forge/feature-artifacts.ts +39 -0
- package/src/api/endpoints/forge/feature-iterations.ts +49 -0
- package/src/api/endpoints/forge/feature-messages.ts +68 -0
- package/src/api/endpoints/forge/features.ts +63 -0
- package/src/api/endpoints/forge/forge.ts +38 -0
- package/src/api/endpoints/forge/index.ts +16 -0
- package/src/api/endpoints/forge/iteration-tags.ts +13 -0
- package/src/api/endpoints/forge/memory.ts +41 -0
- package/src/api/endpoints/forge/project-contexts.ts +49 -0
- package/src/api/endpoints/forge/project-files.ts +41 -0
- package/src/api/endpoints/forge/project-invitations.ts +39 -0
- package/src/api/endpoints/forge/project-iterations.ts +65 -0
- package/src/api/endpoints/forge/project-members.ts +55 -0
- package/src/api/endpoints/forge/projects.ts +56 -0
- package/src/api/endpoints/index.ts +13 -0
- package/src/api/endpoints/liveblocks.ts +14 -0
- package/src/api/endpoints/mcp/index.ts +1 -0
- package/src/api/endpoints/mcp/streams.ts +21 -0
- package/src/api/endpoints/sandboxes/builds.ts +30 -0
- package/src/api/endpoints/sandboxes/index.ts +3 -0
- package/src/api/endpoints/sandboxes/sandboxes.ts +13 -0
- package/src/api/endpoints/sandboxes/templates.ts +16 -0
- package/src/api/endpoints/storybook-sites.ts +42 -0
- package/src/api/endpoints/threads.ts +38 -0
- package/src/api/endpoints/users.ts +26 -0
- package/src/api/endpoints/workspaces/billing.ts +24 -0
- package/src/api/endpoints/workspaces/chat-threads.ts +95 -0
- package/src/api/endpoints/workspaces/index.ts +9 -0
- package/src/api/endpoints/workspaces/integrations.ts +15 -0
- package/src/api/endpoints/workspaces/invites.ts +34 -0
- package/src/api/endpoints/workspaces/knowledge-items.ts +59 -0
- package/src/api/endpoints/workspaces/members.ts +31 -0
- package/src/api/endpoints/workspaces/npm-register.ts +20 -0
- package/src/api/endpoints/workspaces/subscription.ts +31 -0
- package/src/api/endpoints/workspaces/workspaces.ts +84 -0
- package/src/api/index.ts +6 -0
- package/src/api/payloads/design-systems/code-snapshots.ts +27 -0
- package/src/api/payloads/design-systems/index.ts +3 -0
- package/src/api/payloads/design-systems/update-design-system.ts +42 -0
- package/src/api/payloads/design-systems/version.ts +29 -0
- package/src/api/payloads/documentation/analytics.ts +36 -0
- package/src/api/payloads/documentation/block-definitions.ts +18 -0
- package/src/api/payloads/documentation/design-data-doc-diff.ts +7 -0
- package/src/api/payloads/documentation/index.ts +3 -0
- package/src/api/payloads/export/index.ts +1 -0
- package/src/api/payloads/export/pipeline.ts +111 -0
- package/src/api/payloads/index.ts +6 -0
- package/src/api/payloads/liveblocks/auth.ts +7 -0
- package/src/api/payloads/liveblocks/index.ts +1 -0
- package/src/api/payloads/users/index.ts +1 -0
- package/src/api/payloads/users/notifications/index.ts +1 -0
- package/src/api/payloads/users/notifications/notification-settings.ts +17 -0
- package/src/api/payloads/workspaces/index.ts +2 -0
- package/src/api/payloads/workspaces/workspace-configuration.ts +62 -0
- package/src/api/payloads/workspaces/workspace-integrations.ts +35 -0
- package/src/api/transport/index.ts +2 -0
- package/src/api/transport/request-executor-error.ts +60 -0
- package/src/api/transport/request-executor.ts +94 -0
- package/src/events/design-system.ts +21 -0
- package/src/events/event.ts +6 -0
- package/src/events/index.ts +2 -0
- package/src/index.ts +5 -0
- package/src/sync/docs-local-action-executor.ts +412 -0
- package/src/sync/docs-structure-repo.ts +283 -0
- package/src/sync/index.ts +5 -0
- package/src/sync/project-content-repo.ts +215 -0
- package/src/sync/project-local-action-executor.ts +415 -0
- package/src/sync/types.ts +37 -0
- package/src/utils/figma.ts +72 -0
- package/src/utils/hash.ts +62 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/query.ts +41 -0
- package/src/utils/redirect-validation.ts +76 -0
- package/src/yjs/design-system-content/documentation-hierarchy.ts +35 -0
- package/src/yjs/design-system-content/index.ts +2 -0
- package/src/yjs/design-system-content/item-configuration.ts +62 -0
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +764 -0
- package/src/yjs/docs-editor/index.ts +7 -0
- package/src/yjs/docs-editor/list-tree-builder.ts +127 -0
- package/src/yjs/docs-editor/mock.ts +2271 -0
- package/src/yjs/docs-editor/model/block.ts +8 -0
- package/src/yjs/docs-editor/model/index.ts +2 -0
- package/src/yjs/docs-editor/model/page.ts +8 -0
- package/src/yjs/docs-editor/prosemirror/index.ts +3 -0
- package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +145 -0
- package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +577 -0
- package/src/yjs/docs-editor/prosemirror/types.ts +19 -0
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +986 -0
- package/src/yjs/docs-editor/utils.ts +115 -0
- package/src/yjs/feature-room/backend.ts +36 -0
- package/src/yjs/feature-room/base.ts +109 -0
- package/src/yjs/feature-room/frontend.ts +53 -0
- package/src/yjs/feature-room/index.ts +3 -0
- package/src/yjs/forge-project-room/backend.ts +59 -0
- package/src/yjs/forge-project-room/base.ts +190 -0
- package/src/yjs/forge-project-room/index.ts +2 -0
- package/src/yjs/index.ts +7 -0
- package/src/yjs/thread-room/backend.ts +32 -0
- package/src/yjs/thread-room/base.ts +71 -0
- package/src/yjs/thread-room/frontend.ts +39 -0
- package/src/yjs/thread-room/index.ts +3 -0
- package/src/yjs/utils/index.ts +1 -0
- package/src/yjs/utils/key-value-storage.ts +57 -0
- package/src/yjs/version-room/backend.ts +101 -0
- package/src/yjs/version-room/base.ts +323 -0
- package/src/yjs/version-room/compute-dto.ts +387 -0
- package/src/yjs/version-room/frontend.ts +76 -0
- package/src/yjs/version-room/index.ts +6 -0
- package/src/yjs/version-room/types.ts +31 -0
- package/src/yjs/version-room/utils.ts +109 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
const DimensionsVariableScopeSchema = z.enum([
|
|
4
|
+
"CORNER_RADIUS",
|
|
5
|
+
"WIDTH_HEIGHT",
|
|
6
|
+
"GAP",
|
|
7
|
+
"STROKE_FLOAT",
|
|
8
|
+
"EFFECT_FLOAT",
|
|
9
|
+
"OPACITY",
|
|
10
|
+
"FONT_SIZE",
|
|
11
|
+
"LINE_HEIGHT",
|
|
12
|
+
"LETTER_SPACING",
|
|
13
|
+
"PARAGRAPH_SPACING",
|
|
14
|
+
"PARAGRAPH_INDENT",
|
|
15
|
+
"FONT_WEIGHT",
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
const StringVariableScopeSchema = z.enum(["TEXT_CONTENT", "FONT_FAMILY", "FONT_STYLE"]);
|
|
19
|
+
|
|
20
|
+
export type DimensionsVariableScopeType = z.infer<typeof DimensionsVariableScopeSchema>;
|
|
21
|
+
export const DimensionsVariableScopeType = DimensionsVariableScopeSchema.enum;
|
|
22
|
+
|
|
23
|
+
export type StringVariableScopeType = z.infer<typeof StringVariableScopeSchema>;
|
|
24
|
+
export const StringVariableScopeType = StringVariableScopeSchema.enum;
|
|
25
|
+
|
|
26
|
+
const VariableScope = z.string();
|
|
27
|
+
|
|
28
|
+
const ReferencedVariableOrigin = z.object({
|
|
29
|
+
name: z.string(),
|
|
30
|
+
remote: z.boolean(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const RGB = z.object({
|
|
34
|
+
r: z.number(),
|
|
35
|
+
g: z.number(),
|
|
36
|
+
b: z.number(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const RGBA = RGB.extend({
|
|
40
|
+
a: z.number(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const VariableAlias = z.object({
|
|
44
|
+
type: z.literal("VARIABLE_ALIAS"),
|
|
45
|
+
id: z.string(),
|
|
46
|
+
resolvedValue: z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).optional(),
|
|
47
|
+
referenceOrigin: ReferencedVariableOrigin.optional().or(z.null()),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const VariableValue = z.boolean().or(z.number()).or(z.string()).or(RGBA).or(RGB).or(VariableAlias);
|
|
51
|
+
export const ResolvedVariableType = z.enum(["BOOLEAN", "FLOAT", "STRING", "COLOR"]);
|
|
52
|
+
|
|
53
|
+
export const Variable = z.object({
|
|
54
|
+
id: z.string(),
|
|
55
|
+
name: z.string(),
|
|
56
|
+
key: z.string(),
|
|
57
|
+
variableCollectionId: z.string(),
|
|
58
|
+
variableCollectionKey: z.string(),
|
|
59
|
+
resolvedType: ResolvedVariableType,
|
|
60
|
+
valuesByMode: z.record(VariableValue),
|
|
61
|
+
remote: z.boolean(),
|
|
62
|
+
description: z.string(),
|
|
63
|
+
hiddenFromPublishing: z.boolean(),
|
|
64
|
+
scopes: z.array(VariableScope),
|
|
65
|
+
codeSyntax: z.record(z.any()).optional(),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const VariableMode = z.object({
|
|
69
|
+
modeId: z.string(),
|
|
70
|
+
name: z.string(),
|
|
71
|
+
parentModeId: z.string().optional(),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export const Collection = z.object({
|
|
75
|
+
id: z.string(),
|
|
76
|
+
name: z.string(),
|
|
77
|
+
key: z.string(),
|
|
78
|
+
modes: z.array(VariableMode),
|
|
79
|
+
defaultModeId: z.string(),
|
|
80
|
+
remote: z.boolean(),
|
|
81
|
+
hiddenFromPublishing: z.boolean(),
|
|
82
|
+
|
|
83
|
+
isExtension: z.boolean().optional(),
|
|
84
|
+
parentVariableCollectionId: z.string().optional(),
|
|
85
|
+
parentVariableCollectionKey: z.string().optional(),
|
|
86
|
+
variableOverrides: z.record(z.string(), z.record(z.string(), VariableValue)).optional(),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export const VariablesMapping = z.object({
|
|
90
|
+
variableCollections: z.array(z.string()).min(1),
|
|
91
|
+
variableCollectionKeys: z.array(z.string()),
|
|
92
|
+
variableMode: z.string().min(1),
|
|
93
|
+
supernovaBrand: z.string().min(1),
|
|
94
|
+
supernovaTheme: z.string().min(1).nullable().optional(),
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export const VariableCollectionsSchema = z.record(z.string(), Collection);
|
|
98
|
+
export const VariablesSchema = z.record(z.string(), Variable);
|
|
99
|
+
|
|
100
|
+
export const FormattedCollections = z.object({
|
|
101
|
+
variableCollections: VariableCollectionsSchema,
|
|
102
|
+
variables: VariablesSchema,
|
|
103
|
+
variablesOrder: z.string().array().optional(),
|
|
104
|
+
mappings: z.array(VariablesMapping).optional(),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
//
|
|
108
|
+
// Types
|
|
109
|
+
//
|
|
110
|
+
|
|
111
|
+
export type RGB = z.infer<typeof RGB>;
|
|
112
|
+
export type RGBA = z.infer<typeof RGBA>;
|
|
113
|
+
export type ResolvedVariableType = z.infer<typeof ResolvedVariableType>;
|
|
114
|
+
export type Variable = z.infer<typeof Variable>;
|
|
115
|
+
export type VariableAlias = z.infer<typeof VariableAlias>;
|
|
116
|
+
export type VariableValue = z.infer<typeof VariableValue>;
|
|
117
|
+
export type VariableMode = z.infer<typeof VariableMode>;
|
|
118
|
+
export type Collection = z.infer<typeof Collection>;
|
|
119
|
+
export type VariablesMapping = z.infer<typeof VariablesMapping>;
|
|
120
|
+
export type VariableCollections = z.infer<typeof VariableCollectionsSchema>;
|
|
121
|
+
export type Variables = z.infer<typeof VariablesSchema>;
|
|
122
|
+
export type FormattedCollections = z.infer<typeof FormattedCollections>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AssetScope } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTOAssetScope = AssetScope;
|
|
5
|
+
|
|
6
|
+
export const DTOFileUploadItem = z.object({
|
|
7
|
+
size: z.number(),
|
|
8
|
+
name: z.string(),
|
|
9
|
+
checksum: z.string(),
|
|
10
|
+
scope: DTOAssetScope.exclude(["ComponentThumbnail", "DocumentationFrame"]).optional(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const DTOFileUploadPayload = z.object({
|
|
14
|
+
files: z.array(DTOFileUploadItem),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const DTOFileUploadResponseItem = z.object({
|
|
18
|
+
fileId: z.string(),
|
|
19
|
+
referencePersistentId: z.string(),
|
|
20
|
+
name: z.string(),
|
|
21
|
+
checksum: z.string(),
|
|
22
|
+
pendingUpload: z.boolean().optional(),
|
|
23
|
+
url: z.string(),
|
|
24
|
+
size: z.number(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const DTOFileResponseItem = DTOFileUploadResponseItem;
|
|
28
|
+
|
|
29
|
+
export const DTOUploadUrlItem = z.object({
|
|
30
|
+
fileId: z.string(),
|
|
31
|
+
uploadUrl: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const DTOFileUploadResponse = z.object({
|
|
35
|
+
files: z.array(DTOFileUploadResponseItem),
|
|
36
|
+
uploadUrls: z.array(DTOUploadUrlItem),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Use GET method with DTOFilesGetQuery
|
|
41
|
+
*/
|
|
42
|
+
export const DTOFilesGetPayload = z.object({
|
|
43
|
+
persistentIds: z.string().array().optional(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const DTOFilesGetQuery = z.object({
|
|
47
|
+
includeScope: DTOAssetScope.optional(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const DTOFilesResponse = z.object({
|
|
51
|
+
files: z.array(DTOFileResponseItem),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const DTOFileUploadFinalizePayload = z.object({
|
|
55
|
+
fileIds: z.array(z.string()),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export const DTOFileUploadFinalizeResponse = z.object({ ok: z.literal(true) });
|
|
59
|
+
|
|
60
|
+
export type DTOFileUploadItem = z.infer<typeof DTOFileUploadItem>;
|
|
61
|
+
export type DTOFileUploadPayload = z.infer<typeof DTOFileUploadPayload>;
|
|
62
|
+
export type DTOFileUploadResponseItem = z.infer<typeof DTOFileUploadResponseItem>;
|
|
63
|
+
export type DTOUploadUrlItem = z.infer<typeof DTOUploadUrlItem>;
|
|
64
|
+
export type DTOFileUploadResponse = z.infer<typeof DTOFileUploadResponse>;
|
|
65
|
+
export type DTOFileUploadFinalizePayload = z.infer<typeof DTOFileUploadFinalizePayload>;
|
|
66
|
+
export type DTOFileUploadFinalizeResponse = z.infer<typeof DTOFileUploadFinalizeResponse>;
|
|
67
|
+
export type DTOFileResponseItem = z.infer<typeof DTOFileResponseItem>;
|
|
68
|
+
export type DTOFilesGetPayload = z.infer<typeof DTOFilesGetPayload>;
|
|
69
|
+
export type DTOFilesResponse = z.infer<typeof DTOFilesResponse>;
|
|
70
|
+
export type DTOFilesGetQuery = z.infer<typeof DTOFilesGetQuery>;
|
|
71
|
+
export type DTOAssetScope = z.infer<typeof DTOAssetScope>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataSourceAutoImportMode,
|
|
3
|
+
DataSourceFigmaScope,
|
|
4
|
+
DataSourceRemoteType,
|
|
5
|
+
ImportJobState,
|
|
6
|
+
} from "@supernova-studio/model";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
//
|
|
10
|
+
// Read
|
|
11
|
+
//
|
|
12
|
+
|
|
13
|
+
export const DTOImportJob = z.object({
|
|
14
|
+
id: z.string(),
|
|
15
|
+
designSystemId: z.string(),
|
|
16
|
+
designSystemVersionId: z.string(),
|
|
17
|
+
operation: z.literal("Import"),
|
|
18
|
+
createdAt: z.coerce.date(),
|
|
19
|
+
stateChangedAt: z.coerce.date(),
|
|
20
|
+
state: ImportJobState,
|
|
21
|
+
sourceIds: z.string().array(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const DTOImportJobResponse = z.object({
|
|
25
|
+
job: DTOImportJob,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type DTOImportJob = z.infer<typeof DTOImportJob>;
|
|
29
|
+
export type DTOImportJobResponse = z.infer<typeof DTOImportJobResponse>;
|
|
30
|
+
|
|
31
|
+
//
|
|
32
|
+
// Write
|
|
33
|
+
//
|
|
34
|
+
|
|
35
|
+
export const DTOBffFigmaImportRequestBody = z.object({
|
|
36
|
+
type: z.literal(DataSourceRemoteType.Enum.Figma),
|
|
37
|
+
brandPersistentId: z.string().optional(),
|
|
38
|
+
fileId: z.string(),
|
|
39
|
+
scope: DataSourceFigmaScope,
|
|
40
|
+
autoImportMode: DataSourceAutoImportMode,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const DTOBffUploadImportRequestBody = z.object({
|
|
44
|
+
type: z
|
|
45
|
+
.enum([DataSourceRemoteType.Enum.FigmaVariablesPlugin, "Upload"])
|
|
46
|
+
.transform(v => DataSourceRemoteType.Enum.FigmaVariablesPlugin),
|
|
47
|
+
brandPersistentId: z.string().optional(),
|
|
48
|
+
sourceName: z.string().optional(),
|
|
49
|
+
remoteId: z.string(),
|
|
50
|
+
isTokenTypeSplitEnabled: z.boolean().optional(),
|
|
51
|
+
version: z.string().optional(),
|
|
52
|
+
payload: z.any(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const DTOBffImportRequestBody = z.discriminatedUnion("type", [
|
|
56
|
+
DTOBffFigmaImportRequestBody,
|
|
57
|
+
DTOBffUploadImportRequestBody,
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
export type DTOBffFigmaImportRequestBody = z.infer<typeof DTOBffFigmaImportRequestBody>;
|
|
61
|
+
export type DTOBffUploadImportRequestBody = z.infer<typeof DTOBffUploadImportRequestBody>;
|
|
62
|
+
export type DTOBffImportRequestBody = z.infer<typeof DTOBffImportRequestBody>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export * from "./brand";
|
|
2
|
+
export * from "./code-component-usage";
|
|
3
|
+
export * from "./code-component";
|
|
4
|
+
export * from "./code-history";
|
|
5
|
+
export * from "./code-scan";
|
|
6
|
+
export * from "./code-snapshots";
|
|
7
|
+
export * from "./component";
|
|
8
|
+
export * from "./contact";
|
|
9
|
+
export * from "./data-source";
|
|
10
|
+
export * from "./design-system";
|
|
11
|
+
export * from "./documentation-search";
|
|
12
|
+
export * from "./elements-diff";
|
|
13
|
+
export * from "./figma-variables";
|
|
14
|
+
export * from "./file";
|
|
15
|
+
export * from "./import-job";
|
|
16
|
+
export * from "./members";
|
|
17
|
+
export * from "./redirects";
|
|
18
|
+
export * from "./role";
|
|
19
|
+
export * from "./stats";
|
|
20
|
+
export * from "./storybook";
|
|
21
|
+
export * from "./user-design-systems";
|
|
22
|
+
export * from "./version-room";
|
|
23
|
+
export * from "./version";
|
|
24
|
+
export * from "./view";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DesignSystemMembershipUpdates } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTODesignSystemRole } from "./role";
|
|
4
|
+
|
|
5
|
+
//
|
|
6
|
+
// Read
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
export const DTODesignSystemMember = z.object({
|
|
10
|
+
userId: z.string(),
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Role that the member has in the design system,
|
|
14
|
+
* undefined if set to inherit from workspace
|
|
15
|
+
*/
|
|
16
|
+
designSystemRole: DTODesignSystemRole.optional(),
|
|
17
|
+
|
|
18
|
+
isDeactivated: z.boolean(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const DTODesignSystemInvitation = z.object({
|
|
22
|
+
id: z.string(),
|
|
23
|
+
workspaceInvitationId: z.string(),
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Role that the invitation has in the design system,
|
|
27
|
+
* undefined if set to inherit from workspace
|
|
28
|
+
*/
|
|
29
|
+
designSystemRole: DTODesignSystemRole.optional(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const DTODesignSystemMemberListResponse = z.object({
|
|
33
|
+
members: DTODesignSystemMember.array(),
|
|
34
|
+
invitations: DTODesignSystemInvitation.array(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const DTODesignSystemMembersUpdateResponse = z.object({
|
|
38
|
+
ok: z.literal(true),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export type DTODesignSystemMember = z.infer<typeof DTODesignSystemMember>;
|
|
42
|
+
export type DTODesignSystemInvitation = z.infer<typeof DTODesignSystemInvitation>;
|
|
43
|
+
export type DTODesignSystemMemberListResponse = z.infer<typeof DTODesignSystemMemberListResponse>;
|
|
44
|
+
export type DTODesignSystemMembersUpdateResponse = z.infer<typeof DTODesignSystemMembersUpdateResponse>;
|
|
45
|
+
|
|
46
|
+
//
|
|
47
|
+
// Write
|
|
48
|
+
//
|
|
49
|
+
|
|
50
|
+
export const DTODesignSystemMembersUpdatePayload = DesignSystemMembershipUpdates;
|
|
51
|
+
|
|
52
|
+
export type DTODesignSystemMembersUpdatePayload = z.infer<typeof DTODesignSystemMembersUpdatePayload>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOPageRedirectCreateBody = z.object({
|
|
4
|
+
pagePersistentId: z.string(),
|
|
5
|
+
path: z.string(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const DTOPageRedirectUpdateBody = DTOPageRedirectCreateBody.partial();
|
|
9
|
+
|
|
10
|
+
export const DTOPageRedirect = z.object({
|
|
11
|
+
id: z.string(),
|
|
12
|
+
pagePersistentId: z.string(),
|
|
13
|
+
path: z.string(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const DTOPageRedirectListResponse = z.object({
|
|
17
|
+
redirects: DTOPageRedirect.array(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const DTOPageRedirectResponse = z.object({
|
|
21
|
+
redirect: DTOPageRedirect,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const DTOPageRedirectDeleteResponse = z.object({
|
|
25
|
+
success: z.boolean(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type DTOPageRedirectCreateBody = z.infer<typeof DTOPageRedirectCreateBody>;
|
|
29
|
+
export type DTOPageRedirectUpdateBody = z.infer<typeof DTOPageRedirectUpdateBody>;
|
|
30
|
+
export type DTOPageRedirect = z.infer<typeof DTOPageRedirect>;
|
|
31
|
+
export type DTOPageRedirectListResponse = z.infer<typeof DTOPageRedirectListResponse>;
|
|
32
|
+
export type DTOPageRedirectResponse = z.infer<typeof DTOPageRedirectResponse>;
|
|
33
|
+
export type DTOPageRedirectDeleteResponse = z.infer<typeof DTOPageRedirectDeleteResponse>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WorkspaceRole } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTODesignSystemRole = z.enum([
|
|
5
|
+
WorkspaceRole.Admin,
|
|
6
|
+
WorkspaceRole.Contributor,
|
|
7
|
+
WorkspaceRole.Creator,
|
|
8
|
+
WorkspaceRole.Viewer,
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
export type DTODesignSystemRole = z.infer<typeof DTODesignSystemRole>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTODesignSystemVersionStats = z.object({
|
|
4
|
+
tokens: z.number(),
|
|
5
|
+
designSystemComponents: z.number(),
|
|
6
|
+
assets: z.number(),
|
|
7
|
+
documentationPages: z.number(),
|
|
8
|
+
figmaComponents: z.number(),
|
|
9
|
+
stories: z.number(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const DTODesignSystemVersionStatsQuery = z.object({
|
|
13
|
+
/**
|
|
14
|
+
* Unique ID across versions (non-persistent ID)
|
|
15
|
+
*/
|
|
16
|
+
brandId: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type DTODesignSystemVersionStats = z.infer<typeof DTODesignSystemVersionStats>;
|
|
20
|
+
export type DTODesignSystemVersionStatsQuery = z.infer<typeof DTODesignSystemVersionStatsQuery>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zodQueryBoolean } from "../../../utils/query";
|
|
3
|
+
|
|
4
|
+
export const DTOStorybookEntryOrigin = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
type: z.enum(["story", "docs"]),
|
|
7
|
+
name: z.string(),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const DTOStorybookEntry = z.object({
|
|
12
|
+
id: z.string(),
|
|
13
|
+
storyId: z.string(),
|
|
14
|
+
designSystemId: z.string(),
|
|
15
|
+
sourceId: z.string(),
|
|
16
|
+
aliases: z.array(z.string()).optional(),
|
|
17
|
+
url: z.string(),
|
|
18
|
+
isDeleted: z.boolean().optional(),
|
|
19
|
+
origin: DTOStorybookEntryOrigin,
|
|
20
|
+
createdAt: z.coerce.date(),
|
|
21
|
+
updatedAt: z.coerce.date(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const DTOStorybookEntryReplaceAction = z.object({
|
|
25
|
+
newStoryId: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const DTOStorybookEntryQuery = z.object({
|
|
29
|
+
/**
|
|
30
|
+
* Unique ID across versions (non-persistent ID)
|
|
31
|
+
*/
|
|
32
|
+
brandId: z.string().optional(),
|
|
33
|
+
|
|
34
|
+
excludeDocs: zodQueryBoolean(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const DTOStorybookEntryListResponse = z.object({ entries: z.array(DTOStorybookEntry) });
|
|
38
|
+
export const DTOStorybookEntryResponse = z.object({ entry: DTOStorybookEntry });
|
|
39
|
+
|
|
40
|
+
export type DTOStorybookEntryQuery = z.infer<typeof DTOStorybookEntryQuery>;
|
|
41
|
+
export type DTOStorybookEntry = z.infer<typeof DTOStorybookEntry>;
|
|
42
|
+
export type DTOStorybookEntryOrigin = z.infer<typeof DTOStorybookEntryOrigin>;
|
|
43
|
+
export type DTOStorybookEntryReplaceAction = z.infer<typeof DTOStorybookEntryReplaceAction>;
|
|
44
|
+
export type DTOStorybookEntryListResponse = z.infer<typeof DTOStorybookEntryListResponse>;
|
|
45
|
+
export type DTOStorybookEntryResponse = z.infer<typeof DTOStorybookEntryResponse>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTODesignSystem } from "./design-system";
|
|
3
|
+
import { DTOWorkspace } from "../workspaces";
|
|
4
|
+
|
|
5
|
+
export const DTOUserDesignSystemsResponse = z.object({
|
|
6
|
+
designSystems: DTODesignSystem.array(),
|
|
7
|
+
workspaces: DTOWorkspace.array(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type DTOUserDesignSystemsResponse = z.infer<typeof DTOUserDesignSystemsResponse>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTODesignSystemVersionRoom = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export const DTODesignSystemVersionRoomResponse = z.object({
|
|
8
|
+
room: DTODesignSystemVersionRoom,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type DTODesignSystemVersionRoom = z.infer<typeof DTODesignSystemVersionRoom>;
|
|
12
|
+
export type DTODesignSystemVersionRoomResponse = z.infer<typeof DTODesignSystemVersionRoomResponse>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ObjectMeta, VersionCreationJob } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOCreateVersionInput } from "../../payloads";
|
|
4
|
+
|
|
5
|
+
export const DTODesignSystemVersion = z.object({
|
|
6
|
+
id: z.string(),
|
|
7
|
+
createdAt: z.coerce.date(),
|
|
8
|
+
meta: ObjectMeta,
|
|
9
|
+
version: z.string(),
|
|
10
|
+
isReadonly: z.boolean(),
|
|
11
|
+
changeLog: z.string(),
|
|
12
|
+
designSystemId: z.string(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const DTODesignSystemVersionsListResponse = z.object({
|
|
16
|
+
designSystemVersions: z.array(DTODesignSystemVersion),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const DTODesignSystemVersionGetResponse = z.object({
|
|
20
|
+
designSystemVersion: DTODesignSystemVersion,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const DTODesignSystemVersionCreationResponse = z.object({
|
|
24
|
+
meta: ObjectMeta,
|
|
25
|
+
version: z.string(),
|
|
26
|
+
changeLog: z.string(),
|
|
27
|
+
isReadOnly: z.boolean(),
|
|
28
|
+
designSystemId: z.string(),
|
|
29
|
+
jobId: z.string(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const VersionSQSPayload = z.object({
|
|
33
|
+
jobId: z.string(),
|
|
34
|
+
designSystemId: z.string(),
|
|
35
|
+
input: DTOCreateVersionInput,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type VersionSQSPayload = z.infer<typeof VersionSQSPayload>;
|
|
39
|
+
|
|
40
|
+
export type DTODesignSystemVersionCreationResponse = z.infer<typeof DTODesignSystemVersionCreationResponse>;
|
|
41
|
+
export type DTODesignSystemVersion = z.infer<typeof DTODesignSystemVersion>;
|
|
42
|
+
export type DTODesignSystemVersionsListResponse = z.infer<typeof DTODesignSystemVersionsListResponse>;
|
|
43
|
+
export type DTODesignSystemVersionGetResponse = z.infer<typeof DTODesignSystemVersionGetResponse>;
|
|
44
|
+
|
|
45
|
+
export const DTODesignSystemVersionJobsResponse = z.object({
|
|
46
|
+
jobs: z.array(VersionCreationJob),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export type DTODesignSystemVersionJobsResponse = z.infer<typeof DTODesignSystemVersionJobsResponse>;
|
|
50
|
+
|
|
51
|
+
// Creation job status response
|
|
52
|
+
export const DTODesignSystemVersionJobStatusResponse = z.object({
|
|
53
|
+
job: VersionCreationJob,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export type DTODesignSystemVersionJobStatusResponse = z.infer<typeof DTODesignSystemVersionJobStatusResponse>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ElementPropertyTargetType, ElementViewBaseColumnType, ObjectMeta } from "@supernova-studio/model";
|
|
3
|
+
|
|
4
|
+
export const DTOElementViewColumnSharedAttributes = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
persistentId: z.string(),
|
|
7
|
+
width: z.number(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const DTOElementViewBasePropertyColumn = DTOElementViewColumnSharedAttributes.extend({
|
|
11
|
+
type: z.literal("BaseProperty"),
|
|
12
|
+
basePropertyType: ElementViewBaseColumnType,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const DTOElementViewPropertyDefinitionColumn = DTOElementViewColumnSharedAttributes.extend({
|
|
16
|
+
type: z.literal("PropertyDefinition"),
|
|
17
|
+
propertyDefinitionId: z.string(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const DTOElementViewThemeColumn = DTOElementViewColumnSharedAttributes.extend({
|
|
21
|
+
type: z.literal("Theme"),
|
|
22
|
+
themeId: z.string(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const DTOElementViewColumn = z.discriminatedUnion("type", [
|
|
26
|
+
DTOElementViewBasePropertyColumn,
|
|
27
|
+
DTOElementViewPropertyDefinitionColumn,
|
|
28
|
+
DTOElementViewThemeColumn,
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
export const DTOElementView = z.object({
|
|
32
|
+
meta: ObjectMeta,
|
|
33
|
+
persistentId: z.string(),
|
|
34
|
+
targetElementType: ElementPropertyTargetType,
|
|
35
|
+
id: z.string(),
|
|
36
|
+
isDefault: z.boolean(),
|
|
37
|
+
columns: z.array(DTOElementViewColumn),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const DTOElementViewsListResponse = z.object({
|
|
41
|
+
elementDataViews: z.array(DTOElementView),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export type DTOElementView = z.infer<typeof DTOElementView>;
|
|
45
|
+
export type DTOElementViewsListResponse = z.infer<typeof DTOElementViewsListResponse>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DesignTokenOrigin, DesignTokenType, DesignTokenTypedData, ObjectMeta } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//
|
|
5
|
+
// Read
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
export const DTODesignToken = DesignTokenTypedData.and(
|
|
9
|
+
z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
persistentId: z.string(),
|
|
12
|
+
designSystemVersionId: z.string(),
|
|
13
|
+
meta: ObjectMeta,
|
|
14
|
+
originStyle: DesignTokenOrigin.optional(),
|
|
15
|
+
brandId: z.string(),
|
|
16
|
+
collectionId: z.string().optional(),
|
|
17
|
+
updatedAt: z.coerce.date(),
|
|
18
|
+
})
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const DTODesignTokenListResponse = z.object({
|
|
22
|
+
tokens: DTODesignToken.array(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const DTODesignTokenResponse = z.object({
|
|
26
|
+
token: DTODesignToken,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const DTODesignTokenGroup = z.object({
|
|
30
|
+
id: z.string(),
|
|
31
|
+
tokenType: DesignTokenType,
|
|
32
|
+
persistentId: z.string(),
|
|
33
|
+
isRoot: z.boolean(),
|
|
34
|
+
brandId: z.string(),
|
|
35
|
+
meta: ObjectMeta,
|
|
36
|
+
childrenIds: z.string().array(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const DTODesignTokenGroupListResponse = z.object({
|
|
40
|
+
groups: DTODesignTokenGroup.array(),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const DTODesignTokenGroupResponse = z.object({
|
|
44
|
+
group: DTODesignTokenGroup,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export type DTODesignToken = z.infer<typeof DTODesignToken>;
|
|
48
|
+
export type DTODesignTokenResponse = z.infer<typeof DTODesignTokenResponse>;
|
|
49
|
+
export type DTODesignTokenListResponse = z.infer<typeof DTODesignTokenListResponse>;
|
|
50
|
+
|
|
51
|
+
export type DTODesignTokenGroup = z.infer<typeof DTODesignTokenGroup>;
|
|
52
|
+
export type DTODesignTokenGroupListResponse = z.infer<typeof DTODesignTokenGroupListResponse>;
|
|
53
|
+
export type DTODesignTokenGroupResponse = z.infer<typeof DTODesignTokenGroupResponse>;
|
|
54
|
+
|
|
55
|
+
//
|
|
56
|
+
// Write
|
|
57
|
+
//
|
|
58
|
+
|
|
59
|
+
export const DTODesignTokenCreatePayload = DesignTokenTypedData.and(
|
|
60
|
+
z.object({
|
|
61
|
+
persistentId: z.string(),
|
|
62
|
+
meta: ObjectMeta,
|
|
63
|
+
brandId: z.string(),
|
|
64
|
+
groupPersistentId: z.string().optional(),
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export const DTODesignTokenGroupCreatePayload = z.object({
|
|
69
|
+
persistentId: z.string(),
|
|
70
|
+
meta: ObjectMeta,
|
|
71
|
+
brandId: z.string(),
|
|
72
|
+
parentId: z.string().optional(),
|
|
73
|
+
tokenType: DesignTokenType,
|
|
74
|
+
childrenIds: z.string().array(),
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export type DTODesignTokenCreatePayload = z.infer<typeof DTODesignTokenCreatePayload>;
|
|
78
|
+
export type DTODesignTokenGroupCreatePayload = z.infer<typeof DTODesignTokenGroupCreatePayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./design-token";
|