domani 1.0.0 → 1.0.2
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 +648 -19
- package/dist/index.js +192 -7
- package/package.json +19 -8
package/dist/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/* eslint-disable */
|
|
2
|
-
// AUTO-GENERATED from the domani OpenAPI spec by scripts/generate-sdk.ts.
|
|
3
|
-
// Do not edit by hand - re-run `
|
|
3
|
+
// AUTO-GENERATED from the domani OpenAPI spec by apps/web/scripts/generate-sdk.ts.
|
|
4
|
+
// Do not edit by hand - re-run `pnpm --filter @domani/web exec tsx scripts/generate-sdk.ts`.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Domani = exports.DomaniError = void 0;
|
|
4
7
|
/** Structured API error - mirrors the `apiError()` shape returned by the API. */
|
|
5
|
-
|
|
8
|
+
class DomaniError extends Error {
|
|
6
9
|
status;
|
|
7
10
|
code;
|
|
8
11
|
hint;
|
|
@@ -16,9 +19,10 @@ export class DomaniError extends Error {
|
|
|
16
19
|
this.documentation_url = body?.documentation_url;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
22
|
+
exports.DomaniError = DomaniError;
|
|
19
23
|
const enc = encodeURIComponent;
|
|
20
24
|
// ─── Client ─────────────────────────────────────────
|
|
21
|
-
|
|
25
|
+
class Domani {
|
|
22
26
|
apiKey;
|
|
23
27
|
baseUrl;
|
|
24
28
|
fetchImpl;
|
|
@@ -27,7 +31,7 @@ export class Domani {
|
|
|
27
31
|
throw new Error("Domani: apiKey is required");
|
|
28
32
|
this.apiKey = opts.apiKey;
|
|
29
33
|
this.baseUrl = (opts.baseUrl || "https://domani.run").replace(/\/$/, "");
|
|
30
|
-
this.fetchImpl = opts.fetch || globalThis.fetch;
|
|
34
|
+
this.fetchImpl = opts.fetch || globalThis.fetch?.bind(globalThis);
|
|
31
35
|
if (!this.fetchImpl)
|
|
32
36
|
throw new Error("Domani: no fetch implementation available (pass opts.fetch on older runtimes)");
|
|
33
37
|
}
|
|
@@ -68,14 +72,42 @@ export class Domani {
|
|
|
68
72
|
throw new DomaniError(res.status, data);
|
|
69
73
|
return data;
|
|
70
74
|
}
|
|
75
|
+
/** Accept a workspace invitation (POST /api/workspaces/invitations/accept) */
|
|
76
|
+
acceptWorkspaceInvitation(body) {
|
|
77
|
+
return this.request("POST", `/api/workspaces/invitations/accept`, { body });
|
|
78
|
+
}
|
|
79
|
+
/** Accept workspace ownership (POST /api/workspaces/ownership-transfers/accept) */
|
|
80
|
+
acceptWorkspaceOwnershipTransfer(body) {
|
|
81
|
+
return this.request("POST", `/api/workspaces/ownership-transfers/accept`, { body });
|
|
82
|
+
}
|
|
83
|
+
/** Add a private conversation note (POST /api/email/collaboration/{id}/notes) */
|
|
84
|
+
addConversationNote(id, body) {
|
|
85
|
+
return this.request("POST", `/api/email/collaboration/${enc(id)}/notes`, { body });
|
|
86
|
+
}
|
|
87
|
+
/** Publish a DNSSEC DS record (enable DNSSEC) (POST /api/domains/{domain}/dnssec) */
|
|
88
|
+
addDnssecRecord(domain, body) {
|
|
89
|
+
return this.request("POST", `/api/domains/${enc(domain)}/dnssec`, { body });
|
|
90
|
+
}
|
|
71
91
|
/** Add a mailbox alias (POST /api/emails/{address}/aliases) */
|
|
72
92
|
addMailboxAlias(address, body) {
|
|
73
93
|
return this.request("POST", `/api/emails/${enc(address)}/aliases`, { body });
|
|
74
94
|
}
|
|
95
|
+
/** Add an inbound mail rule (POST /api/emails/{address}/rules) */
|
|
96
|
+
addMailRule(address, body) {
|
|
97
|
+
return this.request("POST", `/api/emails/${enc(address)}/rules`, { body });
|
|
98
|
+
}
|
|
75
99
|
/** Add a suppression (POST /api/suppressions) */
|
|
76
100
|
addSuppression(body) {
|
|
77
101
|
return this.request("POST", `/api/suppressions`, { body });
|
|
78
102
|
}
|
|
103
|
+
/** Adopt an owned mailbox into a workspace (POST /api/workspaces/{id}/mailboxes) */
|
|
104
|
+
attachWorkspaceMailbox(id, body) {
|
|
105
|
+
return this.request("POST", `/api/workspaces/${enc(id)}/mailboxes`, { body });
|
|
106
|
+
}
|
|
107
|
+
/** Buy an aftermarket domain (POST /api/domains/{domain}/buy-aftermarket) */
|
|
108
|
+
buyAftermarket(domain, body) {
|
|
109
|
+
return this.request("POST", `/api/domains/${enc(domain)}/buy-aftermarket`, { body });
|
|
110
|
+
}
|
|
79
111
|
/** Purchase one or more domains (POST /api/domains/buy) */
|
|
80
112
|
buyDomain(body) {
|
|
81
113
|
return this.request("POST", `/api/domains/buy`, { body });
|
|
@@ -96,10 +128,18 @@ export class Domani {
|
|
|
96
128
|
cancelNegotiation(id) {
|
|
97
129
|
return this.request("DELETE", `/api/negotiations/${enc(id)}`, undefined);
|
|
98
130
|
}
|
|
131
|
+
/** Cancel a Mailzero workspace subscription (POST /api/workspaces/{id}/billing/cancel) */
|
|
132
|
+
cancelWorkspaceSubscription(id) {
|
|
133
|
+
return this.request("POST", `/api/workspaces/${enc(id)}/billing/cancel`, undefined);
|
|
134
|
+
}
|
|
99
135
|
/** Check email DNS health (MX, SPF, DMARC, DKIM) (GET /api/domains/{domain}/email/check) */
|
|
100
136
|
checkEmail(domain) {
|
|
101
137
|
return this.request("GET", `/api/domains/${enc(domain)}/email/check`, undefined);
|
|
102
138
|
}
|
|
139
|
+
/** Preflight an outbound email (POST /api/emails/{address}/deliverability-check) */
|
|
140
|
+
checkEmailDeliverabilityByAddress(address, body) {
|
|
141
|
+
return this.request("POST", `/api/emails/${enc(address)}/deliverability-check`, { body });
|
|
142
|
+
}
|
|
103
143
|
/** Pre-check transfer eligibility (GET /api/domains/transfer-check) */
|
|
104
144
|
checkTransferEligibility(query) {
|
|
105
145
|
return this.request("GET", `/api/domains/transfer-check`, { query });
|
|
@@ -108,6 +148,10 @@ export class Domani {
|
|
|
108
148
|
checkTransferStatus(domain) {
|
|
109
149
|
return this.request("GET", `/api/domains/${enc(domain)}/transfer-status`, undefined);
|
|
110
150
|
}
|
|
151
|
+
/** Claim a free agent identity (<handle>.domani.run) (POST /api/agents/identity) */
|
|
152
|
+
claimIdentity(body) {
|
|
153
|
+
return this.request("POST", `/api/agents/identity`, { body });
|
|
154
|
+
}
|
|
111
155
|
/** Clear domain catch-all (DELETE /api/domains/{domain}/email/catch-all) */
|
|
112
156
|
clearCatchAll(domain) {
|
|
113
157
|
return this.request("DELETE", `/api/domains/${enc(domain)}/email/catch-all`, undefined);
|
|
@@ -116,6 +160,10 @@ export class Domani {
|
|
|
116
160
|
clearDomainRedirect(domain) {
|
|
117
161
|
return this.request("DELETE", `/api/domains/${enc(domain)}/redirect`, undefined);
|
|
118
162
|
}
|
|
163
|
+
/** Clone another domain's DNS onto this one (POST /api/domains/{domain}/dns/clone) */
|
|
164
|
+
cloneDns(domain, body) {
|
|
165
|
+
return this.request("POST", `/api/domains/${enc(domain)}/dns/clone`, { body });
|
|
166
|
+
}
|
|
119
167
|
/** Connect a domain to a hosting or email provider (POST /api/domains/{domain}/connect) */
|
|
120
168
|
connectDomain(domain, body) {
|
|
121
169
|
return this.request("POST", `/api/domains/${enc(domain)}/connect`, { body });
|
|
@@ -144,6 +192,10 @@ export class Domani {
|
|
|
144
192
|
createMailboxByAddress(body) {
|
|
145
193
|
return this.request("POST", `/api/emails`, { body });
|
|
146
194
|
}
|
|
195
|
+
/** Create an app password (hosted) (POST /api/emails/{address}/credentials) */
|
|
196
|
+
createMailboxCredential(address, body) {
|
|
197
|
+
return this.request("POST", `/api/emails/${enc(address)}/credentials`, { body });
|
|
198
|
+
}
|
|
147
199
|
/** Create a new API token (POST /api/tokens) */
|
|
148
200
|
createToken(body) {
|
|
149
201
|
return this.request("POST", `/api/tokens`, { body });
|
|
@@ -152,10 +204,22 @@ export class Domani {
|
|
|
152
204
|
createWebhook(body) {
|
|
153
205
|
return this.request("POST", `/api/webhooks`, { body });
|
|
154
206
|
}
|
|
155
|
-
/**
|
|
207
|
+
/** Create a workspace (POST /api/workspaces) */
|
|
208
|
+
createWorkspace(body) {
|
|
209
|
+
return this.request("POST", `/api/workspaces`, { body });
|
|
210
|
+
}
|
|
211
|
+
/** Start Mailzero workspace checkout (POST /api/workspaces/{id}/billing/checkout) */
|
|
212
|
+
createWorkspaceCheckout(id, body) {
|
|
213
|
+
return this.request("POST", `/api/workspaces/${enc(id)}/billing/checkout`, { body });
|
|
214
|
+
}
|
|
215
|
+
/** Delete account (blocked while domains are held) (DELETE /api/me) */
|
|
156
216
|
deleteAccount() {
|
|
157
217
|
return this.request("DELETE", `/api/me`, undefined);
|
|
158
218
|
}
|
|
219
|
+
/** Remove a DNSSEC DS record (disable DNSSEC) (DELETE /api/domains/{domain}/dnssec) */
|
|
220
|
+
deleteDnssecRecord(domain, query) {
|
|
221
|
+
return this.request("DELETE", `/api/domains/${enc(domain)}/dnssec`, { query });
|
|
222
|
+
}
|
|
159
223
|
/** Delete a mailbox (DELETE /api/emails/{address}) */
|
|
160
224
|
deleteMailboxByAddress(address, body) {
|
|
161
225
|
return this.request("DELETE", `/api/emails/${enc(address)}`, { body });
|
|
@@ -220,6 +284,10 @@ export class Domani {
|
|
|
220
284
|
getDnsRecords(domain) {
|
|
221
285
|
return this.request("GET", `/api/domains/${enc(domain)}/dns`, undefined);
|
|
222
286
|
}
|
|
287
|
+
/** List DNSSEC DS records for a domain you own (GET /api/domains/{domain}/dnssec) */
|
|
288
|
+
getDnssecRecords(domain) {
|
|
289
|
+
return this.request("GET", `/api/domains/${enc(domain)}/dnssec`, undefined);
|
|
290
|
+
}
|
|
223
291
|
/** Check email DNS status (GET /api/domains/{domain}/email/status) */
|
|
224
292
|
getDomainEmailStatus(domain) {
|
|
225
293
|
return this.request("GET", `/api/domains/${enc(domain)}/email/status`, undefined);
|
|
@@ -236,6 +304,10 @@ export class Domani {
|
|
|
236
304
|
getDomainStatus(domain) {
|
|
237
305
|
return this.request("GET", `/api/domains/${enc(domain)}/status`, undefined);
|
|
238
306
|
}
|
|
307
|
+
/** Get owner-scoped email deliverability health (GET /api/domains/{domain}/email/deliverability) */
|
|
308
|
+
getEmailDeliverability(domain) {
|
|
309
|
+
return this.request("GET", `/api/domains/${enc(domain)}/email/deliverability`, undefined);
|
|
310
|
+
}
|
|
239
311
|
/** Get mailbox avatar info (GET /api/emails/{address}/avatar) */
|
|
240
312
|
getMailboxAvatarByAddress(address) {
|
|
241
313
|
return this.request("GET", `/api/emails/${enc(address)}/avatar`, undefined);
|
|
@@ -244,6 +316,10 @@ export class Domani {
|
|
|
244
316
|
getMailboxByAddress(address) {
|
|
245
317
|
return this.request("GET", `/api/emails/${enc(address)}`, undefined);
|
|
246
318
|
}
|
|
319
|
+
/** Get mail client settings (hosted) (GET /api/emails/{address}/client-settings) */
|
|
320
|
+
getMailboxClientSettings(address) {
|
|
321
|
+
return this.request("GET", `/api/emails/${enc(address)}/client-settings`, undefined);
|
|
322
|
+
}
|
|
247
323
|
/** Get mailbox webhook config (GET /api/emails/{address}/webhook) */
|
|
248
324
|
getMailboxWebhook(address) {
|
|
249
325
|
return this.request("GET", `/api/emails/${enc(address)}/webhook`, undefined);
|
|
@@ -292,10 +368,26 @@ export class Domani {
|
|
|
292
368
|
getWebhookDeliveries(id, query) {
|
|
293
369
|
return this.request("GET", `/api/webhooks/${enc(id)}/deliveries`, { query });
|
|
294
370
|
}
|
|
371
|
+
/** Get workspace members and mailboxes (GET /api/workspaces/{id}) */
|
|
372
|
+
getWorkspace(id) {
|
|
373
|
+
return this.request("GET", `/api/workspaces/${enc(id)}`, undefined);
|
|
374
|
+
}
|
|
295
375
|
/** Import an external domain (POST /api/domains/import) */
|
|
296
376
|
importDomain(body) {
|
|
297
377
|
return this.request("POST", `/api/domains/import`, { body });
|
|
298
378
|
}
|
|
379
|
+
/** Invite a workspace member (POST /api/workspaces/{id}/invitations) */
|
|
380
|
+
inviteWorkspaceMember(id, body) {
|
|
381
|
+
return this.request("POST", `/api/workspaces/${enc(id)}/invitations`, { body });
|
|
382
|
+
}
|
|
383
|
+
/** Leave a workspace (DELETE /api/workspaces/{id}/members/me) */
|
|
384
|
+
leaveWorkspace(id) {
|
|
385
|
+
return this.request("DELETE", `/api/workspaces/${enc(id)}/members/me`, undefined);
|
|
386
|
+
}
|
|
387
|
+
/** List security audit events (GET /api/audit) */
|
|
388
|
+
listAuditEvents(query) {
|
|
389
|
+
return this.request("GET", `/api/audit`, { query });
|
|
390
|
+
}
|
|
299
391
|
/** List your backorders (GET /api/backorders) */
|
|
300
392
|
listBackorders(query) {
|
|
301
393
|
return this.request("GET", `/api/backorders`, { query });
|
|
@@ -308,6 +400,18 @@ export class Domani {
|
|
|
308
400
|
listConnectProviders(domain) {
|
|
309
401
|
return this.request("GET", `/api/domains/${enc(domain)}/connect`, undefined);
|
|
310
402
|
}
|
|
403
|
+
/** List attributed conversation activity (GET /api/email/collaboration/{id}/activity) */
|
|
404
|
+
listConversationActivity(id) {
|
|
405
|
+
return this.request("GET", `/api/email/collaboration/${enc(id)}/activity`, undefined);
|
|
406
|
+
}
|
|
407
|
+
/** List private conversation notes (GET /api/email/collaboration/{id}/notes) */
|
|
408
|
+
listConversationNotes(id) {
|
|
409
|
+
return this.request("GET", `/api/email/collaboration/${enc(id)}/notes`, undefined);
|
|
410
|
+
}
|
|
411
|
+
/** List shared inbox conversation state (GET /api/email/collaboration) */
|
|
412
|
+
listConversationStates(query) {
|
|
413
|
+
return this.request("GET", `/api/email/collaboration`, { query });
|
|
414
|
+
}
|
|
311
415
|
/** List your deals (GET /api/deals) */
|
|
312
416
|
listDeals(query) {
|
|
313
417
|
return this.request("GET", `/api/deals`, { query });
|
|
@@ -316,10 +420,18 @@ export class Domani {
|
|
|
316
420
|
listDomains() {
|
|
317
421
|
return this.request("GET", `/api/domains`, undefined);
|
|
318
422
|
}
|
|
423
|
+
/** List email folders and counts (GET /api/emails/{address}/folders) */
|
|
424
|
+
listEmailFoldersByAddress(address) {
|
|
425
|
+
return this.request("GET", `/api/emails/${enc(address)}/folders`, undefined);
|
|
426
|
+
}
|
|
319
427
|
/** List emails (GET /api/emails/{address}/messages) */
|
|
320
428
|
listEmailMessagesByAddress(address, query) {
|
|
321
429
|
return this.request("GET", `/api/emails/${enc(address)}/messages`, { query });
|
|
322
430
|
}
|
|
431
|
+
/** List your agent identities (GET /api/agents/identity) */
|
|
432
|
+
listIdentities() {
|
|
433
|
+
return this.request("GET", `/api/agents/identity`, undefined);
|
|
434
|
+
}
|
|
323
435
|
/** List payment invoices (GET /api/billing/invoices) */
|
|
324
436
|
listInvoices(query) {
|
|
325
437
|
return this.request("GET", `/api/billing/invoices`, { query });
|
|
@@ -328,6 +440,10 @@ export class Domani {
|
|
|
328
440
|
listMailboxAliases(address) {
|
|
329
441
|
return this.request("GET", `/api/emails/${enc(address)}/aliases`, undefined);
|
|
330
442
|
}
|
|
443
|
+
/** List app passwords (hosted) (GET /api/emails/{address}/credentials) */
|
|
444
|
+
listMailboxCredentials(address) {
|
|
445
|
+
return this.request("GET", `/api/emails/${enc(address)}/credentials`, undefined);
|
|
446
|
+
}
|
|
331
447
|
/** List all mailboxes (GET /api/email) */
|
|
332
448
|
listMailboxes(query) {
|
|
333
449
|
return this.request("GET", `/api/email`, { query });
|
|
@@ -336,6 +452,10 @@ export class Domani {
|
|
|
336
452
|
listMailboxesByAddress(query) {
|
|
337
453
|
return this.request("GET", `/api/emails`, { query });
|
|
338
454
|
}
|
|
455
|
+
/** List inbound mail rules (GET /api/emails/{address}/rules) */
|
|
456
|
+
listMailRules(address) {
|
|
457
|
+
return this.request("GET", `/api/emails/${enc(address)}/rules`, undefined);
|
|
458
|
+
}
|
|
339
459
|
/** List your negotiations (GET /api/negotiations) */
|
|
340
460
|
listNegotiations(query) {
|
|
341
461
|
return this.request("GET", `/api/negotiations`, { query });
|
|
@@ -368,6 +488,10 @@ export class Domani {
|
|
|
368
488
|
listWebhooks() {
|
|
369
489
|
return this.request("GET", `/api/webhooks`, undefined);
|
|
370
490
|
}
|
|
491
|
+
/** List accessible workspaces (GET /api/workspaces) */
|
|
492
|
+
listWorkspaces() {
|
|
493
|
+
return this.request("GET", `/api/workspaces`, undefined);
|
|
494
|
+
}
|
|
371
495
|
/** Send a magic link sign-in email (POST /api/auth/login) */
|
|
372
496
|
loginUser(body) {
|
|
373
497
|
return this.request("POST", `/api/auth/login`, { body });
|
|
@@ -388,6 +512,10 @@ export class Domani {
|
|
|
388
512
|
markNotificationRead(id, body) {
|
|
389
513
|
return this.request("PATCH", `/api/notifications/${enc(id)}`, { body });
|
|
390
514
|
}
|
|
515
|
+
/** Plan how to adopt an existing domain (GET /api/domains/adoption-plan) */
|
|
516
|
+
planDomainAdoption(query) {
|
|
517
|
+
return this.request("GET", `/api/domains/adoption-plan`, { query });
|
|
518
|
+
}
|
|
391
519
|
/** Provide EPP/auth code (seller) (PATCH /api/deals/{id}) */
|
|
392
520
|
provideEppCode(id, body) {
|
|
393
521
|
return this.request("PATCH", `/api/deals/${enc(id)}`, { body });
|
|
@@ -400,6 +528,10 @@ export class Domani {
|
|
|
400
528
|
registerUser(body) {
|
|
401
529
|
return this.request("POST", `/api/auth/register`, { body });
|
|
402
530
|
}
|
|
531
|
+
/** Release an agent identity (DELETE /api/agents/identity/{slug}) */
|
|
532
|
+
releaseIdentity(slug) {
|
|
533
|
+
return this.request("DELETE", `/api/agents/identity/${enc(slug)}`, undefined);
|
|
534
|
+
}
|
|
403
535
|
/** Remove saved payment method (DELETE /api/billing/card) */
|
|
404
536
|
removeCard() {
|
|
405
537
|
return this.request("DELETE", `/api/billing/card`, undefined);
|
|
@@ -412,14 +544,26 @@ export class Domani {
|
|
|
412
544
|
removeMailboxAlias(address, alias) {
|
|
413
545
|
return this.request("DELETE", `/api/emails/${enc(address)}/aliases/${enc(alias)}`, undefined);
|
|
414
546
|
}
|
|
547
|
+
/** Remove a member mailbox permission (DELETE /api/workspaces/{id}/mailboxes/{mailboxId}/grants) */
|
|
548
|
+
removeMailboxGrant(id, mailboxId, body) {
|
|
549
|
+
return this.request("DELETE", `/api/workspaces/${enc(id)}/mailboxes/${enc(mailboxId)}/grants`, { body });
|
|
550
|
+
}
|
|
415
551
|
/** Remove mailbox webhook (DELETE /api/emails/{address}/webhook) */
|
|
416
552
|
removeMailboxWebhook(address) {
|
|
417
553
|
return this.request("DELETE", `/api/emails/${enc(address)}/webhook`, undefined);
|
|
418
554
|
}
|
|
555
|
+
/** Remove an inbound mail rule (DELETE /api/emails/{address}/rules/{ruleId}) */
|
|
556
|
+
removeMailRule(address, ruleId) {
|
|
557
|
+
return this.request("DELETE", `/api/emails/${enc(address)}/rules/${enc(ruleId)}`, undefined);
|
|
558
|
+
}
|
|
419
559
|
/** Remove a suppression (DELETE /api/suppressions/{address}) */
|
|
420
560
|
removeSuppression(address) {
|
|
421
561
|
return this.request("DELETE", `/api/suppressions/${enc(address)}`, undefined);
|
|
422
562
|
}
|
|
563
|
+
/** Remove a workspace member (DELETE /api/workspaces/{id}/members/{membershipId}) */
|
|
564
|
+
removeWorkspaceMember(id, membershipId) {
|
|
565
|
+
return this.request("DELETE", `/api/workspaces/${enc(id)}/members/${enc(membershipId)}`, undefined);
|
|
566
|
+
}
|
|
423
567
|
/** Renew a domain (POST /api/domains/{domain}/renew) */
|
|
424
568
|
renewDomain(domain, body) {
|
|
425
569
|
return this.request("POST", `/api/domains/${enc(domain)}/renew`, { body });
|
|
@@ -428,6 +572,10 @@ export class Domani {
|
|
|
428
572
|
replyToMessageByAddress(address, id, body) {
|
|
429
573
|
return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/reply`, { body });
|
|
430
574
|
}
|
|
575
|
+
/** Request a workspace ownership transfer (POST /api/workspaces/{id}/ownership-transfer) */
|
|
576
|
+
requestWorkspaceOwnershipTransfer(id, body) {
|
|
577
|
+
return this.request("POST", `/api/workspaces/${enc(id)}/ownership-transfer`, { body });
|
|
578
|
+
}
|
|
431
579
|
/** Resend contact email verification (POST /api/me/resend-verification) */
|
|
432
580
|
resendEmailVerification(body) {
|
|
433
581
|
return this.request("POST", `/api/me/resend-verification`, { body });
|
|
@@ -444,10 +592,22 @@ export class Domani {
|
|
|
444
592
|
restoreDns(domain, body) {
|
|
445
593
|
return this.request("POST", `/api/domains/${enc(domain)}/dns/restore`, { body });
|
|
446
594
|
}
|
|
595
|
+
/** Revoke an app password (hosted) (DELETE /api/emails/{address}/credentials/{id}) */
|
|
596
|
+
revokeMailboxCredential(address, id) {
|
|
597
|
+
return this.request("DELETE", `/api/emails/${enc(address)}/credentials/${enc(id)}`, undefined);
|
|
598
|
+
}
|
|
447
599
|
/** Revoke an API token (DELETE /api/tokens/{id}) */
|
|
448
600
|
revokeToken(id) {
|
|
449
601
|
return this.request("DELETE", `/api/tokens/${enc(id)}`, undefined);
|
|
450
602
|
}
|
|
603
|
+
/** Revoke a pending invitation (DELETE /api/workspaces/{id}/invitations/{invitationId}) */
|
|
604
|
+
revokeWorkspaceInvitation(id, invitationId) {
|
|
605
|
+
return this.request("DELETE", `/api/workspaces/${enc(id)}/invitations/${enc(invitationId)}`, undefined);
|
|
606
|
+
}
|
|
607
|
+
/** Revoke a pending ownership transfer (DELETE /api/workspaces/{id}/ownership-transfer/{transferId}) */
|
|
608
|
+
revokeWorkspaceOwnershipTransfer(id, transferId) {
|
|
609
|
+
return this.request("DELETE", `/api/workspaces/${enc(id)}/ownership-transfer/${enc(transferId)}`, undefined);
|
|
610
|
+
}
|
|
451
611
|
/** Rotate webhook signing secret (POST /api/emails/{address}/webhook/rotate) */
|
|
452
612
|
rotateMailboxWebhookSecret(address) {
|
|
453
613
|
return this.request("POST", `/api/emails/${enc(address)}/webhook/rotate`, undefined);
|
|
@@ -480,6 +640,10 @@ export class Domani {
|
|
|
480
640
|
setDomainRedirect(domain, body) {
|
|
481
641
|
return this.request("PUT", `/api/domains/${enc(domain)}/redirect`, { body });
|
|
482
642
|
}
|
|
643
|
+
/** Set a member mailbox permission (PUT /api/workspaces/{id}/mailboxes/{mailboxId}/grants) */
|
|
644
|
+
setMailboxGrant(id, mailboxId, body) {
|
|
645
|
+
return this.request("PUT", `/api/workspaces/${enc(id)}/mailboxes/${enc(mailboxId)}/grants`, { body });
|
|
646
|
+
}
|
|
483
647
|
/** Set mailbox webhook (PUT /api/emails/{address}/webhook) */
|
|
484
648
|
setMailboxWebhook(address, body) {
|
|
485
649
|
return this.request("PUT", `/api/emails/${enc(address)}/webhook`, { body });
|
|
@@ -520,10 +684,22 @@ export class Domani {
|
|
|
520
684
|
updateAccount(body) {
|
|
521
685
|
return this.request("PUT", `/api/me`, { body });
|
|
522
686
|
}
|
|
687
|
+
/** Assign or update a shared inbox conversation (PATCH /api/email/collaboration) */
|
|
688
|
+
updateConversationState(body) {
|
|
689
|
+
return this.request("PATCH", `/api/email/collaboration`, { body });
|
|
690
|
+
}
|
|
523
691
|
/** Update domain settings (PUT /api/domains/{domain}/settings) */
|
|
524
692
|
updateDomainSettings(domain, body) {
|
|
525
693
|
return this.request("PUT", `/api/domains/${enc(domain)}/settings`, { body });
|
|
526
694
|
}
|
|
695
|
+
/** Apply a lifecycle action to messages (POST /api/emails/{address}/messages/actions) */
|
|
696
|
+
updateEmailMessagesByAddress(address, body) {
|
|
697
|
+
return this.request("POST", `/api/emails/${enc(address)}/messages/actions`, { body });
|
|
698
|
+
}
|
|
699
|
+
/** Update an agent identity (PATCH /api/agents/identity/{slug}) */
|
|
700
|
+
updateIdentity(slug, body) {
|
|
701
|
+
return this.request("PATCH", `/api/agents/identity/${enc(slug)}`, { body });
|
|
702
|
+
}
|
|
527
703
|
/** Update a domain listing (PATCH /api/domains/{domain}/for-sale) */
|
|
528
704
|
updateListing(domain, body) {
|
|
529
705
|
return this.request("PATCH", `/api/domains/${enc(domain)}/for-sale`, { body });
|
|
@@ -544,6 +720,14 @@ export class Domani {
|
|
|
544
720
|
updateWebhook(id, body) {
|
|
545
721
|
return this.request("PATCH", `/api/webhooks/${enc(id)}`, { body });
|
|
546
722
|
}
|
|
723
|
+
/** Rename a workspace (PATCH /api/workspaces/{id}) */
|
|
724
|
+
updateWorkspace(id, body) {
|
|
725
|
+
return this.request("PATCH", `/api/workspaces/${enc(id)}`, { body });
|
|
726
|
+
}
|
|
727
|
+
/** Change a member role (PATCH /api/workspaces/{id}/members/{membershipId}) */
|
|
728
|
+
updateWorkspaceMember(id, membershipId, body) {
|
|
729
|
+
return this.request("PATCH", `/api/workspaces/${enc(id)}/members/${enc(membershipId)}`, { body });
|
|
730
|
+
}
|
|
547
731
|
/** Verify that a provider connection is working (POST /api/domains/{domain}/verify) */
|
|
548
732
|
verifyConnection(domain, body) {
|
|
549
733
|
return this.request("POST", `/api/domains/${enc(domain)}/verify`, { body });
|
|
@@ -577,4 +761,5 @@ export class Domani {
|
|
|
577
761
|
return this.request("POST", `/api/billing/connect/payout`, undefined);
|
|
578
762
|
}
|
|
579
763
|
}
|
|
580
|
-
|
|
764
|
+
exports.Domani = Domani;
|
|
765
|
+
exports.default = Domani;
|
package/package.json
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domani",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Official TypeScript SDK for the domani API - domains, email, and identity for AI agents.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
5
|
+
"main": "./src/index.ts",
|
|
6
|
+
"types": "./src/index.ts",
|
|
9
7
|
"exports": {
|
|
10
8
|
".": {
|
|
11
|
-
"types": "./
|
|
12
|
-
"
|
|
9
|
+
"types": "./src/index.ts",
|
|
10
|
+
"default": "./src/index.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
}
|
|
13
21
|
}
|
|
14
22
|
},
|
|
15
23
|
"files": [
|
|
@@ -17,10 +25,13 @@
|
|
|
17
25
|
],
|
|
18
26
|
"scripts": {
|
|
19
27
|
"build": "tsc -p tsconfig.json",
|
|
28
|
+
"check": "tsc --noEmit",
|
|
29
|
+
"test": "vitest run",
|
|
20
30
|
"prepublishOnly": "npm run build"
|
|
21
31
|
},
|
|
22
32
|
"devDependencies": {
|
|
23
|
-
"typescript": "^5.9.0"
|
|
33
|
+
"typescript": "^5.9.0",
|
|
34
|
+
"vitest": "^4.0.18"
|
|
24
35
|
},
|
|
25
36
|
"keywords": [
|
|
26
37
|
"domani",
|