@supernova-studio/client 0.58.17 → 0.58.19

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.17",
3
+ "version": "0.58.19",
4
4
  "description": "Supernova Data Models",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
package/src/api/client.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { CodegenEndpoint, WorkspacesEndpoint } from "./endpoints";
2
2
  import { DesignSystemsEndpoint } from "./endpoints/design-system";
3
+ import { LiveblocksEndpoint } from "./endpoints/liveblocks";
3
4
  import { UsersEndpoint } from "./endpoints/users";
4
5
  import { RequestExecutor } from "./transport/request-executor";
5
6
 
@@ -13,6 +14,7 @@ export class SupernovaApiClient {
13
14
  readonly workspaces: WorkspacesEndpoint;
14
15
  readonly designSystems: DesignSystemsEndpoint;
15
16
  readonly codegen: CodegenEndpoint;
17
+ readonly liveblocks: LiveblocksEndpoint;
16
18
 
17
19
  constructor(config: SupernovaApiClientConfig) {
18
20
  const requestExecutor = new RequestExecutor({
@@ -24,5 +26,6 @@ export class SupernovaApiClient {
24
26
  this.workspaces = new WorkspacesEndpoint(requestExecutor);
25
27
  this.designSystems = new DesignSystemsEndpoint(requestExecutor);
26
28
  this.codegen = new CodegenEndpoint(requestExecutor);
29
+ this.liveblocks = new LiveblocksEndpoint(requestExecutor);
27
30
  }
28
31
  }
@@ -5,3 +5,4 @@ export * from "./block";
5
5
  export * from "./documentation-page-snapshot";
6
6
  export * from "./link-preview";
7
7
  export * from "./publish";
8
+ export * from "./room";
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+
3
+ export const DTODocumentationPageRoom = z.object({
4
+ id: z.string(),
5
+ });
6
+
7
+ export const DTODocumentationPageRoomResponse = z.object({
8
+ room: DTODocumentationPageRoom,
9
+ });
10
+
11
+ export type DTODocumentationPageRoom = z.infer<typeof DTODocumentationPageRoom>;
12
+ export type DTODocumentationPageRoomResponse = z.infer<typeof DTODocumentationPageRoomResponse>;
@@ -1,11 +1,11 @@
1
- import { DTODocumentationStructure, DTODocumentationStructureItem, DTOImportJobResponse } from "../../../dto";
1
+ import { DTODocumentationPageRoomResponse, DTODocumentationStructure } from "../../../dto";
2
2
  import { RequestExecutor } from "../../../transport/request-executor";
3
3
 
4
4
  export class DocumentationEndpoint {
5
5
  constructor(private readonly requestExecutor: RequestExecutor) {}
6
6
 
7
- getStructure(designSystemId: string, versionId: string) {
8
- return this.requestExecutor.json(
7
+ async getStructure(designSystemId: string, versionId: string) {
8
+ return await this.requestExecutor.json(
9
9
  `/design-systems/${designSystemId}/versions/${versionId}/documentation/structure`,
10
10
  DTODocumentationStructure
11
11
  );
@@ -14,10 +14,14 @@ export class DocumentationEndpoint {
14
14
  async getDocStructure(dsId: string, vId: string) {
15
15
  return await this.requestExecutor.json(
16
16
  `/design-systems/${dsId}/versions/${vId}/documentation/structure`,
17
- DTODocumentationStructure,
18
- {
19
- method: "GET",
20
- }
17
+ DTODocumentationStructure
18
+ );
19
+ }
20
+
21
+ async getPageRoom(dsId: string, vId: string, pageId: string) {
22
+ return await this.requestExecutor.json(
23
+ `/design-systems/${dsId}/versions/${vId}/documentation/pages/${pageId}/room`,
24
+ DTODocumentationPageRoomResponse
21
25
  );
22
26
  }
23
27
  }
@@ -1,4 +1,5 @@
1
1
  export * from "./codegen";
2
2
  export * from "./design-system";
3
3
  export * from "./workspaces";
4
+ export * from "./liveblocks";
4
5
  export * from "./users";
@@ -0,0 +1,14 @@
1
+ import { DTOLiveblocksAuthResponse } from "../dto";
2
+ import { DTOLiveblocksAuthRequest } from "../payloads";
3
+ import { RequestExecutor } from "../transport/request-executor";
4
+
5
+ export class LiveblocksEndpoint {
6
+ constructor(private readonly requestExecutor: RequestExecutor) {}
7
+
8
+ auth(body: DTOLiveblocksAuthRequest) {
9
+ return this.requestExecutor.json("/liveblocks/auth", DTOLiveblocksAuthResponse, {
10
+ method: "POST",
11
+ body,
12
+ });
13
+ }
14
+ }