domani 1.0.5 → 1.1.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/dist/index.d.ts +1132 -56
- package/dist/index.js +243 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,6 +52,10 @@ class Domani {
|
|
|
52
52
|
url += (url.includes("?") ? "&" : "?") + s;
|
|
53
53
|
}
|
|
54
54
|
const headers = { Authorization: `Bearer ${this.apiKey}` };
|
|
55
|
+
if (opts?.headers)
|
|
56
|
+
for (const [name, value] of Object.entries(opts.headers))
|
|
57
|
+
if (value !== undefined)
|
|
58
|
+
headers[name] = value;
|
|
55
59
|
let bodyInit;
|
|
56
60
|
if (opts?.body !== undefined) {
|
|
57
61
|
headers["Content-Type"] = "application/json";
|
|
@@ -72,6 +76,35 @@ class Domani {
|
|
|
72
76
|
throw new DomaniError(res.status, data);
|
|
73
77
|
return data;
|
|
74
78
|
}
|
|
79
|
+
/** Open a server-sent event stream; read `response.body` with an SSE parser. */
|
|
80
|
+
async stream(method, path, opts) {
|
|
81
|
+
let url = this.baseUrl + path;
|
|
82
|
+
if (opts?.query) {
|
|
83
|
+
const qs = new URLSearchParams();
|
|
84
|
+
for (const [k, v] of Object.entries(opts.query))
|
|
85
|
+
if (v !== undefined && v !== null)
|
|
86
|
+
qs.append(k, String(v));
|
|
87
|
+
const s = qs.toString();
|
|
88
|
+
if (s)
|
|
89
|
+
url += (url.includes("?") ? "&" : "?") + s;
|
|
90
|
+
}
|
|
91
|
+
const headers = { Authorization: `Bearer ${this.apiKey}`, Accept: "text/event-stream" };
|
|
92
|
+
if (opts?.headers)
|
|
93
|
+
for (const [name, value] of Object.entries(opts.headers))
|
|
94
|
+
if (value !== undefined)
|
|
95
|
+
headers[name] = value;
|
|
96
|
+
const res = await this.fetchImpl(url, { method, headers, signal: opts?.signal });
|
|
97
|
+
if (!res.ok) {
|
|
98
|
+
const text = await res.text();
|
|
99
|
+
let data = text;
|
|
100
|
+
try {
|
|
101
|
+
data = JSON.parse(text);
|
|
102
|
+
}
|
|
103
|
+
catch { /* not json */ }
|
|
104
|
+
throw new DomaniError(res.status, data);
|
|
105
|
+
}
|
|
106
|
+
return res;
|
|
107
|
+
}
|
|
75
108
|
/** Accept an access or ownership offer (POST /api/workspaces/access/offers/accept) */
|
|
76
109
|
acceptWorkspaceAccessOffer(body) {
|
|
77
110
|
return this.request("POST", `/api/workspaces/access/offers/accept`, { body });
|
|
@@ -113,8 +146,8 @@ class Domani {
|
|
|
113
146
|
return this.request("POST", `/api/domains/${enc(domain)}/buy-aftermarket`, { body });
|
|
114
147
|
}
|
|
115
148
|
/** Purchase one or more domains (POST /api/domains/buy) */
|
|
116
|
-
buyDomain(body) {
|
|
117
|
-
return this.request("POST", `/api/domains/buy`, { body });
|
|
149
|
+
buyDomain(body, paymentSignature) {
|
|
150
|
+
return this.request("POST", `/api/domains/buy`, { body, headers: { "PAYMENT-SIGNATURE": paymentSignature } });
|
|
118
151
|
}
|
|
119
152
|
/** Cancel a backorder (DELETE /api/backorders/{id}) */
|
|
120
153
|
cancelBackorder(id) {
|
|
@@ -172,6 +205,10 @@ class Domani {
|
|
|
172
205
|
connectDomain(domain, body) {
|
|
173
206
|
return this.request("POST", `/api/domains/${enc(domain)}/connect`, { body });
|
|
174
207
|
}
|
|
208
|
+
/** Give an agent its own API key in one call (POST /api/agents/identity/{slug}/tokens) */
|
|
209
|
+
createAgentToken(slug, body) {
|
|
210
|
+
return this.request("POST", `/api/agents/identity/${enc(slug)}/tokens`, { body });
|
|
211
|
+
}
|
|
175
212
|
/** Place a backorder on a taken domain (POST /api/backorders) */
|
|
176
213
|
createBackorder(body) {
|
|
177
214
|
return this.request("POST", `/api/backorders`, { body });
|
|
@@ -188,6 +225,14 @@ class Domani {
|
|
|
188
225
|
createDomainBrief(body) {
|
|
189
226
|
return this.request("POST", `/api/domain-briefs`, { body });
|
|
190
227
|
}
|
|
228
|
+
/** Create an HTTP hostname binding (POST /api/domains/{domain}/hostname-bindings) */
|
|
229
|
+
createHostnameBinding(domain, body, idempotencyKey) {
|
|
230
|
+
return this.request("POST", `/api/domains/${enc(domain)}/hostname-bindings`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
231
|
+
}
|
|
232
|
+
/** Publish a leased HTTP route (POST /api/http-routes) */
|
|
233
|
+
createHttpRoute(body, idempotencyKey) {
|
|
234
|
+
return this.request("POST", `/api/http-routes`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
235
|
+
}
|
|
191
236
|
/** List a domain for sale (PUT /api/domains/{domain}/for-sale) */
|
|
192
237
|
createListing(domain, body) {
|
|
193
238
|
return this.request("PUT", `/api/domains/${enc(domain)}/for-sale`, { body });
|
|
@@ -228,10 +273,26 @@ class Domani {
|
|
|
228
273
|
deleteAccount() {
|
|
229
274
|
return this.request("DELETE", `/api/me`, undefined);
|
|
230
275
|
}
|
|
276
|
+
/** Delete assistant-derived data (DELETE /api/assistant/data) */
|
|
277
|
+
deleteAssistantData() {
|
|
278
|
+
return this.request("DELETE", `/api/assistant/data`, undefined);
|
|
279
|
+
}
|
|
280
|
+
/** Delete a contact (DELETE /api/contacts/{address}) */
|
|
281
|
+
deleteContact(address) {
|
|
282
|
+
return this.request("DELETE", `/api/contacts/${enc(address)}`, undefined);
|
|
283
|
+
}
|
|
231
284
|
/** Remove a DNSSEC DS record (disable DNSSEC) (DELETE /api/domains/{domain}/dnssec) */
|
|
232
285
|
deleteDnssecRecord(domain, query) {
|
|
233
286
|
return this.request("DELETE", `/api/domains/${enc(domain)}/dnssec`, { query });
|
|
234
287
|
}
|
|
288
|
+
/** Disable an HTTP hostname binding (DELETE /api/domains/{domain}/hostname-bindings/{id}) */
|
|
289
|
+
deleteHostnameBinding(domain, id) {
|
|
290
|
+
return this.request("DELETE", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}`, undefined);
|
|
291
|
+
}
|
|
292
|
+
/** Terminate a route without releasing its hostname claim (DELETE /api/http-routes/{id}) */
|
|
293
|
+
deleteHttpRoute(id) {
|
|
294
|
+
return this.request("DELETE", `/api/http-routes/${enc(id)}`, undefined);
|
|
295
|
+
}
|
|
235
296
|
/** Delete a mailbox (DELETE /api/emails/{address}) */
|
|
236
297
|
deleteMailboxByAddress(address, body) {
|
|
237
298
|
return this.request("DELETE", `/api/emails/${enc(address)}`, { body });
|
|
@@ -241,8 +302,8 @@ class Domani {
|
|
|
241
302
|
return this.request("DELETE", `/api/emails/${enc(address)}/messages/${enc(id)}`, undefined);
|
|
242
303
|
}
|
|
243
304
|
/** Bulk delete messages (POST /api/emails/{address}/messages/delete) */
|
|
244
|
-
deleteMessagesByAddress(address, body) {
|
|
245
|
-
return this.request("POST", `/api/emails/${enc(address)}/messages/delete`, { body });
|
|
305
|
+
deleteMessagesByAddress(address, body, idempotencyKey) {
|
|
306
|
+
return this.request("POST", `/api/emails/${enc(address)}/messages/delete`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
246
307
|
}
|
|
247
308
|
/** Delete webhook (DELETE /api/webhooks/{id}) */
|
|
248
309
|
deleteWebhook(id) {
|
|
@@ -252,6 +313,22 @@ class Domani {
|
|
|
252
313
|
dnsCheck(query) {
|
|
253
314
|
return this.request("GET", `/api/domains/dns-check`, { query });
|
|
254
315
|
}
|
|
316
|
+
/** Flag a message for a human (POST /api/emails/{address}/messages/{id}/escalate) */
|
|
317
|
+
escalateMessageByAddress(address, id, body) {
|
|
318
|
+
return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/escalate`, { body });
|
|
319
|
+
}
|
|
320
|
+
/** OAuth token endpoint (POST /api/oauth/token) */
|
|
321
|
+
exchangeOAuthToken() {
|
|
322
|
+
return this.request("POST", `/api/oauth/token`, undefined);
|
|
323
|
+
}
|
|
324
|
+
/** Export derived assistant data (GET /api/assistant/data) */
|
|
325
|
+
exportAssistantData() {
|
|
326
|
+
return this.request("GET", `/api/assistant/data`, undefined);
|
|
327
|
+
}
|
|
328
|
+
/** Extract the fields you need from a message with your own schema (POST /api/emails/{address}/messages/{id}/extract) */
|
|
329
|
+
extractFromEmailMessage(address, id, body) {
|
|
330
|
+
return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/extract`, { body });
|
|
331
|
+
}
|
|
255
332
|
/** Finalize an agreed negotiation (pay) (POST /api/negotiations/{id}/finalize) */
|
|
256
333
|
finalizeNegotiation(id, body) {
|
|
257
334
|
return this.request("POST", `/api/negotiations/${enc(id)}/finalize`, { body });
|
|
@@ -268,6 +345,42 @@ class Domani {
|
|
|
268
345
|
getActivation() {
|
|
269
346
|
return this.request("GET", `/api/me/activation`, undefined);
|
|
270
347
|
}
|
|
348
|
+
/** Get the exact action preview by opaque ID (GET /api/assistant/action-plans/{id}) */
|
|
349
|
+
getAssistantActionPlan(id) {
|
|
350
|
+
return this.request("GET", `/api/assistant/action-plans/${enc(id)}`, undefined);
|
|
351
|
+
}
|
|
352
|
+
/** Get content-minimized assistant Activity (GET /api/assistant/activity) */
|
|
353
|
+
getAssistantActivity(query) {
|
|
354
|
+
return this.request("GET", `/api/assistant/activity`, { query });
|
|
355
|
+
}
|
|
356
|
+
/** Get background history-import progress (GET /api/assistant/backfill) */
|
|
357
|
+
getAssistantBackfill() {
|
|
358
|
+
return this.request("GET", `/api/assistant/backfill`, undefined);
|
|
359
|
+
}
|
|
360
|
+
/** Read the situation brief for a correspondent (GET /api/assistant/brief) */
|
|
361
|
+
getAssistantCorrespondentBrief(query) {
|
|
362
|
+
return this.request("GET", `/api/assistant/brief`, { query });
|
|
363
|
+
}
|
|
364
|
+
/** Get Mailzero assistant settings (GET /api/assistant/settings) */
|
|
365
|
+
getAssistantSettings() {
|
|
366
|
+
return this.request("GET", `/api/assistant/settings`, undefined);
|
|
367
|
+
}
|
|
368
|
+
/** Get the grounded Today decision queue (GET /api/assistant/today) */
|
|
369
|
+
getAssistantToday(query) {
|
|
370
|
+
return this.request("GET", `/api/assistant/today`, { query });
|
|
371
|
+
}
|
|
372
|
+
/** Get one assistant Work item and exact current plan (GET /api/assistant/work-items/{id}) */
|
|
373
|
+
getAssistantWorkItem(id) {
|
|
374
|
+
return this.request("GET", `/api/assistant/work-items/${enc(id)}`, undefined);
|
|
375
|
+
}
|
|
376
|
+
/** Read the situation brief of a Work item (GET /api/assistant/work-items/{id}/brief) */
|
|
377
|
+
getAssistantWorkItemBrief(id) {
|
|
378
|
+
return this.request("GET", `/api/assistant/work-items/${enc(id)}/brief`, undefined);
|
|
379
|
+
}
|
|
380
|
+
/** Read the facts behind a Work item (GET /api/assistant/work-items/{id}/facts) */
|
|
381
|
+
getAssistantWorkItemFacts(id) {
|
|
382
|
+
return this.request("GET", `/api/assistant/work-items/${enc(id)}/facts`, undefined);
|
|
383
|
+
}
|
|
271
384
|
/** Get EPP auth code (GET /api/domains/{domain}/auth-code) */
|
|
272
385
|
getAuthCode(domain) {
|
|
273
386
|
return this.request("GET", `/api/domains/${enc(domain)}/auth-code`, undefined);
|
|
@@ -332,6 +445,18 @@ class Domani {
|
|
|
332
445
|
getEmailDeliverability(domain) {
|
|
333
446
|
return this.request("GET", `/api/domains/${enc(domain)}/email/deliverability`, undefined);
|
|
334
447
|
}
|
|
448
|
+
/** Read what the assistant established about a message (GET /api/emails/{address}/messages/{id}/facts) */
|
|
449
|
+
getEmailMessageFacts(address, id) {
|
|
450
|
+
return this.request("GET", `/api/emails/${enc(address)}/messages/${enc(id)}/facts`, undefined);
|
|
451
|
+
}
|
|
452
|
+
/** Get an HTTP hostname binding (GET /api/domains/{domain}/hostname-bindings/{id}) */
|
|
453
|
+
getHostnameBinding(domain, id) {
|
|
454
|
+
return this.request("GET", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}`, undefined);
|
|
455
|
+
}
|
|
456
|
+
/** Get a leased HTTP route (GET /api/http-routes/{id}) */
|
|
457
|
+
getHttpRoute(id) {
|
|
458
|
+
return this.request("GET", `/api/http-routes/${enc(id)}`, undefined);
|
|
459
|
+
}
|
|
335
460
|
/** Get mailbox avatar info (GET /api/emails/{address}/avatar) */
|
|
336
461
|
getMailboxAvatarByAddress(address) {
|
|
337
462
|
return this.request("GET", `/api/emails/${enc(address)}/avatar`, undefined);
|
|
@@ -344,6 +469,10 @@ class Domani {
|
|
|
344
469
|
getMailboxClientSettings(address) {
|
|
345
470
|
return this.request("GET", `/api/emails/${enc(address)}/client-settings`, undefined);
|
|
346
471
|
}
|
|
472
|
+
/** Read one conversation, oldest message first (GET /api/emails/{address}/threads/{id}) */
|
|
473
|
+
getMailboxThread(address, id) {
|
|
474
|
+
return this.request("GET", `/api/emails/${enc(address)}/threads/${enc(id)}`, undefined);
|
|
475
|
+
}
|
|
347
476
|
/** Get mailbox webhook config (GET /api/emails/{address}/webhook) */
|
|
348
477
|
getMailboxWebhook(address) {
|
|
349
478
|
return this.request("GET", `/api/emails/${enc(address)}/webhook`, undefined);
|
|
@@ -412,6 +541,10 @@ class Domani {
|
|
|
412
541
|
importDomain(body) {
|
|
413
542
|
return this.request("POST", `/api/domains/import`, { body });
|
|
414
543
|
}
|
|
544
|
+
/** Record a fenced human Decision (POST /api/assistant/work-items/{id}/interactions) */
|
|
545
|
+
interactWithAssistantWorkItem(id, body) {
|
|
546
|
+
return this.request("POST", `/api/assistant/work-items/${enc(id)}/interactions`, { body });
|
|
547
|
+
}
|
|
415
548
|
/** Invite a workspace member (POST /api/workspaces/{id}/invitations) */
|
|
416
549
|
inviteWorkspaceMember(id, body) {
|
|
417
550
|
return this.request("POST", `/api/workspaces/${enc(id)}/invitations`, { body });
|
|
@@ -420,6 +553,10 @@ class Domani {
|
|
|
420
553
|
leaveWorkspace(id) {
|
|
421
554
|
return this.request("DELETE", `/api/workspaces/${enc(id)}/members/me`, undefined);
|
|
422
555
|
}
|
|
556
|
+
/** List the API tokens of an agent identity (GET /api/agents/identity/{slug}/tokens) */
|
|
557
|
+
listAgentTokens(slug) {
|
|
558
|
+
return this.request("GET", `/api/agents/identity/${enc(slug)}/tokens`, undefined);
|
|
559
|
+
}
|
|
423
560
|
/** List security audit events (GET /api/audit) */
|
|
424
561
|
listAuditEvents(query) {
|
|
425
562
|
return this.request("GET", `/api/audit`, { query });
|
|
@@ -436,6 +573,10 @@ class Domani {
|
|
|
436
573
|
listConnectProviders(domain) {
|
|
437
574
|
return this.request("GET", `/api/domains/${enc(domain)}/connect`, undefined);
|
|
438
575
|
}
|
|
576
|
+
/** List contacts (GET /api/contacts) */
|
|
577
|
+
listContacts(query) {
|
|
578
|
+
return this.request("GET", `/api/contacts`, { query });
|
|
579
|
+
}
|
|
439
580
|
/** List attributed conversation activity (GET /api/email/collaboration/{id}/activity) */
|
|
440
581
|
listConversationActivity(id) {
|
|
441
582
|
return this.request("GET", `/api/email/collaboration/${enc(id)}/activity`, undefined);
|
|
@@ -464,6 +605,14 @@ class Domani {
|
|
|
464
605
|
listEmailMessagesByAddress(address, query) {
|
|
465
606
|
return this.request("GET", `/api/emails/${enc(address)}/messages`, { query });
|
|
466
607
|
}
|
|
608
|
+
/** List HTTP hostname bindings (GET /api/domains/{domain}/hostname-bindings) */
|
|
609
|
+
listHostnameBindings(domain) {
|
|
610
|
+
return this.request("GET", `/api/domains/${enc(domain)}/hostname-bindings`, undefined);
|
|
611
|
+
}
|
|
612
|
+
/** List visible leased HTTP routes (GET /api/http-routes) */
|
|
613
|
+
listHttpRoutes(query) {
|
|
614
|
+
return this.request("GET", `/api/http-routes`, { query });
|
|
615
|
+
}
|
|
467
616
|
/** List your agent identities (GET /api/agents/identity) */
|
|
468
617
|
listIdentities() {
|
|
469
618
|
return this.request("GET", `/api/agents/identity`, undefined);
|
|
@@ -492,6 +641,10 @@ class Domani {
|
|
|
492
641
|
listMailboxesByAddress(query) {
|
|
493
642
|
return this.request("GET", `/api/emails`, { query });
|
|
494
643
|
}
|
|
644
|
+
/** List the conversations of a mailbox (GET /api/emails/{address}/threads) */
|
|
645
|
+
listMailboxThreads(address, query) {
|
|
646
|
+
return this.request("GET", `/api/emails/${enc(address)}/threads`, { query });
|
|
647
|
+
}
|
|
495
648
|
/** List inbound mail rules (GET /api/emails/{address}/rules) */
|
|
496
649
|
listMailRules(address) {
|
|
497
650
|
return this.request("GET", `/api/emails/${enc(address)}/rules`, undefined);
|
|
@@ -549,29 +702,49 @@ class Domani {
|
|
|
549
702
|
return this.request("POST", `/api/notifications/read-all`, undefined);
|
|
550
703
|
}
|
|
551
704
|
/** Mark messages as read or unread (PATCH /api/emails/{address}/messages/read) */
|
|
552
|
-
markMessagesReadByAddress(address, body) {
|
|
553
|
-
return this.request("PATCH", `/api/emails/${enc(address)}/messages/read`, { body });
|
|
705
|
+
markMessagesReadByAddress(address, body, idempotencyKey) {
|
|
706
|
+
return this.request("PATCH", `/api/emails/${enc(address)}/messages/read`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
554
707
|
}
|
|
555
708
|
/** Mark notification as read (PATCH /api/notifications/{id}) */
|
|
556
709
|
markNotificationRead(id, body) {
|
|
557
710
|
return this.request("PATCH", `/api/notifications/${enc(id)}`, { body });
|
|
558
711
|
}
|
|
712
|
+
/** Mark a Work item as opened (POST /api/assistant/work-items/{id}/open) */
|
|
713
|
+
openAssistantWorkItem(id) {
|
|
714
|
+
return this.request("POST", `/api/assistant/work-items/${enc(id)}/open`, undefined);
|
|
715
|
+
}
|
|
559
716
|
/** Plan how to adopt an existing domain (GET /api/domains/adoption-plan) */
|
|
560
717
|
planDomainAdoption(query) {
|
|
561
718
|
return this.request("GET", `/api/domains/adoption-plan`, { query });
|
|
562
719
|
}
|
|
720
|
+
/** Plan an HTTP hostname binding (POST /api/domains/{domain}/hostname-bindings/plan) */
|
|
721
|
+
planHostnameBinding(domain, body) {
|
|
722
|
+
return this.request("POST", `/api/domains/${enc(domain)}/hostname-bindings/plan`, { body });
|
|
723
|
+
}
|
|
563
724
|
/** Provide EPP/auth code (seller) (PATCH /api/deals/{id}) */
|
|
564
725
|
provideEppCode(id, body) {
|
|
565
726
|
return this.request("PATCH", `/api/deals/${enc(id)}`, { body });
|
|
566
727
|
}
|
|
567
728
|
/** Provision a complete agent identity in one call (POST /api/agents/provision) */
|
|
568
|
-
provisionAgent(body) {
|
|
569
|
-
return this.request("POST", `/api/agents/provision`, { body });
|
|
729
|
+
provisionAgent(body, paymentSignature) {
|
|
730
|
+
return this.request("POST", `/api/agents/provision`, { body, headers: { "PAYMENT-SIGNATURE": paymentSignature } });
|
|
570
731
|
}
|
|
571
732
|
/** Refresh a domain brief from live sources (POST /api/domain-briefs/{id}/refresh) */
|
|
572
733
|
refreshDomainBrief(id) {
|
|
573
734
|
return this.request("POST", `/api/domain-briefs/${enc(id)}/refresh`, undefined);
|
|
574
735
|
}
|
|
736
|
+
/** Refresh a route lease (PATCH /api/http-routes/{id}) */
|
|
737
|
+
refreshHttpRoute(id, body, idempotencyKey) {
|
|
738
|
+
return this.request("PATCH", `/api/http-routes/${enc(id)}`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
739
|
+
}
|
|
740
|
+
/** Register a device for redacted Now alerts (POST /api/assistant/devices) */
|
|
741
|
+
registerAssistantDevice(body) {
|
|
742
|
+
return this.request("POST", `/api/assistant/devices`, { body });
|
|
743
|
+
}
|
|
744
|
+
/** Register an OAuth client (RFC 7591) (POST /api/oauth/register) */
|
|
745
|
+
registerOAuthClient(body) {
|
|
746
|
+
return this.request("POST", `/api/oauth/register`, { body });
|
|
747
|
+
}
|
|
575
748
|
/** Create a new account (POST /api/auth/register) */
|
|
576
749
|
registerUser(body) {
|
|
577
750
|
return this.request("POST", `/api/auth/register`, { body });
|
|
@@ -584,6 +757,10 @@ class Domani {
|
|
|
584
757
|
releaseIdentity(slug) {
|
|
585
758
|
return this.request("DELETE", `/api/agents/identity/${enc(slug)}`, undefined);
|
|
586
759
|
}
|
|
760
|
+
/** Revoke a device registration (DELETE /api/assistant/devices) */
|
|
761
|
+
removeAssistantDevice(query) {
|
|
762
|
+
return this.request("DELETE", `/api/assistant/devices`, { query });
|
|
763
|
+
}
|
|
587
764
|
/** Remove saved payment method (DELETE /api/billing/card) */
|
|
588
765
|
removeCard() {
|
|
589
766
|
return this.request("DELETE", `/api/billing/card`, undefined);
|
|
@@ -625,8 +802,8 @@ class Domani {
|
|
|
625
802
|
return this.request("POST", `/api/webhooks/${enc(id)}/deliveries/${enc(deliveryId)}/replay`, { body });
|
|
626
803
|
}
|
|
627
804
|
/** Reply to a message (POST /api/emails/{address}/messages/{id}/reply) */
|
|
628
|
-
replyToMessageByAddress(address, id, body) {
|
|
629
|
-
return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/reply`, { body });
|
|
805
|
+
replyToMessageByAddress(address, id, body, idempotencyKey) {
|
|
806
|
+
return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/reply`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
630
807
|
}
|
|
631
808
|
/** Request a workspace ownership transfer (POST /api/workspaces/{id}/ownership-transfer) */
|
|
632
809
|
requestWorkspaceOwnershipTransfer(id, body) {
|
|
@@ -652,6 +829,14 @@ class Domani {
|
|
|
652
829
|
restoreDns(domain, body) {
|
|
653
830
|
return this.request("POST", `/api/domains/${enc(domain)}/dns/restore`, { body });
|
|
654
831
|
}
|
|
832
|
+
/** Retry failed history-import messages (POST /api/assistant/backfill) */
|
|
833
|
+
retryAssistantBackfillFailures() {
|
|
834
|
+
return this.request("POST", `/api/assistant/backfill`, undefined);
|
|
835
|
+
}
|
|
836
|
+
/** Revoke an agent's API token (DELETE /api/agents/identity/{slug}/tokens/{id}) */
|
|
837
|
+
revokeAgentToken(slug, id) {
|
|
838
|
+
return this.request("DELETE", `/api/agents/identity/${enc(slug)}/tokens/${enc(id)}`, undefined);
|
|
839
|
+
}
|
|
655
840
|
/** Revoke an app password (hosted) (DELETE /api/emails/{address}/credentials/{id}) */
|
|
656
841
|
revokeMailboxCredential(address, id) {
|
|
657
842
|
return this.request("DELETE", `/api/emails/${enc(address)}/credentials/${enc(id)}`, undefined);
|
|
@@ -672,6 +857,14 @@ class Domani {
|
|
|
672
857
|
revokeWorkspaceOwnershipTransfer(id, transferId) {
|
|
673
858
|
return this.request("DELETE", `/api/workspaces/${enc(id)}/ownership-transfer/${enc(transferId)}`, undefined);
|
|
674
859
|
}
|
|
860
|
+
/** Replace write-only upstream authentication headers (PUT /api/http-routes/{id}/upstream-headers) */
|
|
861
|
+
rotateHttpRouteUpstreamHeaders(id, body, idempotencyKey) {
|
|
862
|
+
return this.request("PUT", `/api/http-routes/${enc(id)}/upstream-headers`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
863
|
+
}
|
|
864
|
+
/** Rotate the upstream verification secret (POST /api/http-routes/{id}/upstream-verification/rotate) */
|
|
865
|
+
rotateHttpRouteUpstreamVerification(id, idempotencyKey) {
|
|
866
|
+
return this.request("POST", `/api/http-routes/${enc(id)}/upstream-verification/rotate`, { headers: { "Idempotency-Key": idempotencyKey } });
|
|
867
|
+
}
|
|
675
868
|
/** Rotate webhook signing secret (POST /api/emails/{address}/webhook/rotate) */
|
|
676
869
|
rotateMailboxWebhookSecret(address) {
|
|
677
870
|
return this.request("POST", `/api/emails/${enc(address)}/webhook/rotate`, undefined);
|
|
@@ -680,13 +873,21 @@ class Domani {
|
|
|
680
873
|
search(query) {
|
|
681
874
|
return this.request("GET", `/api/domains/search`, { query });
|
|
682
875
|
}
|
|
876
|
+
/** Search mail by meaning and by words (GET /api/emails/search) */
|
|
877
|
+
searchEmailMessages(query) {
|
|
878
|
+
return this.request("GET", `/api/emails/search`, { query });
|
|
879
|
+
}
|
|
880
|
+
/** Search one mailbox by meaning and by words (GET /api/emails/{address}/search) */
|
|
881
|
+
searchEmailMessagesByAddress(address, query) {
|
|
882
|
+
return this.request("GET", `/api/emails/${enc(address)}/search`, { query });
|
|
883
|
+
}
|
|
683
884
|
/** List a domain for sale (open marketplace) (POST /api/domains/sell) */
|
|
684
885
|
sellDomain(body) {
|
|
685
886
|
return this.request("POST", `/api/domains/sell`, { body });
|
|
686
887
|
}
|
|
687
888
|
/** Send an email (POST /api/emails/{address}/send) */
|
|
688
|
-
sendEmailByAddress(address, body) {
|
|
689
|
-
return this.request("POST", `/api/emails/${enc(address)}/send`, { body });
|
|
889
|
+
sendEmailByAddress(address, body, idempotencyKey) {
|
|
890
|
+
return this.request("POST", `/api/emails/${enc(address)}/send`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
690
891
|
}
|
|
691
892
|
/** Set domain catch-all (PUT /api/domains/{domain}/email/catch-all) */
|
|
692
893
|
setCatchAll(domain, body) {
|
|
@@ -712,6 +913,10 @@ class Domani {
|
|
|
712
913
|
setMailboxWebhook(address, body) {
|
|
713
914
|
return this.request("PUT", `/api/emails/${enc(address)}/webhook`, { body });
|
|
714
915
|
}
|
|
916
|
+
/** Set a follow-up reminder (POST /api/emails/{address}/messages/{id}/remind) */
|
|
917
|
+
setMessageReminderByAddress(address, id, body) {
|
|
918
|
+
return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/remind`, { body });
|
|
919
|
+
}
|
|
715
920
|
/** Set nameservers for a domain (PUT /api/domains/{domain}/nameservers) */
|
|
716
921
|
setNameservers(domain, body) {
|
|
717
922
|
return this.request("PUT", `/api/domains/${enc(domain)}/nameservers`, { body });
|
|
@@ -732,10 +937,18 @@ class Domani {
|
|
|
732
937
|
snapshotDns(domain, body) {
|
|
733
938
|
return this.request("POST", `/api/domains/${enc(domain)}/dns/snapshot`, { body });
|
|
734
939
|
}
|
|
940
|
+
/** Consent to and start a background history import (POST /api/assistant/preview) */
|
|
941
|
+
startAssistantPreview(body) {
|
|
942
|
+
return this.request("POST", `/api/assistant/preview`, { body });
|
|
943
|
+
}
|
|
735
944
|
/** Start bank payout onboarding (POST /api/billing/connect) */
|
|
736
945
|
startPayoutOnboarding() {
|
|
737
946
|
return this.request("POST", `/api/billing/connect`, undefined);
|
|
738
947
|
}
|
|
948
|
+
/** Stream mailbox events (server-sent events) (GET /api/emails/{address}/events) */
|
|
949
|
+
streamMailboxEvents(address, lastEventId, query) {
|
|
950
|
+
return this.stream("GET", `/api/emails/${enc(address)}/events`, { query, headers: { "Last-Event-ID": lastEventId } });
|
|
951
|
+
}
|
|
739
952
|
/** AI-powered domain suggestions with availability (GET /api/domains/suggest) */
|
|
740
953
|
suggestDomains(query) {
|
|
741
954
|
return this.request("GET", `/api/domains/suggest`, { query });
|
|
@@ -764,6 +977,10 @@ class Domani {
|
|
|
764
977
|
updateActivationPreference(body) {
|
|
765
978
|
return this.request("PUT", `/api/me/activation`, { body });
|
|
766
979
|
}
|
|
980
|
+
/** Update Mailzero assistant settings (PUT /api/assistant/settings) */
|
|
981
|
+
updateAssistantSettings(body) {
|
|
982
|
+
return this.request("PUT", `/api/assistant/settings`, { body });
|
|
983
|
+
}
|
|
767
984
|
/** Assign or update a shared inbox conversation (PATCH /api/email/collaboration) */
|
|
768
985
|
updateConversationState(body) {
|
|
769
986
|
return this.request("PATCH", `/api/email/collaboration`, { body });
|
|
@@ -773,8 +990,12 @@ class Domani {
|
|
|
773
990
|
return this.request("PUT", `/api/domains/${enc(domain)}/settings`, { body });
|
|
774
991
|
}
|
|
775
992
|
/** Apply a lifecycle action to messages (POST /api/emails/{address}/messages/actions) */
|
|
776
|
-
updateEmailMessagesByAddress(address, body) {
|
|
777
|
-
return this.request("POST", `/api/emails/${enc(address)}/messages/actions`, { body });
|
|
993
|
+
updateEmailMessagesByAddress(address, body, idempotencyKey) {
|
|
994
|
+
return this.request("POST", `/api/emails/${enc(address)}/messages/actions`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
995
|
+
}
|
|
996
|
+
/** Update binding browser mode (PATCH /api/domains/{domain}/hostname-bindings/{id}) */
|
|
997
|
+
updateHostnameBinding(domain, id, body, idempotencyKey) {
|
|
998
|
+
return this.request("PATCH", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}`, { body, headers: { "Idempotency-Key": idempotencyKey } });
|
|
778
999
|
}
|
|
779
1000
|
/** Update an agent identity (PATCH /api/agents/identity/{slug}) */
|
|
780
1001
|
updateIdentity(slug, body) {
|
|
@@ -808,10 +1029,18 @@ class Domani {
|
|
|
808
1029
|
updateWorkspaceMember(id, membershipId, body) {
|
|
809
1030
|
return this.request("PATCH", `/api/workspaces/${enc(id)}/members/${enc(membershipId)}`, { body });
|
|
810
1031
|
}
|
|
1032
|
+
/** Create or update a contact (POST /api/contacts) */
|
|
1033
|
+
upsertContact(body) {
|
|
1034
|
+
return this.request("POST", `/api/contacts`, { body });
|
|
1035
|
+
}
|
|
811
1036
|
/** Verify that a provider connection is working (POST /api/domains/{domain}/verify) */
|
|
812
1037
|
verifyConnection(domain, body) {
|
|
813
1038
|
return this.request("POST", `/api/domains/${enc(domain)}/verify`, { body });
|
|
814
1039
|
}
|
|
1040
|
+
/** Verify binding DNS and certificate (POST /api/domains/{domain}/hostname-bindings/{id}/verify) */
|
|
1041
|
+
verifyHostnameBinding(domain, id) {
|
|
1042
|
+
return this.request("POST", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}/verify`, undefined);
|
|
1043
|
+
}
|
|
815
1044
|
/** Verify and complete domain import (POST /api/domains/import/verify) */
|
|
816
1045
|
verifyImport(body) {
|
|
817
1046
|
return this.request("POST", `/api/domains/import/verify`, { body });
|