@supernova-studio/model 0.54.32 → 0.54.34
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 +303 -429
- package/dist/index.d.ts +303 -429
- package/dist/index.js +361 -339
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +809 -787
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dsm/membership/design-system-membership.ts +35 -0
- package/src/dsm/membership/index.ts +1 -0
- package/src/dsm/membership/invitations.ts +11 -0
- package/src/workspace/workspace-create.ts +0 -13
- package/src/workspace/workspace.ts +4 -1
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { DbCreateInputOmit } from "../../helpers";
|
|
3
|
+
import { WorkspaceRoleSchema } from "../../workspace";
|
|
4
|
+
import { DesignSystemInvitation } from "./invitations";
|
|
3
5
|
|
|
4
6
|
export const DesignSystemMembership = z.object({
|
|
5
7
|
id: z.string(),
|
|
@@ -11,3 +13,36 @@ export const DesignSystemMembership = z.object({
|
|
|
11
13
|
export type DesignSystemMembership = z.infer<typeof DesignSystemMembership>;
|
|
12
14
|
|
|
13
15
|
export type CreateDesignSystemMembership = DbCreateInputOmit<DesignSystemMembership>;
|
|
16
|
+
|
|
17
|
+
export const DesignSystemMembers = z.object({
|
|
18
|
+
members: DesignSystemMembership.array(),
|
|
19
|
+
invitations: DesignSystemInvitation.array(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const DesignSystemPendingMemberInvitation = z.object({
|
|
23
|
+
inviteId: z.string(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const DesignSystemUserInvitation = z.object({
|
|
27
|
+
userId: z.string(),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const DesignSystemInvite = z.object({
|
|
31
|
+
email: z.string(),
|
|
32
|
+
workspaceRole: WorkspaceRoleSchema,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const DesignSystemMembershipUpdates = z.object({
|
|
36
|
+
usersToInvite: DesignSystemUserInvitation.array().optional(),
|
|
37
|
+
invitesToInvite: DesignSystemPendingMemberInvitation.array().optional(),
|
|
38
|
+
emailsToInvite: DesignSystemInvite.array().optional(),
|
|
39
|
+
|
|
40
|
+
removeUserIds: z.string().array().optional(),
|
|
41
|
+
deleteInvitationIds: z.string().array().optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export type DesignSystemMembers = z.infer<typeof DesignSystemMembers>;
|
|
45
|
+
export type DesignSystemInvite = z.infer<typeof DesignSystemInvite>;
|
|
46
|
+
export type DesignSystemPendingMemberInvite = z.infer<typeof DesignSystemPendingMemberInvitation>;
|
|
47
|
+
export type DesignSystemUserInvitation = z.infer<typeof DesignSystemUserInvitation>;
|
|
48
|
+
export type DesignSystemMembershipUpdates = z.infer<typeof DesignSystemMembershipUpdates>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DbCreateInputOmit } from "../../helpers";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const DesignSystemInvitation = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
designSystemId: z.string(),
|
|
7
|
+
workspaceInvitationId: z.string(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type DesignSystemInvitation = z.infer<typeof DesignSystemInvitation>;
|
|
11
|
+
export type CreateDesignSystemInvitation = DbCreateInputOmit<DesignSystemInvitation>;
|
|
@@ -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>;
|