@timothyw/pat-common 1.0.148 → 1.0.149
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.
|
@@ -6,15 +6,15 @@ export interface NotificationContext<T = any> {
|
|
|
6
6
|
entityData: T;
|
|
7
7
|
userId: string;
|
|
8
8
|
}
|
|
9
|
-
export declare enum NotificationTemplateLevel {
|
|
10
|
-
PARENT = "parent",
|
|
11
|
-
ENTITY = "entity"
|
|
12
|
-
}
|
|
13
9
|
export declare enum NotificationTemplateSyncState {
|
|
14
10
|
SYNCED = "synced",
|
|
15
11
|
DESYNCED = "desynced",
|
|
16
12
|
NO_PARENT = "no_parent"
|
|
17
13
|
}
|
|
14
|
+
export declare enum NotificationTemplateLevel {
|
|
15
|
+
PARENT = "parent",
|
|
16
|
+
ENTITY = "entity"
|
|
17
|
+
}
|
|
18
18
|
export declare enum NotificationEntityType {
|
|
19
19
|
AGENDA_ITEM = "agenda_item",
|
|
20
20
|
HABIT = "habit",
|
|
@@ -29,6 +29,7 @@ export declare enum NotificationVariantType {
|
|
|
29
29
|
AGENDA_ITEM_UPCOMING_DEADLINE = "agenda_item_upcoming_deadline",
|
|
30
30
|
HABIT_INCOMPLETE = "habit_incomplete"
|
|
31
31
|
}
|
|
32
|
+
export declare const ENTITY_TYPE_VARIANT_MAP: Record<NotificationEntityType, NotificationVariantType[]>;
|
|
32
33
|
export declare const notificationSchedulerDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
33
34
|
type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
|
|
34
35
|
days: z.ZodArray<z.ZodNumber, "many">;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationDesyncSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.
|
|
3
|
+
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationDesyncSchema = exports.notificationTemplateSchema = 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
|
-
var NotificationTemplateLevel;
|
|
7
|
-
(function (NotificationTemplateLevel) {
|
|
8
|
-
NotificationTemplateLevel["PARENT"] = "parent";
|
|
9
|
-
NotificationTemplateLevel["ENTITY"] = "entity";
|
|
10
|
-
})(NotificationTemplateLevel || (exports.NotificationTemplateLevel = NotificationTemplateLevel = {}));
|
|
11
6
|
var NotificationTemplateSyncState;
|
|
12
7
|
(function (NotificationTemplateSyncState) {
|
|
13
8
|
NotificationTemplateSyncState["SYNCED"] = "synced";
|
|
14
9
|
NotificationTemplateSyncState["DESYNCED"] = "desynced";
|
|
15
10
|
NotificationTemplateSyncState["NO_PARENT"] = "no_parent";
|
|
16
11
|
})(NotificationTemplateSyncState || (exports.NotificationTemplateSyncState = NotificationTemplateSyncState = {}));
|
|
12
|
+
var NotificationTemplateLevel;
|
|
13
|
+
(function (NotificationTemplateLevel) {
|
|
14
|
+
NotificationTemplateLevel["PARENT"] = "parent";
|
|
15
|
+
NotificationTemplateLevel["ENTITY"] = "entity";
|
|
16
|
+
})(NotificationTemplateLevel || (exports.NotificationTemplateLevel = NotificationTemplateLevel = {}));
|
|
17
17
|
var NotificationEntityType;
|
|
18
18
|
(function (NotificationEntityType) {
|
|
19
19
|
NotificationEntityType["AGENDA_ITEM"] = "agenda_item";
|
|
@@ -31,6 +31,16 @@ var NotificationVariantType;
|
|
|
31
31
|
NotificationVariantType["AGENDA_ITEM_UPCOMING_DEADLINE"] = "agenda_item_upcoming_deadline";
|
|
32
32
|
NotificationVariantType["HABIT_INCOMPLETE"] = "habit_incomplete";
|
|
33
33
|
})(NotificationVariantType || (exports.NotificationVariantType = NotificationVariantType = {}));
|
|
34
|
+
exports.ENTITY_TYPE_VARIANT_MAP = {
|
|
35
|
+
[NotificationEntityType.AGENDA_ITEM]: [
|
|
36
|
+
NotificationVariantType.AGENDA_ITEM_UPCOMING_DEADLINE,
|
|
37
|
+
],
|
|
38
|
+
[NotificationEntityType.HABIT]: [
|
|
39
|
+
NotificationVariantType.HABIT_INCOMPLETE,
|
|
40
|
+
],
|
|
41
|
+
[NotificationEntityType.AGENDA_PANEL]: [],
|
|
42
|
+
[NotificationEntityType.INBOX_PANEL]: [],
|
|
43
|
+
};
|
|
34
44
|
exports.notificationSchedulerDataSchema = zod_1.z.discriminatedUnion('type', [
|
|
35
45
|
zod_1.z.object({
|
|
36
46
|
type: zod_1.z.literal(NotificationSchedulerType.DAY_TIME),
|
package/package.json
CHANGED
|
@@ -9,17 +9,17 @@ export interface NotificationContext<T = any> {
|
|
|
9
9
|
userId: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export enum NotificationTemplateLevel {
|
|
13
|
-
PARENT = 'parent',
|
|
14
|
-
ENTITY = 'entity'
|
|
15
|
-
}
|
|
16
|
-
|
|
17
12
|
export enum NotificationTemplateSyncState {
|
|
18
13
|
SYNCED = 'synced',
|
|
19
14
|
DESYNCED = 'desynced',
|
|
20
15
|
NO_PARENT = 'no_parent'
|
|
21
16
|
}
|
|
22
17
|
|
|
18
|
+
export enum NotificationTemplateLevel {
|
|
19
|
+
PARENT = 'parent',
|
|
20
|
+
ENTITY = 'entity'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
23
|
export enum NotificationEntityType {
|
|
24
24
|
AGENDA_ITEM = 'agenda_item',
|
|
25
25
|
HABIT = 'habit',
|
|
@@ -38,6 +38,17 @@ export enum NotificationVariantType {
|
|
|
38
38
|
HABIT_INCOMPLETE = 'habit_incomplete',
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
export const ENTITY_TYPE_VARIANT_MAP: Record<NotificationEntityType, NotificationVariantType[]> = {
|
|
42
|
+
[NotificationEntityType.AGENDA_ITEM]: [
|
|
43
|
+
NotificationVariantType.AGENDA_ITEM_UPCOMING_DEADLINE,
|
|
44
|
+
],
|
|
45
|
+
[NotificationEntityType.HABIT]: [
|
|
46
|
+
NotificationVariantType.HABIT_INCOMPLETE,
|
|
47
|
+
],
|
|
48
|
+
[NotificationEntityType.AGENDA_PANEL]: [],
|
|
49
|
+
[NotificationEntityType.INBOX_PANEL]: [],
|
|
50
|
+
} as const;
|
|
51
|
+
|
|
41
52
|
export const notificationSchedulerDataSchema = z.discriminatedUnion('type', [
|
|
42
53
|
z.object({
|
|
43
54
|
type: z.literal(NotificationSchedulerType.DAY_TIME),
|