@timothyw/pat-common 1.0.113 → 1.0.116
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/id-types.d.ts +2 -2
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.js +4 -3
- package/dist/types/new/agenda-types.d.ts +116 -0
- package/dist/types/new/agenda-types.js +37 -0
- package/dist/types/new/auth-types.d.ts +153 -0
- package/dist/types/new/auth-types.js +48 -0
- package/dist/types/new/habits-types.d.ts +317 -0
- package/dist/types/new/habits-types.js +70 -0
- package/dist/types/new/index.d.ts +10 -0
- package/dist/types/new/index.js +26 -0
- package/dist/types/new/lists-types.d.ts +164 -0
- package/dist/types/new/lists-types.js +50 -0
- package/dist/types/new/misc/index.d.ts +1 -0
- package/dist/types/new/misc/index.js +17 -0
- package/dist/types/new/misc/version-types.d.ts +26 -0
- package/dist/types/new/misc/version-types.js +13 -0
- package/dist/types/new/notifications-types.d.ts +407 -0
- package/dist/types/new/notifications-types.js +91 -0
- package/dist/types/new/people-types.d.ts +285 -0
- package/dist/types/new/people-types.js +58 -0
- package/dist/types/new/program-config-types.d.ts +105 -0
- package/dist/types/new/program-config-types.js +29 -0
- package/dist/types/new/thoughts-types.d.ts +57 -0
- package/dist/types/new/thoughts-types.js +18 -0
- package/dist/types/new/user-types.d.ts +283 -0
- package/dist/types/new/user-types.js +46 -0
- package/dist/types/old/api/account/get-user-types.d.ts +5 -0
- package/dist/types/old/api/account/get-user-types.js +2 -0
- package/dist/types/old/api/account/index.d.ts +2 -0
- package/dist/types/old/api/account/index.js +18 -0
- package/dist/types/old/api/account/update-user-types.d.ts +128 -0
- package/dist/types/old/api/account/update-user-types.js +8 -0
- package/dist/types/old/api/auth/create-account-types.d.ts +24 -0
- package/dist/types/old/api/auth/create-account-types.js +10 -0
- package/dist/types/old/api/auth/index.d.ts +5 -0
- package/dist/types/old/api/auth/index.js +21 -0
- package/dist/types/old/api/auth/refresh-auth-types.d.ts +15 -0
- package/dist/types/old/api/auth/refresh-auth-types.js +7 -0
- package/dist/types/old/api/auth/resend-verification-types.d.ts +3 -0
- package/dist/types/old/api/auth/resend-verification-types.js +2 -0
- package/dist/types/old/api/auth/sign-in-types.d.ts +19 -0
- package/dist/types/old/api/auth/sign-in-types.js +8 -0
- package/dist/types/old/api/auth/verify-email-types.d.ts +3 -0
- package/dist/types/old/api/auth/verify-email-types.js +2 -0
- package/dist/types/old/api/habits/create-habit-entry-types.d.ts +19 -0
- package/dist/types/old/api/habits/create-habit-entry-types.js +10 -0
- package/dist/types/old/api/habits/create-habit-types.d.ts +26 -0
- package/dist/types/old/api/habits/create-habit-types.js +12 -0
- package/dist/types/old/api/habits/delete-habit-entry-types.d.ts +5 -0
- package/dist/types/old/api/habits/delete-habit-entry-types.js +2 -0
- package/dist/types/old/api/habits/delete-habit-types.d.ts +3 -0
- package/dist/types/old/api/habits/delete-habit-types.js +2 -0
- package/dist/types/old/api/habits/get-habits-types.d.ts +5 -0
- package/dist/types/old/api/habits/get-habits-types.js +2 -0
- package/dist/types/old/api/habits/index.d.ts +6 -0
- package/dist/types/old/api/habits/index.js +22 -0
- package/dist/types/old/api/habits/update-habit-types.d.ts +26 -0
- package/dist/types/old/api/habits/update-habit-types.js +12 -0
- package/dist/types/old/api/index.d.ts +9 -0
- package/dist/types/old/api/index.js +25 -0
- package/dist/types/old/api/items/complete-item-types.d.ts +14 -0
- package/dist/types/old/api/items/complete-item-types.js +7 -0
- package/dist/types/old/api/items/create-item-types.d.ts +29 -0
- package/dist/types/old/api/items/create-item-types.js +12 -0
- package/dist/types/old/api/items/delete-item-types.d.ts +3 -0
- package/dist/types/old/api/items/delete-item-types.js +2 -0
- package/dist/types/old/api/items/get-items-types.d.ts +5 -0
- package/dist/types/old/api/items/get-items-types.js +2 -0
- package/dist/types/old/api/items/index.d.ts +5 -0
- package/dist/types/old/api/items/index.js +21 -0
- package/dist/types/old/api/items/update-item-types.d.ts +29 -0
- package/dist/types/old/api/items/update-item-types.js +12 -0
- package/dist/types/old/api/lists/complete-list-item-types.d.ts +14 -0
- package/dist/types/old/api/lists/complete-list-item-types.js +7 -0
- package/dist/types/old/api/lists/create-list-item-types.d.ts +22 -0
- package/dist/types/old/api/lists/create-list-item-types.js +10 -0
- package/dist/types/old/api/lists/create-list-types.d.ts +17 -0
- package/dist/types/old/api/lists/create-list-types.js +9 -0
- package/dist/types/old/api/lists/get-list-item-types.d.ts +5 -0
- package/dist/types/old/api/lists/get-list-item-types.js +2 -0
- package/dist/types/old/api/lists/get-lists-types.d.ts +5 -0
- package/dist/types/old/api/lists/get-lists-types.js +2 -0
- package/dist/types/old/api/lists/index.d.ts +7 -0
- package/dist/types/old/api/lists/index.js +23 -0
- package/dist/types/old/api/lists/update-list-item-types.d.ts +23 -0
- package/dist/types/old/api/lists/update-list-item-types.js +11 -0
- package/dist/types/old/api/lists/update-list-types.d.ts +17 -0
- package/dist/types/old/api/lists/update-list-types.js +9 -0
- package/dist/types/old/api/misc/index.d.ts +1 -0
- package/dist/types/old/api/misc/index.js +17 -0
- package/dist/types/old/api/misc/version-types.d.ts +9 -0
- package/dist/types/old/api/misc/version-types.js +2 -0
- package/dist/types/old/api/notifications/create-notification-template-types.d.ts +78 -0
- package/dist/types/old/api/notifications/create-notification-template-types.js +25 -0
- package/dist/types/old/api/notifications/delete-notification-template-types.d.ts +5 -0
- package/dist/types/old/api/notifications/delete-notification-template-types.js +6 -0
- package/dist/types/old/api/notifications/get-notification-templates-types.d.ts +8 -0
- package/dist/types/old/api/notifications/get-notification-templates-types.js +6 -0
- package/dist/types/old/api/notifications/index.d.ts +6 -0
- package/dist/types/old/api/notifications/index.js +22 -0
- package/dist/types/old/api/notifications/preview-notification-template-types.d.ts +29 -0
- package/dist/types/old/api/notifications/preview-notification-template-types.js +12 -0
- package/dist/types/old/api/notifications/sync-notification-template-types.d.ts +14 -0
- package/dist/types/old/api/notifications/sync-notification-template-types.js +8 -0
- package/dist/types/old/api/notifications/update-notification-template-types.d.ts +69 -0
- package/dist/types/old/api/notifications/update-notification-template-types.js +22 -0
- package/dist/types/old/api/people/create-person-note-types.d.ts +19 -0
- package/dist/types/old/api/people/create-person-note-types.js +9 -0
- package/dist/types/old/api/people/create-person-types.d.ts +35 -0
- package/dist/types/old/api/people/create-person-types.js +13 -0
- package/dist/types/old/api/people/delete-person-notes-types.d.ts +3 -0
- package/dist/types/old/api/people/delete-person-notes-types.js +2 -0
- package/dist/types/old/api/people/delete-person-types.d.ts +3 -0
- package/dist/types/old/api/people/delete-person-types.js +2 -0
- package/dist/types/old/api/people/get-people-types.d.ts +5 -0
- package/dist/types/old/api/people/get-people-types.js +2 -0
- package/dist/types/old/api/people/get-person-notes-types.d.ts +5 -0
- package/dist/types/old/api/people/get-person-notes-types.js +2 -0
- package/dist/types/old/api/people/index.d.ts +8 -0
- package/dist/types/old/api/people/index.js +24 -0
- package/dist/types/old/api/people/update-person-note-types.d.ts +14 -0
- package/dist/types/old/api/people/update-person-note-types.js +7 -0
- package/dist/types/old/api/people/update-person-types.d.ts +35 -0
- package/dist/types/old/api/people/update-person-types.js +13 -0
- package/dist/types/old/api/thoughts/create-thought-types.d.ts +14 -0
- package/dist/types/old/api/thoughts/create-thought-types.js +7 -0
- package/dist/types/old/api/thoughts/delete-thought-types.d.ts +3 -0
- package/dist/types/old/api/thoughts/delete-thought-types.js +2 -0
- package/dist/types/old/api/thoughts/get-thoughts-types.d.ts +5 -0
- package/dist/types/old/api/thoughts/get-thoughts-types.js +2 -0
- package/dist/types/old/api/thoughts/index.d.ts +4 -0
- package/dist/types/old/api/thoughts/index.js +20 -0
- package/dist/types/old/api/thoughts/update-thought-types.d.ts +14 -0
- package/dist/types/old/api/thoughts/update-thought-types.js +7 -0
- package/dist/types/old/auth-tokens.d.ts +11 -0
- package/dist/types/old/auth-tokens.js +2 -0
- package/dist/types/old/models/auth-data.d.ts +14 -0
- package/dist/types/old/models/auth-data.js +9 -0
- package/dist/types/old/models/habit-data.d.ts +48 -0
- package/dist/types/old/models/habit-data.js +25 -0
- package/dist/types/old/models/index.d.ts +10 -0
- package/dist/types/old/models/index.js +26 -0
- package/dist/types/old/models/item-data.d.ts +14 -0
- package/dist/types/old/models/item-data.js +2 -0
- package/dist/types/old/models/list-data.d.ts +23 -0
- package/dist/types/old/models/list-data.js +8 -0
- package/dist/types/old/models/notifiable.d.ts +42 -0
- package/dist/types/old/models/notifiable.js +2 -0
- package/dist/types/old/models/notification-template-data.d.ts +224 -0
- package/dist/types/old/models/notification-template-data.js +52 -0
- package/dist/types/old/models/person-data.d.ts +31 -0
- package/dist/types/old/models/person-data.js +2 -0
- package/dist/types/old/models/program-config.d.ts +25 -0
- package/dist/types/old/models/program-config.js +2 -0
- package/dist/types/old/models/thought-data.d.ts +8 -0
- package/dist/types/old/models/thought-data.js +2 -0
- package/dist/types/old/models/user-data.d.ts +147 -0
- package/dist/types/old/models/user-data.js +42 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/type-helpers.d.ts +4 -0
- package/dist/utils/type-helpers.js +19 -0
- package/package.json +1 -1
- package/src/types/id-types.ts +2 -2
- package/src/types/index.ts +4 -3
- package/src/types/new/agenda-types.ts +69 -0
- package/src/types/new/auth-types.ts +92 -0
- package/src/types/new/habits-types.ts +112 -0
- package/src/types/new/index.ts +10 -0
- package/src/types/new/lists-types.ts +108 -0
- package/src/types/new/misc/index.ts +1 -0
- package/src/types/new/misc/version-types.ts +15 -0
- package/src/types/new/notifications-types.ts +144 -0
- package/src/types/new/people-types.ts +110 -0
- package/src/types/new/program-config-types.ts +29 -0
- package/src/types/new/thoughts-types.ts +44 -0
- package/src/types/new/user-types.ts +61 -0
- package/src/types/{api → old/api}/account/get-user-types.ts +1 -1
- package/src/types/{api → old/api}/account/update-user-types.ts +1 -1
- package/src/types/{api → old/api}/auth/create-account-types.ts +1 -1
- package/src/types/{api → old/api}/habits/create-habit-entry-types.ts +2 -2
- package/src/types/{api → old/api}/habits/create-habit-types.ts +1 -1
- package/src/types/{api → old/api}/habits/delete-habit-entry-types.ts +1 -1
- package/src/types/{api → old/api}/habits/get-habits-types.ts +1 -1
- package/src/types/{api → old/api}/habits/update-habit-types.ts +1 -1
- package/src/types/{api → old/api}/items/complete-item-types.ts +1 -1
- package/src/types/{api → old/api}/items/create-item-types.ts +1 -1
- package/src/types/{api → old/api}/items/get-items-types.ts +1 -1
- package/src/types/{api → old/api}/items/update-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/complete-list-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/create-list-item-types.ts +2 -2
- package/src/types/{api → old/api}/lists/create-list-types.ts +1 -1
- package/src/types/{api → old/api}/lists/get-list-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/get-lists-types.ts +1 -1
- package/src/types/{api → old/api}/lists/update-list-item-types.ts +2 -2
- package/src/types/{api → old/api}/lists/update-list-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/create-notification-template-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/get-notification-templates-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/sync-notification-template-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/update-notification-template-types.ts +1 -1
- package/src/types/{api → old/api}/people/create-person-note-types.ts +2 -2
- package/src/types/{api → old/api}/people/create-person-types.ts +2 -2
- package/src/types/{api → old/api}/people/get-people-types.ts +1 -1
- package/src/types/{api → old/api}/people/get-person-notes-types.ts +1 -1
- package/src/types/{api → old/api}/people/update-person-note-types.ts +1 -1
- package/src/types/{api → old/api}/people/update-person-types.ts +2 -2
- package/src/types/{api → old/api}/thoughts/create-thought-types.ts +1 -1
- package/src/types/{api → old/api}/thoughts/get-thoughts-types.ts +1 -1
- package/src/types/{api → old/api}/thoughts/update-thought-types.ts +1 -1
- package/src/types/{models → old/models}/auth-data.ts +1 -1
- package/src/types/{models → old/models}/habit-data.ts +2 -2
- package/src/types/{models → old/models}/item-data.ts +1 -1
- package/src/types/{models → old/models}/list-data.ts +1 -1
- package/src/types/{models → old/models}/notification-template-data.ts +1 -1
- package/src/types/{models → old/models}/person-data.ts +1 -1
- package/src/types/{models → old/models}/thought-data.ts +1 -1
- package/src/types/{models → old/models}/user-data.ts +2 -2
- package/src/utils/index.ts +2 -1
- package/src/utils/type-helpers.ts +19 -0
- /package/src/types/{api → old/api}/account/index.ts +0 -0
- /package/src/types/{api → old/api}/auth/index.ts +0 -0
- /package/src/types/{api → old/api}/auth/refresh-auth-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/resend-verification-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/sign-in-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/verify-email-types.ts +0 -0
- /package/src/types/{api → old/api}/habits/delete-habit-types.ts +0 -0
- /package/src/types/{api → old/api}/habits/index.ts +0 -0
- /package/src/types/{api → old/api}/index.ts +0 -0
- /package/src/types/{api → old/api}/items/delete-item-types.ts +0 -0
- /package/src/types/{api → old/api}/items/index.ts +0 -0
- /package/src/types/{api → old/api}/lists/index.ts +0 -0
- /package/src/types/{api → old/api}/misc/index.ts +0 -0
- /package/src/types/{api → old/api}/misc/version-types.ts +0 -0
- /package/src/types/{api → old/api}/notifications/delete-notification-template-types.ts +0 -0
- /package/src/types/{api → old/api}/notifications/index.ts +0 -0
- /package/src/types/{api → old/api}/notifications/preview-notification-template-types.ts +0 -0
- /package/src/types/{api → old/api}/people/delete-person-notes-types.ts +0 -0
- /package/src/types/{api → old/api}/people/delete-person-types.ts +0 -0
- /package/src/types/{api → old/api}/people/index.ts +0 -0
- /package/src/types/{api → old/api}/thoughts/delete-thought-types.ts +0 -0
- /package/src/types/{api → old/api}/thoughts/index.ts +0 -0
- /package/src/types/{auth-tokens.ts → old/auth-tokens.ts} +0 -0
- /package/src/types/{models → old/models}/index.ts +0 -0
- /package/src/types/{models → old/models}/notifiable.ts +0 -0
- /package/src/types/{models → old/models}/program-config.ts +0 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Serialized } from '../../utils';
|
|
3
|
+
import { ModuleType } from '../../enums';
|
|
4
|
+
export declare const moduleSchema: z.ZodObject<{
|
|
5
|
+
type: z.ZodNativeEnum<typeof ModuleType>;
|
|
6
|
+
visible: z.ZodBoolean;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
type: ModuleType;
|
|
9
|
+
visible: boolean;
|
|
10
|
+
}, {
|
|
11
|
+
type: ModuleType;
|
|
12
|
+
visible: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const deviceSchema: z.ZodObject<{
|
|
15
|
+
pushToken: z.ZodString;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
pushToken: string;
|
|
18
|
+
}, {
|
|
19
|
+
pushToken: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const userSchema: z.ZodObject<{
|
|
22
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
23
|
+
createdAt: z.ZodDate;
|
|
24
|
+
updatedAt: z.ZodDate;
|
|
25
|
+
sandbox: z.ZodObject<{
|
|
26
|
+
discordId: z.ZodOptional<z.ZodString>;
|
|
27
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
28
|
+
pushToken: z.ZodString;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
pushToken: string;
|
|
31
|
+
}, {
|
|
32
|
+
pushToken: string;
|
|
33
|
+
}>, "many">;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
devices: {
|
|
36
|
+
pushToken: string;
|
|
37
|
+
}[];
|
|
38
|
+
discordId?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
devices: {
|
|
41
|
+
pushToken: string;
|
|
42
|
+
}[];
|
|
43
|
+
discordId?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
timezone: z.ZodEffects<z.ZodString, string, string>;
|
|
47
|
+
config: z.ZodObject<{
|
|
48
|
+
modules: z.ZodArray<z.ZodObject<{
|
|
49
|
+
type: z.ZodNativeEnum<typeof ModuleType>;
|
|
50
|
+
visible: z.ZodBoolean;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
type: ModuleType;
|
|
53
|
+
visible: boolean;
|
|
54
|
+
}, {
|
|
55
|
+
type: ModuleType;
|
|
56
|
+
visible: boolean;
|
|
57
|
+
}>, "many">;
|
|
58
|
+
agenda: z.ZodObject<{
|
|
59
|
+
itemCategories: z.ZodArray<z.ZodString, "many">;
|
|
60
|
+
itemTypes: z.ZodArray<z.ZodString, "many">;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
itemCategories: string[];
|
|
63
|
+
itemTypes: string[];
|
|
64
|
+
}, {
|
|
65
|
+
itemCategories: string[];
|
|
66
|
+
itemTypes: string[];
|
|
67
|
+
}>;
|
|
68
|
+
people: z.ZodObject<{
|
|
69
|
+
propertyKeys: z.ZodArray<z.ZodString, "many">;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
propertyKeys: string[];
|
|
72
|
+
}, {
|
|
73
|
+
propertyKeys: string[];
|
|
74
|
+
}>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
agenda: {
|
|
77
|
+
itemCategories: string[];
|
|
78
|
+
itemTypes: string[];
|
|
79
|
+
};
|
|
80
|
+
people: {
|
|
81
|
+
propertyKeys: string[];
|
|
82
|
+
};
|
|
83
|
+
modules: {
|
|
84
|
+
type: ModuleType;
|
|
85
|
+
visible: boolean;
|
|
86
|
+
}[];
|
|
87
|
+
}, {
|
|
88
|
+
agenda: {
|
|
89
|
+
itemCategories: string[];
|
|
90
|
+
itemTypes: string[];
|
|
91
|
+
};
|
|
92
|
+
people: {
|
|
93
|
+
propertyKeys: string[];
|
|
94
|
+
};
|
|
95
|
+
modules: {
|
|
96
|
+
type: ModuleType;
|
|
97
|
+
visible: boolean;
|
|
98
|
+
}[];
|
|
99
|
+
}>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
_id: string & {
|
|
102
|
+
readonly __brand: "UserId";
|
|
103
|
+
};
|
|
104
|
+
createdAt: Date;
|
|
105
|
+
updatedAt: Date;
|
|
106
|
+
name: string;
|
|
107
|
+
sandbox: {
|
|
108
|
+
devices: {
|
|
109
|
+
pushToken: string;
|
|
110
|
+
}[];
|
|
111
|
+
discordId?: string | undefined;
|
|
112
|
+
};
|
|
113
|
+
timezone: string;
|
|
114
|
+
config: {
|
|
115
|
+
agenda: {
|
|
116
|
+
itemCategories: string[];
|
|
117
|
+
itemTypes: string[];
|
|
118
|
+
};
|
|
119
|
+
people: {
|
|
120
|
+
propertyKeys: string[];
|
|
121
|
+
};
|
|
122
|
+
modules: {
|
|
123
|
+
type: ModuleType;
|
|
124
|
+
visible: boolean;
|
|
125
|
+
}[];
|
|
126
|
+
};
|
|
127
|
+
}, {
|
|
128
|
+
_id: string;
|
|
129
|
+
createdAt: Date;
|
|
130
|
+
updatedAt: Date;
|
|
131
|
+
name: string;
|
|
132
|
+
sandbox: {
|
|
133
|
+
devices: {
|
|
134
|
+
pushToken: string;
|
|
135
|
+
}[];
|
|
136
|
+
discordId?: string | undefined;
|
|
137
|
+
};
|
|
138
|
+
timezone: string;
|
|
139
|
+
config: {
|
|
140
|
+
agenda: {
|
|
141
|
+
itemCategories: string[];
|
|
142
|
+
itemTypes: string[];
|
|
143
|
+
};
|
|
144
|
+
people: {
|
|
145
|
+
propertyKeys: string[];
|
|
146
|
+
};
|
|
147
|
+
modules: {
|
|
148
|
+
type: ModuleType;
|
|
149
|
+
visible: boolean;
|
|
150
|
+
}[];
|
|
151
|
+
};
|
|
152
|
+
}>;
|
|
153
|
+
export declare const updateUserRequestSchema: z.ZodObject<{
|
|
154
|
+
name: z.ZodOptional<z.ZodString>;
|
|
155
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
discordId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
157
|
+
devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
158
|
+
pushToken: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
pushToken?: string | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
pushToken?: string | undefined;
|
|
163
|
+
}>, "many">>;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
discordId?: string | undefined;
|
|
166
|
+
devices?: {
|
|
167
|
+
pushToken?: string | undefined;
|
|
168
|
+
}[] | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
discordId?: string | undefined;
|
|
171
|
+
devices?: {
|
|
172
|
+
pushToken?: string | undefined;
|
|
173
|
+
}[] | undefined;
|
|
174
|
+
}>>;
|
|
175
|
+
timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
176
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
type: z.ZodOptional<z.ZodNativeEnum<typeof ModuleType>>;
|
|
179
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
type?: ModuleType | undefined;
|
|
182
|
+
visible?: boolean | undefined;
|
|
183
|
+
}, {
|
|
184
|
+
type?: ModuleType | undefined;
|
|
185
|
+
visible?: boolean | undefined;
|
|
186
|
+
}>, "many">>;
|
|
187
|
+
agenda: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
itemCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
189
|
+
itemTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
itemCategories?: string[] | undefined;
|
|
192
|
+
itemTypes?: string[] | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
itemCategories?: string[] | undefined;
|
|
195
|
+
itemTypes?: string[] | undefined;
|
|
196
|
+
}>>;
|
|
197
|
+
people: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
propertyKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
199
|
+
}, "strip", z.ZodTypeAny, {
|
|
200
|
+
propertyKeys?: string[] | undefined;
|
|
201
|
+
}, {
|
|
202
|
+
propertyKeys?: string[] | undefined;
|
|
203
|
+
}>>;
|
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
|
205
|
+
agenda?: {
|
|
206
|
+
itemCategories?: string[] | undefined;
|
|
207
|
+
itemTypes?: string[] | undefined;
|
|
208
|
+
} | undefined;
|
|
209
|
+
people?: {
|
|
210
|
+
propertyKeys?: string[] | undefined;
|
|
211
|
+
} | undefined;
|
|
212
|
+
modules?: {
|
|
213
|
+
type?: ModuleType | undefined;
|
|
214
|
+
visible?: boolean | undefined;
|
|
215
|
+
}[] | undefined;
|
|
216
|
+
}, {
|
|
217
|
+
agenda?: {
|
|
218
|
+
itemCategories?: string[] | undefined;
|
|
219
|
+
itemTypes?: string[] | undefined;
|
|
220
|
+
} | undefined;
|
|
221
|
+
people?: {
|
|
222
|
+
propertyKeys?: string[] | undefined;
|
|
223
|
+
} | undefined;
|
|
224
|
+
modules?: {
|
|
225
|
+
type?: ModuleType | undefined;
|
|
226
|
+
visible?: boolean | undefined;
|
|
227
|
+
}[] | undefined;
|
|
228
|
+
}>>;
|
|
229
|
+
}, "strict", z.ZodTypeAny, {
|
|
230
|
+
name?: string | undefined;
|
|
231
|
+
sandbox?: {
|
|
232
|
+
discordId?: string | undefined;
|
|
233
|
+
devices?: {
|
|
234
|
+
pushToken?: string | undefined;
|
|
235
|
+
}[] | undefined;
|
|
236
|
+
} | undefined;
|
|
237
|
+
timezone?: string | undefined;
|
|
238
|
+
config?: {
|
|
239
|
+
agenda?: {
|
|
240
|
+
itemCategories?: string[] | undefined;
|
|
241
|
+
itemTypes?: string[] | undefined;
|
|
242
|
+
} | undefined;
|
|
243
|
+
people?: {
|
|
244
|
+
propertyKeys?: string[] | undefined;
|
|
245
|
+
} | undefined;
|
|
246
|
+
modules?: {
|
|
247
|
+
type?: ModuleType | undefined;
|
|
248
|
+
visible?: boolean | undefined;
|
|
249
|
+
}[] | undefined;
|
|
250
|
+
} | undefined;
|
|
251
|
+
}, {
|
|
252
|
+
name?: string | undefined;
|
|
253
|
+
sandbox?: {
|
|
254
|
+
discordId?: string | undefined;
|
|
255
|
+
devices?: {
|
|
256
|
+
pushToken?: string | undefined;
|
|
257
|
+
}[] | undefined;
|
|
258
|
+
} | undefined;
|
|
259
|
+
timezone?: string | undefined;
|
|
260
|
+
config?: {
|
|
261
|
+
agenda?: {
|
|
262
|
+
itemCategories?: string[] | undefined;
|
|
263
|
+
itemTypes?: string[] | undefined;
|
|
264
|
+
} | undefined;
|
|
265
|
+
people?: {
|
|
266
|
+
propertyKeys?: string[] | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
modules?: {
|
|
269
|
+
type?: ModuleType | undefined;
|
|
270
|
+
visible?: boolean | undefined;
|
|
271
|
+
}[] | undefined;
|
|
272
|
+
} | undefined;
|
|
273
|
+
}>;
|
|
274
|
+
export type UserModuleData = z.infer<typeof moduleSchema>;
|
|
275
|
+
export type UserDeviceData = z.infer<typeof deviceSchema>;
|
|
276
|
+
export type UserData = z.infer<typeof userSchema>;
|
|
277
|
+
export type UpdateUserRequest = z.infer<typeof updateUserRequestSchema>;
|
|
278
|
+
export interface GetUserResponse {
|
|
279
|
+
user: Serialized<UserData>;
|
|
280
|
+
}
|
|
281
|
+
export interface UpdateUserResponse {
|
|
282
|
+
user: Serialized<UserData>;
|
|
283
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateUserRequestSchema = exports.userSchema = exports.deviceSchema = exports.moduleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../id-types");
|
|
6
|
+
const enums_1 = require("../../enums");
|
|
7
|
+
exports.moduleSchema = zod_1.z.object({
|
|
8
|
+
type: zod_1.z.nativeEnum(enums_1.ModuleType),
|
|
9
|
+
visible: zod_1.z.boolean()
|
|
10
|
+
});
|
|
11
|
+
exports.deviceSchema = zod_1.z.object({
|
|
12
|
+
pushToken: zod_1.z.string()
|
|
13
|
+
});
|
|
14
|
+
exports.userSchema = zod_1.z.object({
|
|
15
|
+
_id: id_types_1.userIdSchema,
|
|
16
|
+
createdAt: zod_1.z.date(),
|
|
17
|
+
updatedAt: zod_1.z.date(),
|
|
18
|
+
sandbox: zod_1.z.object({
|
|
19
|
+
discordId: zod_1.z.string().optional(),
|
|
20
|
+
devices: zod_1.z.array(exports.deviceSchema)
|
|
21
|
+
}),
|
|
22
|
+
name: zod_1.z.string().min(1),
|
|
23
|
+
timezone: zod_1.z.string().refine((tz) => {
|
|
24
|
+
try {
|
|
25
|
+
Intl.DateTimeFormat(undefined, { timeZone: tz });
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
config: zod_1.z.object({
|
|
33
|
+
modules: zod_1.z.array(exports.moduleSchema),
|
|
34
|
+
agenda: zod_1.z.object({
|
|
35
|
+
itemCategories: zod_1.z.array(zod_1.z.string()),
|
|
36
|
+
itemTypes: zod_1.z.array(zod_1.z.string())
|
|
37
|
+
}),
|
|
38
|
+
people: zod_1.z.object({
|
|
39
|
+
propertyKeys: zod_1.z.array(zod_1.z.string())
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
exports.updateUserRequestSchema = exports.userSchema
|
|
44
|
+
.omit({ _id: true, createdAt: true, updatedAt: true })
|
|
45
|
+
.deepPartial()
|
|
46
|
+
.strict();
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-user-types"), exports);
|
|
18
|
+
__exportStar(require("./update-user-types"), exports);
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { UserData } from "../../models";
|
|
3
|
+
import { Serialized } from "../../../../utils";
|
|
4
|
+
export declare const updateUserRequestSchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
sandbox: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
discordId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9
|
+
pushToken: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
pushToken?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
pushToken?: string | undefined;
|
|
14
|
+
}>, "many">>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
discordId?: string | undefined;
|
|
17
|
+
devices?: {
|
|
18
|
+
pushToken?: string | undefined;
|
|
19
|
+
}[] | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
discordId?: string | undefined;
|
|
22
|
+
devices?: {
|
|
23
|
+
pushToken?: string | undefined;
|
|
24
|
+
}[] | undefined;
|
|
25
|
+
}>>;
|
|
26
|
+
timezone: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
27
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
modules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
29
|
+
type: z.ZodOptional<z.ZodNativeEnum<typeof import("../../../..").ModuleType>>;
|
|
30
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
type?: import("../../../..").ModuleType | undefined;
|
|
33
|
+
visible?: boolean | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
type?: import("../../../..").ModuleType | undefined;
|
|
36
|
+
visible?: boolean | undefined;
|
|
37
|
+
}>, "many">>;
|
|
38
|
+
agenda: z.ZodOptional<z.ZodObject<{
|
|
39
|
+
itemCategories: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
40
|
+
itemTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
itemCategories?: string[] | undefined;
|
|
43
|
+
itemTypes?: string[] | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
itemCategories?: string[] | undefined;
|
|
46
|
+
itemTypes?: string[] | undefined;
|
|
47
|
+
}>>;
|
|
48
|
+
people: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
propertyKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
propertyKeys?: string[] | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
propertyKeys?: string[] | undefined;
|
|
54
|
+
}>>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
agenda?: {
|
|
57
|
+
itemCategories?: string[] | undefined;
|
|
58
|
+
itemTypes?: string[] | undefined;
|
|
59
|
+
} | undefined;
|
|
60
|
+
people?: {
|
|
61
|
+
propertyKeys?: string[] | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
modules?: {
|
|
64
|
+
type?: import("../../../..").ModuleType | undefined;
|
|
65
|
+
visible?: boolean | undefined;
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
agenda?: {
|
|
69
|
+
itemCategories?: string[] | undefined;
|
|
70
|
+
itemTypes?: string[] | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
people?: {
|
|
73
|
+
propertyKeys?: string[] | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
modules?: {
|
|
76
|
+
type?: import("../../../..").ModuleType | undefined;
|
|
77
|
+
visible?: boolean | undefined;
|
|
78
|
+
}[] | undefined;
|
|
79
|
+
}>>;
|
|
80
|
+
}, "strict", z.ZodTypeAny, {
|
|
81
|
+
name?: string | undefined;
|
|
82
|
+
sandbox?: {
|
|
83
|
+
discordId?: string | undefined;
|
|
84
|
+
devices?: {
|
|
85
|
+
pushToken?: string | undefined;
|
|
86
|
+
}[] | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
timezone?: string | undefined;
|
|
89
|
+
config?: {
|
|
90
|
+
agenda?: {
|
|
91
|
+
itemCategories?: string[] | undefined;
|
|
92
|
+
itemTypes?: string[] | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
people?: {
|
|
95
|
+
propertyKeys?: string[] | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
modules?: {
|
|
98
|
+
type?: import("../../../..").ModuleType | undefined;
|
|
99
|
+
visible?: boolean | undefined;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
} | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
name?: string | undefined;
|
|
104
|
+
sandbox?: {
|
|
105
|
+
discordId?: string | undefined;
|
|
106
|
+
devices?: {
|
|
107
|
+
pushToken?: string | undefined;
|
|
108
|
+
}[] | undefined;
|
|
109
|
+
} | undefined;
|
|
110
|
+
timezone?: string | undefined;
|
|
111
|
+
config?: {
|
|
112
|
+
agenda?: {
|
|
113
|
+
itemCategories?: string[] | undefined;
|
|
114
|
+
itemTypes?: string[] | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
people?: {
|
|
117
|
+
propertyKeys?: string[] | undefined;
|
|
118
|
+
} | undefined;
|
|
119
|
+
modules?: {
|
|
120
|
+
type?: import("../../../..").ModuleType | undefined;
|
|
121
|
+
visible?: boolean | undefined;
|
|
122
|
+
}[] | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
export type UpdateUserRequest = z.infer<typeof updateUserRequestSchema>;
|
|
126
|
+
export interface UpdateUserResponse {
|
|
127
|
+
user: Serialized<UserData>;
|
|
128
|
+
}
|
|
@@ -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();
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { UserId } from "../../../id-types";
|
|
3
|
+
export declare const createAccountRequestSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
email: z.ZodString;
|
|
6
|
+
password: z.ZodString;
|
|
7
|
+
skipVerificationEmail: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
email: string;
|
|
10
|
+
name: string;
|
|
11
|
+
password: string;
|
|
12
|
+
skipVerificationEmail?: boolean | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
email: string;
|
|
15
|
+
name: string;
|
|
16
|
+
password: string;
|
|
17
|
+
skipVerificationEmail?: boolean | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export type CreateAccountRequest = z.infer<typeof createAccountRequestSchema>;
|
|
20
|
+
export interface CreateAccountResponse {
|
|
21
|
+
id: UserId;
|
|
22
|
+
name: string;
|
|
23
|
+
email: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAccountRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.createAccountRequestSchema = zod_1.z.object({
|
|
6
|
+
name: zod_1.z.string().trim().min(1),
|
|
7
|
+
email: zod_1.z.string().trim().email(),
|
|
8
|
+
password: zod_1.z.string().min(4),
|
|
9
|
+
skipVerificationEmail: zod_1.z.boolean().optional()
|
|
10
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sign-in-types"), exports);
|
|
18
|
+
__exportStar(require("./refresh-auth-types"), exports);
|
|
19
|
+
__exportStar(require("./create-account-types"), exports);
|
|
20
|
+
__exportStar(require("./resend-verification-types"), exports);
|
|
21
|
+
__exportStar(require("./verify-email-types"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AuthTokens } from "../../auth-tokens";
|
|
3
|
+
import { PublicAuthData } from "../../models";
|
|
4
|
+
export declare const refreshAuthRequestSchema: z.ZodObject<{
|
|
5
|
+
refreshToken: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
refreshToken: string;
|
|
8
|
+
}, {
|
|
9
|
+
refreshToken: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type RefreshAuthRequest = z.infer<typeof refreshAuthRequestSchema>;
|
|
12
|
+
export interface RefreshAuthResponse {
|
|
13
|
+
tokenData: AuthTokens;
|
|
14
|
+
authData: PublicAuthData;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AuthTokens } from "../../auth-tokens";
|
|
3
|
+
import { PublicAuthData, UserData } from "../../models";
|
|
4
|
+
export declare const signInRequestSchema: z.ZodObject<{
|
|
5
|
+
email: z.ZodString;
|
|
6
|
+
password: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
email: string;
|
|
9
|
+
password: string;
|
|
10
|
+
}, {
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
}>;
|
|
14
|
+
export type SignInRequest = z.infer<typeof signInRequestSchema>;
|
|
15
|
+
export interface SignInResponse {
|
|
16
|
+
tokenData: AuthTokens;
|
|
17
|
+
authData: PublicAuthData;
|
|
18
|
+
user: UserData;
|
|
19
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signInRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.signInRequestSchema = zod_1.z.object({
|
|
6
|
+
email: zod_1.z.string().email(),
|
|
7
|
+
password: zod_1.z.string()
|
|
8
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Habit, HabitEntryStatus } from "../../models";
|
|
3
|
+
import { Serialized } from "../../../../utils";
|
|
4
|
+
export declare const createHabitEntryRequestSchema: z.ZodObject<{
|
|
5
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("../../../misc-types").DateOnlyString, string>;
|
|
6
|
+
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
status: HabitEntryStatus;
|
|
9
|
+
date: string & {
|
|
10
|
+
readonly __brand: "DateOnlyString";
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
status: HabitEntryStatus;
|
|
14
|
+
date: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type CreateHabitEntryRequest = z.infer<typeof createHabitEntryRequestSchema>;
|
|
17
|
+
export interface CreateHabitEntryResponse {
|
|
18
|
+
habit: Serialized<Habit>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHabitEntryRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
const misc_types_1 = require("../../../misc-types");
|
|
7
|
+
exports.createHabitEntryRequestSchema = zod_1.z.object({
|
|
8
|
+
date: misc_types_1.dateOnlyStringSchema,
|
|
9
|
+
status: zod_1.z.nativeEnum(models_1.HabitEntryStatus)
|
|
10
|
+
});
|