domani 1.0.4 → 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 +344 -43
  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;
@@ -740,6 +839,9 @@ export interface AccountInfo {
740
839
  workspace_plans: string[];
741
840
  /** Whether the user has a card on file (required before buying domains) */
742
841
  has_payment_method: boolean;
842
+ preferred_payment_method: "card" | "usdc" | null;
843
+ /** Locale used by Domani interfaces and transactional communications */
844
+ preferred_locale: "en" | "fr" | "es" | "pt-BR" | "ja" | "zh-Hans" | "it";
743
845
  /** Whether the user has set WHOIS contact info (required before purchasing domains) */
744
846
  has_contact: boolean;
745
847
  /** Registrant contact info (null if not set) */
@@ -795,19 +897,20 @@ export declare class Domani {
795
897
  request<T = unknown>(method: string, path: string, opts?: {
796
898
  query?: Record<string, unknown>;
797
899
  body?: unknown;
900
+ headers?: Record<string, string | undefined>;
798
901
  }): Promise<T>;
799
902
  /** Accept an access or ownership offer (POST /api/workspaces/access/offers/accept) */
800
903
  acceptWorkspaceAccessOffer(body: {
801
904
  token: string;
802
- }): Promise<unknown>;
905
+ }): Promise<void>;
803
906
  /** Accept a workspace invitation (POST /api/workspaces/invitations/accept) */
804
907
  acceptWorkspaceInvitation(body: {
805
908
  token: string;
806
- }): Promise<unknown>;
909
+ }): Promise<void>;
807
910
  /** Accept workspace ownership (POST /api/workspaces/ownership-transfers/accept) */
808
911
  acceptWorkspaceOwnershipTransfer(body: {
809
912
  token: string;
810
- }): Promise<unknown>;
913
+ }): Promise<void>;
811
914
  /** Add a private conversation note (POST /api/email/collaboration/{id}/notes) */
812
915
  addConversationNote(id: string, body: {
813
916
  body: string;
@@ -834,7 +937,7 @@ export declare class Domani {
834
937
  match_field: "from" | "to" | "subject" | "body";
835
938
  match_op: "contains" | "equals" | "regex";
836
939
  match_value: string;
837
- action: "drop" | "mark_read" | "forward" | "webhook_only" | "label";
940
+ action: "drop" | "mark_read" | "forward" | "webhook_only" | "label" | "escalate";
838
941
  action_arg?: string;
839
942
  priority?: number;
840
943
  enabled?: boolean;
@@ -853,7 +956,7 @@ export declare class Domani {
853
956
  /** Adopt an owned mailbox into a workspace (POST /api/workspaces/{id}/mailboxes) */
854
957
  attachWorkspaceMailbox(id: string, body: {
855
958
  mailbox_id: string;
856
- }): Promise<unknown>;
959
+ }): Promise<void>;
857
960
  /** Buy an aftermarket domain (POST /api/domains/{domain}/buy-aftermarket) */
858
961
  buyAftermarket(domain: string, body?: {
859
962
  max_price?: number;
@@ -881,7 +984,7 @@ export declare class Domani {
881
984
  years?: number;
882
985
  max_price?: number;
883
986
  ref?: string;
884
- }): Promise<{
987
+ }, paymentSignature?: string): Promise<{
885
988
  domain?: string;
886
989
  status?: "active";
887
990
  expires?: string;
@@ -1077,6 +1180,22 @@ export declare class Domani {
1077
1180
  }): Promise<{
1078
1181
  brief: DomainBrief;
1079
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>;
1080
1199
  /** List a domain for sale (PUT /api/domains/{domain}/for-sale) */
1081
1200
  createListing(domain: string, body: {
1082
1201
  price: number;
@@ -1177,6 +1296,21 @@ export declare class Domani {
1177
1296
  max_per_tx?: number;
1178
1297
  max_per_month?: number;
1179
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[];
1180
1314
  }): Promise<{
1181
1315
  id?: string;
1182
1316
  name?: string;
@@ -1186,6 +1320,8 @@ export declare class Domani {
1186
1320
  createdAt?: string;
1187
1321
  max_per_tx?: number | null;
1188
1322
  max_per_month?: number | null;
1323
+ mailbox_ids?: string[];
1324
+ http_route_policy?: HttpRoutePolicy | null;
1189
1325
  agent_identity?: {
1190
1326
  id?: string;
1191
1327
  name?: string | null;
@@ -1196,7 +1332,7 @@ export declare class Domani {
1196
1332
  createWebhook(body: {
1197
1333
  url: string;
1198
1334
  events: string[];
1199
- headers?: Record<string, unknown>;
1335
+ headers?: Record<string, string>;
1200
1336
  }): Promise<{
1201
1337
  id?: string;
1202
1338
  url?: string;
@@ -1210,7 +1346,7 @@ export declare class Domani {
1210
1346
  /** Create a workspace (POST /api/workspaces) */
1211
1347
  createWorkspace(body: {
1212
1348
  name: string;
1213
- }): Promise<unknown>;
1349
+ }): Promise<void>;
1214
1350
  /** Offer mailbox access or workspace ownership (POST /api/workspaces/{id}/access/offers) */
1215
1351
  createWorkspaceAccessOffer(id: string, body: {
1216
1352
  email: string;
@@ -1218,7 +1354,7 @@ export declare class Domani {
1218
1354
  ownership_disposition?: "unchanged" | "claim";
1219
1355
  creator_disposition?: "stay" | "stay_admin" | "leave";
1220
1356
  billing_disposition?: "unchanged" | "sponsor" | "transfer";
1221
- }): Promise<unknown>;
1357
+ }): Promise<void>;
1222
1358
  /** Start Mailzero workspace checkout (POST /api/workspaces/{id}/billing/checkout) */
1223
1359
  createWorkspaceCheckout(id: string, body: {
1224
1360
  plan: "mail_solo" | "mail_team" | "mail_business";
@@ -1232,6 +1368,8 @@ export declare class Domani {
1232
1368
  deleted?: boolean;
1233
1369
  hint?: string;
1234
1370
  }>;
1371
+ /** Delete a contact (DELETE /api/contacts/{address}) */
1372
+ deleteContact(address: string): Promise<void>;
1235
1373
  /** Remove a DNSSEC DS record (disable DNSSEC) (DELETE /api/domains/{domain}/dnssec) */
1236
1374
  deleteDnssecRecord(domain: string, query?: {
1237
1375
  keyTag: string;
@@ -1241,10 +1379,18 @@ export declare class Domani {
1241
1379
  enabled?: boolean;
1242
1380
  records?: DsRecord[];
1243
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>;
1244
1390
  /** Delete a mailbox (DELETE /api/emails/{address}) */
1245
1391
  deleteMailboxByAddress(address: string, body?: {
1246
1392
  confirm?: boolean;
1247
- }): Promise<unknown>;
1393
+ }): Promise<void>;
1248
1394
  /** Delete a message (DELETE /api/emails/{address}/messages/{id}) */
1249
1395
  deleteMessageByAddress(address: string, id: string): Promise<{
1250
1396
  id?: string;
@@ -1254,7 +1400,7 @@ export declare class Domani {
1254
1400
  deleteMessagesByAddress(address: string, body?: {
1255
1401
  message_ids: string[];
1256
1402
  idempotency_key?: string;
1257
- }): Promise<LegacyMailboxOperationReceipt>;
1403
+ }, idempotencyKey?: string): Promise<LegacyMailboxOperationReceipt>;
1258
1404
  /** Delete webhook (DELETE /api/webhooks/{id}) */
1259
1405
  deleteWebhook(id: string): Promise<{
1260
1406
  success?: boolean;
@@ -1269,6 +1415,24 @@ export declare class Domani {
1269
1415
  taken?: string[];
1270
1416
  candidates?: string[];
1271
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
+ }>;
1272
1436
  /** Finalize an agreed negotiation (pay) (POST /api/negotiations/{id}/finalize) */
1273
1437
  finalizeNegotiation(id: string, body?: {
1274
1438
  payment_method?: "card" | "usdc" | "balance";
@@ -1437,7 +1601,7 @@ export declare class Domani {
1437
1601
  }[];
1438
1602
  };
1439
1603
  sending_health: {
1440
- recipients?: Record<string, unknown>;
1604
+ recipients?: Record<string, number>;
1441
1605
  rates?: {
1442
1606
  bounce?: number;
1443
1607
  complaint?: number;
@@ -1463,6 +1627,14 @@ export declare class Domani {
1463
1627
  })[];
1464
1628
  caveats?: string[];
1465
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
+ }>;
1466
1638
  /** Get mailbox avatar info (GET /api/emails/{address}/avatar) */
1467
1639
  getMailboxAvatarByAddress(address: string): Promise<{
1468
1640
  address?: string;
@@ -1653,7 +1825,7 @@ export declare class Domani {
1653
1825
  /** Get workspace members and mailboxes (GET /api/workspaces/{id}) */
1654
1826
  getWorkspace(id: string): Promise<WorkspaceDetail>;
1655
1827
  /** Get the canonical workspace access graph (GET /api/workspaces/{id}/access) */
1656
- getWorkspaceAccess(id: string): Promise<unknown>;
1828
+ getWorkspaceAccess(id: string): Promise<void>;
1657
1829
  /** Heartbeat viewing or composing presence (PUT /api/email/collaboration/coordination) */
1658
1830
  heartbeatConversationPresence(body: {
1659
1831
  mailbox_id: string;
@@ -1683,9 +1855,9 @@ export declare class Domani {
1683
1855
  role?: "admin" | "member";
1684
1856
  mailbox_ids?: string[];
1685
1857
  mailbox_role?: "viewer" | "responder" | "manager";
1686
- }): Promise<unknown>;
1858
+ }): Promise<void>;
1687
1859
  /** Leave a workspace (DELETE /api/workspaces/{id}/members/me) */
1688
- leaveWorkspace(id: string): Promise<unknown>;
1860
+ leaveWorkspace(id: string): Promise<void>;
1689
1861
  /** List security audit events (GET /api/audit) */
1690
1862
  listAuditEvents(query?: {
1691
1863
  limit?: number;
@@ -1724,6 +1896,24 @@ export declare class Domani {
1724
1896
  email?: Record<string, unknown>[];
1725
1897
  };
1726
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
+ }>;
1727
1917
  /** List attributed conversation activity (GET /api/email/collaboration/{id}/activity) */
1728
1918
  listConversationActivity(id: string): Promise<{
1729
1919
  activity: MailActivity[];
@@ -1775,7 +1965,7 @@ export declare class Domani {
1775
1965
  unread?: number;
1776
1966
  })[];
1777
1967
  views?: ({
1778
- id?: "starred" | "all";
1968
+ id?: "starred" | "all" | "needs_human";
1779
1969
  total?: number;
1780
1970
  unread?: number;
1781
1971
  })[];
@@ -1787,7 +1977,7 @@ export declare class Domani {
1787
1977
  limit?: number;
1788
1978
  direction?: "in" | "out" | "all";
1789
1979
  folder?: "inbox" | "archive" | "sent" | "spam" | "trash";
1790
- view?: "starred" | "all";
1980
+ view?: "starred" | "all" | "needs_human";
1791
1981
  since?: string;
1792
1982
  from?: string;
1793
1983
  to?: string;
@@ -1806,6 +1996,10 @@ export declare class Domani {
1806
1996
  folder?: "inbox" | "archive" | "sent" | "spam" | "trash";
1807
1997
  read?: boolean;
1808
1998
  starred?: boolean;
1999
+ needs_human?: boolean;
2000
+ escalation_reason?: string | null;
2001
+ remind_at?: string | null;
2002
+ reminder_note?: string | null;
1809
2003
  answered?: boolean;
1810
2004
  forwarded?: boolean;
1811
2005
  spam_detected?: boolean;
@@ -1825,6 +2019,21 @@ export declare class Domani {
1825
2019
  })[];
1826
2020
  next_cursor?: string | null;
1827
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
+ }>;
1828
2037
  /** List your agent identities (GET /api/agents/identity) */
1829
2038
  listIdentities(): Promise<{
1830
2039
  identities?: AgentIdentity[];
@@ -2060,7 +2269,7 @@ export declare class Domani {
2060
2269
  message_ids: string[];
2061
2270
  read: boolean;
2062
2271
  idempotency_key?: string;
2063
- }): Promise<LegacyMailboxOperationReceipt>;
2272
+ }, idempotencyKey?: string): Promise<LegacyMailboxOperationReceipt>;
2064
2273
  /** Mark notification as read (PATCH /api/notifications/{id}) */
2065
2274
  markNotificationRead(id: string, body: {
2066
2275
  read: boolean;
@@ -2084,6 +2293,7 @@ export declare class Domani {
2084
2293
  nameservers: string[];
2085
2294
  dns_provider: string;
2086
2295
  dnssec_enabled: boolean;
2296
+ checked_at: string | null;
2087
2297
  };
2088
2298
  options: {
2089
2299
  connect?: {
@@ -2108,6 +2318,12 @@ export declare class Domani {
2108
2318
  reason?: string;
2109
2319
  code?: string;
2110
2320
  eligible_at?: string;
2321
+ guidance?: {
2322
+ managed_via: string;
2323
+ unlock: string;
2324
+ auth_code: string;
2325
+ notes: string[];
2326
+ };
2111
2327
  next_action?: {
2112
2328
  method?: string;
2113
2329
  path?: string;
@@ -2117,6 +2333,11 @@ export declare class Domani {
2117
2333
  invariants: string[];
2118
2334
  warnings: string[];
2119
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>;
2120
2341
  /** Provide EPP/auth code (seller) (PATCH /api/deals/{id}) */
2121
2342
  provideEppCode(id: string, body: {
2122
2343
  auth_code: string;
@@ -2139,11 +2360,32 @@ export declare class Domani {
2139
2360
  payment_tx?: string;
2140
2361
  payment_chain?: "base" | "ethereum";
2141
2362
  years?: number;
2142
- }): Promise<ProvisionAgentResult>;
2363
+ }, paymentSignature?: string): Promise<ProvisionAgentResult>;
2143
2364
  /** Refresh a domain brief from live sources (POST /api/domain-briefs/{id}/refresh) */
2144
2365
  refreshDomainBrief(id: string): Promise<{
2145
2366
  brief: DomainBrief;
2146
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
+ }>;
2147
2389
  /** Create a new account (POST /api/auth/register) */
2148
2390
  registerUser(body: {
2149
2391
  email: string;
@@ -2175,7 +2417,7 @@ export declare class Domani {
2175
2417
  removed?: boolean;
2176
2418
  }>;
2177
2419
  /** Remove email from a domain (DELETE /api/domains/{domain}/email/setup) */
2178
- removeDomainEmail(domain: string): Promise<unknown>;
2420
+ removeDomainEmail(domain: string): Promise<void>;
2179
2421
  /** Remove a mailbox alias (DELETE /api/emails/{address}/aliases/{alias}) */
2180
2422
  removeMailboxAlias(address: string, alias: string): Promise<{
2181
2423
  address?: string;
@@ -2185,7 +2427,7 @@ export declare class Domani {
2185
2427
  /** Remove a member mailbox permission (DELETE /api/workspaces/{id}/mailboxes/{mailboxId}/grants) */
2186
2428
  removeMailboxGrant(id: string, mailboxId: string, body: {
2187
2429
  membership_id: string;
2188
- }): Promise<unknown>;
2430
+ }): Promise<void>;
2189
2431
  /** Remove mailbox webhook (DELETE /api/emails/{address}/webhook) */
2190
2432
  removeMailboxWebhook(address: string): Promise<{
2191
2433
  address?: string;
@@ -2208,7 +2450,7 @@ export declare class Domani {
2208
2450
  hint?: string;
2209
2451
  }>;
2210
2452
  /** Remove a workspace member (DELETE /api/workspaces/{id}/members/{membershipId}) */
2211
- removeWorkspaceMember(id: string, membershipId: string): Promise<unknown>;
2453
+ removeWorkspaceMember(id: string, membershipId: string): Promise<void>;
2212
2454
  /** Renew a domain (POST /api/domains/{domain}/renew) */
2213
2455
  renewDomain(domain: string, body?: {
2214
2456
  years?: number;
@@ -2253,7 +2495,7 @@ export declare class Domani {
2253
2495
  lease_id: string;
2254
2496
  expected_reply_version: number;
2255
2497
  };
2256
- }): Promise<{
2498
+ }, idempotencyKey?: string): Promise<{
2257
2499
  id?: string;
2258
2500
  message_id?: string;
2259
2501
  from?: string;
@@ -2264,7 +2506,7 @@ export declare class Domani {
2264
2506
  /** Request a workspace ownership transfer (POST /api/workspaces/{id}/ownership-transfer) */
2265
2507
  requestWorkspaceOwnershipTransfer(id: string, body: {
2266
2508
  membership_id: string;
2267
- }): Promise<unknown>;
2509
+ }): Promise<void>;
2268
2510
  /** Research or refresh a public domain profile (POST /api/domains/{domain}/profile) */
2269
2511
  researchPublicDomainProfile(domain: string, query?: {
2270
2512
  depth?: "instant" | "deep";
@@ -2331,11 +2573,17 @@ export declare class Domani {
2331
2573
  /** Revoke an access grant and its credentials (DELETE /api/workspaces/{id}/access/grants/{grantId}) */
2332
2574
  revokeWorkspaceAccess(id: string, grantId: string, body?: {
2333
2575
  expected_version?: number;
2334
- }): Promise<unknown>;
2576
+ }): Promise<void>;
2335
2577
  /** Revoke a pending invitation (DELETE /api/workspaces/{id}/invitations/{invitationId}) */
2336
- revokeWorkspaceInvitation(id: string, invitationId: string): Promise<unknown>;
2578
+ revokeWorkspaceInvitation(id: string, invitationId: string): Promise<void>;
2337
2579
  /** Revoke a pending ownership transfer (DELETE /api/workspaces/{id}/ownership-transfer/{transferId}) */
2338
- 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>;
2339
2587
  /** Rotate webhook signing secret (POST /api/emails/{address}/webhook/rotate) */
2340
2588
  rotateMailboxWebhookSecret(address: string): Promise<{
2341
2589
  address?: string;
@@ -2387,6 +2635,7 @@ export declare class Domani {
2387
2635
  in_reply_to?: string;
2388
2636
  references?: string;
2389
2637
  idempotency_key?: string;
2638
+ send_at?: string;
2390
2639
  coordination?: {
2391
2640
  thread_key: string;
2392
2641
  client_id: string;
@@ -2399,7 +2648,7 @@ export declare class Domani {
2399
2648
  filename: string;
2400
2649
  content_type?: string;
2401
2650
  }[];
2402
- }): Promise<{
2651
+ }, idempotencyKey?: string): Promise<{
2403
2652
  id?: string;
2404
2653
  message_id?: string;
2405
2654
  from?: string;
@@ -2443,11 +2692,11 @@ export declare class Domani {
2443
2692
  setMailboxGrant(id: string, mailboxId: string, body: {
2444
2693
  membership_id: string;
2445
2694
  role: "viewer" | "responder" | "manager";
2446
- }): Promise<unknown>;
2695
+ }): Promise<void>;
2447
2696
  /** Set mailbox webhook (PUT /api/emails/{address}/webhook) */
2448
2697
  setMailboxWebhook(address: string, body: {
2449
2698
  url: string;
2450
- headers?: Record<string, unknown>;
2699
+ headers?: Record<string, string>;
2451
2700
  }): Promise<{
2452
2701
  address?: string;
2453
2702
  webhook_url?: string;
@@ -2456,6 +2705,16 @@ export declare class Domani {
2456
2705
  header_names?: string[];
2457
2706
  hint?: string;
2458
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
+ }>;
2459
2718
  /** Set nameservers for a domain (PUT /api/domains/{domain}/nameservers) */
2460
2719
  setNameservers(domain: string, body: {
2461
2720
  nameservers: string[];
@@ -2500,7 +2759,7 @@ export declare class Domani {
2500
2759
  };
2501
2760
  expected_version?: number;
2502
2761
  reason?: string;
2503
- }): Promise<unknown>;
2762
+ }): Promise<void>;
2504
2763
  /** Capture a DNS snapshot (POST /api/domains/{domain}/dns/snapshot) */
2505
2764
  snapshotDns(domain: string, body?: {
2506
2765
  extra_subdomains?: string[];
@@ -2542,14 +2801,14 @@ export declare class Domani {
2542
2801
  id: string;
2543
2802
  label: string;
2544
2803
  })[];
2545
- }): Promise<unknown>;
2804
+ }): Promise<void>;
2546
2805
  /** Create or replace an explicit mailbox collection (PUT /api/workspaces/{id}/access/collections) */
2547
2806
  syncMailboxCollection(id: string, body: {
2548
2807
  id?: string;
2549
2808
  name: string;
2550
2809
  description?: string | null;
2551
2810
  mailbox_ids: string[];
2552
- }): Promise<unknown>;
2811
+ }): Promise<void>;
2553
2812
  /** Test mailbox webhook (POST /api/emails/{address}/webhook/test) */
2554
2813
  testMailboxWebhook(address: string): Promise<{
2555
2814
  address?: string;
@@ -2566,12 +2825,36 @@ export declare class Domani {
2566
2825
  payment_tx?: string;
2567
2826
  payment_chain?: "base" | "ethereum";
2568
2827
  extra_subdomains?: string[];
2569
- }): 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
+ }>;
2570
2851
  /** Update account preferences (PUT /api/me) */
2571
2852
  updateAccount(body: {
2572
- preferred_payment_method: "card" | "usdc" | null;
2853
+ preferred_payment_method?: "card" | "usdc" | null;
2854
+ preferred_locale?: "en" | "fr" | "es" | "pt-BR" | "ja" | "zh-Hans" | "it";
2573
2855
  }): Promise<{
2574
2856
  preferred_payment_method?: string | null;
2857
+ preferred_locale?: "en" | "fr" | "es" | "pt-BR" | "ja" | "zh-Hans" | "it";
2575
2858
  hint?: string;
2576
2859
  }>;
2577
2860
  /** Dismiss or restore first-run guidance (PUT /api/me/activation) */
@@ -2614,7 +2897,12 @@ export declare class Domani {
2614
2897
  read?: boolean;
2615
2898
  starred?: boolean;
2616
2899
  idempotency_key?: string;
2617
- }): 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>;
2618
2906
  /** Update an agent identity (PATCH /api/agents/identity/{slug}) */
2619
2907
  updateIdentity(slug: string, body: {
2620
2908
  name?: string;
@@ -2648,6 +2936,7 @@ export declare class Domani {
2648
2936
  webhook_url?: string | null;
2649
2937
  forward_to?: string | null;
2650
2938
  drop_spam?: boolean;
2939
+ tone_notes?: string | null;
2651
2940
  }): Promise<{
2652
2941
  id?: string;
2653
2942
  address?: string;
@@ -2656,6 +2945,7 @@ export declare class Domani {
2656
2945
  name?: string | null;
2657
2946
  webhook_url?: string | null;
2658
2947
  forward_to?: string | null;
2948
+ tone_notes?: string | null;
2659
2949
  signing_secret?: string;
2660
2950
  }>;
2661
2951
  /** Update notification preferences (PUT /api/notifications/preferences) */
@@ -2684,7 +2974,7 @@ export declare class Domani {
2684
2974
  url?: string;
2685
2975
  events?: string[];
2686
2976
  active?: boolean;
2687
- headers?: Record<string, unknown>;
2977
+ headers?: Record<string, string>;
2688
2978
  }): Promise<{
2689
2979
  id?: string;
2690
2980
  url?: string;
@@ -2696,11 +2986,17 @@ export declare class Domani {
2696
2986
  /** Rename a workspace (PATCH /api/workspaces/{id}) */
2697
2987
  updateWorkspace(id: string, body: {
2698
2988
  name: string;
2699
- }): Promise<unknown>;
2989
+ }): Promise<void>;
2700
2990
  /** Change a member role (PATCH /api/workspaces/{id}/members/{membershipId}) */
2701
2991
  updateWorkspaceMember(id: string, membershipId: string, body: {
2702
2992
  role: "admin" | "member";
2703
- }): 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>;
2704
3000
  /** Verify that a provider connection is working (POST /api/domains/{domain}/verify) */
2705
3001
  verifyConnection(domain: string, body: {
2706
3002
  target?: string;
@@ -2715,6 +3011,11 @@ export declare class Domani {
2715
3011
  hint?: string;
2716
3012
  next_steps?: string[];
2717
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
+ }>;
2718
3019
  /** Verify and complete domain import (POST /api/domains/import/verify) */
2719
3020
  verifyImport(body: {
2720
3021
  domain: string;
@@ -2729,7 +3030,7 @@ export declare class Domani {
2729
3030
  /** Verify a magic link token (GET /api/auth/verify) */
2730
3031
  verifyMagicLink(query?: {
2731
3032
  token: string;
2732
- }): Promise<unknown>;
3033
+ }): Promise<void>;
2733
3034
  /** Verify TXT ownership for external listing (POST /api/domains/sell/verify) */
2734
3035
  verifySellListing(body: {
2735
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.4",
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",