@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,52 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOCodeComponentPropUsage = z.object({
|
|
4
|
+
/** How many times this property has been used in this repository? */
|
|
5
|
+
usages: z.number(),
|
|
6
|
+
|
|
7
|
+
/** How many times different values have been used with this property? */
|
|
8
|
+
values: z.record(z.number()),
|
|
9
|
+
|
|
10
|
+
/** How many times a value has not been specified? (all component usages - usages with values) */
|
|
11
|
+
undefinedValue: z.number(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const DTOCodeComponentUsage = z.object({
|
|
15
|
+
/**
|
|
16
|
+
* Name of the component in its package.
|
|
17
|
+
* `componentName` and `componentPackageName` uniquely identify a component
|
|
18
|
+
*/
|
|
19
|
+
componentName: z.string(),
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Which package the component is coming from.
|
|
23
|
+
* `componentName` and `componentPackageName` uniquely identify a component
|
|
24
|
+
*/
|
|
25
|
+
componentPackageName: z.string(),
|
|
26
|
+
|
|
27
|
+
/** Which repository this component is used in */
|
|
28
|
+
usageRepositoryName: z.string(),
|
|
29
|
+
|
|
30
|
+
/** Which package of the repository the component is used in */
|
|
31
|
+
usagePackageName: z.string(),
|
|
32
|
+
|
|
33
|
+
/** How many times this component has been used in this repository? */
|
|
34
|
+
usages: z.number(),
|
|
35
|
+
|
|
36
|
+
/** How many files has at least one usage of this component? */
|
|
37
|
+
usageFiles: z.number(),
|
|
38
|
+
|
|
39
|
+
/** Usage data of the component's props */
|
|
40
|
+
props: z.record(DTOCodeComponentPropUsage),
|
|
41
|
+
|
|
42
|
+
/** Timestamp of the scan that has shapshotted this data */
|
|
43
|
+
scanTimestamp: z.string(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const DTOCodeComponentUsageResponse = z.object({
|
|
47
|
+
componentUsage: DTOCodeComponentUsage.array(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export type DTOCodeComponentPropUsage = z.infer<typeof DTOCodeComponentPropUsage>;
|
|
51
|
+
export type DTOCodeComponentUsage = z.infer<typeof DTOCodeComponentUsage>;
|
|
52
|
+
export type DTOCodeComponentUsageResponse = z.infer<typeof DTOCodeComponentUsageResponse>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOCodeComponentProperty = z.object({
|
|
4
|
+
name: z.string(),
|
|
5
|
+
type: z.string(),
|
|
6
|
+
isRequired: z.boolean(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const DTOCodeComponentStorybookFile = z.object({
|
|
10
|
+
name: z.string(),
|
|
11
|
+
type: z.enum(["Story", "Doc"]),
|
|
12
|
+
filePath: z.string(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const DTOCodeComponentDocFile = z.object({
|
|
16
|
+
filePath: z.string(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const DTOCodeComponent = z.object({
|
|
20
|
+
/** Stable identifier for the code component (Prisma row id, stringified). */
|
|
21
|
+
id: z.string(),
|
|
22
|
+
|
|
23
|
+
/** Name of the component in code */
|
|
24
|
+
name: z.string(),
|
|
25
|
+
|
|
26
|
+
/** Name of the package (from package.json) from where the component was imported */
|
|
27
|
+
packageName: z.string(),
|
|
28
|
+
|
|
29
|
+
/** Name of the repository that contains this component */
|
|
30
|
+
repositoryName: z.string(),
|
|
31
|
+
|
|
32
|
+
/** JSDoc comment for this component */
|
|
33
|
+
description: z.string(),
|
|
34
|
+
|
|
35
|
+
/** File path of this component, relative to the repository root */
|
|
36
|
+
filePath: z.string(),
|
|
37
|
+
|
|
38
|
+
/** All code properties of this component */
|
|
39
|
+
props: DTOCodeComponentProperty.array(),
|
|
40
|
+
|
|
41
|
+
/** List of Storybook files that mention this component */
|
|
42
|
+
storybookFiles: DTOCodeComponentStorybookFile.array(),
|
|
43
|
+
|
|
44
|
+
/** List of doc files (markdown) that mention this component */
|
|
45
|
+
docFiles: DTOCodeComponentDocFile.array(),
|
|
46
|
+
|
|
47
|
+
createdAt: z.string(),
|
|
48
|
+
updatedAt: z.string(),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const DTOCodeComponentListResponse = z.object({
|
|
52
|
+
components: DTOCodeComponent.array(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/** Reference to a single code component by its package and component name */
|
|
56
|
+
export const DTOCodeComponentReference = z.object({
|
|
57
|
+
/** Name of the package (from package.json) the component is imported from */
|
|
58
|
+
packageName: z.string(),
|
|
59
|
+
|
|
60
|
+
/** Name of the component in code */
|
|
61
|
+
componentName: z.string(),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
/** Request body for fetching AI-generated markdown for a batch of code components */
|
|
65
|
+
export const DTOCodeComponentMarkdownQuery = z.object({
|
|
66
|
+
/** Components to fetch markdown for */
|
|
67
|
+
components: DTOCodeComponentReference.array().min(1).max(20),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
/** AI-generated markdown detail for a single code component */
|
|
71
|
+
export const DTOCodeComponentMarkdown = z.object({
|
|
72
|
+
/** Name of the component in code */
|
|
73
|
+
name: z.string(),
|
|
74
|
+
|
|
75
|
+
/** Stable key identifying the component within its package */
|
|
76
|
+
componentKey: z.string(),
|
|
77
|
+
|
|
78
|
+
/** Name of the package (from package.json) the component is imported from */
|
|
79
|
+
packageName: z.string(),
|
|
80
|
+
|
|
81
|
+
/** File path of the component, relative to the repository root */
|
|
82
|
+
componentPath: z.string(),
|
|
83
|
+
|
|
84
|
+
/** AI-generated markdown describing the component's API and usage */
|
|
85
|
+
markdown: z.string(),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export const DTOCodeComponentMarkdownResponse = z.object({
|
|
89
|
+
/** Components for which markdown was found */
|
|
90
|
+
components: DTOCodeComponentMarkdown.array(),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export type DTOCodeComponentProperty = z.infer<typeof DTOCodeComponentProperty>;
|
|
94
|
+
export type DTOCodeComponentStorybookFile = z.infer<typeof DTOCodeComponentStorybookFile>;
|
|
95
|
+
export type DTOCodeComponentDocFile = z.infer<typeof DTOCodeComponentDocFile>;
|
|
96
|
+
export type DTOCodeComponent = z.infer<typeof DTOCodeComponent>;
|
|
97
|
+
export type DTOCodeComponentListResponse = z.infer<typeof DTOCodeComponentListResponse>;
|
|
98
|
+
export type DTOCodeComponentReference = z.infer<typeof DTOCodeComponentReference>;
|
|
99
|
+
export type DTOCodeComponentMarkdownQuery = z.infer<typeof DTOCodeComponentMarkdownQuery>;
|
|
100
|
+
export type DTOCodeComponentMarkdown = z.infer<typeof DTOCodeComponentMarkdown>;
|
|
101
|
+
export type DTOCodeComponentMarkdownResponse = z.infer<typeof DTOCodeComponentMarkdownResponse>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOCodeHistoryRepositoryFilter = z.object({
|
|
4
|
+
repositoryName: z.string(),
|
|
5
|
+
usagePackageNames: z.array(z.string()).optional(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const DTOCodeHistoryQuery = z.object({
|
|
9
|
+
/** Filters components and usages by component package name (e.g. `@supernovaio/dm`) */
|
|
10
|
+
packageNames: z.array(z.string()).optional(),
|
|
11
|
+
/** Filters usages by component name (e.g. `Button`, `Icon`) */
|
|
12
|
+
componentNames: z.array(z.string()).optional(),
|
|
13
|
+
/**
|
|
14
|
+
* Filters usages by repository and optionally by usage package within that repository.
|
|
15
|
+
*
|
|
16
|
+
* - `{"repositoryName": "cloud"}` — all usages for this repository (no package filter)
|
|
17
|
+
* - `{"repositoryName": "cloud", "usagePackageNames": []}` — no usages for this repository
|
|
18
|
+
* - `{"repositoryName": "cloud", "usagePackageNames": ["@supernovaio/portal"]}` — only matching packages for this repository
|
|
19
|
+
*/
|
|
20
|
+
repositoryFilters: z.array(DTOCodeHistoryRepositoryFilter).optional(),
|
|
21
|
+
/** Start of the time range filter (inclusive, ISO 8601 string) */
|
|
22
|
+
timeFrameFrom: z.string().optional(),
|
|
23
|
+
/** End of the time range filter (inclusive, ISO 8601 string) */
|
|
24
|
+
timeFrameTo: z.string().optional(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const DTOCodeHistorySnapshot = z.object({
|
|
28
|
+
scanId: z.string(),
|
|
29
|
+
scanTimestamp: z.string(),
|
|
30
|
+
totalComponents: z.number(),
|
|
31
|
+
componentsWithUsage: z.string(),
|
|
32
|
+
componentsWithStorybook: z.string(),
|
|
33
|
+
totalUsages: z.string(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const DTOCodeHistoryResponse = z.object({
|
|
37
|
+
snapshots: DTOCodeHistorySnapshot.array(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export type DTOCodeHistoryRepositoryFilter = z.infer<typeof DTOCodeHistoryRepositoryFilter>;
|
|
41
|
+
export type DTOCodeHistoryQuery = z.infer<typeof DTOCodeHistoryQuery>;
|
|
42
|
+
export type DTOCodeHistorySnapshot = z.infer<typeof DTOCodeHistorySnapshot>;
|
|
43
|
+
export type DTOCodeHistoryResponse = z.infer<typeof DTOCodeHistoryResponse>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOCodeScanUploadedBy = z.object({
|
|
4
|
+
userId: z.string(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
avatar: z.string().optional(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const DTOCodeScanListItem = z.object({
|
|
10
|
+
scanId: z.string(),
|
|
11
|
+
scanTimestamp: z.string(),
|
|
12
|
+
packageNames: z.array(z.string()),
|
|
13
|
+
repositoryName: z.string(),
|
|
14
|
+
uploadedBy: DTOCodeScanUploadedBy.optional(),
|
|
15
|
+
cliVersion: z.string().optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const DTOCodeScanListResponse = z.object({
|
|
19
|
+
scans: z.array(DTOCodeScanListItem),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const DTOCodeScanDeleteResponse = z.object({
|
|
23
|
+
ok: z.literal(true),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type DTOCodeScanUploadedBy = z.infer<typeof DTOCodeScanUploadedBy>;
|
|
27
|
+
export type DTOCodeScanListItem = z.infer<typeof DTOCodeScanListItem>;
|
|
28
|
+
export type DTOCodeScanListResponse = z.infer<typeof DTOCodeScanListResponse>;
|
|
29
|
+
export type DTOCodeScanDeleteResponse = z.infer<typeof DTOCodeScanDeleteResponse>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTOCodeSnapshotScannerType = z.enum(["Components", "Usage"]);
|
|
4
|
+
|
|
5
|
+
export const DTOCodeSnapshotUploadInitResponse = z.object({
|
|
6
|
+
fileId: z.string(),
|
|
7
|
+
snapshotId: z.string(),
|
|
8
|
+
uploadUrl: z.string(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const DTOCodeSnapshotProcessingRunResponse = z.object({
|
|
12
|
+
processingRunId: z.string(),
|
|
13
|
+
snapshotIds: z.array(z.string()),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const DTOCodeSnapshotFinalizeResponse = z.object({
|
|
17
|
+
ok: z.literal(true),
|
|
18
|
+
processingRunId: z.string().nullable(),
|
|
19
|
+
snapshotId: z.string(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const DTOCodeSnapshotProcessingRunStatus = z.enum(["Processing", "Processed", "Failed"]);
|
|
23
|
+
|
|
24
|
+
export const DTOCodeSnapshotProcessingRunStatusItem = z.object({
|
|
25
|
+
createdAt: z.string(),
|
|
26
|
+
errorSummary: z.string().nullable(),
|
|
27
|
+
failedComponentsCount: z.number(),
|
|
28
|
+
finishedAt: z.string().nullable(),
|
|
29
|
+
processingRunId: z.string(),
|
|
30
|
+
snapshotIds: z.array(z.string()),
|
|
31
|
+
startedAt: z.string(),
|
|
32
|
+
status: DTOCodeSnapshotProcessingRunStatus,
|
|
33
|
+
updatedAt: z.string(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const DTOCodeSnapshotProcessingRunStatusResponse = z.object({
|
|
37
|
+
runs: z.array(DTOCodeSnapshotProcessingRunStatusItem),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export type DTOCodeSnapshotScannerType = z.infer<typeof DTOCodeSnapshotScannerType>;
|
|
41
|
+
export type DTOCodeSnapshotUploadInitResponse = z.infer<typeof DTOCodeSnapshotUploadInitResponse>;
|
|
42
|
+
export type DTOCodeSnapshotProcessingRunResponse = z.infer<typeof DTOCodeSnapshotProcessingRunResponse>;
|
|
43
|
+
export type DTOCodeSnapshotFinalizeResponse = z.infer<typeof DTOCodeSnapshotFinalizeResponse>;
|
|
44
|
+
export type DTOCodeSnapshotProcessingRunStatus = z.infer<typeof DTOCodeSnapshotProcessingRunStatus>;
|
|
45
|
+
export type DTOCodeSnapshotProcessingRunStatusItem = z.infer<typeof DTOCodeSnapshotProcessingRunStatusItem>;
|
|
46
|
+
export type DTOCodeSnapshotProcessingRunStatusResponse = z.infer<typeof DTOCodeSnapshotProcessingRunStatusResponse>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOObjectMeta } from "../aux";
|
|
3
|
+
|
|
4
|
+
//
|
|
5
|
+
// Read
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
export const DTODesignSystemComponent = z.object({
|
|
9
|
+
id: z.string(),
|
|
10
|
+
persistentId: z.string(),
|
|
11
|
+
designSystemVersionId: z.string(),
|
|
12
|
+
brandId: z.string(),
|
|
13
|
+
meta: DTOObjectMeta,
|
|
14
|
+
createdAt: z.coerce.date(),
|
|
15
|
+
updatedAt: z.coerce.date(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const DTODesignSystemComponentResponse = z.object({
|
|
19
|
+
designSystemComponent: DTODesignSystemComponent,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const DTODesignSystemComponentListResponse = z.object({
|
|
23
|
+
designSystemComponents: DTODesignSystemComponent.array(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type DTODesignSystemComponent = z.infer<typeof DTODesignSystemComponent>;
|
|
27
|
+
export type DTODesignSystemComponentResponse = z.infer<typeof DTODesignSystemComponentResponse>;
|
|
28
|
+
export type DTODesignSystemComponentListResponse = z.infer<typeof DTODesignSystemComponentListResponse>;
|
|
29
|
+
|
|
30
|
+
//
|
|
31
|
+
// Write
|
|
32
|
+
//
|
|
33
|
+
|
|
34
|
+
export const DTODesignSystemComponentCreateInput = z.object({
|
|
35
|
+
brandId: z.string(), // Persistent ID,
|
|
36
|
+
persistentId: z.string(),
|
|
37
|
+
meta: DTOObjectMeta,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export type DTODesignSystemComponentCreateInput = z.infer<typeof DTODesignSystemComponentCreateInput>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOUser } from "../users";
|
|
3
|
+
|
|
4
|
+
export const DTODesignSystemContactsResponse = z.object({
|
|
5
|
+
contacts: z.object({
|
|
6
|
+
workspace: z.array(DTOUser),
|
|
7
|
+
designSystem: z.array(DTOUser),
|
|
8
|
+
}),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type DTODesignSystemContactsResponse = z.infer<typeof DTODesignSystemContactsResponse>;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DataSourceAutoImportMode,
|
|
3
|
+
DataSourceFigmaScope,
|
|
4
|
+
DataSourceFigmaState,
|
|
5
|
+
DataSourceRemoteType,
|
|
6
|
+
DataSourceStats,
|
|
7
|
+
DataSourceUploadImportMetadata,
|
|
8
|
+
DataSourceUploadRemoteSource,
|
|
9
|
+
SourceImportStorybookSummary,
|
|
10
|
+
SourceImportSummary,
|
|
11
|
+
} from "@supernova-studio/model";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
|
|
14
|
+
//
|
|
15
|
+
// Read
|
|
16
|
+
//
|
|
17
|
+
|
|
18
|
+
export const DTODataSourceFigmaScope = DataSourceFigmaScope;
|
|
19
|
+
|
|
20
|
+
const DTODataSourceFigmaFileVersion = z.object({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
created_at: z.coerce.date(),
|
|
23
|
+
label: z.string(),
|
|
24
|
+
description: z.string(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const DTODataSourceFigmaCloud = z.object({
|
|
28
|
+
fileId: z.string(),
|
|
29
|
+
state: DataSourceFigmaState,
|
|
30
|
+
autoImportMode: DataSourceAutoImportMode,
|
|
31
|
+
fileThumbnailUrl: z.string().optional(),
|
|
32
|
+
lastImportResult: SourceImportSummary.nullish(),
|
|
33
|
+
lastImportedAt: z.coerce.date().nullish(),
|
|
34
|
+
lastImportedVersion: DTODataSourceFigmaFileVersion.nullish(),
|
|
35
|
+
lastUpdatesCheckedAt: z.date().nullish(),
|
|
36
|
+
ownerId: z.string(),
|
|
37
|
+
ownerUserName: z.string().optional(),
|
|
38
|
+
preferredCredentialId: z.string().optional(),
|
|
39
|
+
stats: DataSourceStats,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const DTODataSourceFigma = z.object({
|
|
43
|
+
id: z.string(),
|
|
44
|
+
type: z.literal(DataSourceRemoteType.Enum.Figma),
|
|
45
|
+
fileName: z.string(),
|
|
46
|
+
scope: DTODataSourceFigmaScope,
|
|
47
|
+
brandId: z.string(),
|
|
48
|
+
themeId: z.string().nullish(),
|
|
49
|
+
cloud: DTODataSourceFigmaCloud.nullish(),
|
|
50
|
+
sortOrder: z.number().optional(),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// TS is not yet implemented in new BE
|
|
54
|
+
export const DTODataSourceTokenStudio = z.object({
|
|
55
|
+
id: z.string(),
|
|
56
|
+
type: z.literal(DataSourceRemoteType.Enum.TokenStudio),
|
|
57
|
+
fileName: z.string(),
|
|
58
|
+
brandId: z.string(),
|
|
59
|
+
themeId: z.string().nullish(),
|
|
60
|
+
sortOrder: z.number().optional(),
|
|
61
|
+
tokenStudio: z.object({
|
|
62
|
+
settings: z.object({
|
|
63
|
+
dryRun: z.boolean(),
|
|
64
|
+
verbose: z.boolean(),
|
|
65
|
+
preciseCopy: z.boolean(),
|
|
66
|
+
}),
|
|
67
|
+
connectionName: z.string(),
|
|
68
|
+
lastImportedAt: z.coerce.date(),
|
|
69
|
+
lastImportedResults: z.array(
|
|
70
|
+
z.object({
|
|
71
|
+
mapping: z.object({
|
|
72
|
+
tokenSets: z.array(z.string()),
|
|
73
|
+
supernovaBrand: z.string(),
|
|
74
|
+
supernovaTheme: z.string().optional(),
|
|
75
|
+
}),
|
|
76
|
+
isFailed: z.boolean(),
|
|
77
|
+
tokensCreated: z.number(),
|
|
78
|
+
tokensDeleted: z.number(),
|
|
79
|
+
tokensUpdated: z.number(),
|
|
80
|
+
})
|
|
81
|
+
),
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const DTODataSourceFigmaVariablesPlugin = z.object({
|
|
86
|
+
id: z.string(),
|
|
87
|
+
type: z.literal(DataSourceRemoteType.Enum.FigmaVariablesPlugin),
|
|
88
|
+
fileName: z.string(),
|
|
89
|
+
brandId: z.string(),
|
|
90
|
+
sortOrder: z.number().optional(),
|
|
91
|
+
upload: z.object({
|
|
92
|
+
remoteId: z.string(),
|
|
93
|
+
remoteSourceType: DataSourceUploadRemoteSource,
|
|
94
|
+
lastImportedAt: z.coerce.date().optional(),
|
|
95
|
+
lastImportMetadata: DataSourceUploadImportMetadata.optional(),
|
|
96
|
+
isTokenTypeSplitEnabled: z.boolean(),
|
|
97
|
+
}),
|
|
98
|
+
figmaVariablesPlugin: z.object({
|
|
99
|
+
fileId: z.string(),
|
|
100
|
+
lastImportedAt: z.coerce.date().optional(),
|
|
101
|
+
lastImportMetadata: DataSourceUploadImportMetadata.optional(),
|
|
102
|
+
isTokenTypeSplitEnabled: z.boolean(),
|
|
103
|
+
isCollectionsMigrationCompleted: z.boolean().default(false),
|
|
104
|
+
isCollectionKeysMigrationCompleted: z.boolean().default(false),
|
|
105
|
+
}),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export const DTODataSourceStorybook = z.object({
|
|
109
|
+
id: z.string(),
|
|
110
|
+
type: z.literal(DataSourceRemoteType.Enum.Storybook),
|
|
111
|
+
fileName: z.string(),
|
|
112
|
+
brandId: z.string(),
|
|
113
|
+
sortOrder: z.number().optional(),
|
|
114
|
+
storybook: z.object({
|
|
115
|
+
indexUrl: z.string(),
|
|
116
|
+
userUrl: z.string(),
|
|
117
|
+
lastImportedAt: z.coerce.date().optional(),
|
|
118
|
+
lastImportedResult: SourceImportStorybookSummary.optional(),
|
|
119
|
+
lastImportedSuccessfully: z.coerce.date().optional(),
|
|
120
|
+
isFailed: z.boolean(),
|
|
121
|
+
storiesCount: z.number(),
|
|
122
|
+
docsCount: z.number(),
|
|
123
|
+
description: z.string().optional(),
|
|
124
|
+
isUsingVpn: z.boolean().optional(),
|
|
125
|
+
}),
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
export const DTODataSourcesStorybookResponse = z.object({
|
|
129
|
+
isFailed: z.boolean(),
|
|
130
|
+
storiesCount: z.number(),
|
|
131
|
+
docsCount: z.number(),
|
|
132
|
+
created: z.array(z.string()).optional(),
|
|
133
|
+
updated: z.array(z.string()).optional(),
|
|
134
|
+
deleted: z.array(z.string()).optional(),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export const DTODataSource = z.discriminatedUnion("type", [
|
|
138
|
+
DTODataSourceFigma,
|
|
139
|
+
DTODataSourceFigmaVariablesPlugin,
|
|
140
|
+
DTODataSourceTokenStudio,
|
|
141
|
+
DTODataSourceStorybook,
|
|
142
|
+
]);
|
|
143
|
+
|
|
144
|
+
export const DTODataSourcesListResponse = z.object({
|
|
145
|
+
sources: z.array(DTODataSource),
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
export const DTODataSourceResponse = z.object({
|
|
149
|
+
source: DTODataSource,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export type DTODataSourceFigma = z.infer<typeof DTODataSourceFigma>;
|
|
153
|
+
export type DTODataSourceTokenStudio = z.infer<typeof DTODataSourceTokenStudio>;
|
|
154
|
+
export type DTODataSourceFigmaVariablesPlugin = z.infer<typeof DTODataSourceFigmaVariablesPlugin>;
|
|
155
|
+
export type DTODataSourceStorybook = z.infer<typeof DTODataSourceStorybook>;
|
|
156
|
+
export type DTODataSource = z.infer<typeof DTODataSource>;
|
|
157
|
+
export type DTODataSourceResponse = z.infer<typeof DTODataSourceResponse>;
|
|
158
|
+
export type DTODataSourcesListResponse = z.infer<typeof DTODataSourcesListResponse>;
|
|
159
|
+
export type DTODataSourcesStorybookResponse = z.infer<typeof DTODataSourcesStorybookResponse>;
|
|
160
|
+
|
|
161
|
+
//
|
|
162
|
+
// Write
|
|
163
|
+
//
|
|
164
|
+
|
|
165
|
+
export const DTODataSourceFigmaCreatePayload = z.object({
|
|
166
|
+
brandPersistentId: z.string(),
|
|
167
|
+
figmaFileUrl: z.string(),
|
|
168
|
+
scope: DTODataSourceFigmaScope,
|
|
169
|
+
autoImportMode: DataSourceAutoImportMode,
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
export const DTODataSourceFigmaImportPayload = z.object({
|
|
173
|
+
sourceIds: z.array(z.string()),
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
export const DTODataSourceStorybookCreatePayload = z.object({
|
|
177
|
+
brandPersistentId: z.string(),
|
|
178
|
+
fileName: z.string().optional(),
|
|
179
|
+
userUrl: z.string(),
|
|
180
|
+
indexUrl: z.string(),
|
|
181
|
+
payload: z.unknown(),
|
|
182
|
+
type: z.literal(DataSourceRemoteType.Enum.Storybook),
|
|
183
|
+
description: z.string().optional(),
|
|
184
|
+
isUsingVpn: z.boolean().optional(),
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
export const DTOStorybookImportPayload = z.object({
|
|
188
|
+
sourceId: z.string(),
|
|
189
|
+
payload: z.unknown(),
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
export const DTOStorybookSourceUpdatePayload = z.object({
|
|
193
|
+
description: z.string().nullish().optional(),
|
|
194
|
+
isUsingVpn: z.boolean().optional(),
|
|
195
|
+
fileName: z.string().optional(),
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
export const DTOFigmaSourceUpdatePayload = z.object({
|
|
199
|
+
themeId: z.string().nullish(),
|
|
200
|
+
scope: DataSourceFigmaScope.optional(),
|
|
201
|
+
autoImportMode: DataSourceAutoImportMode.optional(),
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
export const DTOFVPMigrationsCollectionKeysPayload = z.object({
|
|
205
|
+
pluginFileId: z.string(),
|
|
206
|
+
collectionIdToKeyMap: z.record(z.string()),
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
export type DTODataSourceFigmaScope = z.infer<typeof DTODataSourceFigmaScope>;
|
|
210
|
+
export type DTODataSourceFigmaCreatePayload = z.infer<typeof DTODataSourceFigmaCreatePayload>;
|
|
211
|
+
export type DTODataSourceStorybookCreatePayload = z.infer<typeof DTODataSourceStorybookCreatePayload>;
|
|
212
|
+
export type DTODataSourceFigmaImportPayload = z.infer<typeof DTODataSourceFigmaImportPayload>;
|
|
213
|
+
export type DTOStorybookImportPayload = z.infer<typeof DTOStorybookImportPayload>;
|
|
214
|
+
export type DTOStorybookSourceUpdatePayload = z.infer<typeof DTOStorybookSourceUpdatePayload>;
|
|
215
|
+
export type DTOFigmaSourceUpdatePayload = z.infer<typeof DTOFigmaSourceUpdatePayload>;
|
|
216
|
+
export type DTOFVPMigrationsCollectionKeysPayload = z.infer<typeof DTOFVPMigrationsCollectionKeysPayload>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DesignSystem, DesignSystemAccessMode, ObjectMeta, WorkspaceRoleSchema } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOFileReference } from "../files";
|
|
4
|
+
import { DTODesignSystemMembersUpdatePayload } from "./members";
|
|
5
|
+
import { DTODesignSystemRole } from "./role";
|
|
6
|
+
|
|
7
|
+
//
|
|
8
|
+
// Read
|
|
9
|
+
//
|
|
10
|
+
|
|
11
|
+
export const DTODesignSystem = DesignSystem.omit({
|
|
12
|
+
name: true,
|
|
13
|
+
description: true,
|
|
14
|
+
docExporterId: true,
|
|
15
|
+
sharedDraftId: true,
|
|
16
|
+
iconFilePath: true,
|
|
17
|
+
}).extend({
|
|
18
|
+
meta: ObjectMeta,
|
|
19
|
+
docExporterId: z.string(),
|
|
20
|
+
sources: z.array(z.any()),
|
|
21
|
+
isPublic: z.literal(true),
|
|
22
|
+
sharedDraftId: z.string(),
|
|
23
|
+
|
|
24
|
+
icon: DTOFileReference.optional(),
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Whether or not user who is requesting the design system
|
|
28
|
+
* has access to the design system's contents.
|
|
29
|
+
*/
|
|
30
|
+
isAvailableToUser: z.boolean(),
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated
|
|
34
|
+
*/
|
|
35
|
+
role: WorkspaceRoleSchema.optional(),
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* User's role within the design system that can come either from
|
|
39
|
+
* the design system or workspace.
|
|
40
|
+
*/
|
|
41
|
+
effectiveRole: DTODesignSystemRole.optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const DTODesignSystemResponse = z.object({
|
|
45
|
+
designSystem: DTODesignSystem,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const DTODesignSystemsListResponse = z.object({
|
|
49
|
+
designSystems: DTODesignSystem.array(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export type DTODesignSystem = z.infer<typeof DTODesignSystem>;
|
|
53
|
+
export type DTODesignSystemResponse = z.infer<typeof DTODesignSystemResponse>;
|
|
54
|
+
export type DTODesignSystemsListResponse = z.infer<typeof DTODesignSystemsListResponse>;
|
|
55
|
+
|
|
56
|
+
//
|
|
57
|
+
// Write
|
|
58
|
+
//
|
|
59
|
+
|
|
60
|
+
export const DTODesignSystemCreateInput = z.object({
|
|
61
|
+
workspaceId: z.string(),
|
|
62
|
+
meta: ObjectMeta.optional(),
|
|
63
|
+
name: z.string().min(2).max(64).optional(),
|
|
64
|
+
description: z.string().max(1024).optional(),
|
|
65
|
+
accessMode: DesignSystemAccessMode.optional(),
|
|
66
|
+
iconFileId: z.string().optional(),
|
|
67
|
+
|
|
68
|
+
invites: DTODesignSystemMembersUpdatePayload.pick({
|
|
69
|
+
usersToInvite: true,
|
|
70
|
+
invitesToInvite: true,
|
|
71
|
+
emailsToInvite: true,
|
|
72
|
+
}).optional(),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export type DTODesignSystemCreateInput = z.infer<typeof DTODesignSystemCreateInput>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTODocumentationSearchIndexResponse = z.object({
|
|
4
|
+
indexedPages: z.number(),
|
|
5
|
+
totalPages: z.number(),
|
|
6
|
+
errors: z.number(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const DTODocumentationSearchQuery = z.object({
|
|
10
|
+
query: z.string().min(1).max(1000),
|
|
11
|
+
mode: z.enum(["full-text", "vector", "hybrid"]).optional().default("hybrid"),
|
|
12
|
+
limit: z.number().int().min(1).max(50).optional().default(10),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const DTODocumentationSearchResult = z.object({
|
|
16
|
+
pageId: z.string(),
|
|
17
|
+
title: z.string(),
|
|
18
|
+
excerpt: z.string(),
|
|
19
|
+
vectorScore: z.number().nullable(),
|
|
20
|
+
fullTextScore: z.number().nullable(),
|
|
21
|
+
reciprocalRankFusionScore: z.number(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const DTODocumentationSearchResponse = z.object({
|
|
25
|
+
results: z.array(DTODocumentationSearchResult),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type DTODocumentationSearchIndexResponse = z.infer<typeof DTODocumentationSearchIndexResponse>;
|
|
29
|
+
export type DTODocumentationSearchQuery = z.infer<typeof DTODocumentationSearchQuery>;
|
|
30
|
+
export type DTODocumentationSearchResult = z.infer<typeof DTODocumentationSearchResult>;
|
|
31
|
+
export type DTODocumentationSearchResponse = z.infer<typeof DTODocumentationSearchResponse>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const DTODiffCountBase = z.object({
|
|
4
|
+
created: z.number(),
|
|
5
|
+
updated: z.number(),
|
|
6
|
+
deleted: z.number(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const DTODesignElementsDataDiffResponse = z.object({
|
|
10
|
+
tokens: DTODiffCountBase,
|
|
11
|
+
assets: DTODiffCountBase,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type DTODesignElementsDataDiffResponse = z.infer<typeof DTODesignElementsDataDiffResponse>;
|