@supernova-studio/client 0.54.25 → 0.54.27
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 +894 -296
- package/dist/index.d.ts +894 -296
- package/dist/index.js +63 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -50
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/design-systems/design-system.ts +2 -2
- package/src/api/dto/workspaces/membership.ts +1 -1
- package/src/api/dto/workspaces/workspace.ts +2 -2
- package/src/api/endpoints/design-system-members.ts +24 -0
- package/src/api/endpoints/design-systems.ts +11 -12
- package/src/api/endpoints/index.ts +2 -0
- package/src/api/endpoints/workspace-members.ts +31 -0
- package/src/api/endpoints/workspaces.ts +11 -5
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ export const DTODesignSystem = DesignSystem.omit({
|
|
|
16
16
|
role: WorkspaceRoleSchema.optional(),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const DTODesignSystemResponse = z.object({
|
|
20
20
|
designSystem: DTODesignSystem,
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -25,7 +25,7 @@ export const DTODesignSystemsListResponse = z.object({
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
export type DTODesignSystem = z.infer<typeof DTODesignSystem>;
|
|
28
|
-
export type
|
|
28
|
+
export type DTODesignSystemResponse = z.infer<typeof DTODesignSystemResponse>;
|
|
29
29
|
export type DTODesignSystemsListResponse = z.infer<typeof DTODesignSystemsListResponse>;
|
|
30
30
|
|
|
31
31
|
//
|
|
@@ -23,9 +23,9 @@ export const DTOWorkspaceCreateInput = z.object({
|
|
|
23
23
|
name: z.string(),
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
export const
|
|
26
|
+
export const DTOWorkspaceResponse = z.object({
|
|
27
27
|
workspace: DTOWorkspace,
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
export type DTOWorkspaceCreateInput = z.infer<typeof DTOWorkspaceCreateInput>;
|
|
31
|
-
export type
|
|
31
|
+
export type DTOWorkspaceResponse = z.infer<typeof DTOWorkspaceResponse>;
|
|
@@ -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
|
+
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
DTODesignSystemCreateResponse,
|
|
5
|
-
DTODesignSystemMembersUpdatePayload,
|
|
6
|
-
DTODesignSystemMembersUpdateResponse,
|
|
7
|
-
DTODesignSystemsListResponse,
|
|
8
|
-
} from "../dto";
|
|
2
|
+
import { DTODesignSystemCreateInput, DTODesignSystemResponse, DTODesignSystemsListResponse } from "../dto";
|
|
3
|
+
import { DTODesignSystemUpdateInput } from "../payloads";
|
|
9
4
|
import { RequestExecutor } from "../transport/request-executor";
|
|
5
|
+
import { DesignSystemMembersEndpoint } from "./design-system-members";
|
|
10
6
|
|
|
11
7
|
export class DesignSystemsEndpoint {
|
|
12
|
-
|
|
8
|
+
members: DesignSystemMembersEndpoint;
|
|
9
|
+
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
10
|
+
this.members = new DesignSystemMembersEndpoint(requestExecutor);
|
|
11
|
+
}
|
|
13
12
|
|
|
14
13
|
create(body: DTODesignSystemCreateInput) {
|
|
15
|
-
return this.requestExecutor.json("/design-systems",
|
|
14
|
+
return this.requestExecutor.json("/design-systems", DTODesignSystemResponse, { method: "POST", body });
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
list(wsId: string) {
|
|
@@ -27,9 +26,9 @@ export class DesignSystemsEndpoint {
|
|
|
27
26
|
return this.requestExecutor.json(`/design-systems/${dsId}`, z.any(), { method: "DELETE" });
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
return this.requestExecutor.json(`/design-systems/${dsId}
|
|
32
|
-
method: "
|
|
29
|
+
update(dsId: string, body: DTODesignSystemUpdateInput) {
|
|
30
|
+
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {
|
|
31
|
+
method: "PUT",
|
|
33
32
|
body,
|
|
34
33
|
});
|
|
35
34
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { UpdateMembershipRolesInput } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DTOUserWorkspaceMembershipsResponse, DTOWorkspaceInvitationsListInput, 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`, DTOUserWorkspaceMembershipsResponse, {
|
|
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
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { DTOWorkspaceCreateInput,
|
|
2
|
+
import { DTOWorkspaceCreateInput, DTOWorkspaceResponse } from "../dto";
|
|
3
3
|
import { RequestExecutor } from "../transport/request-executor";
|
|
4
|
+
import { WorkspaceMembersEndpoint } from "./workspace-members";
|
|
4
5
|
|
|
6
|
+
// TODO Response types
|
|
5
7
|
export class WorkspacesEndpoint {
|
|
6
|
-
|
|
8
|
+
public members: WorkspaceMembersEndpoint;
|
|
9
|
+
|
|
10
|
+
constructor(private readonly requestExecutor: RequestExecutor) {
|
|
11
|
+
this.members = new WorkspaceMembersEndpoint(requestExecutor);
|
|
12
|
+
}
|
|
7
13
|
|
|
8
14
|
create(body: DTOWorkspaceCreateInput) {
|
|
9
|
-
return this.requestExecutor.json("/workspaces",
|
|
15
|
+
return this.requestExecutor.json("/workspaces", DTOWorkspaceResponse, {
|
|
10
16
|
method: "POST",
|
|
11
17
|
body: {
|
|
12
18
|
...body,
|
|
@@ -20,7 +26,7 @@ export class WorkspacesEndpoint {
|
|
|
20
26
|
return this.requestExecutor.json(`/workspaces/${workspaceId}`, z.any(), { method: "DELETE" });
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/
|
|
29
|
+
subscription(workspaceId: string) {
|
|
30
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z.any(), { method: "GET" });
|
|
25
31
|
}
|
|
26
32
|
}
|