@supernova-studio/client 0.58.7 → 0.58.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supernova-studio/client",
3
- "version": "0.58.7",
3
+ "version": "0.58.8",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,23 @@
1
+ import { DTODocumentationStructure, DTODocumentationStructureItem, DTOImportJobResponse } from "../../../dto";
2
+ import { RequestExecutor } from "../../../transport/request-executor";
3
+
4
+ export class DocumentationEndpoint {
5
+ constructor(private readonly requestExecutor: RequestExecutor) {}
6
+
7
+ getStructure(designSystemId: string, versionId: string) {
8
+ return this.requestExecutor.json(
9
+ `/design-systems/${designSystemId}/versions/${versionId}/documentation/structure`,
10
+ DTODocumentationStructure
11
+ );
12
+ }
13
+
14
+ async getDocStructure(dsId: string, vId: string) {
15
+ return await this.requestExecutor.json(
16
+ `/design-systems/${dsId}/versions/${vId}/documentation/structure`,
17
+ DTODocumentationStructure,
18
+ {
19
+ method: "GET",
20
+ }
21
+ );
22
+ }
23
+ }
@@ -0,0 +1,100 @@
1
+ import {
2
+ DTOCreateDocumentationGroupInput,
3
+ DTOCreateDocumentationPageInputV2,
4
+ DTOCreateDocumentationTabInput,
5
+ DTODocumentationStructure,
6
+ DTODocumentationStructureItem,
7
+ DTOElementActionOutput,
8
+ DTOMoveDocumentationGroupInput,
9
+ DTOUpdateDocumentationGroupInput,
10
+ DTOUpdateDocumentationPageInputV2,
11
+ } from "../../../dto";
12
+ import { RequestExecutor } from "../../../transport/request-executor";
13
+
14
+ export class ElementsActionsEndpoint {
15
+ constructor(private readonly requestExecutor: RequestExecutor) {}
16
+
17
+ async createDocPage(dsId: string, vId: string, input: DTOCreateDocumentationPageInputV2) {
18
+ return this.requestExecutor.json(
19
+ `/design-systems/${dsId}/versions/${vId}/elements-action`,
20
+ DTOElementActionOutput,
21
+ {
22
+ body: {
23
+ type: "DocumentationPageCreate",
24
+ input,
25
+ },
26
+ method: "POST",
27
+ }
28
+ );
29
+ }
30
+
31
+ async createDocGroup(dsId: string, vId: string, input: DTOCreateDocumentationGroupInput) {
32
+ return this.requestExecutor.json(
33
+ `/design-systems/${dsId}/versions/${vId}/elements-action`,
34
+ DTOElementActionOutput,
35
+ {
36
+ body: {
37
+ type: "DocumentationGroupCreate",
38
+ input,
39
+ },
40
+ method: "POST",
41
+ }
42
+ );
43
+ }
44
+
45
+ async moveDocGroup(dsId: string, vId: string, input: DTOMoveDocumentationGroupInput) {
46
+ return this.requestExecutor.json(
47
+ `/design-systems/${dsId}/versions/${vId}/elements-action`,
48
+ DTOElementActionOutput,
49
+ {
50
+ body: {
51
+ type: "DocumentationGroupMove",
52
+ input,
53
+ },
54
+ method: "POST",
55
+ }
56
+ );
57
+ }
58
+
59
+ async updateDocPage(dsId: string, vId: string, input: DTOUpdateDocumentationPageInputV2) {
60
+ return this.requestExecutor.json(
61
+ `/design-systems/${dsId}/versions/${vId}/elements-action`,
62
+ DTOElementActionOutput,
63
+ {
64
+ body: {
65
+ type: "DocumentationPageUpdate",
66
+ input,
67
+ },
68
+ method: "POST",
69
+ }
70
+ );
71
+ }
72
+
73
+ async updateDocGroup(dsId: string, vId: string, input: DTOUpdateDocumentationGroupInput) {
74
+ return this.requestExecutor.json(
75
+ `/design-systems/${dsId}/versions/${vId}/elements-action`,
76
+ DTOElementActionOutput,
77
+ {
78
+ body: {
79
+ type: "DocumentationGroupUpdate",
80
+ input,
81
+ },
82
+ method: "POST",
83
+ }
84
+ );
85
+ }
86
+
87
+ async createDocTab(dsId: string, vId: string, input: DTOCreateDocumentationTabInput) {
88
+ return this.requestExecutor.json(
89
+ `/design-systems/${dsId}/versions/${vId}/elements-action`,
90
+ DTOElementActionOutput,
91
+ {
92
+ body: {
93
+ type: "DocumentationTabCreate",
94
+ input,
95
+ },
96
+ method: "POST",
97
+ }
98
+ );
99
+ }
100
+ }
@@ -1,5 +1,7 @@
1
1
  export * from "./brands";
2
2
  export * from "./components";
3
+ export * from "./documentation";
4
+ export * from "./elements-action";
3
5
  export * from "./elements-actions";
4
6
  export * from "./import-jobs";
5
7
  export * from "./overrides";
@@ -7,6 +7,7 @@ import { DTOCreateVersionInput } from "../../../payloads";
7
7
  import { RequestExecutor } from "../../../transport/request-executor";
8
8
  import { BrandsEndpoint } from "./brands";
9
9
  import { DesignSystemComponentEndpoint } from "./components";
10
+ import { DocumentationEndpoint } from "./documentation";
10
11
  import { ElementsActionsEndpoint } from "./elements-actions";
11
12
  import { ImportJobsEndpoint } from "./import-jobs";
12
13
  import { ElementPropertyDefinitionsEndpoint } from "./property-definitions";
@@ -29,6 +30,7 @@ export class DesignSystemVersionsEndpoint {
29
30
  readonly elementPropertyValues: ElementPropertyValuesEndpoint;
30
31
  readonly elementsActions: ElementsActionsEndpoint;
31
32
  readonly designSystemComponents: DesignSystemComponentEndpoint;
33
+ readonly documentation: DocumentationEndpoint;
32
34
 
33
35
  constructor(private readonly requestExecutor: RequestExecutor) {
34
36
  this.themes = new ThemesEndpoint(requestExecutor);
@@ -42,6 +44,7 @@ export class DesignSystemVersionsEndpoint {
42
44
  this.elementPropertyValues = new ElementPropertyValuesEndpoint(requestExecutor);
43
45
  this.elementsActions = new ElementsActionsEndpoint(requestExecutor);
44
46
  this.designSystemComponents = new DesignSystemComponentEndpoint(requestExecutor);
47
+ this.documentation = new DocumentationEndpoint(requestExecutor);
45
48
  }
46
49
 
47
50
  list(dsId: string) {
@@ -3,6 +3,7 @@ import { DTOWorkspaceCreateInput, DTOWorkspaceResponse } from "../../dto";
3
3
  import { RequestExecutor } from "../../transport/request-executor";
4
4
  import { WorkspaceInvitationsEndpoint } from "./workspace-invites";
5
5
  import { WorkspaceMembersEndpoint } from "./workspace-members";
6
+ import { DTOTransferOwnershipPayload } from "../../payloads";
6
7
 
7
8
  // TODO Response types
8
9
  export class WorkspacesEndpoint {
@@ -36,4 +37,11 @@ export class WorkspacesEndpoint {
36
37
  subscription(workspaceId: string) {
37
38
  return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z.any(), { method: "GET" });
38
39
  }
40
+
41
+ transferOwnership(workspaceId: string, body: DTOTransferOwnershipPayload) {
42
+ return this.requestExecutor.json(`/workspaces/${workspaceId}/ownership`, DTOWorkspaceResponse, {
43
+ method: "PUT",
44
+ body,
45
+ });
46
+ }
39
47
  }
@@ -1,2 +1,3 @@
1
+ export * from "./transfer-ownership";
1
2
  export * from "./workspace-configuration";
2
3
  export * from "./workspace-integrations";
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+
3
+ export const DTOTransferOwnershipPayload = z.object({
4
+ newOwnerId: z.string(),
5
+ });
6
+
7
+ export type DTOTransferOwnershipPayload = z.infer<typeof DTOTransferOwnershipPayload>;