@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,141 @@
|
|
|
1
|
+
import { DTOObjectMetadata } from "../aux"
|
|
2
|
+
|
|
3
|
+
import { z } from "zod"
|
|
4
|
+
|
|
5
|
+
export const DTOForgeProjectContextFeedbackSentiment = z.enum([
|
|
6
|
+
"Positive",
|
|
7
|
+
"Neutral",
|
|
8
|
+
"Negative",
|
|
9
|
+
"Aggressive",
|
|
10
|
+
])
|
|
11
|
+
export const DTOForgeProjectContextFeedbackState = z.enum([
|
|
12
|
+
"Resolved",
|
|
13
|
+
"Unresolved",
|
|
14
|
+
])
|
|
15
|
+
export const DTOForgeProjectContextFeedbackCategory = z.enum([
|
|
16
|
+
"MissingInformation",
|
|
17
|
+
"Incorrect",
|
|
18
|
+
"Output",
|
|
19
|
+
"WrongSource",
|
|
20
|
+
])
|
|
21
|
+
|
|
22
|
+
export const DTOForgeProjectContextFeedback = z.object({
|
|
23
|
+
id: z.string().uuid(),
|
|
24
|
+
workspaceId: z.string(),
|
|
25
|
+
contextId: z.string(),
|
|
26
|
+
createdByUserId: z.string().optional(),
|
|
27
|
+
createdAt: z.coerce.date(),
|
|
28
|
+
message: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe(
|
|
31
|
+
"A concise human-readable summary of the feedback being collected."
|
|
32
|
+
),
|
|
33
|
+
description: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe(
|
|
37
|
+
"Optional additional details that expand on the feedback summary."
|
|
38
|
+
),
|
|
39
|
+
conversation: z
|
|
40
|
+
.array(z.string())
|
|
41
|
+
.describe(
|
|
42
|
+
"Ordered conversation excerpts that provide context for the feedback. Each item should be one message."
|
|
43
|
+
),
|
|
44
|
+
sentiment: DTOForgeProjectContextFeedbackSentiment.describe(
|
|
45
|
+
"Overall sentiment of the feedback. Use Positive, Neutral, Negative, or Aggressive."
|
|
46
|
+
),
|
|
47
|
+
state: DTOForgeProjectContextFeedbackState,
|
|
48
|
+
category: DTOForgeProjectContextFeedbackCategory,
|
|
49
|
+
llm: z
|
|
50
|
+
.object({
|
|
51
|
+
model: z
|
|
52
|
+
.string()
|
|
53
|
+
.describe(
|
|
54
|
+
"The LLM model name that generated or participated in the conversation."
|
|
55
|
+
),
|
|
56
|
+
provider: z.string().describe("The LLM provider name."),
|
|
57
|
+
})
|
|
58
|
+
.describe("Information about the LLM associated with this feedback."),
|
|
59
|
+
metadata: DTOObjectMetadata.optional(),
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
export const DTOForgeProjectContextFeedbackCreatePayload =
|
|
63
|
+
DTOForgeProjectContextFeedback.pick({
|
|
64
|
+
contextId: true,
|
|
65
|
+
message: true,
|
|
66
|
+
description: true,
|
|
67
|
+
conversation: true,
|
|
68
|
+
sentiment: true,
|
|
69
|
+
category: true,
|
|
70
|
+
metadata: true,
|
|
71
|
+
llm: true,
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
export const DTOForgeProjectContextFeedbackListQuery = z
|
|
75
|
+
.object({
|
|
76
|
+
contextId: z.string().optional(),
|
|
77
|
+
workspaceId: z.string().optional(),
|
|
78
|
+
designSystemId: z.string().optional(),
|
|
79
|
+
})
|
|
80
|
+
.refine(
|
|
81
|
+
(query) =>
|
|
82
|
+
Boolean(query.contextId) ||
|
|
83
|
+
Boolean(query.workspaceId) ||
|
|
84
|
+
Boolean(query.designSystemId),
|
|
85
|
+
"At least one of contextId, workspaceId, or designSystemId is required."
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
export const DTOForgeProjectContextFeedbackDeletePayload = z.object({
|
|
89
|
+
id: z.union([z.string(), z.array(z.string())]),
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
export const DTOForgeProjectContextFeedbackUpdatePayload = z.object({
|
|
93
|
+
id: z.string(),
|
|
94
|
+
state: DTOForgeProjectContextFeedbackState,
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
export const DTOForgeProjectContextFeedbackResponse = z.object({
|
|
98
|
+
feedback: DTOForgeProjectContextFeedback,
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
export const DTOForgeProjectContextFeedbackListResponse = z.object({
|
|
102
|
+
feedback: z.array(DTOForgeProjectContextFeedback),
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
export const DTOForgeProjectContextFeedbackDeleteResponse = z.object({
|
|
106
|
+
ok: z.literal(true),
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
export type DTOForgeProjectContextFeedbackSentiment = z.infer<
|
|
110
|
+
typeof DTOForgeProjectContextFeedbackSentiment
|
|
111
|
+
>
|
|
112
|
+
export type DTOForgeProjectContextFeedbackState = z.infer<
|
|
113
|
+
typeof DTOForgeProjectContextFeedbackState
|
|
114
|
+
>
|
|
115
|
+
export type DTOForgeProjectContextFeedbackCategory = z.infer<
|
|
116
|
+
typeof DTOForgeProjectContextFeedbackCategory
|
|
117
|
+
>
|
|
118
|
+
export type DTOForgeProjectContextFeedback = z.infer<
|
|
119
|
+
typeof DTOForgeProjectContextFeedback
|
|
120
|
+
>
|
|
121
|
+
export type DTOForgeProjectContextFeedbackCreatePayload = z.infer<
|
|
122
|
+
typeof DTOForgeProjectContextFeedbackCreatePayload
|
|
123
|
+
>
|
|
124
|
+
export type DTOForgeProjectContextFeedbackListQuery = z.infer<
|
|
125
|
+
typeof DTOForgeProjectContextFeedbackListQuery
|
|
126
|
+
>
|
|
127
|
+
export type DTOForgeProjectContextFeedbackDeletePayload = z.infer<
|
|
128
|
+
typeof DTOForgeProjectContextFeedbackDeletePayload
|
|
129
|
+
>
|
|
130
|
+
export type DTOForgeProjectContextFeedbackUpdatePayload = z.infer<
|
|
131
|
+
typeof DTOForgeProjectContextFeedbackUpdatePayload
|
|
132
|
+
>
|
|
133
|
+
export type DTOForgeProjectContextFeedbackResponse = z.infer<
|
|
134
|
+
typeof DTOForgeProjectContextFeedbackResponse
|
|
135
|
+
>
|
|
136
|
+
export type DTOForgeProjectContextFeedbackListResponse = z.infer<
|
|
137
|
+
typeof DTOForgeProjectContextFeedbackListResponse
|
|
138
|
+
>
|
|
139
|
+
export type DTOForgeProjectContextFeedbackDeleteResponse = z.infer<
|
|
140
|
+
typeof DTOForgeProjectContextFeedbackDeleteResponse
|
|
141
|
+
>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { DTOForgeProjectContextV2, DTOForgeProjectTheme } from "./project-context-v2";
|
|
3
|
+
|
|
4
|
+
export const DTOProjectContextOverride = z.object({
|
|
5
|
+
projectId: z.string(),
|
|
6
|
+
theme: DTOForgeProjectTheme.partial(),
|
|
7
|
+
themePreset: z.string().optional(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const DTOProjectContextOverrideInput = z.object({
|
|
11
|
+
updateSharedContext: z.boolean().optional(),
|
|
12
|
+
theme: DTOForgeProjectTheme.partial(),
|
|
13
|
+
themePreset: z.string().optional(),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// TS7056 workaround. DTOForgeProjectContextV2 embeds the recursive scope tree
|
|
17
|
+
// and appears twice here, so a whole-composite `z.infer<...>` would expand both
|
|
18
|
+
// copies inline and overflow the .d.ts emit limit. The cast keeps `.parse()`
|
|
19
|
+
// typed via the manual alias below — runtime validation is unchanged.
|
|
20
|
+
//
|
|
21
|
+
// Alternatives ruled out:
|
|
22
|
+
// - `z.ZodType<X>` annotation → `.nullish()` input/output variance error
|
|
23
|
+
// - `z.lazy(() => DTOForgeProjectContextV2)` → same variance error
|
|
24
|
+
// - `z.ZodTypeAny` annotation → consumers lose `.parse()` typing
|
|
25
|
+
export const DTOProjectContextOverrideResponse = z.object({
|
|
26
|
+
override: DTOProjectContextOverride,
|
|
27
|
+
originalContext: DTOForgeProjectContextV2,
|
|
28
|
+
resolvedContext: DTOForgeProjectContextV2,
|
|
29
|
+
}) as unknown as z.ZodType<DTOProjectContextOverrideResponse>;
|
|
30
|
+
|
|
31
|
+
export type DTOProjectContextOverride = z.infer<typeof DTOProjectContextOverride>;
|
|
32
|
+
export type DTOProjectContextOverrideInput = z.infer<typeof DTOProjectContextOverrideInput>;
|
|
33
|
+
// Manual definition (not `z.infer<typeof DTOProjectContextOverrideResponse>`)
|
|
34
|
+
// for the same TS7056 reason — see comment on the schema above. Field-level
|
|
35
|
+
// `z.infer<typeof DTOForgeProjectContextV2>` is fine because TS emits it as a
|
|
36
|
+
// name reference, not an inline expansion.
|
|
37
|
+
export type DTOProjectContextOverrideResponse = {
|
|
38
|
+
override: DTOProjectContextOverride;
|
|
39
|
+
originalContext: z.infer<typeof DTOForgeProjectContextV2>;
|
|
40
|
+
resolvedContext: z.infer<typeof DTOForgeProjectContextV2>;
|
|
41
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ForgeProjectContextMcpUrlSlug,
|
|
3
|
+
ForgeProjectContextScope,
|
|
4
|
+
} from "@supernova-studio/model";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
|
|
7
|
+
const MAX_SCOPE_BYTES = 1024 * 1024;
|
|
8
|
+
|
|
9
|
+
// Adds a 1MB wire-format cap on top of the model schema.
|
|
10
|
+
export const DTOForgeProjectContextScope = ForgeProjectContextScope.superRefine((scope, ctx) => {
|
|
11
|
+
const size = new TextEncoder().encode(JSON.stringify(scope)).length;
|
|
12
|
+
if (size > MAX_SCOPE_BYTES) {
|
|
13
|
+
ctx.addIssue({
|
|
14
|
+
code: z.ZodIssueCode.custom,
|
|
15
|
+
message: "Project context scope must be 1MB or smaller.",
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type DTOForgeProjectContextScope = ForgeProjectContextScope;
|
|
21
|
+
|
|
22
|
+
export const DTOForgeMcpUrlSlug = ForgeProjectContextMcpUrlSlug;
|
|
23
|
+
export type DTOForgeMcpUrlSlug = ForgeProjectContextMcpUrlSlug;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BorderRadiusTokenData,
|
|
3
|
+
ColorTokenData,
|
|
4
|
+
FontFamilyTokenData,
|
|
5
|
+
FontSizeTokenData,
|
|
6
|
+
FontWeightTokenData,
|
|
7
|
+
LineHeightTokenData,
|
|
8
|
+
ShadowTokenData,
|
|
9
|
+
SpaceTokenData,
|
|
10
|
+
} from "@supernova-studio/model";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { zodQueryBoolean } from "../../../utils/query";
|
|
13
|
+
import { DTOObjectMetadata } from "../aux";
|
|
14
|
+
import { DTOFileReference } from "../files/files";
|
|
15
|
+
import { DTOForgeMcpUrlSlug, DTOForgeProjectContextScope } from "./project-context-scope";
|
|
16
|
+
|
|
17
|
+
export const DTOForgeComponentSetTypeV2 = z.enum(["Shadcn"]);
|
|
18
|
+
export const DTOForgeComponentSet = z.object({
|
|
19
|
+
type: DTOForgeComponentSetTypeV2,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const DTOForgeIconSetTypeV2 = z.enum(["Phosphor", "Lucide", "Tabler"]);
|
|
23
|
+
export const DTOForgeThemeKnownPreset = z.enum(["Default", "Airbnb", "Spotify", "Windows98"]);
|
|
24
|
+
|
|
25
|
+
export const DTOForgeIconSet = z.object({
|
|
26
|
+
type: DTOForgeIconSetTypeV2,
|
|
27
|
+
variant: z.string().optional(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const DTOForgeTokenThemeSet = z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
name: z.string(),
|
|
33
|
+
tokenThemeIds: z.array(z.string()),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const DTOForgeProjectTheme = z.object({
|
|
37
|
+
// Colors
|
|
38
|
+
background: ColorTokenData,
|
|
39
|
+
foreground: ColorTokenData,
|
|
40
|
+
card: ColorTokenData,
|
|
41
|
+
cardForeground: ColorTokenData,
|
|
42
|
+
popover: ColorTokenData,
|
|
43
|
+
popoverForeground: ColorTokenData,
|
|
44
|
+
primary: ColorTokenData,
|
|
45
|
+
primaryForeground: ColorTokenData,
|
|
46
|
+
secondary: ColorTokenData,
|
|
47
|
+
secondaryForeground: ColorTokenData,
|
|
48
|
+
muted: ColorTokenData,
|
|
49
|
+
mutedForeground: ColorTokenData,
|
|
50
|
+
accent: ColorTokenData,
|
|
51
|
+
accentForeground: ColorTokenData,
|
|
52
|
+
destructive: ColorTokenData,
|
|
53
|
+
border: ColorTokenData,
|
|
54
|
+
input: ColorTokenData,
|
|
55
|
+
ring: ColorTokenData,
|
|
56
|
+
chart1: ColorTokenData,
|
|
57
|
+
chart2: ColorTokenData,
|
|
58
|
+
chart3: ColorTokenData,
|
|
59
|
+
chart4: ColorTokenData,
|
|
60
|
+
chart5: ColorTokenData,
|
|
61
|
+
sidebar: ColorTokenData,
|
|
62
|
+
sidebarForeground: ColorTokenData,
|
|
63
|
+
sidebarPrimary: ColorTokenData,
|
|
64
|
+
sidebarPrimaryForeground: ColorTokenData,
|
|
65
|
+
sidebarAccent: ColorTokenData,
|
|
66
|
+
sidebarAccentForeground: ColorTokenData,
|
|
67
|
+
sidebarBorder: ColorTokenData,
|
|
68
|
+
sidebarRing: ColorTokenData,
|
|
69
|
+
|
|
70
|
+
// Font family
|
|
71
|
+
fontFamily: FontFamilyTokenData,
|
|
72
|
+
|
|
73
|
+
// Font sizes
|
|
74
|
+
textXs: FontSizeTokenData,
|
|
75
|
+
textSm: FontSizeTokenData,
|
|
76
|
+
textBase: FontSizeTokenData,
|
|
77
|
+
textLg: FontSizeTokenData,
|
|
78
|
+
textXl: FontSizeTokenData,
|
|
79
|
+
text2xl: FontSizeTokenData,
|
|
80
|
+
text3xl: FontSizeTokenData,
|
|
81
|
+
text4xl: FontSizeTokenData,
|
|
82
|
+
text5xl: FontSizeTokenData,
|
|
83
|
+
text6xl: FontSizeTokenData,
|
|
84
|
+
text7xl: FontSizeTokenData,
|
|
85
|
+
text8xl: FontSizeTokenData,
|
|
86
|
+
text9xl: FontSizeTokenData,
|
|
87
|
+
|
|
88
|
+
// Line heights
|
|
89
|
+
textXsLineHeight: LineHeightTokenData,
|
|
90
|
+
textSmLineHeight: LineHeightTokenData,
|
|
91
|
+
textBaseLineHeight: LineHeightTokenData,
|
|
92
|
+
textLgLineHeight: LineHeightTokenData,
|
|
93
|
+
textXlLineHeight: LineHeightTokenData,
|
|
94
|
+
text2xlLineHeight: LineHeightTokenData,
|
|
95
|
+
text3xlLineHeight: LineHeightTokenData,
|
|
96
|
+
text4xlLineHeight: LineHeightTokenData,
|
|
97
|
+
text5xlLineHeight: LineHeightTokenData,
|
|
98
|
+
text6xlLineHeight: LineHeightTokenData,
|
|
99
|
+
text7xlLineHeight: LineHeightTokenData,
|
|
100
|
+
text8xlLineHeight: LineHeightTokenData,
|
|
101
|
+
text9xlLineHeight: LineHeightTokenData,
|
|
102
|
+
|
|
103
|
+
// Font weights
|
|
104
|
+
fontWeightThin: FontWeightTokenData,
|
|
105
|
+
fontWeightExtralight: FontWeightTokenData,
|
|
106
|
+
fontWeightLight: FontWeightTokenData,
|
|
107
|
+
fontWeightNormal: FontWeightTokenData,
|
|
108
|
+
fontWeightMedium: FontWeightTokenData,
|
|
109
|
+
fontWeightSemibold: FontWeightTokenData,
|
|
110
|
+
fontWeightBold: FontWeightTokenData,
|
|
111
|
+
fontWeightExtrabold: FontWeightTokenData,
|
|
112
|
+
fontWeightBlack: FontWeightTokenData,
|
|
113
|
+
|
|
114
|
+
// Other dimensions
|
|
115
|
+
radius: BorderRadiusTokenData,
|
|
116
|
+
spacing: SpaceTokenData,
|
|
117
|
+
|
|
118
|
+
// Shadows
|
|
119
|
+
shadow2xs: ShadowTokenData,
|
|
120
|
+
shadowXs: ShadowTokenData,
|
|
121
|
+
shadowSm: ShadowTokenData,
|
|
122
|
+
shadowMd: ShadowTokenData,
|
|
123
|
+
shadowLg: ShadowTokenData,
|
|
124
|
+
shadowXl: ShadowTokenData,
|
|
125
|
+
shadow2xl: ShadowTokenData,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export const DTOForgeProjectContextV2 = z.object({
|
|
129
|
+
id: z.string(),
|
|
130
|
+
name: z.string(),
|
|
131
|
+
workspaceId: z.string(),
|
|
132
|
+
designSystemId: z.string().optional(),
|
|
133
|
+
brandId: z.string().optional(),
|
|
134
|
+
defaultTokenThemeSetId: z.string().optional(),
|
|
135
|
+
description: z.string().optional(),
|
|
136
|
+
productContext: z.string().optional(),
|
|
137
|
+
additionalContext: z.string().optional(),
|
|
138
|
+
isArchived: z.boolean(),
|
|
139
|
+
isAllowedInPortal: z.boolean(),
|
|
140
|
+
isLibraryDismissed: z.boolean().optional(),
|
|
141
|
+
themePreset: z.string().optional(),
|
|
142
|
+
tokenThemeSets: z.array(DTOForgeTokenThemeSet).optional(),
|
|
143
|
+
scope: DTOForgeProjectContextScope.nullish(),
|
|
144
|
+
mcpUrlSlug: DTOForgeMcpUrlSlug.nullish(),
|
|
145
|
+
metadata: DTOObjectMetadata.optional(),
|
|
146
|
+
componentSet: DTOForgeComponentSet,
|
|
147
|
+
iconSet: DTOForgeIconSet,
|
|
148
|
+
theme: DTOForgeProjectTheme,
|
|
149
|
+
createdAt: z.coerce.date(),
|
|
150
|
+
updatedAt: z.coerce.date(),
|
|
151
|
+
thumbnail: DTOFileReference.optional(),
|
|
152
|
+
|
|
153
|
+
sandboxTemplate: z
|
|
154
|
+
.object({
|
|
155
|
+
id: z.string(),
|
|
156
|
+
version: z.string(),
|
|
157
|
+
})
|
|
158
|
+
.optional(),
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export const DTOForgeProjectContextCreateV2 = DTOForgeProjectContextV2.omit({
|
|
162
|
+
id: true,
|
|
163
|
+
createdAt: true,
|
|
164
|
+
updatedAt: true,
|
|
165
|
+
isArchived: true,
|
|
166
|
+
thumbnail: true,
|
|
167
|
+
})
|
|
168
|
+
.extend({
|
|
169
|
+
// Optional on create: FE may pass an explicit value, otherwise the server
|
|
170
|
+
// derives it (true when a sandbox template or component library is provided, else false).
|
|
171
|
+
isAllowedInPortal: z.boolean().optional(),
|
|
172
|
+
thumbnailFileId: z.string().optional(),
|
|
173
|
+
theme: DTOForgeProjectTheme.optional(),
|
|
174
|
+
iconSet: DTOForgeIconSet.optional(),
|
|
175
|
+
componentSet: DTOForgeComponentSet.optional(),
|
|
176
|
+
})
|
|
177
|
+
.superRefine((input, ctx) => {
|
|
178
|
+
// If FE sets isAllowedInPortal to false => we don't care about templates/component lib
|
|
179
|
+
if (input.isAllowedInPortal === false) return;
|
|
180
|
+
|
|
181
|
+
const hasDefaultTemplateFields = input.theme && input.iconSet && input.componentSet;
|
|
182
|
+
const hasCustomTemplateFields = input.sandboxTemplate;
|
|
183
|
+
|
|
184
|
+
if (hasDefaultTemplateFields || hasCustomTemplateFields) return;
|
|
185
|
+
|
|
186
|
+
ctx.addIssue({
|
|
187
|
+
code: z.ZodIssueCode.custom,
|
|
188
|
+
message:
|
|
189
|
+
"Either the setup fields for default template (theme, iconSet, componentSet) or a sandbox template field (sandboxTemplate) must be provided.",
|
|
190
|
+
path: ["theme", "iconSet", "componentSet", "sandboxTemplate"],
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
export const DTOForgeProjectContextUpdateV2 = DTOForgeProjectContextV2.omit({
|
|
195
|
+
id: true,
|
|
196
|
+
workspaceId: true,
|
|
197
|
+
// designSystemId + brandId are immutable after create. Changing them on an
|
|
198
|
+
// existing context would orphan stored scope (token/page ids reference the
|
|
199
|
+
// original DS/brand). To re-target, create a new context.
|
|
200
|
+
designSystemId: true,
|
|
201
|
+
brandId: true,
|
|
202
|
+
createdAt: true,
|
|
203
|
+
updatedAt: true,
|
|
204
|
+
thumbnail: true,
|
|
205
|
+
})
|
|
206
|
+
.partial()
|
|
207
|
+
.extend({
|
|
208
|
+
thumbnailFileId: z.string().nullish(),
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
export const DTOForgeProjectContextResponseV2 = z.object({ context: DTOForgeProjectContextV2 });
|
|
212
|
+
export const DTOForgeProjectContextListQueryV2 = z.object({
|
|
213
|
+
workspaceId: z.string(),
|
|
214
|
+
isArchived: zodQueryBoolean(),
|
|
215
|
+
});
|
|
216
|
+
export const DTOForgeProjectContextListResponseV2 = z.object({ contexts: z.array(DTOForgeProjectContextV2) });
|
|
217
|
+
|
|
218
|
+
export type DTOForgeTokenThemeSet = z.infer<typeof DTOForgeTokenThemeSet>;
|
|
219
|
+
export type DTOForgeProjectContextV2 = z.infer<typeof DTOForgeProjectContextV2>;
|
|
220
|
+
export type DTOForgeThemeKnownPreset = z.infer<typeof DTOForgeThemeKnownPreset>;
|
|
221
|
+
export type DTOForgeProjectContextCreateV2 = z.infer<typeof DTOForgeProjectContextCreateV2>;
|
|
222
|
+
export type DTOForgeProjectContextUpdateV2 = z.infer<typeof DTOForgeProjectContextUpdateV2>;
|
|
223
|
+
export type DTOForgeIconSetTypeV2 = z.infer<typeof DTOForgeIconSetTypeV2>;
|
|
224
|
+
export type DTOForgeComponentSetTypeV2 = z.infer<typeof DTOForgeComponentSetTypeV2>;
|
|
225
|
+
export type DTOForgeProjectContextResponseV2 = z.infer<typeof DTOForgeProjectContextResponseV2>;
|
|
226
|
+
export type DTOForgeProjectContextListQueryV2 = z.infer<typeof DTOForgeProjectContextListQueryV2>;
|
|
227
|
+
export type DTOForgeProjectContextListResponseV2 = z.infer<typeof DTOForgeProjectContextListResponseV2>;
|
|
228
|
+
export type DTOForgeProjectTheme = z.infer<typeof DTOForgeProjectTheme>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { NpmRegistryConfig } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTONpmRegistryConfig } from "../workspaces";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
export const DTOForgeProjectContext = z.object({
|
|
9
|
+
definition: z.string(),
|
|
10
|
+
dependencies: z.array(
|
|
11
|
+
z.object({
|
|
12
|
+
packageName: z.string(),
|
|
13
|
+
type: z.literal("npm"),
|
|
14
|
+
version: z.string().default("latest"),
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
designSystemId: z.string(),
|
|
18
|
+
id: z.string(),
|
|
19
|
+
meta: z.object({
|
|
20
|
+
name: z.string(),
|
|
21
|
+
description: z.string().optional(),
|
|
22
|
+
}),
|
|
23
|
+
name: z.string(),
|
|
24
|
+
npmProxySettings: DTONpmRegistryConfig.optional(),
|
|
25
|
+
platform: z.enum(["React", "Vue", "Angular"]),
|
|
26
|
+
styling: z.enum(["CSS", "Tailwind"]),
|
|
27
|
+
|
|
28
|
+
tailwindConfig: z
|
|
29
|
+
.object({
|
|
30
|
+
content: z.string(),
|
|
31
|
+
version: z.string(),
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
|
|
35
|
+
createdAt: z.coerce.date(),
|
|
36
|
+
updatedAt: z.coerce.date(),
|
|
37
|
+
workspaceId: z.string(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const DTOCreateForgeProjectContext = DTOForgeProjectContext.pick({
|
|
41
|
+
definition: true,
|
|
42
|
+
name: true,
|
|
43
|
+
meta: true,
|
|
44
|
+
designSystemId: true,
|
|
45
|
+
platform: true,
|
|
46
|
+
dependencies: true,
|
|
47
|
+
tailwindConfig: true,
|
|
48
|
+
styling: true,
|
|
49
|
+
}).extend({ npmProxySettings: DTONpmRegistryConfig });
|
|
50
|
+
|
|
51
|
+
export const DTOUpdateForgeProjectContext = DTOCreateForgeProjectContext.partial().extend({ id: z.string() });
|
|
52
|
+
|
|
53
|
+
export const DTOForgeProjectContextGetResponse = z.object({ context: DTOForgeProjectContext });
|
|
54
|
+
|
|
55
|
+
export const DTOForgeProjectContextListResponse = z.object({ contexts: z.array(DTOForgeProjectContext) });
|
|
56
|
+
|
|
57
|
+
export const DTOForgeProjectContextCreateResponse = z.object({ context: DTOForgeProjectContext });
|
|
58
|
+
|
|
59
|
+
export const DTOForgeProjectContextUpdateResponse = z.object({ context: DTOForgeProjectContext });
|
|
60
|
+
|
|
61
|
+
export const DTOForgeProjectContextRemoveResponse = z.object({
|
|
62
|
+
ok: z.literal(true),
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export type DTOForgeProjectContext = z.infer<typeof DTOForgeProjectContext>;
|
|
66
|
+
export type DTOCreateForgeProjectContext = z.infer<typeof DTOCreateForgeProjectContext>;
|
|
67
|
+
export type DTOUpdateForgeProjectContext = z.infer<typeof DTOUpdateForgeProjectContext>;
|
|
68
|
+
export type DTOForgeProjectContextGetResponse = z.infer<typeof DTOForgeProjectContextGetResponse>;
|
|
69
|
+
export type DTOForgeProjectContextListResponse = z.infer<typeof DTOForgeProjectContextListResponse>;
|
|
70
|
+
export type DTOForgeProjectContextCreateResponse = z.infer<typeof DTOForgeProjectContextCreateResponse>;
|
|
71
|
+
export type DTOForgeProjectContextUpdateResponse = z.infer<typeof DTOForgeProjectContextUpdateResponse>;
|
|
72
|
+
export type DTOForgeProjectContextRemoveResponse = z.infer<typeof DTOForgeProjectContextRemoveResponse>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { FeaturePublishedState, Id, ProjectFeature, ProjectFeatureStatus } from "@supernova-studio/model";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { DTOThreadMessageCreateInput } from "../threads";
|
|
4
|
+
import { DTOForgeSectionItemMoveInput } from "./project-section";
|
|
5
|
+
|
|
6
|
+
export const DTOFeaturePublishedStateUpdateInput = FeaturePublishedState.pick({
|
|
7
|
+
iterationId: true,
|
|
8
|
+
hideSupernovaUI: true,
|
|
9
|
+
visibility: true,
|
|
10
|
+
});
|
|
11
|
+
export const DTOForgeProjectFeature = ProjectFeature;
|
|
12
|
+
|
|
13
|
+
export const DTOForgeProjectPublishedFeature = z.object({
|
|
14
|
+
featureName: z.string(),
|
|
15
|
+
iterationName: z.string(),
|
|
16
|
+
hideSupernovaUI: z.boolean(),
|
|
17
|
+
thumbnailUrl: z.string().optional(),
|
|
18
|
+
staticPreviewUrl: z.string().optional(),
|
|
19
|
+
|
|
20
|
+
// These are only included when authenticated user has access to the project (for both public & private published features)
|
|
21
|
+
projectId: z.string().optional(),
|
|
22
|
+
projectName: z.string().optional(),
|
|
23
|
+
workspaceId: z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const DTOForgeProjectPublishedFeatureGetResponse = z.object({
|
|
27
|
+
publishedFeature: DTOForgeProjectPublishedFeature,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const DTOForgeProjectFeatureListResponse = z.object({
|
|
31
|
+
features: DTOForgeProjectFeature.array(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const DTOForgeProjectFeatureGetResponse = z.object({
|
|
35
|
+
feature: DTOForgeProjectFeature,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const DTOForgeProjectFeatureCreateInput = z.object({
|
|
39
|
+
id: Id,
|
|
40
|
+
name: z.string().optional(),
|
|
41
|
+
description: z.string(),
|
|
42
|
+
sectionId: Id.optional(),
|
|
43
|
+
afterFeatureId: Id.nullable().optional(),
|
|
44
|
+
initialMessage: DTOThreadMessageCreateInput,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const DTOForgeProjectFeatureUpdateInput = z.object({
|
|
48
|
+
id: Id,
|
|
49
|
+
name: z.string().optional(),
|
|
50
|
+
description: z.string().optional(),
|
|
51
|
+
isArchived: z.boolean().optional(),
|
|
52
|
+
status: ProjectFeatureStatus.optional(),
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Sending null will result in feature unpublish
|
|
56
|
+
*/
|
|
57
|
+
publishedState: DTOFeaturePublishedStateUpdateInput.nullish(),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const DTOForgeProjectFeatureDeleteInput = z.object({
|
|
61
|
+
id: Id,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const DTOForgeProjectFeatureGetByIdParam = z.object({
|
|
65
|
+
id: Id,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const DTOFeatureArtifactListQuery = z.object({
|
|
69
|
+
messageId: z.string().optional(),
|
|
70
|
+
iterationId: z.string().optional(),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const DTOForgeProjectFeatureMoveInput = DTOForgeSectionItemMoveInput;
|
|
74
|
+
|
|
75
|
+
export type DTOForgeProjectFeature = z.infer<typeof DTOForgeProjectFeature>;
|
|
76
|
+
export type DTOForgeProjectFeatureListResponse = z.infer<typeof DTOForgeProjectFeatureListResponse>;
|
|
77
|
+
export type DTOForgeProjectFeatureCreateInput = z.infer<typeof DTOForgeProjectFeatureCreateInput>;
|
|
78
|
+
export type DTOForgeProjectFeatureUpdateInput = z.infer<typeof DTOForgeProjectFeatureUpdateInput>;
|
|
79
|
+
export type DTOForgeProjectFeatureDeleteInput = z.infer<typeof DTOForgeProjectFeatureDeleteInput>;
|
|
80
|
+
export type DTOForgeProjectFeatureGetByIdParam = z.infer<typeof DTOForgeProjectFeatureGetByIdParam>;
|
|
81
|
+
export type DTOForgeProjectFeatureMoveInput = z.infer<typeof DTOForgeProjectFeatureMoveInput>;
|
|
82
|
+
export type DTOForgeProjectFeatureGetResponse = z.infer<typeof DTOForgeProjectFeatureGetResponse>;
|
|
83
|
+
export type DTOForgeProjectPublishedFeature = z.infer<typeof DTOForgeProjectPublishedFeature>;
|
|
84
|
+
export type DTOForgeProjectPublishedFeatureGetResponse = z.infer<typeof DTOForgeProjectPublishedFeatureGetResponse>;
|
|
85
|
+
export type DTOFeaturePublishedStateUpdateInput = z.infer<typeof DTOFeaturePublishedStateUpdateInput>;
|
|
86
|
+
export type DTOFeatureArtifactListQuery = z.infer<typeof DTOFeatureArtifactListQuery>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ForgeProjectFigmaNode, ForgeProjectFigmaNodeRenderInput } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTOForgeProjectFigmaNode = ForgeProjectFigmaNode;
|
|
5
|
+
|
|
6
|
+
export const DTOForgeProjectFigmaNodeRenderInput = ForgeProjectFigmaNodeRenderInput;
|
|
7
|
+
|
|
8
|
+
export type DTOForgeProjectFigmaNode = z.infer<typeof DTOForgeProjectFigmaNode>;
|
|
9
|
+
export type DTOForgeProjectFigmaNodeRenderInput = z.infer<typeof DTOForgeProjectFigmaNodeRenderInput>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOForgeProjectFile = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
checksum: z.string(),
|
|
7
|
+
pendingUpload: z.boolean().optional(),
|
|
8
|
+
url: z.string(),
|
|
9
|
+
size: z.number(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const DTOForgeProjectFileListResponse = z.object({
|
|
13
|
+
files: z.array(DTOForgeProjectFile),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const DTOForgeProjectFileUploadPayloadItem = z.object({
|
|
17
|
+
size: z.number(),
|
|
18
|
+
name: z.string(),
|
|
19
|
+
checksum: z.string(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const DTOForgeProjectFileUploadPayload = z.object({
|
|
23
|
+
files: z.array(DTOForgeProjectFileUploadPayloadItem),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const DTOForgeProjectFileUploadResponse = z.object({
|
|
27
|
+
files: z.array(DTOForgeProjectFile),
|
|
28
|
+
uploadUrls: z.array(
|
|
29
|
+
z.object({
|
|
30
|
+
fileId: z.string(),
|
|
31
|
+
uploadUrl: z.string(),
|
|
32
|
+
})
|
|
33
|
+
),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const DTOForgeProjectFileUploadFinalizePayload = z.object({
|
|
37
|
+
fileIds: z.array(z.string()),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const DTOForgeProjectFileUploadFinalizeResponse = z.object({ ok: z.literal(true) });
|
|
41
|
+
|
|
42
|
+
export type DTOForgeProjectFile = z.infer<typeof DTOForgeProjectFile>;
|
|
43
|
+
export type DTOForgeProjectFileListResponse = z.infer<typeof DTOForgeProjectFileListResponse>;
|
|
44
|
+
export type DTOForgeProjectFileUploadPayloadItem = z.infer<typeof DTOForgeProjectFileUploadPayloadItem>;
|
|
45
|
+
export type DTOForgeProjectFileUploadPayload = z.infer<typeof DTOForgeProjectFileUploadPayload>;
|
|
46
|
+
export type DTOForgeProjectFileUploadResponse = z.infer<typeof DTOForgeProjectFileUploadResponse>;
|
|
47
|
+
export type DTOForgeProjectFileUploadFinalizePayload = z.infer<typeof DTOForgeProjectFileUploadFinalizePayload>;
|
|
48
|
+
export type DTOForgeProjectFileUploadFinalizeResponse = z.infer<typeof DTOForgeProjectFileUploadFinalizeResponse>;
|