@timothyw/pat-common 1.0.118 → 1.0.120
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/agenda-types.d.ts +115 -0
- package/dist/types/agenda-types.js +37 -0
- package/dist/types/auth-types.d.ts +153 -0
- package/dist/types/auth-types.js +48 -0
- package/dist/types/habits-types.d.ts +315 -0
- package/dist/types/habits-types.js +70 -0
- package/dist/types/index.d.ts +11 -3
- package/dist/types/index.js +11 -6
- package/dist/types/lists-types.d.ts +162 -0
- package/dist/types/lists-types.js +50 -0
- package/dist/types/misc/index.d.ts +3 -0
- package/dist/types/misc/index.js +19 -0
- package/dist/types/misc/misc-types.d.ts +8 -0
- package/dist/types/misc/misc-types.js +9 -0
- package/dist/types/misc/socket-message-types.d.ts +17 -0
- package/dist/types/misc/socket-message-types.js +12 -0
- package/dist/types/misc/version-types.d.ts +26 -0
- package/dist/types/misc/version-types.js +13 -0
- package/dist/types/new/notifications-types.d.ts +7 -0
- package/dist/types/notifications-types.d.ts +570 -0
- package/dist/types/notifications-types.js +149 -0
- package/dist/types/people-types.d.ts +283 -0
- package/dist/types/people-types.js +58 -0
- package/dist/types/program-config-types.d.ts +105 -0
- package/dist/types/program-config-types.js +29 -0
- package/dist/types/thoughts-types.d.ts +56 -0
- package/dist/types/thoughts-types.js +18 -0
- package/dist/types/user-types.d.ts +283 -0
- package/dist/types/user-types.js +46 -0
- package/package.json +1 -1
- package/src/types/{new/agenda-types.ts → agenda-types.ts} +2 -2
- package/src/types/{new/auth-types.ts → auth-types.ts} +1 -1
- package/src/types/{new/habits-types.ts → habits-types.ts} +3 -3
- package/src/types/index.ts +12 -7
- package/src/types/{new/lists-types.ts → lists-types.ts} +2 -2
- package/src/types/misc/index.ts +3 -0
- package/src/types/{new/notifications-types.ts → notifications-types.ts} +64 -12
- package/src/types/{new/people-types.ts → people-types.ts} +2 -2
- package/src/types/{new/thoughts-types.ts → thoughts-types.ts} +2 -2
- package/src/types/{new/user-types.ts → user-types.ts} +3 -3
- package/src/types/new/index.ts +0 -10
- package/src/types/new/misc/index.ts +0 -1
- package/src/types/old/api/account/get-user-types.ts +0 -6
- package/src/types/old/api/account/index.ts +0 -2
- package/src/types/old/api/account/update-user-types.ts +0 -14
- package/src/types/old/api/auth/create-account-types.ts +0 -17
- package/src/types/old/api/auth/index.ts +0 -5
- package/src/types/old/api/auth/refresh-auth-types.ts +0 -14
- package/src/types/old/api/auth/resend-verification-types.ts +0 -3
- package/src/types/old/api/auth/sign-in-types.ts +0 -16
- package/src/types/old/api/auth/verify-email-types.ts +0 -3
- package/src/types/old/api/habits/create-habit-entry-types.ts +0 -15
- package/src/types/old/api/habits/create-habit-types.ts +0 -17
- package/src/types/old/api/habits/delete-habit-entry-types.ts +0 -6
- package/src/types/old/api/habits/delete-habit-types.ts +0 -3
- package/src/types/old/api/habits/get-habits-types.ts +0 -6
- package/src/types/old/api/habits/index.ts +0 -6
- package/src/types/old/api/habits/update-habit-types.ts +0 -17
- package/src/types/old/api/index.ts +0 -9
- package/src/types/old/api/items/complete-item-types.ts +0 -13
- package/src/types/old/api/items/create-item-types.ts +0 -18
- package/src/types/old/api/items/delete-item-types.ts +0 -3
- package/src/types/old/api/items/get-items-types.ts +0 -6
- package/src/types/old/api/items/index.ts +0 -5
- package/src/types/old/api/items/update-item-types.ts +0 -18
- package/src/types/old/api/lists/complete-list-item-types.ts +0 -13
- package/src/types/old/api/lists/create-list-item-types.ts +0 -16
- package/src/types/old/api/lists/create-list-types.ts +0 -14
- package/src/types/old/api/lists/get-list-item-types.ts +0 -6
- package/src/types/old/api/lists/get-lists-types.ts +0 -6
- package/src/types/old/api/lists/index.ts +0 -7
- package/src/types/old/api/lists/update-list-item-types.ts +0 -17
- package/src/types/old/api/lists/update-list-types.ts +0 -14
- package/src/types/old/api/misc/index.ts +0 -1
- package/src/types/old/api/misc/version-types.ts +0 -10
- package/src/types/old/api/notifications/create-notification-template-types.ts +0 -30
- package/src/types/old/api/notifications/delete-notification-template-types.ts +0 -8
- package/src/types/old/api/notifications/get-notification-templates-types.ts +0 -12
- package/src/types/old/api/notifications/index.ts +0 -6
- package/src/types/old/api/notifications/preview-notification-template-types.ts +0 -21
- package/src/types/old/api/notifications/sync-notification-template-types.ts +0 -14
- package/src/types/old/api/notifications/update-notification-template-types.ts +0 -30
- package/src/types/old/api/people/create-person-note-types.ts +0 -15
- package/src/types/old/api/people/create-person-types.ts +0 -19
- package/src/types/old/api/people/delete-person-notes-types.ts +0 -3
- package/src/types/old/api/people/delete-person-types.ts +0 -3
- package/src/types/old/api/people/get-people-types.ts +0 -6
- package/src/types/old/api/people/get-person-notes-types.ts +0 -6
- package/src/types/old/api/people/index.ts +0 -8
- package/src/types/old/api/people/update-person-note-types.ts +0 -13
- package/src/types/old/api/people/update-person-types.ts +0 -19
- package/src/types/old/api/thoughts/create-thought-types.ts +0 -13
- package/src/types/old/api/thoughts/delete-thought-types.ts +0 -3
- package/src/types/old/api/thoughts/get-thoughts-types.ts +0 -6
- package/src/types/old/api/thoughts/index.ts +0 -4
- package/src/types/old/api/thoughts/update-thought-types.ts +0 -13
- package/src/types/old/auth-tokens.ts +0 -13
- package/src/types/old/models/auth-data.ts +0 -21
- package/src/types/old/models/habit-data.ts +0 -62
- package/src/types/old/models/index.ts +0 -10
- package/src/types/old/models/item-data.ts +0 -16
- package/src/types/old/models/list-data.ts +0 -26
- package/src/types/old/models/notifiable.ts +0 -52
- package/src/types/old/models/notification-template-data.ts +0 -67
- package/src/types/old/models/person-data.ts +0 -35
- package/src/types/old/models/program-config.ts +0 -25
- package/src/types/old/models/thought-data.ts +0 -9
- package/src/types/old/models/user-data.ts +0 -47
- /package/src/types/{misc-types.ts → misc/misc-types.ts} +0 -0
- /package/src/types/{socket-message-types.ts → misc/socket-message-types.ts} +0 -0
- /package/src/types/{new/misc → misc}/version-types.ts +0 -0
- /package/src/types/{new/program-config-types.ts → program-config-types.ts} +0 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Serialized } from '../utils';
|
|
3
|
+
export interface NotificationContext<T = any> {
|
|
4
|
+
entityId: string;
|
|
5
|
+
entityType: NotificationEntityType;
|
|
6
|
+
entityData: T;
|
|
7
|
+
userId: string;
|
|
8
|
+
variables: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
export declare enum NotificationEntityType {
|
|
11
|
+
AGENDA = "agenda",
|
|
12
|
+
TASKS = "tasks",
|
|
13
|
+
HABITS = "habits",
|
|
14
|
+
INBOX = "inbox",
|
|
15
|
+
AGENDA_ITEM = "agenda_item",
|
|
16
|
+
HABIT = "habit",
|
|
17
|
+
AGENDA_DEFAULTS = "agenda_defaults",
|
|
18
|
+
HABITS_DEFAULTS = "habits_defaults",
|
|
19
|
+
INBOX_PANEL = "inbox_panel"
|
|
20
|
+
}
|
|
21
|
+
export declare const notificationEntityTypeSchema: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
22
|
+
export declare enum NotificationStatus {
|
|
23
|
+
SCHEDULED = "scheduled",
|
|
24
|
+
SENT = "sent",
|
|
25
|
+
FAILED = "failed",
|
|
26
|
+
CANCELLED = "cancelled"
|
|
27
|
+
}
|
|
28
|
+
export declare enum NotificationTriggerType {
|
|
29
|
+
TIME_BASED = "time_based",
|
|
30
|
+
EVENT_BASED = "event_based",
|
|
31
|
+
RECURRING = "recurring"
|
|
32
|
+
}
|
|
33
|
+
export declare const notificationStatusSchema: z.ZodNativeEnum<typeof NotificationStatus>;
|
|
34
|
+
export declare const notificationTriggerTypeSchema: z.ZodNativeEnum<typeof NotificationTriggerType>;
|
|
35
|
+
export declare const notificationTriggerSchema: z.ZodObject<{
|
|
36
|
+
type: z.ZodNativeEnum<typeof NotificationTriggerType>;
|
|
37
|
+
conditions: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
38
|
+
timing: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
type: NotificationTriggerType;
|
|
41
|
+
conditions: Record<string, any>;
|
|
42
|
+
timing: Record<string, any>;
|
|
43
|
+
}, {
|
|
44
|
+
type: NotificationTriggerType;
|
|
45
|
+
conditions: Record<string, any>;
|
|
46
|
+
timing: Record<string, any>;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const notificationContentSchema: z.ZodObject<{
|
|
49
|
+
title: z.ZodString;
|
|
50
|
+
body: z.ZodString;
|
|
51
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
title: string;
|
|
54
|
+
body: string;
|
|
55
|
+
variables?: Record<string, string> | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
title: string;
|
|
58
|
+
body: string;
|
|
59
|
+
variables?: Record<string, string> | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const notificationTemplateSchema: z.ZodObject<{
|
|
62
|
+
_id: z.ZodEffects<z.ZodString, import("./id-types").NotificationTemplateId, string>;
|
|
63
|
+
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
64
|
+
entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
65
|
+
entityId: z.ZodOptional<z.ZodString>;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
description: z.ZodOptional<z.ZodString>;
|
|
68
|
+
trigger: z.ZodObject<{
|
|
69
|
+
type: z.ZodNativeEnum<typeof NotificationTriggerType>;
|
|
70
|
+
conditions: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
71
|
+
timing: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
type: NotificationTriggerType;
|
|
74
|
+
conditions: Record<string, any>;
|
|
75
|
+
timing: Record<string, any>;
|
|
76
|
+
}, {
|
|
77
|
+
type: NotificationTriggerType;
|
|
78
|
+
conditions: Record<string, any>;
|
|
79
|
+
timing: Record<string, any>;
|
|
80
|
+
}>;
|
|
81
|
+
content: z.ZodObject<{
|
|
82
|
+
title: z.ZodString;
|
|
83
|
+
body: z.ZodString;
|
|
84
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
title: string;
|
|
87
|
+
body: string;
|
|
88
|
+
variables?: Record<string, string> | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
title: string;
|
|
91
|
+
body: string;
|
|
92
|
+
variables?: Record<string, string> | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
active: z.ZodBoolean;
|
|
95
|
+
inheritedFrom: z.ZodOptional<z.ZodEffects<z.ZodString, import("./id-types").NotificationTemplateId, string>>;
|
|
96
|
+
customized: z.ZodBoolean;
|
|
97
|
+
createdAt: z.ZodDate;
|
|
98
|
+
updatedAt: z.ZodDate;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
_id: string & {
|
|
101
|
+
readonly __brand: "NotificationTemplateId";
|
|
102
|
+
};
|
|
103
|
+
createdAt: Date;
|
|
104
|
+
updatedAt: Date;
|
|
105
|
+
userId: string & {
|
|
106
|
+
readonly __brand: "UserId";
|
|
107
|
+
};
|
|
108
|
+
name: string;
|
|
109
|
+
content: {
|
|
110
|
+
title: string;
|
|
111
|
+
body: string;
|
|
112
|
+
variables?: Record<string, string> | undefined;
|
|
113
|
+
};
|
|
114
|
+
entityType: NotificationEntityType;
|
|
115
|
+
trigger: {
|
|
116
|
+
type: NotificationTriggerType;
|
|
117
|
+
conditions: Record<string, any>;
|
|
118
|
+
timing: Record<string, any>;
|
|
119
|
+
};
|
|
120
|
+
active: boolean;
|
|
121
|
+
customized: boolean;
|
|
122
|
+
description?: string | undefined;
|
|
123
|
+
entityId?: string | undefined;
|
|
124
|
+
inheritedFrom?: import("./id-types").NotificationTemplateId | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
_id: string;
|
|
127
|
+
createdAt: Date;
|
|
128
|
+
updatedAt: Date;
|
|
129
|
+
userId: string;
|
|
130
|
+
name: string;
|
|
131
|
+
content: {
|
|
132
|
+
title: string;
|
|
133
|
+
body: string;
|
|
134
|
+
variables?: Record<string, string> | undefined;
|
|
135
|
+
};
|
|
136
|
+
entityType: NotificationEntityType;
|
|
137
|
+
trigger: {
|
|
138
|
+
type: NotificationTriggerType;
|
|
139
|
+
conditions: Record<string, any>;
|
|
140
|
+
timing: Record<string, any>;
|
|
141
|
+
};
|
|
142
|
+
active: boolean;
|
|
143
|
+
customized: boolean;
|
|
144
|
+
description?: string | undefined;
|
|
145
|
+
entityId?: string | undefined;
|
|
146
|
+
inheritedFrom?: string | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
export declare const createNotificationTemplateSchema: z.ZodObject<Omit<{
|
|
149
|
+
_id: z.ZodEffects<z.ZodString, import("./id-types").NotificationTemplateId, string>;
|
|
150
|
+
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
151
|
+
entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
152
|
+
entityId: z.ZodOptional<z.ZodString>;
|
|
153
|
+
name: z.ZodString;
|
|
154
|
+
description: z.ZodOptional<z.ZodString>;
|
|
155
|
+
trigger: z.ZodObject<{
|
|
156
|
+
type: z.ZodNativeEnum<typeof NotificationTriggerType>;
|
|
157
|
+
conditions: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
158
|
+
timing: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
type: NotificationTriggerType;
|
|
161
|
+
conditions: Record<string, any>;
|
|
162
|
+
timing: Record<string, any>;
|
|
163
|
+
}, {
|
|
164
|
+
type: NotificationTriggerType;
|
|
165
|
+
conditions: Record<string, any>;
|
|
166
|
+
timing: Record<string, any>;
|
|
167
|
+
}>;
|
|
168
|
+
content: z.ZodObject<{
|
|
169
|
+
title: z.ZodString;
|
|
170
|
+
body: z.ZodString;
|
|
171
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
title: string;
|
|
174
|
+
body: string;
|
|
175
|
+
variables?: Record<string, string> | undefined;
|
|
176
|
+
}, {
|
|
177
|
+
title: string;
|
|
178
|
+
body: string;
|
|
179
|
+
variables?: Record<string, string> | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
active: z.ZodBoolean;
|
|
182
|
+
inheritedFrom: z.ZodOptional<z.ZodEffects<z.ZodString, import("./id-types").NotificationTemplateId, string>>;
|
|
183
|
+
customized: z.ZodBoolean;
|
|
184
|
+
createdAt: z.ZodDate;
|
|
185
|
+
updatedAt: z.ZodDate;
|
|
186
|
+
}, "_id" | "createdAt" | "updatedAt">, "strip", z.ZodTypeAny, {
|
|
187
|
+
userId: string & {
|
|
188
|
+
readonly __brand: "UserId";
|
|
189
|
+
};
|
|
190
|
+
name: string;
|
|
191
|
+
content: {
|
|
192
|
+
title: string;
|
|
193
|
+
body: string;
|
|
194
|
+
variables?: Record<string, string> | undefined;
|
|
195
|
+
};
|
|
196
|
+
entityType: NotificationEntityType;
|
|
197
|
+
trigger: {
|
|
198
|
+
type: NotificationTriggerType;
|
|
199
|
+
conditions: Record<string, any>;
|
|
200
|
+
timing: Record<string, any>;
|
|
201
|
+
};
|
|
202
|
+
active: boolean;
|
|
203
|
+
customized: boolean;
|
|
204
|
+
description?: string | undefined;
|
|
205
|
+
entityId?: string | undefined;
|
|
206
|
+
inheritedFrom?: import("./id-types").NotificationTemplateId | undefined;
|
|
207
|
+
}, {
|
|
208
|
+
userId: string;
|
|
209
|
+
name: string;
|
|
210
|
+
content: {
|
|
211
|
+
title: string;
|
|
212
|
+
body: string;
|
|
213
|
+
variables?: Record<string, string> | undefined;
|
|
214
|
+
};
|
|
215
|
+
entityType: NotificationEntityType;
|
|
216
|
+
trigger: {
|
|
217
|
+
type: NotificationTriggerType;
|
|
218
|
+
conditions: Record<string, any>;
|
|
219
|
+
timing: Record<string, any>;
|
|
220
|
+
};
|
|
221
|
+
active: boolean;
|
|
222
|
+
customized: boolean;
|
|
223
|
+
description?: string | undefined;
|
|
224
|
+
entityId?: string | undefined;
|
|
225
|
+
inheritedFrom?: string | undefined;
|
|
226
|
+
}>;
|
|
227
|
+
export declare const entitySyncStateSchema: z.ZodObject<{
|
|
228
|
+
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
229
|
+
entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
230
|
+
entityId: z.ZodString;
|
|
231
|
+
synced: z.ZodBoolean;
|
|
232
|
+
updatedAt: z.ZodDate;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
234
|
+
updatedAt: Date;
|
|
235
|
+
userId: string & {
|
|
236
|
+
readonly __brand: "UserId";
|
|
237
|
+
};
|
|
238
|
+
entityType: NotificationEntityType;
|
|
239
|
+
entityId: string;
|
|
240
|
+
synced: boolean;
|
|
241
|
+
}, {
|
|
242
|
+
updatedAt: Date;
|
|
243
|
+
userId: string;
|
|
244
|
+
entityType: NotificationEntityType;
|
|
245
|
+
entityId: string;
|
|
246
|
+
synced: boolean;
|
|
247
|
+
}>;
|
|
248
|
+
export declare const notificationInstanceSchema: z.ZodObject<{
|
|
249
|
+
_id: z.ZodEffects<z.ZodString, import("./id-types").NotificationInstanceId, string>;
|
|
250
|
+
templateId: z.ZodEffects<z.ZodString, import("./id-types").NotificationTemplateId, string>;
|
|
251
|
+
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
252
|
+
entityId: z.ZodString;
|
|
253
|
+
scheduledFor: z.ZodDate;
|
|
254
|
+
status: z.ZodNativeEnum<typeof NotificationStatus>;
|
|
255
|
+
sentAt: z.ZodOptional<z.ZodDate>;
|
|
256
|
+
content: z.ZodObject<{
|
|
257
|
+
title: z.ZodString;
|
|
258
|
+
body: z.ZodString;
|
|
259
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
260
|
+
}, "strip", z.ZodTypeAny, {
|
|
261
|
+
title: string;
|
|
262
|
+
body: string;
|
|
263
|
+
data?: Record<string, any> | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
title: string;
|
|
266
|
+
body: string;
|
|
267
|
+
data?: Record<string, any> | undefined;
|
|
268
|
+
}>;
|
|
269
|
+
redisId: z.ZodString;
|
|
270
|
+
error: z.ZodOptional<z.ZodString>;
|
|
271
|
+
createdAt: z.ZodDate;
|
|
272
|
+
updatedAt: z.ZodDate;
|
|
273
|
+
}, "strip", z.ZodTypeAny, {
|
|
274
|
+
status: NotificationStatus;
|
|
275
|
+
_id: string & {
|
|
276
|
+
readonly __brand: "NotificationInstanceId";
|
|
277
|
+
};
|
|
278
|
+
createdAt: Date;
|
|
279
|
+
updatedAt: Date;
|
|
280
|
+
userId: string & {
|
|
281
|
+
readonly __brand: "UserId";
|
|
282
|
+
};
|
|
283
|
+
content: {
|
|
284
|
+
title: string;
|
|
285
|
+
body: string;
|
|
286
|
+
data?: Record<string, any> | undefined;
|
|
287
|
+
};
|
|
288
|
+
entityId: string;
|
|
289
|
+
templateId: string & {
|
|
290
|
+
readonly __brand: "NotificationTemplateId";
|
|
291
|
+
};
|
|
292
|
+
scheduledFor: Date;
|
|
293
|
+
redisId: string;
|
|
294
|
+
sentAt?: Date | undefined;
|
|
295
|
+
error?: string | undefined;
|
|
296
|
+
}, {
|
|
297
|
+
status: NotificationStatus;
|
|
298
|
+
_id: string;
|
|
299
|
+
createdAt: Date;
|
|
300
|
+
updatedAt: Date;
|
|
301
|
+
userId: string;
|
|
302
|
+
content: {
|
|
303
|
+
title: string;
|
|
304
|
+
body: string;
|
|
305
|
+
data?: Record<string, any> | undefined;
|
|
306
|
+
};
|
|
307
|
+
entityId: string;
|
|
308
|
+
templateId: string;
|
|
309
|
+
scheduledFor: Date;
|
|
310
|
+
redisId: string;
|
|
311
|
+
sentAt?: Date | undefined;
|
|
312
|
+
error?: string | undefined;
|
|
313
|
+
}>;
|
|
314
|
+
export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
|
|
315
|
+
entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
316
|
+
entityId: z.ZodOptional<z.ZodString>;
|
|
317
|
+
name: z.ZodString;
|
|
318
|
+
description: z.ZodOptional<z.ZodString>;
|
|
319
|
+
trigger: z.ZodObject<{
|
|
320
|
+
type: z.ZodNativeEnum<typeof NotificationTriggerType>;
|
|
321
|
+
conditions: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
322
|
+
timing: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
323
|
+
}, "strip", z.ZodTypeAny, {
|
|
324
|
+
type: NotificationTriggerType;
|
|
325
|
+
conditions: Record<string, any>;
|
|
326
|
+
timing: Record<string, any>;
|
|
327
|
+
}, {
|
|
328
|
+
type: NotificationTriggerType;
|
|
329
|
+
conditions: Record<string, any>;
|
|
330
|
+
timing: Record<string, any>;
|
|
331
|
+
}>;
|
|
332
|
+
content: z.ZodObject<{
|
|
333
|
+
title: z.ZodString;
|
|
334
|
+
body: z.ZodString;
|
|
335
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
336
|
+
}, "strip", z.ZodTypeAny, {
|
|
337
|
+
title: string;
|
|
338
|
+
body: string;
|
|
339
|
+
variables?: Record<string, string> | undefined;
|
|
340
|
+
}, {
|
|
341
|
+
title: string;
|
|
342
|
+
body: string;
|
|
343
|
+
variables?: Record<string, string> | undefined;
|
|
344
|
+
}>;
|
|
345
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
346
|
+
inheritedFrom: z.ZodOptional<z.ZodString>;
|
|
347
|
+
customized: z.ZodDefault<z.ZodBoolean>;
|
|
348
|
+
}, "strip", z.ZodTypeAny, {
|
|
349
|
+
name: string;
|
|
350
|
+
content: {
|
|
351
|
+
title: string;
|
|
352
|
+
body: string;
|
|
353
|
+
variables?: Record<string, string> | undefined;
|
|
354
|
+
};
|
|
355
|
+
entityType: NotificationEntityType;
|
|
356
|
+
trigger: {
|
|
357
|
+
type: NotificationTriggerType;
|
|
358
|
+
conditions: Record<string, any>;
|
|
359
|
+
timing: Record<string, any>;
|
|
360
|
+
};
|
|
361
|
+
active: boolean;
|
|
362
|
+
customized: boolean;
|
|
363
|
+
description?: string | undefined;
|
|
364
|
+
entityId?: string | undefined;
|
|
365
|
+
inheritedFrom?: string | undefined;
|
|
366
|
+
}, {
|
|
367
|
+
name: string;
|
|
368
|
+
content: {
|
|
369
|
+
title: string;
|
|
370
|
+
body: string;
|
|
371
|
+
variables?: Record<string, string> | undefined;
|
|
372
|
+
};
|
|
373
|
+
entityType: NotificationEntityType;
|
|
374
|
+
trigger: {
|
|
375
|
+
type: NotificationTriggerType;
|
|
376
|
+
conditions: Record<string, any>;
|
|
377
|
+
timing: Record<string, any>;
|
|
378
|
+
};
|
|
379
|
+
description?: string | undefined;
|
|
380
|
+
entityId?: string | undefined;
|
|
381
|
+
active?: boolean | undefined;
|
|
382
|
+
inheritedFrom?: string | undefined;
|
|
383
|
+
customized?: boolean | undefined;
|
|
384
|
+
}>;
|
|
385
|
+
export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
|
|
386
|
+
name: z.ZodOptional<z.ZodString>;
|
|
387
|
+
description: z.ZodOptional<z.ZodString>;
|
|
388
|
+
trigger: z.ZodOptional<z.ZodObject<{
|
|
389
|
+
type: z.ZodNativeEnum<typeof NotificationTriggerType>;
|
|
390
|
+
conditions: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
391
|
+
timing: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
392
|
+
}, "strip", z.ZodTypeAny, {
|
|
393
|
+
type: NotificationTriggerType;
|
|
394
|
+
conditions: Record<string, any>;
|
|
395
|
+
timing: Record<string, any>;
|
|
396
|
+
}, {
|
|
397
|
+
type: NotificationTriggerType;
|
|
398
|
+
conditions: Record<string, any>;
|
|
399
|
+
timing: Record<string, any>;
|
|
400
|
+
}>>;
|
|
401
|
+
content: z.ZodOptional<z.ZodObject<{
|
|
402
|
+
title: z.ZodString;
|
|
403
|
+
body: z.ZodString;
|
|
404
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
405
|
+
}, "strip", z.ZodTypeAny, {
|
|
406
|
+
title: string;
|
|
407
|
+
body: string;
|
|
408
|
+
variables?: Record<string, string> | undefined;
|
|
409
|
+
}, {
|
|
410
|
+
title: string;
|
|
411
|
+
body: string;
|
|
412
|
+
variables?: Record<string, string> | undefined;
|
|
413
|
+
}>>;
|
|
414
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
415
|
+
customized: z.ZodOptional<z.ZodBoolean>;
|
|
416
|
+
}, "strip", z.ZodTypeAny, {
|
|
417
|
+
name?: string | undefined;
|
|
418
|
+
description?: string | undefined;
|
|
419
|
+
content?: {
|
|
420
|
+
title: string;
|
|
421
|
+
body: string;
|
|
422
|
+
variables?: Record<string, string> | undefined;
|
|
423
|
+
} | undefined;
|
|
424
|
+
trigger?: {
|
|
425
|
+
type: NotificationTriggerType;
|
|
426
|
+
conditions: Record<string, any>;
|
|
427
|
+
timing: Record<string, any>;
|
|
428
|
+
} | undefined;
|
|
429
|
+
active?: boolean | undefined;
|
|
430
|
+
customized?: boolean | undefined;
|
|
431
|
+
}, {
|
|
432
|
+
name?: string | undefined;
|
|
433
|
+
description?: string | undefined;
|
|
434
|
+
content?: {
|
|
435
|
+
title: string;
|
|
436
|
+
body: string;
|
|
437
|
+
variables?: Record<string, string> | undefined;
|
|
438
|
+
} | undefined;
|
|
439
|
+
trigger?: {
|
|
440
|
+
type: NotificationTriggerType;
|
|
441
|
+
conditions: Record<string, any>;
|
|
442
|
+
timing: Record<string, any>;
|
|
443
|
+
} | undefined;
|
|
444
|
+
active?: boolean | undefined;
|
|
445
|
+
customized?: boolean | undefined;
|
|
446
|
+
}>;
|
|
447
|
+
export declare const syncNotificationTemplateRequestSchema: z.ZodObject<{
|
|
448
|
+
sync: z.ZodBoolean;
|
|
449
|
+
}, "strip", z.ZodTypeAny, {
|
|
450
|
+
sync: boolean;
|
|
451
|
+
}, {
|
|
452
|
+
sync: boolean;
|
|
453
|
+
}>;
|
|
454
|
+
export declare const previewNotificationTemplateRequestSchema: z.ZodObject<{
|
|
455
|
+
templateTitle: z.ZodString;
|
|
456
|
+
templateBody: z.ZodString;
|
|
457
|
+
entityType: z.ZodString;
|
|
458
|
+
entityId: z.ZodString;
|
|
459
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
460
|
+
}, "strip", z.ZodTypeAny, {
|
|
461
|
+
entityType: string;
|
|
462
|
+
entityId: string;
|
|
463
|
+
templateTitle: string;
|
|
464
|
+
templateBody: string;
|
|
465
|
+
variables?: Record<string, any> | undefined;
|
|
466
|
+
}, {
|
|
467
|
+
entityType: string;
|
|
468
|
+
entityId: string;
|
|
469
|
+
templateTitle: string;
|
|
470
|
+
templateBody: string;
|
|
471
|
+
variables?: Record<string, any> | undefined;
|
|
472
|
+
}>;
|
|
473
|
+
export declare const getNotificationInstancesRequestSchema: z.ZodObject<{
|
|
474
|
+
status: z.ZodOptional<z.ZodString>;
|
|
475
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
476
|
+
entityId: z.ZodOptional<z.ZodString>;
|
|
477
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
478
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
479
|
+
}, "strip", z.ZodTypeAny, {
|
|
480
|
+
status?: string | undefined;
|
|
481
|
+
entityId?: string | undefined;
|
|
482
|
+
templateId?: string | undefined;
|
|
483
|
+
limit?: number | undefined;
|
|
484
|
+
offset?: number | undefined;
|
|
485
|
+
}, {
|
|
486
|
+
status?: string | undefined;
|
|
487
|
+
entityId?: string | undefined;
|
|
488
|
+
templateId?: string | undefined;
|
|
489
|
+
limit?: number | undefined;
|
|
490
|
+
offset?: number | undefined;
|
|
491
|
+
}>;
|
|
492
|
+
export declare const entitySyncRequestSchema: z.ZodObject<{
|
|
493
|
+
entityType: z.ZodString;
|
|
494
|
+
entityId: z.ZodString;
|
|
495
|
+
synced: z.ZodBoolean;
|
|
496
|
+
}, "strip", z.ZodTypeAny, {
|
|
497
|
+
entityType: string;
|
|
498
|
+
entityId: string;
|
|
499
|
+
synced: boolean;
|
|
500
|
+
}, {
|
|
501
|
+
entityType: string;
|
|
502
|
+
entityId: string;
|
|
503
|
+
synced: boolean;
|
|
504
|
+
}>;
|
|
505
|
+
export declare const getEntitySyncRequestSchema: z.ZodObject<{
|
|
506
|
+
entityType: z.ZodString;
|
|
507
|
+
entityId: z.ZodString;
|
|
508
|
+
}, "strip", z.ZodTypeAny, {
|
|
509
|
+
entityType: string;
|
|
510
|
+
entityId: string;
|
|
511
|
+
}, {
|
|
512
|
+
entityType: string;
|
|
513
|
+
entityId: string;
|
|
514
|
+
}>;
|
|
515
|
+
export type NotificationTrigger = z.infer<typeof notificationTriggerSchema>;
|
|
516
|
+
export type NotificationContent = z.infer<typeof notificationContentSchema>;
|
|
517
|
+
export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
|
|
518
|
+
export type CreateNotificationTemplateData = z.infer<typeof createNotificationTemplateSchema>;
|
|
519
|
+
export type EntitySyncState = z.infer<typeof entitySyncStateSchema>;
|
|
520
|
+
export type NotificationInstanceData = z.infer<typeof notificationInstanceSchema>;
|
|
521
|
+
export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
|
|
522
|
+
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|
|
523
|
+
export type SyncNotificationTemplateRequest = z.infer<typeof syncNotificationTemplateRequestSchema>;
|
|
524
|
+
export type PreviewNotificationTemplateRequest = z.infer<typeof previewNotificationTemplateRequestSchema>;
|
|
525
|
+
export type GetNotificationInstancesRequest = z.infer<typeof getNotificationInstancesRequestSchema>;
|
|
526
|
+
export type EntitySyncRequest = z.infer<typeof entitySyncRequestSchema>;
|
|
527
|
+
export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
|
|
528
|
+
export interface CreateNotificationTemplateResponse {
|
|
529
|
+
template: Serialized<NotificationTemplateData>;
|
|
530
|
+
}
|
|
531
|
+
export interface GetNotificationTemplatesResponse {
|
|
532
|
+
templates: Serialized<NotificationTemplateData>[];
|
|
533
|
+
}
|
|
534
|
+
export interface GetNotificationTemplateResponse {
|
|
535
|
+
template: Serialized<NotificationTemplateData>;
|
|
536
|
+
}
|
|
537
|
+
export interface UpdateNotificationTemplateResponse {
|
|
538
|
+
template: Serialized<NotificationTemplateData>;
|
|
539
|
+
}
|
|
540
|
+
export interface DeleteNotificationTemplateResponse {
|
|
541
|
+
}
|
|
542
|
+
export interface SyncNotificationTemplateResponse {
|
|
543
|
+
synced: boolean;
|
|
544
|
+
}
|
|
545
|
+
export interface PreviewNotificationTemplateResponse {
|
|
546
|
+
preview: {
|
|
547
|
+
title: string;
|
|
548
|
+
body: string;
|
|
549
|
+
variables: Record<string, any>;
|
|
550
|
+
};
|
|
551
|
+
missingVariables: string[];
|
|
552
|
+
}
|
|
553
|
+
export interface GetNotificationInstancesResponse {
|
|
554
|
+
success: boolean;
|
|
555
|
+
instances?: Serialized<NotificationInstanceData>[];
|
|
556
|
+
total?: number;
|
|
557
|
+
error?: string;
|
|
558
|
+
}
|
|
559
|
+
export interface EntitySyncResponse {
|
|
560
|
+
success: boolean;
|
|
561
|
+
synced: boolean;
|
|
562
|
+
templates?: Serialized<NotificationTemplateData>[];
|
|
563
|
+
error?: string;
|
|
564
|
+
}
|
|
565
|
+
export interface GetEntitySyncResponse {
|
|
566
|
+
success: boolean;
|
|
567
|
+
synced: boolean;
|
|
568
|
+
hasParentTemplates: boolean;
|
|
569
|
+
error?: string;
|
|
570
|
+
}
|