@rubytech/create-maxy-code 0.1.603 → 0.1.604
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/__tests__/email-sampler-unit.test.js +22 -0
- package/dist/index.js +3 -0
- package/dist/port-resolution.js +9 -1
- package/package.json +1 -1
- package/payload/platform/lib/routine-templates/dist/roster.d.ts +17 -1
- package/payload/platform/lib/routine-templates/dist/roster.d.ts.map +1 -1
- package/payload/platform/lib/routine-templates/dist/roster.js +8 -0
- package/payload/platform/lib/routine-templates/dist/roster.js.map +1 -1
- package/payload/platform/lib/routine-templates/src/__tests__/seed.test.ts +26 -1
- package/payload/platform/lib/routine-templates/src/roster.ts +26 -1
- package/payload/platform/lib/telegram-store-read/dist/index.d.ts +59 -0
- package/payload/platform/lib/telegram-store-read/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/telegram-store-read/dist/index.js +219 -0
- package/payload/platform/lib/telegram-store-read/dist/index.js.map +1 -0
- package/payload/platform/lib/telegram-store-read/src/__tests__/fold.test.ts +124 -0
- package/payload/platform/lib/telegram-store-read/src/index.ts +262 -0
- package/payload/platform/lib/telegram-store-read/tsconfig.json +9 -0
- package/payload/platform/lib/telegram-store-read/vitest.config.ts +9 -0
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +37 -4
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +6 -0
- package/payload/platform/plugins/docs/references/outlook-guide.md +21 -2
- package/payload/platform/plugins/docs/references/telegram-guide.md +15 -1
- package/payload/platform/plugins/email/PLUGIN.md +10 -1
- package/payload/platform/plugins/email/mcp/dist/sampler/__tests__/sample-mailbox.test.js +30 -0
- package/payload/platform/plugins/email/mcp/dist/sampler/__tests__/sample-mailbox.test.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/sampler/main.js +49 -3
- package/payload/platform/plugins/email/mcp/dist/sampler/main.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/sampler/sample-mailbox.d.ts +5 -0
- package/payload/platform/plugins/email/mcp/dist/sampler/sample-mailbox.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/sampler/sample-mailbox.js +10 -5
- package/payload/platform/plugins/email/mcp/dist/sampler/sample-mailbox.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-section-properties-strip.test.js +11 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-ingest-section-properties-strip.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js +8 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-ingest.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sample-outlook-mailbox.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sample-outlook-mailbox.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sample-outlook-mailbox.test.js +324 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sample-outlook-mailbox.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-cursor.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-cursor.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-cursor.test.js +102 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-cursor.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-enumerate.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-enumerate.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-enumerate.test.js +125 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/sampler-enumerate.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/arm.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/arm.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/arm.js +109 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/arm.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/cursor.d.ts +25 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/cursor.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/cursor.js +94 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/cursor.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/enumerate.d.ts +41 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/enumerate.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/enumerate.js +122 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/enumerate.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/sample-outlook-mailbox.d.ts +73 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/sample-outlook-mailbox.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/sample-outlook-mailbox.js +162 -0
- package/payload/platform/plugins/outlook/mcp/dist/sampler/sample-outlook-mailbox.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.js +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/gate-flag.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/gate-flag.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/gate-flag.test.js +90 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/gate-flag.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/gate.test.js +26 -4
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/gate.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate-flag.d.ts +78 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate-flag.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate-flag.js +76 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate-flag.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate.d.ts +8 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate.js +9 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/gate.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/gate-dispatch-wiring.test.js +15 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/gate-dispatch-wiring.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts +12 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js +34 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js +9 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/check-due-events.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js +116 -4
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.d.ts +60 -2
- package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js +101 -4
- package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js.map +1 -1
- package/payload/platform/plugins/telegram/PLUGIN.md +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/messages.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/messages.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/messages.test.js +157 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/messages.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin.test.js +2 -2
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/public-pin.test.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/index.js +32 -34
- package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/lib/public-pin.js +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/lib/public-pin.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/messages.d.ts +27 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/messages.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/messages.js +152 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/messages.js.map +1 -0
- package/payload/platform/plugins/telegram/skills/build/SKILL.md +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/server/public/operator.html +1 -1
- package/payload/server/server.js +69 -5
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.d.ts +0 -16
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.d.ts.map +0 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js +0 -68
- package/payload/platform/plugins/telegram/mcp/dist/tools/message-history.js.map +0 -1
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { sampleOutlookMailbox, } from "../sampler/sample-outlook-mailbox.js";
|
|
4
|
+
const TARGET = {
|
|
5
|
+
accountId: "acct-1",
|
|
6
|
+
mailbox: "a@example.com",
|
|
7
|
+
mailboxKey: "guid-1",
|
|
8
|
+
pathPrefix: "/me",
|
|
9
|
+
via: null,
|
|
10
|
+
};
|
|
11
|
+
const NOW = Date.parse("2026-08-13T12:00:00Z");
|
|
12
|
+
function listed(id, receivedDateTime) {
|
|
13
|
+
return { id, receivedDateTime };
|
|
14
|
+
}
|
|
15
|
+
function body(id, receivedDateTime, text = "full body") {
|
|
16
|
+
return {
|
|
17
|
+
id,
|
|
18
|
+
subject: "subject",
|
|
19
|
+
from: "sender@example.com",
|
|
20
|
+
fromName: "Sender",
|
|
21
|
+
to: ["a@example.com"],
|
|
22
|
+
cc: [],
|
|
23
|
+
conversationId: "conv-1",
|
|
24
|
+
body: text,
|
|
25
|
+
receivedDateTime,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function harness(over = {}) {
|
|
29
|
+
const lines = [];
|
|
30
|
+
const writes = [];
|
|
31
|
+
let stored = null;
|
|
32
|
+
const deps = {
|
|
33
|
+
list: async () => ({ items: [], nextCursor: null }),
|
|
34
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T09:00:00Z"),
|
|
35
|
+
write: async (m) => {
|
|
36
|
+
writes.push(m);
|
|
37
|
+
return { threadsDispatched: 1, threadsSkipped: 0, unresolvedAddresses: [] };
|
|
38
|
+
},
|
|
39
|
+
readCursor: () => stored,
|
|
40
|
+
writeCursor: (_t, c) => {
|
|
41
|
+
stored = c;
|
|
42
|
+
},
|
|
43
|
+
log: (l) => lines.push(l),
|
|
44
|
+
now: () => NOW,
|
|
45
|
+
...over,
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
deps,
|
|
49
|
+
lines,
|
|
50
|
+
writes,
|
|
51
|
+
get stored() {
|
|
52
|
+
return stored;
|
|
53
|
+
},
|
|
54
|
+
setStored(c) {
|
|
55
|
+
stored = c;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
test("the first cycle asks for the last 7 days", async () => {
|
|
60
|
+
const seen = [];
|
|
61
|
+
const h = harness({
|
|
62
|
+
list: async (_t, since) => {
|
|
63
|
+
seen.push(since);
|
|
64
|
+
return { items: [], nextCursor: null };
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
68
|
+
assert.deepEqual(seen, [new Date(NOW - 7 * 24 * 60 * 60 * 1000).toISOString()]);
|
|
69
|
+
});
|
|
70
|
+
test("a later cycle asks from the stored instant", async () => {
|
|
71
|
+
const seen = [];
|
|
72
|
+
const h = harness({
|
|
73
|
+
list: async (_t, since) => {
|
|
74
|
+
seen.push(since);
|
|
75
|
+
return { items: [], nextCursor: null };
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
h.setStored({ newestReceivedAt: "2026-08-13T09:00:00Z", idsAtNewest: ["id-1"] });
|
|
79
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
80
|
+
assert.deepEqual(seen, ["2026-08-13T09:00:00Z"]);
|
|
81
|
+
});
|
|
82
|
+
test("nothing newer is a no-op that writes nothing and leaves the cursor alone", async () => {
|
|
83
|
+
const h = harness({
|
|
84
|
+
list: async () => ({ items: [listed("id-1", "2026-08-13T09:00:00Z")], nextCursor: null }),
|
|
85
|
+
});
|
|
86
|
+
h.setStored({ newestReceivedAt: "2026-08-13T09:00:00Z", idsAtNewest: ["id-1"] });
|
|
87
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
88
|
+
assert.equal(r.fetched, 0);
|
|
89
|
+
assert.equal(h.writes.length, 0);
|
|
90
|
+
assert.deepEqual(h.stored, { newestReceivedAt: "2026-08-13T09:00:00Z", idsAtNewest: ["id-1"] });
|
|
91
|
+
assert.ok(h.lines.some((l) => l === "op=sample mailbox=a@example.com provider=outlook fetched=0 cursor=2026-08-13T09:00:00Z"), h.lines.join("\n"));
|
|
92
|
+
});
|
|
93
|
+
test("messages above the cursor are written once and the cursor advances", async () => {
|
|
94
|
+
const h = harness({
|
|
95
|
+
list: async () => ({
|
|
96
|
+
items: [listed("id-2", "2026-08-13T10:00:00Z"), listed("id-1", "2026-08-13T09:00:00Z")],
|
|
97
|
+
nextCursor: null,
|
|
98
|
+
}),
|
|
99
|
+
fetchBody: async (_t, id) => body(id, id === "id-2" ? "2026-08-13T10:00:00Z" : "2026-08-13T09:00:00Z"),
|
|
100
|
+
});
|
|
101
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
102
|
+
assert.equal(r.fetched, 2);
|
|
103
|
+
assert.equal(h.writes.length, 1, "one write for the whole batch");
|
|
104
|
+
assert.equal(h.writes[0].length, 2);
|
|
105
|
+
assert.deepEqual(h.stored, {
|
|
106
|
+
newestReceivedAt: "2026-08-13T10:00:00Z",
|
|
107
|
+
idsAtNewest: ["id-2"],
|
|
108
|
+
});
|
|
109
|
+
assert.ok(h.lines.some((l) => l === "op=sample mailbox=a@example.com provider=outlook fetched=2 threads=1 skipped=0 cursor=2026-08-13T10:00:00Z"), h.lines.join("\n"));
|
|
110
|
+
});
|
|
111
|
+
test("a sibling arriving at the cursor instant is ingested and joins the exclusion set", async () => {
|
|
112
|
+
const h = harness({
|
|
113
|
+
list: async () => ({
|
|
114
|
+
items: [listed("id-1b", "2026-08-13T09:00:00Z"), listed("id-1", "2026-08-13T09:00:00Z")],
|
|
115
|
+
nextCursor: null,
|
|
116
|
+
}),
|
|
117
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T09:00:00Z"),
|
|
118
|
+
});
|
|
119
|
+
h.setStored({ newestReceivedAt: "2026-08-13T09:00:00Z", idsAtNewest: ["id-1"] });
|
|
120
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
121
|
+
assert.equal(r.fetched, 1, "only the unseen sibling");
|
|
122
|
+
assert.equal(h.writes[0].length, 1);
|
|
123
|
+
assert.equal(h.writes[0][0].messageId, "id-1b");
|
|
124
|
+
assert.deepEqual(h.stored, {
|
|
125
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
126
|
+
idsAtNewest: ["id-1", "id-1b"],
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
test("a second cycle over the same listing re-ingests nothing", async () => {
|
|
130
|
+
const items = [listed("id-2", "2026-08-13T10:00:00Z"), listed("id-1", "2026-08-13T09:00:00Z")];
|
|
131
|
+
const h = harness({
|
|
132
|
+
list: async () => ({ items, nextCursor: null }),
|
|
133
|
+
fetchBody: async (_t, id) => body(id, id === "id-2" ? "2026-08-13T10:00:00Z" : "2026-08-13T09:00:00Z"),
|
|
134
|
+
});
|
|
135
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
136
|
+
// The second cycle's list is filtered `ge cursor`, so only the boundary
|
|
137
|
+
// message comes back — and it is excluded by id.
|
|
138
|
+
const h2 = harness({
|
|
139
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
140
|
+
});
|
|
141
|
+
h2.setStored(h.stored);
|
|
142
|
+
const r2 = await sampleOutlookMailbox(h2.deps, TARGET);
|
|
143
|
+
assert.equal(r2.fetched, 0);
|
|
144
|
+
assert.equal(h2.writes.length, 0);
|
|
145
|
+
});
|
|
146
|
+
test("a write failure leaves the cursor unadvanced", async () => {
|
|
147
|
+
const h = harness({
|
|
148
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
149
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T10:00:00Z"),
|
|
150
|
+
write: async () => {
|
|
151
|
+
throw new Error("neo4j down");
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
155
|
+
assert.equal(r.error, "neo4j down");
|
|
156
|
+
assert.equal(h.stored, null);
|
|
157
|
+
assert.ok(h.lines.some((l) => l === "op=sample-error mailbox=a@example.com provider=outlook detail=neo4j down"), h.lines.join("\n"));
|
|
158
|
+
});
|
|
159
|
+
test("a list failure writes nothing and leaves the cursor unadvanced", async () => {
|
|
160
|
+
const h = harness({
|
|
161
|
+
list: async () => {
|
|
162
|
+
throw new Error("graph 503");
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
166
|
+
assert.equal(r.error, "graph 503");
|
|
167
|
+
assert.equal(h.writes.length, 0);
|
|
168
|
+
assert.equal(h.stored, null);
|
|
169
|
+
});
|
|
170
|
+
test("a body-fetch failure writes nothing and leaves the cursor unadvanced", async () => {
|
|
171
|
+
const h = harness({
|
|
172
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
173
|
+
fetchBody: async () => {
|
|
174
|
+
throw new Error("graph 404");
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
178
|
+
assert.equal(r.error, "graph 404");
|
|
179
|
+
assert.equal(h.writes.length, 0);
|
|
180
|
+
assert.equal(h.stored, null);
|
|
181
|
+
});
|
|
182
|
+
test("every page is fetched before anything is written", async () => {
|
|
183
|
+
const h = harness({
|
|
184
|
+
list: async (_t, _since, cursor) => cursor
|
|
185
|
+
? { items: [listed("id-1", "2026-08-13T09:00:00Z")], nextCursor: null }
|
|
186
|
+
: { items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: "next-link" },
|
|
187
|
+
fetchBody: async (_t, id) => body(id, id === "id-2" ? "2026-08-13T10:00:00Z" : "2026-08-13T09:00:00Z"),
|
|
188
|
+
});
|
|
189
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
190
|
+
assert.equal(r.fetched, 2);
|
|
191
|
+
assert.equal(h.writes.length, 1, "one write, after both pages");
|
|
192
|
+
assert.equal(h.stored?.newestReceivedAt, "2026-08-13T10:00:00Z");
|
|
193
|
+
});
|
|
194
|
+
test("a continuation page is requested with the cursor and no since filter", async () => {
|
|
195
|
+
const calls = [];
|
|
196
|
+
const h = harness({
|
|
197
|
+
list: async (_t, since, cursor) => {
|
|
198
|
+
calls.push({ since, cursor });
|
|
199
|
+
return cursor
|
|
200
|
+
? { items: [], nextCursor: null }
|
|
201
|
+
: { items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: "next-link" };
|
|
202
|
+
},
|
|
203
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T10:00:00Z"),
|
|
204
|
+
});
|
|
205
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
206
|
+
assert.equal(calls.length, 2);
|
|
207
|
+
assert.equal(calls[1].cursor, "next-link");
|
|
208
|
+
assert.equal(calls[1].since, undefined, "a nextLink already encodes the filter");
|
|
209
|
+
});
|
|
210
|
+
test("a delegated mailbox names its delegator on the sample line", async () => {
|
|
211
|
+
const h = harness();
|
|
212
|
+
await sampleOutlookMailbox(h.deps, {
|
|
213
|
+
...TARGET,
|
|
214
|
+
mailbox: "shared@example.com",
|
|
215
|
+
pathPrefix: "/users/shared%40example.com",
|
|
216
|
+
via: "a@example.com",
|
|
217
|
+
});
|
|
218
|
+
assert.ok(h.lines.some((l) => l ===
|
|
219
|
+
"op=sample mailbox=shared@example.com provider=outlook via=a@example.com fetched=0 cursor=none"), h.lines.join("\n"));
|
|
220
|
+
});
|
|
221
|
+
test("the full body is written with no truncation", async () => {
|
|
222
|
+
const long = "x".repeat(4000);
|
|
223
|
+
const h = harness({
|
|
224
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
225
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T10:00:00Z", long),
|
|
226
|
+
});
|
|
227
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
228
|
+
assert.equal(h.writes[0][0].bodyText.length, 4000);
|
|
229
|
+
});
|
|
230
|
+
test("the written record carries the envelope the archive dispatcher groups on", async () => {
|
|
231
|
+
const h = harness({
|
|
232
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
233
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T10:00:00Z"),
|
|
234
|
+
});
|
|
235
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
236
|
+
assert.deepEqual(h.writes[0][0], {
|
|
237
|
+
messageId: "id-2",
|
|
238
|
+
conversationId: "conv-1",
|
|
239
|
+
fromAddress: "sender@example.com",
|
|
240
|
+
fromName: "Sender",
|
|
241
|
+
toAddresses: ["a@example.com"],
|
|
242
|
+
ccAddresses: [],
|
|
243
|
+
subject: "subject",
|
|
244
|
+
bodyText: "full body",
|
|
245
|
+
receivedDateTime: "2026-08-13T10:00:00Z",
|
|
246
|
+
accountId: "acct-1",
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
test("a later message with finer fractional precision still wins the cursor", async () => {
|
|
250
|
+
// Raw string comparison puts "...00.5Z" BEFORE "...00Z" because '.' precedes
|
|
251
|
+
// 'Z'. If the cursor were chosen that way, id-late would never be excluded and
|
|
252
|
+
// would be re-fetched and re-written on every cycle for ever.
|
|
253
|
+
const h = harness({
|
|
254
|
+
list: async () => ({
|
|
255
|
+
items: [
|
|
256
|
+
listed("id-late", "2026-08-13T09:00:00.5Z"),
|
|
257
|
+
listed("id-early", "2026-08-13T09:00:00Z"),
|
|
258
|
+
],
|
|
259
|
+
nextCursor: null,
|
|
260
|
+
}),
|
|
261
|
+
fetchBody: async (_t, id) => body(id, id === "id-late" ? "2026-08-13T09:00:00.5Z" : "2026-08-13T09:00:00Z"),
|
|
262
|
+
});
|
|
263
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
264
|
+
assert.deepEqual(h.stored, {
|
|
265
|
+
newestReceivedAt: "2026-08-13T09:00:00.5Z",
|
|
266
|
+
idsAtNewest: ["id-late"],
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
test("the same instant in two spellings is one instant for the exclusion set", async () => {
|
|
270
|
+
const h = harness({
|
|
271
|
+
readCursor: () => ({ newestReceivedAt: "2026-08-13T09:00:00.000Z", idsAtNewest: ["id-1"] }),
|
|
272
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T09:00:00Z")], nextCursor: null }),
|
|
273
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T09:00:00Z"),
|
|
274
|
+
});
|
|
275
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
276
|
+
// Same instant, different spelling: id-1 must be carried, not discarded.
|
|
277
|
+
assert.deepEqual(h.stored?.idsAtNewest, ["id-1", "id-2"]);
|
|
278
|
+
});
|
|
279
|
+
test("the cursor never moves backwards when a fetched instant disagrees with its listing", async () => {
|
|
280
|
+
const h = harness({
|
|
281
|
+
readCursor: () => ({ newestReceivedAt: "2026-08-13T10:00:00Z", idsAtNewest: ["id-1"] }),
|
|
282
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
283
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T08:00:00Z"),
|
|
284
|
+
});
|
|
285
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
286
|
+
assert.equal(h.stored?.newestReceivedAt, "2026-08-13T10:00:00Z");
|
|
287
|
+
});
|
|
288
|
+
test("an all-skipped write reports the skip and names the unresolved addresses", async () => {
|
|
289
|
+
const h = harness({
|
|
290
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
291
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T10:00:00Z"),
|
|
292
|
+
write: async () => ({
|
|
293
|
+
threadsDispatched: 0,
|
|
294
|
+
threadsSkipped: 1,
|
|
295
|
+
unresolvedAddresses: ["stranger@example.com"],
|
|
296
|
+
}),
|
|
297
|
+
});
|
|
298
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
299
|
+
// fetched=1 alone would state that a message was sampled while nothing
|
|
300
|
+
// reached the graph, and the cursor advances past it either way.
|
|
301
|
+
assert.ok(h.lines.some((l) => l ===
|
|
302
|
+
"op=sample mailbox=a@example.com provider=outlook fetched=1 threads=0 skipped=1 cursor=2026-08-13T10:00:00Z"), h.lines.join("\n"));
|
|
303
|
+
assert.ok(h.lines.some((l) => l ===
|
|
304
|
+
"op=sample-unresolved mailbox=a@example.com provider=outlook threads=1 addresses=stranger@example.com"), h.lines.join("\n"));
|
|
305
|
+
});
|
|
306
|
+
test("a fully resolved write emits no unresolved line", async () => {
|
|
307
|
+
const h = harness({
|
|
308
|
+
list: async () => ({ items: [listed("id-2", "2026-08-13T10:00:00Z")], nextCursor: null }),
|
|
309
|
+
fetchBody: async (_t, id) => body(id, "2026-08-13T10:00:00Z"),
|
|
310
|
+
});
|
|
311
|
+
await sampleOutlookMailbox(h.deps, TARGET);
|
|
312
|
+
assert.ok(!h.lines.some((l) => l.includes("op=sample-unresolved")), h.lines.join("\n"));
|
|
313
|
+
});
|
|
314
|
+
test("an unparseable instant with no stored cursor leaves the cursor unwritten", async () => {
|
|
315
|
+
const h = harness({
|
|
316
|
+
list: async () => ({ items: [listed("id-2", "not-a-date")], nextCursor: null }),
|
|
317
|
+
fetchBody: async (_t, id) => body(id, "not-a-date"),
|
|
318
|
+
});
|
|
319
|
+
const r = await sampleOutlookMailbox(h.deps, TARGET);
|
|
320
|
+
assert.equal(r.error, "no-parseable-instant");
|
|
321
|
+
assert.equal(h.stored, null, "a NaN cursor is worse than re-reading the window");
|
|
322
|
+
assert.ok(h.lines.some((l) => l.includes("detail=no-parseable-instant")), h.lines.join("\n"));
|
|
323
|
+
});
|
|
324
|
+
//# sourceMappingURL=sample-outlook-mailbox.test.js.map
|
package/payload/platform/plugins/outlook/mcp/dist/__tests__/sample-outlook-mailbox.test.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample-outlook-mailbox.test.js","sourceRoot":"","sources":["../../src/__tests__/sample-outlook-mailbox.test.ts"],"names":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AC,CAAC,CAAC;AAEH,IAAI,CAAC,0EAA0E,EAAE,KAAK,IAAI,EAAE;IAC1F,MAAM,CAAC,GAAG,OAAO,CAAC;QAChB,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QAC/E,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC;KACpD,CAAC,CAAC;IACH,MAAM,CAAC,GAAG,MAAM,oBAAoB,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,kDAAkD,CAAC,CAAC;IACjF,MAAM,CAAC,EAAE,CACP,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC,EAC9D,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler-cursor.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/sampler-cursor.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { mkdtempSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { readCursor, writeCursor } from "../sampler/cursor.js";
|
|
7
|
+
function tmp() {
|
|
8
|
+
return mkdtempSync(join(tmpdir(), "outlook-cursor-"));
|
|
9
|
+
}
|
|
10
|
+
function pathFor(dir, accountId) {
|
|
11
|
+
return join(dir, accountId, "secrets", "outlook", "sampler-cursors.json");
|
|
12
|
+
}
|
|
13
|
+
test("a mailbox with no cursor reads null", () => {
|
|
14
|
+
assert.equal(readCursor(tmp(), "acct-1", "a@example.com"), null);
|
|
15
|
+
});
|
|
16
|
+
test("a written cursor reads back for that mailbox only", () => {
|
|
17
|
+
const dir = tmp();
|
|
18
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
19
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
20
|
+
idsAtNewest: ["id-1"],
|
|
21
|
+
});
|
|
22
|
+
assert.deepEqual(readCursor(dir, "acct-1", "a@example.com"), {
|
|
23
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
24
|
+
idsAtNewest: ["id-1"],
|
|
25
|
+
});
|
|
26
|
+
assert.equal(readCursor(dir, "acct-1", "b@example.com"), null);
|
|
27
|
+
});
|
|
28
|
+
test("a second mailbox's write preserves the first", () => {
|
|
29
|
+
const dir = tmp();
|
|
30
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
31
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
32
|
+
idsAtNewest: ["id-1"],
|
|
33
|
+
});
|
|
34
|
+
writeCursor(dir, "acct-1", "b@example.com", {
|
|
35
|
+
newestReceivedAt: "2026-08-13T10:00:00Z",
|
|
36
|
+
idsAtNewest: ["id-2"],
|
|
37
|
+
});
|
|
38
|
+
assert.equal(readCursor(dir, "acct-1", "a@example.com")?.newestReceivedAt, "2026-08-13T09:00:00Z");
|
|
39
|
+
assert.equal(readCursor(dir, "acct-1", "b@example.com")?.newestReceivedAt, "2026-08-13T10:00:00Z");
|
|
40
|
+
});
|
|
41
|
+
test("a second account's cursors are a separate file", () => {
|
|
42
|
+
const dir = tmp();
|
|
43
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
44
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
45
|
+
idsAtNewest: [],
|
|
46
|
+
});
|
|
47
|
+
assert.equal(readCursor(dir, "acct-2", "a@example.com"), null);
|
|
48
|
+
});
|
|
49
|
+
test("the mailbox key is case- and whitespace-insensitive", () => {
|
|
50
|
+
const dir = tmp();
|
|
51
|
+
writeCursor(dir, "acct-1", " A@Example.com ", {
|
|
52
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
53
|
+
idsAtNewest: [],
|
|
54
|
+
});
|
|
55
|
+
assert.ok(readCursor(dir, "acct-1", "a@example.com"));
|
|
56
|
+
});
|
|
57
|
+
test("the cursor file is written 0600 and holds the mailbox key", () => {
|
|
58
|
+
const dir = tmp();
|
|
59
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
60
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
61
|
+
idsAtNewest: [],
|
|
62
|
+
});
|
|
63
|
+
const path = pathFor(dir, "acct-1");
|
|
64
|
+
assert.equal(statSync(path).mode & 0o777, 0o600);
|
|
65
|
+
assert.ok(Object.hasOwn(JSON.parse(readFileSync(path, "utf-8")), "a@example.com"));
|
|
66
|
+
});
|
|
67
|
+
test("an unparseable cursor file reads as no cursor rather than throwing", () => {
|
|
68
|
+
const dir = tmp();
|
|
69
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
70
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
71
|
+
idsAtNewest: [],
|
|
72
|
+
});
|
|
73
|
+
writeFileSync(pathFor(dir, "acct-1"), "{not json");
|
|
74
|
+
assert.equal(readCursor(dir, "acct-1", "a@example.com"), null);
|
|
75
|
+
});
|
|
76
|
+
test("an entry with no instant reads as no cursor", () => {
|
|
77
|
+
const dir = tmp();
|
|
78
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
79
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
80
|
+
idsAtNewest: [],
|
|
81
|
+
});
|
|
82
|
+
writeFileSync(pathFor(dir, "acct-1"), JSON.stringify({ "a@example.com": { idsAtNewest: [] } }));
|
|
83
|
+
assert.equal(readCursor(dir, "acct-1", "a@example.com"), null);
|
|
84
|
+
});
|
|
85
|
+
test("an entry with no id list reads as an empty exclusion set", () => {
|
|
86
|
+
const dir = tmp();
|
|
87
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
88
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
89
|
+
idsAtNewest: [],
|
|
90
|
+
});
|
|
91
|
+
writeFileSync(pathFor(dir, "acct-1"), JSON.stringify({ "a@example.com": { newestReceivedAt: "2026-08-13T09:00:00Z" } }));
|
|
92
|
+
assert.deepEqual(readCursor(dir, "acct-1", "a@example.com")?.idsAtNewest, []);
|
|
93
|
+
});
|
|
94
|
+
test("an inherited property name is not read as a stored cursor", () => {
|
|
95
|
+
const dir = tmp();
|
|
96
|
+
writeCursor(dir, "acct-1", "a@example.com", {
|
|
97
|
+
newestReceivedAt: "2026-08-13T09:00:00Z",
|
|
98
|
+
idsAtNewest: [],
|
|
99
|
+
});
|
|
100
|
+
assert.equal(readCursor(dir, "acct-1", "constructor"), null);
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=sampler-cursor.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler-cursor.test.js","sourceRoot":"","sources":["../../src/__tests__/sampler-cursor.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE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AE,eAAe,CAAC,EAAE,IAAI,CAAC,CAAC;AACjE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,0DAA0D,EAAE,GAAG,EAAE;IACpE,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC;IAClB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE;QAC1C,gBAAgB,EAAE,sBAAsB;QACxC,WAAW,EAAE,EAAE;KAChB,CAAC,CAAC;IACH,aAAa,CACX,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,EACtB,IAAI,CAAC,SAAS,CAAC,EAAE,eAAe,EAAE,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,EAAE,CAAC,CAClF,CAAC;IACF,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2DAA2D,EAAE,GAAG,EAAE;IACrE,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC;IAClB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE;QAC1C,gBAAgB,EAAE,sBAAsB;QACxC,WAAW,EAAE,EAAE;KAChB,CAAC,CAAC;IACH,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,IAAI,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler-enumerate.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/sampler-enumerate.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { TokenStore } from "../auth/token-store.js";
|
|
7
|
+
import { DelegatedStore } from "../auth/delegated-store.js";
|
|
8
|
+
import { censusLine, enumerateSampleableMailboxes } from "../sampler/enumerate.js";
|
|
9
|
+
const ACCT = "11111111-2222-3333-4444-555555555555";
|
|
10
|
+
const ACCT_B = "99999999-8888-7777-6666-555555555555";
|
|
11
|
+
function tmp() {
|
|
12
|
+
return mkdtempSync(join(tmpdir(), "outlook-enum-"));
|
|
13
|
+
}
|
|
14
|
+
/** A provisioned account is a UUID directory holding a parseable account.json. */
|
|
15
|
+
function provision(dir, accountId) {
|
|
16
|
+
mkdirSync(join(dir, accountId), { recursive: true });
|
|
17
|
+
writeFileSync(join(dir, accountId, "account.json"), JSON.stringify({ accountId }));
|
|
18
|
+
}
|
|
19
|
+
function connect(dir, accountId, graphUserId, mail) {
|
|
20
|
+
new TokenStore(accountId, dir, graphUserId).store("access", "refresh", 3600, {
|
|
21
|
+
graphUserId,
|
|
22
|
+
mail,
|
|
23
|
+
scopes: ["Mail.Read"],
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
test("an absent accounts dir enumerates nothing", () => {
|
|
27
|
+
const dir = join(tmp(), "absent");
|
|
28
|
+
assert.deepEqual(enumerateSampleableMailboxes(dir), { sampleable: [], skipped: [], accounts: 0 });
|
|
29
|
+
});
|
|
30
|
+
test("a signed-in mailbox is sampleable with the /me prefix", () => {
|
|
31
|
+
const dir = tmp();
|
|
32
|
+
provision(dir, ACCT);
|
|
33
|
+
connect(dir, ACCT, "guid-1", "a@example.com");
|
|
34
|
+
const { sampleable, skipped } = enumerateSampleableMailboxes(dir);
|
|
35
|
+
assert.deepEqual(skipped, []);
|
|
36
|
+
assert.deepEqual(sampleable, [
|
|
37
|
+
{
|
|
38
|
+
accountId: ACCT,
|
|
39
|
+
mailbox: "a@example.com",
|
|
40
|
+
mailboxKey: "guid-1",
|
|
41
|
+
pathPrefix: "/me",
|
|
42
|
+
via: null,
|
|
43
|
+
},
|
|
44
|
+
]);
|
|
45
|
+
});
|
|
46
|
+
test("a directory with no account.json is not a provisioned account", () => {
|
|
47
|
+
const dir = tmp();
|
|
48
|
+
connect(dir, ACCT, "guid-1", "a@example.com");
|
|
49
|
+
assert.deepEqual(enumerateSampleableMailboxes(dir).sampleable, []);
|
|
50
|
+
});
|
|
51
|
+
test("a non-UUID directory name is not a provisioned account", () => {
|
|
52
|
+
const dir = tmp();
|
|
53
|
+
provision(dir, "not-a-uuid");
|
|
54
|
+
connect(dir, "not-a-uuid", "guid-1", "a@example.com");
|
|
55
|
+
assert.deepEqual(enumerateSampleableMailboxes(dir).sampleable, []);
|
|
56
|
+
});
|
|
57
|
+
test("every provisioned account is enumerated", () => {
|
|
58
|
+
const dir = tmp();
|
|
59
|
+
provision(dir, ACCT);
|
|
60
|
+
provision(dir, ACCT_B);
|
|
61
|
+
connect(dir, ACCT, "guid-1", "a@example.com");
|
|
62
|
+
connect(dir, ACCT_B, "guid-2", "b@example.com");
|
|
63
|
+
const boxes = enumerateSampleableMailboxes(dir).sampleable.map((m) => m.mailbox).sort();
|
|
64
|
+
assert.deepEqual(boxes, ["a@example.com", "b@example.com"]);
|
|
65
|
+
});
|
|
66
|
+
test("a delegated mailbox is sampleable through its delegator's prefix", () => {
|
|
67
|
+
const dir = tmp();
|
|
68
|
+
provision(dir, ACCT);
|
|
69
|
+
connect(dir, ACCT, "guid-1", "a@example.com");
|
|
70
|
+
new DelegatedStore(ACCT, dir).add("shared@example.com", "guid-1", 1);
|
|
71
|
+
const { sampleable } = enumerateSampleableMailboxes(dir);
|
|
72
|
+
const shared = sampleable.find((m) => m.mailbox === "shared@example.com");
|
|
73
|
+
assert.deepEqual(shared, {
|
|
74
|
+
accountId: ACCT,
|
|
75
|
+
mailbox: "shared@example.com",
|
|
76
|
+
mailboxKey: "guid-1",
|
|
77
|
+
pathPrefix: `/users/${encodeURIComponent("shared@example.com")}`,
|
|
78
|
+
via: "a@example.com",
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
test("a delegated record whose delegator is gone is skipped with a reason", () => {
|
|
82
|
+
const dir = tmp();
|
|
83
|
+
provision(dir, ACCT);
|
|
84
|
+
new DelegatedStore(ACCT, dir).add("shared@example.com", "guid-missing", 1);
|
|
85
|
+
const { sampleable, skipped } = enumerateSampleableMailboxes(dir);
|
|
86
|
+
assert.deepEqual(sampleable, []);
|
|
87
|
+
assert.equal(skipped.length, 1);
|
|
88
|
+
assert.equal(skipped[0].mailbox, "shared@example.com");
|
|
89
|
+
assert.match(skipped[0].reason, /delegator-missing/);
|
|
90
|
+
});
|
|
91
|
+
test("a mailbox with a blank email is skipped, never sampled", () => {
|
|
92
|
+
const dir = tmp();
|
|
93
|
+
provision(dir, ACCT);
|
|
94
|
+
connect(dir, ACCT, "guid-2", null);
|
|
95
|
+
const { sampleable, skipped } = enumerateSampleableMailboxes(dir);
|
|
96
|
+
assert.deepEqual(sampleable, []);
|
|
97
|
+
assert.equal(skipped.length, 1);
|
|
98
|
+
assert.match(skipped[0].reason, /blank-email/);
|
|
99
|
+
});
|
|
100
|
+
test("an account with no outlook mailboxes contributes nothing", () => {
|
|
101
|
+
const dir = tmp();
|
|
102
|
+
provision(dir, ACCT);
|
|
103
|
+
// The account IS walked; it simply holds no mailbox. `accounts: 1` is what
|
|
104
|
+
// separates that from an accountsDir that resolved nowhere.
|
|
105
|
+
assert.deepEqual(enumerateSampleableMailboxes(dir), { sampleable: [], skipped: [], accounts: 1 });
|
|
106
|
+
});
|
|
107
|
+
test("the census is emitted with zeros when nothing is connected", () => {
|
|
108
|
+
const dir = tmp();
|
|
109
|
+
provision(dir, ACCT);
|
|
110
|
+
// The guarantee: an install with no Outlook mailbox still says so. Silence
|
|
111
|
+
// here would be indistinguishable from the arm never running.
|
|
112
|
+
assert.equal(censusLine(enumerateSampleableMailboxes(dir)), "op=sample-census provider=outlook accounts=1 mailboxes=0 delegated=0 skipped=0");
|
|
113
|
+
});
|
|
114
|
+
test("the census counts an absent accounts dir as zero accounts", () => {
|
|
115
|
+
assert.equal(censusLine(enumerateSampleableMailboxes(join(tmp(), "absent"))), "op=sample-census provider=outlook accounts=0 mailboxes=0 delegated=0 skipped=0");
|
|
116
|
+
});
|
|
117
|
+
test("the census separates delegated mailboxes from signed-in ones", () => {
|
|
118
|
+
const dir = tmp();
|
|
119
|
+
provision(dir, ACCT);
|
|
120
|
+
connect(dir, ACCT, "guid-1", "a@example.com");
|
|
121
|
+
new DelegatedStore(ACCT, dir).add("shared@example.com", "guid-1", 1);
|
|
122
|
+
new DelegatedStore(ACCT, dir).add("orphan@example.com", "guid-missing", 1);
|
|
123
|
+
assert.equal(censusLine(enumerateSampleableMailboxes(dir)), "op=sample-census provider=outlook accounts=1 mailboxes=2 delegated=1 skipped=1");
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=sampler-enumerate.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler-enumerate.test.js","sourceRoot":"","sources":["../../src/__tests__/sampler-enumerate.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEnF,MAAM,IAAI,GAAG,sCAAsC,CAAC;AACpD,MAAM,MAAM,GAAG,sCAAsC,CAAC;AAEtD,SAAS,GAAG;IACV,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC,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