@remit/data-ports 0.0.82 → 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 -226
- 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 -56
- 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,132 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, test } from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
MessageMutation,
|
|
5
|
-
MessageStatus,
|
|
6
|
-
MessageSyncStatus,
|
|
7
|
-
} from "@remit/domain-enums";
|
|
8
|
-
import {
|
|
9
|
-
abandonedMutationOf,
|
|
10
|
-
hasAbandonedDelete,
|
|
11
|
-
hasAbandonedMove,
|
|
12
|
-
type MessageSettlementFields,
|
|
13
|
-
} from "./message-settlement.js";
|
|
14
|
-
|
|
15
|
-
const row = (over: Partial<MessageSettlementFields>): MessageSettlementFields =>
|
|
16
|
-
({
|
|
17
|
-
status: MessageStatus.active,
|
|
18
|
-
syncStatus: MessageSyncStatus.synced,
|
|
19
|
-
abandonedMutation: MessageMutation.none,
|
|
20
|
-
...over,
|
|
21
|
-
}) as MessageSettlementFields;
|
|
22
|
-
|
|
23
|
-
describe("abandonedMutationOf", () => {
|
|
24
|
-
test("names the delete `abandonDelete` gave up on", () => {
|
|
25
|
-
assert.equal(
|
|
26
|
-
abandonedMutationOf(
|
|
27
|
-
row({
|
|
28
|
-
syncStatus: MessageSyncStatus.abandoned,
|
|
29
|
-
abandonedMutation: MessageMutation.delete,
|
|
30
|
-
}),
|
|
31
|
-
),
|
|
32
|
-
MessageMutation.delete,
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Issue #1229: the two used to be one state on the wire, so a move that
|
|
38
|
-
* handed back rendered the delete copy under a button that deleted the
|
|
39
|
-
* message. The row has to say which, because the hand-back is what erased
|
|
40
|
-
* the `status` that said it.
|
|
41
|
-
*/
|
|
42
|
-
test("names the move a hand-back gave up on, distinctly", () => {
|
|
43
|
-
assert.equal(
|
|
44
|
-
abandonedMutationOf(
|
|
45
|
-
row({
|
|
46
|
-
syncStatus: MessageSyncStatus.abandoned,
|
|
47
|
-
abandonedMutation: MessageMutation.move,
|
|
48
|
-
}),
|
|
49
|
-
),
|
|
50
|
-
MessageMutation.move,
|
|
51
|
-
);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
test("`syncStatus` is the gate: a settled row's stale marker says nothing", () => {
|
|
55
|
-
assert.equal(
|
|
56
|
-
abandonedMutationOf(
|
|
57
|
-
row({
|
|
58
|
-
syncStatus: MessageSyncStatus.synced,
|
|
59
|
-
abandonedMutation: MessageMutation.delete,
|
|
60
|
-
}),
|
|
61
|
-
),
|
|
62
|
-
MessageMutation.none,
|
|
63
|
-
);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* `failed` is the transient attempt marker — every handler writes it and
|
|
68
|
-
* re-throws for redelivery (imap-mutations R3) — so it can never mean a
|
|
69
|
-
* give-up, whatever `status` sits beside it. This is issue #1153: before the
|
|
70
|
-
* give-up had a value of its own, these three were the same row.
|
|
71
|
-
*/
|
|
72
|
-
for (const status of [
|
|
73
|
-
MessageStatus.active,
|
|
74
|
-
MessageStatus.moving,
|
|
75
|
-
MessageStatus.deleting,
|
|
76
|
-
]) {
|
|
77
|
-
test(`a ${status} row mid-retry is not a give-up`, () => {
|
|
78
|
-
assert.equal(
|
|
79
|
-
abandonedMutationOf(
|
|
80
|
-
row({ status, syncStatus: MessageSyncStatus.failed }),
|
|
81
|
-
),
|
|
82
|
-
MessageMutation.none,
|
|
83
|
-
);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
test("an ordinary inbound row, `pending` forever, says nothing", () => {
|
|
88
|
-
assert.equal(
|
|
89
|
-
abandonedMutationOf(row({ syncStatus: MessageSyncStatus.pending })),
|
|
90
|
-
MessageMutation.none,
|
|
91
|
-
);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* A move or delete that exhausted its retries is repaired against IMAP and
|
|
96
|
-
* now carries the give-up (#1098, #1005). What still lands on `synced` is a
|
|
97
|
-
* hand-back that refused nothing — the server never heard the command — and
|
|
98
|
-
* that is settled, not abandoned.
|
|
99
|
-
*/
|
|
100
|
-
test("`synced` is never a give-up, however it was reached", () => {
|
|
101
|
-
assert.equal(
|
|
102
|
-
abandonedMutationOf(row({ syncStatus: MessageSyncStatus.synced })),
|
|
103
|
-
MessageMutation.none,
|
|
104
|
-
);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
describe("the per-operation predicates", () => {
|
|
109
|
-
const abandoned = (
|
|
110
|
-
mutation: MessageSettlementFields["abandonedMutation"],
|
|
111
|
-
): MessageSettlementFields =>
|
|
112
|
-
row({
|
|
113
|
-
syncStatus: MessageSyncStatus.abandoned,
|
|
114
|
-
abandonedMutation: mutation,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
test("a delete that gave up is a delete and not a move", () => {
|
|
118
|
-
assert.equal(hasAbandonedDelete(abandoned(MessageMutation.delete)), true);
|
|
119
|
-
assert.equal(hasAbandonedMove(abandoned(MessageMutation.delete)), false);
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
test("a move that gave up is a move and not a delete", () => {
|
|
123
|
-
assert.equal(hasAbandonedMove(abandoned(MessageMutation.move)), true);
|
|
124
|
-
assert.equal(hasAbandonedDelete(abandoned(MessageMutation.move)), false);
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
test("a copy that gave up claims neither", () => {
|
|
128
|
-
const copy = abandoned(MessageMutation.copy);
|
|
129
|
-
assert.equal(hasAbandonedDelete(copy), false);
|
|
130
|
-
assert.equal(hasAbandonedMove(copy), false);
|
|
131
|
-
});
|
|
132
|
-
});
|
package/src/sender-mute.test.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { isSenderMuted, isSenderMuteFilter } from "./sender-mute.js";
|
|
4
|
-
import type { FilterItem } from "./types.js";
|
|
5
|
-
|
|
6
|
-
const rule = (overrides: Partial<FilterItem> = {}): FilterItem =>
|
|
7
|
-
({
|
|
8
|
-
scope: "Standing",
|
|
9
|
-
literalClauses: [{ field: "From", value: "ada@example.test" }],
|
|
10
|
-
actionLabelId: "None",
|
|
11
|
-
actionMailboxId: "None",
|
|
12
|
-
...overrides,
|
|
13
|
-
}) as unknown as FilterItem;
|
|
14
|
-
|
|
15
|
-
describe("isSenderMuteFilter", () => {
|
|
16
|
-
it("recognises a standing rule that names a sender and does nothing", () => {
|
|
17
|
-
assert.equal(isSenderMuteFilter(rule()), true);
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("declines a rule that applies a label", () => {
|
|
21
|
-
assert.equal(isSenderMuteFilter(rule({ actionLabelId: "label-1" })), false);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("declines a rule that moves the message", () => {
|
|
25
|
-
assert.equal(
|
|
26
|
-
isSenderMuteFilter(rule({ actionMailboxId: "mailbox-1" })),
|
|
27
|
-
false,
|
|
28
|
-
);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it("declines a rule that matches on something other than the sender", () => {
|
|
32
|
-
assert.equal(
|
|
33
|
-
isSenderMuteFilter(
|
|
34
|
-
rule({
|
|
35
|
-
literalClauses: [{ field: "Subject", value: "invitation" }],
|
|
36
|
-
} as Partial<FilterItem>),
|
|
37
|
-
),
|
|
38
|
-
false,
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("declines a rule with no clauses, which would mute everybody", () => {
|
|
43
|
-
assert.equal(isSenderMuteFilter(rule({ literalClauses: [] })), false);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("declines a temporary rule", () => {
|
|
47
|
-
assert.equal(isSenderMuteFilter(rule({ scope: "Temporary" })), false);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
describe("isSenderMuted", () => {
|
|
52
|
-
it("matches an address whatever case either side was written in", () => {
|
|
53
|
-
assert.equal(isSenderMuted([rule()], "Ada@Example.TEST"), true);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("matches the whole address, never a substring of one", () => {
|
|
57
|
-
// A rule about ada@example.test must not silence an address that merely
|
|
58
|
-
// contains it — the lookalike is exactly what a spoofer would send from.
|
|
59
|
-
assert.equal(
|
|
60
|
-
isSenderMuted([rule()], "not-ada@example.test.evil.test"),
|
|
61
|
-
false,
|
|
62
|
-
);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it("says no when nothing names the sender", () => {
|
|
66
|
-
assert.equal(isSenderMuted([rule()], "someone@example.test"), false);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("says no for an empty sender rather than matching an empty clause", () => {
|
|
70
|
-
assert.equal(isSenderMuted([rule()], ""), false);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("says no with no rules at all", () => {
|
|
74
|
-
assert.equal(isSenderMuted([], "ada@example.test"), false);
|
|
75
|
-
});
|
|
76
|
-
});
|