@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.
- package/dist/account-settings.d.ts +371 -0
- package/dist/account-settings.js +114 -0
- package/dist/conformance/account.d.ts +3 -0
- package/dist/conformance/account.js +118 -0
- package/dist/conformance/calendar-collection.d.ts +3 -0
- package/dist/conformance/calendar-collection.js +251 -0
- package/dist/conformance/calendar-event-index.d.ts +3 -0
- package/dist/conformance/calendar-event-index.js +114 -0
- package/dist/conformance/calendar-feed-token.d.ts +3 -0
- package/dist/conformance/calendar-feed-token.js +97 -0
- package/dist/conformance/calendar-object.d.ts +3 -0
- package/dist/conformance/calendar-object.js +156 -0
- package/dist/conformance/calendar-suggestion.d.ts +3 -0
- package/dist/conformance/calendar-suggestion.js +255 -0
- package/{src/conformance/harness.ts → dist/conformance/harness.d.ts} +4 -4
- package/dist/conformance/harness.js +1 -0
- package/dist/conformance/index.js +8 -0
- package/dist/conformance/label.d.ts +3 -0
- package/dist/conformance/label.js +92 -0
- package/dist/conformance/sender-signer-standing.d.ts +3 -0
- package/dist/conformance/sender-signer-standing.js +81 -0
- package/dist/display-name.d.ts +1 -0
- package/dist/display-name.js +26 -0
- package/dist/errors.d.ts +150 -0
- package/dist/errors.js +181 -0
- package/dist/filter-ttl.d.ts +7 -0
- package/{src/filter-ttl.ts → dist/filter-ttl.js} +8 -11
- package/dist/folder-role.d.ts +239 -0
- package/dist/folder-role.js +276 -0
- package/dist/id.d.ts +124 -0
- package/{src/id.ts → dist/id.js} +41 -127
- package/dist/index.d.ts +37 -0
- package/dist/index.js +5 -0
- package/dist/interfaces/account-config.d.ts +15 -0
- package/dist/interfaces/account-config.js +1 -0
- package/dist/interfaces/account-export-request.d.ts +10 -0
- package/dist/interfaces/account-export-request.js +1 -0
- package/dist/interfaces/account-setting.d.ts +8 -0
- package/dist/interfaces/account-setting.js +1 -0
- package/dist/interfaces/account.d.ts +29 -0
- package/dist/interfaces/account.js +1 -0
- package/dist/interfaces/address.d.ts +70 -0
- package/dist/interfaces/address.js +1 -0
- package/dist/interfaces/calendar-collection.d.ts +38 -0
- package/dist/interfaces/calendar-collection.js +1 -0
- package/dist/interfaces/calendar-event-index.d.ts +19 -0
- package/dist/interfaces/calendar-event-index.js +1 -0
- package/dist/interfaces/calendar-feed-token.d.ts +31 -0
- package/dist/interfaces/calendar-feed-token.js +1 -0
- package/dist/interfaces/calendar-object.d.ts +36 -0
- package/dist/interfaces/calendar-object.js +1 -0
- package/dist/interfaces/calendar-store.d.ts +93 -0
- package/dist/interfaces/calendar-store.js +1 -0
- package/dist/interfaces/calendar-suggestion.d.ts +62 -0
- package/dist/interfaces/calendar-suggestion.js +1 -0
- package/dist/interfaces/config-import.d.ts +8 -0
- package/dist/interfaces/config-import.js +1 -0
- package/dist/interfaces/envelope.d.ts +24 -0
- package/dist/interfaces/envelope.js +1 -0
- package/dist/interfaces/filter.d.ts +28 -0
- package/dist/interfaces/filter.js +1 -0
- package/dist/interfaces/label.d.ts +17 -0
- package/dist/interfaces/label.js +1 -0
- package/dist/interfaces/mailbox-lock.d.ts +12 -0
- package/dist/interfaces/mailbox-lock.js +1 -0
- package/dist/interfaces/mailbox-special-use.d.ts +54 -0
- package/dist/interfaces/mailbox-special-use.js +1 -0
- package/dist/interfaces/mailbox.d.ts +79 -0
- package/dist/interfaces/mailbox.js +1 -0
- package/dist/interfaces/message-flag-push.d.ts +9 -0
- package/dist/interfaces/message-flag-push.js +1 -0
- package/dist/interfaces/message-flag.d.ts +14 -0
- package/dist/interfaces/message-flag.js +1 -0
- package/dist/interfaces/message-label.d.ts +21 -0
- package/dist/interfaces/message-label.js +1 -0
- package/dist/interfaces/message-placement-move.d.ts +8 -0
- package/dist/interfaces/message-placement-move.js +1 -0
- package/dist/interfaces/message.d.ts +60 -0
- package/dist/interfaces/message.js +1 -0
- package/dist/interfaces/organize-job-request.d.ts +10 -0
- package/dist/interfaces/organize-job-request.js +1 -0
- package/dist/interfaces/outbox-attachment.d.ts +101 -0
- package/dist/interfaces/outbox-attachment.js +7 -0
- package/dist/interfaces/outbox-message.d.ts +70 -0
- package/dist/interfaces/outbox-message.js +20 -0
- package/dist/interfaces/quarantine.d.ts +20 -0
- package/dist/interfaces/quarantine.js +1 -0
- package/dist/interfaces/sender-signer-standing.d.ts +26 -0
- package/dist/interfaces/sender-signer-standing.js +1 -0
- package/dist/interfaces/sync-warning.d.ts +11 -0
- package/dist/interfaces/sync-warning.js +1 -0
- package/dist/interfaces/thread-message.d.ts +202 -0
- package/dist/interfaces/thread-message.js +1 -0
- package/dist/mailbox-name.d.ts +35 -0
- package/dist/mailbox-name.js +68 -0
- package/dist/message-parts.d.ts +22 -0
- package/dist/message-parts.js +18 -0
- package/dist/message-settlement.d.ts +35 -0
- package/{src/message-settlement.ts → dist/message-settlement.js} +5 -19
- package/dist/mutation-events.d.ts +19 -0
- package/{src/mutation-events.ts → dist/mutation-events.js} +2 -5
- package/dist/sender-mute.d.ts +26 -0
- package/{src/sender-mute.ts → dist/sender-mute.js} +12 -34
- package/dist/sync-warning-state.d.ts +3 -0
- package/dist/sync-warning-state.js +5 -0
- package/dist/types.d.ts +491 -0
- package/dist/types.js +1 -0
- package/dist/update-manifest.d.ts +24 -0
- package/dist/update-manifest.js +20 -0
- package/dist/virtual-copy.d.ts +8 -0
- package/{src/virtual-copy.ts → dist/virtual-copy.js} +10 -15
- package/dist/wellknown.d.ts +47 -0
- package/{src/wellknown.ts → dist/wellknown.js} +26 -49
- package/package.json +44 -79
- package/src/account-settings.ts +0 -194
- package/src/conformance/account.ts +0 -104
- package/src/conformance/calendar-collection.ts +0 -342
- package/src/conformance/calendar-event-index.ts +0 -203
- package/src/conformance/calendar-feed-token.ts +0 -148
- package/src/conformance/calendar-object.ts +0 -269
- package/src/conformance/calendar-suggestion.ts +0 -490
- package/src/conformance/label.ts +0 -136
- package/src/conformance/sender-signer-standing.ts +0 -117
- package/src/display-name.test.ts +0 -101
- package/src/display-name.ts +0 -40
- package/src/errors.ts +0 -244
- package/src/folder-role.test.ts +0 -422
- package/src/folder-role.ts +0 -447
- package/src/id.test.ts +0 -352
- package/src/index.ts +0 -170
- package/src/interfaces/account-config.ts +0 -25
- package/src/interfaces/account-export-request.ts +0 -21
- package/src/interfaces/account-setting.ts +0 -14
- package/src/interfaces/account.ts +0 -43
- package/src/interfaces/address.ts +0 -122
- package/src/interfaces/calendar-collection.ts +0 -60
- package/src/interfaces/calendar-event-index.ts +0 -34
- package/src/interfaces/calendar-feed-token.ts +0 -38
- package/src/interfaces/calendar-object.ts +0 -58
- package/src/interfaces/calendar-suggestion.ts +0 -93
- package/src/interfaces/calendar-unit-of-work.ts +0 -47
- package/src/interfaces/config-import.ts +0 -16
- package/src/interfaces/envelope.ts +0 -32
- package/src/interfaces/filter-anchor-transaction.ts +0 -23
- package/src/interfaces/filter-anchor.ts +0 -11
- package/src/interfaces/filter.ts +0 -41
- package/src/interfaces/label.ts +0 -30
- package/src/interfaces/mailbox-lock.ts +0 -32
- package/src/interfaces/mailbox-special-use.ts +0 -60
- package/src/interfaces/mailbox.ts +0 -115
- package/src/interfaces/message-flag-push.ts +0 -17
- package/src/interfaces/message-flag.ts +0 -15
- package/src/interfaces/message-label.ts +0 -25
- package/src/interfaces/message-placement-move.ts +0 -15
- package/src/interfaces/message.ts +0 -65
- package/src/interfaces/organize-job-request.ts +0 -19
- package/src/interfaces/outbox-attachment.ts +0 -132
- package/src/interfaces/outbox-message.ts +0 -106
- package/src/interfaces/quarantine.ts +0 -22
- package/src/interfaces/sender-signer-standing.ts +0 -37
- package/src/interfaces/thread-message.ts +0 -264
- package/src/interfaces/unit-of-work.ts +0 -28
- package/src/mailbox-name.test.ts +0 -106
- package/src/mailbox-name.ts +0 -90
- package/src/mailbox-state-doors.test.ts +0 -104
- package/src/message-placement-doors.test.ts +0 -100
- package/src/message-settlement.test.ts +0 -132
- package/src/sender-mute.test.ts +0 -76
- package/src/types.ts +0 -820
- package/src/update-manifest.test.ts +0 -130
- package/src/update-manifest.ts +0 -22
- package/src/virtual-copy.test.ts +0 -34
- package/tsconfig.json +0 -8
- /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
|
-
});
|
package/src/update-manifest.ts
DELETED
|
@@ -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
|
-
});
|
package/src/virtual-copy.test.ts
DELETED
|
@@ -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
|
File without changes
|