@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,21 @@
|
|
|
1
|
+
import { DTOMCPStreamResponse, DTOMCPStreamUpdateInput } from "../../dto";
|
|
2
|
+
import { RequestExecutor } from "../../transport";
|
|
3
|
+
|
|
4
|
+
export class MCPStreamsEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
getById(streamId: string) {
|
|
8
|
+
return this.requestExecutor.json(`/mcp/streams/${streamId}`, DTOMCPStreamResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getForUser() {
|
|
12
|
+
return this.requestExecutor.json(`/mcp/streams/user`, DTOMCPStreamResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
updateForUser(body: DTOMCPStreamUpdateInput) {
|
|
16
|
+
return this.requestExecutor.json(`/mcp/streams/user`, DTOMCPStreamResponse, {
|
|
17
|
+
method: "PUT",
|
|
18
|
+
body,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOSandboxTemplateBuildCreateInput,
|
|
3
|
+
DTOSandboxTemplateBuildCreateResponse,
|
|
4
|
+
DTOSandboxTemplateBuildFinalizeResponse,
|
|
5
|
+
DTOSandboxTemplateBuildResponse,
|
|
6
|
+
DTOSandboxTemplateBuildTriggerInput,
|
|
7
|
+
} from "../../dto";
|
|
8
|
+
import { RequestExecutor } from "../../transport";
|
|
9
|
+
|
|
10
|
+
export class SandboxTemplateBuildsEndpoint {
|
|
11
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
12
|
+
|
|
13
|
+
start(body: DTOSandboxTemplateBuildCreateInput) {
|
|
14
|
+
return this.requestExecutor.json(`/sandboxes/builds`, DTOSandboxTemplateBuildCreateResponse, {
|
|
15
|
+
body,
|
|
16
|
+
method: "POST",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get(buildId: string) {
|
|
21
|
+
return this.requestExecutor.json(`/sandboxes/builds/${buildId}`, DTOSandboxTemplateBuildResponse);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
finalize(buildId: string, body: DTOSandboxTemplateBuildTriggerInput) {
|
|
25
|
+
return this.requestExecutor.json(`/sandboxes/builds/${buildId}`, DTOSandboxTemplateBuildFinalizeResponse, {
|
|
26
|
+
method: "PUT",
|
|
27
|
+
body,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RequestExecutor } from "../../transport";
|
|
2
|
+
import { SandboxTemplateBuildsEndpoint } from "./builds";
|
|
3
|
+
import { SandboxTemplatesEndpoint } from "./templates";
|
|
4
|
+
|
|
5
|
+
export class SandboxesEndpoint {
|
|
6
|
+
readonly builds: SandboxTemplateBuildsEndpoint;
|
|
7
|
+
readonly templates: SandboxTemplatesEndpoint;
|
|
8
|
+
|
|
9
|
+
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
10
|
+
this.builds = new SandboxTemplateBuildsEndpoint(requestExecutor);
|
|
11
|
+
this.templates = new SandboxTemplatesEndpoint(requestExecutor);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DTOSandboxTemplateListResponse, DTOSandboxTemplateQuery, DTOSandboxTemplateResponse } from "../../dto";
|
|
2
|
+
import { RequestExecutor } from "../../transport";
|
|
3
|
+
|
|
4
|
+
export class SandboxTemplatesEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
list(query: DTOSandboxTemplateQuery) {
|
|
8
|
+
return this.requestExecutor.json(`/sandboxes/templates`, DTOSandboxTemplateListResponse, {
|
|
9
|
+
query: new URLSearchParams(query),
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get(templateId: string) {
|
|
14
|
+
return this.requestExecutor.json(`/sandboxes/templates/${templateId}`, DTOSandboxTemplateResponse);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import {
|
|
3
|
+
DTOStorybookSiteListQuery,
|
|
4
|
+
DTOStorybookSiteListResponse,
|
|
5
|
+
DTOStorybookSiteUploadPayload,
|
|
6
|
+
DTOStorybookSiteUploadResponse,
|
|
7
|
+
DTOStorybookSiteVersionResponse,
|
|
8
|
+
} from "../dto";
|
|
9
|
+
import { RequestExecutor } from "../transport";
|
|
10
|
+
|
|
11
|
+
export class StorybookSitesEndpoint {
|
|
12
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
13
|
+
|
|
14
|
+
listSites(query: DTOStorybookSiteListQuery) {
|
|
15
|
+
return this.requestExecutor.json(`/storybook/sites`, DTOStorybookSiteListResponse, {
|
|
16
|
+
query: new URLSearchParams(query),
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
deleteSite(siteId: string) {
|
|
21
|
+
return this.requestExecutor.json(`/storybook/sites/${siteId}`, z.unknown(), {
|
|
22
|
+
method: "DELETE",
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
uploadInit(body: DTOStorybookSiteUploadPayload) {
|
|
27
|
+
return this.requestExecutor.json(`/storybook/site-versions`, DTOStorybookSiteUploadResponse, {
|
|
28
|
+
body,
|
|
29
|
+
method: "POST",
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getVersion(siteVersionId: string) {
|
|
34
|
+
return this.requestExecutor.json(`/storybook/site-versions/${siteVersionId}`, DTOStorybookSiteVersionResponse);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
uploadFinailize(siteVersionId: string) {
|
|
38
|
+
return this.requestExecutor.json(`/storybook/site-versions/${siteVersionId}`, DTOStorybookSiteVersionResponse, {
|
|
39
|
+
method: "PUT",
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOFileUploadFinalizeResponse,
|
|
3
|
+
DTOThreadMessageCreateInput,
|
|
4
|
+
DTOThreadMessageListResponse,
|
|
5
|
+
DTOThreadReactionCreateInput,
|
|
6
|
+
DTOThreadReactionDeleteInput,
|
|
7
|
+
DTOThreadReactionResponse,
|
|
8
|
+
} from "../dto";
|
|
9
|
+
import { RequestExecutor } from "../transport";
|
|
10
|
+
|
|
11
|
+
export class ThreadsEndpoint {
|
|
12
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
13
|
+
|
|
14
|
+
listMessages(threadId: string) {
|
|
15
|
+
return this.requestExecutor.json(`/threads/${threadId}/messages`, DTOThreadMessageListResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
postMessage(threadId: string, body: DTOThreadMessageCreateInput) {
|
|
19
|
+
return this.requestExecutor.json(`/threads/${threadId}/messages`, DTOThreadMessageListResponse, {
|
|
20
|
+
method: "POST",
|
|
21
|
+
body,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
postReaction(threadId: string, body: DTOThreadReactionCreateInput) {
|
|
26
|
+
return this.requestExecutor.json(`/threads/${threadId}/reactions`, DTOThreadReactionResponse, {
|
|
27
|
+
method: "POST",
|
|
28
|
+
body,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
deleteReaction(threadId: string, body: DTOThreadReactionDeleteInput) {
|
|
33
|
+
return this.requestExecutor.json(`/threads/${threadId}/reactions`, DTOFileUploadFinalizeResponse, {
|
|
34
|
+
method: "DELETE",
|
|
35
|
+
body,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DTOUserWorkspaceMembershipsResponse } from "../dto";
|
|
2
|
+
import { DTOAuthenticatedUserResponse, DTOUserProfileUpdatePayload } from "../dto/users/authenticated-user";
|
|
3
|
+
import { RequestExecutor } from "../transport/request-executor";
|
|
4
|
+
|
|
5
|
+
export class UsersEndpoint {
|
|
6
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
|
+
|
|
8
|
+
getMe() {
|
|
9
|
+
return this.requestExecutor.json("/users/me", DTOAuthenticatedUserResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
listWorkspaces(uid: string) {
|
|
13
|
+
return this.requestExecutor.json(`/users/${uid}/workspaces`, DTOUserWorkspaceMembershipsResponse);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
delete(uid: string) {
|
|
17
|
+
return this.requestExecutor.json(`/users/${uid}`, DTOAuthenticatedUserResponse, { method: "DELETE" });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
updateProfile(uid: string, body: DTOUserProfileUpdatePayload) {
|
|
21
|
+
return this.requestExecutor.json(`/users/${uid}/profile`, DTOAuthenticatedUserResponse, {
|
|
22
|
+
method: "PUT",
|
|
23
|
+
body,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOBillingCreditsCheckIfCanSpendResponse,
|
|
3
|
+
DTOBillingCreditsSpendInput,
|
|
4
|
+
DTOBillingCreditsSpendResponse,
|
|
5
|
+
} from "../../dto";
|
|
6
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
7
|
+
|
|
8
|
+
export class WorkspaceBillingEndpoint {
|
|
9
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
10
|
+
|
|
11
|
+
creditsSpend(wsId: string, body: DTOBillingCreditsSpendInput) {
|
|
12
|
+
return this.requestExecutor.json(`/workspaces/${wsId}/billing/credits/spend`, DTOBillingCreditsSpendResponse, {
|
|
13
|
+
body,
|
|
14
|
+
method: "POST",
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
creditsCheck(wsId: string) {
|
|
19
|
+
return this.requestExecutor.json(
|
|
20
|
+
`/workspaces/${wsId}/billing/credits/check`,
|
|
21
|
+
DTOBillingCreditsCheckIfCanSpendResponse
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
DTOForgeChatMessageCreateInput,
|
|
4
|
+
DTOForgeChatMessageCreateResponse,
|
|
5
|
+
DTOForgeChatMessageListQuery,
|
|
6
|
+
DTOForgeChatMessageListResponse,
|
|
7
|
+
DTOForgeChatMessageScoreRequest,
|
|
8
|
+
DTOForgeChatThreadCreateInput,
|
|
9
|
+
DTOForgeChatThreadCreateResponse,
|
|
10
|
+
DTOForgeChatThreadListQuery,
|
|
11
|
+
DTOForgeChatThreadListResponse,
|
|
12
|
+
DTOForgeChatThreadUpdateInput,
|
|
13
|
+
DTOForgeChatThreadUpdateResponse,
|
|
14
|
+
} from "../../dto/forge/threads";
|
|
15
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
16
|
+
|
|
17
|
+
export class WorkspaceChatThreadsEndpoint {
|
|
18
|
+
readonly messages: ChatThreadMessagesEndpoint;
|
|
19
|
+
|
|
20
|
+
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
21
|
+
this.messages = new ChatThreadMessagesEndpoint(requestExecutor);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
create(workspaceId: string, body: DTOForgeChatThreadCreateInput) {
|
|
25
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads`, DTOForgeChatThreadCreateResponse, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
body,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
list(workspaceId: string, query?: DTOForgeChatThreadListQuery) {
|
|
32
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads`, DTOForgeChatThreadListResponse, {
|
|
33
|
+
query: query
|
|
34
|
+
? new URLSearchParams({
|
|
35
|
+
...(query.limit !== undefined && { limit: query.limit.toString() }),
|
|
36
|
+
...(query.offset !== undefined && { offset: query.offset.toString() }),
|
|
37
|
+
})
|
|
38
|
+
: undefined,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
update(workspaceId: string, threadId: string, body: DTOForgeChatThreadUpdateInput) {
|
|
43
|
+
return this.requestExecutor.json(
|
|
44
|
+
`/workspaces/${workspaceId}/forge/threads/${threadId}`,
|
|
45
|
+
DTOForgeChatThreadUpdateResponse,
|
|
46
|
+
{
|
|
47
|
+
method: "PUT",
|
|
48
|
+
body,
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
delete(workspaceId: string, threadId: string) {
|
|
54
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads/${threadId}`, z.any(), {
|
|
55
|
+
method: "DELETE",
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class ChatThreadMessagesEndpoint {
|
|
61
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
62
|
+
|
|
63
|
+
list(workspaceId: string, threadId: string, query?: DTOForgeChatMessageListQuery) {
|
|
64
|
+
return this.requestExecutor.json(
|
|
65
|
+
`/workspaces/${workspaceId}/forge/threads/${threadId}/messages`,
|
|
66
|
+
DTOForgeChatMessageListResponse,
|
|
67
|
+
{
|
|
68
|
+
query: query
|
|
69
|
+
? new URLSearchParams({
|
|
70
|
+
...(query.limit !== undefined && { limit: query.limit.toString() }),
|
|
71
|
+
...(query.offset !== undefined && { offset: query.offset.toString() }),
|
|
72
|
+
})
|
|
73
|
+
: undefined,
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
create(workspaceId: string, threadId: string, body: DTOForgeChatMessageCreateInput) {
|
|
79
|
+
return this.requestExecutor.json(
|
|
80
|
+
`/workspaces/${workspaceId}/forge/threads/${threadId}/messages`,
|
|
81
|
+
DTOForgeChatMessageCreateResponse,
|
|
82
|
+
{
|
|
83
|
+
method: "POST",
|
|
84
|
+
body,
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
score(workspaceId: string, threadId: string, body: z.input<typeof DTOForgeChatMessageScoreRequest>) {
|
|
90
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads/${threadId}/scores`, z.any(), {
|
|
91
|
+
method: "POST",
|
|
92
|
+
body,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./billing";
|
|
2
|
+
export * from "./chat-threads";
|
|
3
|
+
export * from "./integrations";
|
|
4
|
+
export * from "./invites";
|
|
5
|
+
export * from "./knowledge-items";
|
|
6
|
+
export * from "./members";
|
|
7
|
+
export * from "./npm-register";
|
|
8
|
+
export * from "./subscription";
|
|
9
|
+
export * from "./workspaces";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOIntegrationsGetListResponse } from "../../dto";
|
|
3
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
4
|
+
|
|
5
|
+
export class WorkspaceIntegrationsEndpoint {
|
|
6
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
|
+
|
|
8
|
+
list(wsId: string) {
|
|
9
|
+
return this.requestExecutor.json(`/workspaces/${wsId}/integrations`, DTOIntegrationsGetListResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
delete(wsId: string, iId: string) {
|
|
13
|
+
return this.requestExecutor.json(`/workspaces/${wsId}/integrations/${iId}`, z.unknown(), { method: "DELETE" });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOWorkspaceInvitationsResponse,
|
|
3
|
+
DTOWorkspaceInvitationUpdateResponse,
|
|
4
|
+
DTOWorkspaceInviteUpdate,
|
|
5
|
+
DTOWorkspaceResponse,
|
|
6
|
+
} from "../../dto";
|
|
7
|
+
import { RequestExecutor } from "../../transport";
|
|
8
|
+
|
|
9
|
+
export class WorkspaceInvitationsEndpoint {
|
|
10
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
11
|
+
|
|
12
|
+
update(workspaceId: string, invitationId: string, body: DTOWorkspaceInviteUpdate) {
|
|
13
|
+
return this.requestExecutor.json(
|
|
14
|
+
`/workspaces/${workspaceId}/invitations/${invitationId}/role`,
|
|
15
|
+
DTOWorkspaceInvitationUpdateResponse,
|
|
16
|
+
{
|
|
17
|
+
method: "PUT",
|
|
18
|
+
body,
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
list(workspaceId: string) {
|
|
24
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/invitations`, DTOWorkspaceInvitationsResponse, {
|
|
25
|
+
method: "GET",
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
delete(workspaceId: string, invitationId: string) {
|
|
30
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/invitations/${invitationId}`, DTOWorkspaceResponse, {
|
|
31
|
+
method: "DELETE",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTOKnowledgeItemCreatePayload,
|
|
3
|
+
DTOKnowledgeItemDeletePayload,
|
|
4
|
+
DTOKnowledgeItemDeleteResponse,
|
|
5
|
+
DTOKnowledgeItemListResponse,
|
|
6
|
+
DTOKnowledgeItemResponse,
|
|
7
|
+
DTOKnowledgeItemUpdatePayload,
|
|
8
|
+
DTOKnowledgeItemSearchIndexResponse,
|
|
9
|
+
DTOKnowledgeItemSearchQuery,
|
|
10
|
+
DTOKnowledgeItemSearchResponse,
|
|
11
|
+
} from "../../dto";
|
|
12
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
13
|
+
|
|
14
|
+
export class WorkspaceKnowledgeItemsEndpoint {
|
|
15
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
16
|
+
|
|
17
|
+
list(workspaceId: string) {
|
|
18
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/knowledge-items`, DTOKnowledgeItemListResponse, {
|
|
19
|
+
method: "GET",
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
create(workspaceId: string, body: DTOKnowledgeItemCreatePayload) {
|
|
24
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/knowledge-items`, DTOKnowledgeItemResponse, {
|
|
25
|
+
method: "POST",
|
|
26
|
+
body,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
update(workspaceId: string, itemId: string, body: DTOKnowledgeItemUpdatePayload) {
|
|
31
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/knowledge-items/${itemId}`, DTOKnowledgeItemResponse, {
|
|
32
|
+
method: "PUT",
|
|
33
|
+
body,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
delete(workspaceId: string, body: DTOKnowledgeItemDeletePayload) {
|
|
38
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/knowledge-items`, DTOKnowledgeItemDeleteResponse, {
|
|
39
|
+
method: "DELETE",
|
|
40
|
+
body,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
buildSearchIndex(workspaceId: string) {
|
|
45
|
+
return this.requestExecutor.json(
|
|
46
|
+
`/workspaces/${workspaceId}/knowledge-items/search/index`,
|
|
47
|
+
DTOKnowledgeItemSearchIndexResponse,
|
|
48
|
+
{ method: "POST" }
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
search(workspaceId: string, body: DTOKnowledgeItemSearchQuery) {
|
|
53
|
+
return this.requestExecutor.json(
|
|
54
|
+
`/workspaces/${workspaceId}/knowledge-items/search/query`,
|
|
55
|
+
DTOKnowledgeItemSearchResponse,
|
|
56
|
+
{ method: "POST", body }
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { UpdateMembershipRolesInput } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOWorkspaceInvitationsListInput, DTOWorkspaceMembersListResponse, DTOWorkspaceResponse } from "../../dto";
|
|
4
|
+
import { RequestExecutor } from "../../transport";
|
|
5
|
+
|
|
6
|
+
export class WorkspaceMembersEndpoint {
|
|
7
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
8
|
+
|
|
9
|
+
list(workspaceId: string) {
|
|
10
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, DTOWorkspaceMembersListResponse, {
|
|
11
|
+
method: "GET",
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
update(workspaceId: string, body: UpdateMembershipRolesInput) {
|
|
16
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/members/role`, DTOWorkspaceResponse, {
|
|
17
|
+
method: "PUT",
|
|
18
|
+
body,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
invite(workspaceId: string, body: DTOWorkspaceInvitationsListInput) {
|
|
23
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z.any(), { method: "POST", body });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
delete(workspaceId: string, userId: string) {
|
|
27
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/members/${userId}`, DTOWorkspaceResponse, {
|
|
28
|
+
method: "DELETE",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
2
|
+
import { DTONpmRegistryAccessTokenResponse, DTOUpdateRegistryInput, DTOUpdateRegistryOutput } from "../../dto";
|
|
3
|
+
|
|
4
|
+
export class WorkspaceNpmRegistryEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
getAccessToken(wsId: string) {
|
|
8
|
+
return this.requestExecutor.json(
|
|
9
|
+
`/workspaces/${wsId}/npm-registry/access-token`,
|
|
10
|
+
DTONpmRegistryAccessTokenResponse
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
update(wsId: string, body: DTOUpdateRegistryInput) {
|
|
15
|
+
return this.requestExecutor.json(`/workspaces/${wsId}/npm-registry`, DTOUpdateRegistryOutput, {
|
|
16
|
+
method: "PUT",
|
|
17
|
+
body,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DTOSubscriptionResponse, DTOSubscriptionUpdateInput, DTOSubscriptionUpdatePreviewResponse } from "../../dto";
|
|
3
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
4
|
+
|
|
5
|
+
export class WorkspaceSubscriptionEndpoint {
|
|
6
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
7
|
+
|
|
8
|
+
get(workspaceId: string) {
|
|
9
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, DTOSubscriptionResponse, {
|
|
10
|
+
method: "GET",
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
update(workspaceId: string, body: DTOSubscriptionUpdateInput) {
|
|
15
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z.any(), {
|
|
16
|
+
method: "PUT",
|
|
17
|
+
body,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
previewUpdate(workspaceId: string, body: DTOSubscriptionUpdateInput) {
|
|
22
|
+
return this.requestExecutor.json(
|
|
23
|
+
`/workspaces/${workspaceId}/subscription/preview-update`,
|
|
24
|
+
DTOSubscriptionUpdatePreviewResponse,
|
|
25
|
+
{
|
|
26
|
+
method: "POST",
|
|
27
|
+
body,
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
DTOPortalSettingsGetResponse,
|
|
4
|
+
DTOPortalSettingsUpdatePayload,
|
|
5
|
+
DTOTransferOwnershipPayload,
|
|
6
|
+
DTOUserWorkspaceMembershipsResponse,
|
|
7
|
+
DTOWorkspaceCreateInput,
|
|
8
|
+
DTOWorkspaceResponse,
|
|
9
|
+
} from "../../dto";
|
|
10
|
+
import { RequestExecutor } from "../../transport/request-executor";
|
|
11
|
+
import { WorkspaceBillingEndpoint } from "./billing";
|
|
12
|
+
import { WorkspaceChatThreadsEndpoint } from "./chat-threads";
|
|
13
|
+
import { WorkspaceIntegrationsEndpoint } from "./integrations";
|
|
14
|
+
import { WorkspaceKnowledgeItemsEndpoint } from "./knowledge-items";
|
|
15
|
+
import { WorkspaceInvitationsEndpoint } from "./invites";
|
|
16
|
+
import { WorkspaceMembersEndpoint } from "./members";
|
|
17
|
+
import { WorkspaceNpmRegistryEndpoint } from "./npm-register";
|
|
18
|
+
import { WorkspaceSubscriptionEndpoint } from "./subscription";
|
|
19
|
+
|
|
20
|
+
// TODO Response types
|
|
21
|
+
export class WorkspacesEndpoint {
|
|
22
|
+
public members: WorkspaceMembersEndpoint;
|
|
23
|
+
public invitations: WorkspaceInvitationsEndpoint;
|
|
24
|
+
public npmRegistry: WorkspaceNpmRegistryEndpoint;
|
|
25
|
+
public chatThreads: WorkspaceChatThreadsEndpoint;
|
|
26
|
+
public integrations: WorkspaceIntegrationsEndpoint;
|
|
27
|
+
public knowledgeItems: WorkspaceKnowledgeItemsEndpoint;
|
|
28
|
+
public subscription: WorkspaceSubscriptionEndpoint;
|
|
29
|
+
public billing: WorkspaceBillingEndpoint;
|
|
30
|
+
|
|
31
|
+
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
32
|
+
this.members = new WorkspaceMembersEndpoint(requestExecutor);
|
|
33
|
+
this.invitations = new WorkspaceInvitationsEndpoint(requestExecutor);
|
|
34
|
+
this.integrations = new WorkspaceIntegrationsEndpoint(requestExecutor);
|
|
35
|
+
this.knowledgeItems = new WorkspaceKnowledgeItemsEndpoint(requestExecutor);
|
|
36
|
+
this.npmRegistry = new WorkspaceNpmRegistryEndpoint(requestExecutor);
|
|
37
|
+
this.chatThreads = new WorkspaceChatThreadsEndpoint(requestExecutor);
|
|
38
|
+
this.subscription = new WorkspaceSubscriptionEndpoint(requestExecutor);
|
|
39
|
+
this.billing = new WorkspaceBillingEndpoint(requestExecutor);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
create(body: DTOWorkspaceCreateInput) {
|
|
43
|
+
return this.requestExecutor.json("/workspaces", DTOWorkspaceResponse, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
body: {
|
|
46
|
+
...body,
|
|
47
|
+
product: "free",
|
|
48
|
+
priceId: "yearly",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
list() {
|
|
54
|
+
return this.requestExecutor.json(`/workspaces`, DTOUserWorkspaceMembershipsResponse, { method: "GET" });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get(workspaceId: string) {
|
|
58
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}`, DTOWorkspaceResponse, { method: "GET" });
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
delete(workspaceId: string) {
|
|
62
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}`, z.any(), { method: "DELETE" });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
getPortalSettings(workspaceId: string) {
|
|
66
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/portal/settings`, DTOPortalSettingsGetResponse, {
|
|
67
|
+
method: "GET",
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
updatePortalSettings(workspaceId: string, body: DTOPortalSettingsUpdatePayload) {
|
|
72
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/portal/settings`, DTOPortalSettingsGetResponse, {
|
|
73
|
+
method: "PUT",
|
|
74
|
+
body,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
transferOwnership(workspaceId: string, body: DTOTransferOwnershipPayload) {
|
|
79
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/ownership`, DTOWorkspaceResponse, {
|
|
80
|
+
method: "PUT",
|
|
81
|
+
body,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import { DTOCodeSnapshotScannerType } from "../../dto/design-systems/code-snapshots";
|
|
4
|
+
|
|
5
|
+
export const DTOCodeSnapshotUploadInitScannerType = DTOCodeSnapshotScannerType;
|
|
6
|
+
|
|
7
|
+
export const DTOCodeSnapshotUploadInitPayload = z.object({
|
|
8
|
+
archiveChecksum: z.string(),
|
|
9
|
+
archiveName: z.string(),
|
|
10
|
+
archiveSize: z.number(),
|
|
11
|
+
designSystemId: z.string(),
|
|
12
|
+
repoId: z.string(),
|
|
13
|
+
repoName: z.string(),
|
|
14
|
+
repoPackageName: z.string(),
|
|
15
|
+
scannerType: DTOCodeSnapshotUploadInitScannerType,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const DTOCodeSnapshotFinalizePayload = z.object({}).optional();
|
|
19
|
+
|
|
20
|
+
export const DTOCodeSnapshotStartProcessingRunPayload = z.object({
|
|
21
|
+
designSystemId: z.string(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type DTOCodeSnapshotUploadInitPayload = z.infer<typeof DTOCodeSnapshotUploadInitPayload>;
|
|
25
|
+
export type DTOCodeSnapshotUploadInitScannerType = z.infer<typeof DTOCodeSnapshotUploadInitScannerType>;
|
|
26
|
+
export type DTOCodeSnapshotFinalizePayload = z.infer<typeof DTOCodeSnapshotFinalizePayload>;
|
|
27
|
+
export type DTOCodeSnapshotStartProcessingRunPayload = z.infer<typeof DTOCodeSnapshotStartProcessingRunPayload>;
|