@remit/drizzle-pg-schema 0.0.1 → 0.0.3

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/schema.d.ts CHANGED
@@ -185,6 +185,422 @@ export declare const accountExportRequests: import("drizzle-orm/pg-core").PgTabl
185
185
  };
186
186
  dialect: "pg";
187
187
  }>;
188
+ export declare const quarantines: import("drizzle-orm/pg-core").PgTableWithColumns<{
189
+ name: "quarantine";
190
+ schema: undefined;
191
+ columns: {
192
+ quarantineId: import("drizzle-orm/pg-core").PgColumn<{
193
+ name: "quarantine_id";
194
+ tableName: "quarantine";
195
+ dataType: "string";
196
+ columnType: "PgText";
197
+ data: string;
198
+ driverParam: string;
199
+ notNull: true;
200
+ hasDefault: true;
201
+ isPrimaryKey: true;
202
+ isAutoincrement: false;
203
+ hasRuntimeDefault: true;
204
+ enumValues: [string, ...string[]];
205
+ baseColumn: never;
206
+ identity: undefined;
207
+ generated: undefined;
208
+ }, {}, {}>;
209
+ accountConfigId: import("drizzle-orm/pg-core").PgColumn<{
210
+ name: "account_config_id";
211
+ tableName: "quarantine";
212
+ dataType: "string";
213
+ columnType: "PgText";
214
+ data: string;
215
+ driverParam: string;
216
+ notNull: true;
217
+ hasDefault: false;
218
+ isPrimaryKey: false;
219
+ isAutoincrement: false;
220
+ hasRuntimeDefault: false;
221
+ enumValues: [string, ...string[]];
222
+ baseColumn: never;
223
+ identity: undefined;
224
+ generated: undefined;
225
+ }, {}, {}>;
226
+ accountId: import("drizzle-orm/pg-core").PgColumn<{
227
+ name: "account_id";
228
+ tableName: "quarantine";
229
+ dataType: "string";
230
+ columnType: "PgText";
231
+ data: string;
232
+ driverParam: string;
233
+ notNull: true;
234
+ hasDefault: false;
235
+ isPrimaryKey: false;
236
+ isAutoincrement: false;
237
+ hasRuntimeDefault: false;
238
+ enumValues: [string, ...string[]];
239
+ baseColumn: never;
240
+ identity: undefined;
241
+ generated: undefined;
242
+ }, {}, {}>;
243
+ mailboxId: import("drizzle-orm/pg-core").PgColumn<{
244
+ name: "mailbox_id";
245
+ tableName: "quarantine";
246
+ dataType: "string";
247
+ columnType: "PgText";
248
+ data: string;
249
+ driverParam: string;
250
+ notNull: true;
251
+ hasDefault: false;
252
+ isPrimaryKey: false;
253
+ isAutoincrement: false;
254
+ hasRuntimeDefault: false;
255
+ enumValues: [string, ...string[]];
256
+ baseColumn: never;
257
+ identity: undefined;
258
+ generated: undefined;
259
+ }, {}, {}>;
260
+ uidValidity: import("drizzle-orm/pg-core").PgColumn<{
261
+ name: "uid_validity";
262
+ tableName: "quarantine";
263
+ dataType: "number";
264
+ columnType: "PgBigInt53";
265
+ data: number;
266
+ driverParam: string | number;
267
+ notNull: true;
268
+ hasDefault: false;
269
+ isPrimaryKey: false;
270
+ isAutoincrement: false;
271
+ hasRuntimeDefault: false;
272
+ enumValues: undefined;
273
+ baseColumn: never;
274
+ identity: undefined;
275
+ generated: undefined;
276
+ }, {}, {}>;
277
+ uid: import("drizzle-orm/pg-core").PgColumn<{
278
+ name: "uid";
279
+ tableName: "quarantine";
280
+ dataType: "number";
281
+ columnType: "PgBigInt53";
282
+ data: number;
283
+ driverParam: string | number;
284
+ notNull: true;
285
+ hasDefault: false;
286
+ isPrimaryKey: false;
287
+ isAutoincrement: false;
288
+ hasRuntimeDefault: false;
289
+ enumValues: undefined;
290
+ baseColumn: never;
291
+ identity: undefined;
292
+ generated: undefined;
293
+ }, {}, {}>;
294
+ mailboxRole: import("drizzle-orm/pg-core").PgColumn<{
295
+ name: "mailbox_role";
296
+ tableName: "quarantine";
297
+ dataType: "string";
298
+ columnType: "PgText";
299
+ data: "Inbox" | "Drafts" | "Sent" | "Archive" | "Junk" | "Trash" | "All" | "Flagged";
300
+ driverParam: string;
301
+ notNull: false;
302
+ hasDefault: false;
303
+ isPrimaryKey: false;
304
+ isAutoincrement: false;
305
+ hasRuntimeDefault: false;
306
+ enumValues: [string, ...string[]];
307
+ baseColumn: never;
308
+ identity: undefined;
309
+ generated: undefined;
310
+ }, {}, {
311
+ $type: "Inbox" | "Drafts" | "Sent" | "Archive" | "Junk" | "Trash" | "All" | "Flagged";
312
+ }>;
313
+ mailboxPath: import("drizzle-orm/pg-core").PgColumn<{
314
+ name: "mailbox_path";
315
+ tableName: "quarantine";
316
+ dataType: "string";
317
+ columnType: "PgText";
318
+ data: string;
319
+ driverParam: string;
320
+ notNull: true;
321
+ hasDefault: false;
322
+ isPrimaryKey: false;
323
+ isAutoincrement: false;
324
+ hasRuntimeDefault: false;
325
+ enumValues: [string, ...string[]];
326
+ baseColumn: never;
327
+ identity: undefined;
328
+ generated: undefined;
329
+ }, {}, {}>;
330
+ quarantinedAt: import("drizzle-orm/pg-core").PgColumn<{
331
+ name: "quarantined_at";
332
+ tableName: "quarantine";
333
+ dataType: "number";
334
+ columnType: "PgBigInt53";
335
+ data: number;
336
+ driverParam: string | number;
337
+ notNull: true;
338
+ hasDefault: false;
339
+ isPrimaryKey: false;
340
+ isAutoincrement: false;
341
+ hasRuntimeDefault: false;
342
+ enumValues: undefined;
343
+ baseColumn: never;
344
+ identity: undefined;
345
+ generated: undefined;
346
+ }, {}, {}>;
347
+ attempts: import("drizzle-orm/pg-core").PgColumn<{
348
+ name: "attempts";
349
+ tableName: "quarantine";
350
+ dataType: "number";
351
+ columnType: "PgInteger";
352
+ data: number;
353
+ driverParam: string | number;
354
+ notNull: true;
355
+ hasDefault: false;
356
+ isPrimaryKey: false;
357
+ isAutoincrement: false;
358
+ hasRuntimeDefault: false;
359
+ enumValues: undefined;
360
+ baseColumn: never;
361
+ identity: undefined;
362
+ generated: undefined;
363
+ }, {}, {}>;
364
+ failureStage: import("drizzle-orm/pg-core").PgColumn<{
365
+ name: "failure_stage";
366
+ tableName: "quarantine";
367
+ dataType: "string";
368
+ columnType: "PgText";
369
+ data: "BodyParse";
370
+ driverParam: string;
371
+ notNull: true;
372
+ hasDefault: false;
373
+ isPrimaryKey: false;
374
+ isAutoincrement: false;
375
+ hasRuntimeDefault: false;
376
+ enumValues: [string, ...string[]];
377
+ baseColumn: never;
378
+ identity: undefined;
379
+ generated: undefined;
380
+ }, {}, {
381
+ $type: "BodyParse";
382
+ }>;
383
+ failureCode: import("drizzle-orm/pg-core").PgColumn<{
384
+ name: "failure_code";
385
+ tableName: "quarantine";
386
+ dataType: "string";
387
+ columnType: "PgText";
388
+ data: "UnterminatedMultipartBoundary" | "UnknownCharset" | "TruncatedBody";
389
+ driverParam: string;
390
+ notNull: true;
391
+ hasDefault: false;
392
+ isPrimaryKey: false;
393
+ isAutoincrement: false;
394
+ hasRuntimeDefault: false;
395
+ enumValues: [string, ...string[]];
396
+ baseColumn: never;
397
+ identity: undefined;
398
+ generated: undefined;
399
+ }, {}, {
400
+ $type: "UnterminatedMultipartBoundary" | "UnknownCharset" | "TruncatedBody";
401
+ }>;
402
+ failureMessage: import("drizzle-orm/pg-core").PgColumn<{
403
+ name: "failure_message";
404
+ tableName: "quarantine";
405
+ dataType: "string";
406
+ columnType: "PgText";
407
+ data: string;
408
+ driverParam: string;
409
+ notNull: true;
410
+ hasDefault: false;
411
+ isPrimaryKey: false;
412
+ isAutoincrement: false;
413
+ hasRuntimeDefault: false;
414
+ enumValues: [string, ...string[]];
415
+ baseColumn: never;
416
+ identity: undefined;
417
+ generated: undefined;
418
+ }, {}, {}>;
419
+ failurePartPath: import("drizzle-orm/pg-core").PgColumn<{
420
+ name: "failure_part_path";
421
+ tableName: "quarantine";
422
+ dataType: "custom";
423
+ columnType: "PgCustomColumn";
424
+ data: string;
425
+ driverParam: string;
426
+ notNull: false;
427
+ hasDefault: false;
428
+ isPrimaryKey: false;
429
+ isAutoincrement: false;
430
+ hasRuntimeDefault: false;
431
+ enumValues: undefined;
432
+ baseColumn: never;
433
+ identity: undefined;
434
+ generated: undefined;
435
+ }, {}, {
436
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
437
+ }>;
438
+ workerVersion: import("drizzle-orm/pg-core").PgColumn<{
439
+ name: "worker_version";
440
+ tableName: "quarantine";
441
+ dataType: "string";
442
+ columnType: "PgText";
443
+ data: string;
444
+ driverParam: string;
445
+ notNull: true;
446
+ hasDefault: false;
447
+ isPrimaryKey: false;
448
+ isAutoincrement: false;
449
+ hasRuntimeDefault: false;
450
+ enumValues: [string, ...string[]];
451
+ baseColumn: never;
452
+ identity: undefined;
453
+ generated: undefined;
454
+ }, {}, {}>;
455
+ contentType: import("drizzle-orm/pg-core").PgColumn<{
456
+ name: "content_type";
457
+ tableName: "quarantine";
458
+ dataType: "custom";
459
+ columnType: "PgCustomColumn";
460
+ data: string;
461
+ driverParam: string;
462
+ notNull: false;
463
+ hasDefault: false;
464
+ isPrimaryKey: false;
465
+ isAutoincrement: false;
466
+ hasRuntimeDefault: false;
467
+ enumValues: undefined;
468
+ baseColumn: never;
469
+ identity: undefined;
470
+ generated: undefined;
471
+ }, {}, {
472
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
473
+ }>;
474
+ transferEncoding: import("drizzle-orm/pg-core").PgColumn<{
475
+ name: "transfer_encoding";
476
+ tableName: "quarantine";
477
+ dataType: "custom";
478
+ columnType: "PgCustomColumn";
479
+ data: string;
480
+ driverParam: string;
481
+ notNull: false;
482
+ hasDefault: false;
483
+ isPrimaryKey: false;
484
+ isAutoincrement: false;
485
+ hasRuntimeDefault: false;
486
+ enumValues: undefined;
487
+ baseColumn: never;
488
+ identity: undefined;
489
+ generated: undefined;
490
+ }, {}, {
491
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
492
+ }>;
493
+ charset: import("drizzle-orm/pg-core").PgColumn<{
494
+ name: "charset";
495
+ tableName: "quarantine";
496
+ dataType: "custom";
497
+ columnType: "PgCustomColumn";
498
+ data: string;
499
+ driverParam: string;
500
+ notNull: false;
501
+ hasDefault: false;
502
+ isPrimaryKey: false;
503
+ isAutoincrement: false;
504
+ hasRuntimeDefault: false;
505
+ enumValues: undefined;
506
+ baseColumn: never;
507
+ identity: undefined;
508
+ generated: undefined;
509
+ }, {}, {
510
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
511
+ }>;
512
+ sizeBytes: import("drizzle-orm/pg-core").PgColumn<{
513
+ name: "size_bytes";
514
+ tableName: "quarantine";
515
+ dataType: "custom";
516
+ columnType: "PgCustomColumn";
517
+ data: number;
518
+ driverParam: string | number;
519
+ notNull: false;
520
+ hasDefault: false;
521
+ isPrimaryKey: false;
522
+ isAutoincrement: false;
523
+ hasRuntimeDefault: false;
524
+ enumValues: undefined;
525
+ baseColumn: never;
526
+ identity: undefined;
527
+ generated: undefined;
528
+ }, {}, {
529
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
530
+ }>;
531
+ structure: import("drizzle-orm/pg-core").PgColumn<{
532
+ name: "structure";
533
+ tableName: "quarantine";
534
+ dataType: "json";
535
+ columnType: "PgJsonb";
536
+ data: unknown;
537
+ driverParam: unknown;
538
+ notNull: true;
539
+ hasDefault: false;
540
+ isPrimaryKey: false;
541
+ isAutoincrement: false;
542
+ hasRuntimeDefault: false;
543
+ enumValues: undefined;
544
+ baseColumn: never;
545
+ identity: undefined;
546
+ generated: undefined;
547
+ }, {}, {}>;
548
+ messageIdHash: import("drizzle-orm/pg-core").PgColumn<{
549
+ name: "message_id_hash";
550
+ tableName: "quarantine";
551
+ dataType: "custom";
552
+ columnType: "PgCustomColumn";
553
+ data: string;
554
+ driverParam: string;
555
+ notNull: false;
556
+ hasDefault: false;
557
+ isPrimaryKey: false;
558
+ isAutoincrement: false;
559
+ hasRuntimeDefault: false;
560
+ enumValues: undefined;
561
+ baseColumn: never;
562
+ identity: undefined;
563
+ generated: undefined;
564
+ }, {}, {
565
+ pgColumnBuilderBrand: "PgCustomColumnBuilderBrand";
566
+ }>;
567
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
568
+ name: "created_at";
569
+ tableName: "quarantine";
570
+ dataType: "number";
571
+ columnType: "PgBigInt53";
572
+ data: number;
573
+ driverParam: string | number;
574
+ notNull: true;
575
+ hasDefault: false;
576
+ isPrimaryKey: false;
577
+ isAutoincrement: false;
578
+ hasRuntimeDefault: false;
579
+ enumValues: undefined;
580
+ baseColumn: never;
581
+ identity: undefined;
582
+ generated: undefined;
583
+ }, {}, {}>;
584
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
585
+ name: "updated_at";
586
+ tableName: "quarantine";
587
+ dataType: "number";
588
+ columnType: "PgBigInt53";
589
+ data: number;
590
+ driverParam: string | number;
591
+ notNull: true;
592
+ hasDefault: false;
593
+ isPrimaryKey: false;
594
+ isAutoincrement: false;
595
+ hasRuntimeDefault: false;
596
+ enumValues: undefined;
597
+ baseColumn: never;
598
+ identity: undefined;
599
+ generated: undefined;
600
+ }, {}, {}>;
601
+ };
602
+ dialect: "pg";
603
+ }>;
188
604
  export declare const accountConfigs: import("drizzle-orm/pg-core").PgTableWithColumns<{
189
605
  name: "account_config";
190
606
  schema: undefined;
@@ -1024,16 +1440,16 @@ export declare const mailboxes: import("drizzle-orm/pg-core").PgTableWithColumns
1024
1440
  highestModseq: import("drizzle-orm/pg-core").PgColumn<{
1025
1441
  name: "highest_modseq";
1026
1442
  tableName: "mailbox";
1027
- dataType: "number";
1028
- columnType: "PgBigInt53";
1029
- data: number;
1030
- driverParam: string | number;
1443
+ dataType: "string";
1444
+ columnType: "PgText";
1445
+ data: string;
1446
+ driverParam: string;
1031
1447
  notNull: true;
1032
1448
  hasDefault: false;
1033
1449
  isPrimaryKey: false;
1034
1450
  isAutoincrement: false;
1035
1451
  hasRuntimeDefault: false;
1036
- enumValues: undefined;
1452
+ enumValues: [string, ...string[]];
1037
1453
  baseColumn: never;
1038
1454
  identity: undefined;
1039
1455
  generated: undefined;
@@ -4280,7 +4696,7 @@ export declare const mailboxSpecialUseEntries: import("drizzle-orm/pg-core").PgT
4280
4696
  tableName: "mailbox_special_use_entry";
4281
4697
  dataType: "string";
4282
4698
  columnType: "PgText";
4283
- data: "All" | "Archive" | "Drafts" | "Flagged" | "Junk" | "Sent" | "Trash" | "Important";
4699
+ data: "Drafts" | "Sent" | "Archive" | "Junk" | "Trash" | "All" | "Flagged" | "Important";
4284
4700
  driverParam: string;
4285
4701
  notNull: true;
4286
4702
  hasDefault: false;
@@ -4292,7 +4708,7 @@ export declare const mailboxSpecialUseEntries: import("drizzle-orm/pg-core").PgT
4292
4708
  identity: undefined;
4293
4709
  generated: undefined;
4294
4710
  }, {}, {
4295
- $type: "All" | "Archive" | "Drafts" | "Flagged" | "Junk" | "Sent" | "Trash" | "Important";
4711
+ $type: "Drafts" | "Sent" | "Archive" | "Junk" | "Trash" | "All" | "Flagged" | "Important";
4296
4712
  }>;
4297
4713
  };
4298
4714
  dialect: "pg";
package/dist/schema.js CHANGED
@@ -14,6 +14,33 @@ export const accountExportRequests = pgTable("account_export_request", {
14
14
  }, (table) => [
15
15
  index("account_export_request_by_account_config_id").on(table.accountConfigId, table.createdAt),
16
16
  ]);
17
+ export const quarantines = pgTable("quarantine", {
18
+ quarantineId: text("quarantine_id").primaryKey().$defaultFn(() => generateBase36Id()),
19
+ accountConfigId: text("account_config_id").notNull(),
20
+ accountId: text("account_id").notNull(),
21
+ mailboxId: text("mailbox_id").notNull(),
22
+ uidValidity: bigint("uid_validity", { mode: "number" }).notNull(),
23
+ uid: bigint("uid", { mode: "number" }).notNull(),
24
+ mailboxRole: text("mailbox_role").$type(),
25
+ mailboxPath: text("mailbox_path").notNull(),
26
+ quarantinedAt: bigint("quarantined_at", { mode: "number" }).notNull(),
27
+ attempts: integer("attempts").notNull(),
28
+ failureStage: text("failure_stage").$type().notNull(),
29
+ failureCode: text("failure_code").$type().notNull(),
30
+ failureMessage: text("failure_message").notNull(),
31
+ failurePartPath: nullableText("failure_part_path"),
32
+ workerVersion: text("worker_version").notNull(),
33
+ contentType: nullableText("content_type"),
34
+ transferEncoding: nullableText("transfer_encoding"),
35
+ charset: nullableText("charset"),
36
+ sizeBytes: nullableBigint("size_bytes"),
37
+ structure: jsonb("structure").notNull(),
38
+ messageIdHash: nullableText("message_id_hash"),
39
+ createdAt: bigint("created_at", { mode: "number" }).notNull(),
40
+ updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
41
+ }, (table) => [
42
+ index("quarantine_by_account_config_id").on(table.accountConfigId, table.quarantinedAt),
43
+ ]);
17
44
  export const accountConfigs = pgTable("account_config", {
18
45
  accountConfigId: text("account_config_id").primaryKey().$defaultFn(() => generateBase36Id()),
19
46
  userId: text("user_id").notNull(),
@@ -69,7 +96,7 @@ export const mailboxes = pgTable("mailbox", {
69
96
  fullPath: text("full_path").notNull(),
70
97
  uidValidity: bigint("uid_validity", { mode: "number" }).notNull(),
71
98
  uidNext: bigint("uid_next", { mode: "number" }).notNull(),
72
- highestModseq: bigint("highest_modseq", { mode: "number" }).notNull(),
99
+ highestModseq: text("highest_modseq").notNull(),
73
100
  messageCount: integer("message_count").notNull(),
74
101
  unseenCount: integer("unseen_count").notNull(),
75
102
  deletedCount: integer("deleted_count").notNull(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/drizzle-pg-schema",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/schema.ts CHANGED
@@ -20,6 +20,38 @@ export const accountExportRequests = pgTable(
20
20
  ],
21
21
  );
22
22
 
23
+ export const quarantines = pgTable(
24
+ "quarantine",
25
+ {
26
+ quarantineId: text("quarantine_id").primaryKey().$defaultFn(() => generateBase36Id()),
27
+ accountConfigId: text("account_config_id").notNull(),
28
+ accountId: text("account_id").notNull(),
29
+ mailboxId: text("mailbox_id").notNull(),
30
+ uidValidity: bigint("uid_validity", { mode: "number" }).notNull(),
31
+ uid: bigint("uid", { mode: "number" }).notNull(),
32
+ mailboxRole: text("mailbox_role").$type<"Inbox" | "Drafts" | "Sent" | "Archive" | "Junk" | "Trash" | "All" | "Flagged">(),
33
+ mailboxPath: text("mailbox_path").notNull(),
34
+ quarantinedAt: bigint("quarantined_at", { mode: "number" }).notNull(),
35
+ attempts: integer("attempts").notNull(),
36
+ failureStage: text("failure_stage").$type<"BodyParse">().notNull(),
37
+ failureCode: text("failure_code").$type<"UnterminatedMultipartBoundary" | "UnknownCharset" | "TruncatedBody">().notNull(),
38
+ failureMessage: text("failure_message").notNull(),
39
+ failurePartPath: nullableText("failure_part_path"),
40
+ workerVersion: text("worker_version").notNull(),
41
+ contentType: nullableText("content_type"),
42
+ transferEncoding: nullableText("transfer_encoding"),
43
+ charset: nullableText("charset"),
44
+ sizeBytes: nullableBigint("size_bytes"),
45
+ structure: jsonb("structure").notNull(),
46
+ messageIdHash: nullableText("message_id_hash"),
47
+ createdAt: bigint("created_at", { mode: "number" }).notNull(),
48
+ updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
49
+ },
50
+ (table) => [
51
+ index("quarantine_by_account_config_id").on(table.accountConfigId, table.quarantinedAt),
52
+ ],
53
+ );
54
+
23
55
  export const accountConfigs = pgTable(
24
56
  "account_config",
25
57
  {
@@ -87,7 +119,7 @@ export const mailboxes = pgTable(
87
119
  fullPath: text("full_path").notNull(),
88
120
  uidValidity: bigint("uid_validity", { mode: "number" }).notNull(),
89
121
  uidNext: bigint("uid_next", { mode: "number" }).notNull(),
90
- highestModseq: bigint("highest_modseq", { mode: "number" }).notNull(),
122
+ highestModseq: text("highest_modseq").notNull(),
91
123
  messageCount: integer("message_count").notNull(),
92
124
  unseenCount: integer("unseen_count").notNull(),
93
125
  deletedCount: integer("deleted_count").notNull(),