@open-workspace/email 0.4.1 → 0.5.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.
Files changed (271) hide show
  1. package/README.md +9 -4
  2. package/alchemy/index.ts +130 -2
  3. package/drizzle/mailbox/0002_good_komodo.sql +2 -0
  4. package/drizzle/mailbox/0003_after_0_4_2.sql +180 -0
  5. package/drizzle/mailbox/meta/0002_snapshot.json +1017 -0
  6. package/drizzle/mailbox/meta/0003_snapshot.json +1507 -0
  7. package/drizzle/mailbox/meta/_journal.json +14 -0
  8. package/drizzle/mailbox/migrations.js +5 -1
  9. package/migrations/0001_overrated_ricochet.sql +2 -0
  10. package/migrations/0002_after_0_4_2.sql +35 -0
  11. package/migrations/meta/0001_snapshot.json +564 -0
  12. package/migrations/meta/0002_snapshot.json +807 -0
  13. package/migrations/meta/_journal.json +14 -0
  14. package/package.json +23 -7
  15. package/shared/attachment-preview.ts +18 -8
  16. package/shared/folder-order.ts +31 -6
  17. package/shared/mail-headers.ts +3 -3
  18. package/shared/mail-html.ts +25 -0
  19. package/shared/mail-import.ts +0 -7
  20. package/shared/mail-received.ts +4 -4
  21. package/shared/mail-rule-actions.ts +47 -0
  22. package/shared/mail.ts +70 -4
  23. package/shared/office-preview.ts +0 -4
  24. package/shared/pdfjs-assets.ts +1 -3
  25. package/shared/rich-content.ts +35 -0
  26. package/shared/signature.ts +15 -0
  27. package/src/admin/address-auto-reply.tsx +49 -0
  28. package/src/admin/blocked-senders.tsx +86 -66
  29. package/src/admin/forward-destinations.tsx +140 -0
  30. package/src/admin/mail-archive.tsx +134 -0
  31. package/src/admin/team-signature.tsx +90 -0
  32. package/src/client.tsx +130 -16
  33. package/src/mail/attachment-preview-dialog.tsx +13 -5
  34. package/src/mail/auto-reply-banner.tsx +61 -0
  35. package/src/mail/blocked-senders.tsx +124 -91
  36. package/src/mail/compose-window-chrome.tsx +20 -8
  37. package/src/mail/compose-window.tsx +387 -365
  38. package/src/mail/composer-asset-bookmarks.ts +47 -12
  39. package/src/mail/composer-attachment-list.tsx +42 -17
  40. package/src/mail/composer-editor-document.ts +54 -10
  41. package/src/mail/composer-editor.tsx +44 -44
  42. package/src/mail/composer-link-text.ts +42 -0
  43. package/src/mail/composer-recipient-fields.tsx +25 -16
  44. package/src/mail/composer-recipients.ts +62 -16
  45. package/src/mail/composer-session.ts +107 -23
  46. package/src/mail/composer-toolbar.tsx +15 -1
  47. package/src/mail/composer-upload-client.ts +29 -1
  48. package/src/mail/composer-upload-progress.ts +2 -2
  49. package/src/mail/conversation-actions-model.ts +56 -0
  50. package/src/mail/conversation-list.tsx +263 -128
  51. package/src/mail/conversation-loading-skeleton.tsx +165 -90
  52. package/src/mail/conversation-message.tsx +257 -102
  53. package/src/mail/conversation-order.ts +12 -0
  54. package/src/mail/conversation-reply.tsx +313 -189
  55. package/src/mail/conversation-selection-toolbar.tsx +188 -143
  56. package/src/mail/conversation-view.tsx +320 -85
  57. package/src/mail/delivery-indicator.tsx +33 -12
  58. package/src/mail/draft-attachments.ts +194 -0
  59. package/src/mail/email-html-body.tsx +97 -53
  60. package/src/mail/folder-cleanup-bar.tsx +193 -0
  61. package/src/mail/folder-glyph.tsx +5 -0
  62. package/src/mail/folder-manager.tsx +71 -38
  63. package/src/mail/mail-app-bar.tsx +15 -3
  64. package/src/mail/mail-dock.tsx +19 -3
  65. package/src/mail/mail-focus.ts +48 -0
  66. package/src/mail/mail-folders.ts +14 -2
  67. package/src/mail/mail-layout.css +20 -0
  68. package/src/mail/mail-mailbox-sheet.tsx +22 -69
  69. package/src/mail/mail-nav-rail.tsx +7 -4
  70. package/src/mail/mail-nav.tsx +66 -46
  71. package/src/mail/mail-prefetch.ts +30 -9
  72. package/src/mail/mail-primitives.tsx +6 -4
  73. package/src/mail/mail-queries.ts +122 -20
  74. package/src/mail/mail-query-cache.ts +1085 -173
  75. package/src/mail/mail-search-params.ts +35 -0
  76. package/src/mail/mail-shell.tsx +32 -9
  77. package/src/mail/mailbox-ai-settings.tsx +56 -42
  78. package/src/mail/mailbox-realtime.tsx +4 -12
  79. package/src/mail/mailbox-rules.tsx +898 -0
  80. package/src/mail/message-actions.tsx +38 -26
  81. package/src/mail/message-attachments.tsx +20 -12
  82. package/src/mail/message-body.ts +53 -0
  83. package/src/mail/message-format.ts +8 -2
  84. package/src/mail/message-header.tsx +3 -1
  85. package/src/mail/message-translation.tsx +34 -67
  86. package/src/mail/original-message-sheet.tsx +63 -50
  87. package/src/mail/original-message.ts +6 -6
  88. package/src/mail/pane-splitter.tsx +3 -3
  89. package/src/mail/pdf-preview.tsx +70 -62
  90. package/src/mail/plain-message-text.tsx +28 -0
  91. package/src/mail/print-message.ts +31 -36
  92. package/src/mail/reader-pane.tsx +134 -102
  93. package/src/mail/recipient-combobox.tsx +52 -29
  94. package/src/mail/recipient-field-row.tsx +3 -0
  95. package/src/mail/rich-content.ts +128 -0
  96. package/src/mail/sanitize-email-html.ts +57 -33
  97. package/src/mail/sender-actions.tsx +49 -39
  98. package/src/mail/sender-authentication.tsx +1 -1
  99. package/src/mail/sender-dialogs.tsx +67 -43
  100. package/src/mail/sender-security.tsx +9 -10
  101. package/src/mail/signature.ts +43 -0
  102. package/src/mail/translation-html.ts +3 -3
  103. package/src/mail/types.ts +12 -0
  104. package/src/mail/use-composer-attachment-preflight.ts +23 -60
  105. package/src/mail/use-composer-core.ts +286 -0
  106. package/src/mail/use-composer-navigation.ts +120 -0
  107. package/src/mail/use-composer-submission.ts +154 -19
  108. package/src/mail/use-conversation-actions.ts +292 -0
  109. package/src/mail/use-conversation-position.ts +51 -0
  110. package/src/mail/use-conversation-selection.ts +192 -89
  111. package/src/mail/use-draft-autosave.ts +394 -0
  112. package/src/mail/use-drafts.ts +194 -0
  113. package/src/mail/use-mail-controller.ts +754 -213
  114. package/src/mail/use-mail-data.ts +210 -100
  115. package/src/mail/use-mail-safety.ts +19 -38
  116. package/src/mail/use-mail-send.ts +18 -6
  117. package/src/mail/use-pdf-translation.ts +1 -1
  118. package/src/mail/use-reply-cc.ts +61 -0
  119. package/src/mail/use-visible-message-read.ts +128 -64
  120. package/src/pwa/push-key.ts +18 -0
  121. package/src/pwa/push-subscription.ts +88 -26
  122. package/src/settings/auto-reply-editor.tsx +454 -0
  123. package/src/settings/auto-reply-page.tsx +59 -0
  124. package/src/settings/mail-apps-page.tsx +52 -43
  125. package/src/settings/notifications-page.tsx +82 -67
  126. package/src/settings/rich-content-editor.tsx +182 -0
  127. package/src/settings/settings-queries.ts +57 -0
  128. package/src/settings/signature-editor.tsx +142 -0
  129. package/src/settings/signature-page.tsx +70 -0
  130. package/worker/admin/blocked-sender-routes.ts +10 -16
  131. package/worker/backups/eml.ts +185 -0
  132. package/worker/backups/file-parts.ts +140 -0
  133. package/worker/backups/mail-backup.ts +644 -0
  134. package/worker/backups/settings-backup.ts +866 -0
  135. package/worker/backups/stream-eml.ts +73 -0
  136. package/worker/db/schema.ts +98 -2
  137. package/worker/jmap/attachment-blobs.ts +113 -0
  138. package/worker/jmap/blobs.ts +162 -0
  139. package/worker/jmap/draft-content.ts +42 -0
  140. package/worker/jmap/drafts.ts +70 -0
  141. package/worker/jmap/email-body.ts +152 -0
  142. package/worker/jmap/email-methods.ts +1223 -0
  143. package/worker/jmap/eventsource.ts +9 -8
  144. package/worker/jmap/import-methods.ts +205 -0
  145. package/worker/jmap/mailbox-methods.ts +187 -0
  146. package/worker/jmap/method-core.ts +379 -0
  147. package/worker/jmap/methods.ts +108 -1815
  148. package/worker/jmap/push-subscription-methods.ts +373 -0
  149. package/worker/jmap/push-types.ts +46 -2
  150. package/worker/jmap/push.ts +24 -31
  151. package/worker/jmap/routes.ts +144 -153
  152. package/worker/jmap/submission-methods.ts +395 -0
  153. package/worker/mail/access.ts +35 -12
  154. package/worker/mail/ai-classification.ts +2 -2
  155. package/worker/mail/archive-object.ts +96 -0
  156. package/worker/mail/archive-routes.ts +35 -0
  157. package/worker/mail/archive.ts +682 -0
  158. package/worker/mail/auth-headers.ts +48 -40
  159. package/worker/mail/auto-reply-routes.ts +255 -0
  160. package/worker/mail/auto-reply.ts +243 -0
  161. package/worker/mail/bimi.ts +53 -36
  162. package/worker/mail/bootstrap.ts +11 -3
  163. package/worker/mail/capabilities.ts +69 -0
  164. package/worker/mail/classification-signals.ts +1 -1
  165. package/worker/mail/confusables-data.ts +9 -0
  166. package/worker/mail/conversation-cursor.ts +6 -15
  167. package/worker/mail/delivery-events.ts +9 -7
  168. package/worker/mail/delivery-facts.ts +1 -1
  169. package/worker/mail/demo-routes.ts +3 -3
  170. package/worker/mail/doh.ts +3 -3
  171. package/worker/mail/download-links.ts +153 -0
  172. package/worker/mail/downloads.ts +2 -6
  173. package/worker/mail/draft-routes.ts +473 -0
  174. package/worker/mail/draft-sender.ts +54 -0
  175. package/worker/mail/edge-cache.ts +41 -55
  176. package/worker/mail/email-routing.ts +123 -0
  177. package/worker/mail/forward-destinations.ts +114 -0
  178. package/worker/mail/forward-downloads.ts +115 -0
  179. package/worker/mail/forward-html.ts +85 -0
  180. package/worker/mail/header-metadata.ts +2 -5
  181. package/worker/mail/impersonation.ts +102 -101
  182. package/worker/mail/import-routes.ts +29 -82
  183. package/worker/mail/import.ts +130 -0
  184. package/worker/mail/inbound-delivery.ts +6 -5
  185. package/worker/mail/inbound.ts +58 -28
  186. package/worker/mail/ip-intel.ts +8 -17
  187. package/worker/mail/isolate-cache.ts +1 -1
  188. package/worker/mail/mailbox-deletion.ts +33 -12
  189. package/worker/mail/mailbox-directory.ts +39 -65
  190. package/worker/mail/mailing-list.ts +29 -58
  191. package/worker/mail/message-security.ts +3 -3
  192. package/worker/mail/message-view.ts +12 -10
  193. package/worker/mail/office-conversion.ts +3 -5
  194. package/worker/mail/office-preview-container.ts +3 -8
  195. package/worker/mail/outbound-content.ts +139 -65
  196. package/worker/mail/outbound-delivery.ts +20 -17
  197. package/worker/mail/outbound-service.ts +34 -9
  198. package/worker/mail/outbound.ts +146 -75
  199. package/worker/mail/outgoing-context.ts +60 -30
  200. package/worker/mail/participants.ts +10 -15
  201. package/worker/mail/plain-body.ts +39 -0
  202. package/worker/mail/push-endpoint.ts +17 -0
  203. package/worker/mail/push-notifications.ts +87 -43
  204. package/worker/mail/quote-parser.ts +107 -25
  205. package/worker/mail/r2-presigned-urls.ts +7 -0
  206. package/worker/mail/receive.ts +146 -39
  207. package/worker/mail/recipients.ts +1 -1
  208. package/worker/mail/remote-proxy.ts +3 -3
  209. package/worker/mail/repeat.ts +1 -1
  210. package/worker/mail/reply-plan.ts +124 -26
  211. package/worker/mail/rfc.ts +15 -7
  212. package/worker/mail/rich-content.ts +207 -0
  213. package/worker/mail/routes.ts +696 -304
  214. package/worker/mail/routing.ts +274 -0
  215. package/worker/mail/rules.ts +230 -0
  216. package/worker/mail/safety-routes.ts +88 -80
  217. package/worker/mail/schemas.ts +222 -31
  218. package/worker/mail/search.ts +25 -2
  219. package/worker/mail/security-settings.ts +4 -10
  220. package/worker/mail/send-message.ts +238 -0
  221. package/worker/mail/sender-intel.ts +12 -20
  222. package/worker/mail/signature-routes.ts +201 -0
  223. package/worker/mail/signatures.ts +195 -0
  224. package/worker/mail/spamhaus.ts +28 -16
  225. package/worker/mail/storage-keys.ts +35 -0
  226. package/worker/mail/unsubscribe.ts +19 -41
  227. package/worker/mail/uploads.ts +193 -80
  228. package/worker/mail/webhook-source.ts +3 -2
  229. package/worker/mail/workspace-safety.ts +194 -60
  230. package/worker/mailbox/demo.ts +13 -15
  231. package/worker/mailbox/email-index.ts +92 -13
  232. package/worker/mailbox/folder-model.ts +0 -20
  233. package/worker/mailbox/import-placement.ts +21 -36
  234. package/worker/mailbox/inbound-decision.ts +114 -0
  235. package/worker/mailbox/inbox-counts.ts +45 -25
  236. package/worker/mailbox/index.ts +843 -2888
  237. package/worker/mailbox/jmap-change-log.ts +195 -0
  238. package/worker/mailbox/jmap-email-rows.ts +186 -0
  239. package/worker/mailbox/jmap-mailboxes.ts +116 -0
  240. package/worker/mailbox/jmap-placement.ts +139 -0
  241. package/worker/mailbox/jmap-query-filter.ts +231 -0
  242. package/worker/mailbox/jmap-store.ts +167 -299
  243. package/worker/mailbox/mailbox-auto-reply.ts +301 -0
  244. package/worker/mailbox/mailbox-backup.ts +538 -0
  245. package/worker/mailbox/mailbox-drafts.ts +417 -0
  246. package/worker/mailbox/mailbox-folders.ts +242 -0
  247. package/worker/mailbox/mailbox-import.ts +450 -0
  248. package/worker/mailbox/mailbox-inbound.ts +934 -0
  249. package/worker/mailbox/mailbox-jmap.ts +294 -0
  250. package/worker/mailbox/mailbox-outbound.ts +413 -0
  251. package/worker/mailbox/mailbox-rules.ts +336 -0
  252. package/worker/mailbox/mailbox-senders.ts +294 -0
  253. package/worker/mailbox/mailbox-storage.ts +438 -0
  254. package/worker/mailbox/mailbox-views.ts +891 -0
  255. package/worker/mailbox/model.ts +1 -0
  256. package/worker/mailbox/office-preview-jobs.ts +59 -47
  257. package/worker/mailbox/placement.ts +933 -0
  258. package/worker/mailbox/restore-thread.ts +52 -0
  259. package/worker/mailbox/retention.ts +36 -0
  260. package/worker/mailbox/schema.ts +211 -1
  261. package/worker/mailbox/senders.ts +216 -178
  262. package/worker/mailbox/spam-undo-filing.ts +138 -0
  263. package/worker/mailbox/spam-undo.ts +240 -0
  264. package/worker/mailbox/support.ts +416 -0
  265. package/worker/mcp/mail-action-tools.ts +156 -0
  266. package/worker/mcp/mail-compose-tools.ts +8 -2
  267. package/worker/mcp/mail-safety-tools.ts +4 -4
  268. package/worker/module.ts +23 -2
  269. package/src/mail/use-compose-submission.ts +0 -208
  270. package/src/mail/use-reply-submission.ts +0 -114
  271. package/worker/mail/capped-body.ts +0 -36
@@ -15,6 +15,20 @@
15
15
  "when": 1794379791382,
16
16
  "tag": "0001_mute_jack_flag",
17
17
  "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "6",
22
+ "when": 1794581335782,
23
+ "tag": "0002_good_komodo",
24
+ "breakpoints": true
25
+ },
26
+ {
27
+ "idx": 3,
28
+ "version": "6",
29
+ "when": 1795144622814,
30
+ "tag": "0003_after_0_4_2",
31
+ "breakpoints": true
18
32
  }
19
33
  ]
20
34
  }
@@ -1,12 +1,16 @@
1
1
  import journal from './meta/_journal.json';
2
2
  import m0000 from './0000_puzzling_dracula.sql';
3
3
  import m0001 from './0001_mute_jack_flag.sql';
4
+ import m0002 from './0002_good_komodo.sql';
5
+ import m0003 from './0003_after_0_4_2.sql';
4
6
 
5
7
  export default {
6
8
  journal,
7
9
  migrations: {
8
10
  m0000,
9
- m0001
11
+ m0001,
12
+ m0002,
13
+ m0003
10
14
  }
11
15
  }
12
16
 
@@ -0,0 +1,2 @@
1
+ ALTER TABLE `push_subscriptions` ADD `session_id` text;--> statement-breakpoint
2
+ CREATE INDEX `push_subscriptions_session_idx` ON `push_subscriptions` (`session_id`);
@@ -0,0 +1,35 @@
1
+ CREATE TABLE `mail_archive_entries` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `mailbox_id` text NOT NULL,
4
+ `direction` text NOT NULL,
5
+ `source_key` text,
6
+ `status` text DEFAULT 'pending' NOT NULL,
7
+ `attempts` integer DEFAULT 0 NOT NULL,
8
+ `last_error` text,
9
+ `archive_key` text NOT NULL,
10
+ `sha256` text,
11
+ `size` integer,
12
+ `created_at` integer NOT NULL,
13
+ `updated_at` integer NOT NULL,
14
+ `archived_at` integer
15
+ );
16
+ --> statement-breakpoint
17
+ CREATE INDEX `mail_archive_entries_status_idx` ON `mail_archive_entries` (`status`,`created_at`);--> statement-breakpoint
18
+ CREATE INDEX `mail_archive_entries_source_idx` ON `mail_archive_entries` (`source_key`);--> statement-breakpoint
19
+ CREATE INDEX `mail_archive_entries_mailbox_idx` ON `mail_archive_entries` (`mailbox_id`,`status`);--> statement-breakpoint
20
+ CREATE TABLE `signatures` (
21
+ `user_id` text,
22
+ `mailbox_id` text,
23
+ `html` text NOT NULL,
24
+ `text` text NOT NULL,
25
+ `images` text NOT NULL,
26
+ `use_on_new` integer DEFAULT true NOT NULL,
27
+ `use_on_reply` integer DEFAULT true NOT NULL,
28
+ `updated_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
29
+ FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade,
30
+ FOREIGN KEY (`mailbox_id`) REFERENCES `mailboxes`(`id`) ON UPDATE no action ON DELETE cascade,
31
+ CONSTRAINT "signatures_one_owner" CHECK(("signatures"."user_id" is null) <> ("signatures"."mailbox_id" is null))
32
+ );
33
+ --> statement-breakpoint
34
+ CREATE UNIQUE INDEX `signatures_user_idx` ON `signatures` (`user_id`);--> statement-breakpoint
35
+ CREATE UNIQUE INDEX `signatures_mailbox_idx` ON `signatures` (`mailbox_id`);
@@ -0,0 +1,564 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "63092f02-08dd-4c6e-82ff-ad66a1642095",
5
+ "prevId": "3c9a9f87-017b-4419-8672-d798164a2460",
6
+ "tables": {
7
+ "blocked_senders": {
8
+ "name": "blocked_senders",
9
+ "columns": {
10
+ "pattern": {
11
+ "name": "pattern",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "created_by_user_id": {
18
+ "name": "created_by_user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": false,
22
+ "autoincrement": false
23
+ },
24
+ "created_at": {
25
+ "name": "created_at",
26
+ "type": "integer",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ }
31
+ },
32
+ "indexes": {},
33
+ "foreignKeys": {
34
+ "blocked_senders_created_by_user_id_users_id_fk": {
35
+ "name": "blocked_senders_created_by_user_id_users_id_fk",
36
+ "tableFrom": "blocked_senders",
37
+ "tableTo": "users",
38
+ "columnsFrom": [
39
+ "created_by_user_id"
40
+ ],
41
+ "columnsTo": [
42
+ "id"
43
+ ],
44
+ "onDelete": "set null",
45
+ "onUpdate": "no action"
46
+ }
47
+ },
48
+ "compositePrimaryKeys": {},
49
+ "uniqueConstraints": {},
50
+ "checkConstraints": {}
51
+ },
52
+ "jmap_push_subscriptions": {
53
+ "name": "jmap_push_subscriptions",
54
+ "columns": {
55
+ "id": {
56
+ "name": "id",
57
+ "type": "text",
58
+ "primaryKey": true,
59
+ "notNull": true,
60
+ "autoincrement": false
61
+ },
62
+ "user_id": {
63
+ "name": "user_id",
64
+ "type": "text",
65
+ "primaryKey": false,
66
+ "notNull": true,
67
+ "autoincrement": false
68
+ },
69
+ "client_id": {
70
+ "name": "client_id",
71
+ "type": "text",
72
+ "primaryKey": false,
73
+ "notNull": true,
74
+ "autoincrement": false
75
+ },
76
+ "device_client_id": {
77
+ "name": "device_client_id",
78
+ "type": "text",
79
+ "primaryKey": false,
80
+ "notNull": true,
81
+ "autoincrement": false
82
+ },
83
+ "url": {
84
+ "name": "url",
85
+ "type": "text",
86
+ "primaryKey": false,
87
+ "notNull": true,
88
+ "autoincrement": false
89
+ },
90
+ "p256dh": {
91
+ "name": "p256dh",
92
+ "type": "text",
93
+ "primaryKey": false,
94
+ "notNull": false,
95
+ "autoincrement": false
96
+ },
97
+ "auth": {
98
+ "name": "auth",
99
+ "type": "text",
100
+ "primaryKey": false,
101
+ "notNull": false,
102
+ "autoincrement": false
103
+ },
104
+ "verification_code": {
105
+ "name": "verification_code",
106
+ "type": "text",
107
+ "primaryKey": false,
108
+ "notNull": true,
109
+ "autoincrement": false
110
+ },
111
+ "verified_at": {
112
+ "name": "verified_at",
113
+ "type": "integer",
114
+ "primaryKey": false,
115
+ "notNull": false,
116
+ "autoincrement": false
117
+ },
118
+ "expires_at": {
119
+ "name": "expires_at",
120
+ "type": "integer",
121
+ "primaryKey": false,
122
+ "notNull": true,
123
+ "autoincrement": false
124
+ },
125
+ "types_json": {
126
+ "name": "types_json",
127
+ "type": "text",
128
+ "primaryKey": false,
129
+ "notNull": false,
130
+ "autoincrement": false
131
+ },
132
+ "created_at": {
133
+ "name": "created_at",
134
+ "type": "integer",
135
+ "primaryKey": false,
136
+ "notNull": true,
137
+ "autoincrement": false
138
+ }
139
+ },
140
+ "indexes": {
141
+ "jmap_push_subscriptions_device_unique": {
142
+ "name": "jmap_push_subscriptions_device_unique",
143
+ "columns": [
144
+ "user_id",
145
+ "device_client_id"
146
+ ],
147
+ "isUnique": true
148
+ },
149
+ "jmap_push_subscriptions_expires_idx": {
150
+ "name": "jmap_push_subscriptions_expires_idx",
151
+ "columns": [
152
+ "expires_at"
153
+ ],
154
+ "isUnique": false
155
+ }
156
+ },
157
+ "foreignKeys": {
158
+ "jmap_push_subscriptions_client_id_user_id_oidc_grants_client_id_user_id_fk": {
159
+ "name": "jmap_push_subscriptions_client_id_user_id_oidc_grants_client_id_user_id_fk",
160
+ "tableFrom": "jmap_push_subscriptions",
161
+ "tableTo": "oidc_grants",
162
+ "columnsFrom": [
163
+ "client_id",
164
+ "user_id"
165
+ ],
166
+ "columnsTo": [
167
+ "client_id",
168
+ "user_id"
169
+ ],
170
+ "onDelete": "cascade",
171
+ "onUpdate": "no action"
172
+ }
173
+ },
174
+ "compositePrimaryKeys": {},
175
+ "uniqueConstraints": {},
176
+ "checkConstraints": {}
177
+ },
178
+ "mailbox_counts": {
179
+ "name": "mailbox_counts",
180
+ "columns": {
181
+ "mailbox_id": {
182
+ "name": "mailbox_id",
183
+ "type": "text",
184
+ "primaryKey": true,
185
+ "notNull": true,
186
+ "autoincrement": false
187
+ },
188
+ "incoming_count": {
189
+ "name": "incoming_count",
190
+ "type": "integer",
191
+ "primaryKey": false,
192
+ "notNull": true,
193
+ "autoincrement": false
194
+ },
195
+ "version": {
196
+ "name": "version",
197
+ "type": "integer",
198
+ "primaryKey": false,
199
+ "notNull": true,
200
+ "autoincrement": false
201
+ },
202
+ "updated_at": {
203
+ "name": "updated_at",
204
+ "type": "integer",
205
+ "primaryKey": false,
206
+ "notNull": true,
207
+ "autoincrement": false
208
+ }
209
+ },
210
+ "indexes": {},
211
+ "foreignKeys": {
212
+ "mailbox_counts_mailbox_id_mailboxes_id_fk": {
213
+ "name": "mailbox_counts_mailbox_id_mailboxes_id_fk",
214
+ "tableFrom": "mailbox_counts",
215
+ "tableTo": "mailboxes",
216
+ "columnsFrom": [
217
+ "mailbox_id"
218
+ ],
219
+ "columnsTo": [
220
+ "id"
221
+ ],
222
+ "onDelete": "cascade",
223
+ "onUpdate": "no action"
224
+ }
225
+ },
226
+ "compositePrimaryKeys": {},
227
+ "uniqueConstraints": {},
228
+ "checkConstraints": {}
229
+ },
230
+ "mailbox_notification_preferences": {
231
+ "name": "mailbox_notification_preferences",
232
+ "columns": {
233
+ "mailbox_id": {
234
+ "name": "mailbox_id",
235
+ "type": "text",
236
+ "primaryKey": false,
237
+ "notNull": true,
238
+ "autoincrement": false
239
+ },
240
+ "user_id": {
241
+ "name": "user_id",
242
+ "type": "text",
243
+ "primaryKey": false,
244
+ "notNull": true,
245
+ "autoincrement": false
246
+ },
247
+ "enabled": {
248
+ "name": "enabled",
249
+ "type": "integer",
250
+ "primaryKey": false,
251
+ "notNull": true,
252
+ "autoincrement": false,
253
+ "default": true
254
+ },
255
+ "updated_at": {
256
+ "name": "updated_at",
257
+ "type": "integer",
258
+ "primaryKey": false,
259
+ "notNull": true,
260
+ "autoincrement": false,
261
+ "default": "(unixepoch() * 1000)"
262
+ }
263
+ },
264
+ "indexes": {
265
+ "mailbox_notification_preferences_user_idx": {
266
+ "name": "mailbox_notification_preferences_user_idx",
267
+ "columns": [
268
+ "user_id"
269
+ ],
270
+ "isUnique": false
271
+ }
272
+ },
273
+ "foreignKeys": {
274
+ "mailbox_notification_preferences_mailbox_id_mailboxes_id_fk": {
275
+ "name": "mailbox_notification_preferences_mailbox_id_mailboxes_id_fk",
276
+ "tableFrom": "mailbox_notification_preferences",
277
+ "tableTo": "mailboxes",
278
+ "columnsFrom": [
279
+ "mailbox_id"
280
+ ],
281
+ "columnsTo": [
282
+ "id"
283
+ ],
284
+ "onDelete": "cascade",
285
+ "onUpdate": "no action"
286
+ },
287
+ "mailbox_notification_preferences_user_id_users_id_fk": {
288
+ "name": "mailbox_notification_preferences_user_id_users_id_fk",
289
+ "tableFrom": "mailbox_notification_preferences",
290
+ "tableTo": "users",
291
+ "columnsFrom": [
292
+ "user_id"
293
+ ],
294
+ "columnsTo": [
295
+ "id"
296
+ ],
297
+ "onDelete": "cascade",
298
+ "onUpdate": "no action"
299
+ }
300
+ },
301
+ "compositePrimaryKeys": {
302
+ "mailbox_notification_preferences_mailbox_id_user_id_pk": {
303
+ "columns": [
304
+ "mailbox_id",
305
+ "user_id"
306
+ ],
307
+ "name": "mailbox_notification_preferences_mailbox_id_user_id_pk"
308
+ }
309
+ },
310
+ "uniqueConstraints": {},
311
+ "checkConstraints": {}
312
+ },
313
+ "mailbox_read_counts": {
314
+ "name": "mailbox_read_counts",
315
+ "columns": {
316
+ "mailbox_id": {
317
+ "name": "mailbox_id",
318
+ "type": "text",
319
+ "primaryKey": false,
320
+ "notNull": true,
321
+ "autoincrement": false
322
+ },
323
+ "user_id": {
324
+ "name": "user_id",
325
+ "type": "text",
326
+ "primaryKey": false,
327
+ "notNull": true,
328
+ "autoincrement": false
329
+ },
330
+ "read_count": {
331
+ "name": "read_count",
332
+ "type": "integer",
333
+ "primaryKey": false,
334
+ "notNull": true,
335
+ "autoincrement": false
336
+ }
337
+ },
338
+ "indexes": {},
339
+ "foreignKeys": {
340
+ "mailbox_read_counts_mailbox_id_mailboxes_id_fk": {
341
+ "name": "mailbox_read_counts_mailbox_id_mailboxes_id_fk",
342
+ "tableFrom": "mailbox_read_counts",
343
+ "tableTo": "mailboxes",
344
+ "columnsFrom": [
345
+ "mailbox_id"
346
+ ],
347
+ "columnsTo": [
348
+ "id"
349
+ ],
350
+ "onDelete": "cascade",
351
+ "onUpdate": "no action"
352
+ }
353
+ },
354
+ "compositePrimaryKeys": {
355
+ "mailbox_read_counts_mailbox_id_user_id_pk": {
356
+ "columns": [
357
+ "mailbox_id",
358
+ "user_id"
359
+ ],
360
+ "name": "mailbox_read_counts_mailbox_id_user_id_pk"
361
+ }
362
+ },
363
+ "uniqueConstraints": {},
364
+ "checkConstraints": {}
365
+ },
366
+ "push_subscriptions": {
367
+ "name": "push_subscriptions",
368
+ "columns": {
369
+ "id": {
370
+ "name": "id",
371
+ "type": "text",
372
+ "primaryKey": true,
373
+ "notNull": true,
374
+ "autoincrement": false
375
+ },
376
+ "user_id": {
377
+ "name": "user_id",
378
+ "type": "text",
379
+ "primaryKey": false,
380
+ "notNull": true,
381
+ "autoincrement": false
382
+ },
383
+ "session_id": {
384
+ "name": "session_id",
385
+ "type": "text",
386
+ "primaryKey": false,
387
+ "notNull": false,
388
+ "autoincrement": false
389
+ },
390
+ "endpoint": {
391
+ "name": "endpoint",
392
+ "type": "text",
393
+ "primaryKey": false,
394
+ "notNull": true,
395
+ "autoincrement": false
396
+ },
397
+ "p256dh": {
398
+ "name": "p256dh",
399
+ "type": "text",
400
+ "primaryKey": false,
401
+ "notNull": true,
402
+ "autoincrement": false
403
+ },
404
+ "auth": {
405
+ "name": "auth",
406
+ "type": "text",
407
+ "primaryKey": false,
408
+ "notNull": true,
409
+ "autoincrement": false
410
+ },
411
+ "created_at": {
412
+ "name": "created_at",
413
+ "type": "integer",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "autoincrement": false,
417
+ "default": "(unixepoch() * 1000)"
418
+ },
419
+ "updated_at": {
420
+ "name": "updated_at",
421
+ "type": "integer",
422
+ "primaryKey": false,
423
+ "notNull": true,
424
+ "autoincrement": false,
425
+ "default": "(unixepoch() * 1000)"
426
+ }
427
+ },
428
+ "indexes": {
429
+ "push_subscriptions_endpoint_unique": {
430
+ "name": "push_subscriptions_endpoint_unique",
431
+ "columns": [
432
+ "endpoint"
433
+ ],
434
+ "isUnique": true
435
+ },
436
+ "push_subscriptions_user_idx": {
437
+ "name": "push_subscriptions_user_idx",
438
+ "columns": [
439
+ "user_id"
440
+ ],
441
+ "isUnique": false
442
+ },
443
+ "push_subscriptions_session_idx": {
444
+ "name": "push_subscriptions_session_idx",
445
+ "columns": [
446
+ "session_id"
447
+ ],
448
+ "isUnique": false
449
+ }
450
+ },
451
+ "foreignKeys": {
452
+ "push_subscriptions_user_id_users_id_fk": {
453
+ "name": "push_subscriptions_user_id_users_id_fk",
454
+ "tableFrom": "push_subscriptions",
455
+ "tableTo": "users",
456
+ "columnsFrom": [
457
+ "user_id"
458
+ ],
459
+ "columnsTo": [
460
+ "id"
461
+ ],
462
+ "onDelete": "cascade",
463
+ "onUpdate": "no action"
464
+ }
465
+ },
466
+ "compositePrimaryKeys": {},
467
+ "uniqueConstraints": {},
468
+ "checkConstraints": {}
469
+ },
470
+ "sender_reports": {
471
+ "name": "sender_reports",
472
+ "columns": {
473
+ "mailbox_id": {
474
+ "name": "mailbox_id",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true,
478
+ "autoincrement": false
479
+ },
480
+ "email_id": {
481
+ "name": "email_id",
482
+ "type": "text",
483
+ "primaryKey": false,
484
+ "notNull": true,
485
+ "autoincrement": false
486
+ },
487
+ "address": {
488
+ "name": "address",
489
+ "type": "text",
490
+ "primaryKey": false,
491
+ "notNull": true,
492
+ "autoincrement": false
493
+ },
494
+ "domain": {
495
+ "name": "domain",
496
+ "type": "text",
497
+ "primaryKey": false,
498
+ "notNull": true,
499
+ "autoincrement": false
500
+ },
501
+ "label": {
502
+ "name": "label",
503
+ "type": "text",
504
+ "primaryKey": false,
505
+ "notNull": true,
506
+ "autoincrement": false
507
+ },
508
+ "created_at": {
509
+ "name": "created_at",
510
+ "type": "integer",
511
+ "primaryKey": false,
512
+ "notNull": true,
513
+ "autoincrement": false
514
+ }
515
+ },
516
+ "indexes": {
517
+ "sender_reports_domain_idx": {
518
+ "name": "sender_reports_domain_idx",
519
+ "columns": [
520
+ "domain",
521
+ "address"
522
+ ],
523
+ "isUnique": false
524
+ }
525
+ },
526
+ "foreignKeys": {
527
+ "sender_reports_mailbox_id_mailboxes_id_fk": {
528
+ "name": "sender_reports_mailbox_id_mailboxes_id_fk",
529
+ "tableFrom": "sender_reports",
530
+ "tableTo": "mailboxes",
531
+ "columnsFrom": [
532
+ "mailbox_id"
533
+ ],
534
+ "columnsTo": [
535
+ "id"
536
+ ],
537
+ "onDelete": "cascade",
538
+ "onUpdate": "no action"
539
+ }
540
+ },
541
+ "compositePrimaryKeys": {
542
+ "sender_reports_mailbox_id_email_id_pk": {
543
+ "columns": [
544
+ "mailbox_id",
545
+ "email_id"
546
+ ],
547
+ "name": "sender_reports_mailbox_id_email_id_pk"
548
+ }
549
+ },
550
+ "uniqueConstraints": {},
551
+ "checkConstraints": {}
552
+ }
553
+ },
554
+ "views": {},
555
+ "enums": {},
556
+ "_meta": {
557
+ "schemas": {},
558
+ "tables": {},
559
+ "columns": {}
560
+ },
561
+ "internal": {
562
+ "indexes": {}
563
+ }
564
+ }