@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,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PortalSettingsSidebar,
|
|
3
|
+
PortalSettingsSidebarLink,
|
|
4
|
+
PortalSettingsSidebarSection,
|
|
5
|
+
PortalSettingsTheme,
|
|
6
|
+
} from "@supernova-studio/model";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
export const DTOPortalSettingsTheme = PortalSettingsTheme;
|
|
10
|
+
export const DTOPortalSettingsSidebarLink = PortalSettingsSidebarLink;
|
|
11
|
+
export const DTOPortalSettingsSidebarSection = PortalSettingsSidebarSection;
|
|
12
|
+
export const DTOPortalSettingsSidebar = PortalSettingsSidebar;
|
|
13
|
+
|
|
14
|
+
export const DTOPortalSettings = z.object({
|
|
15
|
+
id: z.string(),
|
|
16
|
+
workspaceId: z.string(),
|
|
17
|
+
|
|
18
|
+
enabledDesignSystemIds: z.array(z.string()),
|
|
19
|
+
enabledBrandPersistentIds: z.array(z.string()),
|
|
20
|
+
|
|
21
|
+
theme: DTOPortalSettingsTheme.nullish(),
|
|
22
|
+
sidebar: DTOPortalSettingsSidebar.nullish(),
|
|
23
|
+
|
|
24
|
+
createdAt: z.coerce.date(),
|
|
25
|
+
updatedAt: z.coerce.date(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const DTOPortalSettingsGetResponse = z.object({
|
|
29
|
+
portalSettings: DTOPortalSettings,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const DTOPortalSettingsUpdatePayload = z.object({
|
|
33
|
+
enabledDesignSystemIds: z.array(z.string()).optional(),
|
|
34
|
+
enabledBrandPersistentIds: z.array(z.string()).optional(),
|
|
35
|
+
theme: DTOPortalSettingsTheme.nullish(),
|
|
36
|
+
sidebar: DTOPortalSettingsSidebar.nullish(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export type DTOPortalSettingsTheme = z.infer<typeof DTOPortalSettingsTheme>;
|
|
40
|
+
export type DTOPortalSettingsSidebarLink = z.infer<typeof DTOPortalSettingsSidebarLink>;
|
|
41
|
+
export type DTOPortalSettingsSidebarSection = z.infer<typeof DTOPortalSettingsSidebarSection>;
|
|
42
|
+
export type DTOPortalSettingsSidebar = z.infer<typeof DTOPortalSettingsSidebar>;
|
|
43
|
+
export type DTOPortalSettings = z.infer<typeof DTOPortalSettings>;
|
|
44
|
+
export type DTOPortalSettingsGetResponse = z.infer<typeof DTOPortalSettingsGetResponse>;
|
|
45
|
+
export type DTOPortalSettingsUpdatePayload = z.infer<typeof DTOPortalSettingsUpdatePayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./template";
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// Entity
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
export const DTOSandboxTemplatePreset = z.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
description: z.string(),
|
|
11
|
+
thumbnailUrl: z.string().optional(),
|
|
12
|
+
files: z.string().array(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const DTOSandboxTemplateVersion = z.object({
|
|
16
|
+
name: z.string(),
|
|
17
|
+
createdAt: z.string(),
|
|
18
|
+
createdByUserId: z.string(),
|
|
19
|
+
e2bTemplateId: z.string(),
|
|
20
|
+
templates: DTOSandboxTemplatePreset.array().optional(),
|
|
21
|
+
hasDesignModePlugin: z.boolean().optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const DTOSandboxTemplate = z.object({
|
|
25
|
+
id: z.string(),
|
|
26
|
+
name: z.string(),
|
|
27
|
+
workspaceId: z.string(),
|
|
28
|
+
designSystemId: z.string(),
|
|
29
|
+
createdAt: z.string(),
|
|
30
|
+
versions: DTOSandboxTemplateVersion.array(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const DTOSandboxTemplateBuild = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
workspaceId: z.string(),
|
|
36
|
+
designSystemId: z.string(),
|
|
37
|
+
name: z.string(),
|
|
38
|
+
version: z.string(),
|
|
39
|
+
createdAt: z.string(),
|
|
40
|
+
finishedAt: z.string().optional(),
|
|
41
|
+
createdByUserId: z.string(),
|
|
42
|
+
/** @deprecated use `dockerImageUri` instead */
|
|
43
|
+
dockerImagePath: z.string().optional(),
|
|
44
|
+
dockerImageUri: z.string(),
|
|
45
|
+
error: z.string().optional(),
|
|
46
|
+
state: z.enum(["PendingUpload", "Building", "Success", "Failure", "Timeout"]),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const DTOSandboxTemplateFile = z.object({
|
|
50
|
+
key: z.string(),
|
|
51
|
+
fileId: z.string(),
|
|
52
|
+
filePath: z.string(),
|
|
53
|
+
url: z.string(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export const DTOSandboxTemplateVersionDetail = z.object({
|
|
57
|
+
version: DTOSandboxTemplateVersion,
|
|
58
|
+
files: DTOSandboxTemplateFile.array(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export type DTOSandboxTemplate = z.infer<typeof DTOSandboxTemplate>;
|
|
62
|
+
export type DTOSandboxTemplatePreset = z.infer<typeof DTOSandboxTemplatePreset>;
|
|
63
|
+
export type DTOSandboxTemplateVersion = z.infer<typeof DTOSandboxTemplateVersion>;
|
|
64
|
+
export type DTOSandboxTemplateBuild = z.infer<typeof DTOSandboxTemplateBuild>;
|
|
65
|
+
export type DTOSandboxTemplateFile = z.infer<typeof DTOSandboxTemplateFile>;
|
|
66
|
+
export type DTOSandboxTemplateVersionDetail = z.infer<typeof DTOSandboxTemplateVersionDetail>;
|
|
67
|
+
|
|
68
|
+
//
|
|
69
|
+
// Read
|
|
70
|
+
//
|
|
71
|
+
|
|
72
|
+
export const DTOSandboxTemplateQuery = z.object({
|
|
73
|
+
workspaceId: z.string(),
|
|
74
|
+
designSystemId: z.string().optional(),
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const DTOSandboxTemplateListResponse = z.object({
|
|
78
|
+
templates: DTOSandboxTemplate.array(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export const DTOSandboxTemplateResponse = z.object({
|
|
82
|
+
template: DTOSandboxTemplate,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const DTOSandboxTemplateBuildResponse = z.object({
|
|
86
|
+
build: DTOSandboxTemplateBuild,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export type DTOSandboxTemplateQuery = z.infer<typeof DTOSandboxTemplateQuery>;
|
|
90
|
+
export type DTOSandboxTemplateListResponse = z.infer<typeof DTOSandboxTemplateListResponse>;
|
|
91
|
+
export type DTOSandboxTemplateResponse = z.infer<typeof DTOSandboxTemplateResponse>;
|
|
92
|
+
export type DTOSandboxTemplateBuildResponse = z.infer<typeof DTOSandboxTemplateBuildResponse>;
|
|
93
|
+
|
|
94
|
+
//
|
|
95
|
+
// Write
|
|
96
|
+
//
|
|
97
|
+
|
|
98
|
+
export const DTOSandboxTemplateBuildCreateInput = z.object({
|
|
99
|
+
workspaceId: z.string(),
|
|
100
|
+
designSystemId: z.string(),
|
|
101
|
+
name: z.string(),
|
|
102
|
+
version: z.string(),
|
|
103
|
+
isExistingVersionUpdateAllowed: z.boolean(),
|
|
104
|
+
hasDesignModePlugin: z.boolean().optional(),
|
|
105
|
+
dockerImageUri: z.string().optional(),
|
|
106
|
+
customAuth: z.object({ username: z.string(), password: z.string() }).optional(),
|
|
107
|
+
templates: z
|
|
108
|
+
.object({
|
|
109
|
+
id: z.string(),
|
|
110
|
+
name: z.string(),
|
|
111
|
+
description: z.string(),
|
|
112
|
+
thumbnailUrl: z.string().optional(),
|
|
113
|
+
files: z.string().array(),
|
|
114
|
+
})
|
|
115
|
+
.array()
|
|
116
|
+
.optional(),
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export const DTOSandboxTemplateBuildTriggerInput = z.object({
|
|
120
|
+
imageFileId: z.string().optional(),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export const DTOSandboxTemplateBuildCreateResponse = z.object({
|
|
124
|
+
/** @deprecated use build.dockerImageUri */
|
|
125
|
+
dockerUrl: z.string().optional(),
|
|
126
|
+
|
|
127
|
+
/** @deprecated use build.dockerImageUri */
|
|
128
|
+
dockerRegistryDomain: z.string().optional(),
|
|
129
|
+
|
|
130
|
+
/** @deprecated use docker-login endpoint */
|
|
131
|
+
dockerAccessToken: z.string().optional(),
|
|
132
|
+
|
|
133
|
+
build: DTOSandboxTemplateBuild,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const DTOSandboxTemplateBuildFinalizeResponse = z.object({
|
|
137
|
+
ok: z.boolean(),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
export type DTOSandboxTemplateBuildCreateInput = z.infer<typeof DTOSandboxTemplateBuildCreateInput>;
|
|
141
|
+
export type DTOSandboxTemplateBuildTriggerInput = z.infer<typeof DTOSandboxTemplateBuildTriggerInput>;
|
|
142
|
+
export type DTOSandboxTemplateBuildCreateResponse = z.infer<typeof DTOSandboxTemplateBuildCreateResponse>;
|
|
143
|
+
export type DTOSandboxTemplateBuildFinalizeResponse = z.infer<typeof DTOSandboxTemplateBuildFinalizeResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./storybook-sites";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// Entity
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
export const DTOStorybookUploadStatus = z.enum(["PendingUpload", "Failed", "InProgress", "Completed", "Timeout"]);
|
|
8
|
+
|
|
9
|
+
export const DTOStorybookSiteVersion = z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
isPublic: z.boolean(),
|
|
12
|
+
createdAt: z.string(),
|
|
13
|
+
uploadStatus: DTOStorybookUploadStatus,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const DTOStorybookSite = z.object({
|
|
17
|
+
id: z.string(),
|
|
18
|
+
designSystemId: z.string(),
|
|
19
|
+
name: z.string(),
|
|
20
|
+
indexPageUrl: z.string(),
|
|
21
|
+
createdAt: z.string(),
|
|
22
|
+
currentVersion: DTOStorybookSiteVersion,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type DTOStorybookUploadStatus = z.infer<typeof DTOStorybookUploadStatus>;
|
|
26
|
+
export type DTOStorybookSiteVersion = z.infer<typeof DTOStorybookSiteVersion>;
|
|
27
|
+
export type DTOStorybookSite = z.infer<typeof DTOStorybookSite>;
|
|
28
|
+
|
|
29
|
+
//
|
|
30
|
+
// Payloads
|
|
31
|
+
//
|
|
32
|
+
|
|
33
|
+
export const DTOStorybookSiteListQuery = z.object({
|
|
34
|
+
designSystemId: z.string(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const DTOStorybookSiteListResponse = z.object({
|
|
38
|
+
sites: DTOStorybookSite.array(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const DTOStorybookSiteUploadPayload = z.object({
|
|
42
|
+
designSystemId: z.string(),
|
|
43
|
+
isPublic: z.boolean(),
|
|
44
|
+
name: z.string(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const DTOStorybookSiteUploadResponse = z.object({
|
|
48
|
+
storybookSiteVersion: DTOStorybookSiteVersion,
|
|
49
|
+
uploadUrl: z.string(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const DTOStorybookSiteVersionResponse = z.object({
|
|
53
|
+
storybookSiteVersion: DTOStorybookSiteVersion,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export type DTOStorybookSiteListQuery = z.infer<typeof DTOStorybookSiteListQuery>;
|
|
57
|
+
export type DTOStorybookSiteListResponse = z.infer<typeof DTOStorybookSiteListResponse>;
|
|
58
|
+
export type DTOStorybookSiteUploadPayload = z.infer<typeof DTOStorybookSiteUploadPayload>;
|
|
59
|
+
export type DTOStorybookSiteUploadResponse = z.infer<typeof DTOStorybookSiteUploadResponse>;
|
|
60
|
+
export type DTOStorybookSiteVersionResponse = z.infer<typeof DTOStorybookSiteVersionResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DesignTokenTypedData, ThemeOverrideOrigin } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//
|
|
5
|
+
// Read
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
export const DTOThemeOverride = DesignTokenTypedData.and(
|
|
9
|
+
z.object({
|
|
10
|
+
tokenPersistentId: z.string(),
|
|
11
|
+
origin: ThemeOverrideOrigin.optional(),
|
|
12
|
+
})
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export type DTOThemeOverride = z.infer<typeof DTOThemeOverride>;
|
|
16
|
+
|
|
17
|
+
//
|
|
18
|
+
// Write
|
|
19
|
+
//
|
|
20
|
+
|
|
21
|
+
export const DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(
|
|
22
|
+
z.object({
|
|
23
|
+
tokenPersistentId: z.string(),
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export type DTOThemeOverrideCreatePayload = z.infer<typeof DTOThemeOverrideCreatePayload>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ObjectMeta } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOThemeOverride } from "./override";
|
|
4
|
+
|
|
5
|
+
//
|
|
6
|
+
// Read
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
export const DTOThemesListQuery = z.object({
|
|
10
|
+
brandId: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const DTOTheme = z.object({
|
|
14
|
+
id: z.string(),
|
|
15
|
+
persistentId: z.string(),
|
|
16
|
+
designSystemVersionId: z.string(),
|
|
17
|
+
brandId: z.string(),
|
|
18
|
+
|
|
19
|
+
meta: ObjectMeta,
|
|
20
|
+
codeName: z.string(),
|
|
21
|
+
|
|
22
|
+
parentPersistentId: z.string().optional(),
|
|
23
|
+
collectionPersistentIds: z.string().array(),
|
|
24
|
+
|
|
25
|
+
overrides: DTOThemeOverride.array(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const DTOThemeResponse = z.object({
|
|
29
|
+
theme: DTOTheme,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export const DTOThemeListResponse = z.object({
|
|
33
|
+
themes: DTOTheme.array(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export type DTOThemesListQuery = z.infer<typeof DTOThemesListQuery>;
|
|
37
|
+
export type DTOTheme = z.infer<typeof DTOTheme>;
|
|
38
|
+
export type DTOThemeResponse = z.infer<typeof DTOThemeResponse>;
|
|
39
|
+
export type DTOThemeListResponse = z.infer<typeof DTOThemeListResponse>;
|
|
40
|
+
|
|
41
|
+
//
|
|
42
|
+
// Write
|
|
43
|
+
//
|
|
44
|
+
|
|
45
|
+
export const DTOThemeCreatePayload = z.object({
|
|
46
|
+
meta: ObjectMeta,
|
|
47
|
+
persistentId: z.string(),
|
|
48
|
+
brandId: z.string(),
|
|
49
|
+
codeName: z.string(),
|
|
50
|
+
overrides: DTOThemeOverride.array(),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export type DTOThemeCreatePayload = z.infer<typeof DTOThemeCreatePayload>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./threads";
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { Id } from "@supernova-studio/model";
|
|
2
|
+
import z from "zod";
|
|
3
|
+
import { DTOFileReference } from "../files";
|
|
4
|
+
import { DTOForgeFigmaNode } from "../forge";
|
|
5
|
+
import { DTOBillingUsageSummary } from "../workspaces";
|
|
6
|
+
|
|
7
|
+
//
|
|
8
|
+
// Enums
|
|
9
|
+
//
|
|
10
|
+
|
|
11
|
+
export const DTOThreadSubjectType = z.enum(["ForgeDocument", "ForgeFeature"]);
|
|
12
|
+
export const DTOThreadAgentType = z.enum(["Ask", "Document", "Prototype", "ReleaseNotes"]);
|
|
13
|
+
export const DTOThreadPromptState = z.enum(["Success", "Timeout", "Error"]);
|
|
14
|
+
|
|
15
|
+
export type DTOThreadSubjectType = z.infer<typeof DTOThreadSubjectType>;
|
|
16
|
+
export type DTOThreadAgentType = z.infer<typeof DTOThreadAgentType>;
|
|
17
|
+
export type DTOThreadPromptState = z.infer<typeof DTOThreadPromptState>;
|
|
18
|
+
|
|
19
|
+
//
|
|
20
|
+
// Data model
|
|
21
|
+
//
|
|
22
|
+
|
|
23
|
+
export const DTOThread = z.object({
|
|
24
|
+
id: z.string(),
|
|
25
|
+
liveblocksRoomId: z.string(),
|
|
26
|
+
defaultAgentType: DTOThreadAgentType,
|
|
27
|
+
subjectId: z.string(),
|
|
28
|
+
subjectType: DTOThreadSubjectType,
|
|
29
|
+
createdAt: z.string(),
|
|
30
|
+
updatedAt: z.string(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const DTOThreadMessageUserSender = z.object({
|
|
34
|
+
type: z.literal("User"),
|
|
35
|
+
userId: z.string(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const DTOThreadMessageAgentSender = z.object({
|
|
39
|
+
type: z.literal("Agent"),
|
|
40
|
+
agentType: DTOThreadAgentType,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const DTOThreadMessageSystemSender = z.object({
|
|
44
|
+
type: z.literal("System"),
|
|
45
|
+
onBehalfOfUserId: z.string(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const DTOThreadMessageSender = z.discriminatedUnion("type", [
|
|
49
|
+
DTOThreadMessageUserSender,
|
|
50
|
+
DTOThreadMessageAgentSender,
|
|
51
|
+
DTOThreadMessageSystemSender,
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
export const DTOThreadReaction = z.object({
|
|
55
|
+
messageId: Id,
|
|
56
|
+
userId: z.string(),
|
|
57
|
+
emoji: z.string(),
|
|
58
|
+
createdAt: z.string(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const DTOThreadMessageAttachments = z.object({
|
|
62
|
+
iterationId: Id.optional(),
|
|
63
|
+
files: DTOFileReference.array().optional(),
|
|
64
|
+
templateId: z.string().optional(),
|
|
65
|
+
figmaNodes: DTOForgeFigmaNode.array().optional(),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const DTOThreadMessageAnnotation = z.object({
|
|
69
|
+
prompt: z.string(),
|
|
70
|
+
elements: z.array(
|
|
71
|
+
z.object({
|
|
72
|
+
xpath: z.string(),
|
|
73
|
+
line: z.string(),
|
|
74
|
+
})
|
|
75
|
+
),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export const DTOThreadMessageAnnotations = z.array(DTOThreadMessageAnnotation);
|
|
79
|
+
|
|
80
|
+
export const DTOThreadMessage = z.object({
|
|
81
|
+
id: Id,
|
|
82
|
+
|
|
83
|
+
threadId: z.string(),
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Describes where the message came from
|
|
87
|
+
*/
|
|
88
|
+
sender: DTOThreadMessageSender,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Content of the message
|
|
92
|
+
*/
|
|
93
|
+
body: z.string(),
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Indicates if the message was sent in the agentic mode, if so this message will cause an
|
|
97
|
+
* AI agent to generate a response and perform an action within the feature
|
|
98
|
+
*/
|
|
99
|
+
isPrompt: z.boolean().optional(),
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Indicates if the message is an attempt to retry agent message. Only available for agent messages.
|
|
103
|
+
*/
|
|
104
|
+
isRetry: z.boolean().optional(),
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Indicates if the sender requested agent to reply in a thread
|
|
108
|
+
*/
|
|
109
|
+
startsNewThread: z.boolean().optional(),
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* If defined, this message is considered to be a reply in a thread under parent message id
|
|
113
|
+
*/
|
|
114
|
+
parentMessageId: Id.optional(),
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Link agent response object describing current state of
|
|
118
|
+
*/
|
|
119
|
+
agentResponseTrackerId: Id.optional().nullable(),
|
|
120
|
+
|
|
121
|
+
attachments: DTOThreadMessageAttachments.optional(),
|
|
122
|
+
annotations: DTOThreadMessageAnnotations.optional(),
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* If defined, this message is considered to be a reply to different message
|
|
126
|
+
*/
|
|
127
|
+
replyToMessageId: Id.optional(),
|
|
128
|
+
|
|
129
|
+
promptMetadata: z.record(z.string(), z.any()).optional(),
|
|
130
|
+
|
|
131
|
+
createdAt: z.string(),
|
|
132
|
+
updatedAt: z.string().optional(),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export const DTOThreadAgentResponseTracker = z.object({
|
|
136
|
+
id: Id,
|
|
137
|
+
currentBody: z.string().default(""),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
export type DTOThread = z.infer<typeof DTOThread>;
|
|
141
|
+
export type DTOThreadMessageUserSender = z.infer<typeof DTOThreadMessageUserSender>;
|
|
142
|
+
export type DTOThreadMessageAgentSender = z.infer<typeof DTOThreadMessageAgentSender>;
|
|
143
|
+
export type DTOThreadMessageSystemSender = z.infer<typeof DTOThreadMessageSystemSender>;
|
|
144
|
+
export type DTOThreadMessageSender = z.infer<typeof DTOThreadMessageSender>;
|
|
145
|
+
export type DTOThreadReaction = z.infer<typeof DTOThreadReaction>;
|
|
146
|
+
export type DTOThreadMessage = z.infer<typeof DTOThreadMessage>;
|
|
147
|
+
export type DTOThreadMessageAttachments = z.infer<typeof DTOThreadMessageAttachments>;
|
|
148
|
+
export type DTOThreadMessageAnnotation = z.infer<typeof DTOThreadMessageAnnotation>;
|
|
149
|
+
export type DTOThreadMessageAnnotations = z.infer<typeof DTOThreadMessageAnnotations>;
|
|
150
|
+
export type DTOThreadAgentResponseTracker = z.infer<typeof DTOThreadAgentResponseTracker>;
|
|
151
|
+
|
|
152
|
+
//
|
|
153
|
+
// Payloads
|
|
154
|
+
//
|
|
155
|
+
|
|
156
|
+
export const DTOThreadMessageAttachmentsCreateInput = z.object({
|
|
157
|
+
iterationId: Id.optional(),
|
|
158
|
+
fileIds: z.string().array().optional(),
|
|
159
|
+
figmaNodeIds: z.string().array().optional(),
|
|
160
|
+
templateId: z.string().optional(),
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export const DTOThreadMessageCreateInput = DTOThreadMessage.pick({
|
|
164
|
+
id: true,
|
|
165
|
+
body: true,
|
|
166
|
+
isPrompt: true,
|
|
167
|
+
startsNewThread: true,
|
|
168
|
+
parentMessageId: true,
|
|
169
|
+
promptMetadata: true,
|
|
170
|
+
annotations: true,
|
|
171
|
+
}).extend({
|
|
172
|
+
attachments: DTOThreadMessageAttachmentsCreateInput.optional(),
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export const DTOThreadMessageFinalizeInput = z.object({
|
|
176
|
+
messageId: Id,
|
|
177
|
+
agentMessageBody: z.string().optional(),
|
|
178
|
+
promptState: DTOThreadPromptState.optional(),
|
|
179
|
+
billingUsageSummary: DTOBillingUsageSummary.optional(),
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
export const DTOThreadMessageRetryInput = z.object({
|
|
183
|
+
agentMessageId: Id,
|
|
184
|
+
runtimeError: z.string().optional(),
|
|
185
|
+
/**
|
|
186
|
+
* When `true`, the retry message will be sent to a thread started by the user's message
|
|
187
|
+
* Useful when user retries a message created in the main thread, but expects the retry to be sent as a thread reply
|
|
188
|
+
*/
|
|
189
|
+
shouldReplyInThread: z.boolean().optional(),
|
|
190
|
+
message: DTOThreadMessage.pick({ id: true, body: true }).optional(),
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
export const DTOThreadMessageUpdateInput = DTOThreadMessage.pick({
|
|
194
|
+
id: true,
|
|
195
|
+
}).merge(
|
|
196
|
+
z
|
|
197
|
+
.object({
|
|
198
|
+
body: DTOThreadMessage.shape.body,
|
|
199
|
+
attachments: DTOThreadMessage.shape.attachments,
|
|
200
|
+
agentResponseTrackerId: DTOThreadMessage.shape.agentResponseTrackerId.nullable(),
|
|
201
|
+
})
|
|
202
|
+
.partial()
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
export const DTOThreadReactionCreateInput = z.object({
|
|
206
|
+
messageId: Id,
|
|
207
|
+
emoji: z.string(),
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
export const DTOThreadReactionDeleteInput = z.object({
|
|
211
|
+
messageId: Id,
|
|
212
|
+
emoji: z.string(),
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
export type DTOThreadMessageAttachmentsCreateInput = z.infer<typeof DTOThreadMessageAttachmentsCreateInput>;
|
|
216
|
+
export type DTOThreadMessageFinalizeInput = z.infer<typeof DTOThreadMessageFinalizeInput>;
|
|
217
|
+
export type DTOThreadMessageRetryInput = z.infer<typeof DTOThreadMessageRetryInput>;
|
|
218
|
+
export type DTOThreadMessageCreateInput = z.infer<typeof DTOThreadMessageCreateInput>;
|
|
219
|
+
export type DTOThreadMessageUpdateInput = z.infer<typeof DTOThreadMessageUpdateInput>;
|
|
220
|
+
export type DTOThreadReactionDeleteInput = z.infer<typeof DTOThreadReactionDeleteInput>;
|
|
221
|
+
export type DTOThreadReactionCreateInput = z.infer<typeof DTOThreadReactionCreateInput>;
|
|
222
|
+
|
|
223
|
+
//
|
|
224
|
+
// Responses
|
|
225
|
+
//
|
|
226
|
+
|
|
227
|
+
export const DTOThreadMessageResponse = z.object({
|
|
228
|
+
message: DTOThreadMessage,
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
export const DTOThreadReactionResponse = z.object({
|
|
232
|
+
reaction: DTOThreadReaction,
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
export const DTOThreadMessageListResponse = z.object({
|
|
236
|
+
messages: DTOThreadMessage.array(),
|
|
237
|
+
reactions: DTOThreadReaction.array(),
|
|
238
|
+
lastSeenMessageId: z.string().optional(),
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
export type DTOThreadMessageResponse = z.infer<typeof DTOThreadMessageResponse>;
|
|
242
|
+
export type DTOThreadReactionResponse = z.infer<typeof DTOThreadReactionResponse>;
|
|
243
|
+
export type DTOThreadMessageListResponse = z.infer<typeof DTOThreadMessageListResponse>;
|
|
244
|
+
|
|
245
|
+
//
|
|
246
|
+
// Events
|
|
247
|
+
//
|
|
248
|
+
|
|
249
|
+
export const DTOThreadEventMessagesSent = z.object({
|
|
250
|
+
type: z.literal("MessagesSent"),
|
|
251
|
+
data: DTOThreadMessage.array(),
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export const DTOThreadEventMessagesUpdated = z.object({
|
|
255
|
+
type: z.literal("MessagesUpdated"),
|
|
256
|
+
data: DTOThreadMessage.array(),
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export const DTOThreadEventReactionsSent = z.object({
|
|
260
|
+
type: z.literal("ReactionsSent"),
|
|
261
|
+
data: DTOThreadReaction.array(),
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
export const DTOThreadEventReactionsDeleted = z.object({
|
|
265
|
+
type: z.literal("ReactionsDeleted"),
|
|
266
|
+
data: DTOThreadReaction.array(),
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
export const DTOThreadEvent = z.discriminatedUnion("type", [
|
|
270
|
+
DTOThreadEventMessagesSent,
|
|
271
|
+
DTOThreadEventMessagesUpdated,
|
|
272
|
+
DTOThreadEventReactionsSent,
|
|
273
|
+
DTOThreadEventReactionsDeleted,
|
|
274
|
+
]);
|
|
275
|
+
|
|
276
|
+
export type DTOThreadEventMessagesSent = z.infer<typeof DTOThreadEventMessagesSent>;
|
|
277
|
+
export type DTOThreadEventMessagesUpdated = z.infer<typeof DTOThreadEventMessagesUpdated>;
|
|
278
|
+
export type DTOThreadEventReactionsSent = z.infer<typeof DTOThreadEventReactionsSent>;
|
|
279
|
+
export type DTOThreadEventReactionsDeleted = z.infer<typeof DTOThreadEventReactionsDeleted>;
|
|
280
|
+
export type DTOThreadEvent = z.infer<typeof DTOThreadEvent>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./trail-events";
|