@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,172 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOTrailEventType = z.enum([
|
|
4
|
+
"IterationCreated",
|
|
5
|
+
"IterationBookmarked",
|
|
6
|
+
"FeatureCreated",
|
|
7
|
+
"FeatureDeleted",
|
|
8
|
+
"FeatureArchived",
|
|
9
|
+
"DocumentCreated",
|
|
10
|
+
"DocumentDeleted",
|
|
11
|
+
"DocumentUpdated",
|
|
12
|
+
"DocumentCommentSent",
|
|
13
|
+
"ProjectCreated",
|
|
14
|
+
"ProjectArchived",
|
|
15
|
+
"IterationPromoted",
|
|
16
|
+
"ProjectContextCreated",
|
|
17
|
+
"ProjectContextArchived",
|
|
18
|
+
"FeaturePublished",
|
|
19
|
+
"FeatureUnpublished",
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const DTOTrailEventBase = z.object({
|
|
23
|
+
id: z.string(),
|
|
24
|
+
projectId: z.string(),
|
|
25
|
+
userId: z.string(),
|
|
26
|
+
createdAt: z.coerce.date(),
|
|
27
|
+
updatedAt: z.coerce.date(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const DTOTrailEventIterationCreatedPayload = z.object({
|
|
31
|
+
iterationName: z.string(),
|
|
32
|
+
iterationId: z.string().uuid(),
|
|
33
|
+
featureId: z.string().uuid(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const DTOTrailEventIterationBookmarkedPayload = z.object({
|
|
37
|
+
iterationId: z.string().uuid(),
|
|
38
|
+
featureId: z.string().uuid(),
|
|
39
|
+
iterationName: z.string(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const DTOTrailEventIterationPromotedPayload = z.object({
|
|
43
|
+
iterationId: z.string().uuid(),
|
|
44
|
+
featureId: z.string().uuid(),
|
|
45
|
+
iterationName: z.string(),
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const DTOTrailEventFeatureCreatedPayload = z.object({
|
|
49
|
+
featureId: z.string().uuid(),
|
|
50
|
+
name: z.string(),
|
|
51
|
+
description: z.string().optional(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const DTOTrailEventFeatureDeletedPayload = z.object({
|
|
55
|
+
featureId: z.string().uuid(),
|
|
56
|
+
name: z.string(),
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const DTOTrailEventFeatureArchivedPayload = z.object({
|
|
60
|
+
featureId: z.string().uuid(),
|
|
61
|
+
name: z.string(),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const DTOTrailEventDocumentCreatedPayload = z.object({
|
|
65
|
+
documentId: z.string().uuid(),
|
|
66
|
+
title: z.string(),
|
|
67
|
+
sectionId: z.string().uuid().optional(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const DTOTrailEventDocumentDeletedPayload = z.object({
|
|
71
|
+
documentId: z.string().uuid(),
|
|
72
|
+
title: z.string(),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const DTOTrailEventDocumentUpdatedPayload = z.object({
|
|
76
|
+
documentId: z.string().uuid(),
|
|
77
|
+
title: z.string(),
|
|
78
|
+
sectionId: z.string().uuid().optional(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const DTOTrailEventDocumentCommentSentPayload = z.object({
|
|
82
|
+
documentId: z.string().uuid(),
|
|
83
|
+
title: z.string(),
|
|
84
|
+
sectionId: z.string().uuid().optional(),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const DTOTrailEventProjectCreatedPayload = z.object({
|
|
88
|
+
name: z.string(),
|
|
89
|
+
description: z.string().optional(),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const DTOTrailEventFeaturePublishedPayload = z.object({
|
|
93
|
+
featureId: z.string().uuid(),
|
|
94
|
+
featureName: z.string(),
|
|
95
|
+
iterationId: z.string().uuid().nullish(),
|
|
96
|
+
iterationName: z.string().nullish(),
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const DTOTrailEventFeatureUnpublishedPayload = z.object({
|
|
100
|
+
featureId: z.string().uuid(),
|
|
101
|
+
featureName: z.string(),
|
|
102
|
+
iterationId: z.string().uuid().nullish(),
|
|
103
|
+
iterationName: z.string().nullish(),
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const DTOTrailEventProjectArchivedPayload = z.object({
|
|
107
|
+
name: z.string(),
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const DTOTrailEventProjectContextCreatedPayload = z.object({
|
|
111
|
+
contextId: z.number(),
|
|
112
|
+
name: z.string(),
|
|
113
|
+
description: z.string().optional(),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const DTOTrailEventProjectContextArchivedPayload = z.object({
|
|
117
|
+
contextId: z.number(),
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const DTOTrailEventPayload = z.discriminatedUnion("type", [
|
|
121
|
+
z.object({ type: z.literal("IterationCreated"), payload: DTOTrailEventIterationCreatedPayload }),
|
|
122
|
+
z.object({ type: z.literal("IterationBookmarked"), payload: DTOTrailEventIterationBookmarkedPayload }),
|
|
123
|
+
z.object({ type: z.literal("FeatureCreated"), payload: DTOTrailEventFeatureCreatedPayload }),
|
|
124
|
+
z.object({ type: z.literal("FeatureDeleted"), payload: DTOTrailEventFeatureDeletedPayload }),
|
|
125
|
+
z.object({ type: z.literal("FeatureArchived"), payload: DTOTrailEventFeatureArchivedPayload }),
|
|
126
|
+
z.object({ type: z.literal("DocumentCreated"), payload: DTOTrailEventDocumentCreatedPayload }),
|
|
127
|
+
z.object({ type: z.literal("DocumentDeleted"), payload: DTOTrailEventDocumentDeletedPayload }),
|
|
128
|
+
z.object({ type: z.literal("DocumentUpdated"), payload: DTOTrailEventDocumentUpdatedPayload }),
|
|
129
|
+
z.object({ type: z.literal("DocumentCommentSent"), payload: DTOTrailEventDocumentCommentSentPayload }),
|
|
130
|
+
z.object({ type: z.literal("ProjectCreated"), payload: DTOTrailEventProjectCreatedPayload }),
|
|
131
|
+
z.object({ type: z.literal("ProjectArchived"), payload: DTOTrailEventProjectArchivedPayload }),
|
|
132
|
+
z.object({ type: z.literal("IterationPromoted"), payload: DTOTrailEventIterationPromotedPayload }),
|
|
133
|
+
z.object({ type: z.literal("ProjectContextCreated"), payload: DTOTrailEventProjectContextCreatedPayload }),
|
|
134
|
+
z.object({ type: z.literal("ProjectContextArchived"), payload: DTOTrailEventProjectContextArchivedPayload }),
|
|
135
|
+
z.object({ type: z.literal("FeaturePublished"), payload: DTOTrailEventFeaturePublishedPayload }),
|
|
136
|
+
z.object({ type: z.literal("FeatureUnpublished"), payload: DTOTrailEventFeatureUnpublishedPayload }),
|
|
137
|
+
]);
|
|
138
|
+
|
|
139
|
+
export const DTOTrailEvent = DTOTrailEventPayload.and(DTOTrailEventBase);
|
|
140
|
+
|
|
141
|
+
export const DTOTrailEventWithDetails = DTOTrailEvent.and(
|
|
142
|
+
z.object({
|
|
143
|
+
projectName: z.string().optional(),
|
|
144
|
+
userName: z.string().optional(),
|
|
145
|
+
})
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
export const DTOTrailEventListInput = z.object({
|
|
149
|
+
projectId: z.string(),
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export const DTOTrailEventListResponse = z.object({
|
|
153
|
+
events: z.array(DTOTrailEventWithDetails),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export const DTOTrailEventCreate = DTOTrailEventPayload.and(
|
|
157
|
+
DTOTrailEventBase.omit({ id: true, createdAt: true, updatedAt: true })
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
export const DTOTrailEventClientCreate = z
|
|
161
|
+
.discriminatedUnion("type", [
|
|
162
|
+
z.object({ type: z.literal("DocumentUpdated"), payload: DTOTrailEventDocumentUpdatedPayload }),
|
|
163
|
+
z.object({ type: z.literal("DocumentCommentSent"), payload: DTOTrailEventDocumentCommentSentPayload }),
|
|
164
|
+
])
|
|
165
|
+
.and(DTOTrailEventBase.omit({ id: true, createdAt: true, updatedAt: true }));
|
|
166
|
+
|
|
167
|
+
export type DTOTrailEvent = z.infer<typeof DTOTrailEvent>;
|
|
168
|
+
export type DTOTrailEventWithDetails = z.infer<typeof DTOTrailEventWithDetails>;
|
|
169
|
+
export type DTOTrailEventListInput = z.infer<typeof DTOTrailEventListInput>;
|
|
170
|
+
export type DTOTrailEventListResponse = z.infer<typeof DTOTrailEventListResponse>;
|
|
171
|
+
export type DTOTrailEventType = z.infer<typeof DTOTrailEventType>;
|
|
172
|
+
export type DTOTrailEventCreate = z.infer<typeof DTOTrailEventCreate>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PortalTheme,
|
|
3
|
+
UserOnboardingDepartment,
|
|
4
|
+
UserOnboardingJobLevel,
|
|
5
|
+
UserSource,
|
|
6
|
+
UserTheme,
|
|
7
|
+
} from "@supernova-studio/model";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { DTOUser, DTOUserProfile } from "./user";
|
|
10
|
+
|
|
11
|
+
//
|
|
12
|
+
// Entities
|
|
13
|
+
//
|
|
14
|
+
|
|
15
|
+
export const DTOUserOnboardingDepartment = UserOnboardingDepartment;
|
|
16
|
+
export const DTOUserOnboardingJobLevel = UserOnboardingJobLevel;
|
|
17
|
+
export const DTOUserSource = UserSource;
|
|
18
|
+
export const DTOUserTheme = UserTheme;
|
|
19
|
+
export const DTOUserPortalTheme = PortalTheme;
|
|
20
|
+
|
|
21
|
+
export const DTOUserOnboarding = z.object({
|
|
22
|
+
companyName: z.string().optional(),
|
|
23
|
+
numberOfPeopleInOrg: z.string().optional(),
|
|
24
|
+
numberOfPeopleInDesignTeam: z.string().optional(),
|
|
25
|
+
department: DTOUserOnboardingDepartment.optional(),
|
|
26
|
+
jobTitle: z.string().optional(),
|
|
27
|
+
phase: z.string().optional(),
|
|
28
|
+
jobLevel: DTOUserOnboardingJobLevel.optional(),
|
|
29
|
+
designSystemName: z.string().optional(),
|
|
30
|
+
defaultDestination: z.string().optional(),
|
|
31
|
+
isPageDraftOnboardingFinished: z.boolean().optional(),
|
|
32
|
+
figmaUrl: z.string().optional(),
|
|
33
|
+
isApprovalsOnboardingFinished: z.boolean().optional(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const DTOAuthenticatedUserProfile = DTOUserProfile.extend({
|
|
37
|
+
onboarding: DTOUserOnboarding.optional(),
|
|
38
|
+
theme: DTOUserTheme.optional(),
|
|
39
|
+
portalTheme: DTOUserPortalTheme.optional(),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const DTOUserEmailSettings = z.object({
|
|
43
|
+
marketingEmails: z.boolean(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const DTOAuthenticatedUser = DTOUser.extend({
|
|
47
|
+
profile: DTOAuthenticatedUserProfile,
|
|
48
|
+
emailSettings: DTOUserEmailSettings,
|
|
49
|
+
createdAt: z.coerce.date(),
|
|
50
|
+
loggedOutAt: z.coerce.date().optional(),
|
|
51
|
+
source: DTOUserSource.optional(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export type DTOUserOnboardingDepartment = z.infer<typeof DTOUserOnboardingDepartment>;
|
|
55
|
+
export type DTOUserOnboardingJobLevel = z.infer<typeof DTOUserOnboardingJobLevel>;
|
|
56
|
+
export type DTOUserSource = z.infer<typeof DTOUserSource>;
|
|
57
|
+
export type DTOUserTheme = z.infer<typeof DTOUserTheme>;
|
|
58
|
+
export type DTOUserPortalTheme = z.infer<typeof DTOUserPortalTheme>;
|
|
59
|
+
export type DTOUserOnboarding = z.infer<typeof DTOUserOnboarding>;
|
|
60
|
+
export type DTOAuthenticatedUserProfile = z.infer<typeof DTOAuthenticatedUserProfile>;
|
|
61
|
+
export type DTOUserEmailSettings = z.infer<typeof DTOUserEmailSettings>;
|
|
62
|
+
export type DTOAuthenticatedUser = z.infer<typeof DTOAuthenticatedUser>;
|
|
63
|
+
|
|
64
|
+
//
|
|
65
|
+
// Payloads - input
|
|
66
|
+
//
|
|
67
|
+
|
|
68
|
+
export const DTOUserProfileUpdatePayload = DTOAuthenticatedUserProfile.partial().omit({
|
|
69
|
+
avatar: true,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const DTOUserEmailSettingsUpdatePayload = DTOUserEmailSettings.partial();
|
|
73
|
+
|
|
74
|
+
export const DTOUserUpdatePayload = z.object({
|
|
75
|
+
profile: DTOUserProfileUpdatePayload.optional(),
|
|
76
|
+
emailSettings: DTOUserEmailSettingsUpdatePayload.optional(),
|
|
77
|
+
avatarFileId: z.string().optional(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export type DTOUserProfileUpdatePayload = z.infer<typeof DTOUserProfileUpdatePayload>;
|
|
81
|
+
export type DTOUserEmailSettingsUpdatePayload = z.infer<typeof DTOUserEmailSettingsUpdatePayload>;
|
|
82
|
+
export type DTOUserUpdatePayload = z.infer<typeof DTOUserUpdatePayload>;
|
|
83
|
+
|
|
84
|
+
//
|
|
85
|
+
// Payloads - output
|
|
86
|
+
//
|
|
87
|
+
|
|
88
|
+
export const DTOAuthenticatedUserResponse = z.object({
|
|
89
|
+
user: DTOAuthenticatedUser,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export type DTOAuthenticatedUserResponse = z.infer<typeof DTOAuthenticatedUserResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Definition of a user profile as inspectable by other users (i.e. reduced version)
|
|
5
|
+
*/
|
|
6
|
+
export const DTOUserProfile = z.object({
|
|
7
|
+
name: z.string(),
|
|
8
|
+
nickname: z.string().optional(),
|
|
9
|
+
avatar: z.string().optional(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Definition of a user as inspectable by other users (i.e. reduced version)
|
|
14
|
+
*/
|
|
15
|
+
export const DTOUser = z.object({
|
|
16
|
+
id: z.string(),
|
|
17
|
+
email: z.string(),
|
|
18
|
+
profile: DTOUserProfile,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const DTOUserGetResponse = z.object({
|
|
22
|
+
user: DTOUser,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type DTOUserProfile = z.infer<typeof DTOUserProfile>;
|
|
26
|
+
export type DTOUser = z.infer<typeof DTOUser>;
|
|
27
|
+
export type DTOUserGetResponse = z.infer<typeof DTOUserGetResponse>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { DTOBillingInterval, DTOProductCode } from "./enums";
|
|
3
|
+
|
|
4
|
+
export const DTOBillingSupportedModels = z.enum([
|
|
5
|
+
"GPT_4_1",
|
|
6
|
+
"GPT_4_1_MINI",
|
|
7
|
+
"GPT_4O",
|
|
8
|
+
"O1",
|
|
9
|
+
"GPT_5",
|
|
10
|
+
"GPT_5_MINI",
|
|
11
|
+
"GPT_5_NANO",
|
|
12
|
+
"GPT_5_2_CODEX",
|
|
13
|
+
"GPT_5_3_CODEX",
|
|
14
|
+
"GPT_5_4",
|
|
15
|
+
"GPT_5_5",
|
|
16
|
+
// Claude models
|
|
17
|
+
"CLAUDE_OPUS_4_0",
|
|
18
|
+
"CLAUDE_OPUS_4_1",
|
|
19
|
+
"CLAUDE_OPUS_4_5",
|
|
20
|
+
"CLAUDE_SONNET_4_0",
|
|
21
|
+
"CLAUDE_SONNET_4_5",
|
|
22
|
+
"CLAUDE_HAIKU_4_5",
|
|
23
|
+
// Claude dated models
|
|
24
|
+
"CLAUDE_OPUS_4_20250514",
|
|
25
|
+
"CLAUDE_OPUS_4_1_20250805",
|
|
26
|
+
"CLAUDE_OPUS_4_5_20251101",
|
|
27
|
+
"CLAUDE_3_7_SONNET_20250219",
|
|
28
|
+
"CLAUDE_3_7_SONNET_LATEST",
|
|
29
|
+
"CLAUDE_SONNET_4_20250514",
|
|
30
|
+
"CLAUDE_SONNET_4_5_20250929",
|
|
31
|
+
"CLAUDE_3_HAIKU_20240307",
|
|
32
|
+
"CLAUDE_3_5_HAIKU_20241022",
|
|
33
|
+
"CLAUDE_3_5_HAIKU_LATEST",
|
|
34
|
+
"CLAUDE_HAIKU_4_5_20251001",
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
export const DTOBillingCheckoutMode = z.enum(["SubscriptionChange", "CreditsTopUp"]);
|
|
38
|
+
export const DTOBillingCreditsSpendAction = z.enum(["Ask", "Build", "DocumentUpdate"]);
|
|
39
|
+
|
|
40
|
+
export type DTOBillingSupportedModels = z.infer<typeof DTOBillingSupportedModels>;
|
|
41
|
+
export type DTOBillingCheckoutMode = z.infer<typeof DTOBillingCheckoutMode>;
|
|
42
|
+
export type DTOBillingCreditsSpendAction = z.infer<typeof DTOBillingCreditsSpendAction>;
|
|
43
|
+
|
|
44
|
+
//
|
|
45
|
+
// Subscription Preview
|
|
46
|
+
//
|
|
47
|
+
|
|
48
|
+
export const DTOBillingSubscriptionChangePreviewInput = z.object({
|
|
49
|
+
plan: DTOProductCode,
|
|
50
|
+
interval: DTOBillingInterval,
|
|
51
|
+
fullSeats: z.number(),
|
|
52
|
+
builderSeats: z.number(),
|
|
53
|
+
additionalCredits: z.number(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export type DTOBillingSubscriptionChangePreviewInput = z.infer<typeof DTOBillingSubscriptionChangePreviewInput>;
|
|
57
|
+
|
|
58
|
+
//
|
|
59
|
+
// Credits Spend
|
|
60
|
+
//
|
|
61
|
+
|
|
62
|
+
export const DTOBillingCreditsSpendInput = z.object({
|
|
63
|
+
inputTokenCount: z.number().int().nonnegative(),
|
|
64
|
+
outputTokenCount: z.number().int().nonnegative(),
|
|
65
|
+
inputCachedTokenCount: z.number().int().nonnegative().optional(),
|
|
66
|
+
modelName: DTOBillingSupportedModels,
|
|
67
|
+
action: DTOBillingCreditsSpendAction.optional().default(DTOBillingCreditsSpendAction.enum.Ask),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const DTOBillingUsageEntry = z.object({
|
|
71
|
+
executionId: z.string(),
|
|
72
|
+
parentExecutionId: z.string().optional(),
|
|
73
|
+
executionKind: z.enum(["root", "subagent"]),
|
|
74
|
+
agent: z.string(),
|
|
75
|
+
modelName: DTOBillingSupportedModels,
|
|
76
|
+
providerRequestId: z.string().optional(),
|
|
77
|
+
inputTokenCount: z.number().int().nonnegative(),
|
|
78
|
+
outputTokenCount: z.number().int().nonnegative(),
|
|
79
|
+
inputCachedTokenCount: z.number().int().nonnegative().optional(),
|
|
80
|
+
reasoningTokenCount: z.number().int().nonnegative().optional(),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const DTOBillingUsageSummary = z.object({
|
|
84
|
+
rootAction: DTOBillingCreditsSpendAction,
|
|
85
|
+
entries: z.array(DTOBillingUsageEntry),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export const DTOBillingCreditsSpendResponse = z.object({
|
|
89
|
+
hasOverspend: z.boolean(),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const DTOBillingCreditsCheckIfCanSpendResponse = z.object({
|
|
93
|
+
canSpendCredits: z.boolean(),
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
export type DTOBillingCreditsSpendInput = z.infer<typeof DTOBillingCreditsSpendInput>;
|
|
97
|
+
export type DTOBillingUsageEntry = z.infer<typeof DTOBillingUsageEntry>;
|
|
98
|
+
export type DTOBillingUsageSummary = z.infer<typeof DTOBillingUsageSummary>;
|
|
99
|
+
export type DTOBillingCreditsSpendResponse = z.infer<typeof DTOBillingCreditsSpendResponse>;
|
|
100
|
+
export type DTOBillingCreditsCheckIfCanSpendResponse = z.infer<typeof DTOBillingCreditsCheckIfCanSpendResponse>;
|
|
101
|
+
|
|
102
|
+
//
|
|
103
|
+
// Checkout
|
|
104
|
+
//
|
|
105
|
+
|
|
106
|
+
export const DTOBillingCheckoutOldInput = z.object(
|
|
107
|
+
{
|
|
108
|
+
mode: z.literal(undefined),
|
|
109
|
+
|
|
110
|
+
successUrl: z.string().url(),
|
|
111
|
+
cancelUrl: z.string().url(),
|
|
112
|
+
|
|
113
|
+
priceId: z.string(),
|
|
114
|
+
quantity: z.number().int().min(1),
|
|
115
|
+
},
|
|
116
|
+
{ description: "It is deprecated, keep for backwards compatibility" }
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
export const DTOBillingCheckoutSubscriptionChangeInput = z.object({
|
|
120
|
+
mode: z.literal(DTOBillingCheckoutMode.enum.SubscriptionChange),
|
|
121
|
+
|
|
122
|
+
successUrl: z.string().url(),
|
|
123
|
+
cancelUrl: z.string().url(),
|
|
124
|
+
|
|
125
|
+
plan: DTOProductCode,
|
|
126
|
+
interval: DTOBillingInterval,
|
|
127
|
+
fullSeats: z.number(),
|
|
128
|
+
builderSeats: z.number(),
|
|
129
|
+
additionalCredits: z.number(),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export const DTOBillingCheckoutCreditsTopUpInput = z.object({
|
|
133
|
+
mode: z.literal(DTOBillingCheckoutMode.enum.CreditsTopUp),
|
|
134
|
+
|
|
135
|
+
successUrl: z.string().url(),
|
|
136
|
+
cancelUrl: z.string().url(),
|
|
137
|
+
|
|
138
|
+
centAmount: z.number().int().nonnegative().min(1_000),
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export const DTOBillingCheckoutInput = z.discriminatedUnion("mode", [
|
|
142
|
+
DTOBillingCheckoutOldInput,
|
|
143
|
+
DTOBillingCheckoutSubscriptionChangeInput,
|
|
144
|
+
DTOBillingCheckoutCreditsTopUpInput,
|
|
145
|
+
]);
|
|
146
|
+
|
|
147
|
+
export const DTOBillingCheckoutResponse = z.object({
|
|
148
|
+
id: z.string(),
|
|
149
|
+
url: z.string().nullish(),
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export type DTOBillingCheckoutOldInput = z.infer<typeof DTOBillingCheckoutOldInput>;
|
|
153
|
+
export type DTOBillingCheckoutSubscriptionChangeInput = z.infer<typeof DTOBillingCheckoutSubscriptionChangeInput>;
|
|
154
|
+
export type DTOBillingCheckoutCreditsTopUpInput = z.infer<typeof DTOBillingCheckoutCreditsTopUpInput>;
|
|
155
|
+
export type DTOBillingCheckoutInput = z.infer<typeof DTOBillingCheckoutInput>;
|
|
156
|
+
export type DTOBillingCheckoutResponse = z.infer<typeof DTOBillingCheckoutResponse>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOWorkspaceRole = z.enum(["Owner", "Admin", "Creator", "Viewer", "Billing", "Contributor"]);
|
|
4
|
+
export const DTOWorkspaceSeatType = z.enum(["Full", "Builder", "None"]);
|
|
5
|
+
export const DTOWorkspaceBilledSeatType = z.enum(["Full", "Builder"]);
|
|
6
|
+
export const DTOBillingInterval = z.enum(["daily", "monthly", "yearly"]);
|
|
7
|
+
export const DTOProductCode = z.enum(["free", "pro", "team", "company", "enterprise"]);
|
|
8
|
+
|
|
9
|
+
export type DTOWorkspaceRole = z.infer<typeof DTOWorkspaceRole>;
|
|
10
|
+
export type DTOWorkspaceSeatType = z.infer<typeof DTOWorkspaceSeatType>;
|
|
11
|
+
export type DTOWorkspaceBilledSeatType = z.infer<typeof DTOWorkspaceBilledSeatType>;
|
|
12
|
+
export type DTOBillingInterval = z.infer<typeof DTOBillingInterval>;
|
|
13
|
+
export type DTOProductCode = z.infer<typeof DTOProductCode>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOGitOrganization = z.object({
|
|
4
|
+
id: z.string(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
url: z.string(),
|
|
7
|
+
slug: z.string(),
|
|
8
|
+
});
|
|
9
|
+
export type DTOGitOrganization = z.infer<typeof DTOGitOrganization>;
|
|
10
|
+
|
|
11
|
+
export const DTOGitProject = z.object({
|
|
12
|
+
id: z.string(),
|
|
13
|
+
name: z.string(),
|
|
14
|
+
url: z.string(),
|
|
15
|
+
slug: z.string(),
|
|
16
|
+
});
|
|
17
|
+
export type DTOGitProject = z.infer<typeof DTOGitProject>;
|
|
18
|
+
|
|
19
|
+
export const DTOGitRepository = z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
name: z.string(),
|
|
22
|
+
url: z.string(),
|
|
23
|
+
slug: z.string(),
|
|
24
|
+
defaultBranch: z.string().optional(),
|
|
25
|
+
});
|
|
26
|
+
export type DTOGitRepository = z.infer<typeof DTOGitRepository>;
|
|
27
|
+
|
|
28
|
+
export const DTOGitBranch = z.object({
|
|
29
|
+
name: z.string(),
|
|
30
|
+
lastCommitId: z.string(),
|
|
31
|
+
});
|
|
32
|
+
export type DTOGitBranch = z.infer<typeof DTOGitBranch>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from "./billing";
|
|
2
|
+
export * from "./enums";
|
|
3
|
+
export * from "./git";
|
|
4
|
+
export * from "./integrations";
|
|
5
|
+
export * from "./invitations";
|
|
6
|
+
export * from "./ip-whitelist";
|
|
7
|
+
export * from "./knowledge-items-search";
|
|
8
|
+
export * from "./login-screen";
|
|
9
|
+
export * from "./membership";
|
|
10
|
+
export * from "./npm-registry";
|
|
11
|
+
export * from "./products";
|
|
12
|
+
export * from "./subscription";
|
|
13
|
+
export * from "./transfer-ownership";
|
|
14
|
+
export * from "./untyped-data";
|
|
15
|
+
export * from "./workspace";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ExtendedIntegrationType, IntegrationCredentials, IntegrationDesignSystem } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTOIntegrationCredentials = IntegrationCredentials.omit({
|
|
5
|
+
accessToken: true,
|
|
6
|
+
refreshToken: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const DTOIntegration = z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
workspaceId: z.string(),
|
|
12
|
+
type: ExtendedIntegrationType,
|
|
13
|
+
createdAt: z.coerce.date(),
|
|
14
|
+
integrationCredentials: z.array(DTOIntegrationCredentials).optional(),
|
|
15
|
+
integrationDesignSystems: z.array(IntegrationDesignSystem).optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const DTOIntegrationOAuthGetResponse = z.object({
|
|
19
|
+
url: z.string(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const DTOIntegrationPostResponse = z.object({
|
|
23
|
+
integration: DTOIntegration,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const DTOIntegrationsGetListResponse = z.object({
|
|
27
|
+
integrations: DTOIntegration.array(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export type DTOIntegration = z.infer<typeof DTOIntegration>;
|
|
31
|
+
export type DTOIntegrationCredentials = z.infer<typeof DTOIntegrationCredentials>;
|
|
32
|
+
export type DTOIntegrationOAuthGetResponse = z.infer<typeof DTOIntegrationOAuthGetResponse>;
|
|
33
|
+
export type DTOIntegrationPostResponse = z.infer<typeof DTOIntegrationPostResponse>;
|
|
34
|
+
export type DTOIntegrationsGetListResponse = z.infer<typeof DTOIntegrationsGetListResponse>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOWorkspaceRole, DTOWorkspaceSeatType } from "./enums";
|
|
3
|
+
|
|
4
|
+
export const DTOWorkspaceInvitation = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
email: z.string().email(),
|
|
7
|
+
createdAt: z.coerce.date(),
|
|
8
|
+
resentAt: z.coerce.date().nullish(),
|
|
9
|
+
role: DTOWorkspaceRole,
|
|
10
|
+
seatType: DTOWorkspaceSeatType,
|
|
11
|
+
workspaceId: z.string(),
|
|
12
|
+
invitedBy: z.string(),
|
|
13
|
+
effectiveRole: DTOWorkspaceRole,
|
|
14
|
+
effectiveSeatType: DTOWorkspaceSeatType,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export const DTOWorkspaceInvitationInput = z.object({
|
|
18
|
+
email: z.string().email(),
|
|
19
|
+
role: DTOWorkspaceRole,
|
|
20
|
+
seatType: DTOWorkspaceSeatType.optional(),
|
|
21
|
+
isDeveloperInvite: z.boolean().optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const DTOWorkspaceInvitationsListInput = z.object({
|
|
25
|
+
invites: DTOWorkspaceInvitationInput.array().max(100),
|
|
26
|
+
designSystemId: z.string().optional(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const DTOWorkspaceInvitationsResponse = z.object({
|
|
30
|
+
invitations: DTOWorkspaceInvitation.array(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const DTOWorkspaceInviteUpdate = z.object({
|
|
34
|
+
role: DTOWorkspaceRole,
|
|
35
|
+
seatType: DTOWorkspaceSeatType.optional(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const DTOWorkspaceInvitationUpdateResponse = z.object({
|
|
39
|
+
invitation: DTOWorkspaceInvitation,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export type DTOWorkspaceInvitation = z.infer<typeof DTOWorkspaceInvitation>;
|
|
43
|
+
export type DTOWorkspaceInvitationInput = z.infer<typeof DTOWorkspaceInvitationInput>;
|
|
44
|
+
export type DTOWorkspaceInvitationsListInput = z.infer<typeof DTOWorkspaceInvitationsListInput>;
|
|
45
|
+
export type DTOWorkspaceInvitationsResponse = z.infer<typeof DTOWorkspaceInvitationsResponse>;
|
|
46
|
+
export type DTOWorkspaceInviteUpdate = z.infer<typeof DTOWorkspaceInviteUpdate>;
|
|
47
|
+
export type DTOWorkspaceInvitationUpdateResponse = z.infer<typeof DTOWorkspaceInvitationUpdateResponse>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
//
|
|
4
|
+
// Entity
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
export const DTOIPWhitelistEntry = z.object({
|
|
8
|
+
isEnabled: z.boolean(),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
range: z.string().cidr(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const DTOIPWhitelist = z.object({
|
|
14
|
+
isEnabledForCloud: z.boolean(),
|
|
15
|
+
isEnabledForDocs: z.boolean(),
|
|
16
|
+
entries: DTOIPWhitelistEntry.array(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type DTOIPWhitelist = z.infer<typeof DTOIPWhitelist>;
|
|
20
|
+
export type DTOIPWhitelistEntry = z.infer<typeof DTOIPWhitelistEntry>;
|
|
21
|
+
|
|
22
|
+
//
|
|
23
|
+
// Payloads
|
|
24
|
+
//
|
|
25
|
+
|
|
26
|
+
export const DTOIPWhitelistUpdate = DTOIPWhitelist.partial();
|
|
27
|
+
|
|
28
|
+
export const DTOIPWhitelistResponse = z.object({
|
|
29
|
+
ipWhitelist: DTOIPWhitelist,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export type DTOIPWhitelistUpdate = z.infer<typeof DTOIPWhitelistUpdate>;
|
|
33
|
+
export type DTOIPWhitelistResponse = z.infer<typeof DTOIPWhitelistResponse>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOKnowledgeItemSearchIndexResponse = z.object({
|
|
4
|
+
indexedItems: z.number(),
|
|
5
|
+
totalItems: z.number(),
|
|
6
|
+
skippedItems: z.number(),
|
|
7
|
+
errors: z.number(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const DTOKnowledgeItemSearchKind = z.enum(["file", "skill"]);
|
|
11
|
+
|
|
12
|
+
export const DTOKnowledgeItemSearchQuery = z.object({
|
|
13
|
+
query: z.string().min(1).max(1000),
|
|
14
|
+
mode: z.enum(["full-text", "vector", "hybrid"]).optional().default("hybrid"),
|
|
15
|
+
limit: z.number().int().min(1).max(50).optional().default(10),
|
|
16
|
+
kinds: z.array(DTOKnowledgeItemSearchKind).optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const DTOKnowledgeItemSearchResult = z.object({
|
|
20
|
+
knowledgeItemId: z.string(),
|
|
21
|
+
kind: DTOKnowledgeItemSearchKind,
|
|
22
|
+
path: z.string(),
|
|
23
|
+
excerpt: z.string(),
|
|
24
|
+
vectorScore: z.number().nullable(),
|
|
25
|
+
fullTextScore: z.number().nullable(),
|
|
26
|
+
reciprocalRankFusionScore: z.number(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const DTOKnowledgeItemSearchResponse = z.object({
|
|
30
|
+
results: z.array(DTOKnowledgeItemSearchResult),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export type DTOKnowledgeItemSearchKind = z.infer<typeof DTOKnowledgeItemSearchKind>;
|
|
34
|
+
export type DTOKnowledgeItemSearchIndexResponse = z.infer<typeof DTOKnowledgeItemSearchIndexResponse>;
|
|
35
|
+
export type DTOKnowledgeItemSearchQuery = z.infer<typeof DTOKnowledgeItemSearchQuery>;
|
|
36
|
+
export type DTOKnowledgeItemSearchResult = z.infer<typeof DTOKnowledgeItemSearchResult>;
|
|
37
|
+
export type DTOKnowledgeItemSearchResponse = z.infer<typeof DTOKnowledgeItemSearchResponse>;
|