@timothyw/pat-common 1.0.153 → 1.0.155
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/habits-types.d.ts +5 -17
- package/dist/types/habits-types.js +4 -7
- package/dist/types/notifications-types.d.ts +36 -36
- package/dist/types/notifications-types.js +12 -12
- package/package.json +1 -1
- package/src/types/habits-types.ts +1 -4
- package/src/types/notifications-types.ts +14 -14
|
@@ -16,7 +16,7 @@ export declare const habitEntrySchema: z.ZodObject<{
|
|
|
16
16
|
_id: z.ZodEffects<z.ZodString, import("./id-types").HabitEntryId, string>;
|
|
17
17
|
habitId: z.ZodEffects<z.ZodString, import("./id-types").HabitId, string>;
|
|
18
18
|
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
19
|
-
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
19
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
20
20
|
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
21
21
|
createdAt: z.ZodDate;
|
|
22
22
|
updatedAt: z.ZodDate;
|
|
@@ -52,10 +52,9 @@ export declare const habitDataSchema: z.ZodObject<{
|
|
|
52
52
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
53
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
54
|
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
55
|
-
rolloverTime: z.ZodString;
|
|
56
55
|
startOffsetMinutes: z.ZodNumber;
|
|
57
56
|
endOffsetMinutes: z.ZodNumber;
|
|
58
|
-
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
57
|
+
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
59
58
|
createdAt: z.ZodDate;
|
|
60
59
|
updatedAt: z.ZodDate;
|
|
61
60
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -69,7 +68,6 @@ export declare const habitDataSchema: z.ZodObject<{
|
|
|
69
68
|
};
|
|
70
69
|
name: string;
|
|
71
70
|
frequency: HabitFrequency;
|
|
72
|
-
rolloverTime: string;
|
|
73
71
|
startOffsetMinutes: number;
|
|
74
72
|
endOffsetMinutes: number;
|
|
75
73
|
firstDay: string & {
|
|
@@ -84,7 +82,6 @@ export declare const habitDataSchema: z.ZodObject<{
|
|
|
84
82
|
userId: string;
|
|
85
83
|
name: string;
|
|
86
84
|
frequency: HabitFrequency;
|
|
87
|
-
rolloverTime: string;
|
|
88
85
|
startOffsetMinutes: number;
|
|
89
86
|
endOffsetMinutes: number;
|
|
90
87
|
firstDay: string;
|
|
@@ -117,10 +114,9 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
117
114
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
115
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
116
|
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
120
|
-
rolloverTime: z.ZodString;
|
|
121
117
|
startOffsetMinutes: z.ZodNumber;
|
|
122
118
|
endOffsetMinutes: z.ZodNumber;
|
|
123
|
-
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
119
|
+
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
124
120
|
createdAt: z.ZodDate;
|
|
125
121
|
updatedAt: z.ZodDate;
|
|
126
122
|
} & {
|
|
@@ -128,7 +124,7 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
128
124
|
_id: z.ZodEffects<z.ZodString, import("./id-types").HabitEntryId, string>;
|
|
129
125
|
habitId: z.ZodEffects<z.ZodString, import("./id-types").HabitId, string>;
|
|
130
126
|
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
131
|
-
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
127
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
132
128
|
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
133
129
|
createdAt: z.ZodDate;
|
|
134
130
|
updatedAt: z.ZodDate;
|
|
@@ -204,7 +200,6 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
204
200
|
};
|
|
205
201
|
name: string;
|
|
206
202
|
frequency: HabitFrequency;
|
|
207
|
-
rolloverTime: string;
|
|
208
203
|
startOffsetMinutes: number;
|
|
209
204
|
endOffsetMinutes: number;
|
|
210
205
|
firstDay: string & {
|
|
@@ -235,7 +230,6 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
235
230
|
userId: string;
|
|
236
231
|
name: string;
|
|
237
232
|
frequency: HabitFrequency;
|
|
238
|
-
rolloverTime: string;
|
|
239
233
|
startOffsetMinutes: number;
|
|
240
234
|
endOffsetMinutes: number;
|
|
241
235
|
firstDay: string;
|
|
@@ -254,13 +248,11 @@ export declare const createHabitRequestSchema: z.ZodObject<{
|
|
|
254
248
|
description: z.ZodOptional<z.ZodString>;
|
|
255
249
|
notes: z.ZodOptional<z.ZodString>;
|
|
256
250
|
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
257
|
-
rolloverTime: z.ZodString;
|
|
258
251
|
startOffsetMinutes: z.ZodNumber;
|
|
259
252
|
endOffsetMinutes: z.ZodNumber;
|
|
260
253
|
}, "strip", z.ZodTypeAny, {
|
|
261
254
|
name: string;
|
|
262
255
|
frequency: HabitFrequency;
|
|
263
|
-
rolloverTime: string;
|
|
264
256
|
startOffsetMinutes: number;
|
|
265
257
|
endOffsetMinutes: number;
|
|
266
258
|
description?: string | undefined;
|
|
@@ -268,7 +260,6 @@ export declare const createHabitRequestSchema: z.ZodObject<{
|
|
|
268
260
|
}, {
|
|
269
261
|
name: string;
|
|
270
262
|
frequency: HabitFrequency;
|
|
271
|
-
rolloverTime: string;
|
|
272
263
|
startOffsetMinutes: number;
|
|
273
264
|
endOffsetMinutes: number;
|
|
274
265
|
description?: string | undefined;
|
|
@@ -279,7 +270,6 @@ export declare const updateHabitRequestSchema: z.ZodObject<{
|
|
|
279
270
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
280
271
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
281
272
|
frequency: z.ZodOptional<z.ZodNativeEnum<typeof HabitFrequency>>;
|
|
282
|
-
rolloverTime: z.ZodOptional<z.ZodString>;
|
|
283
273
|
startOffsetMinutes: z.ZodOptional<z.ZodNumber>;
|
|
284
274
|
endOffsetMinutes: z.ZodOptional<z.ZodNumber>;
|
|
285
275
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -287,7 +277,6 @@ export declare const updateHabitRequestSchema: z.ZodObject<{
|
|
|
287
277
|
description?: string | null | undefined;
|
|
288
278
|
notes?: string | null | undefined;
|
|
289
279
|
frequency?: HabitFrequency | undefined;
|
|
290
|
-
rolloverTime?: string | undefined;
|
|
291
280
|
startOffsetMinutes?: number | undefined;
|
|
292
281
|
endOffsetMinutes?: number | undefined;
|
|
293
282
|
}, {
|
|
@@ -295,12 +284,11 @@ export declare const updateHabitRequestSchema: z.ZodObject<{
|
|
|
295
284
|
description?: string | null | undefined;
|
|
296
285
|
notes?: string | null | undefined;
|
|
297
286
|
frequency?: HabitFrequency | undefined;
|
|
298
|
-
rolloverTime?: string | undefined;
|
|
299
287
|
startOffsetMinutes?: number | undefined;
|
|
300
288
|
endOffsetMinutes?: number | undefined;
|
|
301
289
|
}>;
|
|
302
290
|
export declare const createHabitEntryRequestSchema: z.ZodObject<{
|
|
303
|
-
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
291
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
304
292
|
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
305
293
|
}, "strip", z.ZodTypeAny, {
|
|
306
294
|
status: HabitEntryStatus;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createHabitEntryRequestSchema = exports.updateHabitRequestSchema = exports.createHabitRequestSchema = exports.habitSchema = exports.habitStatsSchema = exports.habitDataSchema = exports.habitEntrySchema = exports.HabitEntryStatus = exports.HabitFrequency = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const id_types_1 = require("./id-types");
|
|
6
|
-
const
|
|
6
|
+
const misc_1 = require("./misc");
|
|
7
7
|
var HabitFrequency;
|
|
8
8
|
(function (HabitFrequency) {
|
|
9
9
|
HabitFrequency["DAILY"] = "daily";
|
|
@@ -22,7 +22,7 @@ exports.habitEntrySchema = zod_1.z.object({
|
|
|
22
22
|
_id: id_types_1.habitEntryIdSchema,
|
|
23
23
|
habitId: id_types_1.habitIdSchema,
|
|
24
24
|
userId: id_types_1.userIdSchema,
|
|
25
|
-
date:
|
|
25
|
+
date: misc_1.dateOnlyStringSchema,
|
|
26
26
|
status: zod_1.z.nativeEnum(HabitEntryStatus),
|
|
27
27
|
createdAt: zod_1.z.date(),
|
|
28
28
|
updatedAt: zod_1.z.date()
|
|
@@ -34,10 +34,9 @@ exports.habitDataSchema = zod_1.z.object({
|
|
|
34
34
|
description: zod_1.z.string().nullable().optional(),
|
|
35
35
|
notes: zod_1.z.string().nullable().optional(),
|
|
36
36
|
frequency: zod_1.z.nativeEnum(HabitFrequency),
|
|
37
|
-
rolloverTime: zod_1.z.string(), // TODO: deprecated
|
|
38
37
|
startOffsetMinutes: zod_1.z.number(),
|
|
39
38
|
endOffsetMinutes: zod_1.z.number(),
|
|
40
|
-
firstDay:
|
|
39
|
+
firstDay: misc_1.dateOnlyStringSchema,
|
|
41
40
|
createdAt: zod_1.z.date(),
|
|
42
41
|
updatedAt: zod_1.z.date()
|
|
43
42
|
});
|
|
@@ -57,7 +56,6 @@ exports.createHabitRequestSchema = zod_1.z.object({
|
|
|
57
56
|
description: zod_1.z.string().trim().optional(),
|
|
58
57
|
notes: zod_1.z.string().trim().optional(),
|
|
59
58
|
frequency: zod_1.z.nativeEnum(HabitFrequency),
|
|
60
|
-
rolloverTime: zod_1.z.string(), // TODO: deprecated
|
|
61
59
|
startOffsetMinutes: zod_1.z.number(),
|
|
62
60
|
endOffsetMinutes: zod_1.z.number(),
|
|
63
61
|
});
|
|
@@ -66,11 +64,10 @@ exports.updateHabitRequestSchema = zod_1.z.object({
|
|
|
66
64
|
description: zod_1.z.string().trim().nullish(),
|
|
67
65
|
notes: zod_1.z.string().trim().nullish(),
|
|
68
66
|
frequency: zod_1.z.nativeEnum(HabitFrequency).optional(),
|
|
69
|
-
rolloverTime: zod_1.z.string().optional(), // TODO: deprecated
|
|
70
67
|
startOffsetMinutes: zod_1.z.number().optional(),
|
|
71
68
|
endOffsetMinutes: zod_1.z.number().optional(),
|
|
72
69
|
});
|
|
73
70
|
exports.createHabitEntryRequestSchema = zod_1.z.object({
|
|
74
|
-
date:
|
|
71
|
+
date: misc_1.dateOnlyStringSchema,
|
|
75
72
|
status: zod_1.z.nativeEnum(HabitEntryStatus)
|
|
76
73
|
});
|
|
@@ -176,29 +176,6 @@ export declare const notificationTemplateSchema: z.ZodObject<{
|
|
|
176
176
|
};
|
|
177
177
|
active: boolean;
|
|
178
178
|
}>;
|
|
179
|
-
export declare const notificationDesyncSchema: z.ZodObject<{
|
|
180
|
-
_id: z.ZodEffects<z.ZodString, import("./id-types").NotificationSyncId, string>;
|
|
181
|
-
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
182
|
-
targetId: z.ZodString;
|
|
183
|
-
createdAt: z.ZodDate;
|
|
184
|
-
updatedAt: z.ZodDate;
|
|
185
|
-
}, "strip", z.ZodTypeAny, {
|
|
186
|
-
_id: string & {
|
|
187
|
-
readonly __brand: "NotificationSyncId";
|
|
188
|
-
};
|
|
189
|
-
createdAt: Date;
|
|
190
|
-
updatedAt: Date;
|
|
191
|
-
userId: string & {
|
|
192
|
-
readonly __brand: "UserId";
|
|
193
|
-
};
|
|
194
|
-
targetId: string;
|
|
195
|
-
}, {
|
|
196
|
-
_id: string;
|
|
197
|
-
createdAt: Date;
|
|
198
|
-
updatedAt: Date;
|
|
199
|
-
userId: string;
|
|
200
|
-
targetId: string;
|
|
201
|
-
}>;
|
|
202
179
|
export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
|
|
203
180
|
targetLevel: z.ZodNativeEnum<typeof NotificationTemplateLevel>;
|
|
204
181
|
targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
@@ -364,33 +341,56 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
|
|
|
364
341
|
} | undefined;
|
|
365
342
|
active?: boolean | undefined;
|
|
366
343
|
}>;
|
|
344
|
+
export declare const notificationEntityDesyncSchema: z.ZodObject<{
|
|
345
|
+
_id: z.ZodEffects<z.ZodString, import("./id-types").NotificationSyncId, string>;
|
|
346
|
+
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
347
|
+
entityId: z.ZodString;
|
|
348
|
+
createdAt: z.ZodDate;
|
|
349
|
+
updatedAt: z.ZodDate;
|
|
350
|
+
}, "strip", z.ZodTypeAny, {
|
|
351
|
+
_id: string & {
|
|
352
|
+
readonly __brand: "NotificationSyncId";
|
|
353
|
+
};
|
|
354
|
+
createdAt: Date;
|
|
355
|
+
updatedAt: Date;
|
|
356
|
+
userId: string & {
|
|
357
|
+
readonly __brand: "UserId";
|
|
358
|
+
};
|
|
359
|
+
entityId: string;
|
|
360
|
+
}, {
|
|
361
|
+
_id: string;
|
|
362
|
+
createdAt: Date;
|
|
363
|
+
updatedAt: Date;
|
|
364
|
+
userId: string;
|
|
365
|
+
entityId: string;
|
|
366
|
+
}>;
|
|
367
367
|
export declare const getEntitySyncRequestSchema: z.ZodObject<{
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
369
|
+
entityId: z.ZodString;
|
|
370
370
|
}, "strip", z.ZodTypeAny, {
|
|
371
|
-
|
|
372
|
-
|
|
371
|
+
entityId: string;
|
|
372
|
+
entityType: NotificationEntityType;
|
|
373
373
|
}, {
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
entityId: string;
|
|
375
|
+
entityType: NotificationEntityType;
|
|
376
376
|
}>;
|
|
377
377
|
export declare const setEntitySyncRequestSchema: z.ZodObject<{
|
|
378
|
-
|
|
379
|
-
|
|
378
|
+
entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
379
|
+
entityId: z.ZodString;
|
|
380
380
|
synced: z.ZodBoolean;
|
|
381
381
|
}, "strip", z.ZodTypeAny, {
|
|
382
382
|
synced: boolean;
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
entityId: string;
|
|
384
|
+
entityType: NotificationEntityType;
|
|
385
385
|
}, {
|
|
386
386
|
synced: boolean;
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
entityId: string;
|
|
388
|
+
entityType: NotificationEntityType;
|
|
389
389
|
}>;
|
|
390
390
|
export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
|
|
391
|
-
export type NotificationDesyncData = z.infer<typeof notificationDesyncSchema>;
|
|
392
391
|
export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
|
|
393
392
|
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|
|
393
|
+
export type NotificationDesyncData = z.infer<typeof notificationEntityDesyncSchema>;
|
|
394
394
|
export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
|
|
395
395
|
export type SetEntitySyncRequest = z.infer<typeof setEntitySyncRequestSchema>;
|
|
396
396
|
export interface CreateNotificationTemplateResponse {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.
|
|
3
|
+
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.notificationEntityDesyncSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationTemplateSchema = exports.notificationVariantDataSchema = exports.notificationSchedulerDataSchema = exports.ENTITY_TYPE_VARIANT_MAP = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = exports.NotificationTemplateSyncState = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const id_types_1 = require("./id-types");
|
|
6
6
|
var NotificationTemplateSyncState;
|
|
@@ -79,13 +79,6 @@ exports.notificationTemplateSchema = zod_1.z.object({
|
|
|
79
79
|
createdAt: zod_1.z.date(),
|
|
80
80
|
updatedAt: zod_1.z.date()
|
|
81
81
|
});
|
|
82
|
-
exports.notificationDesyncSchema = zod_1.z.object({
|
|
83
|
-
_id: id_types_1.notificationDesyncIdSchema,
|
|
84
|
-
userId: id_types_1.userIdSchema,
|
|
85
|
-
targetId: zod_1.z.string(),
|
|
86
|
-
createdAt: zod_1.z.date(),
|
|
87
|
-
updatedAt: zod_1.z.date()
|
|
88
|
-
});
|
|
89
82
|
exports.createNotificationTemplateRequestSchema = zod_1.z.object({
|
|
90
83
|
targetLevel: zod_1.z.nativeEnum(NotificationTemplateLevel),
|
|
91
84
|
targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
|
|
@@ -99,12 +92,19 @@ exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
|
|
|
99
92
|
variantData: exports.notificationVariantDataSchema.optional(),
|
|
100
93
|
active: zod_1.z.boolean().optional()
|
|
101
94
|
});
|
|
95
|
+
exports.notificationEntityDesyncSchema = zod_1.z.object({
|
|
96
|
+
_id: id_types_1.notificationDesyncIdSchema,
|
|
97
|
+
userId: id_types_1.userIdSchema,
|
|
98
|
+
entityId: zod_1.z.string(),
|
|
99
|
+
createdAt: zod_1.z.date(),
|
|
100
|
+
updatedAt: zod_1.z.date()
|
|
101
|
+
});
|
|
102
102
|
exports.getEntitySyncRequestSchema = zod_1.z.object({
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
entityType: zod_1.z.nativeEnum(NotificationEntityType),
|
|
104
|
+
entityId: zod_1.z.string()
|
|
105
105
|
});
|
|
106
106
|
exports.setEntitySyncRequestSchema = zod_1.z.object({
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
entityType: zod_1.z.nativeEnum(NotificationEntityType),
|
|
108
|
+
entityId: zod_1.z.string(),
|
|
109
109
|
synced: zod_1.z.boolean()
|
|
110
110
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { habitIdSchema, habitEntryIdSchema, userIdSchema } from './id-types';
|
|
3
|
-
import { dateOnlyStringSchema } from './misc
|
|
3
|
+
import { dateOnlyStringSchema } from './misc';
|
|
4
4
|
import { Serialized } from '../utils';
|
|
5
5
|
|
|
6
6
|
export enum HabitFrequency {
|
|
@@ -34,7 +34,6 @@ export const habitDataSchema = z.object({
|
|
|
34
34
|
description: z.string().nullable().optional(),
|
|
35
35
|
notes: z.string().nullable().optional(),
|
|
36
36
|
frequency: z.nativeEnum(HabitFrequency),
|
|
37
|
-
rolloverTime: z.string(), // TODO: deprecated
|
|
38
37
|
startOffsetMinutes: z.number(),
|
|
39
38
|
endOffsetMinutes: z.number(),
|
|
40
39
|
firstDay: dateOnlyStringSchema,
|
|
@@ -60,7 +59,6 @@ export const createHabitRequestSchema = z.object({
|
|
|
60
59
|
description: z.string().trim().optional(),
|
|
61
60
|
notes: z.string().trim().optional(),
|
|
62
61
|
frequency: z.nativeEnum(HabitFrequency),
|
|
63
|
-
rolloverTime: z.string(), // TODO: deprecated
|
|
64
62
|
startOffsetMinutes: z.number(),
|
|
65
63
|
endOffsetMinutes: z.number(),
|
|
66
64
|
});
|
|
@@ -70,7 +68,6 @@ export const updateHabitRequestSchema = z.object({
|
|
|
70
68
|
description: z.string().trim().nullish(),
|
|
71
69
|
notes: z.string().trim().nullish(),
|
|
72
70
|
frequency: z.nativeEnum(HabitFrequency).optional(),
|
|
73
|
-
rolloverTime: z.string().optional(), // TODO: deprecated
|
|
74
71
|
startOffsetMinutes: z.number().optional(),
|
|
75
72
|
endOffsetMinutes: z.number().optional(),
|
|
76
73
|
});
|
|
@@ -90,14 +90,6 @@ export const notificationTemplateSchema = z.object({
|
|
|
90
90
|
updatedAt: z.date()
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
-
export const notificationDesyncSchema = z.object({
|
|
94
|
-
_id: notificationDesyncIdSchema,
|
|
95
|
-
userId: userIdSchema,
|
|
96
|
-
targetId: z.string(),
|
|
97
|
-
createdAt: z.date(),
|
|
98
|
-
updatedAt: z.date()
|
|
99
|
-
});
|
|
100
|
-
|
|
101
93
|
export const createNotificationTemplateRequestSchema = z.object({
|
|
102
94
|
targetLevel: z.nativeEnum(NotificationTemplateLevel),
|
|
103
95
|
targetEntityType: z.nativeEnum(NotificationEntityType),
|
|
@@ -113,23 +105,31 @@ export const updateNotificationTemplateRequestSchema = z.object({
|
|
|
113
105
|
active: z.boolean().optional()
|
|
114
106
|
});
|
|
115
107
|
|
|
108
|
+
export const notificationEntityDesyncSchema = z.object({
|
|
109
|
+
_id: notificationDesyncIdSchema,
|
|
110
|
+
userId: userIdSchema,
|
|
111
|
+
entityId: z.string(),
|
|
112
|
+
createdAt: z.date(),
|
|
113
|
+
updatedAt: z.date()
|
|
114
|
+
});
|
|
115
|
+
|
|
116
116
|
export const getEntitySyncRequestSchema = z.object({
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
entityType: z.nativeEnum(NotificationEntityType),
|
|
118
|
+
entityId: z.string()
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
export const setEntitySyncRequestSchema = z.object({
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
entityType: z.nativeEnum(NotificationEntityType),
|
|
123
|
+
entityId: z.string(),
|
|
124
124
|
synced: z.boolean()
|
|
125
125
|
});
|
|
126
126
|
|
|
127
127
|
export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
|
|
128
|
-
export type NotificationDesyncData = z.infer<typeof notificationDesyncSchema>;
|
|
129
|
-
|
|
130
128
|
export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
|
|
131
129
|
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|
|
132
130
|
|
|
131
|
+
export type NotificationDesyncData = z.infer<typeof notificationEntityDesyncSchema>;
|
|
132
|
+
|
|
133
133
|
export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
|
|
134
134
|
export type SetEntitySyncRequest = z.infer<typeof setEntitySyncRequestSchema>;
|
|
135
135
|
|