@remit/drizzle-pg-schema 0.0.19 → 0.0.20

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
@@ -5322,6 +5322,361 @@ export declare const messageReferences: import("drizzle-orm/pg-core").PgTableWit
5322
5322
  };
5323
5323
  dialect: "pg";
5324
5324
  }>;
5325
+ export declare const calendarSuggestions: import("drizzle-orm/pg-core").PgTableWithColumns<{
5326
+ name: "calendar_suggestion";
5327
+ schema: undefined;
5328
+ columns: {
5329
+ suggestionId: import("drizzle-orm/pg-core").PgColumn<{
5330
+ name: "suggestion_id";
5331
+ tableName: "calendar_suggestion";
5332
+ dataType: "string";
5333
+ columnType: "PgText";
5334
+ data: string;
5335
+ driverParam: string;
5336
+ notNull: true;
5337
+ hasDefault: false;
5338
+ isPrimaryKey: false;
5339
+ isAutoincrement: false;
5340
+ hasRuntimeDefault: false;
5341
+ enumValues: [string, ...string[]];
5342
+ baseColumn: never;
5343
+ identity: undefined;
5344
+ generated: undefined;
5345
+ }, {}, {}>;
5346
+ accountConfigId: import("drizzle-orm/pg-core").PgColumn<{
5347
+ name: "account_config_id";
5348
+ tableName: "calendar_suggestion";
5349
+ dataType: "string";
5350
+ columnType: "PgText";
5351
+ data: string;
5352
+ driverParam: string;
5353
+ notNull: true;
5354
+ hasDefault: false;
5355
+ isPrimaryKey: false;
5356
+ isAutoincrement: false;
5357
+ hasRuntimeDefault: false;
5358
+ enumValues: [string, ...string[]];
5359
+ baseColumn: never;
5360
+ identity: undefined;
5361
+ generated: undefined;
5362
+ }, {}, {}>;
5363
+ messageId: import("drizzle-orm/pg-core").PgColumn<{
5364
+ name: "message_id";
5365
+ tableName: "calendar_suggestion";
5366
+ dataType: "string";
5367
+ columnType: "PgText";
5368
+ data: string;
5369
+ driverParam: string;
5370
+ notNull: true;
5371
+ hasDefault: false;
5372
+ isPrimaryKey: false;
5373
+ isAutoincrement: false;
5374
+ hasRuntimeDefault: false;
5375
+ enumValues: [string, ...string[]];
5376
+ baseColumn: never;
5377
+ identity: undefined;
5378
+ generated: undefined;
5379
+ }, {}, {}>;
5380
+ bodyPartId: import("drizzle-orm/pg-core").PgColumn<{
5381
+ name: "body_part_id";
5382
+ tableName: "calendar_suggestion";
5383
+ dataType: "string";
5384
+ columnType: "PgText";
5385
+ data: string;
5386
+ driverParam: string;
5387
+ notNull: true;
5388
+ hasDefault: false;
5389
+ isPrimaryKey: false;
5390
+ isAutoincrement: false;
5391
+ hasRuntimeDefault: false;
5392
+ enumValues: [string, ...string[]];
5393
+ baseColumn: never;
5394
+ identity: undefined;
5395
+ generated: undefined;
5396
+ }, {}, {}>;
5397
+ icalUid: import("drizzle-orm/pg-core").PgColumn<{
5398
+ name: "ical_uid";
5399
+ tableName: "calendar_suggestion";
5400
+ dataType: "string";
5401
+ columnType: "PgText";
5402
+ data: string;
5403
+ driverParam: string;
5404
+ notNull: true;
5405
+ hasDefault: false;
5406
+ isPrimaryKey: false;
5407
+ isAutoincrement: false;
5408
+ hasRuntimeDefault: false;
5409
+ enumValues: [string, ...string[]];
5410
+ baseColumn: never;
5411
+ identity: undefined;
5412
+ generated: undefined;
5413
+ }, {}, {}>;
5414
+ sequence: import("drizzle-orm/pg-core").PgColumn<{
5415
+ name: "sequence";
5416
+ tableName: "calendar_suggestion";
5417
+ dataType: "number";
5418
+ columnType: "PgInteger";
5419
+ data: number;
5420
+ driverParam: string | number;
5421
+ notNull: true;
5422
+ hasDefault: true;
5423
+ isPrimaryKey: false;
5424
+ isAutoincrement: false;
5425
+ hasRuntimeDefault: false;
5426
+ enumValues: undefined;
5427
+ baseColumn: never;
5428
+ identity: undefined;
5429
+ generated: undefined;
5430
+ }, {}, {}>;
5431
+ method: import("drizzle-orm/pg-core").PgColumn<{
5432
+ name: "method";
5433
+ tableName: "calendar_suggestion";
5434
+ dataType: "string";
5435
+ columnType: "PgText";
5436
+ data: "None" | "Request" | "Reply" | "Cancel" | "Counter" | "Publish";
5437
+ driverParam: string;
5438
+ notNull: true;
5439
+ hasDefault: true;
5440
+ isPrimaryKey: false;
5441
+ isAutoincrement: false;
5442
+ hasRuntimeDefault: false;
5443
+ enumValues: [string, ...string[]];
5444
+ baseColumn: never;
5445
+ identity: undefined;
5446
+ generated: undefined;
5447
+ }, {}, {
5448
+ $type: "None" | "Request" | "Reply" | "Cancel" | "Counter" | "Publish";
5449
+ }>;
5450
+ source: import("drizzle-orm/pg-core").PgColumn<{
5451
+ name: "source";
5452
+ tableName: "calendar_suggestion";
5453
+ dataType: "string";
5454
+ columnType: "PgText";
5455
+ data: "IcalendarPart" | "IcalendarAttachment" | "TextHeuristic";
5456
+ driverParam: string;
5457
+ notNull: true;
5458
+ hasDefault: true;
5459
+ isPrimaryKey: false;
5460
+ isAutoincrement: false;
5461
+ hasRuntimeDefault: false;
5462
+ enumValues: [string, ...string[]];
5463
+ baseColumn: never;
5464
+ identity: undefined;
5465
+ generated: undefined;
5466
+ }, {}, {
5467
+ $type: "IcalendarPart" | "IcalendarAttachment" | "TextHeuristic";
5468
+ }>;
5469
+ state: import("drizzle-orm/pg-core").PgColumn<{
5470
+ name: "state";
5471
+ tableName: "calendar_suggestion";
5472
+ dataType: "string";
5473
+ columnType: "PgText";
5474
+ data: "Pending" | "Tentative" | "Accepted" | "Declined" | "Dismissed" | "Superseded";
5475
+ driverParam: string;
5476
+ notNull: true;
5477
+ hasDefault: true;
5478
+ isPrimaryKey: false;
5479
+ isAutoincrement: false;
5480
+ hasRuntimeDefault: false;
5481
+ enumValues: [string, ...string[]];
5482
+ baseColumn: never;
5483
+ identity: undefined;
5484
+ generated: undefined;
5485
+ }, {}, {
5486
+ $type: "Pending" | "Tentative" | "Accepted" | "Declined" | "Dismissed" | "Superseded";
5487
+ }>;
5488
+ summary: import("drizzle-orm/pg-core").PgColumn<{
5489
+ name: "summary";
5490
+ tableName: "calendar_suggestion";
5491
+ dataType: "string";
5492
+ columnType: "PgText";
5493
+ data: string;
5494
+ driverParam: string;
5495
+ notNull: true;
5496
+ hasDefault: false;
5497
+ isPrimaryKey: false;
5498
+ isAutoincrement: false;
5499
+ hasRuntimeDefault: false;
5500
+ enumValues: [string, ...string[]];
5501
+ baseColumn: never;
5502
+ identity: undefined;
5503
+ generated: undefined;
5504
+ }, {}, {}>;
5505
+ dtStart: import("drizzle-orm/pg-core").PgColumn<{
5506
+ name: "dt_start";
5507
+ tableName: "calendar_suggestion";
5508
+ dataType: "string";
5509
+ columnType: "PgText";
5510
+ data: string;
5511
+ driverParam: string;
5512
+ notNull: true;
5513
+ hasDefault: false;
5514
+ isPrimaryKey: false;
5515
+ isAutoincrement: false;
5516
+ hasRuntimeDefault: false;
5517
+ enumValues: [string, ...string[]];
5518
+ baseColumn: never;
5519
+ identity: undefined;
5520
+ generated: undefined;
5521
+ }, {}, {}>;
5522
+ dtEnd: import("drizzle-orm/pg-core").PgColumn<{
5523
+ name: "dt_end";
5524
+ tableName: "calendar_suggestion";
5525
+ dataType: "string";
5526
+ columnType: "PgText";
5527
+ data: string;
5528
+ driverParam: string;
5529
+ notNull: true;
5530
+ hasDefault: false;
5531
+ isPrimaryKey: false;
5532
+ isAutoincrement: false;
5533
+ hasRuntimeDefault: false;
5534
+ enumValues: [string, ...string[]];
5535
+ baseColumn: never;
5536
+ identity: undefined;
5537
+ generated: undefined;
5538
+ }, {}, {}>;
5539
+ allDay: import("drizzle-orm/pg-core").PgColumn<{
5540
+ name: "all_day";
5541
+ tableName: "calendar_suggestion";
5542
+ dataType: "boolean";
5543
+ columnType: "PgBoolean";
5544
+ data: boolean;
5545
+ driverParam: boolean;
5546
+ notNull: true;
5547
+ hasDefault: true;
5548
+ isPrimaryKey: false;
5549
+ isAutoincrement: false;
5550
+ hasRuntimeDefault: false;
5551
+ enumValues: undefined;
5552
+ baseColumn: never;
5553
+ identity: undefined;
5554
+ generated: undefined;
5555
+ }, {}, {}>;
5556
+ location: import("drizzle-orm/pg-core").PgColumn<{
5557
+ name: "location";
5558
+ tableName: "calendar_suggestion";
5559
+ dataType: "string";
5560
+ columnType: "PgText";
5561
+ data: string;
5562
+ driverParam: string;
5563
+ notNull: true;
5564
+ hasDefault: true;
5565
+ isPrimaryKey: false;
5566
+ isAutoincrement: false;
5567
+ hasRuntimeDefault: false;
5568
+ enumValues: [string, ...string[]];
5569
+ baseColumn: never;
5570
+ identity: undefined;
5571
+ generated: undefined;
5572
+ }, {}, {}>;
5573
+ organizer: import("drizzle-orm/pg-core").PgColumn<{
5574
+ name: "organizer";
5575
+ tableName: "calendar_suggestion";
5576
+ dataType: "string";
5577
+ columnType: "PgText";
5578
+ data: string;
5579
+ driverParam: string;
5580
+ notNull: true;
5581
+ hasDefault: true;
5582
+ isPrimaryKey: false;
5583
+ isAutoincrement: false;
5584
+ hasRuntimeDefault: false;
5585
+ enumValues: [string, ...string[]];
5586
+ baseColumn: never;
5587
+ identity: undefined;
5588
+ generated: undefined;
5589
+ }, {}, {}>;
5590
+ zoneCertainty: import("drizzle-orm/pg-core").PgColumn<{
5591
+ name: "zone_certainty";
5592
+ tableName: "calendar_suggestion";
5593
+ dataType: "string";
5594
+ columnType: "PgText";
5595
+ data: "Local" | "Explicit" | "Ambiguous";
5596
+ driverParam: string;
5597
+ notNull: true;
5598
+ hasDefault: true;
5599
+ isPrimaryKey: false;
5600
+ isAutoincrement: false;
5601
+ hasRuntimeDefault: false;
5602
+ enumValues: [string, ...string[]];
5603
+ baseColumn: never;
5604
+ identity: undefined;
5605
+ generated: undefined;
5606
+ }, {}, {
5607
+ $type: "Local" | "Explicit" | "Ambiguous";
5608
+ }>;
5609
+ icalData: import("drizzle-orm/pg-core").PgColumn<{
5610
+ name: "ical_data";
5611
+ tableName: "calendar_suggestion";
5612
+ dataType: "string";
5613
+ columnType: "PgText";
5614
+ data: string;
5615
+ driverParam: string;
5616
+ notNull: true;
5617
+ hasDefault: true;
5618
+ isPrimaryKey: false;
5619
+ isAutoincrement: false;
5620
+ hasRuntimeDefault: false;
5621
+ enumValues: [string, ...string[]];
5622
+ baseColumn: never;
5623
+ identity: undefined;
5624
+ generated: undefined;
5625
+ }, {}, {}>;
5626
+ acceptedCalendarObjectId: import("drizzle-orm/pg-core").PgColumn<{
5627
+ name: "accepted_calendar_object_id";
5628
+ tableName: "calendar_suggestion";
5629
+ dataType: "string";
5630
+ columnType: "PgText";
5631
+ data: string;
5632
+ driverParam: string;
5633
+ notNull: true;
5634
+ hasDefault: true;
5635
+ isPrimaryKey: false;
5636
+ isAutoincrement: false;
5637
+ hasRuntimeDefault: false;
5638
+ enumValues: [string, ...string[]];
5639
+ baseColumn: never;
5640
+ identity: undefined;
5641
+ generated: undefined;
5642
+ }, {}, {}>;
5643
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
5644
+ name: "created_at";
5645
+ tableName: "calendar_suggestion";
5646
+ dataType: "number";
5647
+ columnType: "PgBigInt53";
5648
+ data: number;
5649
+ driverParam: string | number;
5650
+ notNull: true;
5651
+ hasDefault: false;
5652
+ isPrimaryKey: false;
5653
+ isAutoincrement: false;
5654
+ hasRuntimeDefault: false;
5655
+ enumValues: undefined;
5656
+ baseColumn: never;
5657
+ identity: undefined;
5658
+ generated: undefined;
5659
+ }, {}, {}>;
5660
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
5661
+ name: "updated_at";
5662
+ tableName: "calendar_suggestion";
5663
+ dataType: "number";
5664
+ columnType: "PgBigInt53";
5665
+ data: number;
5666
+ driverParam: string | number;
5667
+ notNull: true;
5668
+ hasDefault: false;
5669
+ isPrimaryKey: false;
5670
+ isAutoincrement: false;
5671
+ hasRuntimeDefault: false;
5672
+ enumValues: undefined;
5673
+ baseColumn: never;
5674
+ identity: undefined;
5675
+ generated: undefined;
5676
+ }, {}, {}>;
5677
+ };
5678
+ dialect: "pg";
5679
+ }>;
5325
5680
  export declare const envelopeAddresses: import("drizzle-orm/pg-core").PgTableWithColumns<{
5326
5681
  name: "envelope_address";
5327
5682
  schema: undefined;
package/dist/schema.js CHANGED
@@ -377,6 +377,32 @@ export const messageReferences = pgTable("message_reference", {
377
377
  }, (table) => [
378
378
  index("message_reference_by_message_id").on(table.messageId, table.messageReferenceId),
379
379
  ]);
380
+ export const calendarSuggestions = pgTable("calendar_suggestion", {
381
+ suggestionId: text("suggestion_id").notNull(),
382
+ accountConfigId: text("account_config_id").notNull(),
383
+ messageId: text("message_id").notNull(),
384
+ bodyPartId: text("body_part_id").notNull(),
385
+ icalUid: text("ical_uid").notNull(),
386
+ sequence: integer("sequence").notNull().default(0),
387
+ method: text("method").$type().notNull().default("None"),
388
+ source: text("source").$type().notNull().default("IcalendarPart"),
389
+ state: text("state").$type().notNull().default("Pending"),
390
+ summary: text("summary").notNull(),
391
+ dtStart: text("dt_start").notNull(),
392
+ dtEnd: text("dt_end").notNull(),
393
+ allDay: boolean("all_day").notNull().default(false),
394
+ location: text("location").notNull().default(""),
395
+ organizer: text("organizer").notNull().default(""),
396
+ zoneCertainty: text("zone_certainty").$type().notNull().default("Explicit"),
397
+ icalData: text("ical_data").notNull().default(""),
398
+ acceptedCalendarObjectId: text("accepted_calendar_object_id").notNull().default(""),
399
+ createdAt: bigint("created_at", { mode: "number" }).notNull(),
400
+ updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
401
+ }, (table) => [
402
+ primaryKey({ name: "calendar_suggestion_pk", columns: [table.accountConfigId, table.suggestionId] }),
403
+ index("calendar_suggestion_by_state").on(table.accountConfigId, table.state, table.createdAt, table.suggestionId),
404
+ index("calendar_suggestion_by_message").on(table.accountConfigId, table.messageId, table.suggestionId),
405
+ ]);
380
406
  export const envelopeAddresses = pgTable("envelope_address", {
381
407
  envelopeAddressId: text("envelope_address_id").primaryKey().$defaultFn(() => generateBase36Id()),
382
408
  messageId: text("message_id").notNull(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/drizzle-pg-schema",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/schema.ts CHANGED
@@ -463,6 +463,37 @@ export const messageReferences = pgTable(
463
463
  ],
464
464
  );
465
465
 
466
+ export const calendarSuggestions = pgTable(
467
+ "calendar_suggestion",
468
+ {
469
+ suggestionId: text("suggestion_id").notNull(),
470
+ accountConfigId: text("account_config_id").notNull(),
471
+ messageId: text("message_id").notNull(),
472
+ bodyPartId: text("body_part_id").notNull(),
473
+ icalUid: text("ical_uid").notNull(),
474
+ sequence: integer("sequence").notNull().default(0),
475
+ method: text("method").$type<"Request" | "Reply" | "Cancel" | "Counter" | "Publish" | "None">().notNull().default("None"),
476
+ source: text("source").$type<"IcalendarPart" | "IcalendarAttachment" | "TextHeuristic">().notNull().default("IcalendarPart"),
477
+ state: text("state").$type<"Pending" | "Accepted" | "Declined" | "Tentative" | "Dismissed" | "Superseded">().notNull().default("Pending"),
478
+ summary: text("summary").notNull(),
479
+ dtStart: text("dt_start").notNull(),
480
+ dtEnd: text("dt_end").notNull(),
481
+ allDay: boolean("all_day").notNull().default(false),
482
+ location: text("location").notNull().default(""),
483
+ organizer: text("organizer").notNull().default(""),
484
+ zoneCertainty: text("zone_certainty").$type<"Local" | "Explicit" | "Ambiguous">().notNull().default("Explicit"),
485
+ icalData: text("ical_data").notNull().default(""),
486
+ acceptedCalendarObjectId: text("accepted_calendar_object_id").notNull().default(""),
487
+ createdAt: bigint("created_at", { mode: "number" }).notNull(),
488
+ updatedAt: bigint("updated_at", { mode: "number" }).notNull(),
489
+ },
490
+ (table) => [
491
+ primaryKey({ name: "calendar_suggestion_pk", columns: [table.accountConfigId, table.suggestionId] }),
492
+ index("calendar_suggestion_by_state").on(table.accountConfigId, table.state, table.createdAt, table.suggestionId),
493
+ index("calendar_suggestion_by_message").on(table.accountConfigId, table.messageId, table.suggestionId),
494
+ ],
495
+ );
496
+
466
497
  export const envelopeAddresses = pgTable(
467
498
  "envelope_address",
468
499
  {