@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,317 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Serialized } from '../../utils';
|
|
3
|
+
export declare enum HabitFrequency {
|
|
4
|
+
DAILY = "daily",
|
|
5
|
+
WEEKLY = "weekly",
|
|
6
|
+
EVERY_N_DAYS = "every_n_days",
|
|
7
|
+
WEEKDAYS_ONLY = "weekdays_only",
|
|
8
|
+
CUSTOM = "custom"
|
|
9
|
+
}
|
|
10
|
+
export declare enum HabitEntryStatus {
|
|
11
|
+
COMPLETED = "completed",
|
|
12
|
+
EXCUSED = "excused",
|
|
13
|
+
MISSED = "missed"
|
|
14
|
+
}
|
|
15
|
+
export declare const habitEntrySchema: z.ZodObject<{
|
|
16
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").HabitEntryId, string>;
|
|
17
|
+
habitId: z.ZodEffects<z.ZodString, import("../id-types").HabitId, string>;
|
|
18
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
19
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("../misc-types").DateOnlyString, string>;
|
|
20
|
+
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
21
|
+
createdAt: z.ZodDate;
|
|
22
|
+
updatedAt: z.ZodDate;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
_id: string & {
|
|
25
|
+
readonly __brand: "HabitEntryId";
|
|
26
|
+
};
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
userId: string & {
|
|
30
|
+
readonly __brand: "UserId";
|
|
31
|
+
};
|
|
32
|
+
status: HabitEntryStatus;
|
|
33
|
+
date: string & {
|
|
34
|
+
readonly __brand: "DateOnlyString";
|
|
35
|
+
};
|
|
36
|
+
habitId: string & {
|
|
37
|
+
readonly __brand: "HabitId";
|
|
38
|
+
};
|
|
39
|
+
}, {
|
|
40
|
+
_id: string;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
updatedAt: Date;
|
|
43
|
+
userId: string;
|
|
44
|
+
status: HabitEntryStatus;
|
|
45
|
+
date: string;
|
|
46
|
+
habitId: string;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const habitDataSchema: z.ZodObject<{
|
|
49
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").HabitId, string>;
|
|
50
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
51
|
+
name: z.ZodString;
|
|
52
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
|
+
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
55
|
+
rolloverTime: z.ZodString;
|
|
56
|
+
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("../misc-types").DateOnlyString, string>;
|
|
57
|
+
createdAt: z.ZodDate;
|
|
58
|
+
updatedAt: z.ZodDate;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
_id: string & {
|
|
61
|
+
readonly __brand: "HabitId";
|
|
62
|
+
};
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date;
|
|
65
|
+
userId: string & {
|
|
66
|
+
readonly __brand: "UserId";
|
|
67
|
+
};
|
|
68
|
+
name: string;
|
|
69
|
+
frequency: HabitFrequency;
|
|
70
|
+
rolloverTime: string;
|
|
71
|
+
firstDay: string & {
|
|
72
|
+
readonly __brand: "DateOnlyString";
|
|
73
|
+
};
|
|
74
|
+
description?: string | null | undefined;
|
|
75
|
+
notes?: string | null | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
_id: string;
|
|
78
|
+
createdAt: Date;
|
|
79
|
+
updatedAt: Date;
|
|
80
|
+
userId: string;
|
|
81
|
+
name: string;
|
|
82
|
+
frequency: HabitFrequency;
|
|
83
|
+
rolloverTime: string;
|
|
84
|
+
firstDay: string;
|
|
85
|
+
description?: string | null | undefined;
|
|
86
|
+
notes?: string | null | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
export declare const habitStatsSchema: z.ZodObject<{
|
|
89
|
+
totalDays: z.ZodNumber;
|
|
90
|
+
completedDays: z.ZodNumber;
|
|
91
|
+
excusedDays: z.ZodNumber;
|
|
92
|
+
missedDays: z.ZodNumber;
|
|
93
|
+
completionRate: z.ZodNumber;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
totalDays: number;
|
|
96
|
+
completedDays: number;
|
|
97
|
+
excusedDays: number;
|
|
98
|
+
missedDays: number;
|
|
99
|
+
completionRate: number;
|
|
100
|
+
}, {
|
|
101
|
+
totalDays: number;
|
|
102
|
+
completedDays: number;
|
|
103
|
+
excusedDays: number;
|
|
104
|
+
missedDays: number;
|
|
105
|
+
completionRate: number;
|
|
106
|
+
}>;
|
|
107
|
+
export declare const habitSchema: z.ZodObject<{
|
|
108
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").HabitId, string>;
|
|
109
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
110
|
+
name: z.ZodString;
|
|
111
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
113
|
+
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
114
|
+
rolloverTime: z.ZodString;
|
|
115
|
+
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("../misc-types").DateOnlyString, string>;
|
|
116
|
+
createdAt: z.ZodDate;
|
|
117
|
+
updatedAt: z.ZodDate;
|
|
118
|
+
} & {
|
|
119
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
120
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").HabitEntryId, string>;
|
|
121
|
+
habitId: z.ZodEffects<z.ZodString, import("../id-types").HabitId, string>;
|
|
122
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
123
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("../misc-types").DateOnlyString, string>;
|
|
124
|
+
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
125
|
+
createdAt: z.ZodDate;
|
|
126
|
+
updatedAt: z.ZodDate;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
_id: string & {
|
|
129
|
+
readonly __brand: "HabitEntryId";
|
|
130
|
+
};
|
|
131
|
+
createdAt: Date;
|
|
132
|
+
updatedAt: Date;
|
|
133
|
+
userId: string & {
|
|
134
|
+
readonly __brand: "UserId";
|
|
135
|
+
};
|
|
136
|
+
status: HabitEntryStatus;
|
|
137
|
+
date: string & {
|
|
138
|
+
readonly __brand: "DateOnlyString";
|
|
139
|
+
};
|
|
140
|
+
habitId: string & {
|
|
141
|
+
readonly __brand: "HabitId";
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
_id: string;
|
|
145
|
+
createdAt: Date;
|
|
146
|
+
updatedAt: Date;
|
|
147
|
+
userId: string;
|
|
148
|
+
status: HabitEntryStatus;
|
|
149
|
+
date: string;
|
|
150
|
+
habitId: string;
|
|
151
|
+
}>, "many">;
|
|
152
|
+
stats: z.ZodObject<{
|
|
153
|
+
totalDays: z.ZodNumber;
|
|
154
|
+
completedDays: z.ZodNumber;
|
|
155
|
+
excusedDays: z.ZodNumber;
|
|
156
|
+
missedDays: z.ZodNumber;
|
|
157
|
+
completionRate: z.ZodNumber;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
totalDays: number;
|
|
160
|
+
completedDays: number;
|
|
161
|
+
excusedDays: number;
|
|
162
|
+
missedDays: number;
|
|
163
|
+
completionRate: number;
|
|
164
|
+
}, {
|
|
165
|
+
totalDays: number;
|
|
166
|
+
completedDays: number;
|
|
167
|
+
excusedDays: number;
|
|
168
|
+
missedDays: number;
|
|
169
|
+
completionRate: number;
|
|
170
|
+
}>;
|
|
171
|
+
}, "strip", z.ZodTypeAny, {
|
|
172
|
+
_id: string & {
|
|
173
|
+
readonly __brand: "HabitId";
|
|
174
|
+
};
|
|
175
|
+
createdAt: Date;
|
|
176
|
+
updatedAt: Date;
|
|
177
|
+
userId: string & {
|
|
178
|
+
readonly __brand: "UserId";
|
|
179
|
+
};
|
|
180
|
+
entries: {
|
|
181
|
+
_id: string & {
|
|
182
|
+
readonly __brand: "HabitEntryId";
|
|
183
|
+
};
|
|
184
|
+
createdAt: Date;
|
|
185
|
+
updatedAt: Date;
|
|
186
|
+
userId: string & {
|
|
187
|
+
readonly __brand: "UserId";
|
|
188
|
+
};
|
|
189
|
+
status: HabitEntryStatus;
|
|
190
|
+
date: string & {
|
|
191
|
+
readonly __brand: "DateOnlyString";
|
|
192
|
+
};
|
|
193
|
+
habitId: string & {
|
|
194
|
+
readonly __brand: "HabitId";
|
|
195
|
+
};
|
|
196
|
+
}[];
|
|
197
|
+
name: string;
|
|
198
|
+
frequency: HabitFrequency;
|
|
199
|
+
rolloverTime: string;
|
|
200
|
+
firstDay: string & {
|
|
201
|
+
readonly __brand: "DateOnlyString";
|
|
202
|
+
};
|
|
203
|
+
stats: {
|
|
204
|
+
totalDays: number;
|
|
205
|
+
completedDays: number;
|
|
206
|
+
excusedDays: number;
|
|
207
|
+
missedDays: number;
|
|
208
|
+
completionRate: number;
|
|
209
|
+
};
|
|
210
|
+
description?: string | null | undefined;
|
|
211
|
+
notes?: string | null | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
_id: string;
|
|
214
|
+
createdAt: Date;
|
|
215
|
+
updatedAt: Date;
|
|
216
|
+
userId: string;
|
|
217
|
+
entries: {
|
|
218
|
+
_id: string;
|
|
219
|
+
createdAt: Date;
|
|
220
|
+
updatedAt: Date;
|
|
221
|
+
userId: string;
|
|
222
|
+
status: HabitEntryStatus;
|
|
223
|
+
date: string;
|
|
224
|
+
habitId: string;
|
|
225
|
+
}[];
|
|
226
|
+
name: string;
|
|
227
|
+
frequency: HabitFrequency;
|
|
228
|
+
rolloverTime: string;
|
|
229
|
+
firstDay: string;
|
|
230
|
+
stats: {
|
|
231
|
+
totalDays: number;
|
|
232
|
+
completedDays: number;
|
|
233
|
+
excusedDays: number;
|
|
234
|
+
missedDays: number;
|
|
235
|
+
completionRate: number;
|
|
236
|
+
};
|
|
237
|
+
description?: string | null | undefined;
|
|
238
|
+
notes?: string | null | undefined;
|
|
239
|
+
}>;
|
|
240
|
+
export declare const createHabitRequestSchema: z.ZodObject<{
|
|
241
|
+
name: z.ZodString;
|
|
242
|
+
description: z.ZodOptional<z.ZodString>;
|
|
243
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
244
|
+
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
245
|
+
rolloverTime: z.ZodString;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
name: string;
|
|
248
|
+
frequency: HabitFrequency;
|
|
249
|
+
rolloverTime: string;
|
|
250
|
+
description?: string | undefined;
|
|
251
|
+
notes?: string | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
name: string;
|
|
254
|
+
frequency: HabitFrequency;
|
|
255
|
+
rolloverTime: string;
|
|
256
|
+
description?: string | undefined;
|
|
257
|
+
notes?: string | undefined;
|
|
258
|
+
}>;
|
|
259
|
+
export declare const updateHabitRequestSchema: z.ZodObject<{
|
|
260
|
+
name: z.ZodOptional<z.ZodString>;
|
|
261
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
262
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
263
|
+
frequency: z.ZodOptional<z.ZodNativeEnum<typeof HabitFrequency>>;
|
|
264
|
+
rolloverTime: z.ZodOptional<z.ZodString>;
|
|
265
|
+
}, "strip", z.ZodTypeAny, {
|
|
266
|
+
name?: string | undefined;
|
|
267
|
+
description?: string | null | undefined;
|
|
268
|
+
notes?: string | null | undefined;
|
|
269
|
+
frequency?: HabitFrequency | undefined;
|
|
270
|
+
rolloverTime?: string | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
name?: string | undefined;
|
|
273
|
+
description?: string | null | undefined;
|
|
274
|
+
notes?: string | null | undefined;
|
|
275
|
+
frequency?: HabitFrequency | undefined;
|
|
276
|
+
rolloverTime?: string | undefined;
|
|
277
|
+
}>;
|
|
278
|
+
export declare const createHabitEntryRequestSchema: z.ZodObject<{
|
|
279
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("../misc-types").DateOnlyString, string>;
|
|
280
|
+
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
281
|
+
}, "strip", z.ZodTypeAny, {
|
|
282
|
+
status: HabitEntryStatus;
|
|
283
|
+
date: string & {
|
|
284
|
+
readonly __brand: "DateOnlyString";
|
|
285
|
+
};
|
|
286
|
+
}, {
|
|
287
|
+
status: HabitEntryStatus;
|
|
288
|
+
date: string;
|
|
289
|
+
}>;
|
|
290
|
+
export type HabitEntryData = z.infer<typeof habitEntrySchema>;
|
|
291
|
+
export type HabitData = z.infer<typeof habitDataSchema>;
|
|
292
|
+
export type HabitStats = z.infer<typeof habitStatsSchema>;
|
|
293
|
+
export type Habit = z.infer<typeof habitSchema>;
|
|
294
|
+
export type CreateHabitRequest = z.infer<typeof createHabitRequestSchema>;
|
|
295
|
+
export type UpdateHabitRequest = z.infer<typeof updateHabitRequestSchema>;
|
|
296
|
+
export type CreateHabitEntryRequest = z.infer<typeof createHabitEntryRequestSchema>;
|
|
297
|
+
export interface CreateHabitResponse {
|
|
298
|
+
habit: Serialized<Habit>;
|
|
299
|
+
}
|
|
300
|
+
export interface GetHabitsResponse {
|
|
301
|
+
habits: Serialized<Habit>[];
|
|
302
|
+
}
|
|
303
|
+
export interface GetHabitResponse {
|
|
304
|
+
habit: Serialized<Habit>;
|
|
305
|
+
}
|
|
306
|
+
export interface UpdateHabitResponse {
|
|
307
|
+
habit: Serialized<Habit>;
|
|
308
|
+
}
|
|
309
|
+
export interface DeleteHabitResponse {
|
|
310
|
+
deleted: boolean;
|
|
311
|
+
}
|
|
312
|
+
export interface CreateHabitEntryResponse {
|
|
313
|
+
habit: Serialized<Habit>;
|
|
314
|
+
}
|
|
315
|
+
export interface DeleteHabitEntryResponse {
|
|
316
|
+
habit: Serialized<Habit>;
|
|
317
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createHabitEntryRequestSchema = exports.updateHabitRequestSchema = exports.createHabitRequestSchema = exports.habitSchema = exports.habitStatsSchema = exports.habitDataSchema = exports.habitEntrySchema = exports.HabitEntryStatus = exports.HabitFrequency = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../id-types");
|
|
6
|
+
const misc_types_1 = require("../misc-types");
|
|
7
|
+
var HabitFrequency;
|
|
8
|
+
(function (HabitFrequency) {
|
|
9
|
+
HabitFrequency["DAILY"] = "daily";
|
|
10
|
+
HabitFrequency["WEEKLY"] = "weekly";
|
|
11
|
+
HabitFrequency["EVERY_N_DAYS"] = "every_n_days";
|
|
12
|
+
HabitFrequency["WEEKDAYS_ONLY"] = "weekdays_only";
|
|
13
|
+
HabitFrequency["CUSTOM"] = "custom";
|
|
14
|
+
})(HabitFrequency || (exports.HabitFrequency = HabitFrequency = {}));
|
|
15
|
+
var HabitEntryStatus;
|
|
16
|
+
(function (HabitEntryStatus) {
|
|
17
|
+
HabitEntryStatus["COMPLETED"] = "completed";
|
|
18
|
+
HabitEntryStatus["EXCUSED"] = "excused";
|
|
19
|
+
HabitEntryStatus["MISSED"] = "missed";
|
|
20
|
+
})(HabitEntryStatus || (exports.HabitEntryStatus = HabitEntryStatus = {}));
|
|
21
|
+
exports.habitEntrySchema = zod_1.z.object({
|
|
22
|
+
_id: id_types_1.habitEntryIdSchema,
|
|
23
|
+
habitId: id_types_1.habitIdSchema,
|
|
24
|
+
userId: id_types_1.userIdSchema,
|
|
25
|
+
date: misc_types_1.dateOnlyStringSchema,
|
|
26
|
+
status: zod_1.z.nativeEnum(HabitEntryStatus),
|
|
27
|
+
createdAt: zod_1.z.date(),
|
|
28
|
+
updatedAt: zod_1.z.date()
|
|
29
|
+
});
|
|
30
|
+
exports.habitDataSchema = zod_1.z.object({
|
|
31
|
+
_id: id_types_1.habitIdSchema,
|
|
32
|
+
userId: id_types_1.userIdSchema,
|
|
33
|
+
name: zod_1.z.string(),
|
|
34
|
+
description: zod_1.z.string().nullable().optional(),
|
|
35
|
+
notes: zod_1.z.string().nullable().optional(),
|
|
36
|
+
frequency: zod_1.z.nativeEnum(HabitFrequency),
|
|
37
|
+
rolloverTime: zod_1.z.string(),
|
|
38
|
+
firstDay: misc_types_1.dateOnlyStringSchema,
|
|
39
|
+
createdAt: zod_1.z.date(),
|
|
40
|
+
updatedAt: zod_1.z.date()
|
|
41
|
+
});
|
|
42
|
+
exports.habitStatsSchema = zod_1.z.object({
|
|
43
|
+
totalDays: zod_1.z.number(),
|
|
44
|
+
completedDays: zod_1.z.number(),
|
|
45
|
+
excusedDays: zod_1.z.number(),
|
|
46
|
+
missedDays: zod_1.z.number(),
|
|
47
|
+
completionRate: zod_1.z.number()
|
|
48
|
+
});
|
|
49
|
+
exports.habitSchema = exports.habitDataSchema.extend({
|
|
50
|
+
entries: zod_1.z.array(exports.habitEntrySchema),
|
|
51
|
+
stats: exports.habitStatsSchema
|
|
52
|
+
});
|
|
53
|
+
exports.createHabitRequestSchema = zod_1.z.object({
|
|
54
|
+
name: zod_1.z.string().min(1).trim(),
|
|
55
|
+
description: zod_1.z.string().trim().optional(),
|
|
56
|
+
notes: zod_1.z.string().trim().optional(),
|
|
57
|
+
frequency: zod_1.z.nativeEnum(HabitFrequency),
|
|
58
|
+
rolloverTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/)
|
|
59
|
+
});
|
|
60
|
+
exports.updateHabitRequestSchema = zod_1.z.object({
|
|
61
|
+
name: zod_1.z.string().min(1).trim().optional(),
|
|
62
|
+
description: zod_1.z.string().trim().nullish(),
|
|
63
|
+
notes: zod_1.z.string().trim().nullish(),
|
|
64
|
+
frequency: zod_1.z.nativeEnum(HabitFrequency).optional(),
|
|
65
|
+
rolloverTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/).optional()
|
|
66
|
+
});
|
|
67
|
+
exports.createHabitEntryRequestSchema = zod_1.z.object({
|
|
68
|
+
date: misc_types_1.dateOnlyStringSchema,
|
|
69
|
+
status: zod_1.z.nativeEnum(HabitEntryStatus)
|
|
70
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './agenda-types';
|
|
2
|
+
export * from './thoughts-types';
|
|
3
|
+
export * from './habits-types';
|
|
4
|
+
export * from './people-types';
|
|
5
|
+
export * from './lists-types';
|
|
6
|
+
export * from './notifications-types';
|
|
7
|
+
export * from './auth-types';
|
|
8
|
+
export * from './user-types';
|
|
9
|
+
export * from './program-config-types';
|
|
10
|
+
export * from './misc';
|
|
@@ -0,0 +1,26 @@
|
|
|
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("./agenda-types"), exports);
|
|
18
|
+
__exportStar(require("./thoughts-types"), exports);
|
|
19
|
+
__exportStar(require("./habits-types"), exports);
|
|
20
|
+
__exportStar(require("./people-types"), exports);
|
|
21
|
+
__exportStar(require("./lists-types"), exports);
|
|
22
|
+
__exportStar(require("./notifications-types"), exports);
|
|
23
|
+
__exportStar(require("./auth-types"), exports);
|
|
24
|
+
__exportStar(require("./user-types"), exports);
|
|
25
|
+
__exportStar(require("./program-config-types"), exports);
|
|
26
|
+
__exportStar(require("./misc"), exports);
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Serialized } from '../../utils';
|
|
3
|
+
export declare enum ListType {
|
|
4
|
+
TASKS = "tasks",
|
|
5
|
+
NOTES = "notes"
|
|
6
|
+
}
|
|
7
|
+
export declare const listItemSchema: z.ZodObject<{
|
|
8
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").ListItemId, string>;
|
|
9
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
10
|
+
createdAt: z.ZodDate;
|
|
11
|
+
updatedAt: z.ZodDate;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
14
|
+
completed: z.ZodBoolean;
|
|
15
|
+
listId: z.ZodEffects<z.ZodString, import("../id-types").ListId, string>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
_id: string & {
|
|
18
|
+
readonly __brand: "ListItemId";
|
|
19
|
+
};
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
userId: string & {
|
|
23
|
+
readonly __brand: "UserId";
|
|
24
|
+
};
|
|
25
|
+
name: string;
|
|
26
|
+
completed: boolean;
|
|
27
|
+
listId: string & {
|
|
28
|
+
readonly __brand: "ListId";
|
|
29
|
+
};
|
|
30
|
+
notes?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
_id: string;
|
|
33
|
+
createdAt: Date;
|
|
34
|
+
updatedAt: Date;
|
|
35
|
+
userId: string;
|
|
36
|
+
name: string;
|
|
37
|
+
completed: boolean;
|
|
38
|
+
listId: string;
|
|
39
|
+
notes?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const listSchema: z.ZodObject<{
|
|
42
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").ListId, string>;
|
|
43
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
44
|
+
createdAt: z.ZodDate;
|
|
45
|
+
updatedAt: z.ZodDate;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
type: z.ZodNativeEnum<typeof ListType>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
_id: string & {
|
|
50
|
+
readonly __brand: "ListId";
|
|
51
|
+
};
|
|
52
|
+
createdAt: Date;
|
|
53
|
+
updatedAt: Date;
|
|
54
|
+
userId: string & {
|
|
55
|
+
readonly __brand: "UserId";
|
|
56
|
+
};
|
|
57
|
+
type: ListType;
|
|
58
|
+
name: string;
|
|
59
|
+
}, {
|
|
60
|
+
_id: string;
|
|
61
|
+
createdAt: Date;
|
|
62
|
+
updatedAt: Date;
|
|
63
|
+
userId: string;
|
|
64
|
+
type: ListType;
|
|
65
|
+
name: string;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const createListRequestSchema: z.ZodObject<{
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
type: z.ZodNativeEnum<typeof ListType>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
type: ListType;
|
|
72
|
+
name: string;
|
|
73
|
+
}, {
|
|
74
|
+
type: ListType;
|
|
75
|
+
name: string;
|
|
76
|
+
}>;
|
|
77
|
+
export declare const updateListRequestSchema: z.ZodObject<{
|
|
78
|
+
name: z.ZodOptional<z.ZodString>;
|
|
79
|
+
type: z.ZodOptional<z.ZodNativeEnum<typeof ListType>>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
type?: ListType | undefined;
|
|
82
|
+
name?: string | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
type?: ListType | undefined;
|
|
85
|
+
name?: string | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
export declare const createListItemRequestSchema: z.ZodObject<{
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
90
|
+
listId: z.ZodEffects<z.ZodString, import("../id-types").ListId, string>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
name: string;
|
|
93
|
+
listId: string & {
|
|
94
|
+
readonly __brand: "ListId";
|
|
95
|
+
};
|
|
96
|
+
notes?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
name: string;
|
|
99
|
+
listId: string;
|
|
100
|
+
notes?: string | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
export declare const updateListItemRequestSchema: z.ZodObject<{
|
|
103
|
+
name: z.ZodOptional<z.ZodString>;
|
|
104
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
listId: z.ZodOptional<z.ZodEffects<z.ZodString, import("../id-types").ListId, string>>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
name?: string | undefined;
|
|
109
|
+
notes?: string | null | undefined;
|
|
110
|
+
completed?: boolean | undefined;
|
|
111
|
+
listId?: import("../id-types").ListId | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
name?: string | undefined;
|
|
114
|
+
notes?: string | null | undefined;
|
|
115
|
+
completed?: boolean | undefined;
|
|
116
|
+
listId?: string | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
export declare const completeListItemRequestSchema: z.ZodObject<{
|
|
119
|
+
completed: z.ZodBoolean;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
completed: boolean;
|
|
122
|
+
}, {
|
|
123
|
+
completed: boolean;
|
|
124
|
+
}>;
|
|
125
|
+
export type ListItemData = z.infer<typeof listItemSchema>;
|
|
126
|
+
export type ListData = z.infer<typeof listSchema>;
|
|
127
|
+
export type CreateListRequest = z.infer<typeof createListRequestSchema>;
|
|
128
|
+
export type UpdateListRequest = z.infer<typeof updateListRequestSchema>;
|
|
129
|
+
export type CreateListItemRequest = z.infer<typeof createListItemRequestSchema>;
|
|
130
|
+
export type UpdateListItemRequest = z.infer<typeof updateListItemRequestSchema>;
|
|
131
|
+
export type CompleteListItemRequest = z.infer<typeof completeListItemRequestSchema>;
|
|
132
|
+
export interface CreateListResponse {
|
|
133
|
+
list: Serialized<ListData>;
|
|
134
|
+
}
|
|
135
|
+
export interface GetListsResponse {
|
|
136
|
+
lists: Serialized<ListData>[];
|
|
137
|
+
}
|
|
138
|
+
export interface GetListResponse {
|
|
139
|
+
list: Serialized<ListData>;
|
|
140
|
+
}
|
|
141
|
+
export interface UpdateListResponse {
|
|
142
|
+
list: Serialized<ListData>;
|
|
143
|
+
}
|
|
144
|
+
export interface DeleteListResponse {
|
|
145
|
+
deleted: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface CreateListItemResponse {
|
|
148
|
+
listItem: Serialized<ListItemData>;
|
|
149
|
+
}
|
|
150
|
+
export interface GetListItemsResponse {
|
|
151
|
+
listItems: Serialized<ListItemData>[];
|
|
152
|
+
}
|
|
153
|
+
export interface GetListItemResponse {
|
|
154
|
+
listItem: Serialized<ListItemData>;
|
|
155
|
+
}
|
|
156
|
+
export interface UpdateListItemResponse {
|
|
157
|
+
listItem: Serialized<ListItemData>;
|
|
158
|
+
}
|
|
159
|
+
export interface CompleteListItemResponse {
|
|
160
|
+
listItem: Serialized<ListItemData>;
|
|
161
|
+
}
|
|
162
|
+
export interface DeleteListItemResponse {
|
|
163
|
+
deleted: boolean;
|
|
164
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.completeListItemRequestSchema = exports.updateListItemRequestSchema = exports.createListItemRequestSchema = exports.updateListRequestSchema = exports.createListRequestSchema = exports.listSchema = exports.listItemSchema = exports.ListType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../id-types");
|
|
6
|
+
var ListType;
|
|
7
|
+
(function (ListType) {
|
|
8
|
+
ListType["TASKS"] = "tasks";
|
|
9
|
+
ListType["NOTES"] = "notes";
|
|
10
|
+
})(ListType || (exports.ListType = ListType = {}));
|
|
11
|
+
exports.listItemSchema = zod_1.z.object({
|
|
12
|
+
_id: id_types_1.listItemIdSchema,
|
|
13
|
+
userId: id_types_1.userIdSchema,
|
|
14
|
+
createdAt: zod_1.z.date(),
|
|
15
|
+
updatedAt: zod_1.z.date(),
|
|
16
|
+
name: zod_1.z.string(),
|
|
17
|
+
notes: zod_1.z.string().optional(),
|
|
18
|
+
completed: zod_1.z.boolean(),
|
|
19
|
+
listId: id_types_1.listIdSchema
|
|
20
|
+
});
|
|
21
|
+
exports.listSchema = zod_1.z.object({
|
|
22
|
+
_id: id_types_1.listIdSchema,
|
|
23
|
+
userId: id_types_1.userIdSchema,
|
|
24
|
+
createdAt: zod_1.z.date(),
|
|
25
|
+
updatedAt: zod_1.z.date(),
|
|
26
|
+
name: zod_1.z.string(),
|
|
27
|
+
type: zod_1.z.nativeEnum(ListType)
|
|
28
|
+
});
|
|
29
|
+
exports.createListRequestSchema = zod_1.z.object({
|
|
30
|
+
name: zod_1.z.string().min(1),
|
|
31
|
+
type: zod_1.z.nativeEnum(ListType)
|
|
32
|
+
});
|
|
33
|
+
exports.updateListRequestSchema = zod_1.z.object({
|
|
34
|
+
name: zod_1.z.string().min(1).optional(),
|
|
35
|
+
type: zod_1.z.nativeEnum(ListType).optional()
|
|
36
|
+
});
|
|
37
|
+
exports.createListItemRequestSchema = zod_1.z.object({
|
|
38
|
+
name: zod_1.z.string().min(1),
|
|
39
|
+
notes: zod_1.z.string().optional(),
|
|
40
|
+
listId: id_types_1.listIdSchema
|
|
41
|
+
});
|
|
42
|
+
exports.updateListItemRequestSchema = zod_1.z.object({
|
|
43
|
+
name: zod_1.z.string().min(1).optional(),
|
|
44
|
+
notes: zod_1.z.string().nullish(),
|
|
45
|
+
completed: zod_1.z.boolean().optional(),
|
|
46
|
+
listId: id_types_1.listIdSchema.optional()
|
|
47
|
+
});
|
|
48
|
+
exports.completeListItemRequestSchema = zod_1.z.object({
|
|
49
|
+
completed: zod_1.z.boolean()
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './version-types';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./version-types"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const versionQuerySchema: z.ZodObject<{
|
|
3
|
+
iOSBuildVersion: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
androidBuildVersion: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
iOSBuildVersion?: number | undefined;
|
|
7
|
+
androidBuildVersion?: number | undefined;
|
|
8
|
+
}, {
|
|
9
|
+
iOSBuildVersion?: number | undefined;
|
|
10
|
+
androidBuildVersion?: number | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const versionResponseSchema: z.ZodObject<{
|
|
13
|
+
minIOSBuildVersion: z.ZodNumber;
|
|
14
|
+
minAndroidBuildVersion: z.ZodNumber;
|
|
15
|
+
updateRequired: z.ZodBoolean;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
minIOSBuildVersion: number;
|
|
18
|
+
minAndroidBuildVersion: number;
|
|
19
|
+
updateRequired: boolean;
|
|
20
|
+
}, {
|
|
21
|
+
minIOSBuildVersion: number;
|
|
22
|
+
minAndroidBuildVersion: number;
|
|
23
|
+
updateRequired: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
export type VersionQuery = z.infer<typeof versionQuerySchema>;
|
|
26
|
+
export type VersionResponse = z.infer<typeof versionResponseSchema>;
|