@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/dist/index.d.mts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +49 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +384 -345
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/client.ts +3 -0
- package/src/api/dto/documentation/index.ts +1 -0
- package/src/api/dto/documentation/room.ts +12 -0
- package/src/api/endpoints/design-system/versions/documentation.ts +11 -7
- package/src/api/endpoints/index.ts +1 -0
- package/src/api/endpoints/liveblocks.ts +14 -0
package/package.json
CHANGED
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
|
}
|
|
@@ -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 {
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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
|
+
}
|