@timothyw/pat-common 1.0.140 → 1.0.142
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
CHANGED
|
@@ -43,7 +43,7 @@ export declare const notificationTemplateIdSchema: z.ZodEffects<z.ZodString, Not
|
|
|
43
43
|
export type NotificationTemplateId = string & {
|
|
44
44
|
readonly __brand: "NotificationTemplateId";
|
|
45
45
|
};
|
|
46
|
-
export declare const
|
|
47
|
-
export type
|
|
48
|
-
readonly __brand: "
|
|
46
|
+
export declare const notificationDesyncIdSchema: z.ZodEffects<z.ZodString, NotificationSyncId, string>;
|
|
47
|
+
export type NotificationSyncId = string & {
|
|
48
|
+
readonly __brand: "NotificationSyncId";
|
|
49
49
|
};
|
package/dist/types/id-types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.notificationDesyncIdSchema = exports.notificationTemplateIdSchema = exports.habitEntryIdSchema = exports.habitIdSchema = exports.listItemIdSchema = exports.listIdSchema = exports.thoughtIdSchema = exports.personNoteIdSchema = exports.personIdSchema = exports.itemIdSchema = exports.authIdSchema = exports.userIdSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.userIdSchema = zod_1.z.string().transform((val) => val);
|
|
6
6
|
exports.authIdSchema = zod_1.z.string().transform((val) => val);
|
|
@@ -13,4 +13,4 @@ exports.listItemIdSchema = zod_1.z.string().transform((val) => val);
|
|
|
13
13
|
exports.habitIdSchema = zod_1.z.string().transform((val) => val);
|
|
14
14
|
exports.habitEntryIdSchema = zod_1.z.string().transform((val) => val);
|
|
15
15
|
exports.notificationTemplateIdSchema = zod_1.z.string().transform((val) => val);
|
|
16
|
-
exports.
|
|
16
|
+
exports.notificationDesyncIdSchema = zod_1.z.string().transform((val) => val);
|
|
@@ -119,6 +119,24 @@ export declare const notificationTemplateSchema: z.ZodObject<{
|
|
|
119
119
|
active: boolean;
|
|
120
120
|
variantData?: any;
|
|
121
121
|
}>;
|
|
122
|
+
export declare const notificationDesyncSchema: z.ZodObject<{
|
|
123
|
+
_id: z.ZodEffects<z.ZodString, import("./id-types").NotificationSyncId, string>;
|
|
124
|
+
targetId: z.ZodString;
|
|
125
|
+
createdAt: z.ZodDate;
|
|
126
|
+
updatedAt: z.ZodDate;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
_id: string & {
|
|
129
|
+
readonly __brand: "NotificationSyncId";
|
|
130
|
+
};
|
|
131
|
+
createdAt: Date;
|
|
132
|
+
updatedAt: Date;
|
|
133
|
+
targetId: string;
|
|
134
|
+
}, {
|
|
135
|
+
_id: string;
|
|
136
|
+
createdAt: Date;
|
|
137
|
+
updatedAt: Date;
|
|
138
|
+
targetId: string;
|
|
139
|
+
}>;
|
|
122
140
|
export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
|
|
123
141
|
targetLevel: z.ZodNativeEnum<typeof NotificationTemplateLevel>;
|
|
124
142
|
targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
@@ -247,8 +265,8 @@ export declare const setEntitySyncRequestSchema: z.ZodObject<{
|
|
|
247
265
|
targetId: string;
|
|
248
266
|
synced: boolean;
|
|
249
267
|
}>;
|
|
250
|
-
export type NotificationTrigger = z.infer<typeof notificationSchedulerDataSchema>;
|
|
251
268
|
export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
|
|
269
|
+
export type NotificationDesyncData = z.infer<typeof notificationDesyncSchema>;
|
|
252
270
|
export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
|
|
253
271
|
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|
|
254
272
|
export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = void 0;
|
|
3
|
+
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationDesyncSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const id_types_1 = require("./id-types");
|
|
6
6
|
var NotificationTemplateLevel;
|
|
@@ -48,6 +48,12 @@ exports.notificationTemplateSchema = zod_1.z.object({
|
|
|
48
48
|
createdAt: zod_1.z.date(),
|
|
49
49
|
updatedAt: zod_1.z.date()
|
|
50
50
|
});
|
|
51
|
+
exports.notificationDesyncSchema = zod_1.z.object({
|
|
52
|
+
_id: id_types_1.notificationDesyncIdSchema,
|
|
53
|
+
targetId: zod_1.z.string(),
|
|
54
|
+
createdAt: zod_1.z.date(),
|
|
55
|
+
updatedAt: zod_1.z.date()
|
|
56
|
+
});
|
|
51
57
|
exports.createNotificationTemplateRequestSchema = zod_1.z.object({
|
|
52
58
|
targetLevel: zod_1.z.nativeEnum(NotificationTemplateLevel),
|
|
53
59
|
targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
|
package/package.json
CHANGED
package/src/types/id-types.ts
CHANGED
|
@@ -33,5 +33,5 @@ export type HabitEntryId = string & { readonly __brand: "HabitEntryId" };
|
|
|
33
33
|
export const notificationTemplateIdSchema = z.string().transform((val): NotificationTemplateId => val as NotificationTemplateId);
|
|
34
34
|
export type NotificationTemplateId = string & { readonly __brand: "NotificationTemplateId" };
|
|
35
35
|
|
|
36
|
-
export const
|
|
37
|
-
export type
|
|
36
|
+
export const notificationDesyncIdSchema = z.string().transform((val): NotificationSyncId => val as NotificationSyncId);
|
|
37
|
+
export type NotificationSyncId = string & { readonly __brand: "NotificationSyncId" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { notificationTemplateIdSchema,
|
|
2
|
+
import { notificationTemplateIdSchema, notificationDesyncIdSchema, userIdSchema } from './id-types';
|
|
3
3
|
import { Serialized } from '../utils';
|
|
4
4
|
|
|
5
5
|
export interface NotificationContext<T = any> {
|
|
@@ -57,6 +57,13 @@ export const notificationTemplateSchema = z.object({
|
|
|
57
57
|
updatedAt: z.date()
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
export const notificationDesyncSchema = z.object({
|
|
61
|
+
_id: notificationDesyncIdSchema,
|
|
62
|
+
targetId: z.string(),
|
|
63
|
+
createdAt: z.date(),
|
|
64
|
+
updatedAt: z.date()
|
|
65
|
+
});
|
|
66
|
+
|
|
60
67
|
export const createNotificationTemplateRequestSchema = z.object({
|
|
61
68
|
targetLevel: z.nativeEnum(NotificationTemplateLevel),
|
|
62
69
|
targetEntityType: z.nativeEnum(NotificationEntityType),
|
|
@@ -83,8 +90,8 @@ export const setEntitySyncRequestSchema = z.object({
|
|
|
83
90
|
synced: z.boolean()
|
|
84
91
|
});
|
|
85
92
|
|
|
86
|
-
export type NotificationTrigger = z.infer<typeof notificationSchedulerDataSchema>;
|
|
87
93
|
export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
|
|
94
|
+
export type NotificationDesyncData = z.infer<typeof notificationDesyncSchema>;
|
|
88
95
|
|
|
89
96
|
export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
|
|
90
97
|
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|