@happyvertical/smrt-messages 0.62.6 → 0.62.7

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.
Files changed (63) hide show
  1. package/AGENTS.md +72 -0
  2. package/dist/access-enforcement.d.ts +20 -0
  3. package/dist/access-enforcement.d.ts.map +1 -0
  4. package/dist/access.d.ts +203 -0
  5. package/dist/access.d.ts.map +1 -0
  6. package/dist/chunks/AttachmentCollection-nTqD75n8.js +308 -0
  7. package/dist/chunks/AttachmentCollection-nTqD75n8.js.map +1 -0
  8. package/dist/chunks/{Email-ChfbMCSF.js → Email-DKcIiMxB.js} +6 -6
  9. package/dist/chunks/{Email-ChfbMCSF.js.map → Email-DKcIiMxB.js.map} +1 -1
  10. package/dist/chunks/EmailAccountCollection-DtCuHcB4.js +1224 -0
  11. package/dist/chunks/EmailAccountCollection-DtCuHcB4.js.map +1 -0
  12. package/dist/chunks/EmailCollection-BYeuWWsP.js +181 -0
  13. package/dist/chunks/EmailCollection-BYeuWWsP.js.map +1 -0
  14. package/dist/chunks/{EmailFolder-XH5eH4Ed.js → EmailFolder-UMGpXTQ7.js} +25 -6
  15. package/dist/chunks/EmailFolder-UMGpXTQ7.js.map +1 -0
  16. package/dist/chunks/EmailFolderCollection-DHZKwe1H.js +177 -0
  17. package/dist/chunks/EmailFolderCollection-DHZKwe1H.js.map +1 -0
  18. package/dist/chunks/EmailSender-B-Rtq9du.js +147 -0
  19. package/dist/chunks/EmailSender-B-Rtq9du.js.map +1 -0
  20. package/dist/chunks/{Message-C6P1V5C_.js → Message-M8INXZs5.js} +30 -6
  21. package/dist/chunks/Message-M8INXZs5.js.map +1 -0
  22. package/dist/chunks/{MessageCollection-CjCT06XE.js → MessageCollection-CT0O_7wG.js} +2 -2
  23. package/dist/chunks/{MessageCollection-CjCT06XE.js.map → MessageCollection-CT0O_7wG.js.map} +1 -1
  24. package/dist/chunks/MessagingEndpointCollection-DrNvP8GM.js +97 -0
  25. package/dist/chunks/MessagingEndpointCollection-DrNvP8GM.js.map +1 -0
  26. package/dist/collections/AttachmentCollection.d.ts +6 -0
  27. package/dist/collections/AttachmentCollection.d.ts.map +1 -1
  28. package/dist/connect.d.ts +82 -0
  29. package/dist/connect.d.ts.map +1 -0
  30. package/dist/connect.js +126 -0
  31. package/dist/connect.js.map +1 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +458 -1399
  35. package/dist/index.js.map +1 -1
  36. package/dist/manifest.json +892 -32
  37. package/dist/models/Account.d.ts +23 -0
  38. package/dist/models/Account.d.ts.map +1 -1
  39. package/dist/models/Attachment.d.ts +14 -0
  40. package/dist/models/Attachment.d.ts.map +1 -1
  41. package/dist/models/EmailAccount.d.ts +3 -0
  42. package/dist/models/EmailAccount.d.ts.map +1 -1
  43. package/dist/models/EmailFolder.d.ts +7 -0
  44. package/dist/models/EmailFolder.d.ts.map +1 -1
  45. package/dist/models/Message.d.ts +7 -0
  46. package/dist/models/Message.d.ts.map +1 -1
  47. package/dist/permissions.d.ts +11 -0
  48. package/dist/permissions.d.ts.map +1 -1
  49. package/dist/services/MessagingSettingsService.d.ts +86 -0
  50. package/dist/services/MessagingSettingsService.d.ts.map +1 -1
  51. package/dist/services/NotificationOutboxService.d.ts +3 -0
  52. package/dist/services/NotificationOutboxService.d.ts.map +1 -1
  53. package/dist/smrt-knowledge.json +762 -21
  54. package/dist/smrt-knowledge.okf.md +3 -2
  55. package/dist/types.d.ts +5 -0
  56. package/dist/types.d.ts.map +1 -1
  57. package/package.json +20 -16
  58. package/dist/chunks/AccountCollection-RP_hLf6L.js +0 -257
  59. package/dist/chunks/AccountCollection-RP_hLf6L.js.map +0 -1
  60. package/dist/chunks/EmailFolder-XH5eH4Ed.js.map +0 -1
  61. package/dist/chunks/Message-C6P1V5C_.js.map +0 -1
  62. package/dist/chunks/__smrt-register__-CfOb1uCN.js +0 -6
  63. package/dist/chunks/__smrt-register__-CfOb1uCN.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-messages",
5
- "packageVersion": "0.62.6",
5
+ "packageVersion": "0.62.7",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-messages:AccountCollection": {
8
8
  "name": "accountcollection",
@@ -153,7 +153,7 @@
153
153
  ],
154
154
  "schema": {
155
155
  "tableName": "accounts",
156
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
156
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
157
157
  "columns": {
158
158
  "_sync_origin_device_id": {
159
159
  "type": "TEXT"
@@ -220,6 +220,23 @@
220
220
  "notNull": false,
221
221
  "default": true
222
222
  },
223
+ "owner_user_id": {
224
+ "type": "UUID",
225
+ "referenceKind": "crossPackageRef",
226
+ "notNull": false
227
+ },
228
+ "label": {
229
+ "type": "TEXT",
230
+ "notNull": false
231
+ },
232
+ "connection_status": {
233
+ "type": "TEXT",
234
+ "notNull": false
235
+ },
236
+ "status_message": {
237
+ "type": "TEXT",
238
+ "notNull": false
239
+ },
223
240
  "last_sync_at": {
224
241
  "type": "TIMESTAMP",
225
242
  "notNull": false
@@ -286,6 +303,12 @@
286
303
  "tenant_id",
287
304
  "created_at"
288
305
  ]
306
+ },
307
+ {
308
+ "name": "accounts_owner_user_id_idx",
309
+ "columns": [
310
+ "owner_user_id"
311
+ ]
289
312
  }
290
313
  ],
291
314
  "checks": [
@@ -297,7 +320,7 @@
297
320
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
298
321
  }
299
322
  ],
300
- "version": "b5f42708"
323
+ "version": "0ccc3936"
301
324
  },
302
325
  "importPath": "@happyvertical/smrt-messages"
303
326
  },
@@ -310,6 +333,14 @@
310
333
  "packageName": "@happyvertical/smrt-messages",
311
334
  "fields": {},
312
335
  "methods": {
336
+ "backfillAccountIds": {
337
+ "name": "backfillAccountIds",
338
+ "async": true,
339
+ "parameters": [],
340
+ "returnType": "Promise<number>",
341
+ "isStatic": false,
342
+ "isPublic": true
343
+ },
313
344
  "getByMessage": {
314
345
  "name": "getByMessage",
315
346
  "async": true,
@@ -544,7 +575,7 @@
544
575
  ],
545
576
  "schema": {
546
577
  "tableName": "attachments",
547
- "ddl": "CREATE TABLE IF NOT EXISTS \"attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
578
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"account_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
548
579
  "columns": {
549
580
  "_sync_origin_device_id": {
550
581
  "type": "TEXT"
@@ -595,6 +626,18 @@
595
626
  "onUpdate": "CASCADE"
596
627
  }
597
628
  },
629
+ "account_id": {
630
+ "type": "UUID",
631
+ "referenceKind": "foreignKey",
632
+ "notNull": false,
633
+ "unique": false,
634
+ "foreignKey": {
635
+ "table": "accounts",
636
+ "column": "id",
637
+ "onDelete": "NO ACTION",
638
+ "onUpdate": "CASCADE"
639
+ }
640
+ },
598
641
  "filename": {
599
642
  "type": "TEXT",
600
643
  "notNull": false,
@@ -656,9 +699,15 @@
656
699
  "columns": [
657
700
  "message_id"
658
701
  ]
702
+ },
703
+ {
704
+ "name": "attachments_account_id_idx",
705
+ "columns": [
706
+ "account_id"
707
+ ]
659
708
  }
660
709
  ],
661
- "version": "710eb303"
710
+ "version": "3f32531c"
662
711
  },
663
712
  "importPath": "@happyvertical/smrt-messages"
664
713
  },
@@ -1047,7 +1096,7 @@
1047
1096
  ],
1048
1097
  "schema": {
1049
1098
  "tableName": "accounts",
1050
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
1099
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
1051
1100
  "columns": {
1052
1101
  "_sync_origin_device_id": {
1053
1102
  "type": "TEXT"
@@ -1114,6 +1163,23 @@
1114
1163
  "notNull": false,
1115
1164
  "default": true
1116
1165
  },
1166
+ "owner_user_id": {
1167
+ "type": "UUID",
1168
+ "referenceKind": "crossPackageRef",
1169
+ "notNull": false
1170
+ },
1171
+ "label": {
1172
+ "type": "TEXT",
1173
+ "notNull": false
1174
+ },
1175
+ "connection_status": {
1176
+ "type": "TEXT",
1177
+ "notNull": false
1178
+ },
1179
+ "status_message": {
1180
+ "type": "TEXT",
1181
+ "notNull": false
1182
+ },
1117
1183
  "last_sync_at": {
1118
1184
  "type": "TIMESTAMP",
1119
1185
  "notNull": false
@@ -1180,6 +1246,12 @@
1180
1246
  "tenant_id",
1181
1247
  "created_at"
1182
1248
  ]
1249
+ },
1250
+ {
1251
+ "name": "accounts_owner_user_id_idx",
1252
+ "columns": [
1253
+ "owner_user_id"
1254
+ ]
1183
1255
  }
1184
1256
  ],
1185
1257
  "checks": [
@@ -1191,7 +1263,7 @@
1191
1263
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
1192
1264
  }
1193
1265
  ],
1194
- "version": "b5f42708"
1266
+ "version": "0ccc3936"
1195
1267
  },
1196
1268
  "importPath": "@happyvertical/smrt-messages"
1197
1269
  },
@@ -1204,6 +1276,14 @@
1204
1276
  "packageName": "@happyvertical/smrt-messages",
1205
1277
  "fields": {},
1206
1278
  "methods": {
1279
+ "backfillAccountIds": {
1280
+ "name": "backfillAccountIds",
1281
+ "async": true,
1282
+ "parameters": [],
1283
+ "returnType": "Promise<number>",
1284
+ "isStatic": false,
1285
+ "isPublic": true
1286
+ },
1207
1287
  "getByMessage": {
1208
1288
  "name": "getByMessage",
1209
1289
  "async": true,
@@ -1465,7 +1545,7 @@
1465
1545
  ],
1466
1546
  "schema": {
1467
1547
  "tableName": "email_attachments",
1468
- "ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
1548
+ "ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"account_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
1469
1549
  "columns": {
1470
1550
  "_sync_origin_device_id": {
1471
1551
  "type": "TEXT"
@@ -1516,6 +1596,18 @@
1516
1596
  "onUpdate": "CASCADE"
1517
1597
  }
1518
1598
  },
1599
+ "account_id": {
1600
+ "type": "UUID",
1601
+ "referenceKind": "foreignKey",
1602
+ "notNull": false,
1603
+ "unique": false,
1604
+ "foreignKey": {
1605
+ "table": "accounts",
1606
+ "column": "id",
1607
+ "onDelete": "NO ACTION",
1608
+ "onUpdate": "CASCADE"
1609
+ }
1610
+ },
1519
1611
  "filename": {
1520
1612
  "type": "TEXT",
1521
1613
  "notNull": false,
@@ -1577,9 +1669,15 @@
1577
1669
  "columns": [
1578
1670
  "message_id"
1579
1671
  ]
1672
+ },
1673
+ {
1674
+ "name": "email_attachments_account_id_idx",
1675
+ "columns": [
1676
+ "account_id"
1677
+ ]
1580
1678
  }
1581
1679
  ],
1582
- "version": "4f256284"
1680
+ "version": "ebed0053"
1583
1681
  },
1584
1682
  "importPath": "@happyvertical/smrt-messages"
1585
1683
  },
@@ -4763,6 +4861,52 @@
4763
4861
  "default": true,
4764
4862
  "description": "Whether this account is enabled for messaging."
4765
4863
  },
4864
+ "ownerUserId": {
4865
+ "type": "crossPackageRef",
4866
+ "_meta": {
4867
+ "__statedOptions": [
4868
+ "description",
4869
+ "related"
4870
+ ],
4871
+ "description": "The person who owns this account and decides who else may use it."
4872
+ },
4873
+ "required": false,
4874
+ "related": "@happyvertical/smrt-users:User",
4875
+ "description": "The person who owns this account and decides who else may use it."
4876
+ },
4877
+ "label": {
4878
+ "type": "text",
4879
+ "_meta": {
4880
+ "__statedOptions": [
4881
+ "description"
4882
+ ],
4883
+ "description": "A short name shown beside this account, such as Support or Personal."
4884
+ },
4885
+ "required": false,
4886
+ "description": "A short name shown beside this account, such as Support or Personal."
4887
+ },
4888
+ "connectionStatus": {
4889
+ "type": "text",
4890
+ "_meta": {
4891
+ "__statedOptions": [
4892
+ "description"
4893
+ ],
4894
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
4895
+ },
4896
+ "required": false,
4897
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
4898
+ },
4899
+ "statusMessage": {
4900
+ "type": "text",
4901
+ "_meta": {
4902
+ "__statedOptions": [
4903
+ "description"
4904
+ ],
4905
+ "description": "Why the account needs attention, in plain words."
4906
+ },
4907
+ "required": false,
4908
+ "description": "Why the account needs attention, in plain words."
4909
+ },
4766
4910
  "lastSyncAt": {
4767
4911
  "type": "datetime",
4768
4912
  "_meta": {
@@ -4867,6 +5011,28 @@
4867
5011
  "isStatic": false,
4868
5012
  "isPublic": true
4869
5013
  },
5014
+ "markNeedsReconnect": {
5015
+ "name": "markNeedsReconnect",
5016
+ "async": true,
5017
+ "parameters": [
5018
+ {
5019
+ "name": "reason",
5020
+ "type": "string",
5021
+ "optional": false
5022
+ }
5023
+ ],
5024
+ "returnType": "Promise<void>",
5025
+ "isStatic": false,
5026
+ "isPublic": true
5027
+ },
5028
+ "markConnected": {
5029
+ "name": "markConnected",
5030
+ "async": true,
5031
+ "parameters": [],
5032
+ "returnType": "Promise<void>",
5033
+ "isStatic": false,
5034
+ "isPublic": true
5035
+ },
4870
5036
  "activate": {
4871
5037
  "name": "activate",
4872
5038
  "async": true,
@@ -4905,6 +5071,14 @@
4905
5071
  "isStatic": false,
4906
5072
  "isPublic": true
4907
5073
  },
5074
+ "removeCredentials": {
5075
+ "name": "removeCredentials",
5076
+ "async": true,
5077
+ "parameters": [],
5078
+ "returnType": "Promise<void>",
5079
+ "isStatic": false,
5080
+ "isPublic": true
5081
+ },
4908
5082
  "createSender": {
4909
5083
  "name": "createSender",
4910
5084
  "async": true,
@@ -4965,7 +5139,7 @@
4965
5139
  ],
4966
5140
  "schema": {
4967
5141
  "tableName": "accounts",
4968
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
5142
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
4969
5143
  "columns": {
4970
5144
  "_sync_origin_device_id": {
4971
5145
  "type": "TEXT"
@@ -5032,6 +5206,23 @@
5032
5206
  "notNull": false,
5033
5207
  "default": true
5034
5208
  },
5209
+ "owner_user_id": {
5210
+ "type": "UUID",
5211
+ "referenceKind": "crossPackageRef",
5212
+ "notNull": false
5213
+ },
5214
+ "label": {
5215
+ "type": "TEXT",
5216
+ "notNull": false
5217
+ },
5218
+ "connection_status": {
5219
+ "type": "TEXT",
5220
+ "notNull": false
5221
+ },
5222
+ "status_message": {
5223
+ "type": "TEXT",
5224
+ "notNull": false
5225
+ },
5035
5226
  "last_sync_at": {
5036
5227
  "type": "TIMESTAMP",
5037
5228
  "notNull": false
@@ -5098,6 +5289,12 @@
5098
5289
  "tenant_id",
5099
5290
  "created_at"
5100
5291
  ]
5292
+ },
5293
+ {
5294
+ "name": "accounts_owner_user_id_idx",
5295
+ "columns": [
5296
+ "owner_user_id"
5297
+ ]
5101
5298
  }
5102
5299
  ],
5103
5300
  "checks": [
@@ -5109,7 +5306,7 @@
5109
5306
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
5110
5307
  }
5111
5308
  ],
5112
- "version": "b5f42708"
5309
+ "version": "0ccc3936"
5113
5310
  },
5114
5311
  "importPath": "@happyvertical/smrt-messages"
5115
5312
  },
@@ -5156,6 +5353,16 @@
5156
5353
  "required": false,
5157
5354
  "related": "Message"
5158
5355
  },
5356
+ "accountId": {
5357
+ "type": "foreignKey",
5358
+ "_meta": {
5359
+ "__statedOptions": [
5360
+ "related"
5361
+ ]
5362
+ },
5363
+ "required": false,
5364
+ "related": "Account"
5365
+ },
5159
5366
  "filename": {
5160
5367
  "type": "text",
5161
5368
  "_meta": {
@@ -5225,6 +5432,22 @@
5225
5432
  }
5226
5433
  },
5227
5434
  "methods": {
5435
+ "loadFromId": {
5436
+ "name": "loadFromId",
5437
+ "async": true,
5438
+ "parameters": [],
5439
+ "returnType": "any",
5440
+ "isStatic": false,
5441
+ "isPublic": true
5442
+ },
5443
+ "loadFromSlug": {
5444
+ "name": "loadFromSlug",
5445
+ "async": true,
5446
+ "parameters": [],
5447
+ "returnType": "any",
5448
+ "isStatic": false,
5449
+ "isPublic": true
5450
+ },
5228
5451
  "getMessage": {
5229
5452
  "name": "getMessage",
5230
5453
  "async": true,
@@ -5329,7 +5552,7 @@
5329
5552
  ],
5330
5553
  "schema": {
5331
5554
  "tableName": "attachments",
5332
- "ddl": "CREATE TABLE IF NOT EXISTS \"attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
5555
+ "ddl": "CREATE TABLE IF NOT EXISTS \"attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"account_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
5333
5556
  "columns": {
5334
5557
  "_sync_origin_device_id": {
5335
5558
  "type": "TEXT"
@@ -5380,6 +5603,18 @@
5380
5603
  "onUpdate": "CASCADE"
5381
5604
  }
5382
5605
  },
5606
+ "account_id": {
5607
+ "type": "UUID",
5608
+ "referenceKind": "foreignKey",
5609
+ "notNull": false,
5610
+ "unique": false,
5611
+ "foreignKey": {
5612
+ "table": "accounts",
5613
+ "column": "id",
5614
+ "onDelete": "NO ACTION",
5615
+ "onUpdate": "CASCADE"
5616
+ }
5617
+ },
5383
5618
  "filename": {
5384
5619
  "type": "TEXT",
5385
5620
  "notNull": false,
@@ -5441,9 +5676,15 @@
5441
5676
  "columns": [
5442
5677
  "message_id"
5443
5678
  ]
5679
+ },
5680
+ {
5681
+ "name": "attachments_account_id_idx",
5682
+ "columns": [
5683
+ "account_id"
5684
+ ]
5444
5685
  }
5445
5686
  ],
5446
- "version": "710eb303"
5687
+ "version": "3f32531c"
5447
5688
  },
5448
5689
  "importPath": "@happyvertical/smrt-messages"
5449
5690
  },
@@ -6308,6 +6549,22 @@
6308
6549
  "isStatic": false,
6309
6550
  "isPublic": true
6310
6551
  },
6552
+ "loadFromId": {
6553
+ "name": "loadFromId",
6554
+ "async": true,
6555
+ "parameters": [],
6556
+ "returnType": "any",
6557
+ "isStatic": false,
6558
+ "isPublic": true
6559
+ },
6560
+ "loadFromSlug": {
6561
+ "name": "loadFromSlug",
6562
+ "async": true,
6563
+ "parameters": [],
6564
+ "returnType": "any",
6565
+ "isStatic": false,
6566
+ "isPublic": true
6567
+ },
6311
6568
  "getAccount": {
6312
6569
  "name": "getAccount",
6313
6570
  "async": true,
@@ -7122,6 +7379,52 @@
7122
7379
  "default": true,
7123
7380
  "description": "Whether this account is enabled for messaging."
7124
7381
  },
7382
+ "ownerUserId": {
7383
+ "type": "crossPackageRef",
7384
+ "_meta": {
7385
+ "__statedOptions": [
7386
+ "description",
7387
+ "related"
7388
+ ],
7389
+ "description": "The person who owns this account and decides who else may use it."
7390
+ },
7391
+ "required": false,
7392
+ "related": "@happyvertical/smrt-users:User",
7393
+ "description": "The person who owns this account and decides who else may use it."
7394
+ },
7395
+ "label": {
7396
+ "type": "text",
7397
+ "_meta": {
7398
+ "__statedOptions": [
7399
+ "description"
7400
+ ],
7401
+ "description": "A short name shown beside this account, such as Support or Personal."
7402
+ },
7403
+ "required": false,
7404
+ "description": "A short name shown beside this account, such as Support or Personal."
7405
+ },
7406
+ "connectionStatus": {
7407
+ "type": "text",
7408
+ "_meta": {
7409
+ "__statedOptions": [
7410
+ "description"
7411
+ ],
7412
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
7413
+ },
7414
+ "required": false,
7415
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
7416
+ },
7417
+ "statusMessage": {
7418
+ "type": "text",
7419
+ "_meta": {
7420
+ "__statedOptions": [
7421
+ "description"
7422
+ ],
7423
+ "description": "Why the account needs attention, in plain words."
7424
+ },
7425
+ "required": false,
7426
+ "description": "Why the account needs attention, in plain words."
7427
+ },
7125
7428
  "lastSyncAt": {
7126
7429
  "type": "datetime",
7127
7430
  "_meta": {
@@ -7250,23 +7553,45 @@
7250
7553
  "isStatic": false,
7251
7554
  "isPublic": true
7252
7555
  },
7253
- "activate": {
7254
- "name": "activate",
7556
+ "markNeedsReconnect": {
7557
+ "name": "markNeedsReconnect",
7255
7558
  "async": true,
7256
- "parameters": [],
7559
+ "parameters": [
7560
+ {
7561
+ "name": "reason",
7562
+ "type": "string",
7563
+ "optional": false
7564
+ }
7565
+ ],
7257
7566
  "returnType": "Promise<void>",
7258
7567
  "isStatic": false,
7259
7568
  "isPublic": true
7260
7569
  },
7261
- "deactivate": {
7262
- "name": "deactivate",
7570
+ "markConnected": {
7571
+ "name": "markConnected",
7263
7572
  "async": true,
7264
7573
  "parameters": [],
7265
7574
  "returnType": "Promise<void>",
7266
7575
  "isStatic": false,
7267
7576
  "isPublic": true
7268
7577
  },
7269
- "setCredentials": {
7578
+ "activate": {
7579
+ "name": "activate",
7580
+ "async": true,
7581
+ "parameters": [],
7582
+ "returnType": "Promise<void>",
7583
+ "isStatic": false,
7584
+ "isPublic": true
7585
+ },
7586
+ "deactivate": {
7587
+ "name": "deactivate",
7588
+ "async": true,
7589
+ "parameters": [],
7590
+ "returnType": "Promise<void>",
7591
+ "isStatic": false,
7592
+ "isPublic": true
7593
+ },
7594
+ "setCredentials": {
7270
7595
  "name": "setCredentials",
7271
7596
  "async": true,
7272
7597
  "parameters": [
@@ -7288,6 +7613,14 @@
7288
7613
  "isStatic": false,
7289
7614
  "isPublic": true
7290
7615
  },
7616
+ "removeCredentials": {
7617
+ "name": "removeCredentials",
7618
+ "async": true,
7619
+ "parameters": [],
7620
+ "returnType": "Promise<void>",
7621
+ "isStatic": false,
7622
+ "isPublic": true
7623
+ },
7291
7624
  "createSender": {
7292
7625
  "name": "createSender",
7293
7626
  "async": true,
@@ -7447,7 +7780,7 @@
7447
7780
  ],
7448
7781
  "schema": {
7449
7782
  "tableName": "accounts",
7450
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
7783
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
7451
7784
  "columns": {
7452
7785
  "_sync_origin_device_id": {
7453
7786
  "type": "TEXT"
@@ -7514,6 +7847,23 @@
7514
7847
  "notNull": false,
7515
7848
  "default": true
7516
7849
  },
7850
+ "owner_user_id": {
7851
+ "type": "UUID",
7852
+ "referenceKind": "crossPackageRef",
7853
+ "notNull": false
7854
+ },
7855
+ "label": {
7856
+ "type": "TEXT",
7857
+ "notNull": false
7858
+ },
7859
+ "connection_status": {
7860
+ "type": "TEXT",
7861
+ "notNull": false
7862
+ },
7863
+ "status_message": {
7864
+ "type": "TEXT",
7865
+ "notNull": false
7866
+ },
7517
7867
  "last_sync_at": {
7518
7868
  "type": "TIMESTAMP",
7519
7869
  "notNull": false
@@ -7580,6 +7930,12 @@
7580
7930
  "tenant_id",
7581
7931
  "created_at"
7582
7932
  ]
7933
+ },
7934
+ {
7935
+ "name": "accounts_owner_user_id_idx",
7936
+ "columns": [
7937
+ "owner_user_id"
7938
+ ]
7583
7939
  }
7584
7940
  ],
7585
7941
  "checks": [
@@ -7591,7 +7947,7 @@
7591
7947
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
7592
7948
  }
7593
7949
  ],
7594
- "version": "b5f42708"
7950
+ "version": "0ccc3936"
7595
7951
  },
7596
7952
  "importPath": "@happyvertical/smrt-messages"
7597
7953
  },
@@ -7638,6 +7994,16 @@
7638
7994
  "required": false,
7639
7995
  "related": "Message"
7640
7996
  },
7997
+ "accountId": {
7998
+ "type": "foreignKey",
7999
+ "_meta": {
8000
+ "__statedOptions": [
8001
+ "related"
8002
+ ]
8003
+ },
8004
+ "required": false,
8005
+ "related": "Account"
8006
+ },
7641
8007
  "filename": {
7642
8008
  "type": "text",
7643
8009
  "_meta": {
@@ -7707,6 +8073,22 @@
7707
8073
  }
7708
8074
  },
7709
8075
  "methods": {
8076
+ "loadFromId": {
8077
+ "name": "loadFromId",
8078
+ "async": true,
8079
+ "parameters": [],
8080
+ "returnType": "any",
8081
+ "isStatic": false,
8082
+ "isPublic": true
8083
+ },
8084
+ "loadFromSlug": {
8085
+ "name": "loadFromSlug",
8086
+ "async": true,
8087
+ "parameters": [],
8088
+ "returnType": "any",
8089
+ "isStatic": false,
8090
+ "isPublic": true
8091
+ },
7710
8092
  "getMessage": {
7711
8093
  "name": "getMessage",
7712
8094
  "async": true,
@@ -7816,7 +8198,7 @@
7816
8198
  ],
7817
8199
  "schema": {
7818
8200
  "tableName": "email_attachments",
7819
- "ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
8201
+ "ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"message_id\" UUID,\n \"account_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
7820
8202
  "columns": {
7821
8203
  "_sync_origin_device_id": {
7822
8204
  "type": "TEXT"
@@ -7867,6 +8249,18 @@
7867
8249
  "onUpdate": "CASCADE"
7868
8250
  }
7869
8251
  },
8252
+ "account_id": {
8253
+ "type": "UUID",
8254
+ "referenceKind": "foreignKey",
8255
+ "notNull": false,
8256
+ "unique": false,
8257
+ "foreignKey": {
8258
+ "table": "accounts",
8259
+ "column": "id",
8260
+ "onDelete": "NO ACTION",
8261
+ "onUpdate": "CASCADE"
8262
+ }
8263
+ },
7870
8264
  "filename": {
7871
8265
  "type": "TEXT",
7872
8266
  "notNull": false,
@@ -7928,9 +8322,15 @@
7928
8322
  "columns": [
7929
8323
  "message_id"
7930
8324
  ]
8325
+ },
8326
+ {
8327
+ "name": "email_attachments_account_id_idx",
8328
+ "columns": [
8329
+ "account_id"
8330
+ ]
7931
8331
  }
7932
8332
  ],
7933
- "version": "4f256284"
8333
+ "version": "ebed0053"
7934
8334
  },
7935
8335
  "importPath": "@happyvertical/smrt-messages"
7936
8336
  },
@@ -8051,6 +8451,22 @@
8051
8451
  }
8052
8452
  },
8053
8453
  "methods": {
8454
+ "loadFromId": {
8455
+ "name": "loadFromId",
8456
+ "async": true,
8457
+ "parameters": [],
8458
+ "returnType": "any",
8459
+ "isStatic": false,
8460
+ "isPublic": true
8461
+ },
8462
+ "loadFromSlug": {
8463
+ "name": "loadFromSlug",
8464
+ "async": true,
8465
+ "parameters": [],
8466
+ "returnType": "any",
8467
+ "isStatic": false,
8468
+ "isPublic": true
8469
+ },
8054
8470
  "getAccount": {
8055
8471
  "name": "getAccount",
8056
8472
  "async": true,
@@ -8813,6 +9229,22 @@
8813
9229
  "isStatic": false,
8814
9230
  "isPublic": true
8815
9231
  },
9232
+ "loadFromId": {
9233
+ "name": "loadFromId",
9234
+ "async": true,
9235
+ "parameters": [],
9236
+ "returnType": "any",
9237
+ "isStatic": false,
9238
+ "isPublic": true
9239
+ },
9240
+ "loadFromSlug": {
9241
+ "name": "loadFromSlug",
9242
+ "async": true,
9243
+ "parameters": [],
9244
+ "returnType": "any",
9245
+ "isStatic": false,
9246
+ "isPublic": true
9247
+ },
8816
9248
  "getAccount": {
8817
9249
  "name": "getAccount",
8818
9250
  "async": true,
@@ -11109,6 +11541,52 @@
11109
11541
  "default": true,
11110
11542
  "description": "Whether this account is enabled for messaging."
11111
11543
  },
11544
+ "ownerUserId": {
11545
+ "type": "crossPackageRef",
11546
+ "_meta": {
11547
+ "__statedOptions": [
11548
+ "description",
11549
+ "related"
11550
+ ],
11551
+ "description": "The person who owns this account and decides who else may use it."
11552
+ },
11553
+ "required": false,
11554
+ "related": "@happyvertical/smrt-users:User",
11555
+ "description": "The person who owns this account and decides who else may use it."
11556
+ },
11557
+ "label": {
11558
+ "type": "text",
11559
+ "_meta": {
11560
+ "__statedOptions": [
11561
+ "description"
11562
+ ],
11563
+ "description": "A short name shown beside this account, such as Support or Personal."
11564
+ },
11565
+ "required": false,
11566
+ "description": "A short name shown beside this account, such as Support or Personal."
11567
+ },
11568
+ "connectionStatus": {
11569
+ "type": "text",
11570
+ "_meta": {
11571
+ "__statedOptions": [
11572
+ "description"
11573
+ ],
11574
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
11575
+ },
11576
+ "required": false,
11577
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
11578
+ },
11579
+ "statusMessage": {
11580
+ "type": "text",
11581
+ "_meta": {
11582
+ "__statedOptions": [
11583
+ "description"
11584
+ ],
11585
+ "description": "Why the account needs attention, in plain words."
11586
+ },
11587
+ "required": false,
11588
+ "description": "Why the account needs attention, in plain words."
11589
+ },
11112
11590
  "lastSyncAt": {
11113
11591
  "type": "datetime",
11114
11592
  "_meta": {
@@ -11246,6 +11724,28 @@
11246
11724
  "isStatic": false,
11247
11725
  "isPublic": true
11248
11726
  },
11727
+ "markNeedsReconnect": {
11728
+ "name": "markNeedsReconnect",
11729
+ "async": true,
11730
+ "parameters": [
11731
+ {
11732
+ "name": "reason",
11733
+ "type": "string",
11734
+ "optional": false
11735
+ }
11736
+ ],
11737
+ "returnType": "Promise<void>",
11738
+ "isStatic": false,
11739
+ "isPublic": true
11740
+ },
11741
+ "markConnected": {
11742
+ "name": "markConnected",
11743
+ "async": true,
11744
+ "parameters": [],
11745
+ "returnType": "Promise<void>",
11746
+ "isStatic": false,
11747
+ "isPublic": true
11748
+ },
11249
11749
  "activate": {
11250
11750
  "name": "activate",
11251
11751
  "async": true,
@@ -11284,6 +11784,14 @@
11284
11784
  "isStatic": false,
11285
11785
  "isPublic": true
11286
11786
  },
11787
+ "removeCredentials": {
11788
+ "name": "removeCredentials",
11789
+ "async": true,
11790
+ "parameters": [],
11791
+ "returnType": "Promise<void>",
11792
+ "isStatic": false,
11793
+ "isPublic": true
11794
+ },
11287
11795
  "createSender": {
11288
11796
  "name": "createSender",
11289
11797
  "async": true,
@@ -11336,7 +11844,7 @@
11336
11844
  ],
11337
11845
  "schema": {
11338
11846
  "tableName": "accounts",
11339
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
11847
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
11340
11848
  "columns": {
11341
11849
  "_sync_origin_device_id": {
11342
11850
  "type": "TEXT"
@@ -11403,6 +11911,23 @@
11403
11911
  "notNull": false,
11404
11912
  "default": true
11405
11913
  },
11914
+ "owner_user_id": {
11915
+ "type": "UUID",
11916
+ "referenceKind": "crossPackageRef",
11917
+ "notNull": false
11918
+ },
11919
+ "label": {
11920
+ "type": "TEXT",
11921
+ "notNull": false
11922
+ },
11923
+ "connection_status": {
11924
+ "type": "TEXT",
11925
+ "notNull": false
11926
+ },
11927
+ "status_message": {
11928
+ "type": "TEXT",
11929
+ "notNull": false
11930
+ },
11406
11931
  "last_sync_at": {
11407
11932
  "type": "TIMESTAMP",
11408
11933
  "notNull": false
@@ -11469,6 +11994,12 @@
11469
11994
  "tenant_id",
11470
11995
  "created_at"
11471
11996
  ]
11997
+ },
11998
+ {
11999
+ "name": "accounts_owner_user_id_idx",
12000
+ "columns": [
12001
+ "owner_user_id"
12002
+ ]
11472
12003
  }
11473
12004
  ],
11474
12005
  "checks": [
@@ -11480,7 +12011,7 @@
11480
12011
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
11481
12012
  }
11482
12013
  ],
11483
- "version": "b5f42708"
12014
+ "version": "0ccc3936"
11484
12015
  },
11485
12016
  "importPath": "@happyvertical/smrt-messages"
11486
12017
  },
@@ -12054,6 +12585,22 @@
12054
12585
  "isStatic": false,
12055
12586
  "isPublic": true
12056
12587
  },
12588
+ "loadFromId": {
12589
+ "name": "loadFromId",
12590
+ "async": true,
12591
+ "parameters": [],
12592
+ "returnType": "any",
12593
+ "isStatic": false,
12594
+ "isPublic": true
12595
+ },
12596
+ "loadFromSlug": {
12597
+ "name": "loadFromSlug",
12598
+ "async": true,
12599
+ "parameters": [],
12600
+ "returnType": "any",
12601
+ "isStatic": false,
12602
+ "isPublic": true
12603
+ },
12057
12604
  "getAccount": {
12058
12605
  "name": "getAccount",
12059
12606
  "async": true,
@@ -12785,6 +13332,52 @@
12785
13332
  "default": true,
12786
13333
  "description": "Whether this account is enabled for messaging."
12787
13334
  },
13335
+ "ownerUserId": {
13336
+ "type": "crossPackageRef",
13337
+ "_meta": {
13338
+ "__statedOptions": [
13339
+ "description",
13340
+ "related"
13341
+ ],
13342
+ "description": "The person who owns this account and decides who else may use it."
13343
+ },
13344
+ "required": false,
13345
+ "related": "@happyvertical/smrt-users:User",
13346
+ "description": "The person who owns this account and decides who else may use it."
13347
+ },
13348
+ "label": {
13349
+ "type": "text",
13350
+ "_meta": {
13351
+ "__statedOptions": [
13352
+ "description"
13353
+ ],
13354
+ "description": "A short name shown beside this account, such as Support or Personal."
13355
+ },
13356
+ "required": false,
13357
+ "description": "A short name shown beside this account, such as Support or Personal."
13358
+ },
13359
+ "connectionStatus": {
13360
+ "type": "text",
13361
+ "_meta": {
13362
+ "__statedOptions": [
13363
+ "description"
13364
+ ],
13365
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
13366
+ },
13367
+ "required": false,
13368
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
13369
+ },
13370
+ "statusMessage": {
13371
+ "type": "text",
13372
+ "_meta": {
13373
+ "__statedOptions": [
13374
+ "description"
13375
+ ],
13376
+ "description": "Why the account needs attention, in plain words."
13377
+ },
13378
+ "required": false,
13379
+ "description": "Why the account needs attention, in plain words."
13380
+ },
12788
13381
  "lastSyncAt": {
12789
13382
  "type": "datetime",
12790
13383
  "_meta": {
@@ -12889,6 +13482,28 @@
12889
13482
  "isStatic": false,
12890
13483
  "isPublic": true
12891
13484
  },
13485
+ "markNeedsReconnect": {
13486
+ "name": "markNeedsReconnect",
13487
+ "async": true,
13488
+ "parameters": [
13489
+ {
13490
+ "name": "reason",
13491
+ "type": "string",
13492
+ "optional": false
13493
+ }
13494
+ ],
13495
+ "returnType": "Promise<void>",
13496
+ "isStatic": false,
13497
+ "isPublic": true
13498
+ },
13499
+ "markConnected": {
13500
+ "name": "markConnected",
13501
+ "async": true,
13502
+ "parameters": [],
13503
+ "returnType": "Promise<void>",
13504
+ "isStatic": false,
13505
+ "isPublic": true
13506
+ },
12892
13507
  "activate": {
12893
13508
  "name": "activate",
12894
13509
  "async": true,
@@ -12927,6 +13542,14 @@
12927
13542
  "isStatic": false,
12928
13543
  "isPublic": true
12929
13544
  },
13545
+ "removeCredentials": {
13546
+ "name": "removeCredentials",
13547
+ "async": true,
13548
+ "parameters": [],
13549
+ "returnType": "Promise<void>",
13550
+ "isStatic": false,
13551
+ "isPublic": true
13552
+ },
12930
13553
  "createSender": {
12931
13554
  "name": "createSender",
12932
13555
  "async": true,
@@ -12979,7 +13602,7 @@
12979
13602
  ],
12980
13603
  "schema": {
12981
13604
  "tableName": "accounts",
12982
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
13605
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
12983
13606
  "columns": {
12984
13607
  "_sync_origin_device_id": {
12985
13608
  "type": "TEXT"
@@ -13046,6 +13669,23 @@
13046
13669
  "notNull": false,
13047
13670
  "default": true
13048
13671
  },
13672
+ "owner_user_id": {
13673
+ "type": "UUID",
13674
+ "referenceKind": "crossPackageRef",
13675
+ "notNull": false
13676
+ },
13677
+ "label": {
13678
+ "type": "TEXT",
13679
+ "notNull": false
13680
+ },
13681
+ "connection_status": {
13682
+ "type": "TEXT",
13683
+ "notNull": false
13684
+ },
13685
+ "status_message": {
13686
+ "type": "TEXT",
13687
+ "notNull": false
13688
+ },
13049
13689
  "last_sync_at": {
13050
13690
  "type": "TIMESTAMP",
13051
13691
  "notNull": false
@@ -13112,6 +13752,12 @@
13112
13752
  "tenant_id",
13113
13753
  "created_at"
13114
13754
  ]
13755
+ },
13756
+ {
13757
+ "name": "accounts_owner_user_id_idx",
13758
+ "columns": [
13759
+ "owner_user_id"
13760
+ ]
13115
13761
  }
13116
13762
  ],
13117
13763
  "checks": [
@@ -13123,7 +13769,7 @@
13123
13769
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
13124
13770
  }
13125
13771
  ],
13126
- "version": "b5f42708"
13772
+ "version": "0ccc3936"
13127
13773
  },
13128
13774
  "importPath": "@happyvertical/smrt-messages"
13129
13775
  },
@@ -13685,6 +14331,22 @@
13685
14331
  "isStatic": false,
13686
14332
  "isPublic": true
13687
14333
  },
14334
+ "loadFromId": {
14335
+ "name": "loadFromId",
14336
+ "async": true,
14337
+ "parameters": [],
14338
+ "returnType": "any",
14339
+ "isStatic": false,
14340
+ "isPublic": true
14341
+ },
14342
+ "loadFromSlug": {
14343
+ "name": "loadFromSlug",
14344
+ "async": true,
14345
+ "parameters": [],
14346
+ "returnType": "any",
14347
+ "isStatic": false,
14348
+ "isPublic": true
14349
+ },
13688
14350
  "getAccount": {
13689
14351
  "name": "getAccount",
13690
14352
  "async": true,
@@ -14436,6 +15098,52 @@
14436
15098
  "default": true,
14437
15099
  "description": "Whether this account is enabled for messaging."
14438
15100
  },
15101
+ "ownerUserId": {
15102
+ "type": "crossPackageRef",
15103
+ "_meta": {
15104
+ "__statedOptions": [
15105
+ "description",
15106
+ "related"
15107
+ ],
15108
+ "description": "The person who owns this account and decides who else may use it."
15109
+ },
15110
+ "required": false,
15111
+ "related": "@happyvertical/smrt-users:User",
15112
+ "description": "The person who owns this account and decides who else may use it."
15113
+ },
15114
+ "label": {
15115
+ "type": "text",
15116
+ "_meta": {
15117
+ "__statedOptions": [
15118
+ "description"
15119
+ ],
15120
+ "description": "A short name shown beside this account, such as Support or Personal."
15121
+ },
15122
+ "required": false,
15123
+ "description": "A short name shown beside this account, such as Support or Personal."
15124
+ },
15125
+ "connectionStatus": {
15126
+ "type": "text",
15127
+ "_meta": {
15128
+ "__statedOptions": [
15129
+ "description"
15130
+ ],
15131
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
15132
+ },
15133
+ "required": false,
15134
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
15135
+ },
15136
+ "statusMessage": {
15137
+ "type": "text",
15138
+ "_meta": {
15139
+ "__statedOptions": [
15140
+ "description"
15141
+ ],
15142
+ "description": "Why the account needs attention, in plain words."
15143
+ },
15144
+ "required": false,
15145
+ "description": "Why the account needs attention, in plain words."
15146
+ },
14439
15147
  "lastSyncAt": {
14440
15148
  "type": "datetime",
14441
15149
  "_meta": {
@@ -14554,6 +15262,28 @@
14554
15262
  "isStatic": false,
14555
15263
  "isPublic": true
14556
15264
  },
15265
+ "markNeedsReconnect": {
15266
+ "name": "markNeedsReconnect",
15267
+ "async": true,
15268
+ "parameters": [
15269
+ {
15270
+ "name": "reason",
15271
+ "type": "string",
15272
+ "optional": false
15273
+ }
15274
+ ],
15275
+ "returnType": "Promise<void>",
15276
+ "isStatic": false,
15277
+ "isPublic": true
15278
+ },
15279
+ "markConnected": {
15280
+ "name": "markConnected",
15281
+ "async": true,
15282
+ "parameters": [],
15283
+ "returnType": "Promise<void>",
15284
+ "isStatic": false,
15285
+ "isPublic": true
15286
+ },
14557
15287
  "activate": {
14558
15288
  "name": "activate",
14559
15289
  "async": true,
@@ -14592,6 +15322,14 @@
14592
15322
  "isStatic": false,
14593
15323
  "isPublic": true
14594
15324
  },
15325
+ "removeCredentials": {
15326
+ "name": "removeCredentials",
15327
+ "async": true,
15328
+ "parameters": [],
15329
+ "returnType": "Promise<void>",
15330
+ "isStatic": false,
15331
+ "isPublic": true
15332
+ },
14595
15333
  "createSender": {
14596
15334
  "name": "createSender",
14597
15335
  "async": true,
@@ -14644,7 +15382,7 @@
14644
15382
  ],
14645
15383
  "schema": {
14646
15384
  "tableName": "accounts",
14647
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
15385
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
14648
15386
  "columns": {
14649
15387
  "_sync_origin_device_id": {
14650
15388
  "type": "TEXT"
@@ -14711,6 +15449,23 @@
14711
15449
  "notNull": false,
14712
15450
  "default": true
14713
15451
  },
15452
+ "owner_user_id": {
15453
+ "type": "UUID",
15454
+ "referenceKind": "crossPackageRef",
15455
+ "notNull": false
15456
+ },
15457
+ "label": {
15458
+ "type": "TEXT",
15459
+ "notNull": false
15460
+ },
15461
+ "connection_status": {
15462
+ "type": "TEXT",
15463
+ "notNull": false
15464
+ },
15465
+ "status_message": {
15466
+ "type": "TEXT",
15467
+ "notNull": false
15468
+ },
14714
15469
  "last_sync_at": {
14715
15470
  "type": "TIMESTAMP",
14716
15471
  "notNull": false
@@ -14777,6 +15532,12 @@
14777
15532
  "tenant_id",
14778
15533
  "created_at"
14779
15534
  ]
15535
+ },
15536
+ {
15537
+ "name": "accounts_owner_user_id_idx",
15538
+ "columns": [
15539
+ "owner_user_id"
15540
+ ]
14780
15541
  }
14781
15542
  ],
14782
15543
  "checks": [
@@ -14788,7 +15549,7 @@
14788
15549
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
14789
15550
  }
14790
15551
  ],
14791
- "version": "b5f42708"
15552
+ "version": "0ccc3936"
14792
15553
  },
14793
15554
  "importPath": "@happyvertical/smrt-messages"
14794
15555
  },
@@ -15396,6 +16157,52 @@
15396
16157
  "default": true,
15397
16158
  "description": "Whether this account is enabled for messaging."
15398
16159
  },
16160
+ "ownerUserId": {
16161
+ "type": "crossPackageRef",
16162
+ "_meta": {
16163
+ "__statedOptions": [
16164
+ "description",
16165
+ "related"
16166
+ ],
16167
+ "description": "The person who owns this account and decides who else may use it."
16168
+ },
16169
+ "required": false,
16170
+ "related": "@happyvertical/smrt-users:User",
16171
+ "description": "The person who owns this account and decides who else may use it."
16172
+ },
16173
+ "label": {
16174
+ "type": "text",
16175
+ "_meta": {
16176
+ "__statedOptions": [
16177
+ "description"
16178
+ ],
16179
+ "description": "A short name shown beside this account, such as Support or Personal."
16180
+ },
16181
+ "required": false,
16182
+ "description": "A short name shown beside this account, such as Support or Personal."
16183
+ },
16184
+ "connectionStatus": {
16185
+ "type": "text",
16186
+ "_meta": {
16187
+ "__statedOptions": [
16188
+ "description"
16189
+ ],
16190
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
16191
+ },
16192
+ "required": false,
16193
+ "description": "Whether the saved sign-in still works: connected, or needs_reconnect after the server refused it."
16194
+ },
16195
+ "statusMessage": {
16196
+ "type": "text",
16197
+ "_meta": {
16198
+ "__statedOptions": [
16199
+ "description"
16200
+ ],
16201
+ "description": "Why the account needs attention, in plain words."
16202
+ },
16203
+ "required": false,
16204
+ "description": "Why the account needs attention, in plain words."
16205
+ },
15399
16206
  "lastSyncAt": {
15400
16207
  "type": "datetime",
15401
16208
  "_meta": {
@@ -15500,6 +16307,28 @@
15500
16307
  "isStatic": false,
15501
16308
  "isPublic": true
15502
16309
  },
16310
+ "markNeedsReconnect": {
16311
+ "name": "markNeedsReconnect",
16312
+ "async": true,
16313
+ "parameters": [
16314
+ {
16315
+ "name": "reason",
16316
+ "type": "string",
16317
+ "optional": false
16318
+ }
16319
+ ],
16320
+ "returnType": "Promise<void>",
16321
+ "isStatic": false,
16322
+ "isPublic": true
16323
+ },
16324
+ "markConnected": {
16325
+ "name": "markConnected",
16326
+ "async": true,
16327
+ "parameters": [],
16328
+ "returnType": "Promise<void>",
16329
+ "isStatic": false,
16330
+ "isPublic": true
16331
+ },
15503
16332
  "activate": {
15504
16333
  "name": "activate",
15505
16334
  "async": true,
@@ -15538,6 +16367,14 @@
15538
16367
  "isStatic": false,
15539
16368
  "isPublic": true
15540
16369
  },
16370
+ "removeCredentials": {
16371
+ "name": "removeCredentials",
16372
+ "async": true,
16373
+ "parameters": [],
16374
+ "returnType": "Promise<void>",
16375
+ "isStatic": false,
16376
+ "isPublic": true
16377
+ },
15541
16378
  "createSender": {
15542
16379
  "name": "createSender",
15543
16380
  "async": true,
@@ -15590,7 +16427,7 @@
15590
16427
  ],
15591
16428
  "schema": {
15592
16429
  "tableName": "accounts",
15593
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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);",
16430
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\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 \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\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);",
15594
16431
  "columns": {
15595
16432
  "_sync_origin_device_id": {
15596
16433
  "type": "TEXT"
@@ -15657,6 +16494,23 @@
15657
16494
  "notNull": false,
15658
16495
  "default": true
15659
16496
  },
16497
+ "owner_user_id": {
16498
+ "type": "UUID",
16499
+ "referenceKind": "crossPackageRef",
16500
+ "notNull": false
16501
+ },
16502
+ "label": {
16503
+ "type": "TEXT",
16504
+ "notNull": false
16505
+ },
16506
+ "connection_status": {
16507
+ "type": "TEXT",
16508
+ "notNull": false
16509
+ },
16510
+ "status_message": {
16511
+ "type": "TEXT",
16512
+ "notNull": false
16513
+ },
15660
16514
  "last_sync_at": {
15661
16515
  "type": "TIMESTAMP",
15662
16516
  "notNull": false
@@ -15723,6 +16577,12 @@
15723
16577
  "tenant_id",
15724
16578
  "created_at"
15725
16579
  ]
16580
+ },
16581
+ {
16582
+ "name": "accounts_owner_user_id_idx",
16583
+ "columns": [
16584
+ "owner_user_id"
16585
+ ]
15726
16586
  }
15727
16587
  ],
15728
16588
  "checks": [
@@ -15734,7 +16594,7 @@
15734
16594
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
15735
16595
  }
15736
16596
  ],
15737
- "version": "b5f42708"
16597
+ "version": "0ccc3936"
15738
16598
  },
15739
16599
  "importPath": "@happyvertical/smrt-messages"
15740
16600
  }
@@ -16216,6 +17076,6 @@
16216
17076
  "@happyvertical/smrt-users"
16217
17077
  ]
16218
17078
  },
16219
- "schemaFingerprint": "dfb9fd778f2e205cf70a898f39ad642da42820a92d0ab4884ce7f67c6f5877d5",
17079
+ "schemaFingerprint": "3631b61477d5c27d8f4a0ff27d8b4ba3bc89a989b2bc965478fa4587ae2a01ec",
16220
17080
  "stampsConstructors": true
16221
17081
  }