@prave/shared 0.3.0 → 0.3.1
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,112 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const orgRoleSchema: z.ZodEnum<["owner", "admin", "member"]>;
|
|
3
|
-
export type OrgRole = z.infer<typeof orgRoleSchema>;
|
|
4
|
-
export declare const orgSchema: z.ZodObject<{
|
|
5
|
-
id: z.ZodString;
|
|
6
|
-
name: z.ZodString;
|
|
7
|
-
slug: z.ZodString;
|
|
8
|
-
owner_id: z.ZodString;
|
|
9
|
-
stripe_subscription_id: z.ZodNullable<z.ZodString>;
|
|
10
|
-
seats: z.ZodNumber;
|
|
11
|
-
created_at: z.ZodString;
|
|
12
|
-
updated_at: z.ZodString;
|
|
13
|
-
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
id: string;
|
|
15
|
-
owner_id: string;
|
|
16
|
-
name: string;
|
|
17
|
-
slug: string;
|
|
18
|
-
created_at: string;
|
|
19
|
-
updated_at: string;
|
|
20
|
-
stripe_subscription_id: string | null;
|
|
21
|
-
seats: number;
|
|
22
|
-
}, {
|
|
23
|
-
id: string;
|
|
24
|
-
owner_id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
slug: string;
|
|
27
|
-
created_at: string;
|
|
28
|
-
updated_at: string;
|
|
29
|
-
stripe_subscription_id: string | null;
|
|
30
|
-
seats: number;
|
|
31
|
-
}>;
|
|
32
|
-
export type Org = z.infer<typeof orgSchema>;
|
|
33
|
-
export declare const orgMemberSchema: z.ZodObject<{
|
|
34
|
-
org_id: z.ZodString;
|
|
35
|
-
user_id: z.ZodString;
|
|
36
|
-
role: z.ZodEnum<["owner", "admin", "member"]>;
|
|
37
|
-
invited_email: z.ZodNullable<z.ZodString>;
|
|
38
|
-
joined_at: z.ZodString;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
user_id: string;
|
|
41
|
-
org_id: string;
|
|
42
|
-
role: "owner" | "admin" | "member";
|
|
43
|
-
invited_email: string | null;
|
|
44
|
-
joined_at: string;
|
|
45
|
-
}, {
|
|
46
|
-
user_id: string;
|
|
47
|
-
org_id: string;
|
|
48
|
-
role: "owner" | "admin" | "member";
|
|
49
|
-
invited_email: string | null;
|
|
50
|
-
joined_at: string;
|
|
51
|
-
}>;
|
|
52
|
-
export type OrgMember = z.infer<typeof orgMemberSchema>;
|
|
53
|
-
/** Hydrated row used by the Teams panel — joins the auth user's email/name. */
|
|
54
|
-
export declare const orgMemberRowSchema: z.ZodObject<{
|
|
55
|
-
org_id: z.ZodString;
|
|
56
|
-
user_id: z.ZodString;
|
|
57
|
-
role: z.ZodEnum<["owner", "admin", "member"]>;
|
|
58
|
-
invited_email: z.ZodNullable<z.ZodString>;
|
|
59
|
-
joined_at: z.ZodString;
|
|
60
|
-
} & {
|
|
61
|
-
email: z.ZodNullable<z.ZodString>;
|
|
62
|
-
display_name: z.ZodNullable<z.ZodString>;
|
|
63
|
-
avatar_url: z.ZodNullable<z.ZodString>;
|
|
64
|
-
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
display_name: string | null;
|
|
66
|
-
avatar_url: string | null;
|
|
67
|
-
user_id: string;
|
|
68
|
-
email: string | null;
|
|
69
|
-
org_id: string;
|
|
70
|
-
role: "owner" | "admin" | "member";
|
|
71
|
-
invited_email: string | null;
|
|
72
|
-
joined_at: string;
|
|
73
|
-
}, {
|
|
74
|
-
display_name: string | null;
|
|
75
|
-
avatar_url: string | null;
|
|
76
|
-
user_id: string;
|
|
77
|
-
email: string | null;
|
|
78
|
-
org_id: string;
|
|
79
|
-
role: "owner" | "admin" | "member";
|
|
80
|
-
invited_email: string | null;
|
|
81
|
-
joined_at: string;
|
|
82
|
-
}>;
|
|
83
|
-
export type OrgMemberRow = z.infer<typeof orgMemberRowSchema>;
|
|
84
|
-
export declare const createOrgInputSchema: z.ZodObject<Pick<{
|
|
85
|
-
id: z.ZodString;
|
|
86
|
-
name: z.ZodString;
|
|
87
|
-
slug: z.ZodString;
|
|
88
|
-
owner_id: z.ZodString;
|
|
89
|
-
stripe_subscription_id: z.ZodNullable<z.ZodString>;
|
|
90
|
-
seats: z.ZodNumber;
|
|
91
|
-
created_at: z.ZodString;
|
|
92
|
-
updated_at: z.ZodString;
|
|
93
|
-
}, "name" | "slug">, "strip", z.ZodTypeAny, {
|
|
94
|
-
name: string;
|
|
95
|
-
slug: string;
|
|
96
|
-
}, {
|
|
97
|
-
name: string;
|
|
98
|
-
slug: string;
|
|
99
|
-
}>;
|
|
100
|
-
export type CreateOrgInput = z.infer<typeof createOrgInputSchema>;
|
|
101
|
-
export declare const addMemberInputSchema: z.ZodObject<{
|
|
102
|
-
email: z.ZodString;
|
|
103
|
-
role: z.ZodDefault<z.ZodEnum<["admin", "member"]>>;
|
|
104
|
-
}, "strip", z.ZodTypeAny, {
|
|
105
|
-
email: string;
|
|
106
|
-
role: "admin" | "member";
|
|
107
|
-
}, {
|
|
108
|
-
email: string;
|
|
109
|
-
role?: "admin" | "member" | undefined;
|
|
110
|
-
}>;
|
|
111
|
-
export type AddMemberInput = z.infer<typeof addMemberInputSchema>;
|
|
112
|
-
//# sourceMappingURL=org.schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"org.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/org.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,aAAa,yCAAuC,CAAA;AACjE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;EAapB,CAAA;AACF,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAA;AAE3C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EAM1B,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI7B,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAA6C,CAAA;AAC9E,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const orgRoleSchema = z.enum(['owner', 'admin', 'member']);
|
|
3
|
-
export const orgSchema = z.object({
|
|
4
|
-
id: z.string().uuid(),
|
|
5
|
-
name: z.string().min(1).max(120),
|
|
6
|
-
slug: z
|
|
7
|
-
.string()
|
|
8
|
-
.min(1)
|
|
9
|
-
.max(80)
|
|
10
|
-
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, 'slug must be kebab-case'),
|
|
11
|
-
owner_id: z.string().uuid(),
|
|
12
|
-
stripe_subscription_id: z.string().nullable(),
|
|
13
|
-
seats: z.number().int().positive(),
|
|
14
|
-
created_at: z.string().datetime(),
|
|
15
|
-
updated_at: z.string().datetime(),
|
|
16
|
-
});
|
|
17
|
-
export const orgMemberSchema = z.object({
|
|
18
|
-
org_id: z.string().uuid(),
|
|
19
|
-
user_id: z.string().uuid(),
|
|
20
|
-
role: orgRoleSchema,
|
|
21
|
-
invited_email: z.string().email().nullable(),
|
|
22
|
-
joined_at: z.string().datetime(),
|
|
23
|
-
});
|
|
24
|
-
/** Hydrated row used by the Teams panel — joins the auth user's email/name. */
|
|
25
|
-
export const orgMemberRowSchema = orgMemberSchema.extend({
|
|
26
|
-
email: z.string().email().nullable(),
|
|
27
|
-
display_name: z.string().nullable(),
|
|
28
|
-
avatar_url: z.string().nullable(),
|
|
29
|
-
});
|
|
30
|
-
export const createOrgInputSchema = orgSchema.pick({ name: true, slug: true });
|
|
31
|
-
export const addMemberInputSchema = z.object({
|
|
32
|
-
email: z.string().email(),
|
|
33
|
-
role: z.enum(['admin', 'member']).default('member'),
|
|
34
|
-
});
|