@supernova-studio/client 1.96.5 → 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 +101428 -143199
- package/dist/index.d.ts +101428 -143199
- package/dist/index.js +489 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5607 -5217
- 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,14 @@
|
|
|
1
|
+
import { DTODocumentationAnalyticsRequest, DTODocumentationPageAnalyticsResponse } from "../../dto";
|
|
2
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
3
|
+
|
|
4
|
+
export class DesignSystemAnalyticsEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
get(designSystemId: string, versionId: string, body: DTODocumentationAnalyticsRequest) {
|
|
8
|
+
return this.requestExecutor.json(
|
|
9
|
+
`/design-systems/${designSystemId}/versions/${versionId}/documentation/analytics`,
|
|
10
|
+
DTODocumentationPageAnalyticsResponse,
|
|
11
|
+
{ method: "POST", body }
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DTOBffImportRequestBody, DTOImportJobResponse } from "../../dto";
|
|
2
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
3
|
+
|
|
4
|
+
export class DesignSystemBffEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
import(dsId: string, payload: DTOBffImportRequestBody) {
|
|
8
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/bff/import`, DTOImportJobResponse, {
|
|
9
|
+
method: "POST",
|
|
10
|
+
body: payload,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOCodeSnapshotFinalizeResponse,
|
|
3
|
+
DTOCodeSnapshotProcessingRunResponse,
|
|
4
|
+
DTOCodeSnapshotProcessingRunStatusResponse,
|
|
5
|
+
DTOCodeSnapshotUploadInitResponse,
|
|
6
|
+
} from "../../dto";
|
|
7
|
+
import {
|
|
8
|
+
DTOCodeSnapshotFinalizePayload,
|
|
9
|
+
DTOCodeSnapshotStartProcessingRunPayload,
|
|
10
|
+
DTOCodeSnapshotUploadInitPayload,
|
|
11
|
+
} from "../../payloads";
|
|
12
|
+
import { RequestExecutor } from "../../transport";
|
|
13
|
+
|
|
14
|
+
export class DesignSystemCodeSnapshotsEndpoint {
|
|
15
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
16
|
+
|
|
17
|
+
uploadInit(body: DTOCodeSnapshotUploadInitPayload) {
|
|
18
|
+
return this.requestExecutor.json(`/code-snapshots/upload`, DTOCodeSnapshotUploadInitResponse, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
body,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
finalize(snapshotId: string, body?: DTOCodeSnapshotFinalizePayload) {
|
|
25
|
+
return this.requestExecutor.json(`/code-snapshots/${snapshotId}/finalize`, DTOCodeSnapshotFinalizeResponse, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
body,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
startProcessingRun(body: DTOCodeSnapshotStartProcessingRunPayload) {
|
|
32
|
+
return this.requestExecutor.json(`/code-snapshots/process-run`, DTOCodeSnapshotProcessingRunResponse, {
|
|
33
|
+
method: "POST",
|
|
34
|
+
body,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getProcessingRunStatus(designSystemId: string) {
|
|
39
|
+
return this.requestExecutor.json(
|
|
40
|
+
`/code-snapshots/process-status/${encodeURIComponent(designSystemId)}`,
|
|
41
|
+
DTOCodeSnapshotProcessingRunStatusResponse,
|
|
42
|
+
{
|
|
43
|
+
method: "GET",
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DTODesignSystemContactsResponse } from "../../dto";
|
|
2
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
3
|
+
|
|
4
|
+
export class DesignSystemContactsEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
list(dsId: string) {
|
|
8
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/contacts`, DTODesignSystemContactsResponse, {
|
|
9
|
+
method: "GET",
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
DTODesignSystemCreateInput,
|
|
4
|
+
DTODesignSystemResponse,
|
|
5
|
+
DTODesignSystemsListResponse,
|
|
6
|
+
DTOUserDesignSystemsResponse,
|
|
7
|
+
} from "../../dto";
|
|
8
|
+
import {
|
|
9
|
+
DTODesignSystemUpdateAccessModeInput,
|
|
10
|
+
DTODesignSystemUpdateInput,
|
|
11
|
+
DTODesignSystemUpdateSwitcherInput,
|
|
12
|
+
} from "../../payloads";
|
|
13
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
14
|
+
import { DesignSystemAnalyticsEndpoint } from "./analytics";
|
|
15
|
+
import { DesignSystemBffEndpoint } from "./bff";
|
|
16
|
+
import { DesignSystemCodeSnapshotsEndpoint } from "./code-snapshots";
|
|
17
|
+
import { DesignSystemContactsEndpoint } from "./contact";
|
|
18
|
+
import { FigmaNodeStructuresEndpoint } from "./figma-node-structures";
|
|
19
|
+
import { DesignSystemMembersEndpoint } from "./members";
|
|
20
|
+
import { DesignSystemPageRedirectsEndpoint } from "./redirects";
|
|
21
|
+
import { DesignSystemSourcesEndpoint } from "./sources";
|
|
22
|
+
import { StorybookEntriesEndpoint } from "./storybook";
|
|
23
|
+
import { DesignSystemVersionsEndpoint } from "./versions/versions";
|
|
24
|
+
|
|
25
|
+
export class DesignSystemsEndpoint {
|
|
26
|
+
readonly members: DesignSystemMembersEndpoint;
|
|
27
|
+
readonly versions: DesignSystemVersionsEndpoint;
|
|
28
|
+
readonly bff: DesignSystemBffEndpoint;
|
|
29
|
+
readonly codeSnapshots: DesignSystemCodeSnapshotsEndpoint;
|
|
30
|
+
readonly sources: DesignSystemSourcesEndpoint;
|
|
31
|
+
readonly storybook: StorybookEntriesEndpoint;
|
|
32
|
+
readonly contacts: DesignSystemContactsEndpoint;
|
|
33
|
+
readonly redirects: DesignSystemPageRedirectsEndpoint;
|
|
34
|
+
readonly figmaNodeStructures: FigmaNodeStructuresEndpoint;
|
|
35
|
+
readonly analytics: DesignSystemAnalyticsEndpoint;
|
|
36
|
+
|
|
37
|
+
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
38
|
+
this.members = new DesignSystemMembersEndpoint(requestExecutor);
|
|
39
|
+
this.versions = new DesignSystemVersionsEndpoint(requestExecutor);
|
|
40
|
+
this.bff = new DesignSystemBffEndpoint(requestExecutor);
|
|
41
|
+
this.codeSnapshots = new DesignSystemCodeSnapshotsEndpoint(requestExecutor);
|
|
42
|
+
this.sources = new DesignSystemSourcesEndpoint(requestExecutor);
|
|
43
|
+
this.storybook = new StorybookEntriesEndpoint(requestExecutor);
|
|
44
|
+
this.contacts = new DesignSystemContactsEndpoint(requestExecutor);
|
|
45
|
+
this.redirects = new DesignSystemPageRedirectsEndpoint(requestExecutor);
|
|
46
|
+
this.figmaNodeStructures = new FigmaNodeStructuresEndpoint(requestExecutor);
|
|
47
|
+
this.analytics = new DesignSystemAnalyticsEndpoint(requestExecutor);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
create(body: DTODesignSystemCreateInput) {
|
|
51
|
+
return this.requestExecutor.json("/design-systems", DTODesignSystemResponse, { method: "POST", body });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
list(wsId: string) {
|
|
55
|
+
return this.requestExecutor.json(`/workspaces/${wsId}/design-systems`, DTODesignSystemsListResponse);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
listUserDesignSystems() {
|
|
59
|
+
return this.requestExecutor.json("/design-systems", DTOUserDesignSystemsResponse);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get(dsId: string) {
|
|
63
|
+
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
delete(dsId: string) {
|
|
67
|
+
return this.requestExecutor.json(`/design-systems/${dsId}`, z.any(), { method: "DELETE" });
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
update(dsId: string, body: DTODesignSystemUpdateInput) {
|
|
71
|
+
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {
|
|
72
|
+
method: "PUT",
|
|
73
|
+
body,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
updateSwitcher(dsId: string, body: DTODesignSystemUpdateSwitcherInput) {
|
|
78
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/switcher`, DTODesignSystemResponse, {
|
|
79
|
+
method: "PUT",
|
|
80
|
+
body,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
updateAccessMode(dsId: string, body: DTODesignSystemUpdateAccessModeInput) {
|
|
85
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/access-mode`, DTODesignSystemResponse, {
|
|
86
|
+
method: "PUT",
|
|
87
|
+
body,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DTOFigmaNodeStructureDetailResponse, DTOFigmaNodeStructureListResponse } from "../../dto";
|
|
2
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
3
|
+
|
|
4
|
+
export class FigmaNodeStructuresEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
list(dsId: string) {
|
|
8
|
+
return this.requestExecutor.json(
|
|
9
|
+
`/design-systems/${dsId}/figma-node-structures`,
|
|
10
|
+
DTOFigmaNodeStructureListResponse
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
get(dsId: string, structureId: string) {
|
|
15
|
+
return this.requestExecutor.json(
|
|
16
|
+
`/design-systems/${dsId}/figma-node-structures/${structureId}`,
|
|
17
|
+
DTOFigmaNodeStructureDetailResponse
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./versions";
|
|
2
|
+
export * from "./analytics";
|
|
3
|
+
export * from "./bff";
|
|
4
|
+
export * from "./code-snapshots";
|
|
5
|
+
export * from "./contact";
|
|
6
|
+
export * from "./design-systems";
|
|
7
|
+
export * from "./figma-node-structures";
|
|
8
|
+
export * from "./members";
|
|
9
|
+
export * from "./redirects";
|
|
10
|
+
export * from "./sources";
|
|
11
|
+
export * from "./storybook";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTODesignSystemMemberListResponse,
|
|
3
|
+
DTODesignSystemMembersUpdatePayload,
|
|
4
|
+
DTODesignSystemMembersUpdateResponse,
|
|
5
|
+
DTOUserGetResponse,
|
|
6
|
+
} from "../../dto";
|
|
7
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
8
|
+
|
|
9
|
+
export class DesignSystemMembersEndpoint {
|
|
10
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
11
|
+
|
|
12
|
+
list(dsId: string) {
|
|
13
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMemberListResponse, {
|
|
14
|
+
method: "GET",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
update(dsId: string, body: DTODesignSystemMembersUpdatePayload) {
|
|
19
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/members`, DTODesignSystemMembersUpdateResponse, {
|
|
20
|
+
method: "POST",
|
|
21
|
+
body,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOPageRedirectDeleteResponse,
|
|
3
|
+
DTOPageRedirectListResponse,
|
|
4
|
+
DTOPageRedirectResponse,
|
|
5
|
+
DTOPageRedirectCreateBody,
|
|
6
|
+
DTOPageRedirectUpdateBody,
|
|
7
|
+
} from "../../dto/design-systems/redirects";
|
|
8
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
9
|
+
|
|
10
|
+
export class DesignSystemPageRedirectsEndpoint {
|
|
11
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
12
|
+
|
|
13
|
+
create(dsId: string, body: DTOPageRedirectCreateBody) {
|
|
14
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/documentation/redirects`, DTOPageRedirectResponse, {
|
|
15
|
+
body,
|
|
16
|
+
method: "POST",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
list(dsId: string) {
|
|
21
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/documentation/redirects`, DTOPageRedirectListResponse, {
|
|
22
|
+
method: "GET",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
update(dsId: string, redirectId: string, body: DTOPageRedirectUpdateBody) {
|
|
27
|
+
return this.requestExecutor.json(
|
|
28
|
+
`/design-systems/${dsId}/documentation/redirects/${redirectId}`,
|
|
29
|
+
DTOPageRedirectResponse,
|
|
30
|
+
{
|
|
31
|
+
body,
|
|
32
|
+
method: "PUT",
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
delete(dsId: string, redirectId: string) {
|
|
38
|
+
return this.requestExecutor.json(
|
|
39
|
+
`/design-systems/${dsId}/documentation/redirects/${redirectId}`,
|
|
40
|
+
DTOPageRedirectDeleteResponse,
|
|
41
|
+
{
|
|
42
|
+
method: "DELETE",
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
DTODataSourceFigmaCreatePayload,
|
|
4
|
+
DTODataSourceFigmaImportPayload,
|
|
5
|
+
DTODataSourceResponse,
|
|
6
|
+
DTODataSourcesListResponse,
|
|
7
|
+
DTODataSourcesStorybookResponse,
|
|
8
|
+
DTODataSourceStorybookCreatePayload,
|
|
9
|
+
DTOFigmaSourceUpdatePayload,
|
|
10
|
+
DTOImportJobResponse,
|
|
11
|
+
DTOStorybookImportPayload,
|
|
12
|
+
DTOStorybookSourceUpdatePayload,
|
|
13
|
+
} from "../../dto";
|
|
14
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
15
|
+
|
|
16
|
+
export class DesignSystemSourcesEndpoint {
|
|
17
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
18
|
+
|
|
19
|
+
create(dsId: string, payload: DTODataSourceFigmaCreatePayload | DTODataSourceStorybookCreatePayload) {
|
|
20
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourceResponse, {
|
|
21
|
+
method: "POST",
|
|
22
|
+
body: payload,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
list(dsId: string) {
|
|
27
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get(dsId: string, sourceId: string) {
|
|
31
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
delete(dsId: string, sourceId: string) {
|
|
35
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z.any(), { method: "DELETE" });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
updateFigmaSource(dsId: string, sourceId: string, payload: DTOFigmaSourceUpdatePayload) {
|
|
39
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse, {
|
|
40
|
+
method: "PUT",
|
|
41
|
+
body: payload,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
updateStorybookSource(dsId: string, sourceId: string, payload: DTOStorybookSourceUpdatePayload) {
|
|
46
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse, {
|
|
47
|
+
method: "PUT",
|
|
48
|
+
body: payload,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
figmaImport(dsId: string, payload: DTODataSourceFigmaImportPayload) {
|
|
53
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/cloud-import`, DTOImportJobResponse, {
|
|
54
|
+
method: "POST",
|
|
55
|
+
body: payload,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
storybookImport(dsId: string, payload: DTOStorybookImportPayload) {
|
|
60
|
+
return this.requestExecutor.json(
|
|
61
|
+
`/design-systems/${dsId}/versions/head/storybook-import`,
|
|
62
|
+
DTODataSourcesStorybookResponse,
|
|
63
|
+
{
|
|
64
|
+
method: "POST",
|
|
65
|
+
body: payload,
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
updateStorybookImport(dsId: string, versionId: string, payload: DTOStorybookImportPayload) {
|
|
71
|
+
return this.requestExecutor.json(
|
|
72
|
+
`/design-systems/${dsId}/versions/${versionId}/storybook-import`,
|
|
73
|
+
DTODataSourcesStorybookResponse,
|
|
74
|
+
{
|
|
75
|
+
method: "POST",
|
|
76
|
+
body: payload,
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { pickDefined } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOStorybookEntryListResponse, DTOStorybookEntryQuery, DTOStorybookEntryReplaceAction } from "../../dto";
|
|
4
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
5
|
+
|
|
6
|
+
export class StorybookEntriesEndpoint {
|
|
7
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
8
|
+
|
|
9
|
+
list(dsId: string, query: DTOStorybookEntryQuery = {}) {
|
|
10
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook`, DTOStorybookEntryListResponse, {
|
|
11
|
+
query: new URLSearchParams(pickDefined(query)),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
replace(dsId: string, entryId: string) {
|
|
16
|
+
return this.requestExecutor.json(
|
|
17
|
+
`/design-systems/${dsId}/versions/head/storybook/${entryId}`,
|
|
18
|
+
DTOStorybookEntryReplaceAction,
|
|
19
|
+
{ method: "PUT" }
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
delete(dsId: string, entryId: string) {
|
|
24
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook/${entryId}`, z.any(), {
|
|
25
|
+
method: "DELETE",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOBrandCreatePayload, DTOBrandGetResponse, DTOBrandsListResponse, DTOBrandUpdatePayload } from "../../../dto";
|
|
3
|
+
import { RequestExecutor } from "../../../transport/request-executor";
|
|
4
|
+
|
|
5
|
+
export class BrandsEndpoint {
|
|
6
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
|
+
|
|
8
|
+
get(designSystemId: string, versionId: string, brandId: string) {
|
|
9
|
+
return this.requestExecutor.json(
|
|
10
|
+
`/design-systems/${designSystemId}/versions/${versionId}/brands/${brandId}`,
|
|
11
|
+
DTOBrandGetResponse
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
list(designSystemId: string, versionId: string) {
|
|
16
|
+
return this.requestExecutor.json(
|
|
17
|
+
`/design-systems/${designSystemId}/versions/${versionId}/brands`,
|
|
18
|
+
DTOBrandsListResponse
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
create(designSystemId: string, versionId: string, body: DTOBrandCreatePayload) {
|
|
23
|
+
return this.requestExecutor.json(
|
|
24
|
+
`/design-systems/${designSystemId}/versions/${versionId}/brands`,
|
|
25
|
+
DTOBrandGetResponse,
|
|
26
|
+
{
|
|
27
|
+
method: "POST",
|
|
28
|
+
body,
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
update(dsId: string, vId: string, brandId: string, body: DTOBrandUpdatePayload) {
|
|
34
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, DTOBrandGetResponse, {
|
|
35
|
+
method: "PUT",
|
|
36
|
+
body,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
delete(dsId: string, vId: string, brandId: string) {
|
|
41
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z.any(), {
|
|
42
|
+
method: "DELETE",
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTODocumentationConfigurationResponse,
|
|
3
|
+
DTODocumentationContentResponse,
|
|
4
|
+
DTODocumentationMinimalPageListResponse,
|
|
5
|
+
DTODocumentationPageContentGetResponse,
|
|
6
|
+
DTODocumentationPageRoomResponse,
|
|
7
|
+
DTODocumentationSearchIndexResponse,
|
|
8
|
+
DTODocumentationSearchQuery,
|
|
9
|
+
DTODocumentationSearchResponse,
|
|
10
|
+
DTODocumentationStructure,
|
|
11
|
+
DTOPublishDocumentationRequest,
|
|
12
|
+
DTOPublishDocumentationResponse,
|
|
13
|
+
} from "../../../dto";
|
|
14
|
+
import { DTOGetBlockDefinitionsOutput } from "../../../payloads";
|
|
15
|
+
import { RequestExecutor } from "../../../transport/request-executor";
|
|
16
|
+
|
|
17
|
+
export class DocumentationEndpoint {
|
|
18
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
19
|
+
|
|
20
|
+
async getConfiguration(designSystemId: string, versionId: string) {
|
|
21
|
+
return await this.requestExecutor.json(
|
|
22
|
+
`/design-systems/${designSystemId}/versions/${versionId}/documentation`,
|
|
23
|
+
DTODocumentationConfigurationResponse
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async getStructure(designSystemId: string, versionId: string) {
|
|
28
|
+
return await this.requestExecutor.json(
|
|
29
|
+
`/design-systems/${designSystemId}/versions/${versionId}/documentation/structure`,
|
|
30
|
+
DTODocumentationStructure
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async getDocStructure(dsId: string, vId: string) {
|
|
35
|
+
return await this.requestExecutor.json(
|
|
36
|
+
`/design-systems/${dsId}/versions/${vId}/documentation/structure`,
|
|
37
|
+
DTODocumentationStructure
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async getPageRoom(dsId: string, vId: string, pageId: string) {
|
|
42
|
+
return await this.requestExecutor.json(
|
|
43
|
+
`/design-systems/${dsId}/versions/${vId}/documentation/pages/${pageId}/room`,
|
|
44
|
+
DTODocumentationPageRoomResponse
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async getBlockDefinitions(dsId: string, vId: string) {
|
|
49
|
+
return await this.requestExecutor.json(
|
|
50
|
+
`/design-systems/${dsId}/versions/${vId}/documentation/block-definitions`,
|
|
51
|
+
DTOGetBlockDefinitionsOutput
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async publish(dsId: string, vId: string, body: DTOPublishDocumentationRequest) {
|
|
56
|
+
return await this.requestExecutor.json(
|
|
57
|
+
`/design-systems/${dsId}/versions/${vId}/documentation/publish`,
|
|
58
|
+
DTOPublishDocumentationResponse,
|
|
59
|
+
{
|
|
60
|
+
method: "POST",
|
|
61
|
+
body,
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
documentationPageContent(dsId: string, versionId: string, pageId: string) {
|
|
67
|
+
return this.requestExecutor.json(
|
|
68
|
+
`/design-systems/${dsId}/versions/${versionId}/documentation/pages/${pageId}/content`,
|
|
69
|
+
DTODocumentationPageContentGetResponse
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
list(dsId: string, versionId: string) {
|
|
74
|
+
return this.requestExecutor.json(
|
|
75
|
+
`/design-systems/${dsId}/versions/${versionId}/documentation/pages`,
|
|
76
|
+
DTODocumentationMinimalPageListResponse
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
getContent(dsId: string, versionId: string, pageIds: string[]) {
|
|
81
|
+
return this.requestExecutor.json(
|
|
82
|
+
`/design-systems/${dsId}/versions/${versionId}/documentation/content`,
|
|
83
|
+
DTODocumentationContentResponse,
|
|
84
|
+
{
|
|
85
|
+
query: new URLSearchParams({
|
|
86
|
+
pageIds: pageIds.join(","),
|
|
87
|
+
}),
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
buildSearchIndex(dsId: string) {
|
|
93
|
+
return this.requestExecutor.json(
|
|
94
|
+
`/design-systems/${dsId}/documentation-search/index`,
|
|
95
|
+
DTODocumentationSearchIndexResponse,
|
|
96
|
+
{ method: "POST" }
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
search(dsId: string, body: DTODocumentationSearchQuery) {
|
|
101
|
+
return this.requestExecutor.json(
|
|
102
|
+
`/design-systems/${dsId}/documentation-search/query`,
|
|
103
|
+
DTODocumentationSearchResponse,
|
|
104
|
+
{ method: "POST", body }
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { pickDefined } from "@supernova-studio/model";
|
|
2
|
+
import {
|
|
3
|
+
DTODesignSystemComponentCreateInput,
|
|
4
|
+
DTODesignSystemComponentListResponse,
|
|
5
|
+
DTODesignSystemComponentResponse,
|
|
6
|
+
} from "../../../dto/design-systems/component";
|
|
7
|
+
import { RequestExecutor } from "../../../transport/request-executor";
|
|
8
|
+
|
|
9
|
+
export class DesignSystemComponentEndpoint {
|
|
10
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
11
|
+
|
|
12
|
+
async list(dsId: string, vId: string, brandId?: string) {
|
|
13
|
+
return this.requestExecutor.json(
|
|
14
|
+
`/design-systems/${dsId}/versions/${vId}/design-system-components`,
|
|
15
|
+
DTODesignSystemComponentListResponse,
|
|
16
|
+
{ query: new URLSearchParams(pickDefined({ brandId })) }
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async create(dsId: string, vId: string, body: DTODesignSystemComponentCreateInput) {
|
|
21
|
+
return this.requestExecutor.json(
|
|
22
|
+
`/design-systems/${dsId}/versions/${vId}/design-system-components`,
|
|
23
|
+
DTODesignSystemComponentResponse,
|
|
24
|
+
{
|
|
25
|
+
body,
|
|
26
|
+
method: "POST",
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOCreateDocumentationGroupInput,
|
|
3
|
+
DTOCreateDocumentationPageInputV2,
|
|
4
|
+
DTOCreateDocumentationTabInput,
|
|
5
|
+
DTOElementActionInput,
|
|
6
|
+
DTOElementActionOutput,
|
|
7
|
+
DTOElementPropertyValueUpsertPaylod,
|
|
8
|
+
DTOFigmaNodeRenderInput,
|
|
9
|
+
DTOMoveDocumentationGroupInput,
|
|
10
|
+
DTOUpdateDocumentationGroupInput,
|
|
11
|
+
DTOUpdateDocumentationPageDocumentInputV2,
|
|
12
|
+
DTOUpdateDocumentationPageInputV2,
|
|
13
|
+
} from "../../../dto";
|
|
14
|
+
import { RequestExecutor } from "../../../transport/request-executor";
|
|
15
|
+
|
|
16
|
+
export class ElementsActionEndpoint {
|
|
17
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
18
|
+
|
|
19
|
+
async createDocPage(dsId: string, vId: string, input: DTOCreateDocumentationPageInputV2) {
|
|
20
|
+
return this.action(dsId, vId, { type: "DocumentationPageCreate", input });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async createDocGroup(dsId: string, vId: string, input: DTOCreateDocumentationGroupInput) {
|
|
24
|
+
return this.action(dsId, vId, { type: "DocumentationGroupCreate", input });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async moveDocGroup(dsId: string, vId: string, input: DTOMoveDocumentationGroupInput) {
|
|
28
|
+
return this.action(dsId, vId, { type: "DocumentationGroupMove", input });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async updateDocPage(dsId: string, vId: string, input: DTOUpdateDocumentationPageInputV2) {
|
|
32
|
+
return this.action(dsId, vId, { type: "DocumentationPageUpdate", input });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async updateDocPageDocument(dsId: string, vId: string, input: DTOUpdateDocumentationPageDocumentInputV2) {
|
|
36
|
+
return this.action(dsId, vId, { type: "DocumentationPageUpdateDocument", input });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async updateDocGroup(dsId: string, vId: string, input: DTOUpdateDocumentationGroupInput) {
|
|
40
|
+
return this.action(dsId, vId, { type: "DocumentationGroupUpdate", input });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async createDocTab(dsId: string, vId: string, input: DTOCreateDocumentationTabInput) {
|
|
44
|
+
return this.action(dsId, vId, { type: "DocumentationTabCreate", input });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async renderNodesAsync(dsId: string, vId: string, nodes: DTOFigmaNodeRenderInput[]) {
|
|
48
|
+
return this.action(dsId, vId, { type: "FigmaNodeRenderAsync", nodes });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async bulkEditPropertyValues(dsId: string, vId: string, values: DTOElementPropertyValueUpsertPaylod[]) {
|
|
52
|
+
return this.action(dsId, vId, { type: "ElementPropertyValuesEdit", values });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private async action(dsId: string, vId: string, input: DTOElementActionInput) {
|
|
56
|
+
return this.requestExecutor.json(
|
|
57
|
+
`/design-systems/${dsId}/versions/${vId}/elements-action`,
|
|
58
|
+
DTOElementActionOutput,
|
|
59
|
+
{
|
|
60
|
+
body: input,
|
|
61
|
+
method: "POST",
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OmitStrict } from "@supernova-studio/model";
|
|
2
|
+
import { serializeQuery } from "../../../../utils";
|
|
3
|
+
import { DTOElementsGetOutput, DTOElementsGetOutputV2, DTOElementsGetQueryParsed } from "../../../dto";
|
|
4
|
+
import { RequestExecutor } from "../../../transport/request-executor";
|
|
5
|
+
|
|
6
|
+
type GetElementsQuery = OmitStrict<DTOElementsGetQueryParsed, "responseVersion">;
|
|
7
|
+
|
|
8
|
+
export class ElementsEndpoint {
|
|
9
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
10
|
+
|
|
11
|
+
getElementsV1(dsId: string, vId: string, query: GetElementsQuery) {
|
|
12
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/elements`, DTOElementsGetOutput, {
|
|
13
|
+
query: serializeQuery(query),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getElementsV2(dsId: string, vId: string, query: GetElementsQuery) {
|
|
18
|
+
const fullQuery: DTOElementsGetQueryParsed = {
|
|
19
|
+
...query,
|
|
20
|
+
responseVersion: 2,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/elements`, DTOElementsGetOutputV2, {
|
|
24
|
+
query: serializeQuery(fullQuery),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|