@supernova-studio/client 0.55.16 → 0.55.17
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 +343 -58
- package/dist/index.d.ts +343 -58
- package/dist/index.js +315 -230
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1305 -1220
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/collections/collection.ts +25 -0
- package/src/api/dto/collections/index.ts +1 -0
- package/src/api/dto/design-systems/design-system.ts +10 -0
- package/src/api/dto/design-systems/index.ts +1 -0
- package/src/api/dto/design-systems/members.ts +13 -0
- package/src/api/dto/design-systems/role.ts +11 -0
- package/src/api/dto/index.ts +1 -0
- package/src/api/endpoints/index.ts +1 -0
- package/src/api/endpoints/token-collections.ts +13 -0
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ObjectMeta } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTOTokenCollection = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
persistentId: z.string(),
|
|
7
|
+
designSystemVersionId: z.string(),
|
|
8
|
+
|
|
9
|
+
meta: ObjectMeta,
|
|
10
|
+
|
|
11
|
+
createdAt: z.coerce.date(),
|
|
12
|
+
updatedAt: z.coerce.date(),
|
|
13
|
+
|
|
14
|
+
origin: z.object({
|
|
15
|
+
id: z.string(),
|
|
16
|
+
sourceId: z.string(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const DTOTokenCollectionsListReponse = z.object({
|
|
21
|
+
collections: DTOTokenCollection.array(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type DTOTokenCollection = z.infer<typeof DTOTokenCollection>;
|
|
25
|
+
export type DTOTokenCollectionsListReponse = z.infer<typeof DTOTokenCollectionsListReponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./collection";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DesignSystem, DesignSystemAccessMode, ObjectMeta, WorkspaceRoleSchema } from "@supernova-studio/model";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { DTODesignSystemMembersUpdatePayload } from "./members";
|
|
4
|
+
import { DTODesignSystemRole } from "./role";
|
|
4
5
|
|
|
5
6
|
//
|
|
6
7
|
// Read
|
|
@@ -21,7 +22,16 @@ export const DTODesignSystem = DesignSystem.omit({
|
|
|
21
22
|
*/
|
|
22
23
|
isAvailableToUser: z.boolean(),
|
|
23
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
24
28
|
role: WorkspaceRoleSchema.optional(),
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* User's role within the design system that can come either from
|
|
32
|
+
* the design system or workspace.
|
|
33
|
+
*/
|
|
34
|
+
effectiveRole: DTODesignSystemRole.optional(),
|
|
25
35
|
});
|
|
26
36
|
|
|
27
37
|
export const DTODesignSystemResponse = z.object({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DesignSystemMembershipUpdates } from "@supernova-studio/model";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { DTODesignSystemRole } from "./role";
|
|
3
4
|
|
|
4
5
|
//
|
|
5
6
|
// Read
|
|
@@ -7,11 +8,23 @@ import { z } from "zod";
|
|
|
7
8
|
|
|
8
9
|
export const DTODesignSystemMember = z.object({
|
|
9
10
|
userId: z.string(),
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Role that the member has in the design system,
|
|
14
|
+
* undefined if set to inherit from workspace
|
|
15
|
+
*/
|
|
16
|
+
designSystemRole: DTODesignSystemRole.optional(),
|
|
10
17
|
});
|
|
11
18
|
|
|
12
19
|
export const DTODesignSystemInvitation = z.object({
|
|
13
20
|
id: z.string(),
|
|
14
21
|
workspaceInvitationId: z.string(),
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Role that the invitation has in the design system,
|
|
25
|
+
* undefined if set to inherit from workspace
|
|
26
|
+
*/
|
|
27
|
+
designSystemRole: DTODesignSystemRole.optional(),
|
|
15
28
|
});
|
|
16
29
|
|
|
17
30
|
export const DTODesignSystemMemberListResponse = z.object({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WorkspaceRole } from "@supernova-studio/model";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DTODesignSystemRole = z.enum([
|
|
5
|
+
WorkspaceRole.Admin,
|
|
6
|
+
WorkspaceRole.Contributor,
|
|
7
|
+
WorkspaceRole.Creator,
|
|
8
|
+
WorkspaceRole.Viewer,
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
export type DTODesignSystemRole = z.infer<typeof DTODesignSystemRole>;
|
package/src/api/dto/index.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DTOTokenCollectionsListReponse } from "../dto";
|
|
2
|
+
import { RequestExecutor } from "../transport/request-executor";
|
|
3
|
+
|
|
4
|
+
export class TokenCollectionsEndpoint {
|
|
5
|
+
constructor(private readonly requestExecutor: RequestExecutor) {}
|
|
6
|
+
|
|
7
|
+
list(dsId: string, vId: string) {
|
|
8
|
+
return this.requestExecutor.json(
|
|
9
|
+
`/design-systems/${dsId}/versions/${vId}/token-collections`,
|
|
10
|
+
DTOTokenCollectionsListReponse
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
}
|