@timothyw/pat-common 1.0.18 → 1.0.20
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/types/api/account/get-user-config-types.d.ts +2 -2
- package/dist/types/api/account/get-user-types.d.ts +4 -0
- package/dist/types/api/account/get-user-types.js +2 -0
- package/dist/types/api/account/index.d.ts +2 -2
- package/dist/types/api/account/index.js +2 -2
- package/dist/types/api/account/update-user-config-types.d.ts +62 -40
- package/dist/types/api/account/update-user-config-types.js +1 -1
- package/dist/types/api/account/update-user-types.d.ts +108 -0
- package/dist/types/api/account/update-user-types.js +8 -0
- package/dist/types/api/auth/login-types.d.ts +2 -2
- package/dist/types/models/index.d.ts +1 -1
- package/dist/types/models/index.js +1 -1
- package/dist/types/models/program-config.d.ts +1 -1
- package/dist/types/models/user-data.d.ts +128 -0
- package/dist/types/models/user-data.js +38 -0
- package/package.json +1 -1
- package/src/types/api/account/get-user-types.ts +5 -0
- package/src/types/api/account/index.ts +2 -2
- package/src/types/api/account/update-user-types.ts +13 -0
- package/src/types/api/auth/login-types.ts +2 -2
- package/src/types/models/index.ts +1 -1
- package/src/types/models/item-data.ts +0 -1
- package/src/types/models/program-config.ts +1 -1
- package/src/types/models/{user-config.ts → user-data.ts} +16 -11
- package/src/types/api/account/get-user-config-types.ts +0 -5
- package/src/types/api/account/update-user-config-types.ts +0 -13
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './get-user-
|
|
2
|
-
export * from './update-user-
|
|
1
|
+
export * from './get-user-types';
|
|
2
|
+
export * from './update-user-types';
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-user-
|
|
18
|
-
__exportStar(require("./update-user-
|
|
17
|
+
__exportStar(require("./get-user-types"), exports);
|
|
18
|
+
__exportStar(require("./update-user-types"), exports);
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { UserData } from "../../models";
|
|
3
3
|
export declare const updateUserConfigRequestSchema: z.ZodObject<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
discordID: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
7
|
-
itemListTracking: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
8
|
-
channelId: z.ZodOptional<z.ZodString>;
|
|
9
|
-
messageId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
sandbox: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
5
|
+
discordId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
10
6
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
|
|
12
|
-
messageId?: string | undefined;
|
|
7
|
+
discordId?: string | undefined;
|
|
13
8
|
}, {
|
|
14
|
-
|
|
15
|
-
messageId?: string | undefined;
|
|
9
|
+
discordId?: string | undefined;
|
|
16
10
|
}>>>;
|
|
17
|
-
|
|
11
|
+
name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
13
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
18
14
|
panels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
19
15
|
type: z.ZodOptional<z.ZodNativeEnum<typeof import("../../..").PanelType>>;
|
|
20
16
|
visible: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -25,62 +21,88 @@ export declare const updateUserConfigRequestSchema: z.ZodObject<{
|
|
|
25
21
|
type?: import("../../..").PanelType | undefined;
|
|
26
22
|
visible?: boolean | undefined;
|
|
27
23
|
}>, "many">>;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
agenda: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
itemCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
itemTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
itemCategories?: string[] | undefined;
|
|
29
|
+
itemTypes?: string[] | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
itemCategories?: string[] | undefined;
|
|
32
|
+
itemTypes?: string[] | undefined;
|
|
33
|
+
}>>;
|
|
34
|
+
people: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
propertyKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
propertyKeys?: string[] | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
propertyKeys?: string[] | undefined;
|
|
40
|
+
}>>;
|
|
31
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
agenda?: {
|
|
43
|
+
itemCategories?: string[] | undefined;
|
|
44
|
+
itemTypes?: string[] | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
people?: {
|
|
47
|
+
propertyKeys?: string[] | undefined;
|
|
48
|
+
} | undefined;
|
|
32
49
|
panels?: {
|
|
33
50
|
type?: import("../../..").PanelType | undefined;
|
|
34
51
|
visible?: boolean | undefined;
|
|
35
52
|
}[] | undefined;
|
|
36
|
-
itemCategories?: string[] | undefined;
|
|
37
|
-
itemTypes?: string[] | undefined;
|
|
38
|
-
propertyKeys?: string[] | undefined;
|
|
39
53
|
}, {
|
|
54
|
+
agenda?: {
|
|
55
|
+
itemCategories?: string[] | undefined;
|
|
56
|
+
itemTypes?: string[] | undefined;
|
|
57
|
+
} | undefined;
|
|
58
|
+
people?: {
|
|
59
|
+
propertyKeys?: string[] | undefined;
|
|
60
|
+
} | undefined;
|
|
40
61
|
panels?: {
|
|
41
62
|
type?: import("../../..").PanelType | undefined;
|
|
42
63
|
visible?: boolean | undefined;
|
|
43
64
|
}[] | undefined;
|
|
44
|
-
itemCategories?: string[] | undefined;
|
|
45
|
-
itemTypes?: string[] | undefined;
|
|
46
|
-
propertyKeys?: string[] | undefined;
|
|
47
65
|
}>>;
|
|
48
66
|
}, "strict", z.ZodTypeAny, {
|
|
67
|
+
sandbox?: {
|
|
68
|
+
discordId?: string | undefined;
|
|
69
|
+
} | undefined;
|
|
49
70
|
name?: string | undefined;
|
|
50
71
|
timezone?: string | undefined;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
72
|
+
config?: {
|
|
73
|
+
agenda?: {
|
|
74
|
+
itemCategories?: string[] | undefined;
|
|
75
|
+
itemTypes?: string[] | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
people?: {
|
|
78
|
+
propertyKeys?: string[] | undefined;
|
|
79
|
+
} | undefined;
|
|
57
80
|
panels?: {
|
|
58
81
|
type?: import("../../..").PanelType | undefined;
|
|
59
82
|
visible?: boolean | undefined;
|
|
60
83
|
}[] | undefined;
|
|
61
|
-
itemCategories?: string[] | undefined;
|
|
62
|
-
itemTypes?: string[] | undefined;
|
|
63
|
-
propertyKeys?: string[] | undefined;
|
|
64
84
|
} | undefined;
|
|
65
85
|
}, {
|
|
86
|
+
sandbox?: {
|
|
87
|
+
discordId?: string | undefined;
|
|
88
|
+
} | undefined;
|
|
66
89
|
name?: string | undefined;
|
|
67
90
|
timezone?: string | undefined;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
91
|
+
config?: {
|
|
92
|
+
agenda?: {
|
|
93
|
+
itemCategories?: string[] | undefined;
|
|
94
|
+
itemTypes?: string[] | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
people?: {
|
|
97
|
+
propertyKeys?: string[] | undefined;
|
|
98
|
+
} | undefined;
|
|
74
99
|
panels?: {
|
|
75
100
|
type?: import("../../..").PanelType | undefined;
|
|
76
101
|
visible?: boolean | undefined;
|
|
77
102
|
}[] | undefined;
|
|
78
|
-
itemCategories?: string[] | undefined;
|
|
79
|
-
itemTypes?: string[] | undefined;
|
|
80
|
-
propertyKeys?: string[] | undefined;
|
|
81
103
|
} | undefined;
|
|
82
104
|
}>;
|
|
83
105
|
export type UpdateUserConfigRequest = z.infer<typeof updateUserConfigRequestSchema>;
|
|
84
106
|
export interface UpdateUserConfigResponse {
|
|
85
|
-
user:
|
|
107
|
+
user: UserData;
|
|
86
108
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateUserConfigRequestSchema = void 0;
|
|
4
4
|
const models_1 = require("../../models");
|
|
5
|
-
exports.updateUserConfigRequestSchema = models_1.
|
|
5
|
+
exports.updateUserConfigRequestSchema = models_1.userDataSchema
|
|
6
6
|
.omit({ _id: true, createdAt: true, updatedAt: true })
|
|
7
7
|
.deepPartial()
|
|
8
8
|
.strict();
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { UserData } from "../../models";
|
|
3
|
+
export declare const updateUserRequestSchema: z.ZodObject<{
|
|
4
|
+
sandbox: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
5
|
+
discordId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
discordId?: string | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
discordId?: string | undefined;
|
|
10
|
+
}>>>;
|
|
11
|
+
name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
13
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
panels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
+
type: z.ZodOptional<z.ZodNativeEnum<typeof import("../../..").PanelType>>;
|
|
16
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
type?: import("../../..").PanelType | undefined;
|
|
19
|
+
visible?: boolean | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
type?: import("../../..").PanelType | undefined;
|
|
22
|
+
visible?: boolean | undefined;
|
|
23
|
+
}>, "many">>;
|
|
24
|
+
agenda: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
itemCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
itemTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
itemCategories?: string[] | undefined;
|
|
29
|
+
itemTypes?: string[] | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
itemCategories?: string[] | undefined;
|
|
32
|
+
itemTypes?: string[] | undefined;
|
|
33
|
+
}>>;
|
|
34
|
+
people: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
propertyKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
propertyKeys?: string[] | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
propertyKeys?: string[] | undefined;
|
|
40
|
+
}>>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
agenda?: {
|
|
43
|
+
itemCategories?: string[] | undefined;
|
|
44
|
+
itemTypes?: string[] | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
people?: {
|
|
47
|
+
propertyKeys?: string[] | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
panels?: {
|
|
50
|
+
type?: import("../../..").PanelType | undefined;
|
|
51
|
+
visible?: boolean | undefined;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
agenda?: {
|
|
55
|
+
itemCategories?: string[] | undefined;
|
|
56
|
+
itemTypes?: string[] | undefined;
|
|
57
|
+
} | undefined;
|
|
58
|
+
people?: {
|
|
59
|
+
propertyKeys?: string[] | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
panels?: {
|
|
62
|
+
type?: import("../../..").PanelType | undefined;
|
|
63
|
+
visible?: boolean | undefined;
|
|
64
|
+
}[] | undefined;
|
|
65
|
+
}>>;
|
|
66
|
+
}, "strict", z.ZodTypeAny, {
|
|
67
|
+
sandbox?: {
|
|
68
|
+
discordId?: string | undefined;
|
|
69
|
+
} | undefined;
|
|
70
|
+
name?: string | undefined;
|
|
71
|
+
timezone?: string | undefined;
|
|
72
|
+
config?: {
|
|
73
|
+
agenda?: {
|
|
74
|
+
itemCategories?: string[] | undefined;
|
|
75
|
+
itemTypes?: string[] | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
people?: {
|
|
78
|
+
propertyKeys?: string[] | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
panels?: {
|
|
81
|
+
type?: import("../../..").PanelType | undefined;
|
|
82
|
+
visible?: boolean | undefined;
|
|
83
|
+
}[] | undefined;
|
|
84
|
+
} | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
sandbox?: {
|
|
87
|
+
discordId?: string | undefined;
|
|
88
|
+
} | undefined;
|
|
89
|
+
name?: string | undefined;
|
|
90
|
+
timezone?: string | undefined;
|
|
91
|
+
config?: {
|
|
92
|
+
agenda?: {
|
|
93
|
+
itemCategories?: string[] | undefined;
|
|
94
|
+
itemTypes?: string[] | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
people?: {
|
|
97
|
+
propertyKeys?: string[] | undefined;
|
|
98
|
+
} | undefined;
|
|
99
|
+
panels?: {
|
|
100
|
+
type?: import("../../..").PanelType | undefined;
|
|
101
|
+
visible?: boolean | undefined;
|
|
102
|
+
}[] | undefined;
|
|
103
|
+
} | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
export type UpdateUserRequest = z.infer<typeof updateUserRequestSchema>;
|
|
106
|
+
export interface UpdateUserConfigResponse {
|
|
107
|
+
user: UserData;
|
|
108
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateUserRequestSchema = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
exports.updateUserRequestSchema = models_1.userDataSchema
|
|
6
|
+
.omit({ _id: true, createdAt: true, updatedAt: true })
|
|
7
|
+
.deepPartial()
|
|
8
|
+
.strict();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AuthTokens } from "../../auth-tokens";
|
|
3
|
-
import { PublicAuthData,
|
|
3
|
+
import { PublicAuthData, UserData } from "../../models";
|
|
4
4
|
export declare const loginRequestSchema: z.ZodObject<{
|
|
5
5
|
email: z.ZodString;
|
|
6
6
|
password: z.ZodString;
|
|
@@ -15,5 +15,5 @@ export type LoginRequest = z.infer<typeof loginRequestSchema>;
|
|
|
15
15
|
export interface LoginResponse {
|
|
16
16
|
tokenData: AuthTokens;
|
|
17
17
|
authData: PublicAuthData;
|
|
18
|
-
user:
|
|
18
|
+
user: UserData;
|
|
19
19
|
}
|
|
@@ -19,4 +19,4 @@ __exportStar(require("./item-data"), exports);
|
|
|
19
19
|
__exportStar(require("./person-data"), exports);
|
|
20
20
|
__exportStar(require("./program-config"), exports);
|
|
21
21
|
__exportStar(require("./thought-data"), exports);
|
|
22
|
-
__exportStar(require("./user-
|
|
22
|
+
__exportStar(require("./user-data"), exports);
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PanelType } from "../../enums";
|
|
3
|
+
declare const panelSchema: z.ZodObject<{
|
|
4
|
+
type: z.ZodNativeEnum<typeof PanelType>;
|
|
5
|
+
visible: z.ZodBoolean;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
type: PanelType;
|
|
8
|
+
visible: boolean;
|
|
9
|
+
}, {
|
|
10
|
+
type: PanelType;
|
|
11
|
+
visible: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const userDataSchema: z.ZodObject<{
|
|
14
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
15
|
+
createdAt: z.ZodDate;
|
|
16
|
+
updatedAt: z.ZodDate;
|
|
17
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
discordId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
discordId?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
discordId?: string | undefined;
|
|
23
|
+
}>>;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
timezone: z.ZodEffects<z.ZodString, string, string>;
|
|
26
|
+
config: z.ZodObject<{
|
|
27
|
+
panels: z.ZodArray<z.ZodObject<{
|
|
28
|
+
type: z.ZodNativeEnum<typeof PanelType>;
|
|
29
|
+
visible: z.ZodBoolean;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
type: PanelType;
|
|
32
|
+
visible: boolean;
|
|
33
|
+
}, {
|
|
34
|
+
type: PanelType;
|
|
35
|
+
visible: boolean;
|
|
36
|
+
}>, "many">;
|
|
37
|
+
agenda: z.ZodObject<{
|
|
38
|
+
itemCategories: z.ZodArray<z.ZodString, "many">;
|
|
39
|
+
itemTypes: z.ZodArray<z.ZodString, "many">;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
itemCategories: string[];
|
|
42
|
+
itemTypes: string[];
|
|
43
|
+
}, {
|
|
44
|
+
itemCategories: string[];
|
|
45
|
+
itemTypes: string[];
|
|
46
|
+
}>;
|
|
47
|
+
people: z.ZodObject<{
|
|
48
|
+
propertyKeys: z.ZodArray<z.ZodString, "many">;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
propertyKeys: string[];
|
|
51
|
+
}, {
|
|
52
|
+
propertyKeys: string[];
|
|
53
|
+
}>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
agenda: {
|
|
56
|
+
itemCategories: string[];
|
|
57
|
+
itemTypes: string[];
|
|
58
|
+
};
|
|
59
|
+
people: {
|
|
60
|
+
propertyKeys: string[];
|
|
61
|
+
};
|
|
62
|
+
panels: {
|
|
63
|
+
type: PanelType;
|
|
64
|
+
visible: boolean;
|
|
65
|
+
}[];
|
|
66
|
+
}, {
|
|
67
|
+
agenda: {
|
|
68
|
+
itemCategories: string[];
|
|
69
|
+
itemTypes: string[];
|
|
70
|
+
};
|
|
71
|
+
people: {
|
|
72
|
+
propertyKeys: string[];
|
|
73
|
+
};
|
|
74
|
+
panels: {
|
|
75
|
+
type: PanelType;
|
|
76
|
+
visible: boolean;
|
|
77
|
+
}[];
|
|
78
|
+
}>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
_id: string & {
|
|
81
|
+
readonly __brand: "UserId";
|
|
82
|
+
};
|
|
83
|
+
createdAt: Date;
|
|
84
|
+
updatedAt: Date;
|
|
85
|
+
name: string;
|
|
86
|
+
timezone: string;
|
|
87
|
+
config: {
|
|
88
|
+
agenda: {
|
|
89
|
+
itemCategories: string[];
|
|
90
|
+
itemTypes: string[];
|
|
91
|
+
};
|
|
92
|
+
people: {
|
|
93
|
+
propertyKeys: string[];
|
|
94
|
+
};
|
|
95
|
+
panels: {
|
|
96
|
+
type: PanelType;
|
|
97
|
+
visible: boolean;
|
|
98
|
+
}[];
|
|
99
|
+
};
|
|
100
|
+
sandbox?: {
|
|
101
|
+
discordId?: string | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
}, {
|
|
104
|
+
_id: string;
|
|
105
|
+
createdAt: Date;
|
|
106
|
+
updatedAt: Date;
|
|
107
|
+
name: string;
|
|
108
|
+
timezone: string;
|
|
109
|
+
config: {
|
|
110
|
+
agenda: {
|
|
111
|
+
itemCategories: string[];
|
|
112
|
+
itemTypes: string[];
|
|
113
|
+
};
|
|
114
|
+
people: {
|
|
115
|
+
propertyKeys: string[];
|
|
116
|
+
};
|
|
117
|
+
panels: {
|
|
118
|
+
type: PanelType;
|
|
119
|
+
visible: boolean;
|
|
120
|
+
}[];
|
|
121
|
+
};
|
|
122
|
+
sandbox?: {
|
|
123
|
+
discordId?: string | undefined;
|
|
124
|
+
} | undefined;
|
|
125
|
+
}>;
|
|
126
|
+
export type Panel = z.infer<typeof panelSchema>;
|
|
127
|
+
export type UserData = z.infer<typeof userDataSchema>;
|
|
128
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userDataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../id-types");
|
|
6
|
+
const enums_1 = require("../../enums");
|
|
7
|
+
const panelSchema = zod_1.z.object({
|
|
8
|
+
type: zod_1.z.nativeEnum(enums_1.PanelType),
|
|
9
|
+
visible: zod_1.z.boolean()
|
|
10
|
+
});
|
|
11
|
+
exports.userDataSchema = zod_1.z.object({
|
|
12
|
+
_id: id_types_1.userIdSchema,
|
|
13
|
+
createdAt: zod_1.z.date(),
|
|
14
|
+
updatedAt: zod_1.z.date(),
|
|
15
|
+
sandbox: zod_1.z.object({
|
|
16
|
+
discordId: zod_1.z.string().optional()
|
|
17
|
+
}).optional(),
|
|
18
|
+
name: zod_1.z.string().min(1),
|
|
19
|
+
timezone: zod_1.z.string().refine((tz) => {
|
|
20
|
+
try {
|
|
21
|
+
Intl.DateTimeFormat(undefined, { timeZone: tz });
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
catch (e) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}, { message: "Invalid timezone" }),
|
|
28
|
+
config: zod_1.z.object({
|
|
29
|
+
panels: zod_1.z.array(panelSchema),
|
|
30
|
+
agenda: zod_1.z.object({
|
|
31
|
+
itemCategories: zod_1.z.array(zod_1.z.string()),
|
|
32
|
+
itemTypes: zod_1.z.array(zod_1.z.string())
|
|
33
|
+
}),
|
|
34
|
+
people: zod_1.z.object({
|
|
35
|
+
propertyKeys: zod_1.z.array(zod_1.z.string())
|
|
36
|
+
}),
|
|
37
|
+
})
|
|
38
|
+
});
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './get-user-
|
|
2
|
-
export * from './update-user-
|
|
1
|
+
export * from './get-user-types';
|
|
2
|
+
export * from './update-user-types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { UserData, userDataSchema } from "../../models";
|
|
3
|
+
|
|
4
|
+
export const updateUserRequestSchema = userDataSchema
|
|
5
|
+
.omit({ _id: true, createdAt: true, updatedAt: true })
|
|
6
|
+
.deepPartial()
|
|
7
|
+
.strict();
|
|
8
|
+
|
|
9
|
+
export type UpdateUserRequest = z.infer<typeof updateUserRequestSchema>;
|
|
10
|
+
|
|
11
|
+
export interface UpdateUserConfigResponse {
|
|
12
|
+
user: UserData
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AuthTokens } from "../../auth-tokens";
|
|
3
|
-
import { PublicAuthData,
|
|
3
|
+
import { PublicAuthData, UserData } from "../../models";
|
|
4
4
|
|
|
5
5
|
export const loginRequestSchema = z.object({
|
|
6
6
|
email: z.string().email(),
|
|
@@ -12,5 +12,5 @@ export type LoginRequest = z.infer<typeof loginRequestSchema>;
|
|
|
12
12
|
export interface LoginResponse {
|
|
13
13
|
tokenData: AuthTokens;
|
|
14
14
|
authData: PublicAuthData;
|
|
15
|
-
user:
|
|
15
|
+
user: UserData;
|
|
16
16
|
}
|
|
@@ -7,10 +7,15 @@ const panelSchema = z.object({
|
|
|
7
7
|
visible: z.boolean()
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
export const
|
|
10
|
+
export const userDataSchema = z.object({
|
|
11
11
|
_id: userIdSchema,
|
|
12
12
|
createdAt: z.date(),
|
|
13
13
|
updatedAt: z.date(),
|
|
14
|
+
|
|
15
|
+
sandbox: z.object({
|
|
16
|
+
discordId: z.string().optional()
|
|
17
|
+
}).optional(),
|
|
18
|
+
|
|
14
19
|
name: z.string().min(1),
|
|
15
20
|
timezone: z.string().refine((tz: string) => {
|
|
16
21
|
try {
|
|
@@ -20,18 +25,18 @@ export const userConfigSchema = z.object({
|
|
|
20
25
|
return false;
|
|
21
26
|
}
|
|
22
27
|
}, { message: "Invalid timezone" }),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
channelId: z.string(),
|
|
26
|
-
messageId: z.string()
|
|
27
|
-
}).optional(),
|
|
28
|
-
iosApp: z.object({
|
|
28
|
+
|
|
29
|
+
config: z.object({
|
|
29
30
|
panels: z.array(panelSchema),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
agenda: z.object({
|
|
32
|
+
itemCategories: z.array(z.string()),
|
|
33
|
+
itemTypes: z.array(z.string())
|
|
34
|
+
}),
|
|
35
|
+
people: z.object({
|
|
36
|
+
propertyKeys: z.array(z.string())
|
|
37
|
+
}),
|
|
33
38
|
})
|
|
34
39
|
});
|
|
35
40
|
|
|
36
41
|
export type Panel = z.infer<typeof panelSchema>;
|
|
37
|
-
export type
|
|
42
|
+
export type UserData = z.infer<typeof userDataSchema>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { UserConfig, userConfigSchema } from "../../models";
|
|
3
|
-
|
|
4
|
-
export const updateUserConfigRequestSchema = userConfigSchema
|
|
5
|
-
.omit({ _id: true, createdAt: true, updatedAt: true })
|
|
6
|
-
.deepPartial()
|
|
7
|
-
.strict();
|
|
8
|
-
|
|
9
|
-
export type UpdateUserConfigRequest = z.infer<typeof updateUserConfigRequestSchema>;
|
|
10
|
-
|
|
11
|
-
export interface UpdateUserConfigResponse {
|
|
12
|
-
user: UserConfig
|
|
13
|
-
}
|