@supernova-studio/model 0.55.16 → 0.55.18

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/model",
3
- "version": "0.55.16",
3
+ "version": "0.55.18",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,7 +27,6 @@ export const DesignSystem = z.object({
27
27
  docSlug: z.string(),
28
28
  docUserSlug: nullishToOptional(z.string()),
29
29
  docSlugDeprecated: z.string(),
30
- isPublic: z.boolean(),
31
30
  isMultibrand: z.boolean(),
32
31
  docViewUrl: nullishToOptional(z.string()),
33
32
  basePrefixes: z.array(z.string()),
@@ -1,8 +1,15 @@
1
1
  import { z } from "zod";
2
2
  import { DbCreateInputOmit } from "../../helpers";
3
- import { WorkspaceRoleSchema } from "../../workspace";
3
+ import { WorkspaceRole, WorkspaceRoleSchema } from "../../workspace/workspace-role";
4
4
  import { DesignSystemInvitation } from "./invitations";
5
5
 
6
+ export const DesignSystemRole = z.enum([
7
+ WorkspaceRole.Admin,
8
+ WorkspaceRole.Contributor,
9
+ WorkspaceRole.Creator,
10
+ WorkspaceRole.Viewer,
11
+ ]);
12
+
6
13
  export const DesignSystemMembership = z.object({
7
14
  id: z.string(),
8
15
  userId: z.string(),
@@ -21,15 +28,33 @@ export const DesignSystemMembers = z.object({
21
28
 
22
29
  export const DesignSystemPendingMemberInvitation = z.object({
23
30
  inviteId: z.string(),
31
+
32
+ /**
33
+ * Role that the user will have in the design system, undefined
34
+ * if it should be inherited from the workspace
35
+ */
36
+ designSystemRole: DesignSystemRole.optional(),
24
37
  });
25
38
 
26
39
  export const DesignSystemUserInvitation = z.object({
27
40
  userId: z.string(),
41
+
42
+ /**
43
+ * Role that the user will have in the design system, undefined
44
+ * if it should be inherited from the workspace
45
+ */
46
+ designSystemRole: DesignSystemRole.optional(),
28
47
  });
29
48
 
30
49
  export const DesignSystemInvite = z.object({
31
50
  email: z.string(),
32
51
  workspaceRole: WorkspaceRoleSchema,
52
+
53
+ /**
54
+ * Role that the user will have in the design system, undefined
55
+ * if it should be inherited from the workspace
56
+ */
57
+ designSystemRole: DesignSystemRole.optional(),
33
58
  });
34
59
 
35
60
  export const DesignSystemMembershipUpdates = z.object({
@@ -41,6 +66,7 @@ export const DesignSystemMembershipUpdates = z.object({
41
66
  deleteInvitationIds: z.string().array().optional(),
42
67
  });
43
68
 
69
+ export type DesignSystemRole = z.infer<typeof DesignSystemRole>;
44
70
  export type DesignSystemMembers = z.infer<typeof DesignSystemMembers>;
45
71
  export type DesignSystemInvite = z.infer<typeof DesignSystemInvite>;
46
72
  export type DesignSystemPendingMemberInvite = z.infer<typeof DesignSystemPendingMemberInvitation>;