domani 1.0.5 → 1.0.6

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +338 -42
  2. package/dist/index.js +102 -14
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ export interface Error {
18
18
  /** Human-readable error message */
19
19
  error: string;
20
20
  /** Machine-readable error code */
21
- code: "MISSING_API_KEY" | "INVALID_API_KEY" | "EXPIRED_API_KEY" | "MISSING_PARAMETER" | "INVALID_DOMAIN" | "PAYMENT_REQUIRED" | "DOMAIN_UNAVAILABLE" | "RATE_LIMIT_EXCEEDED" | "USER_EXISTS" | "NOT_FOUND" | "UNKNOWN_PROVIDER" | "UNKNOWN_METHOD" | "TARGET_REQUIRED" | "INVALID_PARAMETER" | "CONTACT_REQUIRED" | "INVALID_CONTACT" | "INSUFFICIENT_SCOPE" | "SCOPE_ESCALATION" | "DOMAIN_EXISTS" | "DOMAIN_NOT_ACTIVE" | "UNSUPPORTED_TLD" | "NOT_AVAILABLE" | "ALREADY_REGISTERED" | "TRANSFER_NOT_ELIGIBLE" | "ALREADY_LISTED" | "LISTING_SOLD" | "SELF_PURCHASE" | "DESCRIPTION_TOO_LONG" | "DEAL_NOT_FOUND" | "INVALID_DEAL_STATE" | "EPP_ATTEMPTS_EXCEEDED" | "ACTIVE_DEAL_EXISTS" | "AGENT_IDENTITY_NOT_FOUND" | "AGENT_IDENTITY_ESCALATION" | "CREDENTIAL_REVOKE_FAILED" | "INVALID_IDEMPOTENCY_KEY" | "IDEMPOTENCY_KEY_MISMATCH" | "IDEMPOTENCY_KEY_REUSED" | "OPERATION_IN_PROGRESS" | "OPERATION_SUPERSEDED" | "INVALID_OPERATION_RECEIPT" | "WORKSPACE_ADMIN_REQUIRED" | "PRINCIPAL_NOT_IN_WORKSPACE" | "MAILBOX_NOT_IN_WORKSPACE" | "GROUP_NOT_IN_WORKSPACE" | "COLLECTION_NOT_IN_WORKSPACE" | "ACCESS_VERSION_CONFLICT" | "ACCESS_OFFER_INVALID" | "ACCESS_OFFER_EMAIL_MISMATCH" | "MAIL_DOMAIN_CAPACITY_EXHAUSTED" | "MAIL_PROVIDER_ERROR";
21
+ code: "MISSING_API_KEY" | "INVALID_API_KEY" | "EXPIRED_API_KEY" | "MISSING_PARAMETER" | "INVALID_DOMAIN" | "PAYMENT_REQUIRED" | "DOMAIN_UNAVAILABLE" | "RATE_LIMIT_EXCEEDED" | "USER_EXISTS" | "NOT_FOUND" | "UNKNOWN_PROVIDER" | "UNKNOWN_METHOD" | "TARGET_REQUIRED" | "INVALID_PARAMETER" | "CONTACT_REQUIRED" | "INVALID_CONTACT" | "INSUFFICIENT_SCOPE" | "SCOPE_ESCALATION" | "DOMAIN_EXISTS" | "DOMAIN_NOT_ACTIVE" | "UNSUPPORTED_TLD" | "NOT_AVAILABLE" | "ALREADY_REGISTERED" | "TRANSFER_NOT_ELIGIBLE" | "ALREADY_LISTED" | "LISTING_SOLD" | "SELF_PURCHASE" | "DESCRIPTION_TOO_LONG" | "DEAL_NOT_FOUND" | "INVALID_DEAL_STATE" | "EPP_ATTEMPTS_EXCEEDED" | "ACTIVE_DEAL_EXISTS" | "AGENT_IDENTITY_NOT_FOUND" | "AGENT_IDENTITY_ESCALATION" | "CREDENTIAL_REVOKE_FAILED" | "INVALID_IDEMPOTENCY_KEY" | "IDEMPOTENCY_KEY_MISMATCH" | "IDEMPOTENCY_KEY_REUSED" | "OPERATION_IN_PROGRESS" | "OPERATION_SUPERSEDED" | "INVALID_OPERATION_RECEIPT" | "WORKSPACE_ADMIN_REQUIRED" | "WORKSPACE_OWNER_REQUIRED" | "PRINCIPAL_NOT_IN_WORKSPACE" | "MAILBOX_NOT_IN_WORKSPACE" | "GROUP_NOT_IN_WORKSPACE" | "COLLECTION_NOT_IN_WORKSPACE" | "ACCESS_VERSION_CONFLICT" | "ACCESS_OFFER_INVALID" | "ACCESS_OFFER_EMAIL_MISMATCH" | "MAIL_DOMAIN_CAPACITY_EXHAUSTED" | "MAIL_PROVIDER_ERROR" | "INVALID_HTTP_ROUTE_HOSTNAME" | "INVALID_HTTP_ROUTE_UPSTREAM" | "INVALID_HTTP_ROUTE_UPSTREAM_HEADERS" | "INVALID_HTTP_ROUTE_LEASE" | "INVALID_HTTP_ROUTE_POLICY" | "INVALID_HOSTNAME_BINDING" | "HTTP_ROUTE_HOSTNAME_NOT_ALLOWED" | "HTTP_ROUTE_HOSTNAME_REQUIRED" | "HTTP_ROUTE_HOSTNAME_RESERVED" | "HTTP_ROUTE_HOSTNAME_UNAVAILABLE" | "HTTP_ROUTE_CONCURRENCY_LIMIT" | "HTTP_ROUTE_WORKSPACE_LIMIT" | "HTTP_ROUTE_DOMAIN_NOT_OWNED" | "HTTP_ROUTE_TERMINAL" | "HTTP_ROUTE_VERIFICATION_NOT_ENABLED" | "HTTP_ROUTE_VERIFICATION_REQUIRES_HTTPS" | "HTTP_ROUTE_POLICY_WITHOUT_SCOPE" | "HTTP_ROUTE_POLICY_REQUIRED" | "HTTP_ROUTE_AGENT_IDENTITY_REQUIRED" | "HTTP_ROUTE_POLICY_ESCALATION" | "HOSTNAME_BINDING_NOT_ACTIVE" | "HOSTNAME_BINDING_DNS_CONFLICT" | "HOSTNAME_BINDING_ACK_REQUIRED" | "HOSTNAME_BINDING_BROWSER_MODE_MISMATCH" | "HOSTNAME_DNS_CONFLICT" | "ZONE_READ_FAILED" | "DNS_VERSION_CONFLICT" | "UNAUTHORIZED" | "APEX_WEB_MODE_CONFLICT" | "APEX_DELEGATION_ACK_REQUIRED";
22
22
  /** Actionable recovery guidance for the caller */
23
23
  hint?: string;
24
24
  /** CLI command to resolve the error (e.g. 'domani login', 'domani billing'). Present in CLI --json output. */
@@ -87,6 +87,89 @@ export interface DsRecord {
87
87
  /** Hex digest of the DNSKEY */
88
88
  digest: string;
89
89
  }
90
+ export interface HostnameBinding {
91
+ id: string;
92
+ hostname_pattern: string;
93
+ kind: "exact" | "wildcard";
94
+ browser_mode: "stateless" | "dedicated_site" | "trusted_same_site";
95
+ status: "manual_setup_required" | "pending_dns" | "pending_certificate" | "active" | "degraded" | "disabled" | "suspended";
96
+ certificate_status: string;
97
+ installed_records: DnsRecord[];
98
+ last_verified_at?: string | null;
99
+ created_at: string;
100
+ updated_at: string;
101
+ }
102
+ export interface HostnameBindingPlan {
103
+ hostname_pattern: string;
104
+ kind: "exact" | "wildcard";
105
+ browser_mode: "stateless" | "dedicated_site" | "trusted_same_site";
106
+ managed_dns: boolean;
107
+ zone_version: string;
108
+ certificate_kind: "exact" | "wildcard";
109
+ required_records: DnsRecord[];
110
+ conflicts: ({
111
+ code: "HOSTNAME_BINDING_DNS_CONFLICT" | "APEX_WEB_MODE_CONFLICT";
112
+ message: string;
113
+ record?: DnsRecord;
114
+ })[];
115
+ required_acknowledgements: string[];
116
+ warnings: string[];
117
+ }
118
+ export interface HostnameBindingReceipt {
119
+ hostname_binding: HostnameBinding;
120
+ idempotency_key: string;
121
+ idempotent_replay: boolean;
122
+ pending?: boolean;
123
+ manual_records?: DnsRecord[];
124
+ }
125
+ export interface HttpRoute {
126
+ id: string;
127
+ url: string;
128
+ hostname: string;
129
+ domain: string;
130
+ upstream: string;
131
+ /** Names of write-only headers injected toward the upstream; values are never returned */
132
+ upstream_header_names: string[];
133
+ host_header: "public" | "upstream";
134
+ browser_mode: "stateless" | "dedicated_site" | "trusted_same_site";
135
+ upstream_verification: {
136
+ mode: "none" | "signed_headers";
137
+ secret?: string;
138
+ };
139
+ status: "active" | "expired" | "deleted" | "suspended";
140
+ revision: number;
141
+ expires_at: string;
142
+ created_at: string;
143
+ updated_at?: string;
144
+ created_by: {
145
+ type: "user" | "agent" | "token";
146
+ id: string;
147
+ label: string;
148
+ };
149
+ }
150
+ export interface HttpRouteReceipt {
151
+ http_route: HttpRoute;
152
+ idempotency_key: string;
153
+ idempotent_replay: boolean;
154
+ hint?: string;
155
+ }
156
+ export interface HttpRouteVerificationReceipt {
157
+ http_route: HttpRoute;
158
+ upstream_verification: {
159
+ mode: "signed_headers";
160
+ secret: string;
161
+ };
162
+ idempotency_key: string;
163
+ idempotent_replay: boolean;
164
+ hint?: string;
165
+ }
166
+ export interface HttpRouteHeadersReceipt {
167
+ http_route: HttpRoute;
168
+ upstream_header_names: string[];
169
+ idempotency_key: string;
170
+ idempotent_replay: boolean;
171
+ hint?: string;
172
+ }
90
173
  export interface AgentIdentity {
91
174
  /** Stable identity id used to bind scoped API tokens */
92
175
  id: string;
@@ -147,7 +230,7 @@ export interface MailRule {
147
230
  match_field?: "from" | "to" | "subject" | "body";
148
231
  match_op?: "contains" | "equals" | "regex";
149
232
  match_value?: string;
150
- action?: "drop" | "mark_read" | "forward" | "webhook_only" | "label";
233
+ action?: "drop" | "mark_read" | "forward" | "webhook_only" | "label" | "escalate";
151
234
  action_arg?: string | null;
152
235
  enabled?: boolean;
153
236
  created_at?: string;
@@ -668,7 +751,7 @@ export interface TokenInfo {
668
751
  /** Whether this token has expired */
669
752
  expired?: boolean;
670
753
  /** Permission scopes granted to this token. ['*'] means full access. */
671
- scopes?: string[];
754
+ scopes: string[];
672
755
  createdAt: string;
673
756
  /** Per-transaction spend cap in USD (null = uncapped) */
674
757
  max_per_tx?: number | null;
@@ -678,6 +761,9 @@ export interface TokenInfo {
678
761
  spent_this_month?: number;
679
762
  /** Id of the token that minted this one (null = created via dashboard/session) */
680
763
  parent_token_id?: string | null;
764
+ /** Mailbox ids this token is confined to. Empty means no mailbox-id confinement. */
765
+ mailbox_ids: string[];
766
+ http_route_policy: HttpRoutePolicy | null;
681
767
  /** Agent identity represented by this token. Its mail actions are attributed to this agent. */
682
768
  agent_identity?: {
683
769
  id?: string;
@@ -685,6 +771,19 @@ export interface TokenInfo {
685
771
  slug?: string;
686
772
  } | null;
687
773
  }
774
+ export interface HttpRoutePolicy {
775
+ hostname_rules: ({
776
+ domain: string;
777
+ kind: "exact";
778
+ hostname: string;
779
+ } | {
780
+ domain: string;
781
+ kind: "subdomain_prefix";
782
+ prefix: string;
783
+ })[];
784
+ max_concurrent: number;
785
+ max_lease_seconds: number;
786
+ }
688
787
  export interface Contact {
689
788
  /** Contact name */
690
789
  name?: string | null;
@@ -798,19 +897,20 @@ export declare class Domani {
798
897
  request<T = unknown>(method: string, path: string, opts?: {
799
898
  query?: Record<string, unknown>;
800
899
  body?: unknown;
900
+ headers?: Record<string, string | undefined>;
801
901
  }): Promise<T>;
802
902
  /** Accept an access or ownership offer (POST /api/workspaces/access/offers/accept) */
803
903
  acceptWorkspaceAccessOffer(body: {
804
904
  token: string;
805
- }): Promise<unknown>;
905
+ }): Promise<void>;
806
906
  /** Accept a workspace invitation (POST /api/workspaces/invitations/accept) */
807
907
  acceptWorkspaceInvitation(body: {
808
908
  token: string;
809
- }): Promise<unknown>;
909
+ }): Promise<void>;
810
910
  /** Accept workspace ownership (POST /api/workspaces/ownership-transfers/accept) */
811
911
  acceptWorkspaceOwnershipTransfer(body: {
812
912
  token: string;
813
- }): Promise<unknown>;
913
+ }): Promise<void>;
814
914
  /** Add a private conversation note (POST /api/email/collaboration/{id}/notes) */
815
915
  addConversationNote(id: string, body: {
816
916
  body: string;
@@ -837,7 +937,7 @@ export declare class Domani {
837
937
  match_field: "from" | "to" | "subject" | "body";
838
938
  match_op: "contains" | "equals" | "regex";
839
939
  match_value: string;
840
- action: "drop" | "mark_read" | "forward" | "webhook_only" | "label";
940
+ action: "drop" | "mark_read" | "forward" | "webhook_only" | "label" | "escalate";
841
941
  action_arg?: string;
842
942
  priority?: number;
843
943
  enabled?: boolean;
@@ -856,7 +956,7 @@ export declare class Domani {
856
956
  /** Adopt an owned mailbox into a workspace (POST /api/workspaces/{id}/mailboxes) */
857
957
  attachWorkspaceMailbox(id: string, body: {
858
958
  mailbox_id: string;
859
- }): Promise<unknown>;
959
+ }): Promise<void>;
860
960
  /** Buy an aftermarket domain (POST /api/domains/{domain}/buy-aftermarket) */
861
961
  buyAftermarket(domain: string, body?: {
862
962
  max_price?: number;
@@ -884,7 +984,7 @@ export declare class Domani {
884
984
  years?: number;
885
985
  max_price?: number;
886
986
  ref?: string;
887
- }): Promise<{
987
+ }, paymentSignature?: string): Promise<{
888
988
  domain?: string;
889
989
  status?: "active";
890
990
  expires?: string;
@@ -1080,6 +1180,22 @@ export declare class Domani {
1080
1180
  }): Promise<{
1081
1181
  brief: DomainBrief;
1082
1182
  }>;
1183
+ /** Create an HTTP hostname binding (POST /api/domains/{domain}/hostname-bindings) */
1184
+ createHostnameBinding(domain: string, body: {
1185
+ hostname: string;
1186
+ browser_mode?: "stateless" | "dedicated_site" | "trusted_same_site";
1187
+ expected_zone_version?: string;
1188
+ acknowledgements?: string[];
1189
+ }, idempotencyKey: string): Promise<HostnameBindingReceipt>;
1190
+ /** Publish a leased HTTP route (POST /api/http-routes) */
1191
+ createHttpRoute(body: {
1192
+ hostname?: string;
1193
+ upstream: string;
1194
+ expires_in?: number;
1195
+ host_header?: "public" | "upstream";
1196
+ upstream_verification?: "none" | "signed_headers";
1197
+ upstream_headers?: Record<string, string>;
1198
+ }, idempotencyKey: string): Promise<HttpRouteReceipt>;
1083
1199
  /** List a domain for sale (PUT /api/domains/{domain}/for-sale) */
1084
1200
  createListing(domain: string, body: {
1085
1201
  price: number;
@@ -1180,6 +1296,21 @@ export declare class Domani {
1180
1296
  max_per_tx?: number;
1181
1297
  max_per_month?: number;
1182
1298
  agent_identity_id?: string;
1299
+ http_route_policy?: {
1300
+ hostname_rules: ({
1301
+ domain: string;
1302
+ kind: "exact";
1303
+ hostname: string;
1304
+ } | {
1305
+ domain: string;
1306
+ kind: "subdomain_prefix";
1307
+ prefix: string;
1308
+ })[];
1309
+ max_concurrent?: number;
1310
+ max_lease_seconds?: number;
1311
+ acknowledge_apex_delegation?: boolean;
1312
+ };
1313
+ mailboxes?: string[];
1183
1314
  }): Promise<{
1184
1315
  id?: string;
1185
1316
  name?: string;
@@ -1189,6 +1320,8 @@ export declare class Domani {
1189
1320
  createdAt?: string;
1190
1321
  max_per_tx?: number | null;
1191
1322
  max_per_month?: number | null;
1323
+ mailbox_ids?: string[];
1324
+ http_route_policy?: HttpRoutePolicy | null;
1192
1325
  agent_identity?: {
1193
1326
  id?: string;
1194
1327
  name?: string | null;
@@ -1199,7 +1332,7 @@ export declare class Domani {
1199
1332
  createWebhook(body: {
1200
1333
  url: string;
1201
1334
  events: string[];
1202
- headers?: Record<string, unknown>;
1335
+ headers?: Record<string, string>;
1203
1336
  }): Promise<{
1204
1337
  id?: string;
1205
1338
  url?: string;
@@ -1213,7 +1346,7 @@ export declare class Domani {
1213
1346
  /** Create a workspace (POST /api/workspaces) */
1214
1347
  createWorkspace(body: {
1215
1348
  name: string;
1216
- }): Promise<unknown>;
1349
+ }): Promise<void>;
1217
1350
  /** Offer mailbox access or workspace ownership (POST /api/workspaces/{id}/access/offers) */
1218
1351
  createWorkspaceAccessOffer(id: string, body: {
1219
1352
  email: string;
@@ -1221,7 +1354,7 @@ export declare class Domani {
1221
1354
  ownership_disposition?: "unchanged" | "claim";
1222
1355
  creator_disposition?: "stay" | "stay_admin" | "leave";
1223
1356
  billing_disposition?: "unchanged" | "sponsor" | "transfer";
1224
- }): Promise<unknown>;
1357
+ }): Promise<void>;
1225
1358
  /** Start Mailzero workspace checkout (POST /api/workspaces/{id}/billing/checkout) */
1226
1359
  createWorkspaceCheckout(id: string, body: {
1227
1360
  plan: "mail_solo" | "mail_team" | "mail_business";
@@ -1235,6 +1368,8 @@ export declare class Domani {
1235
1368
  deleted?: boolean;
1236
1369
  hint?: string;
1237
1370
  }>;
1371
+ /** Delete a contact (DELETE /api/contacts/{address}) */
1372
+ deleteContact(address: string): Promise<void>;
1238
1373
  /** Remove a DNSSEC DS record (disable DNSSEC) (DELETE /api/domains/{domain}/dnssec) */
1239
1374
  deleteDnssecRecord(domain: string, query?: {
1240
1375
  keyTag: string;
@@ -1244,10 +1379,18 @@ export declare class Domani {
1244
1379
  enabled?: boolean;
1245
1380
  records?: DsRecord[];
1246
1381
  }>;
1382
+ /** Disable an HTTP hostname binding (DELETE /api/domains/{domain}/hostname-bindings/{id}) */
1383
+ deleteHostnameBinding(domain: string, id: string): Promise<{
1384
+ disabled: boolean;
1385
+ cleanup_pending: boolean;
1386
+ manual_cleanup_records?: DnsRecord[];
1387
+ }>;
1388
+ /** Terminate a route without releasing its hostname claim (DELETE /api/http-routes/{id}) */
1389
+ deleteHttpRoute(id: string): Promise<void>;
1247
1390
  /** Delete a mailbox (DELETE /api/emails/{address}) */
1248
1391
  deleteMailboxByAddress(address: string, body?: {
1249
1392
  confirm?: boolean;
1250
- }): Promise<unknown>;
1393
+ }): Promise<void>;
1251
1394
  /** Delete a message (DELETE /api/emails/{address}/messages/{id}) */
1252
1395
  deleteMessageByAddress(address: string, id: string): Promise<{
1253
1396
  id?: string;
@@ -1257,7 +1400,7 @@ export declare class Domani {
1257
1400
  deleteMessagesByAddress(address: string, body?: {
1258
1401
  message_ids: string[];
1259
1402
  idempotency_key?: string;
1260
- }): Promise<LegacyMailboxOperationReceipt>;
1403
+ }, idempotencyKey?: string): Promise<LegacyMailboxOperationReceipt>;
1261
1404
  /** Delete webhook (DELETE /api/webhooks/{id}) */
1262
1405
  deleteWebhook(id: string): Promise<{
1263
1406
  success?: boolean;
@@ -1272,6 +1415,24 @@ export declare class Domani {
1272
1415
  taken?: string[];
1273
1416
  candidates?: string[];
1274
1417
  }>;
1418
+ /** Flag a message for a human (POST /api/emails/{address}/messages/{id}/escalate) */
1419
+ escalateMessageByAddress(address: string, id: string, body?: {
1420
+ reason?: string;
1421
+ clear?: boolean;
1422
+ }): Promise<{
1423
+ id?: string;
1424
+ needs_human?: boolean;
1425
+ escalation_reason?: string | null;
1426
+ thread_key?: string;
1427
+ }>;
1428
+ /** OAuth token endpoint (POST /api/oauth/token) */
1429
+ exchangeOAuthToken(): Promise<{
1430
+ access_token?: string;
1431
+ token_type?: string;
1432
+ expires_in?: number;
1433
+ refresh_token?: string;
1434
+ scope?: string;
1435
+ }>;
1275
1436
  /** Finalize an agreed negotiation (pay) (POST /api/negotiations/{id}/finalize) */
1276
1437
  finalizeNegotiation(id: string, body?: {
1277
1438
  payment_method?: "card" | "usdc" | "balance";
@@ -1440,7 +1601,7 @@ export declare class Domani {
1440
1601
  }[];
1441
1602
  };
1442
1603
  sending_health: {
1443
- recipients?: Record<string, unknown>;
1604
+ recipients?: Record<string, number>;
1444
1605
  rates?: {
1445
1606
  bounce?: number;
1446
1607
  complaint?: number;
@@ -1466,6 +1627,14 @@ export declare class Domani {
1466
1627
  })[];
1467
1628
  caveats?: string[];
1468
1629
  }>;
1630
+ /** Get an HTTP hostname binding (GET /api/domains/{domain}/hostname-bindings/{id}) */
1631
+ getHostnameBinding(domain: string, id: string): Promise<{
1632
+ hostname_binding: HostnameBinding;
1633
+ }>;
1634
+ /** Get a leased HTTP route (GET /api/http-routes/{id}) */
1635
+ getHttpRoute(id: string): Promise<{
1636
+ http_route: HttpRoute;
1637
+ }>;
1469
1638
  /** Get mailbox avatar info (GET /api/emails/{address}/avatar) */
1470
1639
  getMailboxAvatarByAddress(address: string): Promise<{
1471
1640
  address?: string;
@@ -1656,7 +1825,7 @@ export declare class Domani {
1656
1825
  /** Get workspace members and mailboxes (GET /api/workspaces/{id}) */
1657
1826
  getWorkspace(id: string): Promise<WorkspaceDetail>;
1658
1827
  /** Get the canonical workspace access graph (GET /api/workspaces/{id}/access) */
1659
- getWorkspaceAccess(id: string): Promise<unknown>;
1828
+ getWorkspaceAccess(id: string): Promise<void>;
1660
1829
  /** Heartbeat viewing or composing presence (PUT /api/email/collaboration/coordination) */
1661
1830
  heartbeatConversationPresence(body: {
1662
1831
  mailbox_id: string;
@@ -1686,9 +1855,9 @@ export declare class Domani {
1686
1855
  role?: "admin" | "member";
1687
1856
  mailbox_ids?: string[];
1688
1857
  mailbox_role?: "viewer" | "responder" | "manager";
1689
- }): Promise<unknown>;
1858
+ }): Promise<void>;
1690
1859
  /** Leave a workspace (DELETE /api/workspaces/{id}/members/me) */
1691
- leaveWorkspace(id: string): Promise<unknown>;
1860
+ leaveWorkspace(id: string): Promise<void>;
1692
1861
  /** List security audit events (GET /api/audit) */
1693
1862
  listAuditEvents(query?: {
1694
1863
  limit?: number;
@@ -1727,6 +1896,24 @@ export declare class Domani {
1727
1896
  email?: Record<string, unknown>[];
1728
1897
  };
1729
1898
  }>;
1899
+ /** List contacts (GET /api/contacts) */
1900
+ listContacts(query?: {
1901
+ q?: string;
1902
+ limit?: number;
1903
+ cursor?: string;
1904
+ }): Promise<{
1905
+ contacts?: ({
1906
+ address?: string;
1907
+ name?: string | null;
1908
+ notes?: string | null;
1909
+ source?: "auto" | "manual";
1910
+ message_count?: number;
1911
+ first_seen_at?: string;
1912
+ last_seen_at?: string;
1913
+ last_direction?: string | null;
1914
+ })[];
1915
+ next_cursor?: string | null;
1916
+ }>;
1730
1917
  /** List attributed conversation activity (GET /api/email/collaboration/{id}/activity) */
1731
1918
  listConversationActivity(id: string): Promise<{
1732
1919
  activity: MailActivity[];
@@ -1778,7 +1965,7 @@ export declare class Domani {
1778
1965
  unread?: number;
1779
1966
  })[];
1780
1967
  views?: ({
1781
- id?: "starred" | "all";
1968
+ id?: "starred" | "all" | "needs_human";
1782
1969
  total?: number;
1783
1970
  unread?: number;
1784
1971
  })[];
@@ -1790,7 +1977,7 @@ export declare class Domani {
1790
1977
  limit?: number;
1791
1978
  direction?: "in" | "out" | "all";
1792
1979
  folder?: "inbox" | "archive" | "sent" | "spam" | "trash";
1793
- view?: "starred" | "all";
1980
+ view?: "starred" | "all" | "needs_human";
1794
1981
  since?: string;
1795
1982
  from?: string;
1796
1983
  to?: string;
@@ -1809,6 +1996,10 @@ export declare class Domani {
1809
1996
  folder?: "inbox" | "archive" | "sent" | "spam" | "trash";
1810
1997
  read?: boolean;
1811
1998
  starred?: boolean;
1999
+ needs_human?: boolean;
2000
+ escalation_reason?: string | null;
2001
+ remind_at?: string | null;
2002
+ reminder_note?: string | null;
1812
2003
  answered?: boolean;
1813
2004
  forwarded?: boolean;
1814
2005
  spam_detected?: boolean;
@@ -1828,6 +2019,21 @@ export declare class Domani {
1828
2019
  })[];
1829
2020
  next_cursor?: string | null;
1830
2021
  }>;
2022
+ /** List HTTP hostname bindings (GET /api/domains/{domain}/hostname-bindings) */
2023
+ listHostnameBindings(domain: string): Promise<{
2024
+ hostname_bindings: HostnameBinding[];
2025
+ }>;
2026
+ /** List visible leased HTTP routes (GET /api/http-routes) */
2027
+ listHttpRoutes(query?: {
2028
+ domain?: string;
2029
+ hostname?: string;
2030
+ status?: "active" | "expired" | "deleted" | "suspended" | "all";
2031
+ limit?: number;
2032
+ cursor?: string;
2033
+ }): Promise<{
2034
+ http_routes: HttpRoute[];
2035
+ next_cursor: string | null;
2036
+ }>;
1831
2037
  /** List your agent identities (GET /api/agents/identity) */
1832
2038
  listIdentities(): Promise<{
1833
2039
  identities?: AgentIdentity[];
@@ -2063,7 +2269,7 @@ export declare class Domani {
2063
2269
  message_ids: string[];
2064
2270
  read: boolean;
2065
2271
  idempotency_key?: string;
2066
- }): Promise<LegacyMailboxOperationReceipt>;
2272
+ }, idempotencyKey?: string): Promise<LegacyMailboxOperationReceipt>;
2067
2273
  /** Mark notification as read (PATCH /api/notifications/{id}) */
2068
2274
  markNotificationRead(id: string, body: {
2069
2275
  read: boolean;
@@ -2087,6 +2293,7 @@ export declare class Domani {
2087
2293
  nameservers: string[];
2088
2294
  dns_provider: string;
2089
2295
  dnssec_enabled: boolean;
2296
+ checked_at: string | null;
2090
2297
  };
2091
2298
  options: {
2092
2299
  connect?: {
@@ -2111,6 +2318,12 @@ export declare class Domani {
2111
2318
  reason?: string;
2112
2319
  code?: string;
2113
2320
  eligible_at?: string;
2321
+ guidance?: {
2322
+ managed_via: string;
2323
+ unlock: string;
2324
+ auth_code: string;
2325
+ notes: string[];
2326
+ };
2114
2327
  next_action?: {
2115
2328
  method?: string;
2116
2329
  path?: string;
@@ -2120,6 +2333,11 @@ export declare class Domani {
2120
2333
  invariants: string[];
2121
2334
  warnings: string[];
2122
2335
  }>;
2336
+ /** Plan an HTTP hostname binding (POST /api/domains/{domain}/hostname-bindings/plan) */
2337
+ planHostnameBinding(domain: string, body: {
2338
+ hostname: string;
2339
+ browser_mode?: "stateless" | "dedicated_site" | "trusted_same_site";
2340
+ }): Promise<HostnameBindingPlan>;
2123
2341
  /** Provide EPP/auth code (seller) (PATCH /api/deals/{id}) */
2124
2342
  provideEppCode(id: string, body: {
2125
2343
  auth_code: string;
@@ -2142,11 +2360,32 @@ export declare class Domani {
2142
2360
  payment_tx?: string;
2143
2361
  payment_chain?: "base" | "ethereum";
2144
2362
  years?: number;
2145
- }): Promise<ProvisionAgentResult>;
2363
+ }, paymentSignature?: string): Promise<ProvisionAgentResult>;
2146
2364
  /** Refresh a domain brief from live sources (POST /api/domain-briefs/{id}/refresh) */
2147
2365
  refreshDomainBrief(id: string): Promise<{
2148
2366
  brief: DomainBrief;
2149
2367
  }>;
2368
+ /** Refresh a route lease (PATCH /api/http-routes/{id}) */
2369
+ refreshHttpRoute(id: string, body: {
2370
+ expires_in: number;
2371
+ }, idempotencyKey: string): Promise<HttpRouteReceipt>;
2372
+ /** Register an OAuth client (RFC 7591) (POST /api/oauth/register) */
2373
+ registerOAuthClient(body: {
2374
+ redirect_uris: string[];
2375
+ client_name?: string;
2376
+ token_endpoint_auth_method?: "none" | "client_secret_post" | "client_secret_basic";
2377
+ client_uri?: string;
2378
+ logo_uri?: string;
2379
+ }): Promise<{
2380
+ client_id?: string;
2381
+ client_name?: string;
2382
+ redirect_uris?: string[];
2383
+ token_endpoint_auth_method?: string;
2384
+ grant_types?: string[];
2385
+ response_types?: string[];
2386
+ client_id_issued_at?: number;
2387
+ client_secret?: string;
2388
+ }>;
2150
2389
  /** Create a new account (POST /api/auth/register) */
2151
2390
  registerUser(body: {
2152
2391
  email: string;
@@ -2178,7 +2417,7 @@ export declare class Domani {
2178
2417
  removed?: boolean;
2179
2418
  }>;
2180
2419
  /** Remove email from a domain (DELETE /api/domains/{domain}/email/setup) */
2181
- removeDomainEmail(domain: string): Promise<unknown>;
2420
+ removeDomainEmail(domain: string): Promise<void>;
2182
2421
  /** Remove a mailbox alias (DELETE /api/emails/{address}/aliases/{alias}) */
2183
2422
  removeMailboxAlias(address: string, alias: string): Promise<{
2184
2423
  address?: string;
@@ -2188,7 +2427,7 @@ export declare class Domani {
2188
2427
  /** Remove a member mailbox permission (DELETE /api/workspaces/{id}/mailboxes/{mailboxId}/grants) */
2189
2428
  removeMailboxGrant(id: string, mailboxId: string, body: {
2190
2429
  membership_id: string;
2191
- }): Promise<unknown>;
2430
+ }): Promise<void>;
2192
2431
  /** Remove mailbox webhook (DELETE /api/emails/{address}/webhook) */
2193
2432
  removeMailboxWebhook(address: string): Promise<{
2194
2433
  address?: string;
@@ -2211,7 +2450,7 @@ export declare class Domani {
2211
2450
  hint?: string;
2212
2451
  }>;
2213
2452
  /** Remove a workspace member (DELETE /api/workspaces/{id}/members/{membershipId}) */
2214
- removeWorkspaceMember(id: string, membershipId: string): Promise<unknown>;
2453
+ removeWorkspaceMember(id: string, membershipId: string): Promise<void>;
2215
2454
  /** Renew a domain (POST /api/domains/{domain}/renew) */
2216
2455
  renewDomain(domain: string, body?: {
2217
2456
  years?: number;
@@ -2256,7 +2495,7 @@ export declare class Domani {
2256
2495
  lease_id: string;
2257
2496
  expected_reply_version: number;
2258
2497
  };
2259
- }): Promise<{
2498
+ }, idempotencyKey?: string): Promise<{
2260
2499
  id?: string;
2261
2500
  message_id?: string;
2262
2501
  from?: string;
@@ -2267,7 +2506,7 @@ export declare class Domani {
2267
2506
  /** Request a workspace ownership transfer (POST /api/workspaces/{id}/ownership-transfer) */
2268
2507
  requestWorkspaceOwnershipTransfer(id: string, body: {
2269
2508
  membership_id: string;
2270
- }): Promise<unknown>;
2509
+ }): Promise<void>;
2271
2510
  /** Research or refresh a public domain profile (POST /api/domains/{domain}/profile) */
2272
2511
  researchPublicDomainProfile(domain: string, query?: {
2273
2512
  depth?: "instant" | "deep";
@@ -2334,11 +2573,17 @@ export declare class Domani {
2334
2573
  /** Revoke an access grant and its credentials (DELETE /api/workspaces/{id}/access/grants/{grantId}) */
2335
2574
  revokeWorkspaceAccess(id: string, grantId: string, body?: {
2336
2575
  expected_version?: number;
2337
- }): Promise<unknown>;
2576
+ }): Promise<void>;
2338
2577
  /** Revoke a pending invitation (DELETE /api/workspaces/{id}/invitations/{invitationId}) */
2339
- revokeWorkspaceInvitation(id: string, invitationId: string): Promise<unknown>;
2578
+ revokeWorkspaceInvitation(id: string, invitationId: string): Promise<void>;
2340
2579
  /** Revoke a pending ownership transfer (DELETE /api/workspaces/{id}/ownership-transfer/{transferId}) */
2341
- revokeWorkspaceOwnershipTransfer(id: string, transferId: string): Promise<unknown>;
2580
+ revokeWorkspaceOwnershipTransfer(id: string, transferId: string): Promise<void>;
2581
+ /** Replace write-only upstream authentication headers (PUT /api/http-routes/{id}/upstream-headers) */
2582
+ rotateHttpRouteUpstreamHeaders(id: string, body: {
2583
+ upstream_headers: Record<string, string>;
2584
+ }, idempotencyKey: string): Promise<HttpRouteHeadersReceipt>;
2585
+ /** Rotate the upstream verification secret (POST /api/http-routes/{id}/upstream-verification/rotate) */
2586
+ rotateHttpRouteUpstreamVerification(id: string, idempotencyKey: string): Promise<HttpRouteVerificationReceipt>;
2342
2587
  /** Rotate webhook signing secret (POST /api/emails/{address}/webhook/rotate) */
2343
2588
  rotateMailboxWebhookSecret(address: string): Promise<{
2344
2589
  address?: string;
@@ -2390,6 +2635,7 @@ export declare class Domani {
2390
2635
  in_reply_to?: string;
2391
2636
  references?: string;
2392
2637
  idempotency_key?: string;
2638
+ send_at?: string;
2393
2639
  coordination?: {
2394
2640
  thread_key: string;
2395
2641
  client_id: string;
@@ -2402,7 +2648,7 @@ export declare class Domani {
2402
2648
  filename: string;
2403
2649
  content_type?: string;
2404
2650
  }[];
2405
- }): Promise<{
2651
+ }, idempotencyKey?: string): Promise<{
2406
2652
  id?: string;
2407
2653
  message_id?: string;
2408
2654
  from?: string;
@@ -2446,11 +2692,11 @@ export declare class Domani {
2446
2692
  setMailboxGrant(id: string, mailboxId: string, body: {
2447
2693
  membership_id: string;
2448
2694
  role: "viewer" | "responder" | "manager";
2449
- }): Promise<unknown>;
2695
+ }): Promise<void>;
2450
2696
  /** Set mailbox webhook (PUT /api/emails/{address}/webhook) */
2451
2697
  setMailboxWebhook(address: string, body: {
2452
2698
  url: string;
2453
- headers?: Record<string, unknown>;
2699
+ headers?: Record<string, string>;
2454
2700
  }): Promise<{
2455
2701
  address?: string;
2456
2702
  webhook_url?: string;
@@ -2459,6 +2705,16 @@ export declare class Domani {
2459
2705
  header_names?: string[];
2460
2706
  hint?: string;
2461
2707
  }>;
2708
+ /** Set a follow-up reminder (POST /api/emails/{address}/messages/{id}/remind) */
2709
+ setMessageReminderByAddress(address: string, id: string, body?: {
2710
+ remind_at?: string;
2711
+ note?: string;
2712
+ clear?: boolean;
2713
+ }): Promise<{
2714
+ id?: string;
2715
+ remind_at?: string | null;
2716
+ reminder_note?: string | null;
2717
+ }>;
2462
2718
  /** Set nameservers for a domain (PUT /api/domains/{domain}/nameservers) */
2463
2719
  setNameservers(domain: string, body: {
2464
2720
  nameservers: string[];
@@ -2503,7 +2759,7 @@ export declare class Domani {
2503
2759
  };
2504
2760
  expected_version?: number;
2505
2761
  reason?: string;
2506
- }): Promise<unknown>;
2762
+ }): Promise<void>;
2507
2763
  /** Capture a DNS snapshot (POST /api/domains/{domain}/dns/snapshot) */
2508
2764
  snapshotDns(domain: string, body?: {
2509
2765
  extra_subdomains?: string[];
@@ -2545,14 +2801,14 @@ export declare class Domani {
2545
2801
  id: string;
2546
2802
  label: string;
2547
2803
  })[];
2548
- }): Promise<unknown>;
2804
+ }): Promise<void>;
2549
2805
  /** Create or replace an explicit mailbox collection (PUT /api/workspaces/{id}/access/collections) */
2550
2806
  syncMailboxCollection(id: string, body: {
2551
2807
  id?: string;
2552
2808
  name: string;
2553
2809
  description?: string | null;
2554
2810
  mailbox_ids: string[];
2555
- }): Promise<unknown>;
2811
+ }): Promise<void>;
2556
2812
  /** Test mailbox webhook (POST /api/emails/{address}/webhook/test) */
2557
2813
  testMailboxWebhook(address: string): Promise<{
2558
2814
  address?: string;
@@ -2569,7 +2825,29 @@ export declare class Domani {
2569
2825
  payment_tx?: string;
2570
2826
  payment_chain?: "base" | "ethereum";
2571
2827
  extra_subdomains?: string[];
2572
- }): Promise<unknown>;
2828
+ }): Promise<{
2829
+ domain: string;
2830
+ status: "pending" | "active";
2831
+ expires: string;
2832
+ price: number;
2833
+ currency: string;
2834
+ payment_method: string;
2835
+ payment_tx?: string;
2836
+ auto_renew?: boolean;
2837
+ hint: string;
2838
+ dns_snapshot?: {
2839
+ record_count?: number;
2840
+ subdomain_count?: number;
2841
+ };
2842
+ nameservers_preserved: true;
2843
+ dns_migration: "not_requested";
2844
+ continuity: {
2845
+ nameservers?: string[];
2846
+ dns_provider?: string;
2847
+ dnssec_enabled?: boolean;
2848
+ verification_status?: "verified" | "repaired" | "degraded" | "unknown";
2849
+ };
2850
+ }>;
2573
2851
  /** Update account preferences (PUT /api/me) */
2574
2852
  updateAccount(body: {
2575
2853
  preferred_payment_method?: "card" | "usdc" | null;
@@ -2619,7 +2897,12 @@ export declare class Domani {
2619
2897
  read?: boolean;
2620
2898
  starred?: boolean;
2621
2899
  idempotency_key?: string;
2622
- }): Promise<MailboxOperationReceipt>;
2900
+ }, idempotencyKey?: string): Promise<MailboxOperationReceipt>;
2901
+ /** Update binding browser mode (PATCH /api/domains/{domain}/hostname-bindings/{id}) */
2902
+ updateHostnameBinding(domain: string, id: string, body: {
2903
+ browser_mode: "stateless" | "dedicated_site" | "trusted_same_site";
2904
+ acknowledgements?: string[];
2905
+ }, idempotencyKey: string): Promise<HostnameBindingReceipt>;
2623
2906
  /** Update an agent identity (PATCH /api/agents/identity/{slug}) */
2624
2907
  updateIdentity(slug: string, body: {
2625
2908
  name?: string;
@@ -2653,6 +2936,7 @@ export declare class Domani {
2653
2936
  webhook_url?: string | null;
2654
2937
  forward_to?: string | null;
2655
2938
  drop_spam?: boolean;
2939
+ tone_notes?: string | null;
2656
2940
  }): Promise<{
2657
2941
  id?: string;
2658
2942
  address?: string;
@@ -2661,6 +2945,7 @@ export declare class Domani {
2661
2945
  name?: string | null;
2662
2946
  webhook_url?: string | null;
2663
2947
  forward_to?: string | null;
2948
+ tone_notes?: string | null;
2664
2949
  signing_secret?: string;
2665
2950
  }>;
2666
2951
  /** Update notification preferences (PUT /api/notifications/preferences) */
@@ -2689,7 +2974,7 @@ export declare class Domani {
2689
2974
  url?: string;
2690
2975
  events?: string[];
2691
2976
  active?: boolean;
2692
- headers?: Record<string, unknown>;
2977
+ headers?: Record<string, string>;
2693
2978
  }): Promise<{
2694
2979
  id?: string;
2695
2980
  url?: string;
@@ -2701,11 +2986,17 @@ export declare class Domani {
2701
2986
  /** Rename a workspace (PATCH /api/workspaces/{id}) */
2702
2987
  updateWorkspace(id: string, body: {
2703
2988
  name: string;
2704
- }): Promise<unknown>;
2989
+ }): Promise<void>;
2705
2990
  /** Change a member role (PATCH /api/workspaces/{id}/members/{membershipId}) */
2706
2991
  updateWorkspaceMember(id: string, membershipId: string, body: {
2707
2992
  role: "admin" | "member";
2708
- }): Promise<unknown>;
2993
+ }): Promise<void>;
2994
+ /** Create or update a contact (POST /api/contacts) */
2995
+ upsertContact(body: {
2996
+ address: string;
2997
+ name?: string | null;
2998
+ notes?: string | null;
2999
+ }): Promise<void>;
2709
3000
  /** Verify that a provider connection is working (POST /api/domains/{domain}/verify) */
2710
3001
  verifyConnection(domain: string, body: {
2711
3002
  target?: string;
@@ -2720,6 +3011,11 @@ export declare class Domani {
2720
3011
  hint?: string;
2721
3012
  next_steps?: string[];
2722
3013
  }>;
3014
+ /** Verify binding DNS and certificate (POST /api/domains/{domain}/hostname-bindings/{id}/verify) */
3015
+ verifyHostnameBinding(domain: string, id: string): Promise<{
3016
+ hostname_binding: HostnameBinding;
3017
+ pending: boolean;
3018
+ }>;
2723
3019
  /** Verify and complete domain import (POST /api/domains/import/verify) */
2724
3020
  verifyImport(body: {
2725
3021
  domain: string;
@@ -2734,7 +3030,7 @@ export declare class Domani {
2734
3030
  /** Verify a magic link token (GET /api/auth/verify) */
2735
3031
  verifyMagicLink(query?: {
2736
3032
  token: string;
2737
- }): Promise<unknown>;
3033
+ }): Promise<void>;
2738
3034
  /** Verify TXT ownership for external listing (POST /api/domains/sell/verify) */
2739
3035
  verifySellListing(body: {
2740
3036
  domain: string;
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";
@@ -113,8 +117,8 @@ class Domani {
113
117
  return this.request("POST", `/api/domains/${enc(domain)}/buy-aftermarket`, { body });
114
118
  }
115
119
  /** Purchase one or more domains (POST /api/domains/buy) */
116
- buyDomain(body) {
117
- return this.request("POST", `/api/domains/buy`, { body });
120
+ buyDomain(body, paymentSignature) {
121
+ return this.request("POST", `/api/domains/buy`, { body, headers: { "PAYMENT-SIGNATURE": paymentSignature } });
118
122
  }
119
123
  /** Cancel a backorder (DELETE /api/backorders/{id}) */
120
124
  cancelBackorder(id) {
@@ -188,6 +192,14 @@ class Domani {
188
192
  createDomainBrief(body) {
189
193
  return this.request("POST", `/api/domain-briefs`, { body });
190
194
  }
195
+ /** Create an HTTP hostname binding (POST /api/domains/{domain}/hostname-bindings) */
196
+ createHostnameBinding(domain, body, idempotencyKey) {
197
+ return this.request("POST", `/api/domains/${enc(domain)}/hostname-bindings`, { body, headers: { "Idempotency-Key": idempotencyKey } });
198
+ }
199
+ /** Publish a leased HTTP route (POST /api/http-routes) */
200
+ createHttpRoute(body, idempotencyKey) {
201
+ return this.request("POST", `/api/http-routes`, { body, headers: { "Idempotency-Key": idempotencyKey } });
202
+ }
191
203
  /** List a domain for sale (PUT /api/domains/{domain}/for-sale) */
192
204
  createListing(domain, body) {
193
205
  return this.request("PUT", `/api/domains/${enc(domain)}/for-sale`, { body });
@@ -228,10 +240,22 @@ class Domani {
228
240
  deleteAccount() {
229
241
  return this.request("DELETE", `/api/me`, undefined);
230
242
  }
243
+ /** Delete a contact (DELETE /api/contacts/{address}) */
244
+ deleteContact(address) {
245
+ return this.request("DELETE", `/api/contacts/${enc(address)}`, undefined);
246
+ }
231
247
  /** Remove a DNSSEC DS record (disable DNSSEC) (DELETE /api/domains/{domain}/dnssec) */
232
248
  deleteDnssecRecord(domain, query) {
233
249
  return this.request("DELETE", `/api/domains/${enc(domain)}/dnssec`, { query });
234
250
  }
251
+ /** Disable an HTTP hostname binding (DELETE /api/domains/{domain}/hostname-bindings/{id}) */
252
+ deleteHostnameBinding(domain, id) {
253
+ return this.request("DELETE", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}`, undefined);
254
+ }
255
+ /** Terminate a route without releasing its hostname claim (DELETE /api/http-routes/{id}) */
256
+ deleteHttpRoute(id) {
257
+ return this.request("DELETE", `/api/http-routes/${enc(id)}`, undefined);
258
+ }
235
259
  /** Delete a mailbox (DELETE /api/emails/{address}) */
236
260
  deleteMailboxByAddress(address, body) {
237
261
  return this.request("DELETE", `/api/emails/${enc(address)}`, { body });
@@ -241,8 +265,8 @@ class Domani {
241
265
  return this.request("DELETE", `/api/emails/${enc(address)}/messages/${enc(id)}`, undefined);
242
266
  }
243
267
  /** 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 });
268
+ deleteMessagesByAddress(address, body, idempotencyKey) {
269
+ return this.request("POST", `/api/emails/${enc(address)}/messages/delete`, { body, headers: { "Idempotency-Key": idempotencyKey } });
246
270
  }
247
271
  /** Delete webhook (DELETE /api/webhooks/{id}) */
248
272
  deleteWebhook(id) {
@@ -252,6 +276,14 @@ class Domani {
252
276
  dnsCheck(query) {
253
277
  return this.request("GET", `/api/domains/dns-check`, { query });
254
278
  }
279
+ /** Flag a message for a human (POST /api/emails/{address}/messages/{id}/escalate) */
280
+ escalateMessageByAddress(address, id, body) {
281
+ return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/escalate`, { body });
282
+ }
283
+ /** OAuth token endpoint (POST /api/oauth/token) */
284
+ exchangeOAuthToken() {
285
+ return this.request("POST", `/api/oauth/token`, undefined);
286
+ }
255
287
  /** Finalize an agreed negotiation (pay) (POST /api/negotiations/{id}/finalize) */
256
288
  finalizeNegotiation(id, body) {
257
289
  return this.request("POST", `/api/negotiations/${enc(id)}/finalize`, { body });
@@ -332,6 +364,14 @@ class Domani {
332
364
  getEmailDeliverability(domain) {
333
365
  return this.request("GET", `/api/domains/${enc(domain)}/email/deliverability`, undefined);
334
366
  }
367
+ /** Get an HTTP hostname binding (GET /api/domains/{domain}/hostname-bindings/{id}) */
368
+ getHostnameBinding(domain, id) {
369
+ return this.request("GET", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}`, undefined);
370
+ }
371
+ /** Get a leased HTTP route (GET /api/http-routes/{id}) */
372
+ getHttpRoute(id) {
373
+ return this.request("GET", `/api/http-routes/${enc(id)}`, undefined);
374
+ }
335
375
  /** Get mailbox avatar info (GET /api/emails/{address}/avatar) */
336
376
  getMailboxAvatarByAddress(address) {
337
377
  return this.request("GET", `/api/emails/${enc(address)}/avatar`, undefined);
@@ -436,6 +476,10 @@ class Domani {
436
476
  listConnectProviders(domain) {
437
477
  return this.request("GET", `/api/domains/${enc(domain)}/connect`, undefined);
438
478
  }
479
+ /** List contacts (GET /api/contacts) */
480
+ listContacts(query) {
481
+ return this.request("GET", `/api/contacts`, { query });
482
+ }
439
483
  /** List attributed conversation activity (GET /api/email/collaboration/{id}/activity) */
440
484
  listConversationActivity(id) {
441
485
  return this.request("GET", `/api/email/collaboration/${enc(id)}/activity`, undefined);
@@ -464,6 +508,14 @@ class Domani {
464
508
  listEmailMessagesByAddress(address, query) {
465
509
  return this.request("GET", `/api/emails/${enc(address)}/messages`, { query });
466
510
  }
511
+ /** List HTTP hostname bindings (GET /api/domains/{domain}/hostname-bindings) */
512
+ listHostnameBindings(domain) {
513
+ return this.request("GET", `/api/domains/${enc(domain)}/hostname-bindings`, undefined);
514
+ }
515
+ /** List visible leased HTTP routes (GET /api/http-routes) */
516
+ listHttpRoutes(query) {
517
+ return this.request("GET", `/api/http-routes`, { query });
518
+ }
467
519
  /** List your agent identities (GET /api/agents/identity) */
468
520
  listIdentities() {
469
521
  return this.request("GET", `/api/agents/identity`, undefined);
@@ -549,8 +601,8 @@ class Domani {
549
601
  return this.request("POST", `/api/notifications/read-all`, undefined);
550
602
  }
551
603
  /** 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 });
604
+ markMessagesReadByAddress(address, body, idempotencyKey) {
605
+ return this.request("PATCH", `/api/emails/${enc(address)}/messages/read`, { body, headers: { "Idempotency-Key": idempotencyKey } });
554
606
  }
555
607
  /** Mark notification as read (PATCH /api/notifications/{id}) */
556
608
  markNotificationRead(id, body) {
@@ -560,18 +612,30 @@ class Domani {
560
612
  planDomainAdoption(query) {
561
613
  return this.request("GET", `/api/domains/adoption-plan`, { query });
562
614
  }
615
+ /** Plan an HTTP hostname binding (POST /api/domains/{domain}/hostname-bindings/plan) */
616
+ planHostnameBinding(domain, body) {
617
+ return this.request("POST", `/api/domains/${enc(domain)}/hostname-bindings/plan`, { body });
618
+ }
563
619
  /** Provide EPP/auth code (seller) (PATCH /api/deals/{id}) */
564
620
  provideEppCode(id, body) {
565
621
  return this.request("PATCH", `/api/deals/${enc(id)}`, { body });
566
622
  }
567
623
  /** Provision a complete agent identity in one call (POST /api/agents/provision) */
568
- provisionAgent(body) {
569
- return this.request("POST", `/api/agents/provision`, { body });
624
+ provisionAgent(body, paymentSignature) {
625
+ return this.request("POST", `/api/agents/provision`, { body, headers: { "PAYMENT-SIGNATURE": paymentSignature } });
570
626
  }
571
627
  /** Refresh a domain brief from live sources (POST /api/domain-briefs/{id}/refresh) */
572
628
  refreshDomainBrief(id) {
573
629
  return this.request("POST", `/api/domain-briefs/${enc(id)}/refresh`, undefined);
574
630
  }
631
+ /** Refresh a route lease (PATCH /api/http-routes/{id}) */
632
+ refreshHttpRoute(id, body, idempotencyKey) {
633
+ return this.request("PATCH", `/api/http-routes/${enc(id)}`, { body, headers: { "Idempotency-Key": idempotencyKey } });
634
+ }
635
+ /** Register an OAuth client (RFC 7591) (POST /api/oauth/register) */
636
+ registerOAuthClient(body) {
637
+ return this.request("POST", `/api/oauth/register`, { body });
638
+ }
575
639
  /** Create a new account (POST /api/auth/register) */
576
640
  registerUser(body) {
577
641
  return this.request("POST", `/api/auth/register`, { body });
@@ -625,8 +689,8 @@ class Domani {
625
689
  return this.request("POST", `/api/webhooks/${enc(id)}/deliveries/${enc(deliveryId)}/replay`, { body });
626
690
  }
627
691
  /** 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 });
692
+ replyToMessageByAddress(address, id, body, idempotencyKey) {
693
+ return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/reply`, { body, headers: { "Idempotency-Key": idempotencyKey } });
630
694
  }
631
695
  /** Request a workspace ownership transfer (POST /api/workspaces/{id}/ownership-transfer) */
632
696
  requestWorkspaceOwnershipTransfer(id, body) {
@@ -672,6 +736,14 @@ class Domani {
672
736
  revokeWorkspaceOwnershipTransfer(id, transferId) {
673
737
  return this.request("DELETE", `/api/workspaces/${enc(id)}/ownership-transfer/${enc(transferId)}`, undefined);
674
738
  }
739
+ /** Replace write-only upstream authentication headers (PUT /api/http-routes/{id}/upstream-headers) */
740
+ rotateHttpRouteUpstreamHeaders(id, body, idempotencyKey) {
741
+ return this.request("PUT", `/api/http-routes/${enc(id)}/upstream-headers`, { body, headers: { "Idempotency-Key": idempotencyKey } });
742
+ }
743
+ /** Rotate the upstream verification secret (POST /api/http-routes/{id}/upstream-verification/rotate) */
744
+ rotateHttpRouteUpstreamVerification(id, idempotencyKey) {
745
+ return this.request("POST", `/api/http-routes/${enc(id)}/upstream-verification/rotate`, { headers: { "Idempotency-Key": idempotencyKey } });
746
+ }
675
747
  /** Rotate webhook signing secret (POST /api/emails/{address}/webhook/rotate) */
676
748
  rotateMailboxWebhookSecret(address) {
677
749
  return this.request("POST", `/api/emails/${enc(address)}/webhook/rotate`, undefined);
@@ -685,8 +757,8 @@ class Domani {
685
757
  return this.request("POST", `/api/domains/sell`, { body });
686
758
  }
687
759
  /** Send an email (POST /api/emails/{address}/send) */
688
- sendEmailByAddress(address, body) {
689
- return this.request("POST", `/api/emails/${enc(address)}/send`, { body });
760
+ sendEmailByAddress(address, body, idempotencyKey) {
761
+ return this.request("POST", `/api/emails/${enc(address)}/send`, { body, headers: { "Idempotency-Key": idempotencyKey } });
690
762
  }
691
763
  /** Set domain catch-all (PUT /api/domains/{domain}/email/catch-all) */
692
764
  setCatchAll(domain, body) {
@@ -712,6 +784,10 @@ class Domani {
712
784
  setMailboxWebhook(address, body) {
713
785
  return this.request("PUT", `/api/emails/${enc(address)}/webhook`, { body });
714
786
  }
787
+ /** Set a follow-up reminder (POST /api/emails/{address}/messages/{id}/remind) */
788
+ setMessageReminderByAddress(address, id, body) {
789
+ return this.request("POST", `/api/emails/${enc(address)}/messages/${enc(id)}/remind`, { body });
790
+ }
715
791
  /** Set nameservers for a domain (PUT /api/domains/{domain}/nameservers) */
716
792
  setNameservers(domain, body) {
717
793
  return this.request("PUT", `/api/domains/${enc(domain)}/nameservers`, { body });
@@ -773,8 +849,12 @@ class Domani {
773
849
  return this.request("PUT", `/api/domains/${enc(domain)}/settings`, { body });
774
850
  }
775
851
  /** 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 });
852
+ updateEmailMessagesByAddress(address, body, idempotencyKey) {
853
+ return this.request("POST", `/api/emails/${enc(address)}/messages/actions`, { body, headers: { "Idempotency-Key": idempotencyKey } });
854
+ }
855
+ /** Update binding browser mode (PATCH /api/domains/{domain}/hostname-bindings/{id}) */
856
+ updateHostnameBinding(domain, id, body, idempotencyKey) {
857
+ return this.request("PATCH", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}`, { body, headers: { "Idempotency-Key": idempotencyKey } });
778
858
  }
779
859
  /** Update an agent identity (PATCH /api/agents/identity/{slug}) */
780
860
  updateIdentity(slug, body) {
@@ -808,10 +888,18 @@ class Domani {
808
888
  updateWorkspaceMember(id, membershipId, body) {
809
889
  return this.request("PATCH", `/api/workspaces/${enc(id)}/members/${enc(membershipId)}`, { body });
810
890
  }
891
+ /** Create or update a contact (POST /api/contacts) */
892
+ upsertContact(body) {
893
+ return this.request("POST", `/api/contacts`, { body });
894
+ }
811
895
  /** Verify that a provider connection is working (POST /api/domains/{domain}/verify) */
812
896
  verifyConnection(domain, body) {
813
897
  return this.request("POST", `/api/domains/${enc(domain)}/verify`, { body });
814
898
  }
899
+ /** Verify binding DNS and certificate (POST /api/domains/{domain}/hostname-bindings/{id}/verify) */
900
+ verifyHostnameBinding(domain, id) {
901
+ return this.request("POST", `/api/domains/${enc(domain)}/hostname-bindings/${enc(id)}/verify`, undefined);
902
+ }
815
903
  /** Verify and complete domain import (POST /api/domains/import/verify) */
816
904
  verifyImport(body) {
817
905
  return this.request("POST", `/api/domains/import/verify`, { body });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domani",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Official TypeScript SDK for the domani API - domains, email, and identity for AI agents.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",