@remit/data-ports 0.0.83 → 0.0.84
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 +7 -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 +69 -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
package/src/id.test.ts
DELETED
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
base36uuidv5,
|
|
5
|
-
deriveAddressId,
|
|
6
|
-
deriveBodyPartId,
|
|
7
|
-
deriveCalendarId,
|
|
8
|
-
deriveCalendarObjectId,
|
|
9
|
-
deriveCalendarSuggestionId,
|
|
10
|
-
deriveCopyMessageId,
|
|
11
|
-
deriveEnvelopeId,
|
|
12
|
-
deriveMessageId,
|
|
13
|
-
deriveMessageIdFromSource,
|
|
14
|
-
deriveQuarantineId,
|
|
15
|
-
deriveThreadId,
|
|
16
|
-
normalizeCalendarUrlSegment,
|
|
17
|
-
normalizeMessageIdHeader,
|
|
18
|
-
quarantineMessageIdHash,
|
|
19
|
-
REMIT_NAMESPACE,
|
|
20
|
-
ROOT_PART_PATH,
|
|
21
|
-
} from "./id.js";
|
|
22
|
-
|
|
23
|
-
const ACCOUNT = "acct-1";
|
|
24
|
-
const MAILBOX = "mbx-1";
|
|
25
|
-
|
|
26
|
-
describe("deriveQuarantineId", () => {
|
|
27
|
-
it("is stable for the same message", () => {
|
|
28
|
-
assert.equal(
|
|
29
|
-
deriveQuarantineId(ACCOUNT, MAILBOX, 1_700_000_000, 40217),
|
|
30
|
-
deriveQuarantineId(ACCOUNT, MAILBOX, 1_700_000_000, 40217),
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("separates the same uid across a UIDVALIDITY bump", () => {
|
|
35
|
-
// A mailbox keeps its mailboxId when the server bumps UIDVALIDITY, so
|
|
36
|
-
// without this the stale entry would name the new message and suppress
|
|
37
|
-
// it from a sync round — losing mail rather than a diagnostic.
|
|
38
|
-
assert.notEqual(
|
|
39
|
-
deriveQuarantineId(ACCOUNT, MAILBOX, 1_700_000_000, 40217),
|
|
40
|
-
deriveQuarantineId(ACCOUNT, MAILBOX, 1_700_000_001, 40217),
|
|
41
|
-
);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("separates mailboxes and accounts", () => {
|
|
45
|
-
const base = deriveQuarantineId(ACCOUNT, MAILBOX, 1, 40217);
|
|
46
|
-
assert.notEqual(base, deriveQuarantineId(ACCOUNT, "mbx-2", 1, 40217));
|
|
47
|
-
assert.notEqual(base, deriveQuarantineId("acct-2", MAILBOX, 1, 40217));
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
describe("deriveCopyMessageId", () => {
|
|
52
|
-
const SOURCE = deriveMessageId(ACCOUNT, "<abc@example.com>");
|
|
53
|
-
const DEST = "mbx-archive";
|
|
54
|
-
|
|
55
|
-
it("is stable for the same source and destination (idempotent copy)", () => {
|
|
56
|
-
assert.equal(
|
|
57
|
-
deriveCopyMessageId(SOURCE, DEST),
|
|
58
|
-
deriveCopyMessageId(SOURCE, DEST),
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("separates a copy of one mail into two folders", () => {
|
|
63
|
-
assert.notEqual(
|
|
64
|
-
deriveCopyMessageId(SOURCE, DEST),
|
|
65
|
-
deriveCopyMessageId(SOURCE, "mbx-other"),
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("separates copies of two different mails into one folder", () => {
|
|
70
|
-
assert.notEqual(
|
|
71
|
-
deriveCopyMessageId(SOURCE, DEST),
|
|
72
|
-
deriveCopyMessageId(deriveMessageId(ACCOUNT, "<xyz@example.com>"), DEST),
|
|
73
|
-
);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it("never equals the folder-independent id sync derives", () => {
|
|
77
|
-
// Sync keys a message on deriveMessageId; the copy id folds in the
|
|
78
|
-
// destination mailbox, so the two can never collide.
|
|
79
|
-
assert.notEqual(deriveCopyMessageId(SOURCE, DEST), SOURCE);
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
describe("quarantineMessageIdHash", () => {
|
|
84
|
-
it("hashes a real Message-ID to a pinned sha256 value", () => {
|
|
85
|
-
const hash = quarantineMessageIdHash("<abc@example.com>");
|
|
86
|
-
assert.match(hash ?? "", /^sha256:[0-9a-f]{64}$/);
|
|
87
|
-
assert.equal(hash, quarantineMessageIdHash("<abc@example.com>"));
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it("distinguishes different Message-IDs", () => {
|
|
91
|
-
assert.notEqual(
|
|
92
|
-
quarantineMessageIdHash("<a@example.com>"),
|
|
93
|
-
quarantineMessageIdHash("<b@example.com>"),
|
|
94
|
-
);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it("refuses to hash a Message-ID the sync path never had", () => {
|
|
98
|
-
// The sync path coerces a missing Message-ID to "". Hashing that would
|
|
99
|
-
// give every such message one shared hash and correlate unrelated
|
|
100
|
-
// reports — the opposite of what the field is for.
|
|
101
|
-
for (const absent of [undefined, "", " ", "<>"]) {
|
|
102
|
-
assert.equal(quarantineMessageIdHash(absent), undefined);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
describe("normalizeCalendarUrlSegment", () => {
|
|
108
|
-
it("folds a segment to the one form the id and the stored column share", () => {
|
|
109
|
-
assert.equal(
|
|
110
|
-
normalizeCalendarUrlSegment(" Work-Calendar "),
|
|
111
|
-
"work-calendar",
|
|
112
|
-
);
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
describe("deriveCalendarId", () => {
|
|
117
|
-
it("resolves a DAV path segment case-insensitively", () => {
|
|
118
|
-
assert.equal(
|
|
119
|
-
deriveCalendarId(ACCOUNT, "Work"),
|
|
120
|
-
deriveCalendarId(ACCOUNT, "work"),
|
|
121
|
-
);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it("derives from the folded segment, so a stored segment resolves to its own id", () => {
|
|
125
|
-
assert.equal(
|
|
126
|
-
deriveCalendarId(ACCOUNT, " Work "),
|
|
127
|
-
deriveCalendarId(ACCOUNT, normalizeCalendarUrlSegment(" Work ")),
|
|
128
|
-
);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it("separates the same segment across two account configs", () => {
|
|
132
|
-
assert.notEqual(
|
|
133
|
-
deriveCalendarId(ACCOUNT, "default"),
|
|
134
|
-
deriveCalendarId("acct-2", "default"),
|
|
135
|
-
);
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
describe("deriveCalendarObjectId", () => {
|
|
140
|
-
it("is stable for the same resource", () => {
|
|
141
|
-
assert.equal(
|
|
142
|
-
deriveCalendarObjectId("cal-1", "event.ics"),
|
|
143
|
-
deriveCalendarObjectId("cal-1", "event.ics"),
|
|
144
|
-
);
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it("separates the same resource name across two collections", () => {
|
|
148
|
-
assert.notEqual(
|
|
149
|
-
deriveCalendarObjectId("cal-1", "event.ics"),
|
|
150
|
-
deriveCalendarObjectId("cal-2", "event.ics"),
|
|
151
|
-
);
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it("keeps a resource name case-sensitive, unlike a collection segment", () => {
|
|
155
|
-
// A resource name is the literal last path segment a client PUT to, and
|
|
156
|
-
// CalDAV lets two resources in one collection differ only by case. Folding
|
|
157
|
-
// it would merge them into one row and lose the second.
|
|
158
|
-
assert.notEqual(
|
|
159
|
-
deriveCalendarObjectId("cal-1", "Event.ics"),
|
|
160
|
-
deriveCalendarObjectId("cal-1", "event.ics"),
|
|
161
|
-
);
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
describe("deriveCalendarSuggestionId", () => {
|
|
166
|
-
const MESSAGE = "msg-1";
|
|
167
|
-
const PART = "part-1";
|
|
168
|
-
const UID = "invite@example.com";
|
|
169
|
-
|
|
170
|
-
it("converges a re-read of the same message on one row", () => {
|
|
171
|
-
assert.equal(
|
|
172
|
-
deriveCalendarSuggestionId(MESSAGE, PART, UID),
|
|
173
|
-
deriveCalendarSuggestionId(MESSAGE, PART, UID),
|
|
174
|
-
);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it("keeps two invitations in one message apart", () => {
|
|
178
|
-
assert.notEqual(
|
|
179
|
-
deriveCalendarSuggestionId(MESSAGE, PART, UID),
|
|
180
|
-
deriveCalendarSuggestionId(MESSAGE, "part-2", UID),
|
|
181
|
-
);
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it("gives a revision its own row, so the superseded card survives", () => {
|
|
185
|
-
// A later message carrying the same UID is a second suggestion, never an
|
|
186
|
-
// overwrite of the first: the older message keeps its card and the user
|
|
187
|
-
// can see which revision replaced which.
|
|
188
|
-
assert.notEqual(
|
|
189
|
-
deriveCalendarSuggestionId(MESSAGE, PART, UID),
|
|
190
|
-
deriveCalendarSuggestionId("msg-2", PART, UID),
|
|
191
|
-
);
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it("separates two events sent as one part", () => {
|
|
195
|
-
assert.notEqual(
|
|
196
|
-
deriveCalendarSuggestionId(MESSAGE, PART, UID),
|
|
197
|
-
deriveCalendarSuggestionId(MESSAGE, PART, "other@example.com"),
|
|
198
|
-
);
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
describe("deriveThreadId", () => {
|
|
203
|
-
const ROOT = "<root@example.com>";
|
|
204
|
-
|
|
205
|
-
// #1017: the account is not part of the name, so every mailbox connected to
|
|
206
|
-
// one config resolves the same root header to one conversation. Keyed on the
|
|
207
|
-
// account, a reply sent from the second account opened a thread of its own.
|
|
208
|
-
it("gives one root header one thread across the accounts of a config", () => {
|
|
209
|
-
assert.equal(deriveThreadId("cfg-1", ROOT), deriveThreadId("cfg-1", ROOT));
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
it("separates two account configs holding the same conversation", () => {
|
|
213
|
-
assert.notEqual(
|
|
214
|
-
deriveThreadId("cfg-1", ROOT),
|
|
215
|
-
deriveThreadId("cfg-2", ROOT),
|
|
216
|
-
);
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it("separates two conversations under one config", () => {
|
|
220
|
-
assert.notEqual(
|
|
221
|
-
deriveThreadId("cfg-1", ROOT),
|
|
222
|
-
deriveThreadId("cfg-1", "<other@example.com>"),
|
|
223
|
-
);
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
describe("derived ids are stored primary keys: a changed value orphans every row already written and needs a migration, never a new expectation here", () => {
|
|
228
|
-
const ACCOUNT = "account-golden";
|
|
229
|
-
const ACCOUNT_CONFIG = "account-config-golden";
|
|
230
|
-
const MESSAGE = "message-golden";
|
|
231
|
-
const MAILBOX = "mailbox-golden";
|
|
232
|
-
const ABSENT_HEADER_SOURCE = {
|
|
233
|
-
messageId: undefined,
|
|
234
|
-
mailboxId: MAILBOX,
|
|
235
|
-
uid: 40217,
|
|
236
|
-
date: "2026-08-23T00:00:00Z",
|
|
237
|
-
subject: "Golden",
|
|
238
|
-
fromMailbox: "golden",
|
|
239
|
-
fromHost: "example.com",
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
it("REMIT_NAMESPACE is the seed of every derived id and can never change", () => {
|
|
243
|
-
assert.equal(REMIT_NAMESPACE, "9e89694d-214b-4d9b-99f5-214b4d9b99f5");
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
it("base36uuidv5 pins the encoding every derivation below is built on", () => {
|
|
247
|
-
assert.equal(
|
|
248
|
-
base36uuidv5("golden-seed", REMIT_NAMESPACE),
|
|
249
|
-
"67hxxs95ofdk5frbprqyrgwmo",
|
|
250
|
-
);
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
it("deriveAddressId pins the address primary key, lowercased email included", () => {
|
|
254
|
-
assert.equal(
|
|
255
|
-
deriveAddressId(ACCOUNT, "Golden.User@Example.COM"),
|
|
256
|
-
"dzu01kz6aj1ro8fr8l375tfbr",
|
|
257
|
-
);
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
it("deriveMessageId pins the message primary key", () => {
|
|
261
|
-
assert.equal(
|
|
262
|
-
deriveMessageId(ACCOUNT, "<golden@example.com>"),
|
|
263
|
-
"bfthbm5n4279aacb5a1q1c94h",
|
|
264
|
-
);
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
it("normalizeMessageIdHeader pins the synthetic header that seeds a Message-ID-less message", () => {
|
|
268
|
-
assert.equal(
|
|
269
|
-
normalizeMessageIdHeader(ABSENT_HEADER_SOURCE),
|
|
270
|
-
"generated:mailbox-golden:40217:2026-08-23T00:00:00Z:Golden:golden:example.com",
|
|
271
|
-
);
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
it("deriveMessageIdFromSource pins the key of a message that declared no Message-ID", () => {
|
|
275
|
-
assert.equal(
|
|
276
|
-
deriveMessageIdFromSource(ACCOUNT, ABSENT_HEADER_SOURCE),
|
|
277
|
-
"0rae70onzy4ufhlnndqe7lwml",
|
|
278
|
-
);
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
it("deriveCopyMessageId pins the key of a message copied into another folder", () => {
|
|
282
|
-
assert.equal(
|
|
283
|
-
deriveCopyMessageId(MESSAGE, MAILBOX),
|
|
284
|
-
"43cwqvpfh4o1fcbmaciabmqo3",
|
|
285
|
-
);
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
it("deriveThreadId pins the thread primary key, keyed on the account config, lowercased root header included", () => {
|
|
289
|
-
assert.equal(
|
|
290
|
-
deriveThreadId(ACCOUNT_CONFIG, "<Golden.Root@Example.COM>"),
|
|
291
|
-
"3tl03sgy85b60rfb15u6vtiex",
|
|
292
|
-
);
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
it("deriveEnvelopeId pins the envelope primary key", () => {
|
|
296
|
-
assert.equal(deriveEnvelopeId(MESSAGE), "f1bngysevoxuqt625rd5hvtzt");
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
it("ROOT_PART_PATH is baked into stored body part keys and S3 keys", () => {
|
|
300
|
-
assert.equal(ROOT_PART_PATH, "0");
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
it("deriveBodyPartId pins the body_part primary key", () => {
|
|
304
|
-
assert.equal(deriveBodyPartId(MESSAGE, "1.2"), "363nl1jzgh77ki2ojk1hqvxxe");
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
it("deriveQuarantineId pins the quarantine primary key", () => {
|
|
308
|
-
assert.equal(
|
|
309
|
-
deriveQuarantineId(ACCOUNT, MAILBOX, 1_700_000_000, 40217),
|
|
310
|
-
"4xg2y7x2j7nmvy0wtwgdq8b8p",
|
|
311
|
-
);
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
it("deriveCalendarId pins the calendar primary key, lowercased segment included", () => {
|
|
315
|
-
assert.equal(
|
|
316
|
-
deriveCalendarId(ACCOUNT, "Work-Calendar"),
|
|
317
|
-
"ckygmpewwbyhzkrjs6ui29iuw",
|
|
318
|
-
);
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
it("deriveCalendarId pins the key of the default collection every account is provisioned", () => {
|
|
322
|
-
assert.equal(
|
|
323
|
-
deriveCalendarId(ACCOUNT, "default"),
|
|
324
|
-
"bg614rmeq926iyti6npylfzja",
|
|
325
|
-
);
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
it("deriveCalendarObjectId pins the calendar_object primary key, resource name case intact", () => {
|
|
329
|
-
assert.equal(
|
|
330
|
-
deriveCalendarObjectId("calendar-golden", "golden-event.ics"),
|
|
331
|
-
"aklxxezhc8icpuewggz983okb",
|
|
332
|
-
);
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
it("deriveCalendarSuggestionId pins the calendar_suggestion primary key", () => {
|
|
336
|
-
assert.equal(
|
|
337
|
-
deriveCalendarSuggestionId(
|
|
338
|
-
MESSAGE,
|
|
339
|
-
"bodypart-golden",
|
|
340
|
-
"golden-invite@example.com",
|
|
341
|
-
),
|
|
342
|
-
"1pesdr3fl02uyoz5k1qrfik3e",
|
|
343
|
-
);
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
it("quarantineMessageIdHash pins the stored Message-ID hash that correlates reports", () => {
|
|
347
|
-
assert.equal(
|
|
348
|
-
quarantineMessageIdHash("<golden@example.com>"),
|
|
349
|
-
"sha256:5e888fd63760269e96a61e1a09b83ddec28556d0e3cda7e480897e58c8e6a2f5",
|
|
350
|
-
);
|
|
351
|
-
});
|
|
352
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
export { deriveFilterTtl } from "./filter-ttl.js";
|
|
2
|
-
export type { IAccountRepository } from "./interfaces/account.js";
|
|
3
|
-
export type { IAccountConfigRepository } from "./interfaces/account-config.js";
|
|
4
|
-
export type { IAccountExportRequestRepository } from "./interfaces/account-export-request.js";
|
|
5
|
-
export type { IAccountSettingRepository } from "./interfaces/account-setting.js";
|
|
6
|
-
export type { IAddressRepository } from "./interfaces/address.js";
|
|
7
|
-
export type { ICalendarCollectionRepository } from "./interfaces/calendar-collection.js";
|
|
8
|
-
export type { ICalendarEventIndexRepository } from "./interfaces/calendar-event-index.js";
|
|
9
|
-
export type { ICalendarFeedTokenRepository } from "./interfaces/calendar-feed-token.js";
|
|
10
|
-
export type { ICalendarObjectRepository } from "./interfaces/calendar-object.js";
|
|
11
|
-
export type {
|
|
12
|
-
ICalendarSuggestionRepository,
|
|
13
|
-
SettleCalendarSuggestionInput,
|
|
14
|
-
} from "./interfaces/calendar-suggestion.js";
|
|
15
|
-
export type {
|
|
16
|
-
CalendarUnitOfWorkRepositories,
|
|
17
|
-
ICalendarUnitOfWork,
|
|
18
|
-
} from "./interfaces/calendar-unit-of-work.js";
|
|
19
|
-
export type { IConfigImportRepository } from "./interfaces/config-import.js";
|
|
20
|
-
export type { IEnvelopeRepository } from "./interfaces/envelope.js";
|
|
21
|
-
export type { IFilterRepository } from "./interfaces/filter.js";
|
|
22
|
-
export type { IFilterAnchorRepository } from "./interfaces/filter-anchor.js";
|
|
23
|
-
export type { IFilterAnchorTransaction } from "./interfaces/filter-anchor-transaction.js";
|
|
24
|
-
export type { ILabelRepository } from "./interfaces/label.js";
|
|
25
|
-
export type { IMailboxRepository } from "./interfaces/mailbox.js";
|
|
26
|
-
export type { IMailboxLockRepository } from "./interfaces/mailbox-lock.js";
|
|
27
|
-
export type { IMailboxSpecialUseRepository } from "./interfaces/mailbox-special-use.js";
|
|
28
|
-
export type { IMessageRepository } from "./interfaces/message.js";
|
|
29
|
-
export type { IMessageFlagRepository } from "./interfaces/message-flag.js";
|
|
30
|
-
export type { IMessageFlagPushRepository } from "./interfaces/message-flag-push.js";
|
|
31
|
-
export type { IMessageLabelRepository } from "./interfaces/message-label.js";
|
|
32
|
-
export type { IMessagePlacementMoveRepository } from "./interfaces/message-placement-move.js";
|
|
33
|
-
export type { IOrganizeJobRequestRepository } from "./interfaces/organize-job-request.js";
|
|
34
|
-
export type {
|
|
35
|
-
CreateOutboxAttachmentInput,
|
|
36
|
-
IOutboxAttachmentRepository,
|
|
37
|
-
OutboxAttachmentCap,
|
|
38
|
-
ReserveOutboxAttachmentResult,
|
|
39
|
-
} from "./interfaces/outbox-attachment.js";
|
|
40
|
-
export { holdsRoom } from "./interfaces/outbox-attachment.js";
|
|
41
|
-
export type { IOutboxMessageRepository } from "./interfaces/outbox-message.js";
|
|
42
|
-
export {
|
|
43
|
-
APPENDED_UID_NONE,
|
|
44
|
-
APPENDED_UID_UNREPORTED,
|
|
45
|
-
isSentCopyFiled,
|
|
46
|
-
} from "./interfaces/outbox-message.js";
|
|
47
|
-
export type { IQuarantineRepository } from "./interfaces/quarantine.js";
|
|
48
|
-
export type { ISenderSignerStandingRepository } from "./interfaces/sender-signer-standing.js";
|
|
49
|
-
export type { IThreadMessageRepository } from "./interfaces/thread-message.js";
|
|
50
|
-
export type {
|
|
51
|
-
IUnitOfWork,
|
|
52
|
-
UnitOfWorkRepositories,
|
|
53
|
-
} from "./interfaces/unit-of-work.js";
|
|
54
|
-
export type { MessageSettlementFields } from "./message-settlement.js";
|
|
55
|
-
export {
|
|
56
|
-
abandonedMutationOf,
|
|
57
|
-
hasAbandonedDelete,
|
|
58
|
-
hasAbandonedMove,
|
|
59
|
-
} from "./message-settlement.js";
|
|
60
|
-
export {
|
|
61
|
-
FILTER_NO_ACTION,
|
|
62
|
-
isSenderMuted,
|
|
63
|
-
isSenderMuteFilter,
|
|
64
|
-
} from "./sender-mute.js";
|
|
65
|
-
export type {
|
|
66
|
-
AccountConfigDescription,
|
|
67
|
-
AccountConfigItem,
|
|
68
|
-
AccountDescription,
|
|
69
|
-
AccountExportRequestItem,
|
|
70
|
-
AccountItem,
|
|
71
|
-
AccountSchedulerPage,
|
|
72
|
-
AccountSettingItem,
|
|
73
|
-
AccountSettingValue,
|
|
74
|
-
AddressFlags,
|
|
75
|
-
AddressItem,
|
|
76
|
-
BodyPartContentItem,
|
|
77
|
-
BodyPartContentUpsertInput,
|
|
78
|
-
BodyPartItem,
|
|
79
|
-
BodyPartParameterItem,
|
|
80
|
-
BodyPartParameterUpsertInput,
|
|
81
|
-
BodyPartStorageItem,
|
|
82
|
-
BodyPartUpsertInput,
|
|
83
|
-
CalendarCollectionItem,
|
|
84
|
-
CalendarEventIndexItem,
|
|
85
|
-
CalendarFeedTokenItem,
|
|
86
|
-
CalendarObjectItem,
|
|
87
|
-
CalendarOccurrenceInput,
|
|
88
|
-
CalendarSuggestionItem,
|
|
89
|
-
ConfigImportItem,
|
|
90
|
-
ConfigImportUnresolvedRefItem,
|
|
91
|
-
CreateAccountConfigInput,
|
|
92
|
-
CreateAccountExportRequestInput,
|
|
93
|
-
CreateAccountInput,
|
|
94
|
-
CreateAddressInput,
|
|
95
|
-
CreateCalendarCollectionInput,
|
|
96
|
-
CreateConfigImportInput,
|
|
97
|
-
CreateEnvelopeAddressInput,
|
|
98
|
-
CreateEnvelopeInput,
|
|
99
|
-
CreateFilterAnchorInput,
|
|
100
|
-
CreateFilterInput,
|
|
101
|
-
CreateLabelInput,
|
|
102
|
-
CreateMailboxInput,
|
|
103
|
-
CreateMailboxResult,
|
|
104
|
-
CreateMessageFlagInput,
|
|
105
|
-
CreateMessageInput,
|
|
106
|
-
CreateMessageLabelInput,
|
|
107
|
-
CreateOrganizeJobRequestInput,
|
|
108
|
-
CreateOutboxMessageInput,
|
|
109
|
-
CreateThreadMessageInput,
|
|
110
|
-
EnvelopeAddressItem,
|
|
111
|
-
EnvelopeItem,
|
|
112
|
-
FilterAnchorItem,
|
|
113
|
-
FilterItem,
|
|
114
|
-
FlagsMergePatch,
|
|
115
|
-
LabelItem,
|
|
116
|
-
ListOptions,
|
|
117
|
-
MailboxItem,
|
|
118
|
-
MailboxLockItem,
|
|
119
|
-
MailboxSpecialUseItem,
|
|
120
|
-
MailboxSpecialUseValue,
|
|
121
|
-
MailboxStatePredicate,
|
|
122
|
-
MailboxSubtreeTransitionIntent,
|
|
123
|
-
MailboxTransitionIntent,
|
|
124
|
-
MailboxTransitionWrite,
|
|
125
|
-
MessageData,
|
|
126
|
-
MessageDescription,
|
|
127
|
-
MessageFlagItem,
|
|
128
|
-
MessageFlagPushItem,
|
|
129
|
-
MessageIdSource,
|
|
130
|
-
MessageItem,
|
|
131
|
-
MessageLabelItem,
|
|
132
|
-
MessagePlacementMoveItem,
|
|
133
|
-
MessageReferenceItem,
|
|
134
|
-
ObserveSenderSignerStandingInput,
|
|
135
|
-
OrganizeJobRequestItem,
|
|
136
|
-
OutboxAttachmentItem,
|
|
137
|
-
OutboxMessageItem,
|
|
138
|
-
PlacementPredicate,
|
|
139
|
-
PlacementTransitionInput,
|
|
140
|
-
PutCalendarFeedTokenInput,
|
|
141
|
-
PutCalendarObjectInput,
|
|
142
|
-
PutCalendarSuggestionInput,
|
|
143
|
-
PutMessageFlagPushInput,
|
|
144
|
-
PutMessagePlacementMoveInput,
|
|
145
|
-
QuarantineItem,
|
|
146
|
-
QuarantineMimeNodeItem,
|
|
147
|
-
QuarantineUpsertInput,
|
|
148
|
-
RawMessageStorageItem,
|
|
149
|
-
ResultList,
|
|
150
|
-
SearchOptions,
|
|
151
|
-
SenderSignerStandingItem,
|
|
152
|
-
ThreadMessageFieldTerm,
|
|
153
|
-
ThreadMessageItem,
|
|
154
|
-
UpdateAccountConfigInput,
|
|
155
|
-
UpdateAccountExportRequestInput,
|
|
156
|
-
UpdateAccountInput,
|
|
157
|
-
UpdateAddressInput,
|
|
158
|
-
UpdateCalendarCollectionInput,
|
|
159
|
-
UpdateConfigImportInput,
|
|
160
|
-
UpdateEnvelopeInput,
|
|
161
|
-
UpdateFilterInput,
|
|
162
|
-
UpdateLabelInput,
|
|
163
|
-
UpdateMailboxInput,
|
|
164
|
-
UpdateMessageInput,
|
|
165
|
-
UpdateOrganizeJobRequestInput,
|
|
166
|
-
UpdateOutboxMessageInput,
|
|
167
|
-
UpdateThreadMessageInput,
|
|
168
|
-
UpsertAccountSettingInput,
|
|
169
|
-
WithMailboxLockResult,
|
|
170
|
-
} from "./types.js";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AccountConfigDescription,
|
|
3
|
-
AccountConfigItem,
|
|
4
|
-
CreateAccountConfigInput,
|
|
5
|
-
ResultList,
|
|
6
|
-
UpdateAccountConfigInput,
|
|
7
|
-
} from "../types.js";
|
|
8
|
-
|
|
9
|
-
export interface IAccountConfigRepository {
|
|
10
|
-
create(input: CreateAccountConfigInput): Promise<AccountConfigItem>;
|
|
11
|
-
get(accountConfigId: string): Promise<AccountConfigItem>;
|
|
12
|
-
get(accountConfigIds: string[]): Promise<AccountConfigItem[]>;
|
|
13
|
-
update(
|
|
14
|
-
accountConfigId: string,
|
|
15
|
-
input: UpdateAccountConfigInput,
|
|
16
|
-
): Promise<AccountConfigItem>;
|
|
17
|
-
delete(accountConfigId: string): Promise<void>;
|
|
18
|
-
deleteMany(accountConfigIds: string[]): Promise<void>;
|
|
19
|
-
listByUser(
|
|
20
|
-
userId: string,
|
|
21
|
-
options?: { limit?: number; continuationToken?: string },
|
|
22
|
-
): Promise<ResultList<AccountConfigItem>>;
|
|
23
|
-
describe(accountConfigId: string): Promise<AccountConfigDescription>;
|
|
24
|
-
listAll(): Promise<AccountConfigItem[]>;
|
|
25
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AccountExportRequestItem,
|
|
3
|
-
CreateAccountExportRequestInput,
|
|
4
|
-
ResultList,
|
|
5
|
-
UpdateAccountExportRequestInput,
|
|
6
|
-
} from "../types.js";
|
|
7
|
-
|
|
8
|
-
export interface IAccountExportRequestRepository {
|
|
9
|
-
create(
|
|
10
|
-
input: CreateAccountExportRequestInput,
|
|
11
|
-
): Promise<AccountExportRequestItem>;
|
|
12
|
-
get(accountExportRequestId: string): Promise<AccountExportRequestItem>;
|
|
13
|
-
update(
|
|
14
|
-
accountExportRequestId: string,
|
|
15
|
-
input: UpdateAccountExportRequestInput,
|
|
16
|
-
): Promise<AccountExportRequestItem>;
|
|
17
|
-
listByAccountConfig(
|
|
18
|
-
accountConfigId: string,
|
|
19
|
-
options?: { limit?: number; continuationToken?: string },
|
|
20
|
-
): Promise<ResultList<AccountExportRequestItem>>;
|
|
21
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AccountSettingItem,
|
|
3
|
-
UpsertAccountSettingInput,
|
|
4
|
-
} from "../types.js";
|
|
5
|
-
|
|
6
|
-
export interface IAccountSettingRepository {
|
|
7
|
-
get(
|
|
8
|
-
accountConfigId: string,
|
|
9
|
-
name: string,
|
|
10
|
-
): Promise<AccountSettingItem | null>;
|
|
11
|
-
listByAccountConfig(accountConfigId: string): Promise<AccountSettingItem[]>;
|
|
12
|
-
upsert(input: UpsertAccountSettingInput): Promise<AccountSettingItem>;
|
|
13
|
-
delete(accountConfigId: string, name: string): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AccountDescription,
|
|
3
|
-
AccountItem,
|
|
4
|
-
AccountSchedulerPage,
|
|
5
|
-
CreateAccountInput,
|
|
6
|
-
ResultList,
|
|
7
|
-
UpdateAccountInput,
|
|
8
|
-
} from "../types.js";
|
|
9
|
-
|
|
10
|
-
export interface IAccountRepository {
|
|
11
|
-
create(input: CreateAccountInput): Promise<AccountItem>;
|
|
12
|
-
get(accountId: string): Promise<AccountItem>;
|
|
13
|
-
get(accountIds: string[]): Promise<AccountItem[]>;
|
|
14
|
-
update(
|
|
15
|
-
accountId: string,
|
|
16
|
-
input: UpdateAccountInput,
|
|
17
|
-
remove?: string[],
|
|
18
|
-
): Promise<AccountItem>;
|
|
19
|
-
markAuthenticated(accountId: string): Promise<AccountItem>;
|
|
20
|
-
delete(accountId: string): Promise<void>;
|
|
21
|
-
deleteMany(accountIds: string[]): Promise<void>;
|
|
22
|
-
list(
|
|
23
|
-
accountConfigId: string,
|
|
24
|
-
options?: { limit?: number; continuationToken?: string },
|
|
25
|
-
): Promise<ResultList<AccountItem>>;
|
|
26
|
-
listAllByAccountConfig(accountConfigId: string): Promise<AccountItem[]>;
|
|
27
|
-
listMailSourcesByAccountConfig(
|
|
28
|
-
accountConfigId: string,
|
|
29
|
-
): Promise<AccountItem[]>;
|
|
30
|
-
describe(accountId: string): Promise<AccountDescription>;
|
|
31
|
-
listAll(): Promise<AccountItem[]>;
|
|
32
|
-
incrementMailboxSynced(accountId: string): Promise<AccountItem>;
|
|
33
|
-
/**
|
|
34
|
-
* Page through every account system-wide, oldest-created first, for the
|
|
35
|
-
* scheduled-sync tick (#1247). Unlike `list()` this is not accountConfig
|
|
36
|
-
* scoped and the cursor is a raw backend-native token (no salt/tamper
|
|
37
|
-
* checking) — internal use only, never exposed over the API.
|
|
38
|
-
*/
|
|
39
|
-
listAllAccountsPage(options?: {
|
|
40
|
-
limit?: number;
|
|
41
|
-
cursor?: string;
|
|
42
|
-
}): Promise<AccountSchedulerPage>;
|
|
43
|
-
}
|