@timothyw/pat-common 1.0.23 → 1.0.25
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.
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { UserData } from "../../models";
|
|
3
3
|
export declare const updateUserRequestSchema: z.ZodObject<{
|
|
4
|
-
sandbox: z.ZodOptional<z.
|
|
4
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
5
5
|
discordId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
6
|
+
devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7
|
+
pushToken: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
pushToken?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
pushToken?: string | undefined;
|
|
12
|
+
}>, "many">>;
|
|
6
13
|
}, "strip", z.ZodTypeAny, {
|
|
7
14
|
discordId?: string | undefined;
|
|
15
|
+
devices?: {
|
|
16
|
+
pushToken?: string | undefined;
|
|
17
|
+
}[] | undefined;
|
|
8
18
|
}, {
|
|
9
19
|
discordId?: string | undefined;
|
|
10
|
-
|
|
20
|
+
devices?: {
|
|
21
|
+
pushToken?: string | undefined;
|
|
22
|
+
}[] | undefined;
|
|
23
|
+
}>>;
|
|
11
24
|
name: z.ZodOptional<z.ZodString>;
|
|
12
25
|
timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
13
26
|
config: z.ZodOptional<z.ZodObject<{
|
|
@@ -66,6 +79,9 @@ export declare const updateUserRequestSchema: z.ZodObject<{
|
|
|
66
79
|
}, "strict", z.ZodTypeAny, {
|
|
67
80
|
sandbox?: {
|
|
68
81
|
discordId?: string | undefined;
|
|
82
|
+
devices?: {
|
|
83
|
+
pushToken?: string | undefined;
|
|
84
|
+
}[] | undefined;
|
|
69
85
|
} | undefined;
|
|
70
86
|
name?: string | undefined;
|
|
71
87
|
timezone?: string | undefined;
|
|
@@ -85,6 +101,9 @@ export declare const updateUserRequestSchema: z.ZodObject<{
|
|
|
85
101
|
}, {
|
|
86
102
|
sandbox?: {
|
|
87
103
|
discordId?: string | undefined;
|
|
104
|
+
devices?: {
|
|
105
|
+
pushToken?: string | undefined;
|
|
106
|
+
}[] | undefined;
|
|
88
107
|
} | undefined;
|
|
89
108
|
name?: string | undefined;
|
|
90
109
|
timezone?: string | undefined;
|
|
@@ -14,13 +14,26 @@ export declare const userDataSchema: z.ZodObject<{
|
|
|
14
14
|
_id: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
15
15
|
createdAt: z.ZodDate;
|
|
16
16
|
updatedAt: z.ZodDate;
|
|
17
|
-
sandbox: z.
|
|
17
|
+
sandbox: z.ZodObject<{
|
|
18
18
|
discordId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
20
|
+
pushToken: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
pushToken: string;
|
|
23
|
+
}, {
|
|
24
|
+
pushToken: string;
|
|
25
|
+
}>, "many">;
|
|
19
26
|
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
devices: {
|
|
28
|
+
pushToken: string;
|
|
29
|
+
}[];
|
|
20
30
|
discordId?: string | undefined;
|
|
21
31
|
}, {
|
|
32
|
+
devices: {
|
|
33
|
+
pushToken: string;
|
|
34
|
+
}[];
|
|
22
35
|
discordId?: string | undefined;
|
|
23
|
-
}
|
|
36
|
+
}>;
|
|
24
37
|
name: z.ZodString;
|
|
25
38
|
timezone: z.ZodEffects<z.ZodString, string, string>;
|
|
26
39
|
config: z.ZodObject<{
|
|
@@ -82,6 +95,12 @@ export declare const userDataSchema: z.ZodObject<{
|
|
|
82
95
|
};
|
|
83
96
|
createdAt: Date;
|
|
84
97
|
updatedAt: Date;
|
|
98
|
+
sandbox: {
|
|
99
|
+
devices: {
|
|
100
|
+
pushToken: string;
|
|
101
|
+
}[];
|
|
102
|
+
discordId?: string | undefined;
|
|
103
|
+
};
|
|
85
104
|
name: string;
|
|
86
105
|
timezone: string;
|
|
87
106
|
config: {
|
|
@@ -97,13 +116,16 @@ export declare const userDataSchema: z.ZodObject<{
|
|
|
97
116
|
visible: boolean;
|
|
98
117
|
}[];
|
|
99
118
|
};
|
|
100
|
-
sandbox?: {
|
|
101
|
-
discordId?: string | undefined;
|
|
102
|
-
} | undefined;
|
|
103
119
|
}, {
|
|
104
120
|
_id: string;
|
|
105
121
|
createdAt: Date;
|
|
106
122
|
updatedAt: Date;
|
|
123
|
+
sandbox: {
|
|
124
|
+
devices: {
|
|
125
|
+
pushToken: string;
|
|
126
|
+
}[];
|
|
127
|
+
discordId?: string | undefined;
|
|
128
|
+
};
|
|
107
129
|
name: string;
|
|
108
130
|
timezone: string;
|
|
109
131
|
config: {
|
|
@@ -119,9 +141,6 @@ export declare const userDataSchema: z.ZodObject<{
|
|
|
119
141
|
visible: boolean;
|
|
120
142
|
}[];
|
|
121
143
|
};
|
|
122
|
-
sandbox?: {
|
|
123
|
-
discordId?: string | undefined;
|
|
124
|
-
} | undefined;
|
|
125
144
|
}>;
|
|
126
145
|
export type Module = z.infer<typeof moduleSchema>;
|
|
127
146
|
export type UserData = z.infer<typeof userDataSchema>;
|
|
@@ -8,13 +8,17 @@ const moduleSchema = zod_1.z.object({
|
|
|
8
8
|
type: zod_1.z.nativeEnum(enums_1.ModuleType),
|
|
9
9
|
visible: zod_1.z.boolean()
|
|
10
10
|
});
|
|
11
|
+
const deviceSchema = zod_1.z.object({
|
|
12
|
+
pushToken: zod_1.z.string()
|
|
13
|
+
});
|
|
11
14
|
exports.userDataSchema = zod_1.z.object({
|
|
12
15
|
_id: id_types_1.userIdSchema,
|
|
13
16
|
createdAt: zod_1.z.date(),
|
|
14
17
|
updatedAt: zod_1.z.date(),
|
|
15
18
|
sandbox: zod_1.z.object({
|
|
16
|
-
discordId: zod_1.z.string().optional()
|
|
17
|
-
|
|
19
|
+
discordId: zod_1.z.string().optional(),
|
|
20
|
+
devices: zod_1.z.array(deviceSchema)
|
|
21
|
+
}),
|
|
18
22
|
name: zod_1.z.string().min(1),
|
|
19
23
|
timezone: zod_1.z.string().refine((tz) => {
|
|
20
24
|
try {
|
package/package.json
CHANGED
|
@@ -7,14 +7,19 @@ const moduleSchema = z.object({
|
|
|
7
7
|
visible: z.boolean()
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
+
const deviceSchema = z.object({
|
|
11
|
+
pushToken: z.string()
|
|
12
|
+
});
|
|
13
|
+
|
|
10
14
|
export const userDataSchema = z.object({
|
|
11
15
|
_id: userIdSchema,
|
|
12
16
|
createdAt: z.date(),
|
|
13
17
|
updatedAt: z.date(),
|
|
14
18
|
|
|
15
19
|
sandbox: z.object({
|
|
16
|
-
discordId: z.string().optional()
|
|
17
|
-
|
|
20
|
+
discordId: z.string().optional(),
|
|
21
|
+
devices: z.array(deviceSchema)
|
|
22
|
+
}),
|
|
18
23
|
|
|
19
24
|
name: z.string().min(1),
|
|
20
25
|
timezone: z.string().refine((tz: string) => {
|