@happyvertical/smrt-messages 0.40.70 → 0.42.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.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-messages",
5
- "packageVersion": "0.40.70",
5
+ "packageVersion": "0.42.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-messages:AccountCollection": {
8
8
  "name": "accountcollection",
@@ -157,12 +157,6 @@
157
157
  }
158
158
  },
159
159
  "indexes": [
160
- {
161
- "name": "account_collections_id_idx",
162
- "columns": [
163
- "id"
164
- ]
165
- },
166
160
  {
167
161
  "name": "account_collections_slug_context_idx",
168
162
  "columns": [
@@ -170,6 +164,12 @@
170
164
  "context"
171
165
  ],
172
166
  "unique": true
167
+ },
168
+ {
169
+ "name": "account_collections_created_at_idx",
170
+ "columns": [
171
+ "created_at"
172
+ ]
173
173
  }
174
174
  ],
175
175
  "version": "766c026b"
@@ -427,12 +427,6 @@
427
427
  }
428
428
  },
429
429
  "indexes": [
430
- {
431
- "name": "attachment_collections_id_idx",
432
- "columns": [
433
- "id"
434
- ]
435
- },
436
430
  {
437
431
  "name": "attachment_collections_slug_context_idx",
438
432
  "columns": [
@@ -440,6 +434,12 @@
440
434
  "context"
441
435
  ],
442
436
  "unique": true
437
+ },
438
+ {
439
+ "name": "attachment_collections_created_at_idx",
440
+ "columns": [
441
+ "created_at"
442
+ ]
443
443
  }
444
444
  ],
445
445
  "version": "d1da2552"
@@ -519,12 +519,6 @@
519
519
  }
520
520
  },
521
521
  "indexes": [
522
- {
523
- "name": "blacklist_collections_id_idx",
524
- "columns": [
525
- "id"
526
- ]
527
- },
528
522
  {
529
523
  "name": "blacklist_collections_slug_context_idx",
530
524
  "columns": [
@@ -532,6 +526,12 @@
532
526
  "context"
533
527
  ],
534
528
  "unique": true
529
+ },
530
+ {
531
+ "name": "blacklist_collections_created_at_idx",
532
+ "columns": [
533
+ "created_at"
534
+ ]
535
535
  }
536
536
  ],
537
537
  "version": "4858f9dc"
@@ -768,12 +768,6 @@
768
768
  }
769
769
  },
770
770
  "indexes": [
771
- {
772
- "name": "accounts_id_idx",
773
- "columns": [
774
- "id"
775
- ]
776
- },
777
771
  {
778
772
  "name": "accounts_slug_context_idx",
779
773
  "columns": [
@@ -781,6 +775,12 @@
781
775
  "context"
782
776
  ],
783
777
  "unique": true
778
+ },
779
+ {
780
+ "name": "accounts_created_at_idx",
781
+ "columns": [
782
+ "created_at"
783
+ ]
784
784
  }
785
785
  ],
786
786
  "version": "334b9255"
@@ -951,12 +951,6 @@
951
951
  }
952
952
  },
953
953
  "indexes": [
954
- {
955
- "name": "email_attachment_collections_id_idx",
956
- "columns": [
957
- "id"
958
- ]
959
- },
960
954
  {
961
955
  "name": "email_attachment_collections_slug_context_idx",
962
956
  "columns": [
@@ -964,6 +958,12 @@
964
958
  "context"
965
959
  ],
966
960
  "unique": true
961
+ },
962
+ {
963
+ "name": "email_attachment_collections_created_at_idx",
964
+ "columns": [
965
+ "created_at"
966
+ ]
967
967
  }
968
968
  ],
969
969
  "version": "87738bdf"
@@ -1296,12 +1296,6 @@
1296
1296
  }
1297
1297
  },
1298
1298
  "indexes": [
1299
- {
1300
- "name": "messages_id_idx",
1301
- "columns": [
1302
- "id"
1303
- ]
1304
- },
1305
1299
  {
1306
1300
  "name": "messages_slug_context_idx",
1307
1301
  "columns": [
@@ -1309,6 +1303,12 @@
1309
1303
  "context"
1310
1304
  ],
1311
1305
  "unique": true
1306
+ },
1307
+ {
1308
+ "name": "messages_created_at_idx",
1309
+ "columns": [
1310
+ "created_at"
1311
+ ]
1312
1312
  }
1313
1313
  ],
1314
1314
  "version": "ef481539"
@@ -1616,12 +1616,6 @@
1616
1616
  }
1617
1617
  },
1618
1618
  "indexes": [
1619
- {
1620
- "name": "email_folder_collections_id_idx",
1621
- "columns": [
1622
- "id"
1623
- ]
1624
- },
1625
1619
  {
1626
1620
  "name": "email_folder_collections_slug_context_idx",
1627
1621
  "columns": [
@@ -1629,6 +1623,12 @@
1629
1623
  "context"
1630
1624
  ],
1631
1625
  "unique": true
1626
+ },
1627
+ {
1628
+ "name": "email_folder_collections_created_at_idx",
1629
+ "columns": [
1630
+ "created_at"
1631
+ ]
1632
1632
  }
1633
1633
  ],
1634
1634
  "version": "05c924b1"
@@ -1922,12 +1922,6 @@
1922
1922
  }
1923
1923
  },
1924
1924
  "indexes": [
1925
- {
1926
- "name": "message_collections_id_idx",
1927
- "columns": [
1928
- "id"
1929
- ]
1930
- },
1931
1925
  {
1932
1926
  "name": "message_collections_slug_context_idx",
1933
1927
  "columns": [
@@ -1935,6 +1929,12 @@
1935
1929
  "context"
1936
1930
  ],
1937
1931
  "unique": true
1932
+ },
1933
+ {
1934
+ "name": "message_collections_created_at_idx",
1935
+ "columns": [
1936
+ "created_at"
1937
+ ]
1938
1938
  }
1939
1939
  ],
1940
1940
  "version": "c3d5333a"
@@ -1987,12 +1987,6 @@
1987
1987
  }
1988
1988
  },
1989
1989
  "indexes": [
1990
- {
1991
- "name": "messaging_endpoints_id_idx",
1992
- "columns": [
1993
- "id"
1994
- ]
1995
- },
1996
1990
  {
1997
1991
  "name": "messaging_endpoints_slug_context_idx",
1998
1992
  "columns": [
@@ -2000,6 +1994,12 @@
2000
1994
  "context"
2001
1995
  ],
2002
1996
  "unique": true
1997
+ },
1998
+ {
1999
+ "name": "messaging_endpoints_created_at_idx",
2000
+ "columns": [
2001
+ "created_at"
2002
+ ]
2003
2003
  }
2004
2004
  ],
2005
2005
  "version": "82876ebf"
@@ -2067,12 +2067,6 @@
2067
2067
  }
2068
2068
  },
2069
2069
  "indexes": [
2070
- {
2071
- "name": "persona_message_routes_id_idx",
2072
- "columns": [
2073
- "id"
2074
- ]
2075
- },
2076
2070
  {
2077
2071
  "name": "persona_message_routes_slug_context_idx",
2078
2072
  "columns": [
@@ -2080,6 +2074,12 @@
2080
2074
  "context"
2081
2075
  ],
2082
2076
  "unique": true
2077
+ },
2078
+ {
2079
+ "name": "persona_message_routes_created_at_idx",
2080
+ "columns": [
2081
+ "created_at"
2082
+ ]
2083
2083
  }
2084
2084
  ],
2085
2085
  "version": "334a1910"
@@ -2178,12 +2178,6 @@
2178
2178
  }
2179
2179
  },
2180
2180
  "indexes": [
2181
- {
2182
- "name": "whitelist_collections_id_idx",
2183
- "columns": [
2184
- "id"
2185
- ]
2186
- },
2187
2181
  {
2188
2182
  "name": "whitelist_collections_slug_context_idx",
2189
2183
  "columns": [
@@ -2191,6 +2185,12 @@
2191
2185
  "context"
2192
2186
  ],
2193
2187
  "unique": true
2188
+ },
2189
+ {
2190
+ "name": "whitelist_collections_created_at_idx",
2191
+ "columns": [
2192
+ "created_at"
2193
+ ]
2194
2194
  }
2195
2195
  ],
2196
2196
  "version": "db7e0e92"
@@ -2892,7 +2892,13 @@
2892
2892
  },
2893
2893
  "tenantScoped": {
2894
2894
  "mode": "optional"
2895
- }
2895
+ },
2896
+ "conflictColumns": [
2897
+ "tenant_id",
2898
+ "slug",
2899
+ "context",
2900
+ "_meta_type"
2901
+ ]
2896
2902
  },
2897
2903
  "extends": "SmrtObject",
2898
2904
  "exportName": "Account",
@@ -3010,15 +3016,10 @@
3010
3016
  }
3011
3017
  },
3012
3018
  "indexes": [
3013
- {
3014
- "name": "accounts_id_idx",
3015
- "columns": [
3016
- "id"
3017
- ]
3018
- },
3019
3019
  {
3020
3020
  "name": "accounts_slug_context_meta_type_idx",
3021
3021
  "columns": [
3022
+ "tenant_id",
3022
3023
  "slug",
3023
3024
  "context",
3024
3025
  "_meta_type"
@@ -3032,9 +3033,10 @@
3032
3033
  ]
3033
3034
  },
3034
3035
  {
3035
- "name": "accounts_tenant_id_idx",
3036
+ "name": "accounts_tenant_id_created_at_idx",
3036
3037
  "columns": [
3037
- "tenant_id"
3038
+ "tenant_id",
3039
+ "created_at"
3038
3040
  ]
3039
3041
  }
3040
3042
  ],
@@ -3191,7 +3193,12 @@
3191
3193
  "cli": true,
3192
3194
  "tenantScoped": {
3193
3195
  "mode": "optional"
3194
- }
3196
+ },
3197
+ "conflictColumns": [
3198
+ "tenant_id",
3199
+ "slug",
3200
+ "context"
3201
+ ]
3195
3202
  },
3196
3203
  "extends": "SmrtObject",
3197
3204
  "exportName": "Attachment",
@@ -3283,24 +3290,26 @@
3283
3290
  }
3284
3291
  },
3285
3292
  "indexes": [
3286
- {
3287
- "name": "attachments_id_idx",
3288
- "columns": [
3289
- "id"
3290
- ]
3291
- },
3292
3293
  {
3293
3294
  "name": "attachments_slug_context_idx",
3294
3295
  "columns": [
3296
+ "tenant_id",
3295
3297
  "slug",
3296
3298
  "context"
3297
3299
  ],
3298
3300
  "unique": true
3299
3301
  },
3300
3302
  {
3301
- "name": "attachments_tenant_id_idx",
3303
+ "name": "attachments_tenant_id_created_at_idx",
3304
+ "columns": [
3305
+ "tenant_id",
3306
+ "created_at"
3307
+ ]
3308
+ },
3309
+ {
3310
+ "name": "attachments_message_id_idx",
3302
3311
  "columns": [
3303
- "tenant_id"
3312
+ "message_id"
3304
3313
  ]
3305
3314
  }
3306
3315
  ],
@@ -3380,7 +3389,12 @@
3380
3389
  ]
3381
3390
  },
3382
3391
  "cli": true,
3383
- "tenantScoped": true
3392
+ "tenantScoped": true,
3393
+ "conflictColumns": [
3394
+ "tenant_id",
3395
+ "slug",
3396
+ "context"
3397
+ ]
3384
3398
  },
3385
3399
  "extends": "SmrtObject",
3386
3400
  "exportName": "Blacklist",
@@ -3446,24 +3460,20 @@
3446
3460
  }
3447
3461
  },
3448
3462
  "indexes": [
3449
- {
3450
- "name": "blacklists_id_idx",
3451
- "columns": [
3452
- "id"
3453
- ]
3454
- },
3455
3463
  {
3456
3464
  "name": "blacklists_slug_context_idx",
3457
3465
  "columns": [
3466
+ "tenant_id",
3458
3467
  "slug",
3459
3468
  "context"
3460
3469
  ],
3461
3470
  "unique": true
3462
3471
  },
3463
3472
  {
3464
- "name": "blacklists_tenant_id_idx",
3473
+ "name": "blacklists_tenant_id_created_at_idx",
3465
3474
  "columns": [
3466
- "tenant_id"
3475
+ "tenant_id",
3476
+ "created_at"
3467
3477
  ]
3468
3478
  }
3469
3479
  ],
@@ -4518,7 +4528,7 @@
4518
4528
  ],
4519
4529
  "schema": {
4520
4530
  "tableName": "messages",
4521
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT\n);",
4531
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
4522
4532
  "columns": {
4523
4533
  "id": {
4524
4534
  "type": "UUID",
@@ -4726,18 +4736,87 @@
4726
4736
  "headers": {
4727
4737
  "type": "TEXT",
4728
4738
  "notNull": false
4739
+ },
4740
+ "channel_id": {
4741
+ "type": "TEXT",
4742
+ "notNull": false
4743
+ },
4744
+ "channel_name": {
4745
+ "type": "TEXT",
4746
+ "notNull": false
4747
+ },
4748
+ "slack_ts": {
4749
+ "type": "TEXT",
4750
+ "notNull": false
4751
+ },
4752
+ "slack_thread_ts": {
4753
+ "type": "TEXT",
4754
+ "notNull": false
4755
+ },
4756
+ "reactions": {
4757
+ "type": "TEXT",
4758
+ "notNull": false
4759
+ },
4760
+ "is_edited": {
4761
+ "type": "BOOLEAN",
4762
+ "notNull": false,
4763
+ "default": false
4764
+ },
4765
+ "message_type": {
4766
+ "type": "TEXT",
4767
+ "notNull": false
4768
+ },
4769
+ "blocks": {
4770
+ "type": "TEXT",
4771
+ "notNull": false
4772
+ },
4773
+ "tweet_id": {
4774
+ "type": "TEXT",
4775
+ "notNull": false
4776
+ },
4777
+ "retweet_count": {
4778
+ "type": "INTEGER",
4779
+ "notNull": false,
4780
+ "default": 0
4781
+ },
4782
+ "like_count": {
4783
+ "type": "INTEGER",
4784
+ "notNull": false,
4785
+ "default": 0
4786
+ },
4787
+ "reply_count": {
4788
+ "type": "INTEGER",
4789
+ "notNull": false,
4790
+ "default": 0
4791
+ },
4792
+ "is_retweet": {
4793
+ "type": "BOOLEAN",
4794
+ "notNull": false,
4795
+ "default": false
4796
+ },
4797
+ "is_reply": {
4798
+ "type": "BOOLEAN",
4799
+ "notNull": false,
4800
+ "default": false
4801
+ },
4802
+ "media_urls": {
4803
+ "type": "TEXT",
4804
+ "notNull": false
4805
+ },
4806
+ "hashtags": {
4807
+ "type": "TEXT",
4808
+ "notNull": false
4809
+ },
4810
+ "mentions": {
4811
+ "type": "TEXT",
4812
+ "notNull": false
4729
4813
  }
4730
4814
  },
4731
4815
  "indexes": [
4732
- {
4733
- "name": "messages_id_idx",
4734
- "columns": [
4735
- "id"
4736
- ]
4737
- },
4738
4816
  {
4739
4817
  "name": "messages_slug_context_meta_type_idx",
4740
4818
  "columns": [
4819
+ "tenant_id",
4741
4820
  "slug",
4742
4821
  "context",
4743
4822
  "_meta_type"
@@ -4751,13 +4830,38 @@
4751
4830
  ]
4752
4831
  },
4753
4832
  {
4754
- "name": "messages_tenant_id_idx",
4833
+ "name": "messages_tenant_id_created_at_idx",
4834
+ "columns": [
4835
+ "tenant_id",
4836
+ "created_at"
4837
+ ]
4838
+ },
4839
+ {
4840
+ "name": "messages_account_id_idx",
4841
+ "columns": [
4842
+ "account_id"
4843
+ ]
4844
+ },
4845
+ {
4846
+ "name": "messages_persona_id_idx",
4847
+ "columns": [
4848
+ "persona_id"
4849
+ ]
4850
+ },
4851
+ {
4852
+ "name": "messages_endpoint_id_idx",
4853
+ "columns": [
4854
+ "endpoint_id"
4855
+ ]
4856
+ },
4857
+ {
4858
+ "name": "messages_in_reply_to_message_id_idx",
4755
4859
  "columns": [
4756
- "tenant_id"
4860
+ "in_reply_to_message_id"
4757
4861
  ]
4758
4862
  }
4759
4863
  ],
4760
- "version": "665916f6"
4864
+ "version": "e535c8c6"
4761
4865
  }
4762
4866
  },
4763
4867
  "@happyvertical/smrt-messages:EmailAccount": {
@@ -5553,7 +5657,7 @@
5553
5657
  ],
5554
5658
  "schema": {
5555
5659
  "tableName": "accounts",
5556
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60\n);",
5660
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
5557
5661
  "columns": {
5558
5662
  "id": {
5559
5663
  "type": "UUID",
@@ -5634,18 +5738,33 @@
5634
5738
  "type": "INTEGER",
5635
5739
  "notNull": false,
5636
5740
  "default": 60
5741
+ },
5742
+ "workspace_id": {
5743
+ "type": "TEXT",
5744
+ "notNull": false
5745
+ },
5746
+ "workspace_name": {
5747
+ "type": "TEXT",
5748
+ "notNull": false
5749
+ },
5750
+ "bot_user_id": {
5751
+ "type": "TEXT",
5752
+ "notNull": false
5753
+ },
5754
+ "handle": {
5755
+ "type": "TEXT",
5756
+ "notNull": false
5757
+ },
5758
+ "twitter_user_id": {
5759
+ "type": "TEXT",
5760
+ "notNull": false
5637
5761
  }
5638
5762
  },
5639
5763
  "indexes": [
5640
- {
5641
- "name": "accounts_id_idx",
5642
- "columns": [
5643
- "id"
5644
- ]
5645
- },
5646
5764
  {
5647
5765
  "name": "accounts_slug_context_meta_type_idx",
5648
5766
  "columns": [
5767
+ "tenant_id",
5649
5768
  "slug",
5650
5769
  "context",
5651
5770
  "_meta_type"
@@ -5659,13 +5778,14 @@
5659
5778
  ]
5660
5779
  },
5661
5780
  {
5662
- "name": "accounts_tenant_id_idx",
5781
+ "name": "accounts_tenant_id_created_at_idx",
5663
5782
  "columns": [
5664
- "tenant_id"
5783
+ "tenant_id",
5784
+ "created_at"
5665
5785
  ]
5666
5786
  }
5667
5787
  ],
5668
- "version": "54e69e81"
5788
+ "version": "3854ea98"
5669
5789
  }
5670
5790
  },
5671
5791
  "@happyvertical/smrt-messages:EmailAttachment": {
@@ -5721,12 +5841,6 @@
5721
5841
  }
5722
5842
  },
5723
5843
  "indexes": [
5724
- {
5725
- "name": "email_attachments_id_idx",
5726
- "columns": [
5727
- "id"
5728
- ]
5729
- },
5730
5844
  {
5731
5845
  "name": "email_attachments_slug_context_idx",
5732
5846
  "columns": [
@@ -5734,6 +5848,12 @@
5734
5848
  "context"
5735
5849
  ],
5736
5850
  "unique": true
5851
+ },
5852
+ {
5853
+ "name": "email_attachments_created_at_idx",
5854
+ "columns": [
5855
+ "created_at"
5856
+ ]
5737
5857
  }
5738
5858
  ],
5739
5859
  "version": "70291c59"
@@ -5939,8 +6059,13 @@
5939
6059
  "cli": true,
5940
6060
  "tenantScoped": {
5941
6061
  "mode": "optional"
5942
- }
5943
- },
6062
+ },
6063
+ "conflictColumns": [
6064
+ "tenant_id",
6065
+ "slug",
6066
+ "context"
6067
+ ]
6068
+ },
5944
6069
  "extends": "SmrtObject",
5945
6070
  "exportName": "EmailFolder",
5946
6071
  "collectionExportName": "EmailFolderCollection",
@@ -6042,24 +6167,26 @@
6042
6167
  }
6043
6168
  },
6044
6169
  "indexes": [
6045
- {
6046
- "name": "email_folders_id_idx",
6047
- "columns": [
6048
- "id"
6049
- ]
6050
- },
6051
6170
  {
6052
6171
  "name": "email_folders_slug_context_idx",
6053
6172
  "columns": [
6173
+ "tenant_id",
6054
6174
  "slug",
6055
6175
  "context"
6056
6176
  ],
6057
6177
  "unique": true
6058
6178
  },
6059
6179
  {
6060
- "name": "email_folders_tenant_id_idx",
6180
+ "name": "email_folders_tenant_id_created_at_idx",
6061
6181
  "columns": [
6062
- "tenant_id"
6182
+ "tenant_id",
6183
+ "created_at"
6184
+ ]
6185
+ },
6186
+ {
6187
+ "name": "email_folders_account_id_idx",
6188
+ "columns": [
6189
+ "account_id"
6063
6190
  ]
6064
6191
  }
6065
6192
  ],
@@ -6895,7 +7022,13 @@
6895
7022
  "cli": true,
6896
7023
  "tenantScoped": {
6897
7024
  "mode": "optional"
6898
- }
7025
+ },
7026
+ "conflictColumns": [
7027
+ "tenant_id",
7028
+ "slug",
7029
+ "context",
7030
+ "_meta_type"
7031
+ ]
6899
7032
  },
6900
7033
  "extends": "SmrtObject",
6901
7034
  "exportName": "Message",
@@ -7219,15 +7352,10 @@
7219
7352
  }
7220
7353
  },
7221
7354
  "indexes": [
7222
- {
7223
- "name": "messages_id_idx",
7224
- "columns": [
7225
- "id"
7226
- ]
7227
- },
7228
7355
  {
7229
7356
  "name": "messages_slug_context_meta_type_idx",
7230
7357
  "columns": [
7358
+ "tenant_id",
7231
7359
  "slug",
7232
7360
  "context",
7233
7361
  "_meta_type"
@@ -7241,9 +7369,34 @@
7241
7369
  ]
7242
7370
  },
7243
7371
  {
7244
- "name": "messages_tenant_id_idx",
7372
+ "name": "messages_tenant_id_created_at_idx",
7373
+ "columns": [
7374
+ "tenant_id",
7375
+ "created_at"
7376
+ ]
7377
+ },
7378
+ {
7379
+ "name": "messages_account_id_idx",
7380
+ "columns": [
7381
+ "account_id"
7382
+ ]
7383
+ },
7384
+ {
7385
+ "name": "messages_persona_id_idx",
7386
+ "columns": [
7387
+ "persona_id"
7388
+ ]
7389
+ },
7390
+ {
7391
+ "name": "messages_endpoint_id_idx",
7245
7392
  "columns": [
7246
- "tenant_id"
7393
+ "endpoint_id"
7394
+ ]
7395
+ },
7396
+ {
7397
+ "name": "messages_in_reply_to_message_id_idx",
7398
+ "columns": [
7399
+ "in_reply_to_message_id"
7247
7400
  ]
7248
7401
  }
7249
7402
  ],
@@ -7486,12 +7639,6 @@
7486
7639
  }
7487
7640
  },
7488
7641
  "indexes": [
7489
- {
7490
- "name": "messaging_endpoints_id_idx",
7491
- "columns": [
7492
- "id"
7493
- ]
7494
- },
7495
7642
  {
7496
7643
  "name": "messaging_endpoints_tenant_id_channel_idx",
7497
7644
  "columns": [
@@ -7500,6 +7647,26 @@
7500
7647
  "label"
7501
7648
  ],
7502
7649
  "unique": true
7650
+ },
7651
+ {
7652
+ "name": "messaging_endpoints_slug_context_idx",
7653
+ "columns": [
7654
+ "slug",
7655
+ "context"
7656
+ ]
7657
+ },
7658
+ {
7659
+ "name": "messaging_endpoints_tenant_id_created_at_idx",
7660
+ "columns": [
7661
+ "tenant_id",
7662
+ "created_at"
7663
+ ]
7664
+ },
7665
+ {
7666
+ "name": "messaging_endpoints_profile_id_idx",
7667
+ "columns": [
7668
+ "profile_id"
7669
+ ]
7503
7670
  }
7504
7671
  ],
7505
7672
  "version": "fca5554d"
@@ -7721,12 +7888,6 @@
7721
7888
  }
7722
7889
  },
7723
7890
  "indexes": [
7724
- {
7725
- "name": "persona_message_routes_id_idx",
7726
- "columns": [
7727
- "id"
7728
- ]
7729
- },
7730
7891
  {
7731
7892
  "name": "persona_message_routes_tenant_id_persona_id_idx",
7732
7893
  "columns": [
@@ -7737,6 +7898,38 @@
7737
7898
  "purpose"
7738
7899
  ],
7739
7900
  "unique": true
7901
+ },
7902
+ {
7903
+ "name": "persona_message_routes_slug_context_idx",
7904
+ "columns": [
7905
+ "slug",
7906
+ "context"
7907
+ ]
7908
+ },
7909
+ {
7910
+ "name": "persona_message_routes_tenant_id_created_at_idx",
7911
+ "columns": [
7912
+ "tenant_id",
7913
+ "created_at"
7914
+ ]
7915
+ },
7916
+ {
7917
+ "name": "persona_message_routes_persona_id_idx",
7918
+ "columns": [
7919
+ "persona_id"
7920
+ ]
7921
+ },
7922
+ {
7923
+ "name": "persona_message_routes_account_id_idx",
7924
+ "columns": [
7925
+ "account_id"
7926
+ ]
7927
+ },
7928
+ {
7929
+ "name": "persona_message_routes_endpoint_id_idx",
7930
+ "columns": [
7931
+ "endpoint_id"
7932
+ ]
7740
7933
  }
7741
7934
  ],
7742
7935
  "version": "8729538d"
@@ -8459,7 +8652,7 @@
8459
8652
  ],
8460
8653
  "schema": {
8461
8654
  "tableName": "accounts",
8462
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT\n);",
8655
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
8463
8656
  "columns": {
8464
8657
  "id": {
8465
8658
  "type": "UUID",
@@ -8532,6 +8725,15 @@
8532
8725
  "type": "TEXT",
8533
8726
  "notNull": false
8534
8727
  },
8728
+ "email": {
8729
+ "type": "TEXT",
8730
+ "notNull": false
8731
+ },
8732
+ "sync_interval_minutes": {
8733
+ "type": "INTEGER",
8734
+ "notNull": false,
8735
+ "default": 60
8736
+ },
8535
8737
  "workspace_id": {
8536
8738
  "type": "TEXT",
8537
8739
  "notNull": false
@@ -8543,18 +8745,21 @@
8543
8745
  "bot_user_id": {
8544
8746
  "type": "TEXT",
8545
8747
  "notNull": false
8748
+ },
8749
+ "handle": {
8750
+ "type": "TEXT",
8751
+ "notNull": false
8752
+ },
8753
+ "twitter_user_id": {
8754
+ "type": "TEXT",
8755
+ "notNull": false
8546
8756
  }
8547
8757
  },
8548
8758
  "indexes": [
8549
- {
8550
- "name": "accounts_id_idx",
8551
- "columns": [
8552
- "id"
8553
- ]
8554
- },
8555
8759
  {
8556
8760
  "name": "accounts_slug_context_meta_type_idx",
8557
8761
  "columns": [
8762
+ "tenant_id",
8558
8763
  "slug",
8559
8764
  "context",
8560
8765
  "_meta_type"
@@ -8568,13 +8773,14 @@
8568
8773
  ]
8569
8774
  },
8570
8775
  {
8571
- "name": "accounts_tenant_id_idx",
8776
+ "name": "accounts_tenant_id_created_at_idx",
8572
8777
  "columns": [
8573
- "tenant_id"
8778
+ "tenant_id",
8779
+ "created_at"
8574
8780
  ]
8575
8781
  }
8576
8782
  ],
8577
- "version": "abd905bd"
8783
+ "version": "3854ea98"
8578
8784
  }
8579
8785
  },
8580
8786
  "@happyvertical/smrt-messages:SlackMessage": {
@@ -9511,7 +9717,7 @@
9511
9717
  ],
9512
9718
  "schema": {
9513
9719
  "tableName": "messages",
9514
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT\n);",
9720
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
9515
9721
  "columns": {
9516
9722
  "id": {
9517
9723
  "type": "UUID",
@@ -9654,6 +9860,72 @@
9654
9860
  "referenceKind": "foreignKey",
9655
9861
  "notNull": false
9656
9862
  },
9863
+ "message_id": {
9864
+ "type": "TEXT",
9865
+ "notNull": false
9866
+ },
9867
+ "in_reply_to": {
9868
+ "type": "TEXT",
9869
+ "notNull": false
9870
+ },
9871
+ "cc_addresses": {
9872
+ "type": "TEXT",
9873
+ "notNull": false
9874
+ },
9875
+ "bcc_addresses": {
9876
+ "type": "TEXT",
9877
+ "notNull": false
9878
+ },
9879
+ "reply_to_address": {
9880
+ "type": "TEXT",
9881
+ "notNull": false
9882
+ },
9883
+ "reply_to_name": {
9884
+ "type": "TEXT",
9885
+ "notNull": false
9886
+ },
9887
+ "text_body": {
9888
+ "type": "TEXT",
9889
+ "notNull": false
9890
+ },
9891
+ "html_body": {
9892
+ "type": "TEXT",
9893
+ "notNull": false
9894
+ },
9895
+ "folder_id": {
9896
+ "type": "TEXT",
9897
+ "notNull": false
9898
+ },
9899
+ "folder_path": {
9900
+ "type": "TEXT",
9901
+ "notNull": false
9902
+ },
9903
+ "labels": {
9904
+ "type": "TEXT",
9905
+ "notNull": false
9906
+ },
9907
+ "flags": {
9908
+ "type": "TEXT",
9909
+ "notNull": false
9910
+ },
9911
+ "is_answered": {
9912
+ "type": "BOOLEAN",
9913
+ "notNull": false,
9914
+ "default": false
9915
+ },
9916
+ "is_draft": {
9917
+ "type": "BOOLEAN",
9918
+ "notNull": false,
9919
+ "default": false
9920
+ },
9921
+ "raw_message": {
9922
+ "type": "TEXT",
9923
+ "notNull": false
9924
+ },
9925
+ "headers": {
9926
+ "type": "TEXT",
9927
+ "notNull": false
9928
+ },
9657
9929
  "channel_id": {
9658
9930
  "type": "TEXT",
9659
9931
  "notNull": false
@@ -9686,18 +9958,54 @@
9686
9958
  "blocks": {
9687
9959
  "type": "TEXT",
9688
9960
  "notNull": false
9961
+ },
9962
+ "tweet_id": {
9963
+ "type": "TEXT",
9964
+ "notNull": false
9965
+ },
9966
+ "retweet_count": {
9967
+ "type": "INTEGER",
9968
+ "notNull": false,
9969
+ "default": 0
9970
+ },
9971
+ "like_count": {
9972
+ "type": "INTEGER",
9973
+ "notNull": false,
9974
+ "default": 0
9975
+ },
9976
+ "reply_count": {
9977
+ "type": "INTEGER",
9978
+ "notNull": false,
9979
+ "default": 0
9980
+ },
9981
+ "is_retweet": {
9982
+ "type": "BOOLEAN",
9983
+ "notNull": false,
9984
+ "default": false
9985
+ },
9986
+ "is_reply": {
9987
+ "type": "BOOLEAN",
9988
+ "notNull": false,
9989
+ "default": false
9990
+ },
9991
+ "media_urls": {
9992
+ "type": "TEXT",
9993
+ "notNull": false
9994
+ },
9995
+ "hashtags": {
9996
+ "type": "TEXT",
9997
+ "notNull": false
9998
+ },
9999
+ "mentions": {
10000
+ "type": "TEXT",
10001
+ "notNull": false
9689
10002
  }
9690
10003
  },
9691
10004
  "indexes": [
9692
- {
9693
- "name": "messages_id_idx",
9694
- "columns": [
9695
- "id"
9696
- ]
9697
- },
9698
10005
  {
9699
10006
  "name": "messages_slug_context_meta_type_idx",
9700
10007
  "columns": [
10008
+ "tenant_id",
9701
10009
  "slug",
9702
10010
  "context",
9703
10011
  "_meta_type"
@@ -9711,13 +10019,38 @@
9711
10019
  ]
9712
10020
  },
9713
10021
  {
9714
- "name": "messages_tenant_id_idx",
10022
+ "name": "messages_tenant_id_created_at_idx",
10023
+ "columns": [
10024
+ "tenant_id",
10025
+ "created_at"
10026
+ ]
10027
+ },
10028
+ {
10029
+ "name": "messages_account_id_idx",
10030
+ "columns": [
10031
+ "account_id"
10032
+ ]
10033
+ },
10034
+ {
10035
+ "name": "messages_persona_id_idx",
10036
+ "columns": [
10037
+ "persona_id"
10038
+ ]
10039
+ },
10040
+ {
10041
+ "name": "messages_endpoint_id_idx",
9715
10042
  "columns": [
9716
- "tenant_id"
10043
+ "endpoint_id"
10044
+ ]
10045
+ },
10046
+ {
10047
+ "name": "messages_in_reply_to_message_id_idx",
10048
+ "columns": [
10049
+ "in_reply_to_message_id"
9717
10050
  ]
9718
10051
  }
9719
10052
  ],
9720
- "version": "ff34e465"
10053
+ "version": "e535c8c6"
9721
10054
  }
9722
10055
  },
9723
10056
  "@happyvertical/smrt-messages:TelegramAccount": {
@@ -10425,7 +10758,7 @@
10425
10758
  ],
10426
10759
  "schema": {
10427
10760
  "tableName": "accounts",
10428
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT\n);",
10761
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
10429
10762
  "columns": {
10430
10763
  "id": {
10431
10764
  "type": "UUID",
@@ -10497,18 +10830,42 @@
10497
10830
  "configuration": {
10498
10831
  "type": "TEXT",
10499
10832
  "notNull": false
10833
+ },
10834
+ "email": {
10835
+ "type": "TEXT",
10836
+ "notNull": false
10837
+ },
10838
+ "sync_interval_minutes": {
10839
+ "type": "INTEGER",
10840
+ "notNull": false,
10841
+ "default": 60
10842
+ },
10843
+ "workspace_id": {
10844
+ "type": "TEXT",
10845
+ "notNull": false
10846
+ },
10847
+ "workspace_name": {
10848
+ "type": "TEXT",
10849
+ "notNull": false
10850
+ },
10851
+ "bot_user_id": {
10852
+ "type": "TEXT",
10853
+ "notNull": false
10854
+ },
10855
+ "handle": {
10856
+ "type": "TEXT",
10857
+ "notNull": false
10858
+ },
10859
+ "twitter_user_id": {
10860
+ "type": "TEXT",
10861
+ "notNull": false
10500
10862
  }
10501
10863
  },
10502
10864
  "indexes": [
10503
- {
10504
- "name": "accounts_id_idx",
10505
- "columns": [
10506
- "id"
10507
- ]
10508
- },
10509
10865
  {
10510
10866
  "name": "accounts_slug_context_meta_type_idx",
10511
10867
  "columns": [
10868
+ "tenant_id",
10512
10869
  "slug",
10513
10870
  "context",
10514
10871
  "_meta_type"
@@ -10522,13 +10879,14 @@
10522
10879
  ]
10523
10880
  },
10524
10881
  {
10525
- "name": "accounts_tenant_id_idx",
10882
+ "name": "accounts_tenant_id_created_at_idx",
10526
10883
  "columns": [
10527
- "tenant_id"
10884
+ "tenant_id",
10885
+ "created_at"
10528
10886
  ]
10529
10887
  }
10530
10888
  ],
10531
- "version": "2ed1a264"
10889
+ "version": "3854ea98"
10532
10890
  }
10533
10891
  },
10534
10892
  "@happyvertical/smrt-messages:Tweet": {
@@ -11493,7 +11851,7 @@
11493
11851
  ],
11494
11852
  "schema": {
11495
11853
  "tableName": "messages",
11496
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
11854
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
11497
11855
  "columns": {
11498
11856
  "id": {
11499
11857
  "type": "UUID",
@@ -11636,6 +11994,105 @@
11636
11994
  "referenceKind": "foreignKey",
11637
11995
  "notNull": false
11638
11996
  },
11997
+ "message_id": {
11998
+ "type": "TEXT",
11999
+ "notNull": false
12000
+ },
12001
+ "in_reply_to": {
12002
+ "type": "TEXT",
12003
+ "notNull": false
12004
+ },
12005
+ "cc_addresses": {
12006
+ "type": "TEXT",
12007
+ "notNull": false
12008
+ },
12009
+ "bcc_addresses": {
12010
+ "type": "TEXT",
12011
+ "notNull": false
12012
+ },
12013
+ "reply_to_address": {
12014
+ "type": "TEXT",
12015
+ "notNull": false
12016
+ },
12017
+ "reply_to_name": {
12018
+ "type": "TEXT",
12019
+ "notNull": false
12020
+ },
12021
+ "text_body": {
12022
+ "type": "TEXT",
12023
+ "notNull": false
12024
+ },
12025
+ "html_body": {
12026
+ "type": "TEXT",
12027
+ "notNull": false
12028
+ },
12029
+ "folder_id": {
12030
+ "type": "TEXT",
12031
+ "notNull": false
12032
+ },
12033
+ "folder_path": {
12034
+ "type": "TEXT",
12035
+ "notNull": false
12036
+ },
12037
+ "labels": {
12038
+ "type": "TEXT",
12039
+ "notNull": false
12040
+ },
12041
+ "flags": {
12042
+ "type": "TEXT",
12043
+ "notNull": false
12044
+ },
12045
+ "is_answered": {
12046
+ "type": "BOOLEAN",
12047
+ "notNull": false,
12048
+ "default": false
12049
+ },
12050
+ "is_draft": {
12051
+ "type": "BOOLEAN",
12052
+ "notNull": false,
12053
+ "default": false
12054
+ },
12055
+ "raw_message": {
12056
+ "type": "TEXT",
12057
+ "notNull": false
12058
+ },
12059
+ "headers": {
12060
+ "type": "TEXT",
12061
+ "notNull": false
12062
+ },
12063
+ "channel_id": {
12064
+ "type": "TEXT",
12065
+ "notNull": false
12066
+ },
12067
+ "channel_name": {
12068
+ "type": "TEXT",
12069
+ "notNull": false
12070
+ },
12071
+ "slack_ts": {
12072
+ "type": "TEXT",
12073
+ "notNull": false
12074
+ },
12075
+ "slack_thread_ts": {
12076
+ "type": "TEXT",
12077
+ "notNull": false
12078
+ },
12079
+ "reactions": {
12080
+ "type": "TEXT",
12081
+ "notNull": false
12082
+ },
12083
+ "is_edited": {
12084
+ "type": "BOOLEAN",
12085
+ "notNull": false,
12086
+ "default": false
12087
+ },
12088
+ "message_type": {
12089
+ "type": "TEXT",
12090
+ "notNull": false
12091
+ },
12092
+ "blocks": {
12093
+ "type": "TEXT",
12094
+ "notNull": false
12095
+ },
11639
12096
  "tweet_id": {
11640
12097
  "type": "TEXT",
11641
12098
  "notNull": false
@@ -11679,15 +12136,10 @@
11679
12136
  }
11680
12137
  },
11681
12138
  "indexes": [
11682
- {
11683
- "name": "messages_id_idx",
11684
- "columns": [
11685
- "id"
11686
- ]
11687
- },
11688
12139
  {
11689
12140
  "name": "messages_slug_context_meta_type_idx",
11690
12141
  "columns": [
12142
+ "tenant_id",
11691
12143
  "slug",
11692
12144
  "context",
11693
12145
  "_meta_type"
@@ -11701,13 +12153,38 @@
11701
12153
  ]
11702
12154
  },
11703
12155
  {
11704
- "name": "messages_tenant_id_idx",
12156
+ "name": "messages_tenant_id_created_at_idx",
12157
+ "columns": [
12158
+ "tenant_id",
12159
+ "created_at"
12160
+ ]
12161
+ },
12162
+ {
12163
+ "name": "messages_account_id_idx",
12164
+ "columns": [
12165
+ "account_id"
12166
+ ]
12167
+ },
12168
+ {
12169
+ "name": "messages_persona_id_idx",
11705
12170
  "columns": [
11706
- "tenant_id"
12171
+ "persona_id"
12172
+ ]
12173
+ },
12174
+ {
12175
+ "name": "messages_endpoint_id_idx",
12176
+ "columns": [
12177
+ "endpoint_id"
12178
+ ]
12179
+ },
12180
+ {
12181
+ "name": "messages_in_reply_to_message_id_idx",
12182
+ "columns": [
12183
+ "in_reply_to_message_id"
11707
12184
  ]
11708
12185
  }
11709
12186
  ],
11710
- "version": "2b56d8c3"
12187
+ "version": "e535c8c6"
11711
12188
  }
11712
12189
  },
11713
12190
  "@happyvertical/smrt-messages:TwitterAccount": {
@@ -12423,7 +12900,7 @@
12423
12900
  ],
12424
12901
  "schema": {
12425
12902
  "tableName": "accounts",
12426
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
12903
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
12427
12904
  "columns": {
12428
12905
  "id": {
12429
12906
  "type": "UUID",
@@ -12496,6 +12973,27 @@
12496
12973
  "type": "TEXT",
12497
12974
  "notNull": false
12498
12975
  },
12976
+ "email": {
12977
+ "type": "TEXT",
12978
+ "notNull": false
12979
+ },
12980
+ "sync_interval_minutes": {
12981
+ "type": "INTEGER",
12982
+ "notNull": false,
12983
+ "default": 60
12984
+ },
12985
+ "workspace_id": {
12986
+ "type": "TEXT",
12987
+ "notNull": false
12988
+ },
12989
+ "workspace_name": {
12990
+ "type": "TEXT",
12991
+ "notNull": false
12992
+ },
12993
+ "bot_user_id": {
12994
+ "type": "TEXT",
12995
+ "notNull": false
12996
+ },
12499
12997
  "handle": {
12500
12998
  "type": "TEXT",
12501
12999
  "notNull": false
@@ -12506,15 +13004,10 @@
12506
13004
  }
12507
13005
  },
12508
13006
  "indexes": [
12509
- {
12510
- "name": "accounts_id_idx",
12511
- "columns": [
12512
- "id"
12513
- ]
12514
- },
12515
13007
  {
12516
13008
  "name": "accounts_slug_context_meta_type_idx",
12517
13009
  "columns": [
13010
+ "tenant_id",
12518
13011
  "slug",
12519
13012
  "context",
12520
13013
  "_meta_type"
@@ -12528,13 +13021,14 @@
12528
13021
  ]
12529
13022
  },
12530
13023
  {
12531
- "name": "accounts_tenant_id_idx",
13024
+ "name": "accounts_tenant_id_created_at_idx",
12532
13025
  "columns": [
12533
- "tenant_id"
13026
+ "tenant_id",
13027
+ "created_at"
12534
13028
  ]
12535
13029
  }
12536
13030
  ],
12537
- "version": "71bd70b9"
13031
+ "version": "3854ea98"
12538
13032
  }
12539
13033
  },
12540
13034
  "@happyvertical/smrt-messages:Whitelist": {
@@ -12609,7 +13103,12 @@
12609
13103
  ]
12610
13104
  },
12611
13105
  "cli": true,
12612
- "tenantScoped": true
13106
+ "tenantScoped": true,
13107
+ "conflictColumns": [
13108
+ "tenant_id",
13109
+ "slug",
13110
+ "context"
13111
+ ]
12613
13112
  },
12614
13113
  "extends": "SmrtObject",
12615
13114
  "exportName": "Whitelist",
@@ -12674,24 +13173,20 @@
12674
13173
  }
12675
13174
  },
12676
13175
  "indexes": [
12677
- {
12678
- "name": "whitelists_id_idx",
12679
- "columns": [
12680
- "id"
12681
- ]
12682
- },
12683
13176
  {
12684
13177
  "name": "whitelists_slug_context_idx",
12685
13178
  "columns": [
13179
+ "tenant_id",
12686
13180
  "slug",
12687
13181
  "context"
12688
13182
  ],
12689
13183
  "unique": true
12690
13184
  },
12691
13185
  {
12692
- "name": "whitelists_tenant_id_idx",
13186
+ "name": "whitelists_tenant_id_created_at_idx",
12693
13187
  "columns": [
12694
- "tenant_id"
13188
+ "tenant_id",
13189
+ "created_at"
12695
13190
  ]
12696
13191
  }
12697
13192
  ],
@@ -13403,7 +13898,7 @@
13403
13898
  ],
13404
13899
  "schema": {
13405
13900
  "tableName": "accounts",
13406
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT\n);",
13901
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
13407
13902
  "columns": {
13408
13903
  "id": {
13409
13904
  "type": "UUID",
@@ -13475,18 +13970,42 @@
13475
13970
  "configuration": {
13476
13971
  "type": "TEXT",
13477
13972
  "notNull": false
13973
+ },
13974
+ "email": {
13975
+ "type": "TEXT",
13976
+ "notNull": false
13977
+ },
13978
+ "sync_interval_minutes": {
13979
+ "type": "INTEGER",
13980
+ "notNull": false,
13981
+ "default": 60
13982
+ },
13983
+ "workspace_id": {
13984
+ "type": "TEXT",
13985
+ "notNull": false
13986
+ },
13987
+ "workspace_name": {
13988
+ "type": "TEXT",
13989
+ "notNull": false
13990
+ },
13991
+ "bot_user_id": {
13992
+ "type": "TEXT",
13993
+ "notNull": false
13994
+ },
13995
+ "handle": {
13996
+ "type": "TEXT",
13997
+ "notNull": false
13998
+ },
13999
+ "twitter_user_id": {
14000
+ "type": "TEXT",
14001
+ "notNull": false
13478
14002
  }
13479
14003
  },
13480
14004
  "indexes": [
13481
- {
13482
- "name": "accounts_id_idx",
13483
- "columns": [
13484
- "id"
13485
- ]
13486
- },
13487
14005
  {
13488
14006
  "name": "accounts_slug_context_meta_type_idx",
13489
14007
  "columns": [
14008
+ "tenant_id",
13490
14009
  "slug",
13491
14010
  "context",
13492
14011
  "_meta_type"
@@ -13500,13 +14019,14 @@
13500
14019
  ]
13501
14020
  },
13502
14021
  {
13503
- "name": "accounts_tenant_id_idx",
14022
+ "name": "accounts_tenant_id_created_at_idx",
13504
14023
  "columns": [
13505
- "tenant_id"
14024
+ "tenant_id",
14025
+ "created_at"
13506
14026
  ]
13507
14027
  }
13508
14028
  ],
13509
- "version": "a64c8d38"
14029
+ "version": "3854ea98"
13510
14030
  }
13511
14031
  }
13512
14032
  },