@dropthis/cli 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -314,6 +314,53 @@ await dropthis.account.update({ displayName: "Jane Doe" });
314
314
  await dropthis.account.delete();
315
315
  ```
316
316
 
317
+ ### domains
318
+
319
+ Custom domains let you serve drops on your own hostname instead of the shared pool. There are two
320
+ modes: **path** (many drops at `hostname/{slug}/`) and **dedicated** (one drop at the hostname root).
321
+
322
+ ```typescript
323
+ // 1. Connect the domain — returns DNS instructions (status: "pending_dns")
324
+ const { data: domain } = await dropthis.domains.connect({
325
+ hostname: "drops.example.com",
326
+ mode: "path",
327
+ });
328
+
329
+ // 2. Create the CNAME at your DNS provider:
330
+ // drops.example.com CNAME edge.dropthis.app
331
+ const dnsRecord = domain.dns[0];
332
+ // dnsRecord.name → "drops.example.com"
333
+ // dnsRecord.value → "edge.dropthis.app"
334
+
335
+ // 3. Verify — call repeatedly until status is "live"
336
+ const { data: verified } = await dropthis.domains.verify("drops.example.com");
337
+ // Use verified.dns[0].retryAfter (seconds) as the polling interval while status !== "live"
338
+ // verified.status → "live"
339
+
340
+ // 4. Publish to the custom domain (path mode: specify a vanity slug, or omit for a random one)
341
+ const { data: drop } = await dropthis.drops.publish("<h1>Hello</h1>", {
342
+ domain: "drops.example.com",
343
+ slug: "summer-sale",
344
+ });
345
+ // drop.url → "https://drops.example.com/summer-sale/"
346
+ ```
347
+
348
+ Other domain operations:
349
+
350
+ ```typescript
351
+ await dropthis.domains.list();
352
+ await dropthis.domains.get("drops.example.com");
353
+
354
+ // Repoint a dedicated domain to a different drop
355
+ await dropthis.domains.update("bio.example.com", { dropId: "drop_abc123" });
356
+
357
+ // Set a path-mode domain as the account's publish default
358
+ await dropthis.domains.update("drops.example.com", { default: true });
359
+
360
+ // Delete (remove your DNS CNAME after this to prevent re-claim by another account)
361
+ await dropthis.domains.delete("drops.example.com");
362
+ ```
363
+
317
364
  ## Pricing tiers
318
365
 
319
366
  - **Free ($0)** — drops expire after 7 days, 5 MB per drop, dropthis badge.
@@ -336,7 +383,7 @@ const { data, error } = await dropthis.drops.publish("<h1>Hello from the edge</h
336
383
 
337
384
  `DropthisEdge` accepts the in-memory subset of `PublishInput`: inline strings, `Uint8Array`, `URL`, and the explicit `{ kind: "content" }`, `{ kind: "source_url" }`, and `{ kind: "files" }` forms. Local file paths and `string[]` path arrays are not supported (no filesystem on the edge).
338
385
 
339
- `DropthisEdge` exposes the drop lifecycle through `drops.publish(input, options?)`, `drops.updateContent(dropId, input, options?)`, `drops.updateSettings`, `drops.get`, `drops.list`, `drops.resolve`, `drops.getContent`, and `drops.delete`, plus the `deployments`, `account`, and `apiKeys` resource accessors — the same surface as the Node client.
386
+ `DropthisEdge` exposes the drop lifecycle through `drops.publish(input, options?)`, `drops.updateContent(dropId, input, options?)`, `drops.updateSettings`, `drops.get`, `drops.list`, `drops.resolve`, `drops.getContent`, and `drops.delete`, plus the `deployments`, `account`, `apiKeys`, and `domains` resource accessors — the same surface as the Node client.
340
387
 
341
388
  ## Types
342
389
 
@@ -238,6 +238,20 @@ type DropOptions = {
238
238
  entry?: string;
239
239
  /** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */
240
240
  metadata?: Record<string, unknown>;
241
+ /**
242
+ * Hostname of a custom domain connected to this account (must be live — see
243
+ * `client.domains`). Path-mode domains serve the drop at `https://{domain}/{slug}/`;
244
+ * dedicated domains serve it at the root and conflict (409) once occupied. Omit to
245
+ * use the account's default path domain if one exists, else the shared pool.
246
+ */
247
+ domain?: string | null;
248
+ /**
249
+ * Vanity slug — only valid when the target is a path-mode custom domain. 1–63
250
+ * lowercase letters/digits/hyphens (no leading/trailing/double hyphen). Taken slugs
251
+ * are auto-suffixed; omit for a random slug. Setting this on the shared pool returns
252
+ * 422.
253
+ */
254
+ slug?: string | null;
241
255
  };
242
256
  type PrepareOptions = {
243
257
  /** Glob patterns to ignore when publishing directories. */
@@ -286,6 +300,72 @@ type PublishInput = string | string[] | URL | Uint8Array | {
286
300
  files: PublishFileInput[];
287
301
  entry?: string;
288
302
  };
303
+ /** Structured next-step hint returned by domain operations (and publish). */
304
+ type NextHint = {
305
+ action: string;
306
+ message: string;
307
+ };
308
+ /** One DNS record instruction or diagnostic for a custom domain. */
309
+ type DnsRecord = {
310
+ /** Purpose of the record, e.g. "routing". */
311
+ purpose: string;
312
+ /** DNS record type, e.g. "CNAME". */
313
+ type: string;
314
+ /** The DNS name to create the record for. */
315
+ name: string;
316
+ /** The value the record must point at. */
317
+ value: string;
318
+ /** Current DNS status: "missing" | "ok" | "mismatch". */
319
+ status: "missing" | "ok" | "mismatch";
320
+ /** What DoH currently resolves for this record (verify only). */
321
+ observed?: string | null;
322
+ /** Specific guidance for fixing this record. */
323
+ hint?: string | null;
324
+ /** Seconds to wait before retrying verify while DNS/cert propagates. */
325
+ retryAfter?: number | null;
326
+ };
327
+ /** Full domain resource representation. */
328
+ type DomainResponse = {
329
+ object: "domain";
330
+ /** Stable domain identifier. */
331
+ id: string;
332
+ /** Canonical hostname registered with dropthis. */
333
+ hostname: string;
334
+ /** Mount mode: "path" (many drops at hostname/{slug}/) or "dedicated" (one drop at hostname/). */
335
+ mode: "path" | "dedicated";
336
+ /** Lifecycle status: "pending_dns" | "verifying" | "live" | "failed". */
337
+ status: "pending_dns" | "verifying" | "live" | "failed";
338
+ /** Reason for failure status. */
339
+ failureReason?: string | null;
340
+ /** Whether this is the account's default publish domain. */
341
+ default: boolean;
342
+ /** Mounted drop id (dedicated mode only). */
343
+ dropId?: string | null;
344
+ /** DNS records required for this domain. */
345
+ dns: DnsRecord[];
346
+ /** Creation timestamp. */
347
+ createdAt: string;
348
+ /** When the domain first reached "live" status. */
349
+ verifiedAt?: string | null;
350
+ /** Structured next-step hints for the agent. */
351
+ next: NextHint[];
352
+ };
353
+ /** List of domains for the account. */
354
+ type DomainListResponse = {
355
+ object: "domain.list";
356
+ /** Domains connected to this account. */
357
+ domains: DomainResponse[];
358
+ };
359
+ /** Response body for a successful domain deletion. */
360
+ type DomainDeletedResponse = {
361
+ object: "domain.deleted";
362
+ /** Id of the deleted domain. */
363
+ id: string;
364
+ /** Hostname of the deleted domain. */
365
+ hostname: string;
366
+ /** Dangling-CNAME risk warning (always present; instructs you to remove the DNS record). */
367
+ warning: string;
368
+ };
289
369
  /** One readable file in a deployment's content manifest. */
290
370
  type DeploymentContentFile = {
291
371
  /** File path within the deployment, relative to its root. */
@@ -446,6 +526,45 @@ declare class DeploymentsResource {
446
526
  get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>;
447
527
  }
448
528
 
529
+ declare class DomainsResource {
530
+ private readonly transport;
531
+ constructor(transport: Transport);
532
+ /**
533
+ * Connect a custom domain to the account. Returns the domain in `pending_dns` status with
534
+ * DNS instructions. Idempotent on (account, hostname) — re-connecting an already-connected
535
+ * domain returns the existing row. POST /domains.
536
+ */
537
+ connect(input: {
538
+ hostname: string;
539
+ mode: "path" | "dedicated";
540
+ }): Promise<DropthisResult<DomainResponse>>;
541
+ /** List all custom domains connected to this account. GET /domains. */
542
+ list(): Promise<DropthisResult<DomainListResponse>>;
543
+ /** Get a domain by its stable id or hostname. GET /domains/{id_or_hostname}. */
544
+ get(idOrHostname: string): Promise<DropthisResult<DomainResponse>>;
545
+ /**
546
+ * Trigger a DNS + Cloudflare verification check. Returns the domain with updated status and
547
+ * per-record diagnostics. If DNS is still propagating, `dns[].retryAfter` tells you when to
548
+ * re-call. POST /domains/{id_or_hostname}/verify.
549
+ */
550
+ verify(idOrHostname: string): Promise<DropthisResult<DomainResponse>>;
551
+ /**
552
+ * Update a domain's `dropId` (dedicated mode: repoint to a different drop) or `default`
553
+ * flag (path mode only: set/clear the account's default publish domain). Mode is immutable
554
+ * — delete and reconnect to change it. PATCH /domains/{id_or_hostname}.
555
+ */
556
+ update(idOrHostname: string, input: {
557
+ dropId?: string | null;
558
+ default?: boolean | null;
559
+ }): Promise<DropthisResult<DomainResponse>>;
560
+ /**
561
+ * Delete a custom domain and remove all its routes. The response includes a dangling-CNAME
562
+ * warning — remove the DNS record after deleting so another account cannot re-claim the
563
+ * hostname. DELETE /domains/{id_or_hostname}.
564
+ */
565
+ delete(idOrHostname: string): Promise<DropthisResult<DomainDeletedResponse>>;
566
+ }
567
+
449
568
  declare class CursorPage<T> implements ListPage<T> {
450
569
  readonly object: "list";
451
570
  readonly data: T[];
@@ -525,12 +644,20 @@ declare class DropsResource<TInput = PublishInput> {
525
644
  getContent(dropId: string, options?: Omit<GetContentOptions, "path">): Promise<DropthisResult<DeploymentContentManifest>>;
526
645
  /**
527
646
  * Change an EXISTING drop's settings — title, visibility, password, noindex, expiry,
528
- * metadata — by its `drop_…` id. Does not touch content; replace that with {@link updateContent}.
529
- * Idempotent. PATCH /drops/{id}.
647
+ * metadata, domain, or slug — by its `drop_…` id. Does not touch content; replace that
648
+ * with {@link updateContent}. Idempotent. PATCH /drops/{id}.
649
+ *
650
+ * **`domain`** — move the drop to a different custom domain (must be live). Pass `null` to
651
+ * move the drop back to the shared pool (unmount from its current domain).
652
+ *
653
+ * **`slug`** — rename the vanity slug on a path-mode custom domain. Only valid when the drop
654
+ * lives on a path-mode domain. Unlike {@link publish} (which auto-suffixes taken slugs),
655
+ * `updateSettings` returns 409 on a slug conflict and never auto-suffixes — your code must
656
+ * catch 409 and retry with a different slug. Passing `slug` on the shared pool returns 422.
530
657
  */
531
658
  updateSettings(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>;
532
659
  /** Permanently delete a drop and its public URL by its `drop_…` id. DELETE /drops/{id}. */
533
660
  delete(dropId: string): Promise<DropthisResult<null>>;
534
661
  }
535
662
 
536
- export { type AccountLimits as A, Transport as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type UploadManifestFile as F, type GetContentOptions as G, type UploadSessionFileResponse as H, type InMemoryPublishInput as I, type UploadSessionResponse as J, type UploadTarget as K, type Limitations as L, type PrepareOptions as P, type RequestControls as R, type SessionResponse as S, type TierInfo as T, type UpdateContentOptions as U, AccountResource as a, type AccountResponse as b, type ActionResolve as c, ApiKeysResource as d, type CreateUploadSessionResponse as e, CursorPage as f, type DeploymentContentManifest as g, DeploymentsResource as h, type DropAction as i, type DropContentFile as j, type DropDeploymentResponse as k, type DropOptions as l, type DropResponse as m, DropsResource as n, type DropthisClientOptions as o, type DropthisErrorResponse as p, type DropthisResult as q, type ListDeploymentsParams as r, type ListDeploymentsResponse as s, type ListPage as t, type PreparedPublishRequest as u, type PreparedUploadFile as v, type PublishFileInput as w, type PublishInput as x, type PublishOptions as y, type RequestOptions as z };
663
+ export { type AccountLimits as A, type PreparedUploadFile as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type PublishFileInput as F, type GetContentOptions as G, type PublishInput as H, type InMemoryPublishInput as I, type PublishOptions as J, type RequestOptions as K, type Limitations as L, Transport as M, type NextHint as N, type UploadManifestFile as O, type PrepareOptions as P, type UploadSessionFileResponse as Q, type RequestControls as R, type SessionResponse as S, type TierInfo as T, type UpdateContentOptions as U, type UploadSessionResponse as V, type UploadTarget as W, AccountResource as a, type AccountResponse as b, type ActionResolve as c, ApiKeysResource as d, type CreateUploadSessionResponse as e, CursorPage as f, type DeploymentContentManifest as g, DeploymentsResource as h, type DnsRecord as i, type DomainDeletedResponse as j, type DomainListResponse as k, type DomainResponse as l, DomainsResource as m, type DropAction as n, type DropContentFile as o, type DropDeploymentResponse as p, type DropOptions as q, type DropResponse as r, DropsResource as s, type DropthisClientOptions as t, type DropthisErrorResponse as u, type DropthisResult as v, type ListDeploymentsParams as w, type ListDeploymentsResponse as x, type ListPage as y, type PreparedPublishRequest as z };
@@ -238,6 +238,20 @@ type DropOptions = {
238
238
  entry?: string;
239
239
  /** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */
240
240
  metadata?: Record<string, unknown>;
241
+ /**
242
+ * Hostname of a custom domain connected to this account (must be live — see
243
+ * `client.domains`). Path-mode domains serve the drop at `https://{domain}/{slug}/`;
244
+ * dedicated domains serve it at the root and conflict (409) once occupied. Omit to
245
+ * use the account's default path domain if one exists, else the shared pool.
246
+ */
247
+ domain?: string | null;
248
+ /**
249
+ * Vanity slug — only valid when the target is a path-mode custom domain. 1–63
250
+ * lowercase letters/digits/hyphens (no leading/trailing/double hyphen). Taken slugs
251
+ * are auto-suffixed; omit for a random slug. Setting this on the shared pool returns
252
+ * 422.
253
+ */
254
+ slug?: string | null;
241
255
  };
242
256
  type PrepareOptions = {
243
257
  /** Glob patterns to ignore when publishing directories. */
@@ -286,6 +300,72 @@ type PublishInput = string | string[] | URL | Uint8Array | {
286
300
  files: PublishFileInput[];
287
301
  entry?: string;
288
302
  };
303
+ /** Structured next-step hint returned by domain operations (and publish). */
304
+ type NextHint = {
305
+ action: string;
306
+ message: string;
307
+ };
308
+ /** One DNS record instruction or diagnostic for a custom domain. */
309
+ type DnsRecord = {
310
+ /** Purpose of the record, e.g. "routing". */
311
+ purpose: string;
312
+ /** DNS record type, e.g. "CNAME". */
313
+ type: string;
314
+ /** The DNS name to create the record for. */
315
+ name: string;
316
+ /** The value the record must point at. */
317
+ value: string;
318
+ /** Current DNS status: "missing" | "ok" | "mismatch". */
319
+ status: "missing" | "ok" | "mismatch";
320
+ /** What DoH currently resolves for this record (verify only). */
321
+ observed?: string | null;
322
+ /** Specific guidance for fixing this record. */
323
+ hint?: string | null;
324
+ /** Seconds to wait before retrying verify while DNS/cert propagates. */
325
+ retryAfter?: number | null;
326
+ };
327
+ /** Full domain resource representation. */
328
+ type DomainResponse = {
329
+ object: "domain";
330
+ /** Stable domain identifier. */
331
+ id: string;
332
+ /** Canonical hostname registered with dropthis. */
333
+ hostname: string;
334
+ /** Mount mode: "path" (many drops at hostname/{slug}/) or "dedicated" (one drop at hostname/). */
335
+ mode: "path" | "dedicated";
336
+ /** Lifecycle status: "pending_dns" | "verifying" | "live" | "failed". */
337
+ status: "pending_dns" | "verifying" | "live" | "failed";
338
+ /** Reason for failure status. */
339
+ failureReason?: string | null;
340
+ /** Whether this is the account's default publish domain. */
341
+ default: boolean;
342
+ /** Mounted drop id (dedicated mode only). */
343
+ dropId?: string | null;
344
+ /** DNS records required for this domain. */
345
+ dns: DnsRecord[];
346
+ /** Creation timestamp. */
347
+ createdAt: string;
348
+ /** When the domain first reached "live" status. */
349
+ verifiedAt?: string | null;
350
+ /** Structured next-step hints for the agent. */
351
+ next: NextHint[];
352
+ };
353
+ /** List of domains for the account. */
354
+ type DomainListResponse = {
355
+ object: "domain.list";
356
+ /** Domains connected to this account. */
357
+ domains: DomainResponse[];
358
+ };
359
+ /** Response body for a successful domain deletion. */
360
+ type DomainDeletedResponse = {
361
+ object: "domain.deleted";
362
+ /** Id of the deleted domain. */
363
+ id: string;
364
+ /** Hostname of the deleted domain. */
365
+ hostname: string;
366
+ /** Dangling-CNAME risk warning (always present; instructs you to remove the DNS record). */
367
+ warning: string;
368
+ };
289
369
  /** One readable file in a deployment's content manifest. */
290
370
  type DeploymentContentFile = {
291
371
  /** File path within the deployment, relative to its root. */
@@ -446,6 +526,45 @@ declare class DeploymentsResource {
446
526
  get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>;
447
527
  }
448
528
 
529
+ declare class DomainsResource {
530
+ private readonly transport;
531
+ constructor(transport: Transport);
532
+ /**
533
+ * Connect a custom domain to the account. Returns the domain in `pending_dns` status with
534
+ * DNS instructions. Idempotent on (account, hostname) — re-connecting an already-connected
535
+ * domain returns the existing row. POST /domains.
536
+ */
537
+ connect(input: {
538
+ hostname: string;
539
+ mode: "path" | "dedicated";
540
+ }): Promise<DropthisResult<DomainResponse>>;
541
+ /** List all custom domains connected to this account. GET /domains. */
542
+ list(): Promise<DropthisResult<DomainListResponse>>;
543
+ /** Get a domain by its stable id or hostname. GET /domains/{id_or_hostname}. */
544
+ get(idOrHostname: string): Promise<DropthisResult<DomainResponse>>;
545
+ /**
546
+ * Trigger a DNS + Cloudflare verification check. Returns the domain with updated status and
547
+ * per-record diagnostics. If DNS is still propagating, `dns[].retryAfter` tells you when to
548
+ * re-call. POST /domains/{id_or_hostname}/verify.
549
+ */
550
+ verify(idOrHostname: string): Promise<DropthisResult<DomainResponse>>;
551
+ /**
552
+ * Update a domain's `dropId` (dedicated mode: repoint to a different drop) or `default`
553
+ * flag (path mode only: set/clear the account's default publish domain). Mode is immutable
554
+ * — delete and reconnect to change it. PATCH /domains/{id_or_hostname}.
555
+ */
556
+ update(idOrHostname: string, input: {
557
+ dropId?: string | null;
558
+ default?: boolean | null;
559
+ }): Promise<DropthisResult<DomainResponse>>;
560
+ /**
561
+ * Delete a custom domain and remove all its routes. The response includes a dangling-CNAME
562
+ * warning — remove the DNS record after deleting so another account cannot re-claim the
563
+ * hostname. DELETE /domains/{id_or_hostname}.
564
+ */
565
+ delete(idOrHostname: string): Promise<DropthisResult<DomainDeletedResponse>>;
566
+ }
567
+
449
568
  declare class CursorPage<T> implements ListPage<T> {
450
569
  readonly object: "list";
451
570
  readonly data: T[];
@@ -525,12 +644,20 @@ declare class DropsResource<TInput = PublishInput> {
525
644
  getContent(dropId: string, options?: Omit<GetContentOptions, "path">): Promise<DropthisResult<DeploymentContentManifest>>;
526
645
  /**
527
646
  * Change an EXISTING drop's settings — title, visibility, password, noindex, expiry,
528
- * metadata — by its `drop_…` id. Does not touch content; replace that with {@link updateContent}.
529
- * Idempotent. PATCH /drops/{id}.
647
+ * metadata, domain, or slug — by its `drop_…` id. Does not touch content; replace that
648
+ * with {@link updateContent}. Idempotent. PATCH /drops/{id}.
649
+ *
650
+ * **`domain`** — move the drop to a different custom domain (must be live). Pass `null` to
651
+ * move the drop back to the shared pool (unmount from its current domain).
652
+ *
653
+ * **`slug`** — rename the vanity slug on a path-mode custom domain. Only valid when the drop
654
+ * lives on a path-mode domain. Unlike {@link publish} (which auto-suffixes taken slugs),
655
+ * `updateSettings` returns 409 on a slug conflict and never auto-suffixes — your code must
656
+ * catch 409 and retry with a different slug. Passing `slug` on the shared pool returns 422.
530
657
  */
531
658
  updateSettings(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>;
532
659
  /** Permanently delete a drop and its public URL by its `drop_…` id. DELETE /drops/{id}. */
533
660
  delete(dropId: string): Promise<DropthisResult<null>>;
534
661
  }
535
662
 
536
- export { type AccountLimits as A, Transport as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type UploadManifestFile as F, type GetContentOptions as G, type UploadSessionFileResponse as H, type InMemoryPublishInput as I, type UploadSessionResponse as J, type UploadTarget as K, type Limitations as L, type PrepareOptions as P, type RequestControls as R, type SessionResponse as S, type TierInfo as T, type UpdateContentOptions as U, AccountResource as a, type AccountResponse as b, type ActionResolve as c, ApiKeysResource as d, type CreateUploadSessionResponse as e, CursorPage as f, type DeploymentContentManifest as g, DeploymentsResource as h, type DropAction as i, type DropContentFile as j, type DropDeploymentResponse as k, type DropOptions as l, type DropResponse as m, DropsResource as n, type DropthisClientOptions as o, type DropthisErrorResponse as p, type DropthisResult as q, type ListDeploymentsParams as r, type ListDeploymentsResponse as s, type ListPage as t, type PreparedPublishRequest as u, type PreparedUploadFile as v, type PublishFileInput as w, type PublishInput as x, type PublishOptions as y, type RequestOptions as z };
663
+ export { type AccountLimits as A, type PreparedUploadFile as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type PublishFileInput as F, type GetContentOptions as G, type PublishInput as H, type InMemoryPublishInput as I, type PublishOptions as J, type RequestOptions as K, type Limitations as L, Transport as M, type NextHint as N, type UploadManifestFile as O, type PrepareOptions as P, type UploadSessionFileResponse as Q, type RequestControls as R, type SessionResponse as S, type TierInfo as T, type UpdateContentOptions as U, type UploadSessionResponse as V, type UploadTarget as W, AccountResource as a, type AccountResponse as b, type ActionResolve as c, ApiKeysResource as d, type CreateUploadSessionResponse as e, CursorPage as f, type DeploymentContentManifest as g, DeploymentsResource as h, type DnsRecord as i, type DomainDeletedResponse as j, type DomainListResponse as k, type DomainResponse as l, DomainsResource as m, type DropAction as n, type DropContentFile as o, type DropDeploymentResponse as p, type DropOptions as q, type DropResponse as r, DropsResource as s, type DropthisClientOptions as t, type DropthisErrorResponse as u, type DropthisResult as v, type ListDeploymentsParams as w, type ListDeploymentsResponse as x, type ListPage as y, type PreparedPublishRequest as z };
@@ -205,6 +205,8 @@ function optionsBody(options) {
205
205
  if (options.expiresAt !== void 0) {
206
206
  body.expiresAt = options.expiresAt instanceof Date ? options.expiresAt.toISOString() : options.expiresAt;
207
207
  }
208
+ if (options.domain !== void 0) body.domain = options.domain;
209
+ if (options.slug !== void 0) body.slug = options.slug;
208
210
  return body;
209
211
  }
210
212
  function updateContentOptions(options) {
@@ -500,6 +502,67 @@ var DeploymentsResource = class {
500
502
  }
501
503
  };
502
504
 
505
+ // src/resources/domains.ts
506
+ var DomainsResource = class {
507
+ constructor(transport) {
508
+ this.transport = transport;
509
+ }
510
+ transport;
511
+ /**
512
+ * Connect a custom domain to the account. Returns the domain in `pending_dns` status with
513
+ * DNS instructions. Idempotent on (account, hostname) — re-connecting an already-connected
514
+ * domain returns the existing row. POST /domains.
515
+ */
516
+ connect(input) {
517
+ return this.transport.request("POST", "/domains", { body: input });
518
+ }
519
+ /** List all custom domains connected to this account. GET /domains. */
520
+ list() {
521
+ return this.transport.request("GET", "/domains");
522
+ }
523
+ /** Get a domain by its stable id or hostname. GET /domains/{id_or_hostname}. */
524
+ get(idOrHostname) {
525
+ return this.transport.request(
526
+ "GET",
527
+ `/domains/${encodeURIComponent(idOrHostname)}`
528
+ );
529
+ }
530
+ /**
531
+ * Trigger a DNS + Cloudflare verification check. Returns the domain with updated status and
532
+ * per-record diagnostics. If DNS is still propagating, `dns[].retryAfter` tells you when to
533
+ * re-call. POST /domains/{id_or_hostname}/verify.
534
+ */
535
+ verify(idOrHostname) {
536
+ return this.transport.request(
537
+ "POST",
538
+ `/domains/${encodeURIComponent(idOrHostname)}/verify`
539
+ );
540
+ }
541
+ /**
542
+ * Update a domain's `dropId` (dedicated mode: repoint to a different drop) or `default`
543
+ * flag (path mode only: set/clear the account's default publish domain). Mode is immutable
544
+ * — delete and reconnect to change it. PATCH /domains/{id_or_hostname}.
545
+ */
546
+ update(idOrHostname, input) {
547
+ return this.transport.request(
548
+ "PATCH",
549
+ `/domains/${encodeURIComponent(idOrHostname)}`,
550
+ { body: input }
551
+ );
552
+ }
553
+ /**
554
+ * Delete a custom domain and remove all its routes. The response includes a dangling-CNAME
555
+ * warning — remove the DNS record after deleting so another account cannot re-claim the
556
+ * hostname. DELETE /domains/{id_or_hostname}.
557
+ */
558
+ delete(idOrHostname) {
559
+ return this.transport.request(
560
+ "DELETE",
561
+ `/domains/${encodeURIComponent(idOrHostname)}`
562
+ );
563
+ }
564
+ };
565
+
503
566
  // src/pagination.ts
504
567
  var CursorPage = class {
505
568
  object = "list";
@@ -664,8 +727,16 @@ var DropsResource = class {
664
727
  }
665
728
  /**
666
729
  * Change an EXISTING drop's settings — title, visibility, password, noindex, expiry,
667
- * metadata — by its `drop_…` id. Does not touch content; replace that with {@link updateContent}.
668
- * Idempotent. PATCH /drops/{id}.
730
+ * metadata, domain, or slug — by its `drop_…` id. Does not touch content; replace that
731
+ * with {@link updateContent}. Idempotent. PATCH /drops/{id}.
732
+ *
733
+ * **`domain`** — move the drop to a different custom domain (must be live). Pass `null` to
734
+ * move the drop back to the shared pool (unmount from its current domain).
735
+ *
736
+ * **`slug`** — rename the vanity slug on a path-mode custom domain. Only valid when the drop
737
+ * lives on a path-mode domain. Unlike {@link publish} (which auto-suffixes taken slugs),
738
+ * `updateSettings` returns 409 on a slug conflict and never auto-suffixes — your code must
739
+ * catch 409 and retry with a different slug. Passing `slug` on the shared pool returns 422.
669
740
  */
670
741
  updateSettings(dropId, options = {}) {
671
742
  const requestOptions = {
@@ -713,7 +784,9 @@ var SETTINGS = [
713
784
  "visibility",
714
785
  "password",
715
786
  "noindex",
716
- "expiresAt"
787
+ "expiresAt",
788
+ "domain",
789
+ "slug"
717
790
  ];
718
791
  function updateBody(options) {
719
792
  const out = {};
@@ -997,6 +1070,7 @@ var DropthisEdge = class {
997
1070
  accountResource;
998
1071
  apiKeysResource;
999
1072
  deploymentsResource;
1073
+ domainsResource;
1000
1074
  constructor(options = {}) {
1001
1075
  this.transport = new Transport(options);
1002
1076
  }
@@ -1020,6 +1094,11 @@ var DropthisEdge = class {
1020
1094
  this.deploymentsResource = new DeploymentsResource(this.transport);
1021
1095
  return this.deploymentsResource;
1022
1096
  }
1097
+ get domains() {
1098
+ if (!this.domainsResource)
1099
+ this.domainsResource = new DomainsResource(this.transport);
1100
+ return this.domainsResource;
1101
+ }
1023
1102
  };
1024
1103
  // Annotate the CommonJS export names for ESM import in node:
1025
1104
  0 && (module.exports = {