@devmonks/notify 0.0.0-stage → 0.4.0

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.
@@ -0,0 +1,680 @@
1
+ import { type AnyPgColumn } from 'drizzle-orm/pg-core';
2
+ /**
3
+ * Drizzle tables for the notify module. Pass the app's users table so the foreign keys point at it;
4
+ * the user id columns take its id's type (`uuid` or `text`). Re-export the result from the app's schema so its drizzle-kit
5
+ * generates the migration:
6
+ *
7
+ * export const { notifications, devices, notificationPrefs, notificationSettings, notificationDeliveries } =
8
+ * notifyTables({ users });
9
+ */
10
+ export declare function notifyTables({ users }: {
11
+ users: {
12
+ id: AnyPgColumn;
13
+ };
14
+ }): {
15
+ notifications: import("drizzle-orm/pg-core").PgTableWithColumns<{
16
+ name: "notification";
17
+ schema: undefined;
18
+ columns: {
19
+ id: import("drizzle-orm/pg-core").PgColumn<{
20
+ name: "id";
21
+ tableName: "notification";
22
+ dataType: "string";
23
+ columnType: "PgText";
24
+ data: string;
25
+ driverParam: string;
26
+ notNull: true;
27
+ hasDefault: false;
28
+ isPrimaryKey: true;
29
+ isAutoincrement: false;
30
+ hasRuntimeDefault: false;
31
+ enumValues: [string, ...string[]];
32
+ baseColumn: never;
33
+ identity: undefined;
34
+ generated: undefined;
35
+ }, {}, {}>;
36
+ userId: import("drizzle-orm/pg-core").PgColumn<{
37
+ name: string;
38
+ tableName: "notification";
39
+ dataType: "string";
40
+ columnType: "PgText" | "PgUUID";
41
+ data: string;
42
+ driverParam: string;
43
+ notNull: true;
44
+ hasDefault: false;
45
+ isPrimaryKey: false;
46
+ isAutoincrement: false;
47
+ hasRuntimeDefault: false;
48
+ enumValues: [string, ...string[]] | undefined;
49
+ baseColumn: never;
50
+ identity: undefined;
51
+ generated: undefined;
52
+ }, {}, {}>;
53
+ type: import("drizzle-orm/pg-core").PgColumn<{
54
+ name: "type";
55
+ tableName: "notification";
56
+ dataType: "string";
57
+ columnType: "PgText";
58
+ data: string;
59
+ driverParam: string;
60
+ notNull: true;
61
+ hasDefault: false;
62
+ isPrimaryKey: false;
63
+ isAutoincrement: false;
64
+ hasRuntimeDefault: false;
65
+ enumValues: [string, ...string[]];
66
+ baseColumn: never;
67
+ identity: undefined;
68
+ generated: undefined;
69
+ }, {}, {}>;
70
+ title: import("drizzle-orm/pg-core").PgColumn<{
71
+ name: "title";
72
+ tableName: "notification";
73
+ dataType: "string";
74
+ columnType: "PgText";
75
+ data: string;
76
+ driverParam: string;
77
+ notNull: true;
78
+ hasDefault: false;
79
+ isPrimaryKey: false;
80
+ isAutoincrement: false;
81
+ hasRuntimeDefault: false;
82
+ enumValues: [string, ...string[]];
83
+ baseColumn: never;
84
+ identity: undefined;
85
+ generated: undefined;
86
+ }, {}, {}>;
87
+ body: import("drizzle-orm/pg-core").PgColumn<{
88
+ name: "body";
89
+ tableName: "notification";
90
+ dataType: "string";
91
+ columnType: "PgText";
92
+ data: string;
93
+ driverParam: string;
94
+ notNull: true;
95
+ hasDefault: true;
96
+ isPrimaryKey: false;
97
+ isAutoincrement: false;
98
+ hasRuntimeDefault: false;
99
+ enumValues: [string, ...string[]];
100
+ baseColumn: never;
101
+ identity: undefined;
102
+ generated: undefined;
103
+ }, {}, {}>;
104
+ url: import("drizzle-orm/pg-core").PgColumn<{
105
+ name: "url";
106
+ tableName: "notification";
107
+ dataType: "string";
108
+ columnType: "PgText";
109
+ data: string;
110
+ driverParam: string;
111
+ notNull: false;
112
+ hasDefault: false;
113
+ isPrimaryKey: false;
114
+ isAutoincrement: false;
115
+ hasRuntimeDefault: false;
116
+ enumValues: [string, ...string[]];
117
+ baseColumn: never;
118
+ identity: undefined;
119
+ generated: undefined;
120
+ }, {}, {}>;
121
+ data: import("drizzle-orm/pg-core").PgColumn<{
122
+ name: "data";
123
+ tableName: "notification";
124
+ dataType: "json";
125
+ columnType: "PgJsonb";
126
+ data: unknown;
127
+ driverParam: unknown;
128
+ notNull: true;
129
+ hasDefault: true;
130
+ isPrimaryKey: false;
131
+ isAutoincrement: false;
132
+ hasRuntimeDefault: false;
133
+ enumValues: undefined;
134
+ baseColumn: never;
135
+ identity: undefined;
136
+ generated: undefined;
137
+ }, {}, {}>;
138
+ sourceId: import("drizzle-orm/pg-core").PgColumn<{
139
+ name: "source_id";
140
+ tableName: "notification";
141
+ dataType: "string";
142
+ columnType: "PgText";
143
+ data: string;
144
+ driverParam: string;
145
+ notNull: false;
146
+ hasDefault: false;
147
+ isPrimaryKey: false;
148
+ isAutoincrement: false;
149
+ hasRuntimeDefault: false;
150
+ enumValues: [string, ...string[]];
151
+ baseColumn: never;
152
+ identity: undefined;
153
+ generated: undefined;
154
+ }, {}, {}>;
155
+ actorId: import("drizzle-orm/pg-core").PgColumn<{
156
+ name: string;
157
+ tableName: "notification";
158
+ dataType: "string";
159
+ columnType: "PgText" | "PgUUID";
160
+ data: string;
161
+ driverParam: string;
162
+ notNull: false;
163
+ hasDefault: false;
164
+ isPrimaryKey: false;
165
+ isAutoincrement: false;
166
+ hasRuntimeDefault: false;
167
+ enumValues: [string, ...string[]] | undefined;
168
+ baseColumn: never;
169
+ identity: undefined;
170
+ generated: undefined;
171
+ }, {}, {}>;
172
+ readAt: import("drizzle-orm/pg-core").PgColumn<{
173
+ name: string;
174
+ tableName: "notification";
175
+ dataType: "date";
176
+ columnType: "PgTimestamp";
177
+ data: Date;
178
+ driverParam: string;
179
+ notNull: false;
180
+ hasDefault: false;
181
+ isPrimaryKey: false;
182
+ isAutoincrement: false;
183
+ hasRuntimeDefault: false;
184
+ enumValues: undefined;
185
+ baseColumn: never;
186
+ identity: undefined;
187
+ generated: undefined;
188
+ }, {}, {}>;
189
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
190
+ name: string;
191
+ tableName: "notification";
192
+ dataType: "date";
193
+ columnType: "PgTimestamp";
194
+ data: Date;
195
+ driverParam: string;
196
+ notNull: true;
197
+ hasDefault: true;
198
+ isPrimaryKey: false;
199
+ isAutoincrement: false;
200
+ hasRuntimeDefault: false;
201
+ enumValues: undefined;
202
+ baseColumn: never;
203
+ identity: undefined;
204
+ generated: undefined;
205
+ }, {}, {}>;
206
+ };
207
+ dialect: "pg";
208
+ }>;
209
+ devices: import("drizzle-orm/pg-core").PgTableWithColumns<{
210
+ name: "notify_device";
211
+ schema: undefined;
212
+ columns: {
213
+ id: import("drizzle-orm/pg-core").PgColumn<{
214
+ name: "id";
215
+ tableName: "notify_device";
216
+ dataType: "string";
217
+ columnType: "PgText";
218
+ data: string;
219
+ driverParam: string;
220
+ notNull: true;
221
+ hasDefault: false;
222
+ isPrimaryKey: true;
223
+ isAutoincrement: false;
224
+ hasRuntimeDefault: false;
225
+ enumValues: [string, ...string[]];
226
+ baseColumn: never;
227
+ identity: undefined;
228
+ generated: undefined;
229
+ }, {}, {}>;
230
+ userId: import("drizzle-orm/pg-core").PgColumn<{
231
+ name: string;
232
+ tableName: "notify_device";
233
+ dataType: "string";
234
+ columnType: "PgText" | "PgUUID";
235
+ data: string;
236
+ driverParam: string;
237
+ notNull: true;
238
+ hasDefault: false;
239
+ isPrimaryKey: false;
240
+ isAutoincrement: false;
241
+ hasRuntimeDefault: false;
242
+ enumValues: [string, ...string[]] | undefined;
243
+ baseColumn: never;
244
+ identity: undefined;
245
+ generated: undefined;
246
+ }, {}, {}>;
247
+ platform: import("drizzle-orm/pg-core").PgColumn<{
248
+ name: "platform";
249
+ tableName: "notify_device";
250
+ dataType: "string";
251
+ columnType: "PgText";
252
+ data: string;
253
+ driverParam: string;
254
+ notNull: true;
255
+ hasDefault: false;
256
+ isPrimaryKey: false;
257
+ isAutoincrement: false;
258
+ hasRuntimeDefault: false;
259
+ enumValues: [string, ...string[]];
260
+ baseColumn: never;
261
+ identity: undefined;
262
+ generated: undefined;
263
+ }, {}, {}>;
264
+ token: import("drizzle-orm/pg-core").PgColumn<{
265
+ name: "token";
266
+ tableName: "notify_device";
267
+ dataType: "string";
268
+ columnType: "PgText";
269
+ data: string;
270
+ driverParam: string;
271
+ notNull: true;
272
+ hasDefault: false;
273
+ isPrimaryKey: false;
274
+ isAutoincrement: false;
275
+ hasRuntimeDefault: false;
276
+ enumValues: [string, ...string[]];
277
+ baseColumn: never;
278
+ identity: undefined;
279
+ generated: undefined;
280
+ }, {}, {}>;
281
+ appVersion: import("drizzle-orm/pg-core").PgColumn<{
282
+ name: "app_version";
283
+ tableName: "notify_device";
284
+ dataType: "string";
285
+ columnType: "PgText";
286
+ data: string;
287
+ driverParam: string;
288
+ notNull: true;
289
+ hasDefault: true;
290
+ isPrimaryKey: false;
291
+ isAutoincrement: false;
292
+ hasRuntimeDefault: false;
293
+ enumValues: [string, ...string[]];
294
+ baseColumn: never;
295
+ identity: undefined;
296
+ generated: undefined;
297
+ }, {}, {}>;
298
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
299
+ name: string;
300
+ tableName: "notify_device";
301
+ dataType: "date";
302
+ columnType: "PgTimestamp";
303
+ data: Date;
304
+ driverParam: string;
305
+ notNull: true;
306
+ hasDefault: true;
307
+ isPrimaryKey: false;
308
+ isAutoincrement: false;
309
+ hasRuntimeDefault: false;
310
+ enumValues: undefined;
311
+ baseColumn: never;
312
+ identity: undefined;
313
+ generated: undefined;
314
+ }, {}, {}>;
315
+ lastSeenAt: import("drizzle-orm/pg-core").PgColumn<{
316
+ name: string;
317
+ tableName: "notify_device";
318
+ dataType: "date";
319
+ columnType: "PgTimestamp";
320
+ data: Date;
321
+ driverParam: string;
322
+ notNull: true;
323
+ hasDefault: true;
324
+ isPrimaryKey: false;
325
+ isAutoincrement: false;
326
+ hasRuntimeDefault: false;
327
+ enumValues: undefined;
328
+ baseColumn: never;
329
+ identity: undefined;
330
+ generated: undefined;
331
+ }, {}, {}>;
332
+ failureCount: import("drizzle-orm/pg-core").PgColumn<{
333
+ name: "failure_count";
334
+ tableName: "notify_device";
335
+ dataType: "number";
336
+ columnType: "PgInteger";
337
+ data: number;
338
+ driverParam: string | number;
339
+ notNull: true;
340
+ hasDefault: true;
341
+ isPrimaryKey: false;
342
+ isAutoincrement: false;
343
+ hasRuntimeDefault: false;
344
+ enumValues: undefined;
345
+ baseColumn: never;
346
+ identity: undefined;
347
+ generated: undefined;
348
+ }, {}, {}>;
349
+ };
350
+ dialect: "pg";
351
+ }>;
352
+ notificationPrefs: import("drizzle-orm/pg-core").PgTableWithColumns<{
353
+ name: "notification_pref";
354
+ schema: undefined;
355
+ columns: {
356
+ userId: import("drizzle-orm/pg-core").PgColumn<{
357
+ name: string;
358
+ tableName: "notification_pref";
359
+ dataType: "string";
360
+ columnType: "PgText" | "PgUUID";
361
+ data: string;
362
+ driverParam: string;
363
+ notNull: true;
364
+ hasDefault: false;
365
+ isPrimaryKey: false;
366
+ isAutoincrement: false;
367
+ hasRuntimeDefault: false;
368
+ enumValues: [string, ...string[]] | undefined;
369
+ baseColumn: never;
370
+ identity: undefined;
371
+ generated: undefined;
372
+ }, {}, {}>;
373
+ category: import("drizzle-orm/pg-core").PgColumn<{
374
+ name: "category";
375
+ tableName: "notification_pref";
376
+ dataType: "string";
377
+ columnType: "PgText";
378
+ data: string;
379
+ driverParam: string;
380
+ notNull: true;
381
+ hasDefault: false;
382
+ isPrimaryKey: false;
383
+ isAutoincrement: false;
384
+ hasRuntimeDefault: false;
385
+ enumValues: [string, ...string[]];
386
+ baseColumn: never;
387
+ identity: undefined;
388
+ generated: undefined;
389
+ }, {}, {}>;
390
+ channel: import("drizzle-orm/pg-core").PgColumn<{
391
+ name: "channel";
392
+ tableName: "notification_pref";
393
+ dataType: "string";
394
+ columnType: "PgText";
395
+ data: string;
396
+ driverParam: string;
397
+ notNull: true;
398
+ hasDefault: false;
399
+ isPrimaryKey: false;
400
+ isAutoincrement: false;
401
+ hasRuntimeDefault: false;
402
+ enumValues: [string, ...string[]];
403
+ baseColumn: never;
404
+ identity: undefined;
405
+ generated: undefined;
406
+ }, {}, {}>;
407
+ enabled: import("drizzle-orm/pg-core").PgColumn<{
408
+ name: "enabled";
409
+ tableName: "notification_pref";
410
+ dataType: "boolean";
411
+ columnType: "PgBoolean";
412
+ data: boolean;
413
+ driverParam: boolean;
414
+ notNull: true;
415
+ hasDefault: false;
416
+ isPrimaryKey: false;
417
+ isAutoincrement: false;
418
+ hasRuntimeDefault: false;
419
+ enumValues: undefined;
420
+ baseColumn: never;
421
+ identity: undefined;
422
+ generated: undefined;
423
+ }, {}, {}>;
424
+ };
425
+ dialect: "pg";
426
+ }>;
427
+ notificationSettings: import("drizzle-orm/pg-core").PgTableWithColumns<{
428
+ name: "notification_settings";
429
+ schema: undefined;
430
+ columns: {
431
+ userId: import("drizzle-orm/pg-core").PgColumn<{
432
+ name: string;
433
+ tableName: "notification_settings";
434
+ dataType: "string";
435
+ columnType: "PgText" | "PgUUID";
436
+ data: string;
437
+ driverParam: string;
438
+ notNull: true;
439
+ hasDefault: false;
440
+ isPrimaryKey: true;
441
+ isAutoincrement: false;
442
+ hasRuntimeDefault: false;
443
+ enumValues: [string, ...string[]] | undefined;
444
+ baseColumn: never;
445
+ identity: undefined;
446
+ generated: undefined;
447
+ }, {}, {}>;
448
+ quietFrom: import("drizzle-orm/pg-core").PgColumn<{
449
+ name: "quiet_from";
450
+ tableName: "notification_settings";
451
+ dataType: "string";
452
+ columnType: "PgText";
453
+ data: string;
454
+ driverParam: string;
455
+ notNull: false;
456
+ hasDefault: false;
457
+ isPrimaryKey: false;
458
+ isAutoincrement: false;
459
+ hasRuntimeDefault: false;
460
+ enumValues: [string, ...string[]];
461
+ baseColumn: never;
462
+ identity: undefined;
463
+ generated: undefined;
464
+ }, {}, {}>;
465
+ quietTo: import("drizzle-orm/pg-core").PgColumn<{
466
+ name: "quiet_to";
467
+ tableName: "notification_settings";
468
+ dataType: "string";
469
+ columnType: "PgText";
470
+ data: string;
471
+ driverParam: string;
472
+ notNull: false;
473
+ hasDefault: false;
474
+ isPrimaryKey: false;
475
+ isAutoincrement: false;
476
+ hasRuntimeDefault: false;
477
+ enumValues: [string, ...string[]];
478
+ baseColumn: never;
479
+ identity: undefined;
480
+ generated: undefined;
481
+ }, {}, {}>;
482
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
483
+ name: string;
484
+ tableName: "notification_settings";
485
+ dataType: "date";
486
+ columnType: "PgTimestamp";
487
+ data: Date;
488
+ driverParam: string;
489
+ notNull: true;
490
+ hasDefault: true;
491
+ isPrimaryKey: false;
492
+ isAutoincrement: false;
493
+ hasRuntimeDefault: false;
494
+ enumValues: undefined;
495
+ baseColumn: never;
496
+ identity: undefined;
497
+ generated: undefined;
498
+ }, {}, {}>;
499
+ };
500
+ dialect: "pg";
501
+ }>;
502
+ notificationDeliveries: import("drizzle-orm/pg-core").PgTableWithColumns<{
503
+ name: "notification_delivery";
504
+ schema: undefined;
505
+ columns: {
506
+ id: import("drizzle-orm/pg-core").PgColumn<{
507
+ name: "id";
508
+ tableName: "notification_delivery";
509
+ dataType: "string";
510
+ columnType: "PgText";
511
+ data: string;
512
+ driverParam: string;
513
+ notNull: true;
514
+ hasDefault: false;
515
+ isPrimaryKey: true;
516
+ isAutoincrement: false;
517
+ hasRuntimeDefault: false;
518
+ enumValues: [string, ...string[]];
519
+ baseColumn: never;
520
+ identity: undefined;
521
+ generated: undefined;
522
+ }, {}, {}>;
523
+ idempotencyKey: import("drizzle-orm/pg-core").PgColumn<{
524
+ name: "idempotency_key";
525
+ tableName: "notification_delivery";
526
+ dataType: "string";
527
+ columnType: "PgText";
528
+ data: string;
529
+ driverParam: string;
530
+ notNull: true;
531
+ hasDefault: false;
532
+ isPrimaryKey: false;
533
+ isAutoincrement: false;
534
+ hasRuntimeDefault: false;
535
+ enumValues: [string, ...string[]];
536
+ baseColumn: never;
537
+ identity: undefined;
538
+ generated: undefined;
539
+ }, {}, {}>;
540
+ type: import("drizzle-orm/pg-core").PgColumn<{
541
+ name: "type";
542
+ tableName: "notification_delivery";
543
+ dataType: "string";
544
+ columnType: "PgText";
545
+ data: string;
546
+ driverParam: string;
547
+ notNull: true;
548
+ hasDefault: false;
549
+ isPrimaryKey: false;
550
+ isAutoincrement: false;
551
+ hasRuntimeDefault: false;
552
+ enumValues: [string, ...string[]];
553
+ baseColumn: never;
554
+ identity: undefined;
555
+ generated: undefined;
556
+ }, {}, {}>;
557
+ userId: import("drizzle-orm/pg-core").PgColumn<{
558
+ name: "user_id";
559
+ tableName: "notification_delivery";
560
+ dataType: "string";
561
+ columnType: "PgText";
562
+ data: string;
563
+ driverParam: string;
564
+ notNull: true;
565
+ hasDefault: false;
566
+ isPrimaryKey: false;
567
+ isAutoincrement: false;
568
+ hasRuntimeDefault: false;
569
+ enumValues: [string, ...string[]];
570
+ baseColumn: never;
571
+ identity: undefined;
572
+ generated: undefined;
573
+ }, {}, {}>;
574
+ channel: import("drizzle-orm/pg-core").PgColumn<{
575
+ name: "channel";
576
+ tableName: "notification_delivery";
577
+ dataType: "string";
578
+ columnType: "PgText";
579
+ data: string;
580
+ driverParam: string;
581
+ notNull: true;
582
+ hasDefault: false;
583
+ isPrimaryKey: false;
584
+ isAutoincrement: false;
585
+ hasRuntimeDefault: false;
586
+ enumValues: [string, ...string[]];
587
+ baseColumn: never;
588
+ identity: undefined;
589
+ generated: undefined;
590
+ }, {}, {}>;
591
+ deviceId: import("drizzle-orm/pg-core").PgColumn<{
592
+ name: "device_id";
593
+ tableName: "notification_delivery";
594
+ dataType: "string";
595
+ columnType: "PgText";
596
+ data: string;
597
+ driverParam: string;
598
+ notNull: false;
599
+ hasDefault: false;
600
+ isPrimaryKey: false;
601
+ isAutoincrement: false;
602
+ hasRuntimeDefault: false;
603
+ enumValues: [string, ...string[]];
604
+ baseColumn: never;
605
+ identity: undefined;
606
+ generated: undefined;
607
+ }, {}, {}>;
608
+ status: import("drizzle-orm/pg-core").PgColumn<{
609
+ name: "status";
610
+ tableName: "notification_delivery";
611
+ dataType: "string";
612
+ columnType: "PgText";
613
+ data: string;
614
+ driverParam: string;
615
+ notNull: true;
616
+ hasDefault: true;
617
+ isPrimaryKey: false;
618
+ isAutoincrement: false;
619
+ hasRuntimeDefault: false;
620
+ enumValues: [string, ...string[]];
621
+ baseColumn: never;
622
+ identity: undefined;
623
+ generated: undefined;
624
+ }, {}, {}>;
625
+ error: import("drizzle-orm/pg-core").PgColumn<{
626
+ name: "error";
627
+ tableName: "notification_delivery";
628
+ dataType: "string";
629
+ columnType: "PgText";
630
+ data: string;
631
+ driverParam: string;
632
+ notNull: false;
633
+ hasDefault: false;
634
+ isPrimaryKey: false;
635
+ isAutoincrement: false;
636
+ hasRuntimeDefault: false;
637
+ enumValues: [string, ...string[]];
638
+ baseColumn: never;
639
+ identity: undefined;
640
+ generated: undefined;
641
+ }, {}, {}>;
642
+ attempts: import("drizzle-orm/pg-core").PgColumn<{
643
+ name: "attempts";
644
+ tableName: "notification_delivery";
645
+ dataType: "number";
646
+ columnType: "PgInteger";
647
+ data: number;
648
+ driverParam: string | number;
649
+ notNull: true;
650
+ hasDefault: true;
651
+ isPrimaryKey: false;
652
+ isAutoincrement: false;
653
+ hasRuntimeDefault: false;
654
+ enumValues: undefined;
655
+ baseColumn: never;
656
+ identity: undefined;
657
+ generated: undefined;
658
+ }, {}, {}>;
659
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
660
+ name: string;
661
+ tableName: "notification_delivery";
662
+ dataType: "date";
663
+ columnType: "PgTimestamp";
664
+ data: Date;
665
+ driverParam: string;
666
+ notNull: true;
667
+ hasDefault: true;
668
+ isPrimaryKey: false;
669
+ isAutoincrement: false;
670
+ hasRuntimeDefault: false;
671
+ enumValues: undefined;
672
+ baseColumn: never;
673
+ identity: undefined;
674
+ generated: undefined;
675
+ }, {}, {}>;
676
+ };
677
+ dialect: "pg";
678
+ }>;
679
+ };
680
+ export type NotifyTables = ReturnType<typeof notifyTables>;