@remit/data-ports 0.0.83 → 0.0.85

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 (174) hide show
  1. package/dist/account-settings.d.ts +371 -0
  2. package/dist/account-settings.js +114 -0
  3. package/dist/conformance/account.d.ts +3 -0
  4. package/dist/conformance/account.js +118 -0
  5. package/dist/conformance/calendar-collection.d.ts +3 -0
  6. package/dist/conformance/calendar-collection.js +251 -0
  7. package/dist/conformance/calendar-event-index.d.ts +3 -0
  8. package/dist/conformance/calendar-event-index.js +114 -0
  9. package/dist/conformance/calendar-feed-token.d.ts +3 -0
  10. package/dist/conformance/calendar-feed-token.js +97 -0
  11. package/dist/conformance/calendar-object.d.ts +3 -0
  12. package/dist/conformance/calendar-object.js +156 -0
  13. package/dist/conformance/calendar-suggestion.d.ts +3 -0
  14. package/dist/conformance/calendar-suggestion.js +255 -0
  15. package/{src/conformance/harness.ts → dist/conformance/harness.d.ts} +4 -4
  16. package/dist/conformance/harness.js +1 -0
  17. package/dist/conformance/index.js +8 -0
  18. package/dist/conformance/label.d.ts +3 -0
  19. package/dist/conformance/label.js +92 -0
  20. package/dist/conformance/sender-signer-standing.d.ts +3 -0
  21. package/dist/conformance/sender-signer-standing.js +81 -0
  22. package/dist/display-name.d.ts +1 -0
  23. package/dist/display-name.js +26 -0
  24. package/dist/errors.d.ts +150 -0
  25. package/dist/errors.js +181 -0
  26. package/dist/filter-ttl.d.ts +7 -0
  27. package/{src/filter-ttl.ts → dist/filter-ttl.js} +8 -11
  28. package/dist/folder-role.d.ts +239 -0
  29. package/dist/folder-role.js +276 -0
  30. package/dist/id.d.ts +124 -0
  31. package/{src/id.ts → dist/id.js} +41 -127
  32. package/dist/index.d.ts +37 -0
  33. package/dist/index.js +5 -0
  34. package/dist/interfaces/account-config.d.ts +15 -0
  35. package/dist/interfaces/account-config.js +1 -0
  36. package/dist/interfaces/account-export-request.d.ts +10 -0
  37. package/dist/interfaces/account-export-request.js +1 -0
  38. package/dist/interfaces/account-setting.d.ts +8 -0
  39. package/dist/interfaces/account-setting.js +1 -0
  40. package/dist/interfaces/account.d.ts +29 -0
  41. package/dist/interfaces/account.js +1 -0
  42. package/dist/interfaces/address.d.ts +70 -0
  43. package/dist/interfaces/address.js +1 -0
  44. package/dist/interfaces/calendar-collection.d.ts +38 -0
  45. package/dist/interfaces/calendar-collection.js +1 -0
  46. package/dist/interfaces/calendar-event-index.d.ts +19 -0
  47. package/dist/interfaces/calendar-event-index.js +1 -0
  48. package/dist/interfaces/calendar-feed-token.d.ts +31 -0
  49. package/dist/interfaces/calendar-feed-token.js +1 -0
  50. package/dist/interfaces/calendar-object.d.ts +36 -0
  51. package/dist/interfaces/calendar-object.js +1 -0
  52. package/dist/interfaces/calendar-store.d.ts +93 -0
  53. package/dist/interfaces/calendar-store.js +1 -0
  54. package/dist/interfaces/calendar-suggestion.d.ts +62 -0
  55. package/dist/interfaces/calendar-suggestion.js +1 -0
  56. package/dist/interfaces/config-import.d.ts +8 -0
  57. package/dist/interfaces/config-import.js +1 -0
  58. package/dist/interfaces/envelope.d.ts +24 -0
  59. package/dist/interfaces/envelope.js +1 -0
  60. package/dist/interfaces/filter.d.ts +28 -0
  61. package/dist/interfaces/filter.js +1 -0
  62. package/dist/interfaces/label.d.ts +17 -0
  63. package/dist/interfaces/label.js +1 -0
  64. package/dist/interfaces/mailbox-lock.d.ts +12 -0
  65. package/dist/interfaces/mailbox-lock.js +1 -0
  66. package/dist/interfaces/mailbox-special-use.d.ts +54 -0
  67. package/dist/interfaces/mailbox-special-use.js +1 -0
  68. package/dist/interfaces/mailbox.d.ts +79 -0
  69. package/dist/interfaces/mailbox.js +1 -0
  70. package/dist/interfaces/message-flag-push.d.ts +9 -0
  71. package/dist/interfaces/message-flag-push.js +1 -0
  72. package/dist/interfaces/message-flag.d.ts +14 -0
  73. package/dist/interfaces/message-flag.js +1 -0
  74. package/dist/interfaces/message-label.d.ts +21 -0
  75. package/dist/interfaces/message-label.js +1 -0
  76. package/dist/interfaces/message-placement-move.d.ts +8 -0
  77. package/dist/interfaces/message-placement-move.js +1 -0
  78. package/dist/interfaces/message.d.ts +60 -0
  79. package/dist/interfaces/message.js +1 -0
  80. package/dist/interfaces/organize-job-request.d.ts +10 -0
  81. package/dist/interfaces/organize-job-request.js +1 -0
  82. package/dist/interfaces/outbox-attachment.d.ts +101 -0
  83. package/dist/interfaces/outbox-attachment.js +7 -0
  84. package/dist/interfaces/outbox-message.d.ts +70 -0
  85. package/dist/interfaces/outbox-message.js +20 -0
  86. package/dist/interfaces/quarantine.d.ts +20 -0
  87. package/dist/interfaces/quarantine.js +1 -0
  88. package/dist/interfaces/sender-signer-standing.d.ts +26 -0
  89. package/dist/interfaces/sender-signer-standing.js +1 -0
  90. package/dist/interfaces/sync-warning.d.ts +11 -0
  91. package/dist/interfaces/sync-warning.js +1 -0
  92. package/dist/interfaces/thread-message.d.ts +202 -0
  93. package/dist/interfaces/thread-message.js +1 -0
  94. package/dist/mailbox-name.d.ts +35 -0
  95. package/dist/mailbox-name.js +68 -0
  96. package/dist/message-parts.d.ts +22 -0
  97. package/dist/message-parts.js +18 -0
  98. package/dist/message-settlement.d.ts +35 -0
  99. package/{src/message-settlement.ts → dist/message-settlement.js} +5 -19
  100. package/dist/mutation-events.d.ts +19 -0
  101. package/{src/mutation-events.ts → dist/mutation-events.js} +2 -5
  102. package/dist/sender-mute.d.ts +26 -0
  103. package/{src/sender-mute.ts → dist/sender-mute.js} +12 -34
  104. package/dist/sync-warning-state.d.ts +3 -0
  105. package/dist/sync-warning-state.js +5 -0
  106. package/dist/types.d.ts +491 -0
  107. package/dist/types.js +1 -0
  108. package/dist/update-manifest.d.ts +24 -0
  109. package/dist/update-manifest.js +20 -0
  110. package/dist/virtual-copy.d.ts +8 -0
  111. package/{src/virtual-copy.ts → dist/virtual-copy.js} +10 -15
  112. package/dist/wellknown.d.ts +47 -0
  113. package/{src/wellknown.ts → dist/wellknown.js} +26 -49
  114. package/package.json +44 -79
  115. package/src/account-settings.ts +0 -194
  116. package/src/conformance/account.ts +0 -104
  117. package/src/conformance/calendar-collection.ts +0 -342
  118. package/src/conformance/calendar-event-index.ts +0 -203
  119. package/src/conformance/calendar-feed-token.ts +0 -148
  120. package/src/conformance/calendar-object.ts +0 -269
  121. package/src/conformance/calendar-suggestion.ts +0 -490
  122. package/src/conformance/label.ts +0 -136
  123. package/src/conformance/sender-signer-standing.ts +0 -117
  124. package/src/display-name.test.ts +0 -101
  125. package/src/display-name.ts +0 -40
  126. package/src/errors.ts +0 -244
  127. package/src/folder-role.test.ts +0 -422
  128. package/src/folder-role.ts +0 -447
  129. package/src/id.test.ts +0 -352
  130. package/src/index.ts +0 -170
  131. package/src/interfaces/account-config.ts +0 -25
  132. package/src/interfaces/account-export-request.ts +0 -21
  133. package/src/interfaces/account-setting.ts +0 -14
  134. package/src/interfaces/account.ts +0 -43
  135. package/src/interfaces/address.ts +0 -122
  136. package/src/interfaces/calendar-collection.ts +0 -60
  137. package/src/interfaces/calendar-event-index.ts +0 -34
  138. package/src/interfaces/calendar-feed-token.ts +0 -38
  139. package/src/interfaces/calendar-object.ts +0 -58
  140. package/src/interfaces/calendar-suggestion.ts +0 -93
  141. package/src/interfaces/calendar-unit-of-work.ts +0 -47
  142. package/src/interfaces/config-import.ts +0 -16
  143. package/src/interfaces/envelope.ts +0 -32
  144. package/src/interfaces/filter-anchor-transaction.ts +0 -23
  145. package/src/interfaces/filter-anchor.ts +0 -11
  146. package/src/interfaces/filter.ts +0 -41
  147. package/src/interfaces/label.ts +0 -30
  148. package/src/interfaces/mailbox-lock.ts +0 -32
  149. package/src/interfaces/mailbox-special-use.ts +0 -60
  150. package/src/interfaces/mailbox.ts +0 -115
  151. package/src/interfaces/message-flag-push.ts +0 -17
  152. package/src/interfaces/message-flag.ts +0 -15
  153. package/src/interfaces/message-label.ts +0 -25
  154. package/src/interfaces/message-placement-move.ts +0 -15
  155. package/src/interfaces/message.ts +0 -65
  156. package/src/interfaces/organize-job-request.ts +0 -19
  157. package/src/interfaces/outbox-attachment.ts +0 -132
  158. package/src/interfaces/outbox-message.ts +0 -106
  159. package/src/interfaces/quarantine.ts +0 -22
  160. package/src/interfaces/sender-signer-standing.ts +0 -37
  161. package/src/interfaces/thread-message.ts +0 -264
  162. package/src/interfaces/unit-of-work.ts +0 -28
  163. package/src/mailbox-name.test.ts +0 -106
  164. package/src/mailbox-name.ts +0 -90
  165. package/src/mailbox-state-doors.test.ts +0 -104
  166. package/src/message-placement-doors.test.ts +0 -100
  167. package/src/message-settlement.test.ts +0 -132
  168. package/src/sender-mute.test.ts +0 -76
  169. package/src/types.ts +0 -820
  170. package/src/update-manifest.test.ts +0 -130
  171. package/src/update-manifest.ts +0 -22
  172. package/src/virtual-copy.test.ts +0 -34
  173. package/tsconfig.json +0 -8
  174. /package/{src/conformance/index.ts → dist/conformance/index.d.ts} +0 -0
@@ -1,130 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { describe, it } from "node:test";
3
- import { UpdateManifestSchema } from "./update-manifest.js";
4
-
5
- const GOOD_MANIFEST = {
6
- version: "v1.5.0",
7
- publishedAt: "2026-07-18T09:00:00Z",
8
- summary: "Faster search and a fix for attachments over 25 MB.",
9
- releaseNotesUrl: "https://github.com/remit-mail/reader/releases/tag/v1.5.0",
10
- registry: "ghcr.io/remit-mail/reader",
11
- };
12
-
13
- describe("UpdateManifestSchema", () => {
14
- it("accepts the documented manifest shape", () => {
15
- assert.deepEqual(UpdateManifestSchema.parse(GOOD_MANIFEST), GOOD_MANIFEST);
16
- });
17
-
18
- it("rejects a version that is not vX.Y.Z", () => {
19
- assert.throws(() =>
20
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, version: "1.5.0" }),
21
- );
22
- assert.throws(() =>
23
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, version: "v1.5" }),
24
- );
25
- assert.throws(() =>
26
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, version: "v1.5.0-rc1" }),
27
- );
28
- });
29
-
30
- it("rejects a publishedAt that is not ISO 8601", () => {
31
- assert.throws(() =>
32
- UpdateManifestSchema.parse({
33
- ...GOOD_MANIFEST,
34
- publishedAt: "18 July 2026",
35
- }),
36
- );
37
- });
38
-
39
- it("rejects an empty summary", () => {
40
- assert.throws(() =>
41
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, summary: "" }),
42
- );
43
- });
44
-
45
- it("rejects a summary over 140 characters", () => {
46
- assert.throws(() =>
47
- UpdateManifestSchema.parse({
48
- ...GOOD_MANIFEST,
49
- summary: "x".repeat(141),
50
- }),
51
- );
52
- });
53
-
54
- it("accepts a summary at exactly 140 characters", () => {
55
- const summary = "x".repeat(140);
56
- assert.equal(
57
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, summary }).summary,
58
- summary,
59
- );
60
- });
61
-
62
- it("rejects a releaseNotesUrl that is not a URL", () => {
63
- assert.throws(() =>
64
- UpdateManifestSchema.parse({
65
- ...GOOD_MANIFEST,
66
- releaseNotesUrl: "not-a-url",
67
- }),
68
- );
69
- });
70
-
71
- it("rejects a releaseNotesUrl that is not https", () => {
72
- assert.throws(() =>
73
- UpdateManifestSchema.parse({
74
- ...GOOD_MANIFEST,
75
- releaseNotesUrl:
76
- "http://github.com/remit-mail/reader/releases/tag/v1.5.0",
77
- }),
78
- );
79
- });
80
-
81
- it("rejects a releaseNotesUrl using a non-http(s) scheme", () => {
82
- assert.throws(() =>
83
- UpdateManifestSchema.parse({
84
- ...GOOD_MANIFEST,
85
- releaseNotesUrl: "javascript:alert(1)",
86
- }),
87
- );
88
- });
89
-
90
- it("rejects an empty registry", () => {
91
- assert.throws(() =>
92
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, registry: "" }),
93
- );
94
- });
95
-
96
- it("rejects a manifest missing a required field", () => {
97
- const { summary, ...rest } = GOOD_MANIFEST;
98
- assert.throws(() => UpdateManifestSchema.parse(rest));
99
- });
100
-
101
- it("accepts a non-negative integer schemaVersion", () => {
102
- const withSchema = { ...GOOD_MANIFEST, schemaVersion: 9 };
103
- assert.deepEqual(UpdateManifestSchema.parse(withSchema), withSchema);
104
- });
105
-
106
- it("accepts a manifest without a schemaVersion", () => {
107
- assert.equal(
108
- UpdateManifestSchema.parse(GOOD_MANIFEST).schemaVersion,
109
- undefined,
110
- );
111
- });
112
-
113
- it("rejects a non-integer schemaVersion", () => {
114
- assert.throws(() =>
115
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, schemaVersion: 9.5 }),
116
- );
117
- });
118
-
119
- it("rejects a negative schemaVersion", () => {
120
- assert.throws(() =>
121
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, schemaVersion: -1 }),
122
- );
123
- });
124
-
125
- it("rejects a schemaVersion that is not a number", () => {
126
- assert.throws(() =>
127
- UpdateManifestSchema.parse({ ...GOOD_MANIFEST, schemaVersion: "9" }),
128
- );
129
- });
130
- });
@@ -1,22 +0,0 @@
1
- import { z } from "zod";
2
-
3
- export const SUMMARY_MAX_LENGTH = 140;
4
-
5
- export const UpdateManifestSchema = z.object({
6
- version: z.string().regex(/^v\d+\.\d+\.\d+$/),
7
- publishedAt: z.string().datetime(),
8
- summary: z.string().min(1).max(SUMMARY_MAX_LENGTH),
9
- releaseNotesUrl: z
10
- .string()
11
- .url()
12
- .refine((url) => url.startsWith("https://"), {
13
- message: "releaseNotesUrl must be an https:// URL",
14
- }),
15
- registry: z.string().min(1),
16
- // The highest schema migration the release applies, as a count of the
17
- // migrations shipped at that release. The updater compares it against the
18
- // running instance's version to tell whether installing this release runs a
19
- // migration. Optional so a manifest published before this field validates and
20
- // reads as an unknown schema version rather than an error.
21
- schemaVersion: z.number().int().nonnegative().optional(),
22
- });
@@ -1,34 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { describe, it } from "node:test";
3
- import type { MailboxItem } from "./types.js";
4
- import { isVirtualCopyMailbox } from "./virtual-copy.js";
5
-
6
- const mailbox = (fullPath: string, specialUse?: string[]): MailboxItem =>
7
- ({
8
- mailboxId: `mbx-${fullPath}`,
9
- fullPath,
10
- ...(specialUse ? { specialUse } : {}),
11
- }) as MailboxItem;
12
-
13
- describe("which folders hold a second copy of mail that lives elsewhere", () => {
14
- it("reads the special-use the server advertises", () => {
15
- assert.equal(isVirtualCopyMailbox(mailbox("Everything", ["All"])), true);
16
- assert.equal(isVirtualCopyMailbox(mailbox("Pinned", ["Flagged"])), true);
17
- assert.equal(isVirtualCopyMailbox(mailbox("Urgent", ["Important"])), true);
18
- });
19
-
20
- it("falls back to the well-known path when the server advertises nothing", () => {
21
- assert.equal(isVirtualCopyMailbox(mailbox("[Gmail]/All Mail")), true);
22
- assert.equal(isVirtualCopyMailbox(mailbox("[gmail]/starred")), true);
23
- });
24
-
25
- it("matches the whole path, so a folder of the user's own is real mail", () => {
26
- assert.equal(isVirtualCopyMailbox(mailbox("Starred ideas")), false);
27
- assert.equal(isVirtualCopyMailbox(mailbox("[Gmail]/All Mail/2024")), false);
28
- });
29
-
30
- it("reads an ordinary folder as the place mail lives", () => {
31
- assert.equal(isVirtualCopyMailbox(mailbox("INBOX")), false);
32
- assert.equal(isVirtualCopyMailbox(mailbox("Rubbish", ["Junk"])), false);
33
- });
34
- });
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- "rootDir": "src"
6
- },
7
- "include": ["src/**/*.ts"]
8
- }