run402 4.7.0 → 4.8.0
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/lib/notifications.mjs
CHANGED
|
@@ -1,32 +1,61 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* run402 notifications — Operator health notifications.
|
|
2
|
+
* run402 notifications — Operator health notifications + Telegram channel/rules.
|
|
3
3
|
*
|
|
4
4
|
* Wraps the v1.55 `add-operator-health-notifications` API surface:
|
|
5
5
|
*
|
|
6
6
|
* - run402 notifications list [--type ...] [--since ...] [--limit N] [--after <cursor>]
|
|
7
7
|
* - run402 notifications get <id>
|
|
8
8
|
* - run402 notifications preferences [get|set ...]
|
|
9
|
-
* - run402 notifications test
|
|
9
|
+
* - run402 notifications test [--source app|platform] [--type <event_type>]
|
|
10
10
|
* - run402 webhook-secret rotate
|
|
11
11
|
*
|
|
12
|
+
* ...and the `notification-channel-routing-telegram` cascade (self-serve
|
|
13
|
+
* Telegram push + per-rule routing on top of the substrate above):
|
|
14
|
+
*
|
|
15
|
+
* - run402 notifications channels connect telegram [--label <name>]
|
|
16
|
+
* - run402 notifications channels list
|
|
17
|
+
* - run402 notifications channels revoke <binding_id>
|
|
18
|
+
* - run402 notifications rules add --binding <id> [--project <id>] [--source app|platform] [--type a,b] [--class a,b]
|
|
19
|
+
* - run402 notifications rules list
|
|
20
|
+
* - run402 notifications rules rm <rule_id>
|
|
21
|
+
*
|
|
12
22
|
* All commands use the allowance-wallet auth path (SIWX). The assurance
|
|
13
|
-
* ladder is enforced server-side; CLI surfaces 403 errors
|
|
14
|
-
*
|
|
23
|
+
* ladder is enforced server-side; CLI surfaces 403/412/503 errors verbatim
|
|
24
|
+
* (message + code + next_actions) via reportSdkError — no client-side
|
|
25
|
+
* special-casing needed, e.g. a not-yet-provisioned Telegram bot surfaces as
|
|
26
|
+
* 503 TELEGRAM_CHANNEL_NOT_CONFIGURED with its next_actions intact.
|
|
27
|
+
*
|
|
28
|
+
* `channels`/`rules` are nested groups dispatched via `if (sub === ...)`
|
|
29
|
+
* (not `case`), mirroring cli/lib/org.mjs's `member`/`invite` groups — see
|
|
30
|
+
* sync.test.ts's parseNotificationsGroupActions for why.
|
|
15
31
|
*/
|
|
16
32
|
|
|
17
33
|
import { allowanceAuthHeaders } from "./config.mjs";
|
|
18
34
|
import { getSdk } from "./sdk.mjs";
|
|
19
35
|
import { reportSdkError, fail } from "./sdk-errors.mjs";
|
|
20
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
assertAllowedValue,
|
|
38
|
+
assertKnownFlags,
|
|
39
|
+
flagValue,
|
|
40
|
+
normalizeArgv,
|
|
41
|
+
positionalArgs,
|
|
42
|
+
requirePositionalCount,
|
|
43
|
+
} from "./argparse.mjs";
|
|
21
44
|
|
|
22
|
-
const HELP = `run402 notifications — Operator health notifications
|
|
45
|
+
const HELP = `run402 notifications — Operator health notifications + Telegram channel/rules
|
|
23
46
|
|
|
24
47
|
Usage:
|
|
25
48
|
run402 notifications list [--type <event_type>] [--since <iso>] [--limit N] [--after <cursor>]
|
|
26
49
|
run402 notifications get <id>
|
|
27
50
|
run402 notifications preferences
|
|
28
51
|
run402 notifications preferences set <key>=<value> [<key>=<value> ...]
|
|
29
|
-
run402 notifications test
|
|
52
|
+
run402 notifications test [--source app|platform] [--type <event_type>]
|
|
53
|
+
run402 notifications channels connect telegram [--label <name>]
|
|
54
|
+
run402 notifications channels list
|
|
55
|
+
run402 notifications channels revoke <binding_id>
|
|
56
|
+
run402 notifications rules add --binding <binding_id> [--project <id>] [--source app|platform] [--type a,b] [--class a,b]
|
|
57
|
+
run402 notifications rules list
|
|
58
|
+
run402 notifications rules rm <rule_id>
|
|
30
59
|
|
|
31
60
|
Examples:
|
|
32
61
|
run402 notifications list --limit 10
|
|
@@ -36,13 +65,112 @@ Examples:
|
|
|
36
65
|
run402 notifications preferences set digest_cadence=weekly digest_day_of_week=1
|
|
37
66
|
run402 notifications preferences set webhook_url=https://my-receiver.example.com/hook
|
|
38
67
|
run402 notifications test
|
|
68
|
+
run402 notifications test --source app --type signature_failed
|
|
69
|
+
run402 notifications channels connect telegram --label "kychon alerts"
|
|
70
|
+
run402 notifications channels list
|
|
71
|
+
run402 notifications rules add --binding bnd_1 --project prj_abc --source app --type signature_failed
|
|
39
72
|
|
|
40
73
|
Auth ladder (enforced server-side):
|
|
41
74
|
- SIWX wallet: read own notifications + preferences
|
|
42
75
|
- email_verified: cross-wallet rollup reads + multi-wallet preference updates
|
|
43
|
-
- operator_passkey: webhook URL changes, webhook secret rotation
|
|
76
|
+
- operator_passkey: webhook URL changes, webhook secret rotation, Telegram
|
|
77
|
+
channel connect/revoke, routing rule add/rm (channel
|
|
78
|
+
connect additionally requires a VERIFIED operator email)
|
|
79
|
+
|
|
80
|
+
Telegram channels + routing rules teach their own rule model in detail via
|
|
81
|
+
'run402 notifications channels --help' / 'run402 notifications rules --help'
|
|
82
|
+
(AND'd match dimensions, wildcards, one rule -> one chat, no rules -> no
|
|
83
|
+
Telegram traffic).
|
|
44
84
|
`;
|
|
45
85
|
|
|
86
|
+
const CHANNELS_HELP = `run402 notifications channels — Telegram channel bindings
|
|
87
|
+
|
|
88
|
+
Usage:
|
|
89
|
+
run402 notifications channels connect telegram [--label <name>]
|
|
90
|
+
run402 notifications channels list
|
|
91
|
+
run402 notifications channels revoke <binding_id>
|
|
92
|
+
|
|
93
|
+
connect telegram:
|
|
94
|
+
Creates a PENDING binding and prints two single-use, 15-minute deep links:
|
|
95
|
+
a private-chat link and a group-chat link. Open ONE of them in Telegram and
|
|
96
|
+
tap Start — whichever is tapped first consumes the code. This command then
|
|
97
|
+
POLLS 'channels list' (every few seconds, printing progress to stderr)
|
|
98
|
+
until the binding flips to active, or the code expires, whichever happens
|
|
99
|
+
first. Requires operator_passkey assurance AND a VERIFIED operator email
|
|
100
|
+
(bindings are addressed to it — see 'run402 agent verify-email').
|
|
101
|
+
|
|
102
|
+
--label <name> Human-readable name for the chat (e.g. "kychon alerts"),
|
|
103
|
+
1-64 characters.
|
|
104
|
+
|
|
105
|
+
list:
|
|
106
|
+
Shows every notification channel — email, webhook, and every live
|
|
107
|
+
(non-revoked) Telegram binding — for the authenticated wallet.
|
|
108
|
+
|
|
109
|
+
revoke <binding_id>:
|
|
110
|
+
Revokes a Telegram binding. Requires operator_passkey assurance. A
|
|
111
|
+
missing / already-revoked / another operator's binding id all return the
|
|
112
|
+
same not-found error (no existence oracle).
|
|
113
|
+
|
|
114
|
+
Until the platform's dedicated Telegram bot is provisioned on this
|
|
115
|
+
deployment, 'connect telegram' returns 503 TELEGRAM_CHANNEL_NOT_CONFIGURED
|
|
116
|
+
with a next_actions entry pointing at the operator to finish setup.
|
|
117
|
+
|
|
118
|
+
Examples:
|
|
119
|
+
run402 notifications channels connect telegram
|
|
120
|
+
run402 notifications channels connect telegram --label "kychon alerts"
|
|
121
|
+
run402 notifications channels list
|
|
122
|
+
run402 notifications channels revoke bnd_1a2b3c
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
const RULES_HELP = `run402 notifications rules — Telegram routing rules
|
|
126
|
+
|
|
127
|
+
Usage:
|
|
128
|
+
run402 notifications rules add --binding <binding_id> [--project <id>] [--source app|platform] [--type a,b] [--class a,b]
|
|
129
|
+
run402 notifications rules list
|
|
130
|
+
run402 notifications rules rm <rule_id>
|
|
131
|
+
|
|
132
|
+
The rule model:
|
|
133
|
+
- One rule routes to exactly ONE Telegram binding (one chat) — "N
|
|
134
|
+
destinations" is N rules, never a fan-out list on a single rule.
|
|
135
|
+
- Every match dimension you set is ANDed: --project + --source + --type +
|
|
136
|
+
--class must ALL match an event for the rule to fire.
|
|
137
|
+
- An OMITTED dimension is a WILDCARD (matches anything for that
|
|
138
|
+
dimension). 'rules add --binding bnd_1' with no other flags matches
|
|
139
|
+
EVERY event routed to that operator.
|
|
140
|
+
- --type and --class accept comma-separated lists and match if the event
|
|
141
|
+
is ANY of the listed values, e.g.
|
|
142
|
+
--type signature_failed,signature_expired.
|
|
143
|
+
- --source is "app" (your deployed function's events.emit(...) calls from
|
|
144
|
+
@run402/functions) or "platform" (deploys, lifecycle, verification,
|
|
145
|
+
...). Omit it to match both.
|
|
146
|
+
- Multiple rules OR together across an event; if two of YOUR rules both
|
|
147
|
+
resolve to the SAME binding for one event, only one message is sent
|
|
148
|
+
(deduped per chat, not per rule).
|
|
149
|
+
- NO RULES = NO TELEGRAM TRAFFIC for that operator. The Telegram channel
|
|
150
|
+
is opt-in per event, per rule — there is no "send everything" default,
|
|
151
|
+
unlike the always-on email channel.
|
|
152
|
+
- Rules govern the Telegram channel ONLY (v1). The mandatory email floor
|
|
153
|
+
(security / recovery / billing_critical / destructive_lifecycle /
|
|
154
|
+
verification classes) is completely untouched by this command and can
|
|
155
|
+
NEVER be silenced by adding or omitting a rule.
|
|
156
|
+
|
|
157
|
+
Requires operator_passkey assurance for add/rm. 'rules add' rejects an
|
|
158
|
+
unusable telegram_binding_id (revoked / not yours / nonexistent) with the
|
|
159
|
+
same 404 either way (authorize-before-reveal) — run 'channels list' first to
|
|
160
|
+
confirm the binding is 'active'.
|
|
161
|
+
|
|
162
|
+
Examples:
|
|
163
|
+
run402 notifications rules add --binding bnd_1
|
|
164
|
+
run402 notifications rules add --binding bnd_1 --project prj_abc --source app --type signature_failed
|
|
165
|
+
run402 notifications rules add --binding bnd_1 --class security,recovery
|
|
166
|
+
run402 notifications rules list
|
|
167
|
+
run402 notifications rules rm rule_9b21fa0a
|
|
168
|
+
`;
|
|
169
|
+
|
|
170
|
+
// ---------------------------------------------------------------------------
|
|
171
|
+
// Operator health notifications (v1.55) — list / get / preferences / test.
|
|
172
|
+
// ---------------------------------------------------------------------------
|
|
173
|
+
|
|
46
174
|
async function list(args) {
|
|
47
175
|
const parsedArgs = normalizeArgv(args);
|
|
48
176
|
const valueFlags = ["--type", "--since", "--limit", "--after"];
|
|
@@ -133,25 +261,317 @@ async function preferences(args) {
|
|
|
133
261
|
|
|
134
262
|
async function test(args) {
|
|
135
263
|
const parsedArgs = normalizeArgv(args);
|
|
136
|
-
|
|
137
|
-
|
|
264
|
+
const valueFlags = ["--source", "--type"];
|
|
265
|
+
assertKnownFlags(parsedArgs, [...valueFlags, "--help", "-h"], valueFlags);
|
|
266
|
+
const extra = positionalArgs(parsedArgs, valueFlags);
|
|
138
267
|
if (extra.length > 0) {
|
|
139
268
|
fail({ code: "BAD_USAGE", message: `Unexpected argument for notifications test: ${extra[0]}` });
|
|
140
269
|
}
|
|
270
|
+
const source = flagValue(parsedArgs, "--source");
|
|
271
|
+
if (source !== null) assertAllowedValue(source, ["app", "platform"], "--source");
|
|
272
|
+
const eventType = flagValue(parsedArgs, "--type");
|
|
141
273
|
allowanceAuthHeaders("/agent/v1/notifications/test");
|
|
274
|
+
const opts = {};
|
|
275
|
+
if (source) opts.source = source;
|
|
276
|
+
if (eventType) opts.eventType = eventType;
|
|
142
277
|
try {
|
|
143
|
-
const data = await getSdk().admin.testNotification();
|
|
278
|
+
const data = await getSdk().admin.testNotification(opts);
|
|
144
279
|
console.log(JSON.stringify(data, null, 2));
|
|
145
280
|
} catch (err) {
|
|
146
281
|
reportSdkError(err);
|
|
147
282
|
}
|
|
148
283
|
}
|
|
149
284
|
|
|
285
|
+
// ---------------------------------------------------------------------------
|
|
286
|
+
// Telegram channel bindings — notification-channel-routing-telegram.
|
|
287
|
+
// ---------------------------------------------------------------------------
|
|
288
|
+
|
|
289
|
+
const TELEGRAM_CONNECT_POLL_INTERVAL_MS = 3000;
|
|
290
|
+
/** Fallback wait bound if the server's code_expires_at is somehow
|
|
291
|
+
* unparseable — the connect code's real TTL is 15 minutes server-side. */
|
|
292
|
+
const TELEGRAM_CONNECT_FALLBACK_TIMEOUT_MS = 20 * 60 * 1000;
|
|
293
|
+
/** Print a progress line every Nth poll tick (~15s at the interval above) —
|
|
294
|
+
* frequent enough to reassure, not so frequent it floods stderr. */
|
|
295
|
+
const TELEGRAM_CONNECT_PROGRESS_EVERY_N_TICKS = 5;
|
|
296
|
+
|
|
297
|
+
function sleep(ms) {
|
|
298
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Poll `GET /agent/v1/notifications/channels` until `bindingId` shows
|
|
303
|
+
* `status: "active"`, or the connect code's `codeExpiresAt` passes.
|
|
304
|
+
* Transient poll failures (network blips) are logged and retried rather
|
|
305
|
+
* than aborting the whole connect flow — bounded by the same expiry.
|
|
306
|
+
*/
|
|
307
|
+
async function pollTelegramBindingActive(bindingId, codeExpiresAt) {
|
|
308
|
+
const parsedExpiry = Date.parse(codeExpiresAt);
|
|
309
|
+
const deadlineMs = Number.isFinite(parsedExpiry) ? parsedExpiry : Date.now() + TELEGRAM_CONNECT_FALLBACK_TIMEOUT_MS;
|
|
310
|
+
let tick = 0;
|
|
311
|
+
for (;;) {
|
|
312
|
+
await sleep(TELEGRAM_CONNECT_POLL_INTERVAL_MS);
|
|
313
|
+
tick += 1;
|
|
314
|
+
let channels;
|
|
315
|
+
try {
|
|
316
|
+
channels = await getSdk().admin.channels.list();
|
|
317
|
+
} catch (err) {
|
|
318
|
+
console.error(` (poll failed, retrying: ${err?.message || err})`);
|
|
319
|
+
if (Date.now() >= deadlineMs) return { active: false, timedOut: true, binding: null };
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
const binding = (channels.telegram || []).find((b) => b.id === bindingId) || null;
|
|
323
|
+
if (binding && binding.status === "active") {
|
|
324
|
+
return { active: true, binding };
|
|
325
|
+
}
|
|
326
|
+
if (Date.now() >= deadlineMs) {
|
|
327
|
+
return { active: false, timedOut: true, binding };
|
|
328
|
+
}
|
|
329
|
+
if (tick % TELEGRAM_CONNECT_PROGRESS_EVERY_N_TICKS === 1) {
|
|
330
|
+
const remainingSec = Math.max(0, Math.round((deadlineMs - Date.now()) / 1000));
|
|
331
|
+
const status = binding ? binding.status : "pending";
|
|
332
|
+
console.error(` waiting for you to tap the link in Telegram... (status: ${status}, ${remainingSec}s left)`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
async function channelsConnect(args) {
|
|
338
|
+
const a = normalizeArgv(args);
|
|
339
|
+
assertKnownFlags(a, ["--label", "--help", "-h"], ["--label"]);
|
|
340
|
+
const label = flagValue(a, "--label");
|
|
341
|
+
const positionals = positionalArgs(a, ["--label"]);
|
|
342
|
+
if (positionals.length === 0) {
|
|
343
|
+
fail({
|
|
344
|
+
code: "BAD_USAGE",
|
|
345
|
+
message: "Usage: run402 notifications channels connect telegram [--label <name>]",
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
if (positionals[0] !== "telegram") {
|
|
349
|
+
fail({
|
|
350
|
+
code: "BAD_USAGE",
|
|
351
|
+
message: `Unknown channel type: ${positionals[0]}. Only 'telegram' is supported.`,
|
|
352
|
+
details: { channel_type: positionals[0] },
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (positionals.length > 1) {
|
|
356
|
+
fail({ code: "BAD_USAGE", message: `Unexpected argument for notifications channels connect: ${positionals[1]}` });
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
allowanceAuthHeaders("/agent/v1/notifications/channels/telegram");
|
|
360
|
+
let pending;
|
|
361
|
+
try {
|
|
362
|
+
pending = await getSdk().admin.channels.connectTelegram(label ? { label } : {});
|
|
363
|
+
} catch (err) {
|
|
364
|
+
reportSdkError(err);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
console.error("");
|
|
369
|
+
console.error("Open ONE of these links in Telegram and tap Start to connect this channel:");
|
|
370
|
+
console.error(` Private chat: ${pending.connect_url}`);
|
|
371
|
+
console.error(` Group chat: ${pending.connect_group_url}`);
|
|
372
|
+
console.error(` Expires: ${pending.code_expires_at}`);
|
|
373
|
+
console.error("");
|
|
374
|
+
console.error("Waiting for you to tap the link...");
|
|
375
|
+
|
|
376
|
+
const outcome = await pollTelegramBindingActive(pending.binding_id, pending.code_expires_at);
|
|
377
|
+
if (outcome.active) {
|
|
378
|
+
console.error("Connected.");
|
|
379
|
+
console.log(JSON.stringify({ ...pending, connected: true, binding: outcome.binding }, null, 2));
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
console.error("Timed out waiting for you to tap the link — the connect code has expired.");
|
|
383
|
+
console.error("Run `run402 notifications channels connect telegram` again for a fresh link.");
|
|
384
|
+
console.log(JSON.stringify({ ...pending, connected: false, timed_out: true }, null, 2));
|
|
385
|
+
process.exit(1);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
async function channelsList() {
|
|
389
|
+
allowanceAuthHeaders("/agent/v1/notifications/channels");
|
|
390
|
+
try {
|
|
391
|
+
console.log(JSON.stringify(await getSdk().admin.channels.list(), null, 2));
|
|
392
|
+
} catch (err) {
|
|
393
|
+
reportSdkError(err);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
async function channelsRevoke(args) {
|
|
398
|
+
const a = normalizeArgv(args);
|
|
399
|
+
assertKnownFlags(a, ["--help", "-h"]);
|
|
400
|
+
const [bindingId] = requirePositionalCount(a, [], {
|
|
401
|
+
min: 1,
|
|
402
|
+
max: 1,
|
|
403
|
+
command: "run402 notifications channels revoke <binding_id>",
|
|
404
|
+
missing: "Missing <binding_id>.",
|
|
405
|
+
});
|
|
406
|
+
allowanceAuthHeaders("/agent/v1/notifications/channels/telegram");
|
|
407
|
+
try {
|
|
408
|
+
console.log(JSON.stringify(await getSdk().admin.channels.revokeTelegram(bindingId), null, 2));
|
|
409
|
+
} catch (err) {
|
|
410
|
+
reportSdkError(err);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
async function runChannels(args) {
|
|
415
|
+
const channelsAction = args[0];
|
|
416
|
+
const rest = args.slice(1);
|
|
417
|
+
if (!channelsAction || channelsAction === "--help" || channelsAction === "-h") {
|
|
418
|
+
console.log(CHANNELS_HELP);
|
|
419
|
+
process.exit(channelsAction ? 0 : 1);
|
|
420
|
+
}
|
|
421
|
+
if (rest.includes("--help") || rest.includes("-h")) {
|
|
422
|
+
console.log(CHANNELS_HELP);
|
|
423
|
+
process.exit(0);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
if (channelsAction === "connect") {
|
|
427
|
+
await channelsConnect(rest);
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
if (channelsAction === "list") {
|
|
431
|
+
await channelsList();
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
if (channelsAction === "revoke") {
|
|
435
|
+
await channelsRevoke(rest);
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
fail({
|
|
439
|
+
code: "BAD_USAGE",
|
|
440
|
+
message: `Unknown 'notifications channels' action: ${channelsAction}. Try connect | list | revoke.`,
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// ---------------------------------------------------------------------------
|
|
445
|
+
// Telegram routing rules — notification-channel-routing-telegram.
|
|
446
|
+
// ---------------------------------------------------------------------------
|
|
447
|
+
|
|
448
|
+
function splitCsv(value) {
|
|
449
|
+
return value
|
|
450
|
+
.split(",")
|
|
451
|
+
.map((s) => s.trim())
|
|
452
|
+
.filter((s) => s.length > 0);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
async function rulesAdd(args) {
|
|
456
|
+
const a = normalizeArgv(args);
|
|
457
|
+
const valueFlags = ["--binding", "--project", "--source", "--type", "--class"];
|
|
458
|
+
assertKnownFlags(a, [...valueFlags, "--help", "-h"], valueFlags);
|
|
459
|
+
const positionals = positionalArgs(a, valueFlags);
|
|
460
|
+
if (positionals.length > 0) {
|
|
461
|
+
fail({ code: "BAD_USAGE", message: `Unexpected argument for notifications rules add: ${positionals[0]}` });
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const bindingId = flagValue(a, "--binding");
|
|
465
|
+
if (!bindingId) {
|
|
466
|
+
fail({
|
|
467
|
+
code: "BAD_USAGE",
|
|
468
|
+
message:
|
|
469
|
+
"Usage: run402 notifications rules add --binding <binding_id> [--project <id>] [--source app|platform] [--type a,b] [--class a,b]",
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
const projectId = flagValue(a, "--project");
|
|
473
|
+
const source = flagValue(a, "--source");
|
|
474
|
+
if (source !== null) assertAllowedValue(source, ["app", "platform"], "--source");
|
|
475
|
+
const typeRaw = flagValue(a, "--type");
|
|
476
|
+
const classRaw = flagValue(a, "--class");
|
|
477
|
+
|
|
478
|
+
const input = { telegramBindingId: bindingId };
|
|
479
|
+
if (projectId) input.projectId = projectId;
|
|
480
|
+
if (source) input.source = source;
|
|
481
|
+
if (typeRaw !== null) input.eventTypes = splitCsv(typeRaw);
|
|
482
|
+
if (classRaw !== null) input.classes = splitCsv(classRaw);
|
|
483
|
+
|
|
484
|
+
allowanceAuthHeaders("/agent/v1/notifications/rules");
|
|
485
|
+
try {
|
|
486
|
+
console.log(JSON.stringify(await getSdk().admin.rules.create(input), null, 2));
|
|
487
|
+
} catch (err) {
|
|
488
|
+
reportSdkError(err);
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
async function rulesList() {
|
|
493
|
+
allowanceAuthHeaders("/agent/v1/notifications/rules");
|
|
494
|
+
try {
|
|
495
|
+
console.log(JSON.stringify(await getSdk().admin.rules.list(), null, 2));
|
|
496
|
+
} catch (err) {
|
|
497
|
+
reportSdkError(err);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
async function rulesRm(args) {
|
|
502
|
+
const a = normalizeArgv(args);
|
|
503
|
+
assertKnownFlags(a, ["--help", "-h"]);
|
|
504
|
+
const [ruleId] = requirePositionalCount(a, [], {
|
|
505
|
+
min: 1,
|
|
506
|
+
max: 1,
|
|
507
|
+
command: "run402 notifications rules rm <rule_id>",
|
|
508
|
+
missing: "Missing <rule_id>.",
|
|
509
|
+
});
|
|
510
|
+
allowanceAuthHeaders("/agent/v1/notifications/rules");
|
|
511
|
+
try {
|
|
512
|
+
console.log(JSON.stringify(await getSdk().admin.rules.delete(ruleId), null, 2));
|
|
513
|
+
} catch (err) {
|
|
514
|
+
reportSdkError(err);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
async function runRules(args) {
|
|
519
|
+
const rulesAction = args[0];
|
|
520
|
+
const rest = args.slice(1);
|
|
521
|
+
if (!rulesAction || rulesAction === "--help" || rulesAction === "-h") {
|
|
522
|
+
console.log(RULES_HELP);
|
|
523
|
+
process.exit(rulesAction ? 0 : 1);
|
|
524
|
+
}
|
|
525
|
+
if (rest.includes("--help") || rest.includes("-h")) {
|
|
526
|
+
console.log(RULES_HELP);
|
|
527
|
+
process.exit(0);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if (rulesAction === "add") {
|
|
531
|
+
await rulesAdd(rest);
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
if (rulesAction === "list") {
|
|
535
|
+
await rulesList();
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
if (rulesAction === "rm") {
|
|
539
|
+
await rulesRm(rest);
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
fail({
|
|
543
|
+
code: "BAD_USAGE",
|
|
544
|
+
message: `Unknown 'notifications rules' action: ${rulesAction}. Try add | list | rm.`,
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// ---------------------------------------------------------------------------
|
|
549
|
+
// Dispatch.
|
|
550
|
+
// ---------------------------------------------------------------------------
|
|
551
|
+
|
|
150
552
|
export async function run(sub, args) {
|
|
151
553
|
if (!sub || sub === "--help" || sub === "-h") {
|
|
152
554
|
console.log(HELP);
|
|
153
555
|
process.exit(0);
|
|
154
556
|
}
|
|
557
|
+
// Nested groups use `if (sub === ...)` (not `case`) so the sync test
|
|
558
|
+
// extracts their leaf actions via the dedicated channelsAction/rulesAction
|
|
559
|
+
// parsers, mirroring cli/lib/org.mjs's member/invite groups.
|
|
560
|
+
if (sub === "channels") {
|
|
561
|
+
await runChannels(args ?? []);
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
if (sub === "rules") {
|
|
565
|
+
await runRules(args ?? []);
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
// Flat subcommands share the module-level HELP: --help/-h anywhere in the
|
|
569
|
+
// argv must short-circuit BEFORE the handlers touch auth/config (the
|
|
570
|
+
// cli-help.test.mjs contract) — same pre-switch check as cli/lib/org.mjs.
|
|
571
|
+
if (Array.isArray(args) && (args.includes("--help") || args.includes("-h"))) {
|
|
572
|
+
console.log(HELP);
|
|
573
|
+
process.exit(0);
|
|
574
|
+
}
|
|
155
575
|
switch (sub) {
|
|
156
576
|
case "list":
|
|
157
577
|
await list(args);
|
package/lib/webhook-secret.mjs
CHANGED
|
@@ -27,6 +27,12 @@ export async function run(sub, args = []) {
|
|
|
27
27
|
console.log(HELP);
|
|
28
28
|
process.exit(0);
|
|
29
29
|
}
|
|
30
|
+
// --help/-h anywhere in the argv must short-circuit BEFORE auth/config side
|
|
31
|
+
// effects (the cli-help.test.mjs contract) — same check as notifications.mjs.
|
|
32
|
+
if (Array.isArray(args) && (args.includes("--help") || args.includes("-h"))) {
|
|
33
|
+
console.log(HELP);
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
30
36
|
if (sub !== "rotate") {
|
|
31
37
|
fail({
|
|
32
38
|
code: "UNKNOWN_SUBCOMMAND",
|
package/package.json
CHANGED
|
@@ -126,9 +126,50 @@ export type NotificationPreferencesPatch = Partial<Omit<NotificationPreferences,
|
|
|
126
126
|
/** Cannot be changed away from "always" — server returns 400. */
|
|
127
127
|
security_events?: "always";
|
|
128
128
|
};
|
|
129
|
+
export interface TestNotificationOptions {
|
|
130
|
+
/**
|
|
131
|
+
* Route the synthetic test event as if it came from the app lane
|
|
132
|
+
* (`project_events.source = 'app'`) or the platform. Defaults to
|
|
133
|
+
* `"platform"` on the gateway when omitted.
|
|
134
|
+
*/
|
|
135
|
+
source?: "app" | "platform";
|
|
136
|
+
/**
|
|
137
|
+
* Synthetic `event_type` override (flat snake_case,
|
|
138
|
+
* `^[a-z][a-z0-9_]{2,63}$`). Use this to exercise a specific routing rule's
|
|
139
|
+
* `event_types` filter precisely. Defaults to the gateway's built-in
|
|
140
|
+
* sample event when omitted.
|
|
141
|
+
*/
|
|
142
|
+
eventType?: string;
|
|
143
|
+
}
|
|
144
|
+
/** One Telegram destination's outcome from a `testNotification()` call —
|
|
145
|
+
* present only when the operator has a routing rule matching the synthetic
|
|
146
|
+
* event. Empty `telegram.destinations` is Faithful (no matching rule), not
|
|
147
|
+
* an error. */
|
|
148
|
+
export interface TestNotificationDestination {
|
|
149
|
+
binding_id: string;
|
|
150
|
+
label: string | null;
|
|
151
|
+
delivered: boolean;
|
|
152
|
+
/** Present on failures. `true` = retryable (429/5xx/timeout/rate-limited);
|
|
153
|
+
* `false` = permanent (bad chat, bot blocked/removed). */
|
|
154
|
+
transient?: boolean;
|
|
155
|
+
description?: string;
|
|
156
|
+
}
|
|
129
157
|
export interface TestNotificationResult {
|
|
130
|
-
status: "queued";
|
|
158
|
+
status: "delivered" | "skipped" | "queued";
|
|
131
159
|
source_event_id: string;
|
|
160
|
+
drained: {
|
|
161
|
+
claimed: number;
|
|
162
|
+
delivered: number;
|
|
163
|
+
skipped: number;
|
|
164
|
+
failed_transient: number;
|
|
165
|
+
failed_permanent: number;
|
|
166
|
+
};
|
|
167
|
+
/** Telegram delivery report for the synthetic event, routed through the
|
|
168
|
+
* operator's normal rules — the full binding + rule + render + send
|
|
169
|
+
* chain, not just email/webhook. */
|
|
170
|
+
telegram: {
|
|
171
|
+
destinations: TestNotificationDestination[];
|
|
172
|
+
};
|
|
132
173
|
note: string;
|
|
133
174
|
}
|
|
134
175
|
export interface RotateWebhookSecretResult {
|
|
@@ -137,6 +178,200 @@ export interface RotateWebhookSecretResult {
|
|
|
137
178
|
grace_window_hours: number;
|
|
138
179
|
note: string;
|
|
139
180
|
}
|
|
181
|
+
export type TelegramBindingStatus = "pending" | "active" | "revoked";
|
|
182
|
+
/**
|
|
183
|
+
* One Telegram binding as returned by `GET /agent/v1/notifications/channels`
|
|
184
|
+
* (`telegram[]`) and `r.admin.channels.list()`. Never carries the raw
|
|
185
|
+
* connect code — codes are single-use, hashed at rest, and returned only
|
|
186
|
+
* once, inline in {@link ConnectTelegramResult}.
|
|
187
|
+
*/
|
|
188
|
+
export interface TelegramChannelBinding {
|
|
189
|
+
id: string;
|
|
190
|
+
recipient_email: string;
|
|
191
|
+
status: TelegramBindingStatus;
|
|
192
|
+
chat_id: number | null;
|
|
193
|
+
chat_type: string | null;
|
|
194
|
+
chat_title: string | null;
|
|
195
|
+
label: string | null;
|
|
196
|
+
consecutive_failures: number;
|
|
197
|
+
/** Set once auto-disabled after 10 consecutive hard delivery failures. */
|
|
198
|
+
disabled_at: string | null;
|
|
199
|
+
/** Only set while `status === "pending"` — the connect code's 15-min TTL. */
|
|
200
|
+
code_expires_at: string | null;
|
|
201
|
+
created_at: string;
|
|
202
|
+
activated_at: string | null;
|
|
203
|
+
}
|
|
204
|
+
export interface ConnectTelegramOptions {
|
|
205
|
+
/** Human-readable label for the chat (e.g. `"kychon alerts"`), 1-64 chars. */
|
|
206
|
+
label?: string;
|
|
207
|
+
}
|
|
208
|
+
export interface ConnectTelegramNextAction {
|
|
209
|
+
type: string;
|
|
210
|
+
method?: string;
|
|
211
|
+
path?: string;
|
|
212
|
+
why?: string;
|
|
213
|
+
}
|
|
214
|
+
export interface ConnectTelegramResult {
|
|
215
|
+
binding_id: string;
|
|
216
|
+
status: "pending";
|
|
217
|
+
/** `t.me/<bot>?start=<code>` — tap to bind a PRIVATE chat. Single-use, 15-min TTL. */
|
|
218
|
+
connect_url: string;
|
|
219
|
+
/** `t.me/<bot>?startgroup=<code>` — tap to bind a GROUP chat. Same code/TTL as {@link connect_url} (whichever is tapped first consumes it). */
|
|
220
|
+
connect_group_url: string;
|
|
221
|
+
code_expires_at: string;
|
|
222
|
+
label: string | null;
|
|
223
|
+
next_actions: ConnectTelegramNextAction[];
|
|
224
|
+
}
|
|
225
|
+
export interface NotificationChannelsResult {
|
|
226
|
+
email: {
|
|
227
|
+
address: string | null;
|
|
228
|
+
verified: boolean;
|
|
229
|
+
};
|
|
230
|
+
webhook: {
|
|
231
|
+
configured: boolean;
|
|
232
|
+
url: string | null;
|
|
233
|
+
secret_configured: boolean;
|
|
234
|
+
};
|
|
235
|
+
/** Every live (non-revoked) Telegram binding for this operator, newest first. */
|
|
236
|
+
telegram: TelegramChannelBinding[];
|
|
237
|
+
}
|
|
238
|
+
export interface RevokeTelegramResult {
|
|
239
|
+
status: "revoked";
|
|
240
|
+
binding_id: string;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* `"app"` = app-emitted business events (`project_events.source = 'app'`,
|
|
244
|
+
* e.g. `events.emit(...)` from `@run402/functions`); `"platform"` = every
|
|
245
|
+
* non-app platform event (deploys, lifecycle, verification, ...). Absent /
|
|
246
|
+
* `null` on a rule is a wildcard — matches both.
|
|
247
|
+
*/
|
|
248
|
+
export type RoutingRuleSource = "app" | "platform";
|
|
249
|
+
/**
|
|
250
|
+
* Wire-shaped routing rule. Every match dimension (`project_id`, `source`,
|
|
251
|
+
* `event_types`, `classes`) is ANDed; `null` is a wildcard for that
|
|
252
|
+
* dimension. An explicit empty array (`event_types: []` / `classes: []`)
|
|
253
|
+
* matches NOTHING — Postgres `TEXT[]` semantics, deliberately different from
|
|
254
|
+
* the "`[]` means unfiltered" convention used by some read-filter query
|
|
255
|
+
* params elsewhere in this SDK. One rule always targets exactly one Telegram
|
|
256
|
+
* binding; overlapping rules that resolve to the same binding are deduped by
|
|
257
|
+
* the gateway at delivery time (one message, not one per matching rule).
|
|
258
|
+
*/
|
|
259
|
+
export interface RoutingRule {
|
|
260
|
+
id: string;
|
|
261
|
+
recipient_email: string;
|
|
262
|
+
project_id: string | null;
|
|
263
|
+
source: RoutingRuleSource | null;
|
|
264
|
+
event_types: string[] | null;
|
|
265
|
+
classes: string[] | null;
|
|
266
|
+
channel: "telegram";
|
|
267
|
+
telegram_binding_id: string;
|
|
268
|
+
enabled: boolean;
|
|
269
|
+
created_at: string;
|
|
270
|
+
updated_at: string;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* `r.admin.rules.create(...)` input. Every match dimension is optional
|
|
274
|
+
* (absent = wildcard); `telegramBindingId` is the only required field. An
|
|
275
|
+
* all-wildcard rule (every event on every project routes to one chat) is
|
|
276
|
+
* legal.
|
|
277
|
+
*/
|
|
278
|
+
export interface CreateRoutingRuleInput {
|
|
279
|
+
telegramBindingId: string;
|
|
280
|
+
projectId?: string | null;
|
|
281
|
+
source?: RoutingRuleSource | null;
|
|
282
|
+
eventTypes?: string[] | null;
|
|
283
|
+
classes?: string[] | null;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* `r.admin.rules.update(...)` patch. PATCH semantics: a field OMITTED from
|
|
287
|
+
* this object leaves the stored value unchanged; a field explicitly set to
|
|
288
|
+
* `null` CLEARS that dimension back to wildcard. There is no wire difference
|
|
289
|
+
* between "omitted" and "set to `undefined`" — both drop the key from the
|
|
290
|
+
* JSON request body, so the gateway sees no instruction to change it.
|
|
291
|
+
*/
|
|
292
|
+
export interface UpdateRoutingRulePatch {
|
|
293
|
+
projectId?: string | null;
|
|
294
|
+
source?: RoutingRuleSource | null;
|
|
295
|
+
eventTypes?: string[] | null;
|
|
296
|
+
classes?: string[] | null;
|
|
297
|
+
telegramBindingId?: string;
|
|
298
|
+
enabled?: boolean;
|
|
299
|
+
}
|
|
300
|
+
export interface ListRoutingRulesResult {
|
|
301
|
+
rules: RoutingRule[];
|
|
302
|
+
}
|
|
303
|
+
export interface CreateRoutingRuleResult extends RoutingRule {
|
|
304
|
+
next_actions: ConnectTelegramNextAction[];
|
|
305
|
+
}
|
|
306
|
+
export interface DeleteRoutingRuleResult {
|
|
307
|
+
deleted: true;
|
|
308
|
+
rule_id: string;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* `r.admin.channels` — the Telegram notification-channel binding lifecycle
|
|
312
|
+
* (connect / list / revoke). Mutations (`connectTelegram`, `revokeTelegram`)
|
|
313
|
+
* require `operator_passkey` assurance; `connectTelegram` additionally
|
|
314
|
+
* requires a VERIFIED operator email (bindings are addressed to it). See
|
|
315
|
+
* `r.admin.setAgentContact` / `r.admin.verifyAgentContactEmail` and
|
|
316
|
+
* `r.admin.startOperatorPasskeyEnrollment` to reach that assurance level —
|
|
317
|
+
* same ladder as {@link Admin.rotateWebhookSecret}.
|
|
318
|
+
*/
|
|
319
|
+
export declare class Channels {
|
|
320
|
+
private readonly client;
|
|
321
|
+
constructor(client: Client);
|
|
322
|
+
/**
|
|
323
|
+
* Start binding a Telegram chat. Returns two single-use, 15-minute deep
|
|
324
|
+
* links — `connect_url` for a private chat, `connect_group_url` for a
|
|
325
|
+
* group — plus a `pending` binding id. A human taps ONE of the links and
|
|
326
|
+
* starts the bot; poll {@link Channels.list} until the binding's `status`
|
|
327
|
+
* flips to `"active"` (or `code_expires_at` passes and it's swept back to
|
|
328
|
+
* `"revoked"`).
|
|
329
|
+
*
|
|
330
|
+
* Throws (via the generic SDK error hierarchy — check `err.code`) HTTP 503
|
|
331
|
+
* `TELEGRAM_CHANNEL_NOT_CONFIGURED` until the platform's dedicated
|
|
332
|
+
* notification bot is provisioned, and HTTP 412
|
|
333
|
+
* `OPERATOR_EMAIL_NOT_VERIFIED` when the caller has no verified email yet.
|
|
334
|
+
*/
|
|
335
|
+
connectTelegram(opts?: ConnectTelegramOptions): Promise<ConnectTelegramResult>;
|
|
336
|
+
/** List every notification channel — email, webhook, and every live
|
|
337
|
+
* (non-revoked) Telegram binding — for the authenticated wallet. */
|
|
338
|
+
list(): Promise<NotificationChannelsResult>;
|
|
339
|
+
/**
|
|
340
|
+
* Revoke a Telegram binding. Missing / already-revoked / another
|
|
341
|
+
* operator's binding id all return the SAME not-found error
|
|
342
|
+
* (authorize-before-reveal) — no existence oracle.
|
|
343
|
+
*/
|
|
344
|
+
revokeTelegram(bindingId: string): Promise<RevokeTelegramResult>;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* `r.admin.rules` — Telegram routing rules (design D4): one match (ANDed
|
|
348
|
+
* dimensions; an omitted dimension is a wildcard) → one Telegram binding.
|
|
349
|
+
* Rules govern the Telegram channel ONLY in v1 — email/webhook keep their
|
|
350
|
+
* existing preference-toggle semantics untouched. Mutations require
|
|
351
|
+
* `operator_passkey` assurance.
|
|
352
|
+
*/
|
|
353
|
+
export declare class Rules {
|
|
354
|
+
private readonly client;
|
|
355
|
+
constructor(client: Client);
|
|
356
|
+
/** List the operator's routing rules, newest first. */
|
|
357
|
+
list(): Promise<ListRoutingRulesResult>;
|
|
358
|
+
/**
|
|
359
|
+
* Create a routing rule. `telegramBindingId` must reference a binding this
|
|
360
|
+
* operator owns and that is currently usable (`status: "active"`); an
|
|
361
|
+
* unusable or foreign binding id returns the same 404 as a nonexistent one
|
|
362
|
+
* (authorize-before-reveal).
|
|
363
|
+
*/
|
|
364
|
+
create(input: CreateRoutingRuleInput): Promise<CreateRoutingRuleResult>;
|
|
365
|
+
/**
|
|
366
|
+
* Patch a routing rule. PATCH semantics: only fields PRESENT on `patch`
|
|
367
|
+
* are sent — `{ projectId: null }` clears that dimension back to
|
|
368
|
+
* wildcard; omitting a field leaves it unchanged (see
|
|
369
|
+
* {@link UpdateRoutingRulePatch}).
|
|
370
|
+
*/
|
|
371
|
+
update(ruleId: string, patch: UpdateRoutingRulePatch): Promise<RoutingRule>;
|
|
372
|
+
/** Delete a routing rule. */
|
|
373
|
+
delete(ruleId: string): Promise<DeleteRoutingRuleResult>;
|
|
374
|
+
}
|
|
140
375
|
export interface SetLeasePerpetualResult {
|
|
141
376
|
status: "ok";
|
|
142
377
|
org_id: string;
|
|
@@ -246,6 +481,16 @@ export declare class Admin {
|
|
|
246
481
|
* preview, accept, claim, cancel, listIncoming, listOutgoing}`.
|
|
247
482
|
*/
|
|
248
483
|
readonly transfers: Transfers;
|
|
484
|
+
/**
|
|
485
|
+
* Telegram notification-channel binding lifecycle. Access via
|
|
486
|
+
* `r.admin.channels.{connectTelegram, list, revokeTelegram}`.
|
|
487
|
+
*/
|
|
488
|
+
readonly channels: Channels;
|
|
489
|
+
/**
|
|
490
|
+
* Telegram routing rules — one match (ANDed dimensions) to one binding.
|
|
491
|
+
* Access via `r.admin.rules.{list, create, update, delete}`.
|
|
492
|
+
*/
|
|
493
|
+
readonly rules: Rules;
|
|
249
494
|
constructor(client: Client);
|
|
250
495
|
/**
|
|
251
496
|
* Operator-scoped sub-client for an org id — the operator analog of
|
|
@@ -280,10 +525,15 @@ export declare class Admin {
|
|
|
280
525
|
setNotificationPreferences(patch: NotificationPreferencesPatch): Promise<NotificationPreferences>;
|
|
281
526
|
/**
|
|
282
527
|
* Trigger a real test notification. Sends a sample `project_past_due`
|
|
283
|
-
* event through the normal worker pipeline; the audit row
|
|
284
|
-
* `is_test: true`.
|
|
528
|
+
* event through the normal worker pipeline (email/webhook); the audit row
|
|
529
|
+
* is marked `is_test: true`. ALSO delivers a synthetic event through the
|
|
530
|
+
* operator's Telegram routing rules end-to-end (binding + rule + render +
|
|
531
|
+
* send) and reports a per-destination outcome in `telegram.destinations`
|
|
532
|
+
* — pass `opts.source` / `opts.eventType` to target a specific rule's
|
|
533
|
+
* filters instead of the default sample event. Rate-limited per wallet at
|
|
534
|
+
* 1/min.
|
|
285
535
|
*/
|
|
286
|
-
testNotification(): Promise<TestNotificationResult>;
|
|
536
|
+
testNotification(opts?: TestNotificationOptions): Promise<TestNotificationResult>;
|
|
287
537
|
/**
|
|
288
538
|
* Rotate the operator's webhook signing secret. The new plaintext secret
|
|
289
539
|
* is returned EXACTLY once. The previous secret remains valid for 24
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAE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Q,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAI5C,yDAAyD;IACzD,UAAU,IAAI,OAAO,CAAC,uBAAuB,CAAC;CAG/C;AAED;;;;GAIG;AACH,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAAS,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAxC,KAAK,EAAE,KAAK,EAAmB,SAAS,EAAE,MAAM;IAE7E,iDAAiD;IACjD,OAAO,CAAC,IAAI,GAAE,qBAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAIxE,8BAA8B;IAC9B,UAAU,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAI9C,uDAAuD;IACvD,OAAO,CAAC,IAAI,GAAE,0BAA+B,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAGnF"}
|
|
@@ -9,6 +9,114 @@ import { LocalError } from "../errors.js";
|
|
|
9
9
|
import { Transfers } from "./transfers.js";
|
|
10
10
|
import { deprecatePositional } from "../deprecate.js";
|
|
11
11
|
const FINANCE_WINDOWS = new Set(["24h", "7d", "30d", "90d"]);
|
|
12
|
+
/**
|
|
13
|
+
* `r.admin.channels` — the Telegram notification-channel binding lifecycle
|
|
14
|
+
* (connect / list / revoke). Mutations (`connectTelegram`, `revokeTelegram`)
|
|
15
|
+
* require `operator_passkey` assurance; `connectTelegram` additionally
|
|
16
|
+
* requires a VERIFIED operator email (bindings are addressed to it). See
|
|
17
|
+
* `r.admin.setAgentContact` / `r.admin.verifyAgentContactEmail` and
|
|
18
|
+
* `r.admin.startOperatorPasskeyEnrollment` to reach that assurance level —
|
|
19
|
+
* same ladder as {@link Admin.rotateWebhookSecret}.
|
|
20
|
+
*/
|
|
21
|
+
export class Channels {
|
|
22
|
+
client;
|
|
23
|
+
constructor(client) {
|
|
24
|
+
this.client = client;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Start binding a Telegram chat. Returns two single-use, 15-minute deep
|
|
28
|
+
* links — `connect_url` for a private chat, `connect_group_url` for a
|
|
29
|
+
* group — plus a `pending` binding id. A human taps ONE of the links and
|
|
30
|
+
* starts the bot; poll {@link Channels.list} until the binding's `status`
|
|
31
|
+
* flips to `"active"` (or `code_expires_at` passes and it's swept back to
|
|
32
|
+
* `"revoked"`).
|
|
33
|
+
*
|
|
34
|
+
* Throws (via the generic SDK error hierarchy — check `err.code`) HTTP 503
|
|
35
|
+
* `TELEGRAM_CHANNEL_NOT_CONFIGURED` until the platform's dedicated
|
|
36
|
+
* notification bot is provisioned, and HTTP 412
|
|
37
|
+
* `OPERATOR_EMAIL_NOT_VERIFIED` when the caller has no verified email yet.
|
|
38
|
+
*/
|
|
39
|
+
async connectTelegram(opts = {}) {
|
|
40
|
+
const body = {};
|
|
41
|
+
if (opts.label !== undefined)
|
|
42
|
+
body.label = opts.label;
|
|
43
|
+
return this.client.request("/agent/v1/notifications/channels/telegram", { method: "POST", body, context: "connecting a Telegram notification channel" });
|
|
44
|
+
}
|
|
45
|
+
/** List every notification channel — email, webhook, and every live
|
|
46
|
+
* (non-revoked) Telegram binding — for the authenticated wallet. */
|
|
47
|
+
async list() {
|
|
48
|
+
return this.client.request("/agent/v1/notifications/channels", { context: "listing notification channels" });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Revoke a Telegram binding. Missing / already-revoked / another
|
|
52
|
+
* operator's binding id all return the SAME not-found error
|
|
53
|
+
* (authorize-before-reveal) — no existence oracle.
|
|
54
|
+
*/
|
|
55
|
+
async revokeTelegram(bindingId) {
|
|
56
|
+
return this.client.request(`/agent/v1/notifications/channels/telegram/${encodeURIComponent(bindingId)}`, { method: "DELETE", context: "revoking a Telegram notification channel" });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* `r.admin.rules` — Telegram routing rules (design D4): one match (ANDed
|
|
61
|
+
* dimensions; an omitted dimension is a wildcard) → one Telegram binding.
|
|
62
|
+
* Rules govern the Telegram channel ONLY in v1 — email/webhook keep their
|
|
63
|
+
* existing preference-toggle semantics untouched. Mutations require
|
|
64
|
+
* `operator_passkey` assurance.
|
|
65
|
+
*/
|
|
66
|
+
export class Rules {
|
|
67
|
+
client;
|
|
68
|
+
constructor(client) {
|
|
69
|
+
this.client = client;
|
|
70
|
+
}
|
|
71
|
+
/** List the operator's routing rules, newest first. */
|
|
72
|
+
async list() {
|
|
73
|
+
return this.client.request("/agent/v1/notifications/rules", { context: "listing notification routing rules" });
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Create a routing rule. `telegramBindingId` must reference a binding this
|
|
77
|
+
* operator owns and that is currently usable (`status: "active"`); an
|
|
78
|
+
* unusable or foreign binding id returns the same 404 as a nonexistent one
|
|
79
|
+
* (authorize-before-reveal).
|
|
80
|
+
*/
|
|
81
|
+
async create(input) {
|
|
82
|
+
const body = { telegram_binding_id: input.telegramBindingId };
|
|
83
|
+
if (input.projectId !== undefined)
|
|
84
|
+
body.project_id = input.projectId;
|
|
85
|
+
if (input.source !== undefined)
|
|
86
|
+
body.source = input.source;
|
|
87
|
+
if (input.eventTypes !== undefined)
|
|
88
|
+
body.event_types = input.eventTypes;
|
|
89
|
+
if (input.classes !== undefined)
|
|
90
|
+
body.classes = input.classes;
|
|
91
|
+
return this.client.request("/agent/v1/notifications/rules", { method: "POST", body, context: "creating a notification routing rule" });
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Patch a routing rule. PATCH semantics: only fields PRESENT on `patch`
|
|
95
|
+
* are sent — `{ projectId: null }` clears that dimension back to
|
|
96
|
+
* wildcard; omitting a field leaves it unchanged (see
|
|
97
|
+
* {@link UpdateRoutingRulePatch}).
|
|
98
|
+
*/
|
|
99
|
+
async update(ruleId, patch) {
|
|
100
|
+
const body = {};
|
|
101
|
+
if ("projectId" in patch)
|
|
102
|
+
body.project_id = patch.projectId;
|
|
103
|
+
if ("source" in patch)
|
|
104
|
+
body.source = patch.source;
|
|
105
|
+
if ("eventTypes" in patch)
|
|
106
|
+
body.event_types = patch.eventTypes;
|
|
107
|
+
if ("classes" in patch)
|
|
108
|
+
body.classes = patch.classes;
|
|
109
|
+
if ("telegramBindingId" in patch)
|
|
110
|
+
body.telegram_binding_id = patch.telegramBindingId;
|
|
111
|
+
if ("enabled" in patch)
|
|
112
|
+
body.enabled = patch.enabled;
|
|
113
|
+
return this.client.request(`/agent/v1/notifications/rules/${encodeURIComponent(ruleId)}`, { method: "PATCH", body, context: "updating a notification routing rule" });
|
|
114
|
+
}
|
|
115
|
+
/** Delete a routing rule. */
|
|
116
|
+
async delete(ruleId) {
|
|
117
|
+
return this.client.request(`/agent/v1/notifications/rules/${encodeURIComponent(ruleId)}`, { method: "DELETE", context: "deleting a notification routing rule" });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
12
120
|
export class Admin {
|
|
13
121
|
client;
|
|
14
122
|
/**
|
|
@@ -17,9 +125,21 @@ export class Admin {
|
|
|
17
125
|
* preview, accept, claim, cancel, listIncoming, listOutgoing}`.
|
|
18
126
|
*/
|
|
19
127
|
transfers;
|
|
128
|
+
/**
|
|
129
|
+
* Telegram notification-channel binding lifecycle. Access via
|
|
130
|
+
* `r.admin.channels.{connectTelegram, list, revokeTelegram}`.
|
|
131
|
+
*/
|
|
132
|
+
channels;
|
|
133
|
+
/**
|
|
134
|
+
* Telegram routing rules — one match (ANDed dimensions) to one binding.
|
|
135
|
+
* Access via `r.admin.rules.{list, create, update, delete}`.
|
|
136
|
+
*/
|
|
137
|
+
rules;
|
|
20
138
|
constructor(client) {
|
|
21
139
|
this.client = client;
|
|
22
140
|
this.transfers = new Transfers(client);
|
|
141
|
+
this.channels = new Channels(client);
|
|
142
|
+
this.rules = new Rules(client);
|
|
23
143
|
}
|
|
24
144
|
/**
|
|
25
145
|
* Operator-scoped sub-client for an org id — the operator analog of
|
|
@@ -120,11 +240,21 @@ export class Admin {
|
|
|
120
240
|
}
|
|
121
241
|
/**
|
|
122
242
|
* Trigger a real test notification. Sends a sample `project_past_due`
|
|
123
|
-
* event through the normal worker pipeline; the audit row
|
|
124
|
-
* `is_test: true`.
|
|
243
|
+
* event through the normal worker pipeline (email/webhook); the audit row
|
|
244
|
+
* is marked `is_test: true`. ALSO delivers a synthetic event through the
|
|
245
|
+
* operator's Telegram routing rules end-to-end (binding + rule + render +
|
|
246
|
+
* send) and reports a per-destination outcome in `telegram.destinations`
|
|
247
|
+
* — pass `opts.source` / `opts.eventType` to target a specific rule's
|
|
248
|
+
* filters instead of the default sample event. Rate-limited per wallet at
|
|
249
|
+
* 1/min.
|
|
125
250
|
*/
|
|
126
|
-
async testNotification() {
|
|
127
|
-
|
|
251
|
+
async testNotification(opts = {}) {
|
|
252
|
+
const body = {};
|
|
253
|
+
if (opts.source !== undefined)
|
|
254
|
+
body.source = opts.source;
|
|
255
|
+
if (opts.eventType !== undefined)
|
|
256
|
+
body.event_type = opts.eventType;
|
|
257
|
+
return this.client.request("/agent/v1/notifications/test", { method: "POST", body, context: "triggering test notification" });
|
|
128
258
|
}
|
|
129
259
|
/**
|
|
130
260
|
* Rotate the operator's webhook signing secret. The new plaintext secret
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAsEtD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../src/namespaces/admin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAA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