@supernova-studio/model 0.54.33 → 0.54.35

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.54.33",
3
+ "version": "0.54.35",
4
4
  "description": "Supernova Data Models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ import { DesignSystem } from "../dsm/design-system";
3
+ import { User } from "../users/user";
4
+ import { WorkspaceRoleSchema } from "../workspace/workspace-role";
5
+
6
+ /**
7
+ * Object describing who is going to receive the email.
8
+ *
9
+ * Normally recepient is just an email, however in some cases email can be tailored
10
+ * for who receives it. In this case the email has cutomization based on the role of the
11
+ * recepient in the workspace (or design design system).
12
+ */
13
+ export const DesignSystemInviteEmailRecipient = z.object({
14
+ email: z.string(),
15
+ role: WorkspaceRoleSchema,
16
+ });
17
+
18
+ /**
19
+ * Object describing the necessary data to send an email notifying a user that
20
+ * they've been added to a design system.
21
+ */
22
+ export const DesignSystemInviteEmailData = z.object({
23
+ designSystem: DesignSystem,
24
+ invitedBy: User,
25
+ documentationDomain: z.string().optional(),
26
+ });
27
+
28
+ export type DesignSystemInviteEmailRecipient = z.infer<typeof DesignSystemInviteEmailRecipient>;
29
+ export type DesignSystemInviteEmailData = z.infer<typeof DesignSystemInviteEmailData>;
@@ -0,0 +1 @@
1
+ export * from "./design-system-invite";
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export * from "./custom-domains";
6
6
  export * from "./data-dumps";
7
7
  export * from "./docs-server";
8
8
  export * from "./dsm";
9
+ export * from "./emails";
9
10
  export * from "./events";
10
11
  export * from "./export";
11
12
  export * from "./feature-flags";
@@ -13,9 +13,6 @@ export const HANDLE_MAX_LENGTH = 64;
13
13
 
14
14
  export const CreateWorkspaceInput = z.object({
15
15
  name: z.string().min(WORKSPACE_NAME_MIN_LENGTH).max(WORKSPACE_NAME_MAX_LENGTH).trim(),
16
- product: ProductCodeSchema,
17
- priceId: z.string(),
18
- billingEmail: z.string().email().optional(),
19
16
  handle: z
20
17
  .string()
21
18
  .regex(slugRegex)
@@ -23,16 +20,6 @@ export const CreateWorkspaceInput = z.object({
23
20
  .max(HANDLE_MAX_LENGTH)
24
21
  .refine(value => value?.length > 0)
25
22
  .optional(),
26
- invites: UserInvites.optional(),
27
- promoCode: z.string().optional(),
28
- status: InternalStatusSchema.optional(),
29
- planInterval: BillingIntervalSchema.optional(),
30
- seats: z.number().optional(),
31
- seatLimit: z.number().optional(),
32
- card: CardSchema.optional(),
33
- sso: SsoProvider.optional(),
34
- npmRegistrySettings: NpmRegistryConfig.optional(),
35
- ipWhitelist: WorkspaceIpSettings.optional(),
36
23
  });
37
24
 
38
25
  export type CreateWorkspaceInput = z.infer<typeof CreateWorkspaceInput>;
@@ -2,7 +2,7 @@ import IPCIDR from "ip-cidr";
2
2
  import { z } from "zod";
3
3
  import { BillingDetails, Subscription } from "../billing";
4
4
  import { DesignSystem } from "../dsm";
5
- import { nullishToOptional } from "../helpers";
5
+ import { DbCreateInputOmit, DbUpdateInputOmit, nullishToOptional } from "../helpers";
6
6
  import { NpmRegistryConfig } from "./npm-registry-settings";
7
7
  import { SsoProvider } from "./sso-provider";
8
8
 
@@ -52,6 +52,9 @@ export const WorkspaceWithDesignSystems = z.object({
52
52
  designSystems: z.array(DesignSystem),
53
53
  });
54
54
 
55
+ export type CreateWorkspaceDbInput = DbCreateInputOmit<Workspace>;
56
+ export type UpdateWorkspaceDbInput = DbUpdateInputOmit<Workspace>;
57
+
55
58
  export type WorkspaceIpWhitelistEntry = z.infer<typeof WorkspaceIpWhitelistEntry>;
56
59
  export type WorkspaceIpSettings = z.infer<typeof WorkspaceIpSettings>;
57
60
  export type WorkspaceProfile = z.infer<typeof WorkspaceProfile>;