@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,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ForgeArtifact,
|
|
3
|
+
ForgeBuildArtifact,
|
|
4
|
+
ForgeFigmaArtifact,
|
|
5
|
+
ForgeFileArtifact,
|
|
6
|
+
ForgeSpecArtifact,
|
|
7
|
+
} from "@supernova-studio/model";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
export const DTOCreateForgeBuildArtifact = ForgeBuildArtifact.omit({
|
|
11
|
+
id: true,
|
|
12
|
+
createdAt: true,
|
|
13
|
+
projectIterationId: true,
|
|
14
|
+
});
|
|
15
|
+
export const DTOCreateForgeFileArtifact = ForgeFileArtifact.omit({
|
|
16
|
+
id: true,
|
|
17
|
+
createdAt: true,
|
|
18
|
+
projectIterationId: true,
|
|
19
|
+
});
|
|
20
|
+
export const DTOCreateForgeFigmaArtifact = ForgeFigmaArtifact.omit({
|
|
21
|
+
id: true,
|
|
22
|
+
createdAt: true,
|
|
23
|
+
projectIterationId: true,
|
|
24
|
+
});
|
|
25
|
+
export const DTOCreateForgeSpecArtifact = ForgeSpecArtifact.omit({
|
|
26
|
+
id: true,
|
|
27
|
+
createdAt: true,
|
|
28
|
+
projectIterationId: true,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const DTOUpdateForgeBuildArtifact = DTOCreateForgeBuildArtifact.extend({ id: z.string() });
|
|
32
|
+
export const DTOUpdateForgeFileArtifact = DTOCreateForgeFileArtifact.extend({ id: z.string() });
|
|
33
|
+
export const DTOUpdateForgeFigmaArtifact = DTOCreateForgeFigmaArtifact.extend({ id: z.string() });
|
|
34
|
+
export const DTOUpdateForgeSpecArtifact = DTOCreateForgeSpecArtifact.extend({ id: z.string() });
|
|
35
|
+
|
|
36
|
+
export const DTOForgeArtifact = ForgeArtifact;
|
|
37
|
+
export const DTOForgeBuildArtifact = ForgeBuildArtifact;
|
|
38
|
+
export const DTOForgeFileArtifact = ForgeFileArtifact;
|
|
39
|
+
export const DTOForgeFigmaArtifact = ForgeFigmaArtifact;
|
|
40
|
+
export const DTOForgeSpecArtifact = ForgeSpecArtifact;
|
|
41
|
+
|
|
42
|
+
export const DTOCreateForgeArtifact = z.union([
|
|
43
|
+
DTOCreateForgeBuildArtifact,
|
|
44
|
+
DTOCreateForgeFileArtifact,
|
|
45
|
+
DTOCreateForgeFigmaArtifact,
|
|
46
|
+
DTOCreateForgeSpecArtifact,
|
|
47
|
+
]);
|
|
48
|
+
export const DTOUpdateForgeArtifact = z.union([
|
|
49
|
+
DTOUpdateForgeFileArtifact,
|
|
50
|
+
DTOUpdateForgeBuildArtifact,
|
|
51
|
+
DTOUpdateForgeSpecArtifact,
|
|
52
|
+
DTOUpdateForgeFigmaArtifact,
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
export const DTOCreateForgeArtifactResponse = z.object({
|
|
56
|
+
artifact: DTOForgeArtifact,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const DTOUpdateForgeArtifactResponse = z.object({
|
|
60
|
+
artifact: DTOForgeArtifact.nullable(),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const DTODeleteForgeArtifactResponse = z.object({
|
|
64
|
+
ok: z.literal(true),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const DTOForgeArtifactsListResponse = z.object({
|
|
68
|
+
artifacts: z.array(DTOForgeArtifact),
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export const DTOForgeArtifactGetResponse = z.object({
|
|
72
|
+
artifact: DTOForgeArtifact.nullable(),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export type DTOForgeArtifactsListResponse = z.infer<typeof DTOForgeArtifactsListResponse>;
|
|
76
|
+
export type DTOForgeArtifactGetResponse = z.infer<typeof DTOForgeArtifactGetResponse>;
|
|
77
|
+
export type DTOForgeArtifact = z.infer<typeof DTOForgeArtifact>;
|
|
78
|
+
export type DTOForgeBuildArtifact = z.infer<typeof DTOForgeBuildArtifact>;
|
|
79
|
+
export type DTOForgeFileArtifact = z.infer<typeof DTOForgeFileArtifact>;
|
|
80
|
+
export type DTOForgeFigmaArtifact = z.infer<typeof DTOForgeFigmaArtifact>;
|
|
81
|
+
export type DTOForgeSpecArtifact = z.infer<typeof DTOForgeSpecArtifact>;
|
|
82
|
+
export type DTOCreateForgeArtifact = z.infer<typeof DTOCreateForgeArtifact>;
|
|
83
|
+
export type DTOUpdateForgeArtifact = z.infer<typeof DTOUpdateForgeArtifact>;
|
|
84
|
+
export type DTOCreateForgeArtifactResponse = z.infer<typeof DTOCreateForgeArtifactResponse>;
|
|
85
|
+
export type DTOUpdateForgeArtifactResponse = z.infer<typeof DTOUpdateForgeArtifactResponse>;
|
|
86
|
+
export type DTODeleteForgeArtifactResponse = z.infer<typeof DTODeleteForgeArtifactResponse>;
|
|
87
|
+
export type DTOCreateForgeBuildArtifact = z.infer<typeof DTOCreateForgeBuildArtifact>;
|
|
88
|
+
export type DTOCreateForgeFileArtifact = z.infer<typeof DTOCreateForgeFileArtifact>;
|
|
89
|
+
export type DTOCreateForgeFigmaArtifact = z.infer<typeof DTOCreateForgeFigmaArtifact>;
|
|
90
|
+
export type DTOCreateForgeSpecArtifact = z.infer<typeof DTOCreateForgeSpecArtifact>;
|
|
91
|
+
export type DTOUpdateForgeBuildArtifact = z.infer<typeof DTOUpdateForgeBuildArtifact>;
|
|
92
|
+
export type DTOUpdateForgeFileArtifact = z.infer<typeof DTOUpdateForgeFileArtifact>;
|
|
93
|
+
export type DTOUpdateForgeSpecArtifact = z.infer<typeof DTOUpdateForgeSpecArtifact>;
|
|
94
|
+
export type DTOUpdateForgeFigmaArtifact = z.infer<typeof DTOUpdateForgeFigmaArtifact>;
|
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
import { Id } from "@supernova-studio/model";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { DTOFileReference } from "../files";
|
|
4
|
+
|
|
5
|
+
//
|
|
6
|
+
// Data model
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
export const DTOFeatureMessageUserSender = z.object({
|
|
10
|
+
type: z.literal("User"),
|
|
11
|
+
userId: z.string(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const DTOFeatureMessageAgentSender = z.object({
|
|
15
|
+
type: z.literal("Agent"),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const DTOFeatureMessageSystemSender = z.object({
|
|
19
|
+
type: z.literal("System"),
|
|
20
|
+
onBehalfOfUserId: z.string(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const DTOFeatureMessageSender = z.discriminatedUnion("type", [
|
|
24
|
+
DTOFeatureMessageUserSender,
|
|
25
|
+
DTOFeatureMessageAgentSender,
|
|
26
|
+
DTOFeatureMessageSystemSender,
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
export const DTOFeatureMessageReaction = z.object({
|
|
30
|
+
messageId: Id,
|
|
31
|
+
userId: z.string(),
|
|
32
|
+
emoji: z.string(),
|
|
33
|
+
createdAt: z.string(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const DTOFeatureMessageAttachments = z.object({
|
|
37
|
+
iterationId: Id.optional(),
|
|
38
|
+
|
|
39
|
+
// TODO Artem: files, etc
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const DTOFeatureMessage = z.object({
|
|
43
|
+
id: Id,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Describes where the message came from
|
|
47
|
+
*/
|
|
48
|
+
sender: DTOFeatureMessageSender,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Content of the message
|
|
52
|
+
*/
|
|
53
|
+
body: z.string(),
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Indicates if the message was sent in the agentic mode, if so this message will cause an
|
|
57
|
+
* AI agent to generate a response and perform an action within the feature
|
|
58
|
+
*/
|
|
59
|
+
isPrompt: z.boolean().optional(),
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Indicates if the sender requested agent to reply in a thread
|
|
63
|
+
*/
|
|
64
|
+
startsNewThread: z.boolean().optional(),
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* If defined, this message is considered to be a reply in a thread under parent message id
|
|
68
|
+
*/
|
|
69
|
+
parentMessageId: Id.optional(),
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Link agent response object describing current state of
|
|
73
|
+
*/
|
|
74
|
+
agentResponseTrackerId: Id.optional().nullable(),
|
|
75
|
+
|
|
76
|
+
attachments: DTOFeatureMessageAttachments.optional(),
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* If defined, this message is considered to be a reply to different message
|
|
80
|
+
*/
|
|
81
|
+
replyToMessageId: Id.optional(),
|
|
82
|
+
|
|
83
|
+
createdAt: z.string(),
|
|
84
|
+
updatedAt: z.string().optional(),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export const DTOFeatureAgentResponseTracker = z.object({
|
|
88
|
+
id: Id,
|
|
89
|
+
currentBody: z.string().default(""),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const DTOFeatureArtifact = z.object({
|
|
93
|
+
id: Id,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Key of the artifact, can include path like `src/components/button.tsx`
|
|
97
|
+
*/
|
|
98
|
+
key: z.string(),
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Id of the project file that holds content of this artifact
|
|
102
|
+
*/
|
|
103
|
+
fileId: z.string().optional(),
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Id of the Iteration that this artifact belongs to
|
|
107
|
+
*/
|
|
108
|
+
iterationId: Id.optional(),
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* URL of the feature artifact's contents
|
|
112
|
+
*/
|
|
113
|
+
url: z.string(),
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Relative file path of the artifact (without domain/base URL)
|
|
117
|
+
*/
|
|
118
|
+
filePath: z.string().optional(),
|
|
119
|
+
|
|
120
|
+
createdAt: z.string(),
|
|
121
|
+
updatedAt: z.string(),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const DTOFeatureIterationArtifactsDiff = z.object({
|
|
125
|
+
created: z.array(DTOFeatureArtifact.shape.key).optional().default([]),
|
|
126
|
+
updated: z.array(DTOFeatureArtifact.shape.key).optional().default([]),
|
|
127
|
+
deleted: z.array(DTOFeatureArtifact.shape.key).optional().default([]),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export const DTOFeatureIterationState = z.enum(["InProgress", "Success", "Error", "Timeout"]);
|
|
131
|
+
export const DTOFeatureIterationErrorType = z.enum(["PackageInstall", "Build", "Compile", "Unknown", "Runtime"]);
|
|
132
|
+
|
|
133
|
+
export const DTOFeatureIterationError = z.object({
|
|
134
|
+
description: z.string(),
|
|
135
|
+
type: DTOFeatureIterationErrorType,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
export const DTOFeatureIteration = z.object({
|
|
139
|
+
id: Id,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Name of the iteration
|
|
143
|
+
*/
|
|
144
|
+
name: z.string(),
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* ID of the iteration that this iteration is based on
|
|
148
|
+
*/
|
|
149
|
+
baseIterationId: z.string().optional(),
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Message ID that triggered creation of the iteration
|
|
153
|
+
*/
|
|
154
|
+
startedFromMessageId: z.string(),
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Indicates whether the iteration is currently being generated by an agent
|
|
158
|
+
* @deprecated use `state`
|
|
159
|
+
*/
|
|
160
|
+
isInProgress: z.boolean().optional(),
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Indicates current processing (creation) state of this iteration.
|
|
164
|
+
* This property is optional only for backward compatibility with data stored in Liveblocks rooms.
|
|
165
|
+
* It can be treated as non-optional (undefined doesn't have any meaning here).
|
|
166
|
+
*
|
|
167
|
+
* - InProgress: iteration is being created by an AI agent
|
|
168
|
+
* - Success: iteration has been successfully finished and is ready to be consumed
|
|
169
|
+
* - Error: an error has occured during iteration processing, the iteration cannot be consumed
|
|
170
|
+
* - Timeout: the iteration hasn't been finished in a reasonable time, the iteration cannot be consumed
|
|
171
|
+
*/
|
|
172
|
+
state: DTOFeatureIterationState.optional(),
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Description of a sandbox error if there were any (such as during `npm i` or `npm run dev`).
|
|
176
|
+
* To be used for "fix with AI"
|
|
177
|
+
*
|
|
178
|
+
* @deprecated use `error.description` instead
|
|
179
|
+
*/
|
|
180
|
+
errorDescription: z.string().nullish(),
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Description of a sandbox error if there were any (such as during `npm i` or `npm run build`).
|
|
184
|
+
* To be used for "fix with AI"
|
|
185
|
+
*/
|
|
186
|
+
error: DTOFeatureIterationError.optional(),
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The cost in credits to generate this iteration
|
|
190
|
+
*/
|
|
191
|
+
creditsCost: z.number().optional(),
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* URL of a static preview of the feature
|
|
195
|
+
*/
|
|
196
|
+
staticPreviewUrl: z.string().optional(),
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Indicates whether the iteration is bookmarked by user
|
|
200
|
+
*/
|
|
201
|
+
isBookmarked: z.boolean().optional(),
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @deprecated use thumbnail.fileUrl
|
|
205
|
+
* URL of a static thumbnail of the feature iteration
|
|
206
|
+
*/
|
|
207
|
+
thumbnailUrl: z.string().optional(),
|
|
208
|
+
|
|
209
|
+
thumbnail: DTOFileReference.optional(),
|
|
210
|
+
|
|
211
|
+
createdAt: z.string(),
|
|
212
|
+
updatedAt: z.string().optional(),
|
|
213
|
+
|
|
214
|
+
artifactsDiff: DTOFeatureIterationArtifactsDiff.optional().nullable(),
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
export const DTOFeatureIterationTag = z.object({
|
|
218
|
+
id: Id,
|
|
219
|
+
featureId: Id,
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* If defined, this latest tag is specific to a message thread.
|
|
223
|
+
* If null, this is the latest tag for the entire feature.
|
|
224
|
+
*/
|
|
225
|
+
messageId: Id.optional(),
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The iteration that is marked as latest for this context
|
|
229
|
+
*/
|
|
230
|
+
iterationId: Id,
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
export const DTOSandboxError = z.object({
|
|
234
|
+
/** At what stage the error has occured */
|
|
235
|
+
stage: z.enum(["PackageInstall", "HealthCheck", "Build", "Unknown"]),
|
|
236
|
+
|
|
237
|
+
/** We will use this in "fix with AI" */
|
|
238
|
+
errorDescription: z.string(),
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
export const DTOFeatureSandbox = z.object({
|
|
242
|
+
id: z.string(),
|
|
243
|
+
url: z.string(),
|
|
244
|
+
parentMessageId: Id.optional(),
|
|
245
|
+
currentIterationId: Id,
|
|
246
|
+
featureId: Id,
|
|
247
|
+
expiresAt: z.string(),
|
|
248
|
+
error: DTOSandboxError.optional(),
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
export const DTOCreateFeatureSandbox = DTOFeatureSandbox.extend({
|
|
252
|
+
isSystemSandbox: z.boolean().optional(),
|
|
253
|
+
});
|
|
254
|
+
export const DTOUpdateFeatureSandbox = DTOCreateFeatureSandbox.partial().extend({
|
|
255
|
+
id: z.string(),
|
|
256
|
+
parentMessageId: Id.nullish(),
|
|
257
|
+
expiresAt: z.string().optional(),
|
|
258
|
+
error: DTOSandboxError.nullish(),
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
export const DTOFeatureSandboxListResponse = z.object({
|
|
262
|
+
sandboxes: DTOFeatureSandbox.array(),
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
export type DTOFeatureIterationArtifactsDiff = z.infer<typeof DTOFeatureIterationArtifactsDiff>;
|
|
266
|
+
export type DTOFeatureMessageUserSender = z.infer<typeof DTOFeatureMessageUserSender>;
|
|
267
|
+
export type DTOFeatureMessageAgentSender = z.infer<typeof DTOFeatureMessageAgentSender>;
|
|
268
|
+
export type DTOFeatureMessageSystemSender = z.infer<typeof DTOFeatureMessageSystemSender>;
|
|
269
|
+
export type DTOFeatureMessageSender = z.infer<typeof DTOFeatureMessageSender>;
|
|
270
|
+
export type DTOFeatureAgentResponseTracker = z.infer<typeof DTOFeatureAgentResponseTracker>;
|
|
271
|
+
export type DTOFeatureMessageReaction = z.infer<typeof DTOFeatureMessageReaction>;
|
|
272
|
+
export type DTOFeatureMessage = z.infer<typeof DTOFeatureMessage>;
|
|
273
|
+
export type DTOFeatureArtifact = z.infer<typeof DTOFeatureArtifact>;
|
|
274
|
+
export type DTOFeatureIterationState = z.infer<typeof DTOFeatureIterationState>;
|
|
275
|
+
export type DTOFeatureIterationErrorType = z.infer<typeof DTOFeatureIterationErrorType>;
|
|
276
|
+
export type DTOFeatureIterationError = z.infer<typeof DTOFeatureIterationError>;
|
|
277
|
+
export type DTOFeatureIteration = z.infer<typeof DTOFeatureIteration>;
|
|
278
|
+
export type DTOFeatureIterationTag = z.infer<typeof DTOFeatureIterationTag>;
|
|
279
|
+
export type DTOSandboxError = z.infer<typeof DTOSandboxError>;
|
|
280
|
+
export type DTOFeatureSandbox = z.infer<typeof DTOFeatureSandbox>;
|
|
281
|
+
export type DTOCreateFeatureSandbox = z.infer<typeof DTOCreateFeatureSandbox>;
|
|
282
|
+
export type DTOUpdateFeatureSandbox = z.infer<typeof DTOUpdateFeatureSandbox>;
|
|
283
|
+
export type DTOFeatureSandboxListResponse = z.infer<typeof DTOFeatureSandboxListResponse>;
|
|
284
|
+
export type DTOFeatureMessageAttachments = z.infer<typeof DTOFeatureMessageAttachments>;
|
|
285
|
+
|
|
286
|
+
export const DTOProvisionFeatureSandboxInput = z.object({
|
|
287
|
+
parentMessageId: z.string().optional(),
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
export const DTOProvisionFeatureSandboxResponse = z.object({
|
|
291
|
+
ok: z.boolean(),
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
export const DTOKeepAliveFeatureSandboxResponse = z.object({
|
|
295
|
+
sandbox: DTOFeatureSandbox,
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
export type DTOProvisionFeatureSandboxInput = z.infer<typeof DTOProvisionFeatureSandboxInput>;
|
|
299
|
+
export type DTOProvisionFeatureSandboxResponse = z.infer<typeof DTOProvisionFeatureSandboxResponse>;
|
|
300
|
+
export type DTOKeepAliveFeatureSandboxResponse = z.infer<typeof DTOKeepAliveFeatureSandboxResponse>;
|
|
301
|
+
|
|
302
|
+
//
|
|
303
|
+
// Payloads
|
|
304
|
+
//
|
|
305
|
+
|
|
306
|
+
export const DTOFeatureMessageCreateInput = DTOFeatureMessage.pick({
|
|
307
|
+
id: true,
|
|
308
|
+
body: true,
|
|
309
|
+
isPrompt: true,
|
|
310
|
+
startsNewThread: true,
|
|
311
|
+
parentMessageId: true,
|
|
312
|
+
attachments: true,
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
export const DTOFeatureMessageUpdateInput = DTOFeatureMessageCreateInput.omit({ id: true })
|
|
316
|
+
.merge(DTOFeatureMessage.pick({ agentResponseTrackerId: true }))
|
|
317
|
+
.partial();
|
|
318
|
+
|
|
319
|
+
export const DTOFeatureMessageReactionCreateInput = z.object({
|
|
320
|
+
messageId: Id,
|
|
321
|
+
emoji: z.string(),
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export const DTOFeatureMessageReactionDeleteInput = z.object({
|
|
325
|
+
messageId: Id,
|
|
326
|
+
emoji: z.string(),
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
export const DTOFeatureArtifactCreateInput = z.object({
|
|
330
|
+
id: Id,
|
|
331
|
+
key: z.string(),
|
|
332
|
+
fileId: z.string(),
|
|
333
|
+
iterationId: Id.optional(),
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
export const DTOFeatureArtifactDeleteInput = z.object({
|
|
337
|
+
id: Id,
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
export const DTOFeatureIterationCreateInput = DTOFeatureIteration.pick({
|
|
341
|
+
id: true,
|
|
342
|
+
startedFromMessageId: true,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
export const DTOFeatureIterationPromoteInput = z.object({
|
|
346
|
+
id: Id,
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
export const DTOFeatureArtifactGetByIdParam = z.object({
|
|
350
|
+
id: Id,
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
export const DTOFeatureIterationSetLatestInput = z.object({
|
|
354
|
+
id: Id,
|
|
355
|
+
/**
|
|
356
|
+
* Optional message ID to determine the context for setting this iteration as latest.
|
|
357
|
+
* When provided, uses this message's parent as the tag context.
|
|
358
|
+
* When undefined, uses the iteration's original startedFromMessage.
|
|
359
|
+
* When null, explicitly excludes message context from the tag.
|
|
360
|
+
*/
|
|
361
|
+
contextMessageId: Id.nullish(),
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
export const DTOFeatureIterationUpdateInput = z.object({
|
|
365
|
+
id: Id,
|
|
366
|
+
isBookmarked: z.boolean().optional(),
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
export const DTOFeatureIterationTagCreateInput = z.object({
|
|
370
|
+
featureId: Id,
|
|
371
|
+
iterationId: Id,
|
|
372
|
+
messageId: Id.optional(),
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
export const DTOFeatureIterationArtifactDiff = z.object({
|
|
376
|
+
/**
|
|
377
|
+
* Map of artifact key -> new key that describes artifacts that will be moved in this iteration
|
|
378
|
+
*/
|
|
379
|
+
move: z.record(
|
|
380
|
+
z.object({
|
|
381
|
+
newKey: z.string(),
|
|
382
|
+
})
|
|
383
|
+
),
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Map of artifact key -> new key that describes artifacts that will be copied in this iteration
|
|
387
|
+
*/
|
|
388
|
+
copy: z
|
|
389
|
+
.record(
|
|
390
|
+
z.object({
|
|
391
|
+
newKey: z.string(),
|
|
392
|
+
})
|
|
393
|
+
)
|
|
394
|
+
.optional(),
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Map of artifact key -> artifact content that describes artifacts that will be
|
|
398
|
+
* create or updated in this iteration
|
|
399
|
+
*/
|
|
400
|
+
upsert: z.record(
|
|
401
|
+
z.object({
|
|
402
|
+
artifactContent: z.string(),
|
|
403
|
+
})
|
|
404
|
+
),
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* List artifact keys to remove from this iteration
|
|
408
|
+
*/
|
|
409
|
+
remove: z.array(z.string()),
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
export const DTOFeatureIterationUpdateArtifactsInput = z.object({
|
|
413
|
+
id: Id,
|
|
414
|
+
name: z.string().optional(),
|
|
415
|
+
artifactDiff: DTOFeatureIterationArtifactDiff,
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
export const DTOFeatureIterationValidateInput = z.object({
|
|
419
|
+
id: Id,
|
|
420
|
+
messageId: Id,
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
export const DTOFeatureIterationUpdateArtifactsByMessageInput = z.object({
|
|
424
|
+
messageId: Id,
|
|
425
|
+
name: z.string().optional(),
|
|
426
|
+
artifactDiff: DTOFeatureIterationArtifactDiff,
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
export const DTOFeatureAgentWorkFinalizeInput = z.object({
|
|
430
|
+
messageId: Id,
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
export const DTOFeatureUpdateThemeInput = z.object({
|
|
434
|
+
parentMessageId: z.string().optional(),
|
|
435
|
+
themeCss: z.string(),
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
export type DTOFeatureMessageCreateInput = z.infer<typeof DTOFeatureMessageCreateInput>;
|
|
439
|
+
export type DTOFeatureMessageUpdateInput = z.infer<typeof DTOFeatureMessageUpdateInput>;
|
|
440
|
+
export type DTOFeatureMessageReactionDeleteInput = z.infer<typeof DTOFeatureMessageReactionDeleteInput>;
|
|
441
|
+
export type DTOFeatureMessageReactionCreateInput = z.infer<typeof DTOFeatureMessageReactionCreateInput>;
|
|
442
|
+
export type DTOFeatureArtifactCreateInput = z.infer<typeof DTOFeatureArtifactCreateInput>;
|
|
443
|
+
export type DTOFeatureArtifactDeleteInput = z.infer<typeof DTOFeatureArtifactDeleteInput>;
|
|
444
|
+
export type DTOFeatureIterationCreateInput = z.infer<typeof DTOFeatureIterationCreateInput>;
|
|
445
|
+
export type DTOFeatureIterationPromoteInput = z.infer<typeof DTOFeatureIterationPromoteInput>;
|
|
446
|
+
export type DTOFeatureIterationSetLatestInput = z.infer<typeof DTOFeatureIterationSetLatestInput>;
|
|
447
|
+
export type DTOFeatureIterationUpdateInput = z.infer<typeof DTOFeatureIterationUpdateInput>;
|
|
448
|
+
export type DTOFeatureIterationTagCreateInput = z.infer<typeof DTOFeatureIterationTagCreateInput>;
|
|
449
|
+
export type DTOFeatureIterationArtifactDiff = z.infer<typeof DTOFeatureIterationArtifactDiff>;
|
|
450
|
+
export type DTOFeatureIterationUpdateArtifactsInput = z.infer<typeof DTOFeatureIterationUpdateArtifactsInput>;
|
|
451
|
+
export type DTOFeatureIterationValidateInput = z.infer<typeof DTOFeatureIterationValidateInput>;
|
|
452
|
+
export type DTOFeatureIterationUpdateArtifactsByMessageInput = z.infer<
|
|
453
|
+
typeof DTOFeatureIterationUpdateArtifactsByMessageInput
|
|
454
|
+
>;
|
|
455
|
+
export type DTOFeatureAgentWorkFinalizeInput = z.infer<typeof DTOFeatureAgentWorkFinalizeInput>;
|
|
456
|
+
export type DTOFeatureUpdateThemeInput = z.infer<typeof DTOFeatureUpdateThemeInput>;
|
|
457
|
+
export type DTOFeatureArtifactGetByIdParam = z.infer<typeof DTOFeatureArtifactGetByIdParam>;
|
|
458
|
+
|
|
459
|
+
//
|
|
460
|
+
// Responses
|
|
461
|
+
//
|
|
462
|
+
|
|
463
|
+
export const DTOFeatureMessageResponse = z.object({
|
|
464
|
+
message: DTOFeatureMessage,
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
export const DTOFeatureMessageReactionResponse = z.object({
|
|
468
|
+
reaction: DTOFeatureMessageReaction,
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
export const DTOFeatureMessageListResponse = z.object({
|
|
472
|
+
messages: DTOFeatureMessage.array(),
|
|
473
|
+
reactions: DTOFeatureMessageReaction.array(),
|
|
474
|
+
lastSeenMessageId: z.string().optional(),
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
export const DTOFeatureArtifactResponse = z.object({
|
|
478
|
+
artifact: DTOFeatureArtifact,
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
export const DTOFeatureArtifactListResponse = z.object({
|
|
482
|
+
artifacts: DTOFeatureArtifact.array(),
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
export const DTOFeatureArtifactWithContentResponse = z.object({
|
|
486
|
+
artifact: DTOFeatureArtifact,
|
|
487
|
+
content: z.string(),
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
export const DTOFeatureIterationResponse = z.object({
|
|
491
|
+
iteration: DTOFeatureIteration,
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
export const DTOFeatureIterationListResponse = z.object({
|
|
495
|
+
iterations: DTOFeatureIteration.array(),
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
export const DTOFeatureIterationValidateResponse = z.discriminatedUnion("success", [
|
|
499
|
+
z.object({ success: z.literal(true) }),
|
|
500
|
+
z.object({ success: z.literal(false), error: DTOFeatureIterationError }),
|
|
501
|
+
]);
|
|
502
|
+
|
|
503
|
+
export const DTOFeatureIterationTagResponse = z.object({
|
|
504
|
+
tag: DTOFeatureIterationTag,
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
export const DTOFeatureIterationTagListResponse = z.object({
|
|
508
|
+
tags: DTOFeatureIterationTag.array(),
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
export type DTOFeatureMessageResponse = z.infer<typeof DTOFeatureMessageResponse>;
|
|
512
|
+
export type DTOFeatureMessageReactionResponse = z.infer<typeof DTOFeatureMessageReactionResponse>;
|
|
513
|
+
export type DTOFeatureMessageListResponse = z.infer<typeof DTOFeatureMessageListResponse>;
|
|
514
|
+
export type DTOFeatureArtifactResponse = z.infer<typeof DTOFeatureArtifactResponse>;
|
|
515
|
+
export type DTOFeatureArtifactWithContentResponse = z.infer<typeof DTOFeatureArtifactWithContentResponse>;
|
|
516
|
+
export type DTOFeatureArtifactListResponse = z.infer<typeof DTOFeatureArtifactListResponse>;
|
|
517
|
+
export type DTOFeatureIterationListResponse = z.infer<typeof DTOFeatureIterationListResponse>;
|
|
518
|
+
export type DTOFeatureIterationValidateResponse = z.infer<typeof DTOFeatureIterationValidateResponse>;
|
|
519
|
+
export type DTOFeatureIterationResponse = z.infer<typeof DTOFeatureIterationResponse>;
|
|
520
|
+
export type DTOFeatureIterationTagResponse = z.infer<typeof DTOFeatureIterationTagResponse>;
|
|
521
|
+
export type DTOFeatureIterationTagListResponse = z.infer<typeof DTOFeatureIterationTagListResponse>;
|
|
522
|
+
|
|
523
|
+
//
|
|
524
|
+
// Events
|
|
525
|
+
//
|
|
526
|
+
|
|
527
|
+
export const DTOFeatureEventMessagesSent = z.object({
|
|
528
|
+
type: z.literal("MessagesSent"),
|
|
529
|
+
data: DTOFeatureMessage.array(),
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
export const DTOFeatureEventReactionsSent = z.object({
|
|
533
|
+
type: z.literal("ReactionsSent"),
|
|
534
|
+
data: DTOFeatureMessageReaction.array(),
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
export const DTOFeatureEventReactionsDeleted = z.object({
|
|
538
|
+
type: z.literal("ReactionsDeleted"),
|
|
539
|
+
data: DTOFeatureMessageReaction,
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
export const DTOFeatureEvent = z.discriminatedUnion("type", [
|
|
543
|
+
DTOFeatureEventMessagesSent,
|
|
544
|
+
DTOFeatureEventReactionsSent,
|
|
545
|
+
DTOFeatureEventReactionsDeleted,
|
|
546
|
+
]);
|
|
547
|
+
|
|
548
|
+
export type DTOFeatureEventMessagesSent = z.infer<typeof DTOFeatureEventMessagesSent>;
|
|
549
|
+
export type DTOFeatureEventReactionsSent = z.infer<typeof DTOFeatureEventReactionsSent>;
|
|
550
|
+
export type DTOFeatureEventReactionsDeleted = z.infer<typeof DTOFeatureEventReactionsDeleted>;
|
|
551
|
+
export type DTOFeatureEvent = z.infer<typeof DTOFeatureEvent>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOForgeFeatureRoom = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export const DTOForgeFeatureRoomResponse = z.object({
|
|
8
|
+
room: DTOForgeFeatureRoom,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type DTOForgeFeatureRoom = z.infer<typeof DTOForgeFeatureRoom>;
|
|
12
|
+
export type DTOForgeFeatureRoomResponse = z.infer<typeof DTOForgeFeatureRoomResponse>;
|