@ttt-productions/ttt-core 0.7.13 → 0.7.14
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/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/notification.d.ts +347 -0
- package/dist/schemas/notification.d.ts.map +1 -0
- package/dist/schemas/notification.js +158 -0
- package/dist/schemas/notification.js.map +1 -0
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/package.json +5 -1
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const NOTIFICATION_TYPE_VALUES: readonly ["content_report", "content_report_csam", "guild_invite", "guild_chat_message", "admin_dispatch_reply", "threshold_library_submission", "admin_announcement"];
|
|
3
|
+
export declare const NotificationTypeSchema: z.ZodEnum<["content_report", "content_report_csam", "guild_invite", "guild_chat_message", "admin_dispatch_reply", "threshold_library_submission", "admin_announcement"]>;
|
|
4
|
+
export type NotificationType = z.infer<typeof NotificationTypeSchema>;
|
|
5
|
+
/** Delivery channels. Only `inApp` is implemented at launch; `email`/`push`
|
|
6
|
+
* are future channel handlers dispatched from the `runSendNotification`
|
|
7
|
+
* chokepoint. */
|
|
8
|
+
export declare const NOTIFICATION_CHANNEL_VALUES: readonly ["inApp", "email", "push"];
|
|
9
|
+
export declare const NotificationChannelSchema: z.ZodEnum<["inApp", "email", "push"]>;
|
|
10
|
+
export type NotificationChannel = z.infer<typeof NotificationChannelSchema>;
|
|
11
|
+
export type NotificationCategory = 'user' | 'admin';
|
|
12
|
+
export declare const NotificationCategorySchema: z.ZodEnum<["user", "admin"]>;
|
|
13
|
+
export interface NotificationTypeCatalogEntry {
|
|
14
|
+
/** Which active collection / audience this type writes to. */
|
|
15
|
+
category: NotificationCategory;
|
|
16
|
+
/** `realtime` writes straight to active; `queued` goes through the batch processor. */
|
|
17
|
+
delivery: 'realtime' | 'queued';
|
|
18
|
+
/** Default channel list applied when a send omits `channels`. All `['inApp']` at launch. */
|
|
19
|
+
defaultChannels: NotificationChannel[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The canonical TTT notification type catalog. `runSendNotification` resolves a
|
|
23
|
+
* type's category/delivery here and carries `defaultChannels` through when a
|
|
24
|
+
* send omits `channels`.
|
|
25
|
+
*/
|
|
26
|
+
export declare const NOTIFICATION_TYPE_CATALOG: Record<NotificationType, NotificationTypeCatalogEntry>;
|
|
27
|
+
/**
|
|
28
|
+
* Typed `metadata` payload for each notification type. The generic package
|
|
29
|
+
* boundary takes `Record<string, unknown>`; the app validates against this
|
|
30
|
+
* before sending so each type's payload is checked like every other callable
|
|
31
|
+
* schema.
|
|
32
|
+
*/
|
|
33
|
+
export declare const NotificationMetadataByTypeSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
34
|
+
type: z.ZodLiteral<"content_report">;
|
|
35
|
+
reportGroupId: z.ZodString;
|
|
36
|
+
reportedItemType: z.ZodString;
|
|
37
|
+
reportedItemId: z.ZodString;
|
|
38
|
+
}, "strict", z.ZodTypeAny, {
|
|
39
|
+
type: "content_report";
|
|
40
|
+
reportGroupId: string;
|
|
41
|
+
reportedItemType: string;
|
|
42
|
+
reportedItemId: string;
|
|
43
|
+
}, {
|
|
44
|
+
type: "content_report";
|
|
45
|
+
reportGroupId: string;
|
|
46
|
+
reportedItemType: string;
|
|
47
|
+
reportedItemId: string;
|
|
48
|
+
}>, z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"content_report_csam">;
|
|
50
|
+
reportGroupId: z.ZodString;
|
|
51
|
+
reportedItemType: z.ZodString;
|
|
52
|
+
reportedItemId: z.ZodString;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
type: "content_report_csam";
|
|
55
|
+
reportGroupId: string;
|
|
56
|
+
reportedItemType: string;
|
|
57
|
+
reportedItemId: string;
|
|
58
|
+
}, {
|
|
59
|
+
type: "content_report_csam";
|
|
60
|
+
reportGroupId: string;
|
|
61
|
+
reportedItemType: string;
|
|
62
|
+
reportedItemId: string;
|
|
63
|
+
}>, z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"guild_invite">;
|
|
65
|
+
workProjectId: z.ZodString;
|
|
66
|
+
guildInviteId: z.ZodString;
|
|
67
|
+
workTitle: z.ZodString;
|
|
68
|
+
}, "strict", z.ZodTypeAny, {
|
|
69
|
+
workProjectId: string;
|
|
70
|
+
type: "guild_invite";
|
|
71
|
+
guildInviteId: string;
|
|
72
|
+
workTitle: string;
|
|
73
|
+
}, {
|
|
74
|
+
workProjectId: string;
|
|
75
|
+
type: "guild_invite";
|
|
76
|
+
guildInviteId: string;
|
|
77
|
+
workTitle: string;
|
|
78
|
+
}>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"guild_chat_message">;
|
|
80
|
+
workProjectId: z.ZodString;
|
|
81
|
+
channelId: z.ZodString;
|
|
82
|
+
channelName: z.ZodString;
|
|
83
|
+
}, "strict", z.ZodTypeAny, {
|
|
84
|
+
workProjectId: string;
|
|
85
|
+
type: "guild_chat_message";
|
|
86
|
+
channelName: string;
|
|
87
|
+
channelId: string;
|
|
88
|
+
}, {
|
|
89
|
+
workProjectId: string;
|
|
90
|
+
type: "guild_chat_message";
|
|
91
|
+
channelName: string;
|
|
92
|
+
channelId: string;
|
|
93
|
+
}>, z.ZodObject<{
|
|
94
|
+
type: z.ZodLiteral<"admin_dispatch_reply">;
|
|
95
|
+
adminDispatchId: z.ZodString;
|
|
96
|
+
}, "strict", z.ZodTypeAny, {
|
|
97
|
+
type: "admin_dispatch_reply";
|
|
98
|
+
adminDispatchId: string;
|
|
99
|
+
}, {
|
|
100
|
+
type: "admin_dispatch_reply";
|
|
101
|
+
adminDispatchId: string;
|
|
102
|
+
}>, z.ZodObject<{
|
|
103
|
+
type: z.ZodLiteral<"threshold_library_submission">;
|
|
104
|
+
thresholdItemId: z.ZodString;
|
|
105
|
+
hallItemId: z.ZodString;
|
|
106
|
+
workProjectId: z.ZodString;
|
|
107
|
+
}, "strict", z.ZodTypeAny, {
|
|
108
|
+
workProjectId: string;
|
|
109
|
+
type: "threshold_library_submission";
|
|
110
|
+
thresholdItemId: string;
|
|
111
|
+
hallItemId: string;
|
|
112
|
+
}, {
|
|
113
|
+
workProjectId: string;
|
|
114
|
+
type: "threshold_library_submission";
|
|
115
|
+
thresholdItemId: string;
|
|
116
|
+
hallItemId: string;
|
|
117
|
+
}>, z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"admin_announcement">;
|
|
119
|
+
title: z.ZodString;
|
|
120
|
+
message: z.ZodString;
|
|
121
|
+
}, "strict", z.ZodTypeAny, {
|
|
122
|
+
type: "admin_announcement";
|
|
123
|
+
message: string;
|
|
124
|
+
title: string;
|
|
125
|
+
}, {
|
|
126
|
+
type: "admin_announcement";
|
|
127
|
+
message: string;
|
|
128
|
+
title: string;
|
|
129
|
+
}>]>;
|
|
130
|
+
export type NotificationMetadataByType = z.infer<typeof NotificationMetadataByTypeSchema>;
|
|
131
|
+
/**
|
|
132
|
+
* Admin broadcast audience selector. Stored on a broadcast job; the scheduled
|
|
133
|
+
* fan-out worker resolves a page of it into uids (domain-aware queries live in
|
|
134
|
+
* ttt-prod — the package only ever receives uids).
|
|
135
|
+
*/
|
|
136
|
+
export declare const BroadcastAudienceSelectorSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
137
|
+
kind: z.ZodLiteral<"allActiveUsers">;
|
|
138
|
+
}, "strict", z.ZodTypeAny, {
|
|
139
|
+
kind: "allActiveUsers";
|
|
140
|
+
}, {
|
|
141
|
+
kind: "allActiveUsers";
|
|
142
|
+
}>, z.ZodObject<{
|
|
143
|
+
kind: z.ZodLiteral<"explicitUids">;
|
|
144
|
+
uids: z.ZodArray<z.ZodString, "many">;
|
|
145
|
+
}, "strict", z.ZodTypeAny, {
|
|
146
|
+
kind: "explicitUids";
|
|
147
|
+
uids: string[];
|
|
148
|
+
}, {
|
|
149
|
+
kind: "explicitUids";
|
|
150
|
+
uids: string[];
|
|
151
|
+
}>, z.ZodObject<{
|
|
152
|
+
kind: z.ZodLiteral<"workMembers">;
|
|
153
|
+
workProjectId: z.ZodString;
|
|
154
|
+
}, "strict", z.ZodTypeAny, {
|
|
155
|
+
workProjectId: string;
|
|
156
|
+
kind: "workMembers";
|
|
157
|
+
}, {
|
|
158
|
+
workProjectId: string;
|
|
159
|
+
kind: "workMembers";
|
|
160
|
+
}>, z.ZodObject<{
|
|
161
|
+
kind: z.ZodLiteral<"realmMembers">;
|
|
162
|
+
workRealmId: z.ZodString;
|
|
163
|
+
}, "strict", z.ZodTypeAny, {
|
|
164
|
+
workRealmId: string;
|
|
165
|
+
kind: "realmMembers";
|
|
166
|
+
}, {
|
|
167
|
+
workRealmId: string;
|
|
168
|
+
kind: "realmMembers";
|
|
169
|
+
}>, z.ZodObject<{
|
|
170
|
+
kind: z.ZodLiteral<"artisansByRole">;
|
|
171
|
+
tradeProfession: z.ZodEnum<[string, ...string[]]>;
|
|
172
|
+
}, "strict", z.ZodTypeAny, {
|
|
173
|
+
tradeProfession: string;
|
|
174
|
+
kind: "artisansByRole";
|
|
175
|
+
}, {
|
|
176
|
+
tradeProfession: string;
|
|
177
|
+
kind: "artisansByRole";
|
|
178
|
+
}>]>;
|
|
179
|
+
export type BroadcastAudienceSelector = z.infer<typeof BroadcastAudienceSelectorSchema>;
|
|
180
|
+
export declare const CreateNotificationBroadcastInputSchema: z.ZodObject<{
|
|
181
|
+
selector: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
182
|
+
kind: z.ZodLiteral<"allActiveUsers">;
|
|
183
|
+
}, "strict", z.ZodTypeAny, {
|
|
184
|
+
kind: "allActiveUsers";
|
|
185
|
+
}, {
|
|
186
|
+
kind: "allActiveUsers";
|
|
187
|
+
}>, z.ZodObject<{
|
|
188
|
+
kind: z.ZodLiteral<"explicitUids">;
|
|
189
|
+
uids: z.ZodArray<z.ZodString, "many">;
|
|
190
|
+
}, "strict", z.ZodTypeAny, {
|
|
191
|
+
kind: "explicitUids";
|
|
192
|
+
uids: string[];
|
|
193
|
+
}, {
|
|
194
|
+
kind: "explicitUids";
|
|
195
|
+
uids: string[];
|
|
196
|
+
}>, z.ZodObject<{
|
|
197
|
+
kind: z.ZodLiteral<"workMembers">;
|
|
198
|
+
workProjectId: z.ZodString;
|
|
199
|
+
}, "strict", z.ZodTypeAny, {
|
|
200
|
+
workProjectId: string;
|
|
201
|
+
kind: "workMembers";
|
|
202
|
+
}, {
|
|
203
|
+
workProjectId: string;
|
|
204
|
+
kind: "workMembers";
|
|
205
|
+
}>, z.ZodObject<{
|
|
206
|
+
kind: z.ZodLiteral<"realmMembers">;
|
|
207
|
+
workRealmId: z.ZodString;
|
|
208
|
+
}, "strict", z.ZodTypeAny, {
|
|
209
|
+
workRealmId: string;
|
|
210
|
+
kind: "realmMembers";
|
|
211
|
+
}, {
|
|
212
|
+
workRealmId: string;
|
|
213
|
+
kind: "realmMembers";
|
|
214
|
+
}>, z.ZodObject<{
|
|
215
|
+
kind: z.ZodLiteral<"artisansByRole">;
|
|
216
|
+
tradeProfession: z.ZodEnum<[string, ...string[]]>;
|
|
217
|
+
}, "strict", z.ZodTypeAny, {
|
|
218
|
+
tradeProfession: string;
|
|
219
|
+
kind: "artisansByRole";
|
|
220
|
+
}, {
|
|
221
|
+
tradeProfession: string;
|
|
222
|
+
kind: "artisansByRole";
|
|
223
|
+
}>]>;
|
|
224
|
+
title: z.ZodString;
|
|
225
|
+
message: z.ZodString;
|
|
226
|
+
}, "strict", z.ZodTypeAny, {
|
|
227
|
+
message: string;
|
|
228
|
+
title: string;
|
|
229
|
+
selector: {
|
|
230
|
+
kind: "allActiveUsers";
|
|
231
|
+
} | {
|
|
232
|
+
kind: "explicitUids";
|
|
233
|
+
uids: string[];
|
|
234
|
+
} | {
|
|
235
|
+
workProjectId: string;
|
|
236
|
+
kind: "workMembers";
|
|
237
|
+
} | {
|
|
238
|
+
workRealmId: string;
|
|
239
|
+
kind: "realmMembers";
|
|
240
|
+
} | {
|
|
241
|
+
tradeProfession: string;
|
|
242
|
+
kind: "artisansByRole";
|
|
243
|
+
};
|
|
244
|
+
}, {
|
|
245
|
+
message: string;
|
|
246
|
+
title: string;
|
|
247
|
+
selector: {
|
|
248
|
+
kind: "allActiveUsers";
|
|
249
|
+
} | {
|
|
250
|
+
kind: "explicitUids";
|
|
251
|
+
uids: string[];
|
|
252
|
+
} | {
|
|
253
|
+
workProjectId: string;
|
|
254
|
+
kind: "workMembers";
|
|
255
|
+
} | {
|
|
256
|
+
workRealmId: string;
|
|
257
|
+
kind: "realmMembers";
|
|
258
|
+
} | {
|
|
259
|
+
tradeProfession: string;
|
|
260
|
+
kind: "artisansByRole";
|
|
261
|
+
};
|
|
262
|
+
}>;
|
|
263
|
+
export type CreateNotificationBroadcastInput = z.infer<typeof CreateNotificationBroadcastInputSchema>;
|
|
264
|
+
/** Archive scope: a single notification, or the caller's whole category. */
|
|
265
|
+
export declare const ArchiveNotificationScopeSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
266
|
+
kind: z.ZodLiteral<"single">;
|
|
267
|
+
notificationId: z.ZodString;
|
|
268
|
+
}, "strict", z.ZodTypeAny, {
|
|
269
|
+
kind: "single";
|
|
270
|
+
notificationId: string;
|
|
271
|
+
}, {
|
|
272
|
+
kind: "single";
|
|
273
|
+
notificationId: string;
|
|
274
|
+
}>, z.ZodObject<{
|
|
275
|
+
kind: z.ZodLiteral<"all">;
|
|
276
|
+
}, "strict", z.ZodTypeAny, {
|
|
277
|
+
kind: "all";
|
|
278
|
+
}, {
|
|
279
|
+
kind: "all";
|
|
280
|
+
}>]>;
|
|
281
|
+
export type ArchiveNotificationScope = z.infer<typeof ArchiveNotificationScopeSchema>;
|
|
282
|
+
export declare const ArchiveNotificationInputSchema: z.ZodObject<{
|
|
283
|
+
category: z.ZodEnum<["user", "admin"]>;
|
|
284
|
+
scope: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
285
|
+
kind: z.ZodLiteral<"single">;
|
|
286
|
+
notificationId: z.ZodString;
|
|
287
|
+
}, "strict", z.ZodTypeAny, {
|
|
288
|
+
kind: "single";
|
|
289
|
+
notificationId: string;
|
|
290
|
+
}, {
|
|
291
|
+
kind: "single";
|
|
292
|
+
notificationId: string;
|
|
293
|
+
}>, z.ZodObject<{
|
|
294
|
+
kind: z.ZodLiteral<"all">;
|
|
295
|
+
}, "strict", z.ZodTypeAny, {
|
|
296
|
+
kind: "all";
|
|
297
|
+
}, {
|
|
298
|
+
kind: "all";
|
|
299
|
+
}>]>;
|
|
300
|
+
}, "strict", z.ZodTypeAny, {
|
|
301
|
+
category: "user" | "admin";
|
|
302
|
+
scope: {
|
|
303
|
+
kind: "single";
|
|
304
|
+
notificationId: string;
|
|
305
|
+
} | {
|
|
306
|
+
kind: "all";
|
|
307
|
+
};
|
|
308
|
+
}, {
|
|
309
|
+
category: "user" | "admin";
|
|
310
|
+
scope: {
|
|
311
|
+
kind: "single";
|
|
312
|
+
notificationId: string;
|
|
313
|
+
} | {
|
|
314
|
+
kind: "all";
|
|
315
|
+
};
|
|
316
|
+
}>;
|
|
317
|
+
export type ArchiveNotificationInput = z.infer<typeof ArchiveNotificationInputSchema>;
|
|
318
|
+
export declare const MarkNotificationsSeenInputSchema: z.ZodObject<{
|
|
319
|
+
category: z.ZodLiteral<"user">;
|
|
320
|
+
}, "strict", z.ZodTypeAny, {
|
|
321
|
+
category: "user";
|
|
322
|
+
}, {
|
|
323
|
+
category: "user";
|
|
324
|
+
}>;
|
|
325
|
+
export type MarkNotificationsSeenInput = z.infer<typeof MarkNotificationsSeenInputSchema>;
|
|
326
|
+
/**
|
|
327
|
+
* Payload of a `notification.broadcastSent` audit event — written when an admin
|
|
328
|
+
* enqueues a broadcast. Actor mode is `adminReview` / `adminOverride`. Records
|
|
329
|
+
* the selector (never a pre-resolved uid list) + the job it created.
|
|
330
|
+
*/
|
|
331
|
+
export interface NotificationBroadcastSentAuditMetadata {
|
|
332
|
+
jobId: string;
|
|
333
|
+
selector: BroadcastAudienceSelector;
|
|
334
|
+
title: string;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Payload of a `notification.adminArchived` audit event — written when an admin
|
|
338
|
+
* clears a shared admin notification (the `handledBy` action). Actor mode is
|
|
339
|
+
* `adminReview` / `adminOverride`.
|
|
340
|
+
*/
|
|
341
|
+
export interface NotificationAdminArchivedAuditMetadata {
|
|
342
|
+
scope: 'single' | 'all';
|
|
343
|
+
/** Present for single-archive; absent for a category-wide `all` archive. */
|
|
344
|
+
notificationId?: string;
|
|
345
|
+
handledBy: string;
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2BxB,eAAO,MAAM,wBAAwB,wKAQ3B,CAAC;AAEX,eAAO,MAAM,sBAAsB,0KAAmC,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;iBAEiB;AACjB,eAAO,MAAM,2BAA2B,qCAAsC,CAAC;AAC/E,eAAO,MAAM,yBAAyB,uCAAsC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,CAAC;AACpD,eAAO,MAAM,0BAA0B,8BAA4B,CAAC;AAEpE,MAAM,WAAW,4BAA4B;IAC3C,8DAA8D;IAC9D,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,uFAAuF;IACvF,QAAQ,EAAE,UAAU,GAAG,QAAQ,CAAC;IAChC,4FAA4F;IAC5F,eAAe,EAAE,mBAAmB,EAAE,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,4BAA4B,CAQ5F,CAAC;AAMF;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwC3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,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|
|
2
|
+
//
|
|
3
|
+
// `@ttt-productions/notification-core` is generic — at its package boundary a
|
|
4
|
+
// notification's `metadata` is `Record<string, unknown>`. All TTT notification
|
|
5
|
+
// policy lives here: the canonical type catalog (category / delivery / default
|
|
6
|
+
// channels), the per-type typed `metadata` discriminated union, the broadcast
|
|
7
|
+
// audience selector, and the callable input schemas. `runSendNotification`
|
|
8
|
+
// (ttt-prod) validates `metadata` against the per-type schema before any write.
|
|
9
|
+
//
|
|
10
|
+
// The two notification audit-event payload shapes live here too (the
|
|
11
|
+
// `AuditEventType` union members `notification.broadcastSent` /
|
|
12
|
+
// `notification.adminArchived` are added in ../types/audit.ts; their actor is
|
|
13
|
+
// always an admin mode — `adminReview` / `adminOverride`).
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import { userIdSchema, workProjectIdSchema, guildInviteIdSchema, guildChatChannelIdSchema, adminDispatchIdSchema, hallItemIdSchema, thresholdItemIdSchema, titleSchema, } from './atoms.js';
|
|
16
|
+
import { TRADE_PROFESSION_OPTIONS } from '../constants/options.js';
|
|
17
|
+
// String shape atoms specific to notifications.
|
|
18
|
+
const notificationMessageSchema = z.string().min(1).max(2000);
|
|
19
|
+
const channelNameSchema = z.string().min(1).max(200);
|
|
20
|
+
const reportedItemTypeSchema = z.string().min(1).max(64);
|
|
21
|
+
const reportedItemIdSchema = z.string().min(1).max(128);
|
|
22
|
+
const reportGroupIdSchema = z.string().min(1);
|
|
23
|
+
const workRealmIdSchema = z.string().min(1);
|
|
24
|
+
const TRADE_PROFESSION_VALUES = [...TRADE_PROFESSION_OPTIONS];
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// TYPE + CHANNEL CATALOG
|
|
27
|
+
// ============================================================================
|
|
28
|
+
export const NOTIFICATION_TYPE_VALUES = [
|
|
29
|
+
'content_report',
|
|
30
|
+
'content_report_csam',
|
|
31
|
+
'guild_invite',
|
|
32
|
+
'guild_chat_message',
|
|
33
|
+
'admin_dispatch_reply',
|
|
34
|
+
'threshold_library_submission',
|
|
35
|
+
'admin_announcement',
|
|
36
|
+
];
|
|
37
|
+
export const NotificationTypeSchema = z.enum(NOTIFICATION_TYPE_VALUES);
|
|
38
|
+
/** Delivery channels. Only `inApp` is implemented at launch; `email`/`push`
|
|
39
|
+
* are future channel handlers dispatched from the `runSendNotification`
|
|
40
|
+
* chokepoint. */
|
|
41
|
+
export const NOTIFICATION_CHANNEL_VALUES = ['inApp', 'email', 'push'];
|
|
42
|
+
export const NotificationChannelSchema = z.enum(NOTIFICATION_CHANNEL_VALUES);
|
|
43
|
+
export const NotificationCategorySchema = z.enum(['user', 'admin']);
|
|
44
|
+
/**
|
|
45
|
+
* The canonical TTT notification type catalog. `runSendNotification` resolves a
|
|
46
|
+
* type's category/delivery here and carries `defaultChannels` through when a
|
|
47
|
+
* send omits `channels`.
|
|
48
|
+
*/
|
|
49
|
+
export const NOTIFICATION_TYPE_CATALOG = {
|
|
50
|
+
content_report: { category: 'admin', delivery: 'realtime', defaultChannels: ['inApp'] },
|
|
51
|
+
content_report_csam: { category: 'admin', delivery: 'realtime', defaultChannels: ['inApp'] },
|
|
52
|
+
guild_invite: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },
|
|
53
|
+
guild_chat_message: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },
|
|
54
|
+
admin_dispatch_reply: { category: 'user', delivery: 'realtime', defaultChannels: ['inApp'] },
|
|
55
|
+
threshold_library_submission: { category: 'admin', delivery: 'queued', defaultChannels: ['inApp'] },
|
|
56
|
+
admin_announcement: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },
|
|
57
|
+
};
|
|
58
|
+
// ============================================================================
|
|
59
|
+
// PER-TYPE METADATA (discriminated union, keyed by `type`)
|
|
60
|
+
// ============================================================================
|
|
61
|
+
/**
|
|
62
|
+
* Typed `metadata` payload for each notification type. The generic package
|
|
63
|
+
* boundary takes `Record<string, unknown>`; the app validates against this
|
|
64
|
+
* before sending so each type's payload is checked like every other callable
|
|
65
|
+
* schema.
|
|
66
|
+
*/
|
|
67
|
+
export const NotificationMetadataByTypeSchema = z.discriminatedUnion('type', [
|
|
68
|
+
z.object({
|
|
69
|
+
type: z.literal('content_report'),
|
|
70
|
+
reportGroupId: reportGroupIdSchema,
|
|
71
|
+
reportedItemType: reportedItemTypeSchema,
|
|
72
|
+
reportedItemId: reportedItemIdSchema,
|
|
73
|
+
}).strict(),
|
|
74
|
+
z.object({
|
|
75
|
+
type: z.literal('content_report_csam'),
|
|
76
|
+
reportGroupId: reportGroupIdSchema,
|
|
77
|
+
reportedItemType: reportedItemTypeSchema,
|
|
78
|
+
reportedItemId: reportedItemIdSchema,
|
|
79
|
+
}).strict(),
|
|
80
|
+
z.object({
|
|
81
|
+
type: z.literal('guild_invite'),
|
|
82
|
+
workProjectId: workProjectIdSchema,
|
|
83
|
+
guildInviteId: guildInviteIdSchema,
|
|
84
|
+
workTitle: titleSchema,
|
|
85
|
+
}).strict(),
|
|
86
|
+
z.object({
|
|
87
|
+
type: z.literal('guild_chat_message'),
|
|
88
|
+
workProjectId: workProjectIdSchema,
|
|
89
|
+
channelId: guildChatChannelIdSchema,
|
|
90
|
+
channelName: channelNameSchema,
|
|
91
|
+
}).strict(),
|
|
92
|
+
z.object({
|
|
93
|
+
type: z.literal('admin_dispatch_reply'),
|
|
94
|
+
adminDispatchId: adminDispatchIdSchema,
|
|
95
|
+
}).strict(),
|
|
96
|
+
z.object({
|
|
97
|
+
type: z.literal('threshold_library_submission'),
|
|
98
|
+
thresholdItemId: thresholdItemIdSchema,
|
|
99
|
+
hallItemId: hallItemIdSchema,
|
|
100
|
+
workProjectId: workProjectIdSchema,
|
|
101
|
+
}).strict(),
|
|
102
|
+
z.object({
|
|
103
|
+
type: z.literal('admin_announcement'),
|
|
104
|
+
title: titleSchema,
|
|
105
|
+
message: notificationMessageSchema,
|
|
106
|
+
}).strict(),
|
|
107
|
+
]);
|
|
108
|
+
// ============================================================================
|
|
109
|
+
// BROADCAST AUDIENCE SELECTOR
|
|
110
|
+
// ============================================================================
|
|
111
|
+
/**
|
|
112
|
+
* Admin broadcast audience selector. Stored on a broadcast job; the scheduled
|
|
113
|
+
* fan-out worker resolves a page of it into uids (domain-aware queries live in
|
|
114
|
+
* ttt-prod — the package only ever receives uids).
|
|
115
|
+
*/
|
|
116
|
+
export const BroadcastAudienceSelectorSchema = z.discriminatedUnion('kind', [
|
|
117
|
+
z.object({ kind: z.literal('allActiveUsers') }).strict(),
|
|
118
|
+
z.object({
|
|
119
|
+
kind: z.literal('explicitUids'),
|
|
120
|
+
uids: z.array(userIdSchema).min(1).max(10_000),
|
|
121
|
+
}).strict(),
|
|
122
|
+
z.object({
|
|
123
|
+
kind: z.literal('workMembers'),
|
|
124
|
+
workProjectId: workProjectIdSchema,
|
|
125
|
+
}).strict(),
|
|
126
|
+
z.object({
|
|
127
|
+
kind: z.literal('realmMembers'),
|
|
128
|
+
workRealmId: workRealmIdSchema,
|
|
129
|
+
}).strict(),
|
|
130
|
+
z.object({
|
|
131
|
+
kind: z.literal('artisansByRole'),
|
|
132
|
+
tradeProfession: z.enum(TRADE_PROFESSION_VALUES),
|
|
133
|
+
}).strict(),
|
|
134
|
+
]);
|
|
135
|
+
// ============================================================================
|
|
136
|
+
// CALLABLE INPUT SCHEMAS
|
|
137
|
+
// ============================================================================
|
|
138
|
+
export const CreateNotificationBroadcastInputSchema = z.object({
|
|
139
|
+
selector: BroadcastAudienceSelectorSchema,
|
|
140
|
+
title: titleSchema,
|
|
141
|
+
message: notificationMessageSchema,
|
|
142
|
+
}).strict();
|
|
143
|
+
/** Archive scope: a single notification, or the caller's whole category. */
|
|
144
|
+
export const ArchiveNotificationScopeSchema = z.discriminatedUnion('kind', [
|
|
145
|
+
z.object({ kind: z.literal('single'), notificationId: z.string().min(1) }).strict(),
|
|
146
|
+
z.object({ kind: z.literal('all') }).strict(),
|
|
147
|
+
]);
|
|
148
|
+
// No `device` field — it was dropped from the package's ArchivalInfo (A1).
|
|
149
|
+
export const ArchiveNotificationInputSchema = z.object({
|
|
150
|
+
category: NotificationCategorySchema,
|
|
151
|
+
scope: ArchiveNotificationScopeSchema,
|
|
152
|
+
}).strict();
|
|
153
|
+
// Shared admin notifications have no per-admin seen state, so only the personal
|
|
154
|
+
// `user` category can be marked seen.
|
|
155
|
+
export const MarkNotificationsSeenInputSchema = z.object({
|
|
156
|
+
category: z.literal('user'),
|
|
157
|
+
}).strict();
|
|
158
|
+
//# sourceMappingURL=notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,gFAAgF;AAChF,EAAE;AACF,qEAAqE;AACrE,gEAAgE;AAChE,8EAA8E;AAC9E,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,gDAAgD;AAChD,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC9D,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrD,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACzD,MAAM,oBAAoB,GAAG,CAAC,CA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C,CAAC,MAAM,EAAE,CAAC;AAGZ,gFAAgF;AAChF,sCAAsC;AACtC,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;CAC5B,CAAC,CAAC,MAAM,EAAE,CAAC"}
|
package/dist/types/audit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuditEvent } from '@ttt-productions/audit-core';
|
|
2
|
-
export type AuditEventType = 'artisanCreator.grantedToUser' | 'artisanCreator.revokedFromUser' | 'user.accountRegistered' | 'user.statusChanged' | 'user.accountBanned' | 'user.accountUnbanned' | 'admin.systemRoleGranted' | 'admin.systemRoleRevoked' | 'admin.systemRoleSyncedFromDirectEdit' | 'admin.contentAppealReviewed' | 'admin.violationDecisionAccepted' | 'admin.thresholdItemReviewed' | 'admin.futurePlansUpdated' | 'admin.rulesAndAgreementsUpdated' | 'workProject.created' | 'workProject.guildmateUserGuildStandingChanged' | 'workProject.guildmateUserTradeProfessionsChanged' | 'workProject.publicDetailsUpdated' | 'workProject.workAssetDeleted' | 'workProject.guildInviteSent' | 'workProject.guildInviteAccepted' | 'workProject.guildInviteDeclined' | 'workProject.guildInviteCancelled' | 'workProject.guildInviteStakeSharesUpdated' | 'workProject.commissionListingCreated' | 'workProject.commissionProposalCreated' | 'workProject.commissionProposalAccepted' | 'workProject.commissionClosed' | 'workProject.commissionDeleted' | 'workProject.commissionProposalSaveToggled' | 'workProject.commissionProposalRejected' | 'workProject.stakeSharesChanged' | 'workProject.stakeShares.created' | 'workProject.stakeShares.increased' | 'workProject.stakeShares.anomaly' | 'craftSkill.userCraftSkillDeleted' | 'content.itemReported' | 'content.violationRecorded' | 'content.thresholdItemSubmitted' | 'content.hallItemPublished' | 'content.appealSubmitted' | 'content.violationAccepted' | 'content.taleDetailsUpdated' | 'content.taleWorkGenresUpdated' | 'content.chapterCreated' | 'content.chapterDetailsUpdated' | 'content.tuneDetailsUpdated' | 'content.tuneWorkGenresUpdated' | 'content.tuneTrackCreated' | 'content.tuneTrackDetailsUpdated' | 'content.televisionDetailsUpdated' | 'content.televisionWorkGenresUpdated' | 'content.televisionEpisodeCreated' | 'content.televisionEpisodeDetailsUpdated' | 'payment.sessionCreated' | 'payment.pledgePaymentCompleted' | 'payment.pledgePaymentAbandoned' | 'payment.pledgePaymentFailed' | 'admin.taskCheckedOut' | 'admin.taskCheckedIn' | 'admin.taskReleased' | 'admin.taskAutoReleased' | 'admin.taskDeferredLater' | 'workProject.auditionCreated' | 'admin.auditionCreated' | 'audition.entryCreated' | 'audition.closedByUser' | 'system.manualIntervention' | 'system.appConfigUpdated' | 'system.pledgePaymentsArchived' | 'system.pendingMediaArchived' | 'system.profanityListSynced' | 'system.profanityListSyncSkipped' | 'system.orphanUploadsCleanedUp' | 'admin.profanityListUpdated' | 'social.squareStreetzPostLiked' | 'social.squareStreetzPostUnliked' | 'social.userFollowed' | 'social.userUnfollowed' | 'chat.guildChatChannelCreated' | 'chat.guildChatChannelUpdated' | 'chat.guildChatChannelArchived' | 'chat.guildChatMessageSent' | 'chat.adminThreadStarted' | 'chat.adminThreadStatusChanged' | 'chat.attachmentTimedOut' | 'workProject.released' | 'workProject.hidden' | 'workProject.restored' | 'workRealm.created' | 'workRealm.released' | 'workRealm.detailsUpdated' | 'workRealm.hidden' | 'workRealm.restored';
|
|
2
|
+
export type AuditEventType = 'artisanCreator.grantedToUser' | 'artisanCreator.revokedFromUser' | 'user.accountRegistered' | 'user.statusChanged' | 'user.accountBanned' | 'user.accountUnbanned' | 'admin.systemRoleGranted' | 'admin.systemRoleRevoked' | 'admin.systemRoleSyncedFromDirectEdit' | 'admin.contentAppealReviewed' | 'admin.violationDecisionAccepted' | 'admin.thresholdItemReviewed' | 'admin.futurePlansUpdated' | 'admin.rulesAndAgreementsUpdated' | 'workProject.created' | 'workProject.guildmateUserGuildStandingChanged' | 'workProject.guildmateUserTradeProfessionsChanged' | 'workProject.publicDetailsUpdated' | 'workProject.workAssetDeleted' | 'workProject.guildInviteSent' | 'workProject.guildInviteAccepted' | 'workProject.guildInviteDeclined' | 'workProject.guildInviteCancelled' | 'workProject.guildInviteStakeSharesUpdated' | 'workProject.commissionListingCreated' | 'workProject.commissionProposalCreated' | 'workProject.commissionProposalAccepted' | 'workProject.commissionClosed' | 'workProject.commissionDeleted' | 'workProject.commissionProposalSaveToggled' | 'workProject.commissionProposalRejected' | 'workProject.stakeSharesChanged' | 'workProject.stakeShares.created' | 'workProject.stakeShares.increased' | 'workProject.stakeShares.anomaly' | 'craftSkill.userCraftSkillDeleted' | 'content.itemReported' | 'content.violationRecorded' | 'content.thresholdItemSubmitted' | 'content.hallItemPublished' | 'content.appealSubmitted' | 'content.violationAccepted' | 'content.taleDetailsUpdated' | 'content.taleWorkGenresUpdated' | 'content.chapterCreated' | 'content.chapterDetailsUpdated' | 'content.tuneDetailsUpdated' | 'content.tuneWorkGenresUpdated' | 'content.tuneTrackCreated' | 'content.tuneTrackDetailsUpdated' | 'content.televisionDetailsUpdated' | 'content.televisionWorkGenresUpdated' | 'content.televisionEpisodeCreated' | 'content.televisionEpisodeDetailsUpdated' | 'payment.sessionCreated' | 'payment.pledgePaymentCompleted' | 'payment.pledgePaymentAbandoned' | 'payment.pledgePaymentFailed' | 'admin.taskCheckedOut' | 'admin.taskCheckedIn' | 'admin.taskReleased' | 'admin.taskAutoReleased' | 'admin.taskDeferredLater' | 'workProject.auditionCreated' | 'admin.auditionCreated' | 'audition.entryCreated' | 'audition.closedByUser' | 'system.manualIntervention' | 'system.appConfigUpdated' | 'system.pledgePaymentsArchived' | 'system.pendingMediaArchived' | 'system.profanityListSynced' | 'system.profanityListSyncSkipped' | 'system.orphanUploadsCleanedUp' | 'admin.profanityListUpdated' | 'social.squareStreetzPostLiked' | 'social.squareStreetzPostUnliked' | 'social.userFollowed' | 'social.userUnfollowed' | 'chat.guildChatChannelCreated' | 'chat.guildChatChannelUpdated' | 'chat.guildChatChannelArchived' | 'chat.guildChatMessageSent' | 'chat.adminThreadStarted' | 'chat.adminThreadStatusChanged' | 'chat.attachmentTimedOut' | 'notification.broadcastSent' | 'notification.adminArchived' | 'workProject.released' | 'workProject.hidden' | 'workProject.restored' | 'workRealm.created' | 'workRealm.released' | 'workRealm.detailsUpdated' | 'workRealm.hidden' | 'workRealm.restored';
|
|
3
3
|
/**
|
|
4
4
|
* How the actor was acting when the audited action was performed. This is
|
|
5
5
|
* orthogonal to the event name — the same event type can be produced by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/types/audit.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,MAAM,cAAc,GAEtB,8BAA8B,GAC9B,gCAAgC,GAChC,wBAAwB,GACxB,oBAAoB,GACpB,oBAAoB,GACpB,sBAAsB,GAEtB,yBAAyB,GACzB,yBAAyB,GACzB,sCAAsC,GACtC,6BAA6B,GAC7B,iCAAiC,GACjC,6BAA6B,GAC7B,0BAA0B,GAC1B,iCAAiC,GAEjC,qBAAqB,GACrB,+CAA+C,GAC/C,kDAAkD,GAClD,kCAAkC,GAClC,8BAA8B,GAC9B,6BAA6B,GAC7B,iCAAiC,GACjC,iCAAiC,GACjC,kCAAkC,GAClC,2CAA2C,GAC3C,sCAAsC,GACtC,uCAAuC,GACvC,wCAAwC,GACxC,8BAA8B,GAC9B,+BAA+B,GAC/B,2CAA2C,GAC3C,wCAAwC,GACxC,gCAAgC,GAChC,iCAAiC,GACjC,mCAAmC,GACnC,iCAAiC,GAEjC,kCAAkC,GAElC,sBAAsB,GACtB,2BAA2B,GAC3B,gCAAgC,GAChC,2BAA2B,GAC3B,yBAAyB,GACzB,2BAA2B,GAE3B,4BAA4B,GAC5B,+BAA+B,GAC/B,wBAAwB,GACxB,+BAA+B,GAC/B,4BAA4B,GAC5B,+BAA+B,GAC/B,0BAA0B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C,iBAAiB,GAAG;IACnB,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,QAAQ,CAAC;IAC/C,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB,CAAC,GACF,CAAC,iBAAiB,GAAG;IACnB,SAAS,EAAE,aAAa,GAAG,eAAe,CAAC;IAC3C,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;CACjC,CAAC,CAAC;AAEP;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CACpC,cAAc,EACd,aAAa,EACb,cAAc,EACd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttt-productions/ttt-core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.14",
|
|
4
4
|
"description": "Core types, Firestore path constants, and shared constants for TTT Productions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -68,6 +68,10 @@
|
|
|
68
68
|
"types": "./dist/schemas/index.d.ts",
|
|
69
69
|
"default": "./dist/schemas/index.js"
|
|
70
70
|
},
|
|
71
|
+
"./schemas/notification": {
|
|
72
|
+
"types": "./dist/schemas/notification.d.ts",
|
|
73
|
+
"default": "./dist/schemas/notification.js"
|
|
74
|
+
},
|
|
71
75
|
"./upload-variables": {
|
|
72
76
|
"types": "./dist/upload-variables/index.d.ts",
|
|
73
77
|
"default": "./dist/upload-variables/index.js"
|