@supernova-studio/client 1.96.6 → 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 +101177 -143251
- package/dist/index.d.ts +101177 -143251
- package/dist/index.js +408 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5542 -5239
- 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,125 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
DTODocumentationGroupCreateActionInputV2,
|
|
4
|
+
DTODocumentationGroupCreateActionOutputV2,
|
|
5
|
+
DTODocumentationGroupDeleteActionInputV2,
|
|
6
|
+
DTODocumentationGroupDeleteActionOutputV2,
|
|
7
|
+
DTODocumentationGroupDuplicateActionInputV2,
|
|
8
|
+
DTODocumentationGroupDuplicateActionOutputV2,
|
|
9
|
+
DTODocumentationGroupMoveActionInputV2,
|
|
10
|
+
DTODocumentationGroupMoveActionOutputV2,
|
|
11
|
+
DTODocumentationGroupUpdateActionInputV2,
|
|
12
|
+
DTODocumentationGroupUpdateActionOutputV2,
|
|
13
|
+
DTODocumentationTabCreateActionInputV2,
|
|
14
|
+
DTODocumentationTabCreateActionOutputV2,
|
|
15
|
+
DTODocumentationTabGroupDeleteActionInputV2,
|
|
16
|
+
DTODocumentationTabGroupDeleteActionOutputV2,
|
|
17
|
+
} from "./documentation/group-action";
|
|
18
|
+
import {
|
|
19
|
+
DTODocumentationGroupRestoreActionInput,
|
|
20
|
+
DTODocumentationGroupRestoreActionOutput,
|
|
21
|
+
DTODocumentationPageApprovalStateChangeActionInput,
|
|
22
|
+
DTODocumentationPageApprovalStateChangeActionOutput,
|
|
23
|
+
DTODocumentationPageCreateActionInputV2,
|
|
24
|
+
DTODocumentationPageCreateActionOutputV2,
|
|
25
|
+
DTODocumentationPageDeleteActionInputV2,
|
|
26
|
+
DTODocumentationPageDeleteActionOutputV2,
|
|
27
|
+
DTODocumentationPageDuplicateActionInputV2,
|
|
28
|
+
DTODocumentationPageDuplicateActionOutputV2,
|
|
29
|
+
DTODocumentationPageMoveActionInputV2,
|
|
30
|
+
DTODocumentationPageMoveActionOutputV2,
|
|
31
|
+
DTODocumentationPageRestoreActionInput,
|
|
32
|
+
DTODocumentationPageRestoreActionOutput,
|
|
33
|
+
DTODocumentationPageUpdateActionInputV2,
|
|
34
|
+
DTODocumentationPageUpdateActionOutputV2,
|
|
35
|
+
DTODocumentationPageUpdateDocumentActionInputV2,
|
|
36
|
+
DTODocumentationPageUpdateDocumentActionOutputV2,
|
|
37
|
+
} from "./documentation/page-actions-v2";
|
|
38
|
+
import { DTOFigmaNodeRenderAsyncActionInput, DTOFigmaNodeRenderAsyncActionOutput } from "./figma-nodes/node-actions-v2";
|
|
39
|
+
import { DTOElementPropertyValuesEditActionInput, DTOElementPropertyValuesEditActionOutput } from "./properties";
|
|
40
|
+
|
|
41
|
+
//
|
|
42
|
+
// Read
|
|
43
|
+
//
|
|
44
|
+
|
|
45
|
+
export const DTOElementActionOutput = z.discriminatedUnion("type", [
|
|
46
|
+
// Documentation pages
|
|
47
|
+
DTODocumentationPageCreateActionOutputV2,
|
|
48
|
+
DTODocumentationPageUpdateActionOutputV2,
|
|
49
|
+
DTODocumentationPageUpdateDocumentActionOutputV2,
|
|
50
|
+
DTODocumentationPageMoveActionOutputV2,
|
|
51
|
+
DTODocumentationPageDuplicateActionOutputV2,
|
|
52
|
+
DTODocumentationPageDeleteActionOutputV2,
|
|
53
|
+
|
|
54
|
+
// Documentation groups
|
|
55
|
+
DTODocumentationGroupCreateActionOutputV2,
|
|
56
|
+
DTODocumentationTabCreateActionOutputV2,
|
|
57
|
+
DTODocumentationGroupUpdateActionOutputV2,
|
|
58
|
+
DTODocumentationGroupMoveActionOutputV2,
|
|
59
|
+
DTODocumentationGroupDuplicateActionOutputV2,
|
|
60
|
+
DTODocumentationGroupDeleteActionOutputV2,
|
|
61
|
+
DTODocumentationTabGroupDeleteActionOutputV2,
|
|
62
|
+
|
|
63
|
+
// Figma frames
|
|
64
|
+
DTOFigmaNodeRenderAsyncActionOutput,
|
|
65
|
+
|
|
66
|
+
// Restore
|
|
67
|
+
DTODocumentationPageRestoreActionOutput,
|
|
68
|
+
DTODocumentationGroupRestoreActionOutput,
|
|
69
|
+
|
|
70
|
+
// Approvals
|
|
71
|
+
DTODocumentationPageApprovalStateChangeActionOutput,
|
|
72
|
+
|
|
73
|
+
// Element properties
|
|
74
|
+
DTOElementPropertyValuesEditActionOutput,
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
export type DTOElementActionOutput = z.infer<typeof DTOElementActionOutput>;
|
|
78
|
+
|
|
79
|
+
//
|
|
80
|
+
// Write
|
|
81
|
+
//
|
|
82
|
+
|
|
83
|
+
export const DTOElementActionInput = z
|
|
84
|
+
.discriminatedUnion("type", [
|
|
85
|
+
// Documentation pages
|
|
86
|
+
DTODocumentationPageCreateActionInputV2,
|
|
87
|
+
DTODocumentationPageUpdateActionInputV2,
|
|
88
|
+
DTODocumentationPageUpdateDocumentActionInputV2,
|
|
89
|
+
DTODocumentationPageMoveActionInputV2,
|
|
90
|
+
DTODocumentationPageDuplicateActionInputV2,
|
|
91
|
+
DTODocumentationPageDeleteActionInputV2,
|
|
92
|
+
|
|
93
|
+
// Documentation groups
|
|
94
|
+
DTODocumentationGroupCreateActionInputV2,
|
|
95
|
+
DTODocumentationTabCreateActionInputV2,
|
|
96
|
+
DTODocumentationGroupUpdateActionInputV2,
|
|
97
|
+
DTODocumentationGroupMoveActionInputV2,
|
|
98
|
+
DTODocumentationGroupDuplicateActionInputV2,
|
|
99
|
+
DTODocumentationGroupDeleteActionInputV2,
|
|
100
|
+
DTODocumentationTabGroupDeleteActionInputV2,
|
|
101
|
+
|
|
102
|
+
// Figma frames
|
|
103
|
+
DTOFigmaNodeRenderAsyncActionInput,
|
|
104
|
+
|
|
105
|
+
// Restore
|
|
106
|
+
DTODocumentationPageRestoreActionInput,
|
|
107
|
+
DTODocumentationGroupRestoreActionInput,
|
|
108
|
+
|
|
109
|
+
// Approval
|
|
110
|
+
DTODocumentationPageApprovalStateChangeActionInput,
|
|
111
|
+
|
|
112
|
+
// Element properties
|
|
113
|
+
DTOElementPropertyValuesEditActionInput,
|
|
114
|
+
])
|
|
115
|
+
.and(
|
|
116
|
+
z.object({
|
|
117
|
+
tId: z.string().optional(),
|
|
118
|
+
})
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
export type DTOElementActionInput = z.infer<typeof DTOElementActionInput>;
|
|
122
|
+
export type DTOElementActionInputOfType<T extends DTOElementActionInput["type"]> = Extract<
|
|
123
|
+
DTOElementActionInput,
|
|
124
|
+
{ type: T }
|
|
125
|
+
>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FigmaFileStructureNode, FigmaNodeStructureStateV2 } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTOFigmaNodeStructure = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
sourceId: z.string(),
|
|
7
|
+
importState: FigmaNodeStructureStateV2,
|
|
8
|
+
createdAt: z.coerce.date(),
|
|
9
|
+
updatedAt: z.coerce.date(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const DTOFigmaNodeStructureDetail = DTOFigmaNodeStructure.extend({
|
|
13
|
+
rootNode: FigmaFileStructureNode,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const DTOFigmaNodeStructureListResponse = z.object({
|
|
17
|
+
structures: DTOFigmaNodeStructure.array(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const DTOFigmaNodeStructureDetailResponse = z.object({
|
|
21
|
+
structure: DTOFigmaNodeStructureDetail,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type DTOFigmaNodeStructure = z.infer<typeof DTOFigmaNodeStructure>;
|
|
25
|
+
export type DTOFigmaNodeStructureDetail = z.infer<typeof DTOFigmaNodeStructureDetail>;
|
|
26
|
+
export type DTOFigmaNodeStructureListResponse = z.infer<typeof DTOFigmaNodeStructureListResponse>;
|
|
27
|
+
export type DTOFigmaNodeStructureDetailResponse = z.infer<typeof DTOFigmaNodeStructureDetailResponse>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FigmaNodeReference } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOFigmaNodeOrigin, DTOFigmaNodeRenderFormat } from "./figma-node";
|
|
4
|
+
|
|
5
|
+
export const DTOFigmaNodeData = z.object({
|
|
6
|
+
// Id of the node in the Figma file
|
|
7
|
+
figmaNodeId: z.string(),
|
|
8
|
+
|
|
9
|
+
// Validity
|
|
10
|
+
isValid: z.boolean(),
|
|
11
|
+
|
|
12
|
+
// Asset data
|
|
13
|
+
assetId: z.string(),
|
|
14
|
+
assetUrl: z.string(),
|
|
15
|
+
assetFormat: DTOFigmaNodeRenderFormat,
|
|
16
|
+
|
|
17
|
+
// Asset metadata
|
|
18
|
+
assetScale: z.number(),
|
|
19
|
+
assetWidth: z.number().optional(),
|
|
20
|
+
assetHeight: z.number().optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const DTOFigmaNode = FigmaNodeReference.omit({
|
|
24
|
+
data: true,
|
|
25
|
+
origin: true,
|
|
26
|
+
}).extend({
|
|
27
|
+
data: DTOFigmaNodeData,
|
|
28
|
+
origin: DTOFigmaNodeOrigin,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type DTOFigmaNodeData = z.infer<typeof DTOFigmaNodeData>;
|
|
32
|
+
export type DTOFigmaNode = z.infer<typeof DTOFigmaNode>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FigmaNodeReference,
|
|
3
|
+
FigmaNodeRenderedImage,
|
|
4
|
+
FigmaNodeRenderError,
|
|
5
|
+
FigmaNodeRenderFormat,
|
|
6
|
+
FigmaNodeRenderState,
|
|
7
|
+
} from "@supernova-studio/model";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { DTOFigmaNodeOrigin } from "./figma-node";
|
|
10
|
+
|
|
11
|
+
export const DTOFigmaNodeDataV2 = z.object({
|
|
12
|
+
sceneNodeId: z.string(),
|
|
13
|
+
format: FigmaNodeRenderFormat,
|
|
14
|
+
scale: z.number().optional(),
|
|
15
|
+
|
|
16
|
+
renderState: FigmaNodeRenderState,
|
|
17
|
+
renderedImage: FigmaNodeRenderedImage.optional(),
|
|
18
|
+
renderError: FigmaNodeRenderError.optional(),
|
|
19
|
+
|
|
20
|
+
hasSource: z.boolean(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const DTOFigmaNodeV2 = FigmaNodeReference.omit({
|
|
24
|
+
data: true,
|
|
25
|
+
origin: true,
|
|
26
|
+
}).extend({
|
|
27
|
+
data: DTOFigmaNodeDataV2,
|
|
28
|
+
origin: DTOFigmaNodeOrigin,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type DTOFigmaNodeDataV2 = z.infer<typeof DTOFigmaNodeDataV2>;
|
|
32
|
+
export type DTOFigmaNodeV2 = z.infer<typeof DTOFigmaNodeV2>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { FigmaNodeRenderFormat } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//
|
|
5
|
+
// Enums
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
export const DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;
|
|
9
|
+
export type DTOFigmaNodeRenderFormat = z.infer<typeof DTOFigmaNodeRenderFormat>;
|
|
10
|
+
|
|
11
|
+
//
|
|
12
|
+
// Read
|
|
13
|
+
//
|
|
14
|
+
|
|
15
|
+
export const DTOFigmaNodeOrigin = z.object({
|
|
16
|
+
sourceId: z.string(),
|
|
17
|
+
fileId: z.string().optional(),
|
|
18
|
+
parentName: z.string().optional(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type DTOFigmaNodeOrigin = z.infer<typeof DTOFigmaNodeOrigin>;
|
|
22
|
+
|
|
23
|
+
//
|
|
24
|
+
// Write
|
|
25
|
+
//
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Properties that are available on all types of Figma node render requests
|
|
29
|
+
*/
|
|
30
|
+
const DTOFigmaNodeRenderInputBase = z.object({
|
|
31
|
+
/**
|
|
32
|
+
* Format in which the node must be rendered, png by default.
|
|
33
|
+
*/
|
|
34
|
+
format: FigmaNodeRenderFormat.default("Png"),
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Scale to apply to PNG images, can be between 1 and 4. Scale is ignored for other image formats.
|
|
38
|
+
*/
|
|
39
|
+
scale: z.number().optional(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Figma node render request that uses source ID + node ID to identify the requested
|
|
44
|
+
* node to render. The node ID can be obtained from the source's Figma node structure.
|
|
45
|
+
*/
|
|
46
|
+
export const DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
|
|
47
|
+
inputType: z
|
|
48
|
+
.literal("NodeId")
|
|
49
|
+
.optional()
|
|
50
|
+
.transform(v => v ?? "NodeId"),
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Id of a design system's data source representing a linked Figma file
|
|
54
|
+
*/
|
|
55
|
+
sourceId: z.string(),
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Id of a node within the Figma file
|
|
59
|
+
*/
|
|
60
|
+
figmaFileNodeId: z.string(),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Figma node render request that uses Figma URL to identify the requested
|
|
65
|
+
* node to render. The URL can be obtained by the user directly from the Figma app.
|
|
66
|
+
*/
|
|
67
|
+
export const DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
|
|
68
|
+
inputType: z.literal("URL"),
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Id of a design system's data source representing a linked Figma file
|
|
72
|
+
*/
|
|
73
|
+
figmaNodeUrl: z.string(),
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Brand persistent id to use in case a source has to be created for this render
|
|
77
|
+
*/
|
|
78
|
+
brandPersistentId: z.string(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Figma node render request that uses Figma URL to identify the requested
|
|
83
|
+
* node to render. The URL can be obtained by the user directly from the Figma app.
|
|
84
|
+
*/
|
|
85
|
+
export const DTOFigmaNodeRerenderInput = z.object({
|
|
86
|
+
inputType: z.literal("Rerender"),
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Persistent ID of an existing Figma node
|
|
90
|
+
*/
|
|
91
|
+
figmaNodePersistentId: z.string(),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export const DTOFigmaNodeRenderInput = z.discriminatedUnion("inputType", [
|
|
95
|
+
DTOFigmaNodeRenderIdInput,
|
|
96
|
+
DTOFigmaNodeRenderUrlInput,
|
|
97
|
+
DTOFigmaNodeRerenderInput,
|
|
98
|
+
]);
|
|
99
|
+
|
|
100
|
+
export type DTOFigmaNodeRenderIdInput = z.infer<typeof DTOFigmaNodeRenderIdInput>;
|
|
101
|
+
export type DTOFigmaNodeRenderUrlInput = z.infer<typeof DTOFigmaNodeRenderUrlInput>;
|
|
102
|
+
export type DTOFigmaNodeRerenderInput = z.infer<typeof DTOFigmaNodeRerenderInput>;
|
|
103
|
+
export type DTOFigmaNodeRenderInput = z.infer<typeof DTOFigmaNodeRenderInput>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOFigmaNodeRenderInput } from "./figma-node";
|
|
3
|
+
import { DTOFigmaNodeV2 } from "./figma-node-v2";
|
|
4
|
+
|
|
5
|
+
//
|
|
6
|
+
// Read
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
export const DTOFigmaNodeRenderAsyncActionOutput = z.object({
|
|
10
|
+
type: z.literal("FigmaNodeRenderAsync"),
|
|
11
|
+
figmaNodes: z.array(DTOFigmaNodeV2),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type DTOFigmaNodeRenderAsyncActionOutput = z.infer<typeof DTOFigmaNodeRenderAsyncActionOutput>;
|
|
15
|
+
|
|
16
|
+
//
|
|
17
|
+
// Read
|
|
18
|
+
//
|
|
19
|
+
|
|
20
|
+
export const DTOFigmaNodeRenderAsyncActionInput = z.object({
|
|
21
|
+
type: z.literal("FigmaNodeRenderAsync"),
|
|
22
|
+
nodes: DTOFigmaNodeRenderInput.array(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type DTOFigmaNodeRenderAsyncActionInput = z.infer<typeof DTOFigmaNodeRenderAsyncActionInput>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FigmaFileStructureOrigin, FigmaFileStructureStatistics } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTOFrameNodeStructure = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
persistentId: z.string(),
|
|
7
|
+
designSystemVersionId: z.string(),
|
|
8
|
+
origin: FigmaFileStructureOrigin,
|
|
9
|
+
assetsInFile: FigmaFileStructureStatistics,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const DTOFrameNodeStructureListResponse = z.object({
|
|
13
|
+
structures: DTOFrameNodeStructure.array(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type DTOFrameNodeStructure = z.infer<typeof DTOFrameNodeStructure>;
|
|
17
|
+
export type DTOFrameNodeStructureListResponse = z.infer<typeof DTOFrameNodeStructureListResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./frame-node-structure";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOFigmaNode, DTOFigmaNodeV2 } from "./figma-nodes";
|
|
3
|
+
|
|
4
|
+
//
|
|
5
|
+
// Read
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
export const DTOElementsGetTypeFilter = z.enum(["FigmaNode"]);
|
|
9
|
+
|
|
10
|
+
export const DTOElementsGetQuerySchema = z.object({
|
|
11
|
+
types: z.string().transform(val => val.split(",").map(v => DTOElementsGetTypeFilter.parse(v))),
|
|
12
|
+
responseVersion: z.coerce.number().default(1),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const DTOElementsGetOutput = z.object({
|
|
16
|
+
figmaNodes: z.array(DTOFigmaNode).optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const DTOElementsGetOutputV2 = z.object({
|
|
20
|
+
figmaNodes: z.array(DTOFigmaNodeV2).optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type DTOElementsGetOutput = z.infer<typeof DTOElementsGetOutput>;
|
|
24
|
+
export type DTOElementsGetOutputV2 = z.infer<typeof DTOElementsGetOutputV2>;
|
|
25
|
+
export type DTOElementsGetQueryRaw = z.input<typeof DTOElementsGetQuerySchema>;
|
|
26
|
+
export type DTOElementsGetQueryParsed = z.output<typeof DTOElementsGetQuerySchema>;
|
|
27
|
+
export type DTOElementsGetTypeFilter = z.infer<typeof DTOElementsGetTypeFilter>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ElementPropertyImmutableType,
|
|
3
|
+
ElementPropertyLinkType,
|
|
4
|
+
ElementPropertyTargetType,
|
|
5
|
+
ElementPropertyTypeSchema,
|
|
6
|
+
nullishToOptional,
|
|
7
|
+
} from "@supernova-studio/model";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { DTOColorTokenInlineData } from "../../aux";
|
|
10
|
+
import { DTOObjectMeta } from "../../aux/meta";
|
|
11
|
+
|
|
12
|
+
const CODE_NAME_REGEX = /^[a-zA-Z_$][a-zA-Z_$0-9-]{1,99}$/;
|
|
13
|
+
|
|
14
|
+
export const DTOElementPropertyDefinitionOption = z.object({
|
|
15
|
+
id: z.string(),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
backgroundColor: DTOColorTokenInlineData.optional(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// DTO Object
|
|
21
|
+
export const DTOElementPropertyDefinition = z.object({
|
|
22
|
+
id: z.string(),
|
|
23
|
+
designSystemVersionId: z.string(),
|
|
24
|
+
meta: DTOObjectMeta,
|
|
25
|
+
persistentId: z.string(),
|
|
26
|
+
type: ElementPropertyTypeSchema,
|
|
27
|
+
targetElementType: ElementPropertyTargetType,
|
|
28
|
+
codeName: z.string().regex(CODE_NAME_REGEX),
|
|
29
|
+
options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),
|
|
30
|
+
linkElementType: nullishToOptional(ElementPropertyLinkType),
|
|
31
|
+
isImmutable: z.boolean(),
|
|
32
|
+
immutablePropertyType: ElementPropertyImmutableType.optional(),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type DTOElementPropertyDefinitionOption = z.infer<typeof DTOElementPropertyDefinitionOption>;
|
|
36
|
+
export type DTOElementPropertyDefinition = z.infer<typeof DTOElementPropertyDefinition>;
|
|
37
|
+
|
|
38
|
+
//
|
|
39
|
+
// Read
|
|
40
|
+
//
|
|
41
|
+
|
|
42
|
+
export const DTOElementPropertyDefinitionListResponse = z.object({
|
|
43
|
+
definitions: z.array(DTOElementPropertyDefinition),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const DTOElementPropertyDefinitionResponse = z.object({
|
|
47
|
+
definition: DTOElementPropertyDefinition,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export type DTOElementPropertyDefinitionListResponse = z.infer<typeof DTOElementPropertyDefinitionListResponse>;
|
|
51
|
+
export type DTOElementPropertyDefinitionResponse = z.infer<typeof DTOElementPropertyDefinitionResponse>;
|
|
52
|
+
|
|
53
|
+
//
|
|
54
|
+
// Write
|
|
55
|
+
//
|
|
56
|
+
|
|
57
|
+
export const DTOElementPropertyDefinitionCreatePayload = z.object({
|
|
58
|
+
meta: DTOObjectMeta,
|
|
59
|
+
persistentId: z.string(),
|
|
60
|
+
type: ElementPropertyTypeSchema,
|
|
61
|
+
targetElementType: ElementPropertyTargetType,
|
|
62
|
+
codeName: z.string().regex(CODE_NAME_REGEX),
|
|
63
|
+
options: nullishToOptional(z.array(DTOElementPropertyDefinitionOption)),
|
|
64
|
+
linkElementType: nullishToOptional(ElementPropertyLinkType),
|
|
65
|
+
columnWidth: z.number().max(1024).optional(),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const DTOElementPropertyDefinitionUpdatePayload = z.object({
|
|
69
|
+
meta: DTOObjectMeta.optional(),
|
|
70
|
+
codeName: z.string().regex(CODE_NAME_REGEX).optional(),
|
|
71
|
+
options: z.array(DTOElementPropertyDefinitionOption).optional(),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export type DTOElementPropertyDefinitionCreatePayload = z.infer<typeof DTOElementPropertyDefinitionCreatePayload>;
|
|
75
|
+
export type DTOElementPropertyDefinitionUpdatePayload = z.infer<typeof DTOElementPropertyDefinitionUpdatePayload>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// Read
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
export const DTOElementPropertyValue = z.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
designSystemVersionId: z.string(),
|
|
10
|
+
definitionId: z.string(),
|
|
11
|
+
targetElementId: z.string(),
|
|
12
|
+
value: z.union([z.string(), z.number(), z.boolean()]).optional(),
|
|
13
|
+
valuePreview: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const DTOElementPropertyValueListResponse = z.object({
|
|
17
|
+
values: z.array(DTOElementPropertyValue),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const DTOElementPropertyValueResponse = z.object({
|
|
21
|
+
value: DTOElementPropertyValue,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const DTOElementPropertyValuesEditActionOutput = z.object({
|
|
25
|
+
type: z.literal("ElementPropertyValuesEdit"),
|
|
26
|
+
output: z.object({ success: z.literal(true) }),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export type DTOElementPropertyValue = z.infer<typeof DTOElementPropertyValue>;
|
|
30
|
+
export type DTOElementPropertyValueListResponse = z.infer<typeof DTOElementPropertyValueListResponse>;
|
|
31
|
+
export type DTOElementPropertyValueResponse = z.infer<typeof DTOElementPropertyValueResponse>;
|
|
32
|
+
export type DTOElementPropertyValuesEditActionOutput = z.infer<typeof DTOElementPropertyValuesEditActionOutput>;
|
|
33
|
+
|
|
34
|
+
//
|
|
35
|
+
// Write
|
|
36
|
+
//
|
|
37
|
+
|
|
38
|
+
export const DTOElementPropertyValueUpsertPaylod = z.object({
|
|
39
|
+
definitionId: z.string(),
|
|
40
|
+
targetElementId: z.string(),
|
|
41
|
+
value: z.string().or(z.number()).or(z.boolean()).nullable(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const DTOElementPropertyValuesEditActionInput = z.object({
|
|
45
|
+
type: z.literal("ElementPropertyValuesEdit"),
|
|
46
|
+
values: DTOElementPropertyValueUpsertPaylod.array(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export type DTOElementPropertyValueUpsertPaylod = z.infer<typeof DTOElementPropertyValueUpsertPaylod>;
|
|
50
|
+
export type DTOElementPropertyValuesEditActionInput = z.infer<typeof DTOElementPropertyValuesEditActionInput>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Id } from "@supernova-studio/model";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { DTOFeatureIteration, DTOFeatureIterationTag, DTOFeatureSandbox } from "../forge";
|
|
4
|
+
import { DTOForgeProjectMember } from "../forge/project-member";
|
|
5
|
+
|
|
6
|
+
export const DTOForgeProjectMembersCreated = z.object({
|
|
7
|
+
type: z.literal("ProjectMembersCreated"),
|
|
8
|
+
data: z.array(DTOForgeProjectMember),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const DTOForgeProjectMemberUpdated = z.object({
|
|
12
|
+
type: z.literal("ProjectMemberUpdated"),
|
|
13
|
+
data: DTOForgeProjectMember,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const DTOForgeProjectMemberDeleted = z.object({
|
|
17
|
+
type: z.literal("ProjectMemberDeleted"),
|
|
18
|
+
data: DTOForgeProjectMember.pick({ userId: true }),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const DTOForgeProjectIterationTagSet = z.object({
|
|
22
|
+
type: z.literal("ProjectIterationTagSet"),
|
|
23
|
+
data: DTOFeatureIterationTag,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const DTOForgeProjectFeatureSandboxUpdated = z.object({
|
|
27
|
+
type: z.literal("ProjectFeatureSandboxUpdated"),
|
|
28
|
+
data: DTOFeatureSandbox,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const DTOForgeProjectIterationUpdated = z.object({
|
|
32
|
+
type: z.literal("ProjectIterationUpdated"),
|
|
33
|
+
data: DTOFeatureIteration.extend({ featureId: Id }),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const DTOForgeProjectRoomEvent = z.discriminatedUnion("type", [
|
|
37
|
+
DTOForgeProjectMembersCreated,
|
|
38
|
+
DTOForgeProjectMemberUpdated,
|
|
39
|
+
DTOForgeProjectMemberDeleted,
|
|
40
|
+
DTOForgeProjectIterationTagSet,
|
|
41
|
+
DTOForgeProjectFeatureSandboxUpdated,
|
|
42
|
+
DTOForgeProjectIterationUpdated,
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
export type DTOForgeProjectMembersCreated = z.infer<typeof DTOForgeProjectMembersCreated>;
|
|
46
|
+
export type DTOForgeProjectMemberUpdated = z.infer<typeof DTOForgeProjectMemberUpdated>;
|
|
47
|
+
export type DTOForgeProjectMemberDeleted = z.infer<typeof DTOForgeProjectMemberDeleted>;
|
|
48
|
+
export type DTOForgeProjectIterationTagSet = z.infer<typeof DTOForgeProjectIterationTagSet>;
|
|
49
|
+
export type DTOForgeProjectFeatureSandboxUpdated = z.infer<typeof DTOForgeProjectFeatureSandboxUpdated>;
|
|
50
|
+
export type DTOForgeProjectIterationUpdated = z.infer<typeof DTOForgeProjectIterationUpdated>;
|
|
51
|
+
export type DTOForgeProjectRoomEvent = z.infer<typeof DTOForgeProjectRoomEvent>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { DTOCodeScanListItem } from "../design-systems/code-scan";
|
|
3
|
+
import { DTOForgeProjectContextV2 } from "../forge/project-context-v2";
|
|
4
|
+
|
|
5
|
+
export const DTOForgeProjectCreated = z.object({
|
|
6
|
+
type: z.literal("ProjectCreated"),
|
|
7
|
+
data: z.object({ id: z.string() }),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const DTOForgeProjectUpdated = z.object({
|
|
11
|
+
type: z.literal("ProjectUpdated"),
|
|
12
|
+
data: z.object({ id: z.string() }),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const DTOForgeProjectContextCreated = z.object({
|
|
16
|
+
type: z.literal("ProjectContextCreated"),
|
|
17
|
+
data: DTOForgeProjectContextV2,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const DTOForgeProjectContextUpdated = z.object({
|
|
21
|
+
type: z.literal("ProjectContextUpdated"),
|
|
22
|
+
data: DTOForgeProjectContextV2,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const DTOForgeProjectContextDeleted = z.object({
|
|
26
|
+
type: z.literal("ProjectContextDeleted"),
|
|
27
|
+
data: DTOForgeProjectContextV2.pick({ id: true }),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const DTOSandboxTemplateVersionCreated = z.object({
|
|
31
|
+
type: z.literal("SandboxTemplateVersionCreated"),
|
|
32
|
+
data: z.object({
|
|
33
|
+
templateId: z.string(),
|
|
34
|
+
version: z.string(),
|
|
35
|
+
designSystemId: z.string(),
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const DTOSandboxTemplateBuildCreated = z.object({
|
|
40
|
+
type: z.literal("SandboxTemplateBuildCreated"),
|
|
41
|
+
data: z.object({
|
|
42
|
+
buildId: z.string(),
|
|
43
|
+
templateId: z.string().optional(),
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const DTOSandboxTemplateBuildFinished = z.object({
|
|
48
|
+
type: z.literal("SandboxTemplateBuildFinished"),
|
|
49
|
+
data: z.object({
|
|
50
|
+
buildId: z.string(),
|
|
51
|
+
templateId: z.string().optional(),
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const DTOCodeScanFinished = z.object({
|
|
56
|
+
type: z.literal("CodeScanFinished"),
|
|
57
|
+
data: DTOCodeScanListItem,
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const DTOWorkspaceRoomEvent = z.discriminatedUnion("type", [
|
|
61
|
+
DTOForgeProjectUpdated,
|
|
62
|
+
DTOForgeProjectCreated,
|
|
63
|
+
DTOForgeProjectContextCreated,
|
|
64
|
+
DTOForgeProjectContextUpdated,
|
|
65
|
+
DTOForgeProjectContextDeleted,
|
|
66
|
+
DTOSandboxTemplateVersionCreated,
|
|
67
|
+
DTOSandboxTemplateBuildCreated,
|
|
68
|
+
DTOSandboxTemplateBuildFinished,
|
|
69
|
+
DTOCodeScanFinished,
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
export type DTOForgeProjectCreated = z.infer<typeof DTOForgeProjectCreated>;
|
|
73
|
+
export type DTOForgeProjectUpdated = z.infer<typeof DTOForgeProjectUpdated>;
|
|
74
|
+
export type DTOForgeProjectContextCreated = z.infer<typeof DTOForgeProjectContextCreated>;
|
|
75
|
+
export type DTOForgeProjectContextUpdated = z.infer<typeof DTOForgeProjectContextUpdated>;
|
|
76
|
+
export type DTOForgeProjectContextDeleted = z.infer<typeof DTOForgeProjectContextDeleted>;
|
|
77
|
+
export type DTOSandboxTemplateVersionCreated = z.infer<typeof DTOSandboxTemplateVersionCreated>;
|
|
78
|
+
export type DTOSandboxTemplateBuildCreated = z.infer<typeof DTOSandboxTemplateBuildCreated>;
|
|
79
|
+
export type DTOSandboxTemplateBuildFinished = z.infer<typeof DTOSandboxTemplateBuildFinished>;
|
|
80
|
+
export type DTOCodeScanFinished = z.infer<typeof DTOCodeScanFinished>;
|
|
81
|
+
export type DTOWorkspaceRoomEvent = z.infer<typeof DTOWorkspaceRoomEvent>;
|