@dropthis/mcp
Advanced tools
| type DropthisClientOptions = { | ||
| apiKey?: string; | ||
| baseUrl?: string; | ||
| timeoutMs?: number; | ||
| uploadTimeoutMs?: number; | ||
| fetch?: typeof globalThis.fetch; | ||
| /** | ||
| * Default workspace slug or id applied to every publish/prepare call that | ||
| * does not supply its own `options.workspace`. Delegated credentials only; | ||
| * ignored by pinned service keys. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type RequestOptions = { | ||
| authenticated?: boolean; | ||
| idempotencyKey?: string; | ||
| ifRevision?: number; | ||
| timeoutMs?: number; | ||
| }; | ||
| type DropthisErrorResponse = { | ||
| code: string; | ||
| message: string; | ||
| statusCode: number | null; | ||
| type?: string; | ||
| title?: string; | ||
| detail?: string | null; | ||
| instance?: string | null; | ||
| param?: string | null; | ||
| currentRevision?: number; | ||
| requestId?: string | null; | ||
| suggestion?: string | null; | ||
| retryable?: boolean | null; | ||
| /** The gated capability (on `feature_not_in_plan`), e.g. `password_protect`. */ | ||
| feature?: string | null; | ||
| /** The caller's current plan (on `feature_not_in_plan` / `quota_exceeded`). */ | ||
| currentPlan?: string | null; | ||
| /** The lowest plan that unlocks the feature (on `feature_not_in_plan`). */ | ||
| requiredPlan?: string | null; | ||
| /** The pricing/upgrade URL to hand a human (on a plan gate). */ | ||
| upgradeUrl?: string | null; | ||
| /** Numeric ceiling that was hit (on `quota_exceeded`). */ | ||
| limit?: number | null; | ||
| /** Amount already used toward the ceiling (on `quota_exceeded`). */ | ||
| used?: number | null; | ||
| /** Amount the request asked for (on `quota_exceeded`). */ | ||
| requested?: number | null; | ||
| body?: unknown; | ||
| }; | ||
| type DropthisResult<T> = { | ||
| data: T; | ||
| error: null; | ||
| headers: Record<string, string>; | ||
| } | { | ||
| data: null; | ||
| error: DropthisErrorResponse; | ||
| headers: Record<string, string>; | ||
| }; | ||
| type ActionResolve = { | ||
| method: string; | ||
| url?: string | null; | ||
| endpoint?: string | null; | ||
| }; | ||
| type DropAction = { | ||
| code: string; | ||
| kind: "api" | "human"; | ||
| priority: "required" | "suggested"; | ||
| message: string; | ||
| resolve?: ActionResolve | null; | ||
| }; | ||
| type TierInfo = { | ||
| name: string; | ||
| maxSizeBytes: number; | ||
| ttlDays: number | null; | ||
| persistent: boolean; | ||
| badge: boolean; | ||
| }; | ||
| type Limitations = { | ||
| actions: DropAction[]; | ||
| }; | ||
| /** | ||
| * Workspace context echoed on every drop response. Identifies which workspace | ||
| * the drop was published into (ADR 0066). | ||
| */ | ||
| type DropWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| }; | ||
| type DropResponse = { | ||
| id: string; | ||
| slug: string; | ||
| url: string; | ||
| deploymentId: string | null; | ||
| title: string; | ||
| contentType: string; | ||
| visibility: string; | ||
| status: string; | ||
| revision: number; | ||
| contentRevision: number; | ||
| accessRevision: number; | ||
| sizeBytes: number; | ||
| renderMode: string; | ||
| warnings: Array<Record<string, unknown>>; | ||
| createdAt: string; | ||
| expiresAt: string | null; | ||
| noindex: boolean; | ||
| passwordProtected: boolean; | ||
| metadata: Record<string, unknown>; | ||
| /** When the drop was last updated (content or settings), ISO 8601. */ | ||
| updatedAt: string; | ||
| /** Origin that created the drop (e.g. "api", "cli", "mcp"); null/omitted when unattributed. */ | ||
| source?: string | null; | ||
| object: string; | ||
| accessible: boolean; | ||
| persistent: boolean; | ||
| badgeApplied: boolean; | ||
| tier: TierInfo; | ||
| limitations: Limitations; | ||
| /** Hostname of the custom domain this drop is mounted on; null for shared-pool drops. */ | ||
| domain: string | null; | ||
| /** | ||
| * Direct URL to the drop's raw bytes — the agent byte-fetch path. The canonical | ||
| * `url` always serves a branded human view (so the badge is guaranteed); `rawUrl` | ||
| * serves the underlying file's exact bytes at its natural path under the mount | ||
| * (ADR 0061). Populated only for single-file (`renderMode: "file_viewer"`) drops | ||
| * (= canonical URL + the entry filename); `null` for `user_html` drops (the page | ||
| * IS the artifact) and collections (per-file natural paths come from the manifest — | ||
| * see {@link DeploymentContentManifest}). Hand `url` to humans and `rawUrl` to agents. | ||
| * To stream bytes through the SDK regardless of drop kind, use `drops.getContent()`. | ||
| */ | ||
| rawUrl: string | null; | ||
| /** The workspace this drop belongs to (echoed from the server on every response). */ | ||
| workspace: DropWorkspace; | ||
| }; | ||
| type DropDeploymentResponse = { | ||
| id: string; | ||
| dropId: string; | ||
| revision: number; | ||
| status: string; | ||
| entry: string | null; | ||
| contentType: string; | ||
| renderMode: string; | ||
| files: Array<Record<string, unknown>>; | ||
| warnings: Array<Record<string, unknown>>; | ||
| sizeBytes: number; | ||
| classificationVersion: number; | ||
| classificationReason: string; | ||
| errorCode: string | null; | ||
| errorMessage: string | null; | ||
| createdAt: string; | ||
| readyAt: string | null; | ||
| publishedAt: string | null; | ||
| }; | ||
| type ListDeploymentsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| }; | ||
| type ListDeploymentsResponse = { | ||
| deployments: DropDeploymentResponse[]; | ||
| nextCursor: string | null; | ||
| }; | ||
| type ListPage<T> = { | ||
| object: "list"; | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| }; | ||
| type Action = { | ||
| code: string; | ||
| kind: string; | ||
| method?: string | null; | ||
| endpoint?: string | null; | ||
| message: string; | ||
| }; | ||
| type EmailOtpResponse = { | ||
| /** Always `true` on success; optional because the server defaults it. */ | ||
| ok?: true; | ||
| expiresIn: number; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type SessionResponse = { | ||
| object: "session"; | ||
| token: string; | ||
| accountId: string; | ||
| isNewAccount: boolean; | ||
| expiresIn: number; | ||
| /** | ||
| * Rotating refresh token for a console browser session. Present when a session is | ||
| * started (email/verify, refresh); `null`/omitted for non-session token issuance. | ||
| */ | ||
| refreshToken?: string | null; | ||
| }; | ||
| /** | ||
| * Why an API key exists. `delegated` keys act on behalf of the owning account (scoped | ||
| * to the active workspace or an allowed set); `service` keys are pinned to a single | ||
| * workspace and are intended for CI/automation. | ||
| */ | ||
| type KeyType = "delegated" | "service"; | ||
| /** What breaks when a key is revoked. */ | ||
| type RevokeImpact = "disconnects_app" | "breaks_automation"; | ||
| type ApiKeyResponse = { | ||
| object: "api_key"; | ||
| id: string; | ||
| keyLast4: string; | ||
| label: string; | ||
| /** Human-facing credential name: the user's label for `standard` keys, the connected client name for `mcp_oauth` keys. */ | ||
| appName: string; | ||
| /** Why the key exists (drives quota accounting). */ | ||
| keyType: KeyType; | ||
| /** Scopes granted to this key. */ | ||
| scopes: string[]; | ||
| /** When the key was last used to authenticate, ISO 8601; null/omitted if never used. */ | ||
| lastUsedAt?: string | null; | ||
| /** What breaks if this key is revoked. */ | ||
| revokeImpact: RevokeImpact; | ||
| createdAt: string; | ||
| }; | ||
| type ApiKeyCreatedResponse = ApiKeyResponse & { | ||
| key: string; | ||
| accountId?: string | null; | ||
| isNewAccount?: boolean; | ||
| }; | ||
| /** Numeric limits for the active plan — use these to size a publish before uploading. */ | ||
| type EntitlementLimits = { | ||
| /** Maximum size of a single drop in bytes. */ | ||
| maxSizeBytes: number; | ||
| /** Total account storage cap in bytes; null means no account-level cap. */ | ||
| maxStorageBytes: number | null; | ||
| /** Drop lifetime in seconds before expiry; null means drops are permanent. */ | ||
| defaultTtlSeconds: number | null; | ||
| /** Maximum number of custom hostnames the workspace may connect. */ | ||
| maxCustomHostnames: number; | ||
| /** Maximum members the workspace may hold (owner included). */ | ||
| seatLimit: number; | ||
| /** Maximum concurrent in-flight upload sessions (a transient concurrency cap). */ | ||
| maxActiveUploadSessions: number; | ||
| }; | ||
| /** | ||
| * The full capability matrix for the active plan — the single read to pre-check a | ||
| * feature gate before attempting an operation. | ||
| */ | ||
| type Entitlements = { | ||
| /** | ||
| * Per-capability state for the active plan. Boolean caps are `true`/`false`; | ||
| * enum caps (`ogPreview`, `analytics`) carry a value — compare by value, never | ||
| * truthiness (`"none"` is truthy). | ||
| */ | ||
| capabilities: Record<string, boolean | string>; | ||
| /** | ||
| * The lowest plan that unlocks each gated capability — drives the upgrade nudge. | ||
| * Enum sub-values are keyed `ogPreview.customImage` / `analytics.full`. | ||
| */ | ||
| requiredPlan: Record<string, string>; | ||
| /** Numeric limits for the active plan. */ | ||
| limits: EntitlementLimits; | ||
| }; | ||
| /** Current resource usage for the account's active workspace. */ | ||
| type AccountUsage = { | ||
| /** Total bytes consumed across all active drops. */ | ||
| storageUsedBytes: number; | ||
| /** Number of custom domain hostnames currently in use. */ | ||
| customDomainsUsed: number; | ||
| /** Members currently in the workspace (owner included). */ | ||
| seatsUsed: number; | ||
| }; | ||
| /** The workspace a principal acts within (ADR 0066). For an sk_ API key, the workspace the key is bound to. */ | ||
| type AccountWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` when shared with other members. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| }; | ||
| /** | ||
| * A workspace the caller belongs to or has delegated access to. | ||
| * Returned by `GET /v1/workspaces` and `PUT /v1/account/active-workspace`. | ||
| */ | ||
| type Workspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| /** The plan tier of this workspace. */ | ||
| plan: string; | ||
| /** Whether this workspace is currently the caller's active workspace. */ | ||
| isActive: boolean; | ||
| /** | ||
| * On CREATE only (null otherwise): whether the credential that created this workspace can act | ||
| * in it. `false` means an allowlist-restricted key created a workspace outside its allowlist — | ||
| * it will be denied on the next write; re-authenticate to obtain a credential that reaches it. | ||
| */ | ||
| creatorCanReach?: boolean | null; | ||
| }; | ||
| /** A role grantable via invite or a member role-change (owner is transferred, never granted). */ | ||
| type WorkspaceRole = "owner" | "admin" | "member"; | ||
| type InvitableRole = "admin" | "member"; | ||
| /** A member of a team workspace. */ | ||
| type Member = { | ||
| accountId: string; | ||
| /** The member's email, or null if their account was deleted. */ | ||
| email: string | null; | ||
| role: WorkspaceRole; | ||
| /** Whether this row is the calling account. */ | ||
| isYou: boolean; | ||
| joinedAt: string; | ||
| }; | ||
| type MemberListResponse = { | ||
| members: Member[]; | ||
| }; | ||
| /** An invitation to join a team workspace. */ | ||
| type Invitation = { | ||
| id: string; | ||
| workspaceId: string; | ||
| email: string; | ||
| role: WorkspaceRole; | ||
| /** `pending`, `accepted`, or `revoked`. */ | ||
| status: string; | ||
| expiresAt: string; | ||
| createdAt: string; | ||
| acceptedAt?: string | null; | ||
| }; | ||
| type InvitationListResponse = { | ||
| invitations: Invitation[]; | ||
| }; | ||
| type AccountResponse = { | ||
| id: string; | ||
| email: string; | ||
| displayName: string | null; | ||
| plan: string; | ||
| status: string; | ||
| createdAt: string; | ||
| /** The full capability matrix + numeric limits for the active plan. */ | ||
| entitlements: Entitlements; | ||
| usage: AccountUsage; | ||
| workspace: AccountWorkspace; | ||
| /** URL to upgrade; present on every plan below Business, null on the top tier. */ | ||
| upgradeUrl: string | null; | ||
| }; | ||
| type ListDropsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| /** Only drops mounted on this custom domain hostname (e.g. "reports.example.com"). */ | ||
| domain?: string; | ||
| }; | ||
| /** | ||
| * One file in an upload manifest. A discriminated union: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes through a signed PUT. Requires | ||
| * `contentType` and `sizeBytes`; an optional `checksumSha256` locks the | ||
| * transfer integrity. | ||
| * - **remote** — the server fetches the bytes itself from `sourceUrl` during | ||
| * `POST /uploads/{id}/ingest`. No bytes leave this process, so `sizeBytes`, | ||
| * `contentType`, and `checksumSha256` are all optional (the server infers | ||
| * them on fetch). Carries NO signed PUT target. | ||
| * | ||
| * `sourceUrl` is the discriminant: present ⇒ remote, absent ⇒ client-put. The | ||
| * camelCase `sourceUrl` becomes the wire field `source_url` via the transport's | ||
| * snake_case conversion (exactly like `contentType` → `content_type`). | ||
| */ | ||
| type UploadManifestFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string | null; | ||
| sourceUrl?: never; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| sizeBytes?: number; | ||
| checksumSha256?: string | null; | ||
| transform?: ImageTransform; | ||
| }; | ||
| type CreateUploadSessionRequest = { | ||
| schemaVersion?: 1; | ||
| files: UploadManifestFile[]; | ||
| entry?: string | null; | ||
| /** | ||
| * Target workspace slug or id for this upload session. Delegated credentials only; | ||
| * ignored by pinned service keys. Bound at session creation and inherited by the | ||
| * subsequent POST /drops call. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type UploadTarget = { | ||
| /** Always `single_put` — one signed PUT per file is the upload contract. */ | ||
| strategy: "single_put"; | ||
| url: string; | ||
| headers: Record<string, string>; | ||
| expiresAt: string; | ||
| }; | ||
| type CreateUploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| objectKey: string; | ||
| upload: UploadTarget; | ||
| }; | ||
| type UploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| /** Declared MIME type; `null`/omitted for remote-fetch files until ingested. */ | ||
| contentType?: string | null; | ||
| /** Declared byte size; `null`/omitted for remote-fetch files until ingested. */ | ||
| sizeBytes?: number | null; | ||
| objectKey: string; | ||
| /** How the file enters staging: "client_put" (client PUTs bytes) or "remote_fetch" (server fetches sourceUrl). */ | ||
| origin: "client_put" | "remote_fetch"; | ||
| /** Ingest lifecycle state for remote-fetch files (e.g. "pending" | "fetching" | "fetched" | "failed"). */ | ||
| state: string; | ||
| /** Public http(s) URL the server fetches into staging; `null`/omitted for client-put files. */ | ||
| sourceUrl?: string | null; | ||
| verified: boolean; | ||
| }; | ||
| type UploadSessionResponse = { | ||
| uploadId: string; | ||
| status: string; | ||
| expiresAt: string; | ||
| entry?: string | null; | ||
| files: UploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type CreateUploadSessionResponse = { | ||
| uploadId: string; | ||
| expiresAt: string; | ||
| files: CreateUploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| /** | ||
| * Sentinel for `DropOptions.domain`: publish to the shared pool even when the | ||
| * account has a default custom domain (dropthis#55). Collision-free — the | ||
| * literal "shared" can never be a real hostname (single-label names are | ||
| * rejected at domain connect). These drops read back `domain: null`. | ||
| */ | ||
| declare const SHARED_POOL = "shared"; | ||
| type DropOptions = { | ||
| /** Drop title. */ | ||
| title?: string; | ||
| /** public (default) or unlisted. */ | ||
| visibility?: "public" | "unlisted"; | ||
| /** Require password to view. Pass `null` to remove password protection. */ | ||
| password?: string | null; | ||
| /** Prevent search-engine indexing. Pass `null` to allow indexing (default). */ | ||
| noindex?: boolean | null; | ||
| /** Auto-delete after this ISO 8601 date. Pass `null` to clear. */ | ||
| expiresAt?: string | Date | null; | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */ | ||
| metadata?: Record<string, unknown>; | ||
| /** | ||
| * Hostname of a custom domain connected to this account (must be live — see | ||
| * `client.domains`), or {@link SHARED_POOL} (`"shared"`) to publish to the shared | ||
| * pool even when the account has a default domain. Path-mode domains serve the drop | ||
| * at `https://{domain}/{slug}/`; dedicated domains serve it at the root and conflict | ||
| * (409) once occupied. Omit to use the account's default path domain if one exists, | ||
| * else the shared pool. | ||
| */ | ||
| domain?: string | null; | ||
| /** | ||
| * Vanity slug — only valid when the target is a path-mode custom domain. 1–63 | ||
| * lowercase letters/digits/hyphens (no leading/trailing/double hyphen). Taken slugs | ||
| * are auto-suffixed; omit for a random slug. Setting this on the shared pool returns | ||
| * 422. | ||
| */ | ||
| slug?: string | null; | ||
| }; | ||
| type PrepareOptions = { | ||
| /** Glob patterns to ignore when publishing directories. */ | ||
| ignore?: string[]; | ||
| /** Disable default ignore patterns. */ | ||
| ignoreDefaults?: boolean; | ||
| /** Override MIME type (auto-detected from extension). */ | ||
| contentType?: string; | ||
| /** Set filename when publishing from stdin or bytes. */ | ||
| path?: string; | ||
| }; | ||
| type RequestControls = { | ||
| /** Prevent duplicate publishes on retry (auto-generated by CLI). */ | ||
| idempotencyKey?: string; | ||
| /** Fail if current revision doesn't match -- optimistic lock (update only). */ | ||
| ifRevision?: number; | ||
| }; | ||
| type PublishOptions = DropOptions & PrepareOptions & RequestControls & { | ||
| /** | ||
| * Target workspace slug or id — publish/prepare only (a fresh drop's workspace). | ||
| * Delegated credentials only; ignored by pinned service keys. Falls back to the | ||
| * client-level `workspace` default when omitted. Not a settings field: it is NOT | ||
| * accepted by `updateSettings` (a drop never moves workspace) nor by `updateContent` | ||
| * (which stays in the drop's own workspace). | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * Options for `drops.updateContent()` — content-only. A content update ships a new content version | ||
| * and never changes drop settings (title, visibility, password, noindex, expiry, metadata); those | ||
| * belong on `drops.updateSettings()`. Carries only content-prep + request controls + the bundle | ||
| * `entry`. | ||
| */ | ||
| type UpdateContentOptions = PrepareOptions & RequestControls & { | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** | ||
| * How the supplied files combine with what the drop already serves | ||
| * (partial-by-default, ADR 0065): | ||
| * | ||
| * - `"patch"` (default): the supplied files upsert by path and every | ||
| * unmentioned file is carried forward, so editing one file never drops the | ||
| * rest. Use `deletePaths` to remove files. | ||
| * - `"replace"`: the supplied files become the drop's entire content set — | ||
| * a full swap. Anything not supplied is gone. `deletePaths` is invalid here. | ||
| * | ||
| * Omit to default to `"patch"`. | ||
| */ | ||
| mode?: "patch" | "replace"; | ||
| /** | ||
| * Paths to remove from the drop's content (patch-mode only). Each path must | ||
| * exist or the server rejects the update (loud, never a silent no-op). Invalid | ||
| * with `mode: "replace"`. Wire field: `delete_paths`. | ||
| */ | ||
| deletePaths?: string[]; | ||
| }; | ||
| /** | ||
| * One file in a multi-file `{ kind: "files" }` bundle. Supply the bytes inline | ||
| * exactly one way — `content` (UTF-8 text), `contentBase64`, or `bytes` — OR set | ||
| * `sourceUrl` to a public http(s) URL and let the server fetch that file for you | ||
| * server-side (no bytes pass through your process). A single entry may NOT carry | ||
| * both inline bytes and `sourceUrl`. Mix freely within one bundle: e.g. inline | ||
| * `content` for `index.html` plus a `sourceUrl` for each image referenced by it, | ||
| * yielding one self-contained drop. | ||
| */ | ||
| /** | ||
| * Optional server-side image transform applied to a `sourceUrl` file on ingest | ||
| * (publish by reference). The server resizes/re-encodes the fetched image so you can | ||
| * point at a big original and store a small web-optimised derivative. Fits inside the | ||
| * given box preserving aspect ratio, never upscales, strips metadata. Only valid on | ||
| * `sourceUrl` entries; when set, omit `sizeBytes`/`checksumSha256` (the stored object | ||
| * reflects the transform OUTPUT, computed server-side). | ||
| */ | ||
| type ImageTransform = { | ||
| /** Max output width in pixels (fit inside, no upscale). */ | ||
| width?: number; | ||
| /** Max output height in pixels (fit inside, no upscale). */ | ||
| height?: number; | ||
| /** Encoder quality 1-100 (jpeg/webp). */ | ||
| quality?: number; | ||
| /** Output format. Omit to keep the source raster format. */ | ||
| format?: "jpeg" | "png" | "webp"; | ||
| }; | ||
| type PublishFileInput = { | ||
| path: string; | ||
| contentType?: string; | ||
| content?: string; | ||
| contentBase64?: string; | ||
| bytes?: Uint8Array; | ||
| /** | ||
| * Public http(s) URL the server fetches this file's bytes from during publish | ||
| * (publish by reference). Mutually exclusive with `content`/`contentBase64`/`bytes`. | ||
| */ | ||
| sourceUrl?: string; | ||
| /** | ||
| * Optional image transform applied server-side to a `sourceUrl` file on ingest | ||
| * (resize/re-encode). Only valid with `sourceUrl`; when set, omit | ||
| * `sizeBytes`/`checksumSha256` (the stored object reflects the output). | ||
| */ | ||
| transform?: ImageTransform; | ||
| /** | ||
| * Declared byte size of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server uses this for upfront quota admission before fetching, | ||
| * so a large file is rejected immediately rather than after the server downloads it. | ||
| * Ignored for inline files (size is computed from the bytes). | ||
| */ | ||
| sizeBytes?: number; | ||
| /** | ||
| * Expected SHA-256 hex digest of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server verifies the fetched content matches this checksum and | ||
| * rejects the publish if it does not, giving you integrity verification without | ||
| * downloading the bytes yourself. | ||
| * Ignored for inline files (checksum is computed by the SDK/server from actual bytes). | ||
| */ | ||
| checksumSha256?: string; | ||
| }; | ||
| type PublishInput = string | string[] | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| /** Structured next-step hint returned by domain operations (and publish). */ | ||
| type NextHint = { | ||
| action: string; | ||
| message: string; | ||
| }; | ||
| /** One DNS record instruction or diagnostic for a custom domain. */ | ||
| type DnsRecord = { | ||
| /** Purpose of the record, e.g. "routing". */ | ||
| purpose: string; | ||
| /** DNS record type, e.g. "CNAME". */ | ||
| type: string; | ||
| /** The DNS name to create the record for. */ | ||
| name: string; | ||
| /** The value the record must point at. */ | ||
| value: string; | ||
| /** Current DNS status: "missing" | "ok" | "mismatch". */ | ||
| status: "missing" | "ok" | "mismatch"; | ||
| /** What DoH currently resolves for this record (verify only). */ | ||
| observed?: string | null; | ||
| /** Specific guidance for fixing this record. */ | ||
| hint?: string | null; | ||
| /** Seconds to wait before retrying verify while DNS/cert propagates. */ | ||
| retryAfter?: number | null; | ||
| }; | ||
| /** Full domain resource representation. */ | ||
| type DomainResponse = { | ||
| object: "domain"; | ||
| /** Stable domain identifier. */ | ||
| id: string; | ||
| /** Canonical hostname registered with dropthis. */ | ||
| hostname: string; | ||
| /** Mount mode: "path" (many drops at hostname/{slug}/) or "dedicated" (one drop at hostname/). */ | ||
| mode: "path" | "dedicated"; | ||
| /** Lifecycle status: "pending_dns" | "verifying" | "live" | "failed". */ | ||
| status: "pending_dns" | "verifying" | "live" | "failed"; | ||
| /** Reason for failure status. */ | ||
| failureReason?: string | null; | ||
| /** Whether this is the account's default publish domain. */ | ||
| default: boolean; | ||
| /** Mounted drop id (dedicated mode only). */ | ||
| dropId?: string | null; | ||
| /** DNS records required for this domain. */ | ||
| dns: DnsRecord[]; | ||
| /** Creation timestamp. */ | ||
| createdAt: string; | ||
| /** When the domain first reached "live" status. */ | ||
| verifiedAt?: string | null; | ||
| /** Structured next-step hints for the agent. */ | ||
| next: NextHint[]; | ||
| /** | ||
| * Deep link to this domain's setup page in the dropthis console | ||
| * (e.g. https://app.dropthis.app/domains/dom_…). Hand this to a human so | ||
| * they can add the DNS record and watch it go live in a polished UI. | ||
| */ | ||
| consoleUrl: string; | ||
| }; | ||
| /** List of domains for the account. */ | ||
| type DomainListResponse = { | ||
| object: "domain.list"; | ||
| /** Domains connected to this account. */ | ||
| domains: DomainResponse[]; | ||
| }; | ||
| /** Response body for a successful domain deletion. */ | ||
| type DomainDeletedResponse = { | ||
| object: "domain.deleted"; | ||
| /** Id of the deleted domain. */ | ||
| id: string; | ||
| /** Hostname of the deleted domain. */ | ||
| hostname: string; | ||
| /** Dangling-CNAME risk warning (always present; instructs you to remove the DNS record). */ | ||
| warning: string; | ||
| }; | ||
| /** One readable file in a deployment's content manifest. */ | ||
| type DeploymentContentFile = { | ||
| /** File path within the deployment, relative to its root. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with. */ | ||
| contentType: string; | ||
| /** Stored file size in bytes. */ | ||
| sizeBytes: number; | ||
| }; | ||
| /** | ||
| * Manifest of one deployment's readable files (content read-back). | ||
| * Fetch a single file's bytes with `drops.getContent(dropId, { path })`. | ||
| */ | ||
| type DeploymentContentManifest = { | ||
| /** Parent drop identifier. */ | ||
| dropId: string; | ||
| /** Deployment identifier. */ | ||
| deploymentId: string; | ||
| /** Content revision of this deployment. */ | ||
| revision: number; | ||
| /** Deployment lifecycle status. */ | ||
| status: string; | ||
| /** Total deployment size in bytes. */ | ||
| sizeBytes: number; | ||
| /** Entry path served at the drop root. */ | ||
| entry?: string | null; | ||
| /** Readable files in this deployment; pass files[].path as `path` to download one. */ | ||
| files: DeploymentContentFile[]; | ||
| }; | ||
| /** Options for `drops.getContent()`. */ | ||
| type GetContentOptions = { | ||
| /** Read a historical deployment instead of the current one. */ | ||
| deploymentId?: string; | ||
| /** Download this single file's raw stored bytes instead of the JSON manifest. */ | ||
| path?: string; | ||
| }; | ||
| /** A single file downloaded via `drops.getContent(dropId, { path })`. */ | ||
| type DropContentFile = { | ||
| /** The requested file path. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with (from the response Content-Type). */ | ||
| contentType: string | null; | ||
| /** Exact stored bytes. */ | ||
| bytes: Uint8Array; | ||
| /** Decode the bytes as UTF-8 text. */ | ||
| text(): string; | ||
| }; | ||
| declare class Transport { | ||
| readonly apiKey: string | undefined; | ||
| readonly baseUrl: string; | ||
| readonly timeoutMs: number; | ||
| readonly uploadTimeoutMs: number; | ||
| readonly fetchImpl: typeof globalThis.fetch; | ||
| constructor(options?: DropthisClientOptions | string); | ||
| putSignedUrl(url: string, body: Uint8Array | Blob | ReadableStream, headers: Record<string, string>): Promise<DropthisResult<{ | ||
| etag: string | null; | ||
| }>>; | ||
| /** | ||
| * Authenticated GET that returns the raw response bytes untouched (no JSON parsing, | ||
| * no case conversion). Error responses are still parsed as problem+json. Used for | ||
| * content read-back (`drops.getContent` with a file path). | ||
| */ | ||
| requestBytes(path: string, options?: RequestOptions & { | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<{ | ||
| bytes: Uint8Array; | ||
| contentType: string | null; | ||
| }>>; | ||
| request<T>(method: string, path: string, options?: RequestOptions & { | ||
| body?: unknown; | ||
| bodyCase?: "snake" | "raw"; | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<T>>; | ||
| } | ||
| /** | ||
| * A file ready to be staged for upload. Two shapes: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes. The body is lazy: the orchestrator | ||
| * calls `getBody()` per file when it is ready to push bytes to the signed URL. | ||
| * This keeps the resolution layer pure and lets the filesystem layer (node.ts) | ||
| * defer reads/streams until upload time. | ||
| * - **remote** (`sourceUrl` set, no `getBody`) — the server fetches the bytes from | ||
| * `sourceUrl` during `POST /uploads/{id}/ingest`. No bytes leave this process, so | ||
| * it has no `getBody`, no `sizeBytes`, and consumes no signed PUT target. | ||
| */ | ||
| type PreparedUploadFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string; | ||
| sourceUrl?: never; | ||
| getBody(): Promise<Uint8Array | Blob | ReadableStream>; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| /** Optional hint: declared byte size for upfront quota admission (server-side). */ | ||
| sizeBytes?: number; | ||
| /** Optional hint: expected SHA-256 hex digest for server-side integrity check. */ | ||
| checksumSha256?: string; | ||
| /** Optional server-side image transform applied on ingest (resize/re-encode). */ | ||
| transform?: ImageTransform; | ||
| getBody?: never; | ||
| }; | ||
| /** | ||
| * Resolves a publish input into a {@link PreparedPublishRequest}. Two implementations exist: | ||
| * the fs-free {@link resolveInMemory} (Workers-safe) and the fs-capable `resolveInput` in | ||
| * `publish/node.ts`. `DropsResource` takes one by injection so it can power both the Node client | ||
| * and the edge client WITHOUT statically importing the Node-only pipeline (which would poison the | ||
| * Workers bundle with `node:fs`/`fast-glob`). `TInput` is the input type the chosen resolver | ||
| * accepts ({@link InMemoryPublishInput} on the edge, the full `PublishInput` on Node). | ||
| */ | ||
| type PublishInputResolver<TInput> = (input: TInput, options: PublishOptions) => Promise<PreparedPublishRequest>; | ||
| type PreparedPublishRequest = { | ||
| kind: "staged"; | ||
| manifest: CreateUploadSessionRequest; | ||
| files: PreparedUploadFile[]; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Bound at upload-session creation. */ | ||
| workspace?: string; | ||
| } | { | ||
| kind: "source"; | ||
| sourceUrl: string; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Forwarded as top-level field in POST /drops. */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * The canonical publish inputs that can be resolved with no filesystem access: | ||
| * the {@link PublishInput} union minus `string[]` (which is inherently a list | ||
| * of filesystem paths handled by node.ts). | ||
| */ | ||
| type InMemoryPublishInput = string | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| declare class AccountResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| get(): Promise<DropthisResult<AccountResponse>>; | ||
| update(input: { | ||
| displayName: string | null; | ||
| }): Promise<DropthisResult<AccountResponse>>; | ||
| delete(): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class ApiKeysResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| object: "list"; | ||
| data: ApiKeyResponse[]; | ||
| }>>; | ||
| create(input: { | ||
| label: string; | ||
| /** Key type: `"delegated"` (default on server) or `"service"` (pinned to a workspace). */ | ||
| type?: KeyType; | ||
| /** Pin a `service` key to this workspace slug or id. */ | ||
| workspace?: string; | ||
| /** Restrict a `delegated` key to these workspace slugs or ids. */ | ||
| allowedWorkspaces?: string[]; | ||
| /** | ||
| * Request the credential's capability scopes (ADR 0068). Each entry is a bundle | ||
| * name (`publish`, `team`, `team-admin`) or a fine-grained scope (`members:admin`). | ||
| * The minted key gets the requested set intersected with your own scopes | ||
| * (downscope-only). Omit for the default `publish` bundle; pass `["team"]` to mint | ||
| * a credential that can create + manage teams (`login --scope team`). | ||
| */ | ||
| scopes?: string[]; | ||
| }): Promise<DropthisResult<ApiKeyCreatedResponse>>; | ||
| /** Revoke an API key. 204 No Content — data is null on success. */ | ||
| delete(keyId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class DeploymentsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(dropId: string, params?: ListDeploymentsParams): Promise<DropthisResult<ListDeploymentsResponse>>; | ||
| get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>; | ||
| } | ||
| declare class DomainsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** | ||
| * Connect a custom domain to the account. Returns the domain in `pending_dns` status with | ||
| * DNS instructions. Idempotent on (account, hostname) — re-connecting an already-connected | ||
| * domain returns the existing row. POST /domains. | ||
| */ | ||
| connect(input: { | ||
| hostname: string; | ||
| mode: "path" | "dedicated"; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** List all custom domains connected to this account. GET /domains. */ | ||
| list(): Promise<DropthisResult<DomainListResponse>>; | ||
| /** Get a domain by its stable id or hostname. GET /domains/{id_or_hostname}. */ | ||
| get(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Trigger a DNS + Cloudflare verification check. Returns the domain with updated status and | ||
| * per-record diagnostics. If DNS is still propagating, `dns[].retryAfter` tells you when to | ||
| * re-call. POST /domains/{id_or_hostname}/verify. | ||
| */ | ||
| verify(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Update a domain's `dropId` (dedicated mode: repoint to a different drop) or `default` | ||
| * flag (path mode only: set/clear the account's default publish domain). Mode is immutable | ||
| * — delete and reconnect to change it. PATCH /domains/{id_or_hostname}. | ||
| */ | ||
| update(idOrHostname: string, input: { | ||
| dropId?: string | null; | ||
| default?: boolean | null; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Delete a custom domain and remove all its routes. The response includes a dangling-CNAME | ||
| * warning — remove the DNS record after deleting so another account cannot re-claim the | ||
| * hostname. DELETE /domains/{id_or_hostname}. | ||
| */ | ||
| delete(idOrHostname: string): Promise<DropthisResult<DomainDeletedResponse>>; | ||
| } | ||
| declare class CursorPage<T> implements ListPage<T> { | ||
| readonly object: "list"; | ||
| readonly data: T[]; | ||
| readonly hasMore: boolean; | ||
| readonly nextCursor: string | null; | ||
| /** Response headers from the fetch that produced this page. */ | ||
| readonly headers: Record<string, string>; | ||
| private readonly fetchNextPage; | ||
| constructor(input: { | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| headers?: Record<string, string>; | ||
| fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined; | ||
| }); | ||
| /** | ||
| * Collect items across every page into a single array. | ||
| * | ||
| * No-throw, consistent with the rest of the SDK's {@link DropthisResult} | ||
| * contract: returns `{ data: items, error: null }` on success, or | ||
| * `{ data: null, error }` if fetching a later page fails — never a thrown | ||
| * exception, and never a silently truncated list. Inspect `.error` | ||
| * (`code`/`statusCode`/`retryable`/`requestId`) exactly as you would for any | ||
| * other call. Pass `limit` to stop once that many items are collected. | ||
| */ | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| } | ||
| /** | ||
| * The drop lifecycle resource. `TInput` is the publish-input type the injected resolver accepts: | ||
| * the full `PublishInput` on the Node client, the fs-free `InMemoryPublishInput` on the edge. The | ||
| * resolver is injected (not statically imported) so this module never pulls in the Node-only | ||
| * publish pipeline and stays Workers-safe. | ||
| */ | ||
| declare class DropsResource<TInput = PublishInput> { | ||
| private readonly transport; | ||
| private readonly resolveInput; | ||
| private readonly defaultWorkspace?; | ||
| constructor(transport: Transport, resolveInput: PublishInputResolver<TInput>, defaultWorkspace?: string | undefined); | ||
| /** | ||
| * Publish content to a NEW permanent public URL; returns the created drop (with its `drop_…` id). | ||
| * Use to publish / share / post / put online / make public a report, dashboard, site, or file. | ||
| * Creates a NEW drop every call — to change something already published, use {@link updateContent} | ||
| * (the files at the URL) or {@link updateSettings} (title, visibility, password, expiry, | ||
| * metadata) with the drop's id; calling publish again makes a duplicate. POST /drops. | ||
| * | ||
| * Mount target: `options.domain` accepts a connected custom hostname, or `SHARED_POOL` | ||
| * (`"shared"`) to publish to the shared pool even when the account has a default domain. | ||
| * | ||
| * Two URLs come back on the response: `url` is the canonical, **always-branded** human | ||
| * view (badge guaranteed, no client detection); `rawUrl` is the drop's exact bytes at | ||
| * their natural path — hand it to other agents. `rawUrl` is populated only for single | ||
| * non-HTML files (`renderMode: "file_viewer"`) and is `null` for HTML drops and | ||
| * collections. To stream bytes through the SDK for any drop kind, use {@link getContent}. | ||
| */ | ||
| publish(input: TInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Replace the content of an EXISTING drop, keeping its URL (ships a new deployment). Requires the | ||
| * `drop_…` id from a publish response (not the slug/URL). Content-only: settings/metadata are | ||
| * stripped BEFORE prepare, so they are never sent — change those with {@link updateSettings}; create | ||
| * a new drop with {@link publish}. Not idempotent (each call is a new deployment) unless you pass the | ||
| * same `idempotencyKey`. POST /drops/{id}/deployments. | ||
| */ | ||
| updateContent(dropId: string, input: TInput, options?: UpdateContentOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * List the account's drops, newest first (paginated). Each item carries its `drop_…` id. | ||
| * Pass `domain` to only list drops mounted on that custom domain — the recovery path | ||
| * when you have a custom-domain URL but no drop id. GET /drops. | ||
| */ | ||
| list(params?: ListDropsParams): Promise<DropthisResult<CursorPage<DropResponse>>>; | ||
| /** Fetch one drop by its `drop_…` id (not the slug/URL). GET /drops/{id}. */ | ||
| get(dropId: string): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Resolve a public locator (a drop URL, a custom-domain URL, or a bare vanity/shared | ||
| * slug) back to the drop — the way to recover a lost `drop_…` id. Sends the raw target | ||
| * to the server (POST /drops/resolve), which owner-scopes and decomposes it. Returns the | ||
| * full drop, or `data: null` when nothing of yours matches. A `drop_…` id passed as the | ||
| * target round-trips to an owner-scoped id lookup (null instead of 404). | ||
| * | ||
| * Persist the drop_… id. URLs, raw_url, and slugs are locators, not identifiers — a vanity | ||
| * slug is renameable and the pool host rotates, so a stored URL can drift; the id never | ||
| * moves. Treat drop_… as an opaque case-sensitive string. | ||
| */ | ||
| resolve(target: string): Promise<DropthisResult<DropResponse | null>>; | ||
| /** | ||
| * Read back what a drop is serving (owner-only; works regardless of any viewer | ||
| * password). By default returns the JSON manifest of the CURRENT deployment's files; | ||
| * pass `deploymentId` to read a historical (even superseded) deployment — downloading | ||
| * an old version's files and republishing them via {@link updateContent} is the | ||
| * rollback path. Pass `path` (one of the manifest's `files[].path` values) to download | ||
| * that file's exact stored bytes instead. GET /drops/{id}/content. | ||
| */ | ||
| getContent(dropId: string, options: GetContentOptions & { | ||
| path: string; | ||
| }): Promise<DropthisResult<DropContentFile>>; | ||
| getContent(dropId: string, options?: Omit<GetContentOptions, "path">): Promise<DropthisResult<DeploymentContentManifest>>; | ||
| /** | ||
| * Change an EXISTING drop's settings — title, visibility, password, noindex, expiry, | ||
| * metadata, domain, or slug — by its `drop_…` id. Does not touch content; replace that | ||
| * with {@link updateContent}. Idempotent. PATCH /drops/{id}. | ||
| * | ||
| * **`domain`** — move the drop to a different custom domain (must be live). Pass `null` to | ||
| * move the drop back to the shared pool (unmount from its current domain). | ||
| * | ||
| * **`slug`** — rename the vanity slug on a path-mode custom domain. Only valid when the drop | ||
| * lives on a path-mode domain. Unlike {@link publish} (which auto-suffixes taken slugs), | ||
| * `updateSettings` returns 409 on a slug conflict and never auto-suffixes — your code must | ||
| * catch 409 and retry with a different slug. Passing `slug` on the shared pool returns 422. | ||
| */ | ||
| updateSettings(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>; | ||
| /** Permanently delete a drop and its public URL by its `drop_…` id. DELETE /drops/{id}. */ | ||
| delete(dropId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| /** Invitee-side invitations (ADR 0068). Listing needs `members:read`; accepting needs `members:write`. */ | ||
| declare class InvitationsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List the calling account's own pending invitations. */ | ||
| list(): Promise<DropthisResult<InvitationListResponse>>; | ||
| /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */ | ||
| accept(input: { | ||
| token: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */ | ||
| acceptById(input: { | ||
| invitationId: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| } | ||
| /** Team membership management (ADR 0068). Capability follows the credential's scopes. */ | ||
| declare class MembersResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List a workspace's members (any member, `members:read`). */ | ||
| list(workspaceId: string): Promise<DropthisResult<MemberListResponse>>; | ||
| /** Invite an email to the workspace (owner/admin, `members:write`). */ | ||
| invite(workspaceId: string, input: { | ||
| email: string; | ||
| role: InvitableRole; | ||
| }): Promise<DropthisResult<Invitation>>; | ||
| /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */ | ||
| updateRole(workspaceId: string, accountId: string, input: { | ||
| role: WorkspaceRole; | ||
| }): Promise<DropthisResult<Member>>; | ||
| /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`; | ||
| * leaving needs `members:write`. 204 — data is null. */ | ||
| remove(workspaceId: string, accountId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class WorkspacesResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| workspaces: Workspace[]; | ||
| }>>; | ||
| /** Create a team workspace (the caller becomes its sole owner). Needs `workspaces:write`. */ | ||
| create(input: { | ||
| name: string; | ||
| /** URL-safe slug; derived from the name when omitted. A clash on an explicit slug → 409. */ | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Rename a team workspace (owner/admin). Needs `workspaces:write`. */ | ||
| rename(workspaceId: string, input: { | ||
| name?: string; | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Delete a team workspace (owner only). Needs `workspaces:admin`. 204 — data is null. */ | ||
| delete(workspaceId: string): Promise<DropthisResult<null>>; | ||
| use(workspace: string): Promise<DropthisResult<Workspace>>; | ||
| active(): Promise<DropthisResult<Workspace | null>>; | ||
| } | ||
| export { type RequestOptions as $, AccountResource as A, type InMemoryPublishInput as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type InvitableRole as F, type GetContentOptions as G, type Invitation as H, type ImageTransform as I, type InvitationListResponse as J, InvitationsResource as K, type KeyType as L, type Limitations as M, type ListDeploymentsParams as N, type ListDeploymentsResponse as O, type ListPage as P, type Member as Q, type MemberListResponse as R, MembersResource as S, type NextHint as T, type PrepareOptions as U, type PreparedPublishRequest as V, type PreparedUploadFile as W, type PublishFileInput as X, type PublishInput as Y, type PublishOptions as Z, type RequestControls as _, type AccountResponse as a, type RevokeImpact as a0, SHARED_POOL as a1, type SessionResponse as a2, type TierInfo as a3, Transport as a4, type UpdateContentOptions as a5, type UploadManifestFile as a6, type UploadSessionFileResponse as a7, type UploadSessionResponse as a8, type UploadTarget as a9, type Workspace as aa, type WorkspaceRole as ab, WorkspacesResource as ac, type AccountUsage as b, type AccountWorkspace as c, type ActionResolve as d, ApiKeysResource as e, type CreateUploadSessionResponse as f, CursorPage as g, type DeploymentContentManifest as h, DeploymentsResource as i, type DnsRecord as j, type DomainDeletedResponse as k, type DomainListResponse as l, type DomainResponse as m, DomainsResource as n, type DropAction as o, type DropContentFile as p, type DropDeploymentResponse as q, type DropOptions as r, type DropResponse as s, type DropWorkspace as t, DropsResource as u, type DropthisClientOptions as v, type DropthisErrorResponse as w, type DropthisResult as x, type EntitlementLimits as y, type Entitlements as z }; |
| type DropthisClientOptions = { | ||
| apiKey?: string; | ||
| baseUrl?: string; | ||
| timeoutMs?: number; | ||
| uploadTimeoutMs?: number; | ||
| fetch?: typeof globalThis.fetch; | ||
| /** | ||
| * Default workspace slug or id applied to every publish/prepare call that | ||
| * does not supply its own `options.workspace`. Delegated credentials only; | ||
| * ignored by pinned service keys. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type RequestOptions = { | ||
| authenticated?: boolean; | ||
| idempotencyKey?: string; | ||
| ifRevision?: number; | ||
| timeoutMs?: number; | ||
| }; | ||
| type DropthisErrorResponse = { | ||
| code: string; | ||
| message: string; | ||
| statusCode: number | null; | ||
| type?: string; | ||
| title?: string; | ||
| detail?: string | null; | ||
| instance?: string | null; | ||
| param?: string | null; | ||
| currentRevision?: number; | ||
| requestId?: string | null; | ||
| suggestion?: string | null; | ||
| retryable?: boolean | null; | ||
| /** The gated capability (on `feature_not_in_plan`), e.g. `password_protect`. */ | ||
| feature?: string | null; | ||
| /** The caller's current plan (on `feature_not_in_plan` / `quota_exceeded`). */ | ||
| currentPlan?: string | null; | ||
| /** The lowest plan that unlocks the feature (on `feature_not_in_plan`). */ | ||
| requiredPlan?: string | null; | ||
| /** The pricing/upgrade URL to hand a human (on a plan gate). */ | ||
| upgradeUrl?: string | null; | ||
| /** Numeric ceiling that was hit (on `quota_exceeded`). */ | ||
| limit?: number | null; | ||
| /** Amount already used toward the ceiling (on `quota_exceeded`). */ | ||
| used?: number | null; | ||
| /** Amount the request asked for (on `quota_exceeded`). */ | ||
| requested?: number | null; | ||
| body?: unknown; | ||
| }; | ||
| type DropthisResult<T> = { | ||
| data: T; | ||
| error: null; | ||
| headers: Record<string, string>; | ||
| } | { | ||
| data: null; | ||
| error: DropthisErrorResponse; | ||
| headers: Record<string, string>; | ||
| }; | ||
| type ActionResolve = { | ||
| method: string; | ||
| url?: string | null; | ||
| endpoint?: string | null; | ||
| }; | ||
| type DropAction = { | ||
| code: string; | ||
| kind: "api" | "human"; | ||
| priority: "required" | "suggested"; | ||
| message: string; | ||
| resolve?: ActionResolve | null; | ||
| }; | ||
| type TierInfo = { | ||
| name: string; | ||
| maxSizeBytes: number; | ||
| ttlDays: number | null; | ||
| persistent: boolean; | ||
| badge: boolean; | ||
| }; | ||
| type Limitations = { | ||
| actions: DropAction[]; | ||
| }; | ||
| /** | ||
| * Workspace context echoed on every drop response. Identifies which workspace | ||
| * the drop was published into (ADR 0066). | ||
| */ | ||
| type DropWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| }; | ||
| type DropResponse = { | ||
| id: string; | ||
| slug: string; | ||
| url: string; | ||
| deploymentId: string | null; | ||
| title: string; | ||
| contentType: string; | ||
| visibility: string; | ||
| status: string; | ||
| revision: number; | ||
| contentRevision: number; | ||
| accessRevision: number; | ||
| sizeBytes: number; | ||
| renderMode: string; | ||
| warnings: Array<Record<string, unknown>>; | ||
| createdAt: string; | ||
| expiresAt: string | null; | ||
| noindex: boolean; | ||
| passwordProtected: boolean; | ||
| metadata: Record<string, unknown>; | ||
| /** When the drop was last updated (content or settings), ISO 8601. */ | ||
| updatedAt: string; | ||
| /** Origin that created the drop (e.g. "api", "cli", "mcp"); null/omitted when unattributed. */ | ||
| source?: string | null; | ||
| object: string; | ||
| accessible: boolean; | ||
| persistent: boolean; | ||
| badgeApplied: boolean; | ||
| tier: TierInfo; | ||
| limitations: Limitations; | ||
| /** Hostname of the custom domain this drop is mounted on; null for shared-pool drops. */ | ||
| domain: string | null; | ||
| /** | ||
| * Direct URL to the drop's raw bytes — the agent byte-fetch path. The canonical | ||
| * `url` always serves a branded human view (so the badge is guaranteed); `rawUrl` | ||
| * serves the underlying file's exact bytes at its natural path under the mount | ||
| * (ADR 0061). Populated only for single-file (`renderMode: "file_viewer"`) drops | ||
| * (= canonical URL + the entry filename); `null` for `user_html` drops (the page | ||
| * IS the artifact) and collections (per-file natural paths come from the manifest — | ||
| * see {@link DeploymentContentManifest}). Hand `url` to humans and `rawUrl` to agents. | ||
| * To stream bytes through the SDK regardless of drop kind, use `drops.getContent()`. | ||
| */ | ||
| rawUrl: string | null; | ||
| /** The workspace this drop belongs to (echoed from the server on every response). */ | ||
| workspace: DropWorkspace; | ||
| }; | ||
| type DropDeploymentResponse = { | ||
| id: string; | ||
| dropId: string; | ||
| revision: number; | ||
| status: string; | ||
| entry: string | null; | ||
| contentType: string; | ||
| renderMode: string; | ||
| files: Array<Record<string, unknown>>; | ||
| warnings: Array<Record<string, unknown>>; | ||
| sizeBytes: number; | ||
| classificationVersion: number; | ||
| classificationReason: string; | ||
| errorCode: string | null; | ||
| errorMessage: string | null; | ||
| createdAt: string; | ||
| readyAt: string | null; | ||
| publishedAt: string | null; | ||
| }; | ||
| type ListDeploymentsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| }; | ||
| type ListDeploymentsResponse = { | ||
| deployments: DropDeploymentResponse[]; | ||
| nextCursor: string | null; | ||
| }; | ||
| type ListPage<T> = { | ||
| object: "list"; | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| }; | ||
| type Action = { | ||
| code: string; | ||
| kind: string; | ||
| method?: string | null; | ||
| endpoint?: string | null; | ||
| message: string; | ||
| }; | ||
| type EmailOtpResponse = { | ||
| /** Always `true` on success; optional because the server defaults it. */ | ||
| ok?: true; | ||
| expiresIn: number; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type SessionResponse = { | ||
| object: "session"; | ||
| token: string; | ||
| accountId: string; | ||
| isNewAccount: boolean; | ||
| expiresIn: number; | ||
| /** | ||
| * Rotating refresh token for a console browser session. Present when a session is | ||
| * started (email/verify, refresh); `null`/omitted for non-session token issuance. | ||
| */ | ||
| refreshToken?: string | null; | ||
| }; | ||
| /** | ||
| * Why an API key exists. `delegated` keys act on behalf of the owning account (scoped | ||
| * to the active workspace or an allowed set); `service` keys are pinned to a single | ||
| * workspace and are intended for CI/automation. | ||
| */ | ||
| type KeyType = "delegated" | "service"; | ||
| /** What breaks when a key is revoked. */ | ||
| type RevokeImpact = "disconnects_app" | "breaks_automation"; | ||
| type ApiKeyResponse = { | ||
| object: "api_key"; | ||
| id: string; | ||
| keyLast4: string; | ||
| label: string; | ||
| /** Human-facing credential name: the user's label for `standard` keys, the connected client name for `mcp_oauth` keys. */ | ||
| appName: string; | ||
| /** Why the key exists (drives quota accounting). */ | ||
| keyType: KeyType; | ||
| /** Scopes granted to this key. */ | ||
| scopes: string[]; | ||
| /** When the key was last used to authenticate, ISO 8601; null/omitted if never used. */ | ||
| lastUsedAt?: string | null; | ||
| /** What breaks if this key is revoked. */ | ||
| revokeImpact: RevokeImpact; | ||
| createdAt: string; | ||
| }; | ||
| type ApiKeyCreatedResponse = ApiKeyResponse & { | ||
| key: string; | ||
| accountId?: string | null; | ||
| isNewAccount?: boolean; | ||
| }; | ||
| /** Numeric limits for the active plan — use these to size a publish before uploading. */ | ||
| type EntitlementLimits = { | ||
| /** Maximum size of a single drop in bytes. */ | ||
| maxSizeBytes: number; | ||
| /** Total account storage cap in bytes; null means no account-level cap. */ | ||
| maxStorageBytes: number | null; | ||
| /** Drop lifetime in seconds before expiry; null means drops are permanent. */ | ||
| defaultTtlSeconds: number | null; | ||
| /** Maximum number of custom hostnames the workspace may connect. */ | ||
| maxCustomHostnames: number; | ||
| /** Maximum members the workspace may hold (owner included). */ | ||
| seatLimit: number; | ||
| /** Maximum concurrent in-flight upload sessions (a transient concurrency cap). */ | ||
| maxActiveUploadSessions: number; | ||
| }; | ||
| /** | ||
| * The full capability matrix for the active plan — the single read to pre-check a | ||
| * feature gate before attempting an operation. | ||
| */ | ||
| type Entitlements = { | ||
| /** | ||
| * Per-capability state for the active plan. Boolean caps are `true`/`false`; | ||
| * enum caps (`ogPreview`, `analytics`) carry a value — compare by value, never | ||
| * truthiness (`"none"` is truthy). | ||
| */ | ||
| capabilities: Record<string, boolean | string>; | ||
| /** | ||
| * The lowest plan that unlocks each gated capability — drives the upgrade nudge. | ||
| * Enum sub-values are keyed `ogPreview.customImage` / `analytics.full`. | ||
| */ | ||
| requiredPlan: Record<string, string>; | ||
| /** Numeric limits for the active plan. */ | ||
| limits: EntitlementLimits; | ||
| }; | ||
| /** Current resource usage for the account's active workspace. */ | ||
| type AccountUsage = { | ||
| /** Total bytes consumed across all active drops. */ | ||
| storageUsedBytes: number; | ||
| /** Number of custom domain hostnames currently in use. */ | ||
| customDomainsUsed: number; | ||
| /** Members currently in the workspace (owner included). */ | ||
| seatsUsed: number; | ||
| }; | ||
| /** The workspace a principal acts within (ADR 0066). For an sk_ API key, the workspace the key is bound to. */ | ||
| type AccountWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` when shared with other members. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| }; | ||
| /** | ||
| * A workspace the caller belongs to or has delegated access to. | ||
| * Returned by `GET /v1/workspaces` and `PUT /v1/account/active-workspace`. | ||
| */ | ||
| type Workspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| /** The plan tier of this workspace. */ | ||
| plan: string; | ||
| /** Whether this workspace is currently the caller's active workspace. */ | ||
| isActive: boolean; | ||
| /** | ||
| * On CREATE only (null otherwise): whether the credential that created this workspace can act | ||
| * in it. `false` means an allowlist-restricted key created a workspace outside its allowlist — | ||
| * it will be denied on the next write; re-authenticate to obtain a credential that reaches it. | ||
| */ | ||
| creatorCanReach?: boolean | null; | ||
| }; | ||
| /** A role grantable via invite or a member role-change (owner is transferred, never granted). */ | ||
| type WorkspaceRole = "owner" | "admin" | "member"; | ||
| type InvitableRole = "admin" | "member"; | ||
| /** A member of a team workspace. */ | ||
| type Member = { | ||
| accountId: string; | ||
| /** The member's email, or null if their account was deleted. */ | ||
| email: string | null; | ||
| role: WorkspaceRole; | ||
| /** Whether this row is the calling account. */ | ||
| isYou: boolean; | ||
| joinedAt: string; | ||
| }; | ||
| type MemberListResponse = { | ||
| members: Member[]; | ||
| }; | ||
| /** An invitation to join a team workspace. */ | ||
| type Invitation = { | ||
| id: string; | ||
| workspaceId: string; | ||
| email: string; | ||
| role: WorkspaceRole; | ||
| /** `pending`, `accepted`, or `revoked`. */ | ||
| status: string; | ||
| expiresAt: string; | ||
| createdAt: string; | ||
| acceptedAt?: string | null; | ||
| }; | ||
| type InvitationListResponse = { | ||
| invitations: Invitation[]; | ||
| }; | ||
| type AccountResponse = { | ||
| id: string; | ||
| email: string; | ||
| displayName: string | null; | ||
| plan: string; | ||
| status: string; | ||
| createdAt: string; | ||
| /** The full capability matrix + numeric limits for the active plan. */ | ||
| entitlements: Entitlements; | ||
| usage: AccountUsage; | ||
| workspace: AccountWorkspace; | ||
| /** URL to upgrade; present on every plan below Business, null on the top tier. */ | ||
| upgradeUrl: string | null; | ||
| }; | ||
| type ListDropsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| /** Only drops mounted on this custom domain hostname (e.g. "reports.example.com"). */ | ||
| domain?: string; | ||
| }; | ||
| /** | ||
| * One file in an upload manifest. A discriminated union: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes through a signed PUT. Requires | ||
| * `contentType` and `sizeBytes`; an optional `checksumSha256` locks the | ||
| * transfer integrity. | ||
| * - **remote** — the server fetches the bytes itself from `sourceUrl` during | ||
| * `POST /uploads/{id}/ingest`. No bytes leave this process, so `sizeBytes`, | ||
| * `contentType`, and `checksumSha256` are all optional (the server infers | ||
| * them on fetch). Carries NO signed PUT target. | ||
| * | ||
| * `sourceUrl` is the discriminant: present ⇒ remote, absent ⇒ client-put. The | ||
| * camelCase `sourceUrl` becomes the wire field `source_url` via the transport's | ||
| * snake_case conversion (exactly like `contentType` → `content_type`). | ||
| */ | ||
| type UploadManifestFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string | null; | ||
| sourceUrl?: never; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| sizeBytes?: number; | ||
| checksumSha256?: string | null; | ||
| transform?: ImageTransform; | ||
| }; | ||
| type CreateUploadSessionRequest = { | ||
| schemaVersion?: 1; | ||
| files: UploadManifestFile[]; | ||
| entry?: string | null; | ||
| /** | ||
| * Target workspace slug or id for this upload session. Delegated credentials only; | ||
| * ignored by pinned service keys. Bound at session creation and inherited by the | ||
| * subsequent POST /drops call. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type UploadTarget = { | ||
| /** Always `single_put` — one signed PUT per file is the upload contract. */ | ||
| strategy: "single_put"; | ||
| url: string; | ||
| headers: Record<string, string>; | ||
| expiresAt: string; | ||
| }; | ||
| type CreateUploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| objectKey: string; | ||
| upload: UploadTarget; | ||
| }; | ||
| type UploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| /** Declared MIME type; `null`/omitted for remote-fetch files until ingested. */ | ||
| contentType?: string | null; | ||
| /** Declared byte size; `null`/omitted for remote-fetch files until ingested. */ | ||
| sizeBytes?: number | null; | ||
| objectKey: string; | ||
| /** How the file enters staging: "client_put" (client PUTs bytes) or "remote_fetch" (server fetches sourceUrl). */ | ||
| origin: "client_put" | "remote_fetch"; | ||
| /** Ingest lifecycle state for remote-fetch files (e.g. "pending" | "fetching" | "fetched" | "failed"). */ | ||
| state: string; | ||
| /** Public http(s) URL the server fetches into staging; `null`/omitted for client-put files. */ | ||
| sourceUrl?: string | null; | ||
| verified: boolean; | ||
| }; | ||
| type UploadSessionResponse = { | ||
| uploadId: string; | ||
| status: string; | ||
| expiresAt: string; | ||
| entry?: string | null; | ||
| files: UploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type CreateUploadSessionResponse = { | ||
| uploadId: string; | ||
| expiresAt: string; | ||
| files: CreateUploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| /** | ||
| * Sentinel for `DropOptions.domain`: publish to the shared pool even when the | ||
| * account has a default custom domain (dropthis#55). Collision-free — the | ||
| * literal "shared" can never be a real hostname (single-label names are | ||
| * rejected at domain connect). These drops read back `domain: null`. | ||
| */ | ||
| declare const SHARED_POOL = "shared"; | ||
| type DropOptions = { | ||
| /** Drop title. */ | ||
| title?: string; | ||
| /** public (default) or unlisted. */ | ||
| visibility?: "public" | "unlisted"; | ||
| /** Require password to view. Pass `null` to remove password protection. */ | ||
| password?: string | null; | ||
| /** Prevent search-engine indexing. Pass `null` to allow indexing (default). */ | ||
| noindex?: boolean | null; | ||
| /** Auto-delete after this ISO 8601 date. Pass `null` to clear. */ | ||
| expiresAt?: string | Date | null; | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */ | ||
| metadata?: Record<string, unknown>; | ||
| /** | ||
| * Hostname of a custom domain connected to this account (must be live — see | ||
| * `client.domains`), or {@link SHARED_POOL} (`"shared"`) to publish to the shared | ||
| * pool even when the account has a default domain. Path-mode domains serve the drop | ||
| * at `https://{domain}/{slug}/`; dedicated domains serve it at the root and conflict | ||
| * (409) once occupied. Omit to use the account's default path domain if one exists, | ||
| * else the shared pool. | ||
| */ | ||
| domain?: string | null; | ||
| /** | ||
| * Vanity slug — only valid when the target is a path-mode custom domain. 1–63 | ||
| * lowercase letters/digits/hyphens (no leading/trailing/double hyphen). Taken slugs | ||
| * are auto-suffixed; omit for a random slug. Setting this on the shared pool returns | ||
| * 422. | ||
| */ | ||
| slug?: string | null; | ||
| }; | ||
| type PrepareOptions = { | ||
| /** Glob patterns to ignore when publishing directories. */ | ||
| ignore?: string[]; | ||
| /** Disable default ignore patterns. */ | ||
| ignoreDefaults?: boolean; | ||
| /** Override MIME type (auto-detected from extension). */ | ||
| contentType?: string; | ||
| /** Set filename when publishing from stdin or bytes. */ | ||
| path?: string; | ||
| }; | ||
| type RequestControls = { | ||
| /** Prevent duplicate publishes on retry (auto-generated by CLI). */ | ||
| idempotencyKey?: string; | ||
| /** Fail if current revision doesn't match -- optimistic lock (update only). */ | ||
| ifRevision?: number; | ||
| }; | ||
| type PublishOptions = DropOptions & PrepareOptions & RequestControls & { | ||
| /** | ||
| * Target workspace slug or id — publish/prepare only (a fresh drop's workspace). | ||
| * Delegated credentials only; ignored by pinned service keys. Falls back to the | ||
| * client-level `workspace` default when omitted. Not a settings field: it is NOT | ||
| * accepted by `updateSettings` (a drop never moves workspace) nor by `updateContent` | ||
| * (which stays in the drop's own workspace). | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * Options for `drops.updateContent()` — content-only. A content update ships a new content version | ||
| * and never changes drop settings (title, visibility, password, noindex, expiry, metadata); those | ||
| * belong on `drops.updateSettings()`. Carries only content-prep + request controls + the bundle | ||
| * `entry`. | ||
| */ | ||
| type UpdateContentOptions = PrepareOptions & RequestControls & { | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** | ||
| * How the supplied files combine with what the drop already serves | ||
| * (partial-by-default, ADR 0065): | ||
| * | ||
| * - `"patch"` (default): the supplied files upsert by path and every | ||
| * unmentioned file is carried forward, so editing one file never drops the | ||
| * rest. Use `deletePaths` to remove files. | ||
| * - `"replace"`: the supplied files become the drop's entire content set — | ||
| * a full swap. Anything not supplied is gone. `deletePaths` is invalid here. | ||
| * | ||
| * Omit to default to `"patch"`. | ||
| */ | ||
| mode?: "patch" | "replace"; | ||
| /** | ||
| * Paths to remove from the drop's content (patch-mode only). Each path must | ||
| * exist or the server rejects the update (loud, never a silent no-op). Invalid | ||
| * with `mode: "replace"`. Wire field: `delete_paths`. | ||
| */ | ||
| deletePaths?: string[]; | ||
| }; | ||
| /** | ||
| * One file in a multi-file `{ kind: "files" }` bundle. Supply the bytes inline | ||
| * exactly one way — `content` (UTF-8 text), `contentBase64`, or `bytes` — OR set | ||
| * `sourceUrl` to a public http(s) URL and let the server fetch that file for you | ||
| * server-side (no bytes pass through your process). A single entry may NOT carry | ||
| * both inline bytes and `sourceUrl`. Mix freely within one bundle: e.g. inline | ||
| * `content` for `index.html` plus a `sourceUrl` for each image referenced by it, | ||
| * yielding one self-contained drop. | ||
| */ | ||
| /** | ||
| * Optional server-side image transform applied to a `sourceUrl` file on ingest | ||
| * (publish by reference). The server resizes/re-encodes the fetched image so you can | ||
| * point at a big original and store a small web-optimised derivative. Fits inside the | ||
| * given box preserving aspect ratio, never upscales, strips metadata. Only valid on | ||
| * `sourceUrl` entries; when set, omit `sizeBytes`/`checksumSha256` (the stored object | ||
| * reflects the transform OUTPUT, computed server-side). | ||
| */ | ||
| type ImageTransform = { | ||
| /** Max output width in pixels (fit inside, no upscale). */ | ||
| width?: number; | ||
| /** Max output height in pixels (fit inside, no upscale). */ | ||
| height?: number; | ||
| /** Encoder quality 1-100 (jpeg/webp). */ | ||
| quality?: number; | ||
| /** Output format. Omit to keep the source raster format. */ | ||
| format?: "jpeg" | "png" | "webp"; | ||
| }; | ||
| type PublishFileInput = { | ||
| path: string; | ||
| contentType?: string; | ||
| content?: string; | ||
| contentBase64?: string; | ||
| bytes?: Uint8Array; | ||
| /** | ||
| * Public http(s) URL the server fetches this file's bytes from during publish | ||
| * (publish by reference). Mutually exclusive with `content`/`contentBase64`/`bytes`. | ||
| */ | ||
| sourceUrl?: string; | ||
| /** | ||
| * Optional image transform applied server-side to a `sourceUrl` file on ingest | ||
| * (resize/re-encode). Only valid with `sourceUrl`; when set, omit | ||
| * `sizeBytes`/`checksumSha256` (the stored object reflects the output). | ||
| */ | ||
| transform?: ImageTransform; | ||
| /** | ||
| * Declared byte size of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server uses this for upfront quota admission before fetching, | ||
| * so a large file is rejected immediately rather than after the server downloads it. | ||
| * Ignored for inline files (size is computed from the bytes). | ||
| */ | ||
| sizeBytes?: number; | ||
| /** | ||
| * Expected SHA-256 hex digest of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server verifies the fetched content matches this checksum and | ||
| * rejects the publish if it does not, giving you integrity verification without | ||
| * downloading the bytes yourself. | ||
| * Ignored for inline files (checksum is computed by the SDK/server from actual bytes). | ||
| */ | ||
| checksumSha256?: string; | ||
| }; | ||
| type PublishInput = string | string[] | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| /** Structured next-step hint returned by domain operations (and publish). */ | ||
| type NextHint = { | ||
| action: string; | ||
| message: string; | ||
| }; | ||
| /** One DNS record instruction or diagnostic for a custom domain. */ | ||
| type DnsRecord = { | ||
| /** Purpose of the record, e.g. "routing". */ | ||
| purpose: string; | ||
| /** DNS record type, e.g. "CNAME". */ | ||
| type: string; | ||
| /** The DNS name to create the record for. */ | ||
| name: string; | ||
| /** The value the record must point at. */ | ||
| value: string; | ||
| /** Current DNS status: "missing" | "ok" | "mismatch". */ | ||
| status: "missing" | "ok" | "mismatch"; | ||
| /** What DoH currently resolves for this record (verify only). */ | ||
| observed?: string | null; | ||
| /** Specific guidance for fixing this record. */ | ||
| hint?: string | null; | ||
| /** Seconds to wait before retrying verify while DNS/cert propagates. */ | ||
| retryAfter?: number | null; | ||
| }; | ||
| /** Full domain resource representation. */ | ||
| type DomainResponse = { | ||
| object: "domain"; | ||
| /** Stable domain identifier. */ | ||
| id: string; | ||
| /** Canonical hostname registered with dropthis. */ | ||
| hostname: string; | ||
| /** Mount mode: "path" (many drops at hostname/{slug}/) or "dedicated" (one drop at hostname/). */ | ||
| mode: "path" | "dedicated"; | ||
| /** Lifecycle status: "pending_dns" | "verifying" | "live" | "failed". */ | ||
| status: "pending_dns" | "verifying" | "live" | "failed"; | ||
| /** Reason for failure status. */ | ||
| failureReason?: string | null; | ||
| /** Whether this is the account's default publish domain. */ | ||
| default: boolean; | ||
| /** Mounted drop id (dedicated mode only). */ | ||
| dropId?: string | null; | ||
| /** DNS records required for this domain. */ | ||
| dns: DnsRecord[]; | ||
| /** Creation timestamp. */ | ||
| createdAt: string; | ||
| /** When the domain first reached "live" status. */ | ||
| verifiedAt?: string | null; | ||
| /** Structured next-step hints for the agent. */ | ||
| next: NextHint[]; | ||
| /** | ||
| * Deep link to this domain's setup page in the dropthis console | ||
| * (e.g. https://app.dropthis.app/domains/dom_…). Hand this to a human so | ||
| * they can add the DNS record and watch it go live in a polished UI. | ||
| */ | ||
| consoleUrl: string; | ||
| }; | ||
| /** List of domains for the account. */ | ||
| type DomainListResponse = { | ||
| object: "domain.list"; | ||
| /** Domains connected to this account. */ | ||
| domains: DomainResponse[]; | ||
| }; | ||
| /** Response body for a successful domain deletion. */ | ||
| type DomainDeletedResponse = { | ||
| object: "domain.deleted"; | ||
| /** Id of the deleted domain. */ | ||
| id: string; | ||
| /** Hostname of the deleted domain. */ | ||
| hostname: string; | ||
| /** Dangling-CNAME risk warning (always present; instructs you to remove the DNS record). */ | ||
| warning: string; | ||
| }; | ||
| /** One readable file in a deployment's content manifest. */ | ||
| type DeploymentContentFile = { | ||
| /** File path within the deployment, relative to its root. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with. */ | ||
| contentType: string; | ||
| /** Stored file size in bytes. */ | ||
| sizeBytes: number; | ||
| }; | ||
| /** | ||
| * Manifest of one deployment's readable files (content read-back). | ||
| * Fetch a single file's bytes with `drops.getContent(dropId, { path })`. | ||
| */ | ||
| type DeploymentContentManifest = { | ||
| /** Parent drop identifier. */ | ||
| dropId: string; | ||
| /** Deployment identifier. */ | ||
| deploymentId: string; | ||
| /** Content revision of this deployment. */ | ||
| revision: number; | ||
| /** Deployment lifecycle status. */ | ||
| status: string; | ||
| /** Total deployment size in bytes. */ | ||
| sizeBytes: number; | ||
| /** Entry path served at the drop root. */ | ||
| entry?: string | null; | ||
| /** Readable files in this deployment; pass files[].path as `path` to download one. */ | ||
| files: DeploymentContentFile[]; | ||
| }; | ||
| /** Options for `drops.getContent()`. */ | ||
| type GetContentOptions = { | ||
| /** Read a historical deployment instead of the current one. */ | ||
| deploymentId?: string; | ||
| /** Download this single file's raw stored bytes instead of the JSON manifest. */ | ||
| path?: string; | ||
| }; | ||
| /** A single file downloaded via `drops.getContent(dropId, { path })`. */ | ||
| type DropContentFile = { | ||
| /** The requested file path. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with (from the response Content-Type). */ | ||
| contentType: string | null; | ||
| /** Exact stored bytes. */ | ||
| bytes: Uint8Array; | ||
| /** Decode the bytes as UTF-8 text. */ | ||
| text(): string; | ||
| }; | ||
| declare class Transport { | ||
| readonly apiKey: string | undefined; | ||
| readonly baseUrl: string; | ||
| readonly timeoutMs: number; | ||
| readonly uploadTimeoutMs: number; | ||
| readonly fetchImpl: typeof globalThis.fetch; | ||
| constructor(options?: DropthisClientOptions | string); | ||
| putSignedUrl(url: string, body: Uint8Array | Blob | ReadableStream, headers: Record<string, string>): Promise<DropthisResult<{ | ||
| etag: string | null; | ||
| }>>; | ||
| /** | ||
| * Authenticated GET that returns the raw response bytes untouched (no JSON parsing, | ||
| * no case conversion). Error responses are still parsed as problem+json. Used for | ||
| * content read-back (`drops.getContent` with a file path). | ||
| */ | ||
| requestBytes(path: string, options?: RequestOptions & { | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<{ | ||
| bytes: Uint8Array; | ||
| contentType: string | null; | ||
| }>>; | ||
| request<T>(method: string, path: string, options?: RequestOptions & { | ||
| body?: unknown; | ||
| bodyCase?: "snake" | "raw"; | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<T>>; | ||
| } | ||
| /** | ||
| * A file ready to be staged for upload. Two shapes: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes. The body is lazy: the orchestrator | ||
| * calls `getBody()` per file when it is ready to push bytes to the signed URL. | ||
| * This keeps the resolution layer pure and lets the filesystem layer (node.ts) | ||
| * defer reads/streams until upload time. | ||
| * - **remote** (`sourceUrl` set, no `getBody`) — the server fetches the bytes from | ||
| * `sourceUrl` during `POST /uploads/{id}/ingest`. No bytes leave this process, so | ||
| * it has no `getBody`, no `sizeBytes`, and consumes no signed PUT target. | ||
| */ | ||
| type PreparedUploadFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string; | ||
| sourceUrl?: never; | ||
| getBody(): Promise<Uint8Array | Blob | ReadableStream>; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| /** Optional hint: declared byte size for upfront quota admission (server-side). */ | ||
| sizeBytes?: number; | ||
| /** Optional hint: expected SHA-256 hex digest for server-side integrity check. */ | ||
| checksumSha256?: string; | ||
| /** Optional server-side image transform applied on ingest (resize/re-encode). */ | ||
| transform?: ImageTransform; | ||
| getBody?: never; | ||
| }; | ||
| /** | ||
| * Resolves a publish input into a {@link PreparedPublishRequest}. Two implementations exist: | ||
| * the fs-free {@link resolveInMemory} (Workers-safe) and the fs-capable `resolveInput` in | ||
| * `publish/node.ts`. `DropsResource` takes one by injection so it can power both the Node client | ||
| * and the edge client WITHOUT statically importing the Node-only pipeline (which would poison the | ||
| * Workers bundle with `node:fs`/`fast-glob`). `TInput` is the input type the chosen resolver | ||
| * accepts ({@link InMemoryPublishInput} on the edge, the full `PublishInput` on Node). | ||
| */ | ||
| type PublishInputResolver<TInput> = (input: TInput, options: PublishOptions) => Promise<PreparedPublishRequest>; | ||
| type PreparedPublishRequest = { | ||
| kind: "staged"; | ||
| manifest: CreateUploadSessionRequest; | ||
| files: PreparedUploadFile[]; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Bound at upload-session creation. */ | ||
| workspace?: string; | ||
| } | { | ||
| kind: "source"; | ||
| sourceUrl: string; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Forwarded as top-level field in POST /drops. */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * The canonical publish inputs that can be resolved with no filesystem access: | ||
| * the {@link PublishInput} union minus `string[]` (which is inherently a list | ||
| * of filesystem paths handled by node.ts). | ||
| */ | ||
| type InMemoryPublishInput = string | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| declare class AccountResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| get(): Promise<DropthisResult<AccountResponse>>; | ||
| update(input: { | ||
| displayName: string | null; | ||
| }): Promise<DropthisResult<AccountResponse>>; | ||
| delete(): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class ApiKeysResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| object: "list"; | ||
| data: ApiKeyResponse[]; | ||
| }>>; | ||
| create(input: { | ||
| label: string; | ||
| /** Key type: `"delegated"` (default on server) or `"service"` (pinned to a workspace). */ | ||
| type?: KeyType; | ||
| /** Pin a `service` key to this workspace slug or id. */ | ||
| workspace?: string; | ||
| /** Restrict a `delegated` key to these workspace slugs or ids. */ | ||
| allowedWorkspaces?: string[]; | ||
| /** | ||
| * Request the credential's capability scopes (ADR 0068). Each entry is a bundle | ||
| * name (`publish`, `team`, `team-admin`) or a fine-grained scope (`members:admin`). | ||
| * The minted key gets the requested set intersected with your own scopes | ||
| * (downscope-only). Omit for the default `publish` bundle; pass `["team"]` to mint | ||
| * a credential that can create + manage teams (`login --scope team`). | ||
| */ | ||
| scopes?: string[]; | ||
| }): Promise<DropthisResult<ApiKeyCreatedResponse>>; | ||
| /** Revoke an API key. 204 No Content — data is null on success. */ | ||
| delete(keyId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class DeploymentsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(dropId: string, params?: ListDeploymentsParams): Promise<DropthisResult<ListDeploymentsResponse>>; | ||
| get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>; | ||
| } | ||
| declare class DomainsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** | ||
| * Connect a custom domain to the account. Returns the domain in `pending_dns` status with | ||
| * DNS instructions. Idempotent on (account, hostname) — re-connecting an already-connected | ||
| * domain returns the existing row. POST /domains. | ||
| */ | ||
| connect(input: { | ||
| hostname: string; | ||
| mode: "path" | "dedicated"; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** List all custom domains connected to this account. GET /domains. */ | ||
| list(): Promise<DropthisResult<DomainListResponse>>; | ||
| /** Get a domain by its stable id or hostname. GET /domains/{id_or_hostname}. */ | ||
| get(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Trigger a DNS + Cloudflare verification check. Returns the domain with updated status and | ||
| * per-record diagnostics. If DNS is still propagating, `dns[].retryAfter` tells you when to | ||
| * re-call. POST /domains/{id_or_hostname}/verify. | ||
| */ | ||
| verify(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Update a domain's `dropId` (dedicated mode: repoint to a different drop) or `default` | ||
| * flag (path mode only: set/clear the account's default publish domain). Mode is immutable | ||
| * — delete and reconnect to change it. PATCH /domains/{id_or_hostname}. | ||
| */ | ||
| update(idOrHostname: string, input: { | ||
| dropId?: string | null; | ||
| default?: boolean | null; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Delete a custom domain and remove all its routes. The response includes a dangling-CNAME | ||
| * warning — remove the DNS record after deleting so another account cannot re-claim the | ||
| * hostname. DELETE /domains/{id_or_hostname}. | ||
| */ | ||
| delete(idOrHostname: string): Promise<DropthisResult<DomainDeletedResponse>>; | ||
| } | ||
| declare class CursorPage<T> implements ListPage<T> { | ||
| readonly object: "list"; | ||
| readonly data: T[]; | ||
| readonly hasMore: boolean; | ||
| readonly nextCursor: string | null; | ||
| /** Response headers from the fetch that produced this page. */ | ||
| readonly headers: Record<string, string>; | ||
| private readonly fetchNextPage; | ||
| constructor(input: { | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| headers?: Record<string, string>; | ||
| fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined; | ||
| }); | ||
| /** | ||
| * Collect items across every page into a single array. | ||
| * | ||
| * No-throw, consistent with the rest of the SDK's {@link DropthisResult} | ||
| * contract: returns `{ data: items, error: null }` on success, or | ||
| * `{ data: null, error }` if fetching a later page fails — never a thrown | ||
| * exception, and never a silently truncated list. Inspect `.error` | ||
| * (`code`/`statusCode`/`retryable`/`requestId`) exactly as you would for any | ||
| * other call. Pass `limit` to stop once that many items are collected. | ||
| */ | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| } | ||
| /** | ||
| * The drop lifecycle resource. `TInput` is the publish-input type the injected resolver accepts: | ||
| * the full `PublishInput` on the Node client, the fs-free `InMemoryPublishInput` on the edge. The | ||
| * resolver is injected (not statically imported) so this module never pulls in the Node-only | ||
| * publish pipeline and stays Workers-safe. | ||
| */ | ||
| declare class DropsResource<TInput = PublishInput> { | ||
| private readonly transport; | ||
| private readonly resolveInput; | ||
| private readonly defaultWorkspace?; | ||
| constructor(transport: Transport, resolveInput: PublishInputResolver<TInput>, defaultWorkspace?: string | undefined); | ||
| /** | ||
| * Publish content to a NEW permanent public URL; returns the created drop (with its `drop_…` id). | ||
| * Use to publish / share / post / put online / make public a report, dashboard, site, or file. | ||
| * Creates a NEW drop every call — to change something already published, use {@link updateContent} | ||
| * (the files at the URL) or {@link updateSettings} (title, visibility, password, expiry, | ||
| * metadata) with the drop's id; calling publish again makes a duplicate. POST /drops. | ||
| * | ||
| * Mount target: `options.domain` accepts a connected custom hostname, or `SHARED_POOL` | ||
| * (`"shared"`) to publish to the shared pool even when the account has a default domain. | ||
| * | ||
| * Two URLs come back on the response: `url` is the canonical, **always-branded** human | ||
| * view (badge guaranteed, no client detection); `rawUrl` is the drop's exact bytes at | ||
| * their natural path — hand it to other agents. `rawUrl` is populated only for single | ||
| * non-HTML files (`renderMode: "file_viewer"`) and is `null` for HTML drops and | ||
| * collections. To stream bytes through the SDK for any drop kind, use {@link getContent}. | ||
| */ | ||
| publish(input: TInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Replace the content of an EXISTING drop, keeping its URL (ships a new deployment). Requires the | ||
| * `drop_…` id from a publish response (not the slug/URL). Content-only: settings/metadata are | ||
| * stripped BEFORE prepare, so they are never sent — change those with {@link updateSettings}; create | ||
| * a new drop with {@link publish}. Not idempotent (each call is a new deployment) unless you pass the | ||
| * same `idempotencyKey`. POST /drops/{id}/deployments. | ||
| */ | ||
| updateContent(dropId: string, input: TInput, options?: UpdateContentOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * List the account's drops, newest first (paginated). Each item carries its `drop_…` id. | ||
| * Pass `domain` to only list drops mounted on that custom domain — the recovery path | ||
| * when you have a custom-domain URL but no drop id. GET /drops. | ||
| */ | ||
| list(params?: ListDropsParams): Promise<DropthisResult<CursorPage<DropResponse>>>; | ||
| /** Fetch one drop by its `drop_…` id (not the slug/URL). GET /drops/{id}. */ | ||
| get(dropId: string): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Resolve a public locator (a drop URL, a custom-domain URL, or a bare vanity/shared | ||
| * slug) back to the drop — the way to recover a lost `drop_…` id. Sends the raw target | ||
| * to the server (POST /drops/resolve), which owner-scopes and decomposes it. Returns the | ||
| * full drop, or `data: null` when nothing of yours matches. A `drop_…` id passed as the | ||
| * target round-trips to an owner-scoped id lookup (null instead of 404). | ||
| * | ||
| * Persist the drop_… id. URLs, raw_url, and slugs are locators, not identifiers — a vanity | ||
| * slug is renameable and the pool host rotates, so a stored URL can drift; the id never | ||
| * moves. Treat drop_… as an opaque case-sensitive string. | ||
| */ | ||
| resolve(target: string): Promise<DropthisResult<DropResponse | null>>; | ||
| /** | ||
| * Read back what a drop is serving (owner-only; works regardless of any viewer | ||
| * password). By default returns the JSON manifest of the CURRENT deployment's files; | ||
| * pass `deploymentId` to read a historical (even superseded) deployment — downloading | ||
| * an old version's files and republishing them via {@link updateContent} is the | ||
| * rollback path. Pass `path` (one of the manifest's `files[].path` values) to download | ||
| * that file's exact stored bytes instead. GET /drops/{id}/content. | ||
| */ | ||
| getContent(dropId: string, options: GetContentOptions & { | ||
| path: string; | ||
| }): Promise<DropthisResult<DropContentFile>>; | ||
| getContent(dropId: string, options?: Omit<GetContentOptions, "path">): Promise<DropthisResult<DeploymentContentManifest>>; | ||
| /** | ||
| * Change an EXISTING drop's settings — title, visibility, password, noindex, expiry, | ||
| * metadata, domain, or slug — by its `drop_…` id. Does not touch content; replace that | ||
| * with {@link updateContent}. Idempotent. PATCH /drops/{id}. | ||
| * | ||
| * **`domain`** — move the drop to a different custom domain (must be live). Pass `null` to | ||
| * move the drop back to the shared pool (unmount from its current domain). | ||
| * | ||
| * **`slug`** — rename the vanity slug on a path-mode custom domain. Only valid when the drop | ||
| * lives on a path-mode domain. Unlike {@link publish} (which auto-suffixes taken slugs), | ||
| * `updateSettings` returns 409 on a slug conflict and never auto-suffixes — your code must | ||
| * catch 409 and retry with a different slug. Passing `slug` on the shared pool returns 422. | ||
| */ | ||
| updateSettings(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>; | ||
| /** Permanently delete a drop and its public URL by its `drop_…` id. DELETE /drops/{id}. */ | ||
| delete(dropId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| /** Invitee-side invitations (ADR 0068). Listing needs `members:read`; accepting needs `members:write`. */ | ||
| declare class InvitationsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List the calling account's own pending invitations. */ | ||
| list(): Promise<DropthisResult<InvitationListResponse>>; | ||
| /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */ | ||
| accept(input: { | ||
| token: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */ | ||
| acceptById(input: { | ||
| invitationId: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| } | ||
| /** Team membership management (ADR 0068). Capability follows the credential's scopes. */ | ||
| declare class MembersResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List a workspace's members (any member, `members:read`). */ | ||
| list(workspaceId: string): Promise<DropthisResult<MemberListResponse>>; | ||
| /** Invite an email to the workspace (owner/admin, `members:write`). */ | ||
| invite(workspaceId: string, input: { | ||
| email: string; | ||
| role: InvitableRole; | ||
| }): Promise<DropthisResult<Invitation>>; | ||
| /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */ | ||
| updateRole(workspaceId: string, accountId: string, input: { | ||
| role: WorkspaceRole; | ||
| }): Promise<DropthisResult<Member>>; | ||
| /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`; | ||
| * leaving needs `members:write`. 204 — data is null. */ | ||
| remove(workspaceId: string, accountId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class WorkspacesResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| workspaces: Workspace[]; | ||
| }>>; | ||
| /** Create a team workspace (the caller becomes its sole owner). Needs `workspaces:write`. */ | ||
| create(input: { | ||
| name: string; | ||
| /** URL-safe slug; derived from the name when omitted. A clash on an explicit slug → 409. */ | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Rename a team workspace (owner/admin). Needs `workspaces:write`. */ | ||
| rename(workspaceId: string, input: { | ||
| name?: string; | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Delete a team workspace (owner only). Needs `workspaces:admin`. 204 — data is null. */ | ||
| delete(workspaceId: string): Promise<DropthisResult<null>>; | ||
| use(workspace: string): Promise<DropthisResult<Workspace>>; | ||
| active(): Promise<DropthisResult<Workspace | null>>; | ||
| } | ||
| export { type RequestOptions as $, AccountResource as A, type InMemoryPublishInput as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type InvitableRole as F, type GetContentOptions as G, type Invitation as H, type ImageTransform as I, type InvitationListResponse as J, InvitationsResource as K, type KeyType as L, type Limitations as M, type ListDeploymentsParams as N, type ListDeploymentsResponse as O, type ListPage as P, type Member as Q, type MemberListResponse as R, MembersResource as S, type NextHint as T, type PrepareOptions as U, type PreparedPublishRequest as V, type PreparedUploadFile as W, type PublishFileInput as X, type PublishInput as Y, type PublishOptions as Z, type RequestControls as _, type AccountResponse as a, type RevokeImpact as a0, SHARED_POOL as a1, type SessionResponse as a2, type TierInfo as a3, Transport as a4, type UpdateContentOptions as a5, type UploadManifestFile as a6, type UploadSessionFileResponse as a7, type UploadSessionResponse as a8, type UploadTarget as a9, type Workspace as aa, type WorkspaceRole as ab, WorkspacesResource as ac, type AccountUsage as b, type AccountWorkspace as c, type ActionResolve as d, ApiKeysResource as e, type CreateUploadSessionResponse as f, CursorPage as g, type DeploymentContentManifest as h, DeploymentsResource as i, type DnsRecord as j, type DomainDeletedResponse as k, type DomainListResponse as l, type DomainResponse as m, DomainsResource as n, type DropAction as o, type DropContentFile as p, type DropDeploymentResponse as q, type DropOptions as r, type DropResponse as s, type DropWorkspace as t, DropsResource as u, type DropthisClientOptions as v, type DropthisErrorResponse as w, type DropthisResult as x, type EntitlementLimits as y, type Entitlements as z }; |
@@ -249,3 +249,4 @@ "use strict"; | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| } | ||
@@ -337,3 +338,4 @@ ) : { | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| }; | ||
@@ -882,2 +884,65 @@ } | ||
| // src/resources/invitations.ts | ||
| var InvitationsResource = class { | ||
| constructor(transport) { | ||
| this.transport = transport; | ||
| } | ||
| transport; | ||
| /** List the calling account's own pending invitations. */ | ||
| list() { | ||
| return this.transport.request("GET", "/invitations"); | ||
| } | ||
| /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */ | ||
| accept(input) { | ||
| return this.transport.request("POST", "/invitations/accept", { | ||
| body: input | ||
| }); | ||
| } | ||
| /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */ | ||
| acceptById(input) { | ||
| return this.transport.request("POST", "/invitations/accept-by-id", { | ||
| body: input | ||
| }); | ||
| } | ||
| }; | ||
| // src/resources/members.ts | ||
| var MembersResource = class { | ||
| constructor(transport) { | ||
| this.transport = transport; | ||
| } | ||
| transport; | ||
| /** List a workspace's members (any member, `members:read`). */ | ||
| list(workspaceId) { | ||
| return this.transport.request( | ||
| "GET", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/members` | ||
| ); | ||
| } | ||
| /** Invite an email to the workspace (owner/admin, `members:write`). */ | ||
| invite(workspaceId, input) { | ||
| return this.transport.request( | ||
| "POST", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/invitations`, | ||
| { body: input } | ||
| ); | ||
| } | ||
| /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */ | ||
| updateRole(workspaceId, accountId, input) { | ||
| return this.transport.request( | ||
| "PATCH", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}`, | ||
| { body: input } | ||
| ); | ||
| } | ||
| /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`; | ||
| * leaving needs `members:write`. 204 — data is null. */ | ||
| remove(workspaceId, accountId) { | ||
| return this.transport.request( | ||
| "DELETE", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}` | ||
| ); | ||
| } | ||
| }; | ||
| // src/resources/workspaces.ts | ||
@@ -964,3 +1029,3 @@ var WorkspacesResource = class { | ||
| var DEFAULT_BASE_URL = "https://api.dropthis.app"; | ||
| var SDK_VERSION = "0.29.0"; | ||
| var SDK_VERSION = true ? "0.32.0" : "0.0.0-dev"; | ||
| var Transport = class { | ||
@@ -1222,2 +1287,4 @@ apiKey; | ||
| workspacesResource; | ||
| membersResource; | ||
| invitationsResource; | ||
| constructor(options = {}) { | ||
@@ -1266,2 +1333,14 @@ this.transport = new Transport(options); | ||
| } | ||
| /** Team membership management (ADR 0068; needs a team / team-admin scoped credential). */ | ||
| get members() { | ||
| if (!this.membersResource) | ||
| this.membersResource = new MembersResource(this.transport); | ||
| return this.membersResource; | ||
| } | ||
| /** Invitee-side invitations: list the caller's pending invites, accept by token or id. */ | ||
| get invitations() { | ||
| if (!this.invitationsResource) | ||
| this.invitationsResource = new InvitationsResource(this.transport); | ||
| return this.invitationsResource; | ||
| } | ||
| }; | ||
@@ -1268,0 +1347,0 @@ // Annotate the CommonJS export names for ESM import in node: |
@@ -1,2 +0,2 @@ | ||
| import { v as DropthisClientOptions, u as DropsResource, I as InMemoryPublishInput, A as AccountResource, e as ApiKeysResource, i as DeploymentsResource, n as DomainsResource, a9 as WorkspacesResource } from './workspaces-CebiV4DS.cjs'; | ||
| import { v as DropthisClientOptions, u as DropsResource, B as InMemoryPublishInput, A as AccountResource, e as ApiKeysResource, i as DeploymentsResource, n as DomainsResource, ac as WorkspacesResource, S as MembersResource, K as InvitationsResource } from './workspaces-Cq705UM6.cjs'; | ||
@@ -14,2 +14,4 @@ /** Workers-safe dropthis client. Pass an apiKey explicitly (no process.env on the edge). */ | ||
| private workspacesResource?; | ||
| private membersResource?; | ||
| private invitationsResource?; | ||
| constructor(options?: DropthisClientOptions | string); | ||
@@ -27,4 +29,8 @@ get drops(): DropsResource<InMemoryPublishInput>; | ||
| get workspaces(): WorkspacesResource; | ||
| /** Team membership management (ADR 0068; needs a team / team-admin scoped credential). */ | ||
| get members(): MembersResource; | ||
| /** Invitee-side invitations: list the caller's pending invites, accept by token or id. */ | ||
| get invitations(): InvitationsResource; | ||
| } | ||
| export { DropthisEdge, InMemoryPublishInput }; |
@@ -1,2 +0,2 @@ | ||
| import { v as DropthisClientOptions, u as DropsResource, I as InMemoryPublishInput, A as AccountResource, e as ApiKeysResource, i as DeploymentsResource, n as DomainsResource, a9 as WorkspacesResource } from './workspaces-CebiV4DS.js'; | ||
| import { v as DropthisClientOptions, u as DropsResource, B as InMemoryPublishInput, A as AccountResource, e as ApiKeysResource, i as DeploymentsResource, n as DomainsResource, ac as WorkspacesResource, S as MembersResource, K as InvitationsResource } from './workspaces-Cq705UM6.js'; | ||
@@ -14,2 +14,4 @@ /** Workers-safe dropthis client. Pass an apiKey explicitly (no process.env on the edge). */ | ||
| private workspacesResource?; | ||
| private membersResource?; | ||
| private invitationsResource?; | ||
| constructor(options?: DropthisClientOptions | string); | ||
@@ -27,4 +29,8 @@ get drops(): DropsResource<InMemoryPublishInput>; | ||
| get workspaces(): WorkspacesResource; | ||
| /** Team membership management (ADR 0068; needs a team / team-admin scoped credential). */ | ||
| get members(): MembersResource; | ||
| /** Invitee-side invitations: list the caller's pending invites, accept by token or id. */ | ||
| get invitations(): InvitationsResource; | ||
| } | ||
| export { DropthisEdge, InMemoryPublishInput }; |
@@ -223,3 +223,4 @@ // src/errors.ts | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| } | ||
@@ -311,3 +312,4 @@ ) : { | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| }; | ||
@@ -856,2 +858,65 @@ } | ||
| // src/resources/invitations.ts | ||
| var InvitationsResource = class { | ||
| constructor(transport) { | ||
| this.transport = transport; | ||
| } | ||
| transport; | ||
| /** List the calling account's own pending invitations. */ | ||
| list() { | ||
| return this.transport.request("GET", "/invitations"); | ||
| } | ||
| /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */ | ||
| accept(input) { | ||
| return this.transport.request("POST", "/invitations/accept", { | ||
| body: input | ||
| }); | ||
| } | ||
| /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */ | ||
| acceptById(input) { | ||
| return this.transport.request("POST", "/invitations/accept-by-id", { | ||
| body: input | ||
| }); | ||
| } | ||
| }; | ||
| // src/resources/members.ts | ||
| var MembersResource = class { | ||
| constructor(transport) { | ||
| this.transport = transport; | ||
| } | ||
| transport; | ||
| /** List a workspace's members (any member, `members:read`). */ | ||
| list(workspaceId) { | ||
| return this.transport.request( | ||
| "GET", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/members` | ||
| ); | ||
| } | ||
| /** Invite an email to the workspace (owner/admin, `members:write`). */ | ||
| invite(workspaceId, input) { | ||
| return this.transport.request( | ||
| "POST", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/invitations`, | ||
| { body: input } | ||
| ); | ||
| } | ||
| /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */ | ||
| updateRole(workspaceId, accountId, input) { | ||
| return this.transport.request( | ||
| "PATCH", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}`, | ||
| { body: input } | ||
| ); | ||
| } | ||
| /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`; | ||
| * leaving needs `members:write`. 204 — data is null. */ | ||
| remove(workspaceId, accountId) { | ||
| return this.transport.request( | ||
| "DELETE", | ||
| `/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(accountId)}` | ||
| ); | ||
| } | ||
| }; | ||
| // src/resources/workspaces.ts | ||
@@ -938,3 +1003,3 @@ var WorkspacesResource = class { | ||
| var DEFAULT_BASE_URL = "https://api.dropthis.app"; | ||
| var SDK_VERSION = "0.29.0"; | ||
| var SDK_VERSION = true ? "0.32.0" : "0.0.0-dev"; | ||
| var Transport = class { | ||
@@ -1196,2 +1261,4 @@ apiKey; | ||
| workspacesResource; | ||
| membersResource; | ||
| invitationsResource; | ||
| constructor(options = {}) { | ||
@@ -1240,2 +1307,14 @@ this.transport = new Transport(options); | ||
| } | ||
| /** Team membership management (ADR 0068; needs a team / team-admin scoped credential). */ | ||
| get members() { | ||
| if (!this.membersResource) | ||
| this.membersResource = new MembersResource(this.transport); | ||
| return this.membersResource; | ||
| } | ||
| /** Invitee-side invitations: list the caller's pending invites, accept by token or id. */ | ||
| get invitations() { | ||
| if (!this.invitationsResource) | ||
| this.invitationsResource = new InvitationsResource(this.transport); | ||
| return this.invitationsResource; | ||
| } | ||
| }; | ||
@@ -1242,0 +1321,0 @@ export { |
@@ -306,3 +306,4 @@ "use strict"; | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| } | ||
@@ -394,3 +395,4 @@ ) : { | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| }; | ||
@@ -1305,3 +1307,3 @@ } | ||
| var DEFAULT_BASE_URL = "https://api.dropthis.app"; | ||
| var SDK_VERSION = "0.29.0"; | ||
| var SDK_VERSION = true ? "0.32.0" : "0.0.0-dev"; | ||
| var Transport = class { | ||
@@ -1308,0 +1310,0 @@ apiKey; |
@@ -1,3 +0,3 @@ | ||
| import { a1 as Transport, x as DropthisResult, E as EmailOtpResponse, $ as SessionResponse, H as InvitationListResponse, a7 as Workspace, P as MemberListResponse, B as InvitableRole, F as Invitation, a8 as WorkspaceRole, O as Member, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a5 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, V as PublishInput, i as DeploymentsResource, n as DomainsResource, a9 as WorkspacesResource, W as PublishOptions, S as PreparedPublishRequest } from './workspaces-CebiV4DS.cjs'; | ||
| export { a as AccountResponse, b as AccountUsage, c as AccountWorkspace, d as ActionResolve, g as CursorPage, D as DeploymentContentFile, h as DeploymentContentManifest, j as DnsRecord, k as DomainDeletedResponse, l as DomainListResponse, m as DomainResponse, o as DropAction, p as DropContentFile, q as DropDeploymentResponse, r as DropOptions, s as DropResponse, t as DropWorkspace, w as DropthisErrorResponse, y as EntitlementLimits, z as Entitlements, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, J as ListDeploymentsParams, M as ListDeploymentsResponse, N as ListPage, Q as NextHint, R as PrepareOptions, T as PreparedUploadFile, U as PublishFileInput, X as RequestControls, Y as RequestOptions, Z as RevokeImpact, _ as SHARED_POOL, a0 as TierInfo, a2 as UpdateContentOptions, a3 as UploadManifestFile, a4 as UploadSessionFileResponse, a6 as UploadTarget } from './workspaces-CebiV4DS.cjs'; | ||
| import { a4 as Transport, x as DropthisResult, E as EmailOtpResponse, a2 as SessionResponse, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a8 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, Y as PublishInput, i as DeploymentsResource, n as DomainsResource, ac as WorkspacesResource, S as MembersResource, K as InvitationsResource, Z as PublishOptions, V as PreparedPublishRequest } from './workspaces-Cq705UM6.cjs'; | ||
| export { a as AccountResponse, b as AccountUsage, c as AccountWorkspace, d as ActionResolve, g as CursorPage, D as DeploymentContentFile, h as DeploymentContentManifest, j as DnsRecord, k as DomainDeletedResponse, l as DomainListResponse, m as DomainResponse, o as DropAction, p as DropContentFile, q as DropDeploymentResponse, r as DropOptions, s as DropResponse, t as DropWorkspace, w as DropthisErrorResponse, y as EntitlementLimits, z as Entitlements, G as GetContentOptions, I as ImageTransform, B as InMemoryPublishInput, F as InvitableRole, H as Invitation, J as InvitationListResponse, L as KeyType, M as Limitations, N as ListDeploymentsParams, O as ListDeploymentsResponse, P as ListPage, Q as Member, R as MemberListResponse, T as NextHint, U as PrepareOptions, W as PreparedUploadFile, X as PublishFileInput, _ as RequestControls, $ as RequestOptions, a0 as RevokeImpact, a1 as SHARED_POOL, a3 as TierInfo, a5 as UpdateContentOptions, a6 as UploadManifestFile, a7 as UploadSessionFileResponse, a9 as UploadTarget, aa as Workspace, ab as WorkspaceRole } from './workspaces-Cq705UM6.cjs'; | ||
@@ -24,38 +24,2 @@ declare class AuthResource { | ||
| /** Invitee-side invitations (ADR 0068). Listing needs `members:read`; accepting needs `members:write`. */ | ||
| declare class InvitationsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List the calling account's own pending invitations. */ | ||
| list(): Promise<DropthisResult<InvitationListResponse>>; | ||
| /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */ | ||
| accept(input: { | ||
| token: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */ | ||
| acceptById(input: { | ||
| invitationId: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| } | ||
| /** Team membership management (ADR 0068). Capability follows the credential's scopes. */ | ||
| declare class MembersResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List a workspace's members (any member, `members:read`). */ | ||
| list(workspaceId: string): Promise<DropthisResult<MemberListResponse>>; | ||
| /** Invite an email to the workspace (owner/admin, `members:write`). */ | ||
| invite(workspaceId: string, input: { | ||
| email: string; | ||
| role: InvitableRole; | ||
| }): Promise<DropthisResult<Invitation>>; | ||
| /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */ | ||
| updateRole(workspaceId: string, accountId: string, input: { | ||
| role: WorkspaceRole; | ||
| }): Promise<DropthisResult<Member>>; | ||
| /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`; | ||
| * leaving needs `members:write`. 204 — data is null. */ | ||
| remove(workspaceId: string, accountId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class UploadsResource { | ||
@@ -148,2 +112,2 @@ private readonly transport; | ||
| export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, InvitableRole, Invitation, InvitationListResponse, InvitationsResource, Member, MemberListResponse, MembersResource, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, Workspace, WorkspaceRole, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets }; | ||
| export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, InvitationsResource, MembersResource, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets }; |
@@ -1,3 +0,3 @@ | ||
| import { a1 as Transport, x as DropthisResult, E as EmailOtpResponse, $ as SessionResponse, H as InvitationListResponse, a7 as Workspace, P as MemberListResponse, B as InvitableRole, F as Invitation, a8 as WorkspaceRole, O as Member, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a5 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, V as PublishInput, i as DeploymentsResource, n as DomainsResource, a9 as WorkspacesResource, W as PublishOptions, S as PreparedPublishRequest } from './workspaces-CebiV4DS.js'; | ||
| export { a as AccountResponse, b as AccountUsage, c as AccountWorkspace, d as ActionResolve, g as CursorPage, D as DeploymentContentFile, h as DeploymentContentManifest, j as DnsRecord, k as DomainDeletedResponse, l as DomainListResponse, m as DomainResponse, o as DropAction, p as DropContentFile, q as DropDeploymentResponse, r as DropOptions, s as DropResponse, t as DropWorkspace, w as DropthisErrorResponse, y as EntitlementLimits, z as Entitlements, G as GetContentOptions, I as InMemoryPublishInput, K as KeyType, L as Limitations, J as ListDeploymentsParams, M as ListDeploymentsResponse, N as ListPage, Q as NextHint, R as PrepareOptions, T as PreparedUploadFile, U as PublishFileInput, X as RequestControls, Y as RequestOptions, Z as RevokeImpact, _ as SHARED_POOL, a0 as TierInfo, a2 as UpdateContentOptions, a3 as UploadManifestFile, a4 as UploadSessionFileResponse, a6 as UploadTarget } from './workspaces-CebiV4DS.js'; | ||
| import { a4 as Transport, x as DropthisResult, E as EmailOtpResponse, a2 as SessionResponse, C as CreateUploadSessionRequest, f as CreateUploadSessionResponse, a8 as UploadSessionResponse, v as DropthisClientOptions, e as ApiKeysResource, A as AccountResource, u as DropsResource, Y as PublishInput, i as DeploymentsResource, n as DomainsResource, ac as WorkspacesResource, S as MembersResource, K as InvitationsResource, Z as PublishOptions, V as PreparedPublishRequest } from './workspaces-Cq705UM6.js'; | ||
| export { a as AccountResponse, b as AccountUsage, c as AccountWorkspace, d as ActionResolve, g as CursorPage, D as DeploymentContentFile, h as DeploymentContentManifest, j as DnsRecord, k as DomainDeletedResponse, l as DomainListResponse, m as DomainResponse, o as DropAction, p as DropContentFile, q as DropDeploymentResponse, r as DropOptions, s as DropResponse, t as DropWorkspace, w as DropthisErrorResponse, y as EntitlementLimits, z as Entitlements, G as GetContentOptions, I as ImageTransform, B as InMemoryPublishInput, F as InvitableRole, H as Invitation, J as InvitationListResponse, L as KeyType, M as Limitations, N as ListDeploymentsParams, O as ListDeploymentsResponse, P as ListPage, Q as Member, R as MemberListResponse, T as NextHint, U as PrepareOptions, W as PreparedUploadFile, X as PublishFileInput, _ as RequestControls, $ as RequestOptions, a0 as RevokeImpact, a1 as SHARED_POOL, a3 as TierInfo, a5 as UpdateContentOptions, a6 as UploadManifestFile, a7 as UploadSessionFileResponse, a9 as UploadTarget, aa as Workspace, ab as WorkspaceRole } from './workspaces-Cq705UM6.js'; | ||
@@ -24,38 +24,2 @@ declare class AuthResource { | ||
| /** Invitee-side invitations (ADR 0068). Listing needs `members:read`; accepting needs `members:write`. */ | ||
| declare class InvitationsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List the calling account's own pending invitations. */ | ||
| list(): Promise<DropthisResult<InvitationListResponse>>; | ||
| /** Accept by the raw single-use token from the invite email. Joins + switches active workspace. */ | ||
| accept(input: { | ||
| token: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Accept by invitation id, once authenticated as the invited email — the agent path, no token. */ | ||
| acceptById(input: { | ||
| invitationId: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| } | ||
| /** Team membership management (ADR 0068). Capability follows the credential's scopes. */ | ||
| declare class MembersResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** List a workspace's members (any member, `members:read`). */ | ||
| list(workspaceId: string): Promise<DropthisResult<MemberListResponse>>; | ||
| /** Invite an email to the workspace (owner/admin, `members:write`). */ | ||
| invite(workspaceId: string, input: { | ||
| email: string; | ||
| role: InvitableRole; | ||
| }): Promise<DropthisResult<Invitation>>; | ||
| /** Change a member's role (`members:admin`, owner-only-touches-owner enforced server-side). */ | ||
| updateRole(workspaceId: string, accountId: string, input: { | ||
| role: WorkspaceRole; | ||
| }): Promise<DropthisResult<Member>>; | ||
| /** Remove a member, or leave the workspace (your own id). Removing others needs `members:admin`; | ||
| * leaving needs `members:write`. 204 — data is null. */ | ||
| remove(workspaceId: string, accountId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class UploadsResource { | ||
@@ -148,2 +112,2 @@ private readonly transport; | ||
| export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, InvitableRole, Invitation, InvitationListResponse, InvitationsResource, Member, MemberListResponse, MembersResource, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, Workspace, WorkspaceRole, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets }; | ||
| export { CreateUploadSessionRequest, CreateUploadSessionResponse, DeploymentsResource, DomainsResource, Dropthis, DropthisClientOptions, DropthisResult, InvitationsResource, MembersResource, PreparedPublishRequest, PublishInput, PublishInputError, PublishOptions, UploadSessionResponse, UploadsResource, WorkspacesResource, createErrorResult, isFeatureNotInPlan, isPlanGate, isQuotaExceeded, redactSecrets }; |
@@ -256,3 +256,4 @@ // src/publish/node.ts | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| } | ||
@@ -344,3 +345,4 @@ ) : { | ||
| ...file.sizeBytes !== void 0 ? { sizeBytes: file.sizeBytes } : {}, | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {} | ||
| ...file.checksumSha256 ? { checksumSha256: file.checksumSha256 } : {}, | ||
| ...file.transform ? { transform: file.transform } : {} | ||
| }; | ||
@@ -1255,3 +1257,3 @@ } | ||
| var DEFAULT_BASE_URL = "https://api.dropthis.app"; | ||
| var SDK_VERSION = "0.29.0"; | ||
| var SDK_VERSION = true ? "0.32.0" : "0.0.0-dev"; | ||
| var Transport = class { | ||
@@ -1258,0 +1260,0 @@ apiKey; |
| { | ||
| "name": "@dropthis/node", | ||
| "version": "0.29.0", | ||
| "description": "Official Node.js SDK for Dropthis.", | ||
| "version": "0.32.0", | ||
| "description": "Official Node.js SDK for dropthis — the publish layer between AI and the internet. One call in, one URL out.", | ||
| "keywords": [ | ||
| "dropthis", | ||
| "publish", | ||
| "hosting", | ||
| "static-site", | ||
| "share-url", | ||
| "agent", | ||
| "ai", | ||
| "mcp", | ||
| "html", | ||
| "upload", | ||
| "cdn" | ||
| ], | ||
| "license": "MIT", | ||
@@ -6,0 +19,0 @@ "repository": { |
@@ -289,2 +289,24 @@ <p align="center"><img src="https://dropthis.app/icon-512.png" width="76" height="76" alt="dropthis" /></p> | ||
| ### Plan gates & quotas | ||
| A feature your plan doesn't include (`feature_not_in_plan`) or a limit you've hit (`quota_exceeded`) | ||
| comes back as a typed, **non-retryable** error — don't retry it, surface the upgrade path instead. | ||
| `isPlanGate(error)` covers both; the narrower `isFeatureNotInPlan` / `isQuotaExceeded` are exported too. | ||
| ```typescript | ||
| import { isPlanGate } from "@dropthis/node"; | ||
| const { error } = await dropthis.drops.publish("./dist", { password: "hunter2" }); | ||
| if (isPlanGate(error)) { | ||
| // error.feature ("passwordProtect"), error.requiredPlan ("pro"), error.upgradeUrl | ||
| // — on quota_exceeded also: error.limit, error.usage, error.requested | ||
| console.log(`Needs ${error.requiredPlan}: ${error.upgradeUrl}`); | ||
| } | ||
| ``` | ||
| Pre-flight instead of failing: `account.get().data.entitlements` carries the capability matrix + | ||
| numeric limits, so you can check a gate or size a publish before attempting it. A `403` | ||
| `insufficient_scope` is different — that's a [scope](#capability-scopes) gap on the credential, not a | ||
| plan gate; fix it by minting/re-logging with the needed scope, not by upgrading. | ||
| ## Configuration | ||
@@ -308,2 +330,7 @@ | ||
| **Getting a key.** Grab an `sk_…` key from the [console](https://app.dropthis.app) Credentials page, | ||
| or mint one programmatically after an OTP login (`auth.verifyEmailOtp()` → `apiKeys.create()`). The | ||
| credential is sent as `Authorization: Bearer <key>`; an `at_…` session token works in the same slot. | ||
| With no explicit `apiKey`, the client reads `DROPTHIS_API_KEY` from the environment. | ||
| ## Resources | ||
@@ -397,2 +424,5 @@ | ||
| // Key that can create + manage teams (not just publish) — pass a scope bundle | ||
| await dropthis.apiKeys.create({ label: "Team bot", scopes: ["team"] }); | ||
| await dropthis.apiKeys.list(); | ||
@@ -404,2 +434,26 @@ await dropthis.apiKeys.delete("key_abc123"); // 204 No Content — data is null | ||
| #### Capability scopes | ||
| Every credential carries a set of **capability scopes** that decide what it may do (ADR 0068). You | ||
| request them as **bundles**; `apiKeys.create({ scopes })` mints the requested set **intersected with | ||
| your own** (downscope-only — you can never grant a key more than you hold). | ||
| | Bundle | Grants | Use it for | | ||
| | --- | --- | --- | | ||
| | `publish` *(default)* | publish drops, read your own context, mint downscope-only keys | a normal API key / `dropthis login` | | ||
| | `team` | `publish` + create/rename workspaces + invite/manage members | building or running a team | | ||
| | `team-admin` | `team` + delete workspaces, remove members, change roles | the irreversible team-admin tier | | ||
| | `service` | `publish` minus key-minting, workspace-pinned | CI/automation | | ||
| Omit `scopes` for the default `publish` bundle. A plain key **cannot** do team management — call a | ||
| team op (`workspaces.create()`, members, invitations) with a publish-only key and the API returns | ||
| `403 insufficient_scope`; mint or re-login with the `team` bundle to fix it. Fine-grained scopes | ||
| (e.g. `members:admin`) may be passed individually; the created key's `data.scopes` echoes the | ||
| granted set. | ||
| ```typescript | ||
| const { data } = await dropthis.apiKeys.create({ label: "Team bot", scopes: ["team"] }); | ||
| console.log(data.scopes); // the granted set (requested ∩ yours) | ||
| ``` | ||
| ### account | ||
@@ -519,2 +573,33 @@ | ||
| #### Team management (workspaces, members, invitations) | ||
| A **team** workspace is shared by multiple accounts. Creating and managing one needs a `team`-scoped | ||
| credential (see [Capability scopes](#capability-scopes)) — a default publish key gets | ||
| `403 insufficient_scope`. Drops published while a team workspace is active land there and route on its | ||
| shared custom domain automatically. | ||
| ```typescript | ||
| // Create a team (caller becomes its owner) and switch to it | ||
| const { data: team } = await dropthis.workspaces.create({ name: "Acme" }); | ||
| await dropthis.workspaces.use(team.slug); | ||
| // Invite + manage members | ||
| await dropthis.members.invite(team.id, { email: "teammate@acme.com", role: "member" }); | ||
| const { data: roster } = await dropthis.members.list(team.id); | ||
| await dropthis.members.updateRole(team.id, "acc_123", { role: "admin" }); // needs members:admin | ||
| await dropthis.members.remove(team.id, "acc_123"); // remove a member, or your own id to leave | ||
| // Rename / delete the workspace | ||
| await dropthis.workspaces.rename(team.id, { name: "Acme Inc" }); | ||
| await dropthis.workspaces.delete(team.id); // owner only, needs workspaces:admin | ||
| // Invitee side — accept an invite (joins + switches active workspace) | ||
| const { data: pending } = await dropthis.invitations.list(); | ||
| await dropthis.invitations.accept({ token: "inv_raw_token_from_email" }); | ||
| await dropthis.invitations.acceptById({ invitationId: "inv_abc123" }); // agent path: no token, just be the invited email | ||
| ``` | ||
| `role` is `"admin" | "member"` for invites; `updateRole` also accepts `"owner"` to transfer ownership | ||
| (owner-only, enforced server-side). | ||
| ## Pricing tiers | ||
@@ -521,0 +606,0 @@ |
+2
-2
| { | ||
| "name": "@dropthis/mcp", | ||
| "version": "0.29.0", | ||
| "version": "0.30.0", | ||
| "description": "Official MCP server for dropthis — publish content and get a permanent URL from any MCP-compatible agent.", | ||
@@ -44,3 +44,3 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@dropthis/node": "^0.29.0", | ||
| "@dropthis/node": "^0.32.0", | ||
| "@modelcontextprotocol/sdk": "^1.29.0", | ||
@@ -47,0 +47,0 @@ "zod": "^3.25.0" |
+11
-1
@@ -119,3 +119,3 @@ <p align="center"><img src="https://dropthis.app/icon-512.png" width="76" height="76" alt="dropthis" /></p> | ||
| | `content` | UTF-8 text: HTML, CSS, JS, JSON, SVG, markdown | Text is sent inline | | ||
| | `source_url` | Remote assets: images, video, PDFs, fonts | Server fetches the URL; no bytes pass through your agent. Optional `content_type`, `size_bytes`, `checksum_sha256` | | ||
| | `source_url` | Remote assets: images, video, PDFs, fonts | Server fetches the URL; no bytes pass through your agent. Optional `content_type`, `size_bytes`, `checksum_sha256`, `transform` | | ||
| | `content_base64` | Small inline binary blobs only | Capped at 64 KiB encoded; rejected with a corrective error above that threshold pointing at `source_url` | | ||
@@ -135,2 +135,12 @@ | ||
| **Image transforms.** A `source_url` image can carry a `transform` so the server resizes/re-encodes it on ingest — point at a big original and store a small web-optimised derivative, no scratch bucket needed. Fits inside the box, never upscales, strips metadata. Only with `source_url`; omit `size_bytes`/`checksum_sha256` (the stored object reflects the output). | ||
| ```json | ||
| { | ||
| "files": [ | ||
| { "path": "hero.jpg", "source_url": "https://cdn.example.com/original.png", "transform": { "width": 1080, "quality": 78, "format": "jpeg" } } | ||
| ] | ||
| } | ||
| ``` | ||
| ### Editing a bundle — `update_content` is a partial update | ||
@@ -137,0 +147,0 @@ |
| type DropthisClientOptions = { | ||
| apiKey?: string; | ||
| baseUrl?: string; | ||
| timeoutMs?: number; | ||
| uploadTimeoutMs?: number; | ||
| fetch?: typeof globalThis.fetch; | ||
| /** | ||
| * Default workspace slug or id applied to every publish/prepare call that | ||
| * does not supply its own `options.workspace`. Delegated credentials only; | ||
| * ignored by pinned service keys. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type RequestOptions = { | ||
| authenticated?: boolean; | ||
| idempotencyKey?: string; | ||
| ifRevision?: number; | ||
| timeoutMs?: number; | ||
| }; | ||
| type DropthisErrorResponse = { | ||
| code: string; | ||
| message: string; | ||
| statusCode: number | null; | ||
| type?: string; | ||
| title?: string; | ||
| detail?: string | null; | ||
| instance?: string | null; | ||
| param?: string | null; | ||
| currentRevision?: number; | ||
| requestId?: string | null; | ||
| suggestion?: string | null; | ||
| retryable?: boolean | null; | ||
| /** The gated capability (on `feature_not_in_plan`), e.g. `password_protect`. */ | ||
| feature?: string | null; | ||
| /** The caller's current plan (on `feature_not_in_plan` / `quota_exceeded`). */ | ||
| currentPlan?: string | null; | ||
| /** The lowest plan that unlocks the feature (on `feature_not_in_plan`). */ | ||
| requiredPlan?: string | null; | ||
| /** The pricing/upgrade URL to hand a human (on a plan gate). */ | ||
| upgradeUrl?: string | null; | ||
| /** Numeric ceiling that was hit (on `quota_exceeded`). */ | ||
| limit?: number | null; | ||
| /** Amount already used toward the ceiling (on `quota_exceeded`). */ | ||
| used?: number | null; | ||
| /** Amount the request asked for (on `quota_exceeded`). */ | ||
| requested?: number | null; | ||
| body?: unknown; | ||
| }; | ||
| type DropthisResult<T> = { | ||
| data: T; | ||
| error: null; | ||
| headers: Record<string, string>; | ||
| } | { | ||
| data: null; | ||
| error: DropthisErrorResponse; | ||
| headers: Record<string, string>; | ||
| }; | ||
| type ActionResolve = { | ||
| method: string; | ||
| url?: string | null; | ||
| endpoint?: string | null; | ||
| }; | ||
| type DropAction = { | ||
| code: string; | ||
| kind: "api" | "human"; | ||
| priority: "required" | "suggested"; | ||
| message: string; | ||
| resolve?: ActionResolve | null; | ||
| }; | ||
| type TierInfo = { | ||
| name: string; | ||
| maxSizeBytes: number; | ||
| ttlDays: number | null; | ||
| persistent: boolean; | ||
| badge: boolean; | ||
| }; | ||
| type Limitations = { | ||
| actions: DropAction[]; | ||
| }; | ||
| /** | ||
| * Workspace context echoed on every drop response. Identifies which workspace | ||
| * the drop was published into (ADR 0066). | ||
| */ | ||
| type DropWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| }; | ||
| type DropResponse = { | ||
| id: string; | ||
| slug: string; | ||
| url: string; | ||
| deploymentId: string | null; | ||
| title: string; | ||
| contentType: string; | ||
| visibility: string; | ||
| status: string; | ||
| revision: number; | ||
| contentRevision: number; | ||
| accessRevision: number; | ||
| sizeBytes: number; | ||
| renderMode: string; | ||
| warnings: Array<Record<string, unknown>>; | ||
| createdAt: string; | ||
| expiresAt: string | null; | ||
| noindex: boolean; | ||
| passwordProtected: boolean; | ||
| metadata: Record<string, unknown>; | ||
| /** When the drop was last updated (content or settings), ISO 8601. */ | ||
| updatedAt: string; | ||
| /** Origin that created the drop (e.g. "api", "cli", "mcp"); null/omitted when unattributed. */ | ||
| source?: string | null; | ||
| object: string; | ||
| accessible: boolean; | ||
| persistent: boolean; | ||
| badgeApplied: boolean; | ||
| tier: TierInfo; | ||
| limitations: Limitations; | ||
| /** Hostname of the custom domain this drop is mounted on; null for shared-pool drops. */ | ||
| domain: string | null; | ||
| /** | ||
| * Direct URL to the drop's raw bytes — the agent byte-fetch path. The canonical | ||
| * `url` always serves a branded human view (so the badge is guaranteed); `rawUrl` | ||
| * serves the underlying file's exact bytes at its natural path under the mount | ||
| * (ADR 0061). Populated only for single-file (`renderMode: "file_viewer"`) drops | ||
| * (= canonical URL + the entry filename); `null` for `user_html` drops (the page | ||
| * IS the artifact) and collections (per-file natural paths come from the manifest — | ||
| * see {@link DeploymentContentManifest}). Hand `url` to humans and `rawUrl` to agents. | ||
| * To stream bytes through the SDK regardless of drop kind, use `drops.getContent()`. | ||
| */ | ||
| rawUrl: string | null; | ||
| /** The workspace this drop belongs to (echoed from the server on every response). */ | ||
| workspace: DropWorkspace; | ||
| }; | ||
| type DropDeploymentResponse = { | ||
| id: string; | ||
| dropId: string; | ||
| revision: number; | ||
| status: string; | ||
| entry: string | null; | ||
| contentType: string; | ||
| renderMode: string; | ||
| files: Array<Record<string, unknown>>; | ||
| warnings: Array<Record<string, unknown>>; | ||
| sizeBytes: number; | ||
| classificationVersion: number; | ||
| classificationReason: string; | ||
| errorCode: string | null; | ||
| errorMessage: string | null; | ||
| createdAt: string; | ||
| readyAt: string | null; | ||
| publishedAt: string | null; | ||
| }; | ||
| type ListDeploymentsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| }; | ||
| type ListDeploymentsResponse = { | ||
| deployments: DropDeploymentResponse[]; | ||
| nextCursor: string | null; | ||
| }; | ||
| type ListPage<T> = { | ||
| object: "list"; | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| }; | ||
| type Action = { | ||
| code: string; | ||
| kind: string; | ||
| method?: string | null; | ||
| endpoint?: string | null; | ||
| message: string; | ||
| }; | ||
| type EmailOtpResponse = { | ||
| /** Always `true` on success; optional because the server defaults it. */ | ||
| ok?: true; | ||
| expiresIn: number; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type SessionResponse = { | ||
| object: "session"; | ||
| token: string; | ||
| accountId: string; | ||
| isNewAccount: boolean; | ||
| expiresIn: number; | ||
| /** | ||
| * Rotating refresh token for a console browser session. Present when a session is | ||
| * started (email/verify, refresh); `null`/omitted for non-session token issuance. | ||
| */ | ||
| refreshToken?: string | null; | ||
| }; | ||
| /** | ||
| * Why an API key exists. `delegated` keys act on behalf of the owning account (scoped | ||
| * to the active workspace or an allowed set); `service` keys are pinned to a single | ||
| * workspace and are intended for CI/automation. | ||
| */ | ||
| type KeyType = "delegated" | "service"; | ||
| /** What breaks when a key is revoked. */ | ||
| type RevokeImpact = "disconnects_app" | "breaks_automation"; | ||
| type ApiKeyResponse = { | ||
| object: "api_key"; | ||
| id: string; | ||
| keyLast4: string; | ||
| label: string; | ||
| /** Human-facing credential name: the user's label for `standard` keys, the connected client name for `mcp_oauth` keys. */ | ||
| appName: string; | ||
| /** Why the key exists (drives quota accounting). */ | ||
| keyType: KeyType; | ||
| /** Scopes granted to this key. */ | ||
| scopes: string[]; | ||
| /** When the key was last used to authenticate, ISO 8601; null/omitted if never used. */ | ||
| lastUsedAt?: string | null; | ||
| /** What breaks if this key is revoked. */ | ||
| revokeImpact: RevokeImpact; | ||
| createdAt: string; | ||
| }; | ||
| type ApiKeyCreatedResponse = ApiKeyResponse & { | ||
| key: string; | ||
| accountId?: string | null; | ||
| isNewAccount?: boolean; | ||
| }; | ||
| /** Numeric limits for the active plan — use these to size a publish before uploading. */ | ||
| type EntitlementLimits = { | ||
| /** Maximum size of a single drop in bytes. */ | ||
| maxSizeBytes: number; | ||
| /** Total account storage cap in bytes; null means no account-level cap. */ | ||
| maxStorageBytes: number | null; | ||
| /** Drop lifetime in seconds before expiry; null means drops are permanent. */ | ||
| defaultTtlSeconds: number | null; | ||
| /** Maximum number of custom hostnames the workspace may connect. */ | ||
| maxCustomHostnames: number; | ||
| /** Maximum members the workspace may hold (owner included). */ | ||
| seatLimit: number; | ||
| /** Maximum concurrent in-flight upload sessions (a transient concurrency cap). */ | ||
| maxActiveUploadSessions: number; | ||
| }; | ||
| /** | ||
| * The full capability matrix for the active plan — the single read to pre-check a | ||
| * feature gate before attempting an operation. | ||
| */ | ||
| type Entitlements = { | ||
| /** | ||
| * Per-capability state for the active plan. Boolean caps are `true`/`false`; | ||
| * enum caps (`ogPreview`, `analytics`) carry a value — compare by value, never | ||
| * truthiness (`"none"` is truthy). | ||
| */ | ||
| capabilities: Record<string, boolean | string>; | ||
| /** | ||
| * The lowest plan that unlocks each gated capability — drives the upgrade nudge. | ||
| * Enum sub-values are keyed `ogPreview.customImage` / `analytics.full`. | ||
| */ | ||
| requiredPlan: Record<string, string>; | ||
| /** Numeric limits for the active plan. */ | ||
| limits: EntitlementLimits; | ||
| }; | ||
| /** Current resource usage for the account's active workspace. */ | ||
| type AccountUsage = { | ||
| /** Total bytes consumed across all active drops. */ | ||
| storageUsedBytes: number; | ||
| /** Number of custom domain hostnames currently in use. */ | ||
| customDomainsUsed: number; | ||
| /** Members currently in the workspace (owner included). */ | ||
| seatsUsed: number; | ||
| }; | ||
| /** The workspace a principal acts within (ADR 0066). For an sk_ API key, the workspace the key is bound to. */ | ||
| type AccountWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` when shared with other members. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| }; | ||
| /** | ||
| * A workspace the caller belongs to or has delegated access to. | ||
| * Returned by `GET /v1/workspaces` and `PUT /v1/account/active-workspace`. | ||
| */ | ||
| type Workspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| /** The plan tier of this workspace. */ | ||
| plan: string; | ||
| /** Whether this workspace is currently the caller's active workspace. */ | ||
| isActive: boolean; | ||
| /** | ||
| * On CREATE only (null otherwise): whether the credential that created this workspace can act | ||
| * in it. `false` means an allowlist-restricted key created a workspace outside its allowlist — | ||
| * it will be denied on the next write; re-authenticate to obtain a credential that reaches it. | ||
| */ | ||
| creatorCanReach?: boolean | null; | ||
| }; | ||
| /** A role grantable via invite or a member role-change (owner is transferred, never granted). */ | ||
| type WorkspaceRole = "owner" | "admin" | "member"; | ||
| type InvitableRole = "admin" | "member"; | ||
| /** A member of a team workspace. */ | ||
| type Member = { | ||
| accountId: string; | ||
| /** The member's email, or null if their account was deleted. */ | ||
| email: string | null; | ||
| role: WorkspaceRole; | ||
| /** Whether this row is the calling account. */ | ||
| isYou: boolean; | ||
| joinedAt: string; | ||
| }; | ||
| type MemberListResponse = { | ||
| members: Member[]; | ||
| }; | ||
| /** An invitation to join a team workspace. */ | ||
| type Invitation = { | ||
| id: string; | ||
| workspaceId: string; | ||
| email: string; | ||
| role: WorkspaceRole; | ||
| /** `pending`, `accepted`, or `revoked`. */ | ||
| status: string; | ||
| expiresAt: string; | ||
| createdAt: string; | ||
| acceptedAt?: string | null; | ||
| }; | ||
| type InvitationListResponse = { | ||
| invitations: Invitation[]; | ||
| }; | ||
| type AccountResponse = { | ||
| id: string; | ||
| email: string; | ||
| displayName: string | null; | ||
| plan: string; | ||
| status: string; | ||
| createdAt: string; | ||
| /** The full capability matrix + numeric limits for the active plan. */ | ||
| entitlements: Entitlements; | ||
| usage: AccountUsage; | ||
| workspace: AccountWorkspace; | ||
| /** URL to upgrade; present on every plan below Business, null on the top tier. */ | ||
| upgradeUrl: string | null; | ||
| }; | ||
| type ListDropsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| /** Only drops mounted on this custom domain hostname (e.g. "reports.example.com"). */ | ||
| domain?: string; | ||
| }; | ||
| /** | ||
| * One file in an upload manifest. A discriminated union: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes through a signed PUT. Requires | ||
| * `contentType` and `sizeBytes`; an optional `checksumSha256` locks the | ||
| * transfer integrity. | ||
| * - **remote** — the server fetches the bytes itself from `sourceUrl` during | ||
| * `POST /uploads/{id}/ingest`. No bytes leave this process, so `sizeBytes`, | ||
| * `contentType`, and `checksumSha256` are all optional (the server infers | ||
| * them on fetch). Carries NO signed PUT target. | ||
| * | ||
| * `sourceUrl` is the discriminant: present ⇒ remote, absent ⇒ client-put. The | ||
| * camelCase `sourceUrl` becomes the wire field `source_url` via the transport's | ||
| * snake_case conversion (exactly like `contentType` → `content_type`). | ||
| */ | ||
| type UploadManifestFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string | null; | ||
| sourceUrl?: never; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| sizeBytes?: number; | ||
| checksumSha256?: string | null; | ||
| }; | ||
| type CreateUploadSessionRequest = { | ||
| schemaVersion?: 1; | ||
| files: UploadManifestFile[]; | ||
| entry?: string | null; | ||
| /** | ||
| * Target workspace slug or id for this upload session. Delegated credentials only; | ||
| * ignored by pinned service keys. Bound at session creation and inherited by the | ||
| * subsequent POST /drops call. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type UploadTarget = { | ||
| /** Always `single_put` — one signed PUT per file is the upload contract. */ | ||
| strategy: "single_put"; | ||
| url: string; | ||
| headers: Record<string, string>; | ||
| expiresAt: string; | ||
| }; | ||
| type CreateUploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| objectKey: string; | ||
| upload: UploadTarget; | ||
| }; | ||
| type UploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| /** Declared MIME type; `null`/omitted for remote-fetch files until ingested. */ | ||
| contentType?: string | null; | ||
| /** Declared byte size; `null`/omitted for remote-fetch files until ingested. */ | ||
| sizeBytes?: number | null; | ||
| objectKey: string; | ||
| /** How the file enters staging: "client_put" (client PUTs bytes) or "remote_fetch" (server fetches sourceUrl). */ | ||
| origin: "client_put" | "remote_fetch"; | ||
| /** Ingest lifecycle state for remote-fetch files (e.g. "pending" | "fetching" | "fetched" | "failed"). */ | ||
| state: string; | ||
| /** Public http(s) URL the server fetches into staging; `null`/omitted for client-put files. */ | ||
| sourceUrl?: string | null; | ||
| verified: boolean; | ||
| }; | ||
| type UploadSessionResponse = { | ||
| uploadId: string; | ||
| status: string; | ||
| expiresAt: string; | ||
| entry?: string | null; | ||
| files: UploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type CreateUploadSessionResponse = { | ||
| uploadId: string; | ||
| expiresAt: string; | ||
| files: CreateUploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| /** | ||
| * Sentinel for `DropOptions.domain`: publish to the shared pool even when the | ||
| * account has a default custom domain (dropthis#55). Collision-free — the | ||
| * literal "shared" can never be a real hostname (single-label names are | ||
| * rejected at domain connect). These drops read back `domain: null`. | ||
| */ | ||
| declare const SHARED_POOL = "shared"; | ||
| type DropOptions = { | ||
| /** Drop title. */ | ||
| title?: string; | ||
| /** public (default) or unlisted. */ | ||
| visibility?: "public" | "unlisted"; | ||
| /** Require password to view. Pass `null` to remove password protection. */ | ||
| password?: string | null; | ||
| /** Prevent search-engine indexing. Pass `null` to allow indexing (default). */ | ||
| noindex?: boolean | null; | ||
| /** Auto-delete after this ISO 8601 date. Pass `null` to clear. */ | ||
| expiresAt?: string | Date | null; | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */ | ||
| metadata?: Record<string, unknown>; | ||
| /** | ||
| * Hostname of a custom domain connected to this account (must be live — see | ||
| * `client.domains`), or {@link SHARED_POOL} (`"shared"`) to publish to the shared | ||
| * pool even when the account has a default domain. Path-mode domains serve the drop | ||
| * at `https://{domain}/{slug}/`; dedicated domains serve it at the root and conflict | ||
| * (409) once occupied. Omit to use the account's default path domain if one exists, | ||
| * else the shared pool. | ||
| */ | ||
| domain?: string | null; | ||
| /** | ||
| * Vanity slug — only valid when the target is a path-mode custom domain. 1–63 | ||
| * lowercase letters/digits/hyphens (no leading/trailing/double hyphen). Taken slugs | ||
| * are auto-suffixed; omit for a random slug. Setting this on the shared pool returns | ||
| * 422. | ||
| */ | ||
| slug?: string | null; | ||
| }; | ||
| type PrepareOptions = { | ||
| /** Glob patterns to ignore when publishing directories. */ | ||
| ignore?: string[]; | ||
| /** Disable default ignore patterns. */ | ||
| ignoreDefaults?: boolean; | ||
| /** Override MIME type (auto-detected from extension). */ | ||
| contentType?: string; | ||
| /** Set filename when publishing from stdin or bytes. */ | ||
| path?: string; | ||
| }; | ||
| type RequestControls = { | ||
| /** Prevent duplicate publishes on retry (auto-generated by CLI). */ | ||
| idempotencyKey?: string; | ||
| /** Fail if current revision doesn't match -- optimistic lock (update only). */ | ||
| ifRevision?: number; | ||
| }; | ||
| type PublishOptions = DropOptions & PrepareOptions & RequestControls & { | ||
| /** | ||
| * Target workspace slug or id — publish/prepare only (a fresh drop's workspace). | ||
| * Delegated credentials only; ignored by pinned service keys. Falls back to the | ||
| * client-level `workspace` default when omitted. Not a settings field: it is NOT | ||
| * accepted by `updateSettings` (a drop never moves workspace) nor by `updateContent` | ||
| * (which stays in the drop's own workspace). | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * Options for `drops.updateContent()` — content-only. A content update ships a new content version | ||
| * and never changes drop settings (title, visibility, password, noindex, expiry, metadata); those | ||
| * belong on `drops.updateSettings()`. Carries only content-prep + request controls + the bundle | ||
| * `entry`. | ||
| */ | ||
| type UpdateContentOptions = PrepareOptions & RequestControls & { | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** | ||
| * How the supplied files combine with what the drop already serves | ||
| * (partial-by-default, ADR 0065): | ||
| * | ||
| * - `"patch"` (default): the supplied files upsert by path and every | ||
| * unmentioned file is carried forward, so editing one file never drops the | ||
| * rest. Use `deletePaths` to remove files. | ||
| * - `"replace"`: the supplied files become the drop's entire content set — | ||
| * a full swap. Anything not supplied is gone. `deletePaths` is invalid here. | ||
| * | ||
| * Omit to default to `"patch"`. | ||
| */ | ||
| mode?: "patch" | "replace"; | ||
| /** | ||
| * Paths to remove from the drop's content (patch-mode only). Each path must | ||
| * exist or the server rejects the update (loud, never a silent no-op). Invalid | ||
| * with `mode: "replace"`. Wire field: `delete_paths`. | ||
| */ | ||
| deletePaths?: string[]; | ||
| }; | ||
| /** | ||
| * One file in a multi-file `{ kind: "files" }` bundle. Supply the bytes inline | ||
| * exactly one way — `content` (UTF-8 text), `contentBase64`, or `bytes` — OR set | ||
| * `sourceUrl` to a public http(s) URL and let the server fetch that file for you | ||
| * server-side (no bytes pass through your process). A single entry may NOT carry | ||
| * both inline bytes and `sourceUrl`. Mix freely within one bundle: e.g. inline | ||
| * `content` for `index.html` plus a `sourceUrl` for each image referenced by it, | ||
| * yielding one self-contained drop. | ||
| */ | ||
| type PublishFileInput = { | ||
| path: string; | ||
| contentType?: string; | ||
| content?: string; | ||
| contentBase64?: string; | ||
| bytes?: Uint8Array; | ||
| /** | ||
| * Public http(s) URL the server fetches this file's bytes from during publish | ||
| * (publish by reference). Mutually exclusive with `content`/`contentBase64`/`bytes`. | ||
| */ | ||
| sourceUrl?: string; | ||
| /** | ||
| * Declared byte size of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server uses this for upfront quota admission before fetching, | ||
| * so a large file is rejected immediately rather than after the server downloads it. | ||
| * Ignored for inline files (size is computed from the bytes). | ||
| */ | ||
| sizeBytes?: number; | ||
| /** | ||
| * Expected SHA-256 hex digest of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server verifies the fetched content matches this checksum and | ||
| * rejects the publish if it does not, giving you integrity verification without | ||
| * downloading the bytes yourself. | ||
| * Ignored for inline files (checksum is computed by the SDK/server from actual bytes). | ||
| */ | ||
| checksumSha256?: string; | ||
| }; | ||
| type PublishInput = string | string[] | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| /** Structured next-step hint returned by domain operations (and publish). */ | ||
| type NextHint = { | ||
| action: string; | ||
| message: string; | ||
| }; | ||
| /** One DNS record instruction or diagnostic for a custom domain. */ | ||
| type DnsRecord = { | ||
| /** Purpose of the record, e.g. "routing". */ | ||
| purpose: string; | ||
| /** DNS record type, e.g. "CNAME". */ | ||
| type: string; | ||
| /** The DNS name to create the record for. */ | ||
| name: string; | ||
| /** The value the record must point at. */ | ||
| value: string; | ||
| /** Current DNS status: "missing" | "ok" | "mismatch". */ | ||
| status: "missing" | "ok" | "mismatch"; | ||
| /** What DoH currently resolves for this record (verify only). */ | ||
| observed?: string | null; | ||
| /** Specific guidance for fixing this record. */ | ||
| hint?: string | null; | ||
| /** Seconds to wait before retrying verify while DNS/cert propagates. */ | ||
| retryAfter?: number | null; | ||
| }; | ||
| /** Full domain resource representation. */ | ||
| type DomainResponse = { | ||
| object: "domain"; | ||
| /** Stable domain identifier. */ | ||
| id: string; | ||
| /** Canonical hostname registered with dropthis. */ | ||
| hostname: string; | ||
| /** Mount mode: "path" (many drops at hostname/{slug}/) or "dedicated" (one drop at hostname/). */ | ||
| mode: "path" | "dedicated"; | ||
| /** Lifecycle status: "pending_dns" | "verifying" | "live" | "failed". */ | ||
| status: "pending_dns" | "verifying" | "live" | "failed"; | ||
| /** Reason for failure status. */ | ||
| failureReason?: string | null; | ||
| /** Whether this is the account's default publish domain. */ | ||
| default: boolean; | ||
| /** Mounted drop id (dedicated mode only). */ | ||
| dropId?: string | null; | ||
| /** DNS records required for this domain. */ | ||
| dns: DnsRecord[]; | ||
| /** Creation timestamp. */ | ||
| createdAt: string; | ||
| /** When the domain first reached "live" status. */ | ||
| verifiedAt?: string | null; | ||
| /** Structured next-step hints for the agent. */ | ||
| next: NextHint[]; | ||
| /** | ||
| * Deep link to this domain's setup page in the dropthis console | ||
| * (e.g. https://app.dropthis.app/domains/dom_…). Hand this to a human so | ||
| * they can add the DNS record and watch it go live in a polished UI. | ||
| */ | ||
| consoleUrl: string; | ||
| }; | ||
| /** List of domains for the account. */ | ||
| type DomainListResponse = { | ||
| object: "domain.list"; | ||
| /** Domains connected to this account. */ | ||
| domains: DomainResponse[]; | ||
| }; | ||
| /** Response body for a successful domain deletion. */ | ||
| type DomainDeletedResponse = { | ||
| object: "domain.deleted"; | ||
| /** Id of the deleted domain. */ | ||
| id: string; | ||
| /** Hostname of the deleted domain. */ | ||
| hostname: string; | ||
| /** Dangling-CNAME risk warning (always present; instructs you to remove the DNS record). */ | ||
| warning: string; | ||
| }; | ||
| /** One readable file in a deployment's content manifest. */ | ||
| type DeploymentContentFile = { | ||
| /** File path within the deployment, relative to its root. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with. */ | ||
| contentType: string; | ||
| /** Stored file size in bytes. */ | ||
| sizeBytes: number; | ||
| }; | ||
| /** | ||
| * Manifest of one deployment's readable files (content read-back). | ||
| * Fetch a single file's bytes with `drops.getContent(dropId, { path })`. | ||
| */ | ||
| type DeploymentContentManifest = { | ||
| /** Parent drop identifier. */ | ||
| dropId: string; | ||
| /** Deployment identifier. */ | ||
| deploymentId: string; | ||
| /** Content revision of this deployment. */ | ||
| revision: number; | ||
| /** Deployment lifecycle status. */ | ||
| status: string; | ||
| /** Total deployment size in bytes. */ | ||
| sizeBytes: number; | ||
| /** Entry path served at the drop root. */ | ||
| entry?: string | null; | ||
| /** Readable files in this deployment; pass files[].path as `path` to download one. */ | ||
| files: DeploymentContentFile[]; | ||
| }; | ||
| /** Options for `drops.getContent()`. */ | ||
| type GetContentOptions = { | ||
| /** Read a historical deployment instead of the current one. */ | ||
| deploymentId?: string; | ||
| /** Download this single file's raw stored bytes instead of the JSON manifest. */ | ||
| path?: string; | ||
| }; | ||
| /** A single file downloaded via `drops.getContent(dropId, { path })`. */ | ||
| type DropContentFile = { | ||
| /** The requested file path. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with (from the response Content-Type). */ | ||
| contentType: string | null; | ||
| /** Exact stored bytes. */ | ||
| bytes: Uint8Array; | ||
| /** Decode the bytes as UTF-8 text. */ | ||
| text(): string; | ||
| }; | ||
| declare class Transport { | ||
| readonly apiKey: string | undefined; | ||
| readonly baseUrl: string; | ||
| readonly timeoutMs: number; | ||
| readonly uploadTimeoutMs: number; | ||
| readonly fetchImpl: typeof globalThis.fetch; | ||
| constructor(options?: DropthisClientOptions | string); | ||
| putSignedUrl(url: string, body: Uint8Array | Blob | ReadableStream, headers: Record<string, string>): Promise<DropthisResult<{ | ||
| etag: string | null; | ||
| }>>; | ||
| /** | ||
| * Authenticated GET that returns the raw response bytes untouched (no JSON parsing, | ||
| * no case conversion). Error responses are still parsed as problem+json. Used for | ||
| * content read-back (`drops.getContent` with a file path). | ||
| */ | ||
| requestBytes(path: string, options?: RequestOptions & { | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<{ | ||
| bytes: Uint8Array; | ||
| contentType: string | null; | ||
| }>>; | ||
| request<T>(method: string, path: string, options?: RequestOptions & { | ||
| body?: unknown; | ||
| bodyCase?: "snake" | "raw"; | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<T>>; | ||
| } | ||
| /** | ||
| * A file ready to be staged for upload. Two shapes: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes. The body is lazy: the orchestrator | ||
| * calls `getBody()` per file when it is ready to push bytes to the signed URL. | ||
| * This keeps the resolution layer pure and lets the filesystem layer (node.ts) | ||
| * defer reads/streams until upload time. | ||
| * - **remote** (`sourceUrl` set, no `getBody`) — the server fetches the bytes from | ||
| * `sourceUrl` during `POST /uploads/{id}/ingest`. No bytes leave this process, so | ||
| * it has no `getBody`, no `sizeBytes`, and consumes no signed PUT target. | ||
| */ | ||
| type PreparedUploadFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string; | ||
| sourceUrl?: never; | ||
| getBody(): Promise<Uint8Array | Blob | ReadableStream>; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| /** Optional hint: declared byte size for upfront quota admission (server-side). */ | ||
| sizeBytes?: number; | ||
| /** Optional hint: expected SHA-256 hex digest for server-side integrity check. */ | ||
| checksumSha256?: string; | ||
| getBody?: never; | ||
| }; | ||
| /** | ||
| * Resolves a publish input into a {@link PreparedPublishRequest}. Two implementations exist: | ||
| * the fs-free {@link resolveInMemory} (Workers-safe) and the fs-capable `resolveInput` in | ||
| * `publish/node.ts`. `DropsResource` takes one by injection so it can power both the Node client | ||
| * and the edge client WITHOUT statically importing the Node-only pipeline (which would poison the | ||
| * Workers bundle with `node:fs`/`fast-glob`). `TInput` is the input type the chosen resolver | ||
| * accepts ({@link InMemoryPublishInput} on the edge, the full `PublishInput` on Node). | ||
| */ | ||
| type PublishInputResolver<TInput> = (input: TInput, options: PublishOptions) => Promise<PreparedPublishRequest>; | ||
| type PreparedPublishRequest = { | ||
| kind: "staged"; | ||
| manifest: CreateUploadSessionRequest; | ||
| files: PreparedUploadFile[]; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Bound at upload-session creation. */ | ||
| workspace?: string; | ||
| } | { | ||
| kind: "source"; | ||
| sourceUrl: string; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Forwarded as top-level field in POST /drops. */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * The canonical publish inputs that can be resolved with no filesystem access: | ||
| * the {@link PublishInput} union minus `string[]` (which is inherently a list | ||
| * of filesystem paths handled by node.ts). | ||
| */ | ||
| type InMemoryPublishInput = string | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| declare class AccountResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| get(): Promise<DropthisResult<AccountResponse>>; | ||
| update(input: { | ||
| displayName: string | null; | ||
| }): Promise<DropthisResult<AccountResponse>>; | ||
| delete(): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class ApiKeysResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| object: "list"; | ||
| data: ApiKeyResponse[]; | ||
| }>>; | ||
| create(input: { | ||
| label: string; | ||
| /** Key type: `"delegated"` (default on server) or `"service"` (pinned to a workspace). */ | ||
| type?: KeyType; | ||
| /** Pin a `service` key to this workspace slug or id. */ | ||
| workspace?: string; | ||
| /** Restrict a `delegated` key to these workspace slugs or ids. */ | ||
| allowedWorkspaces?: string[]; | ||
| /** | ||
| * Request the credential's capability scopes (ADR 0068). Each entry is a bundle | ||
| * name (`publish`, `team`, `team-admin`) or a fine-grained scope (`members:admin`). | ||
| * The minted key gets the requested set intersected with your own scopes | ||
| * (downscope-only). Omit for the default `publish` bundle; pass `["team"]` to mint | ||
| * a credential that can create + manage teams (`login --scope team`). | ||
| */ | ||
| scopes?: string[]; | ||
| }): Promise<DropthisResult<ApiKeyCreatedResponse>>; | ||
| /** Revoke an API key. 204 No Content — data is null on success. */ | ||
| delete(keyId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class DeploymentsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(dropId: string, params?: ListDeploymentsParams): Promise<DropthisResult<ListDeploymentsResponse>>; | ||
| get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>; | ||
| } | ||
| declare class DomainsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** | ||
| * Connect a custom domain to the account. Returns the domain in `pending_dns` status with | ||
| * DNS instructions. Idempotent on (account, hostname) — re-connecting an already-connected | ||
| * domain returns the existing row. POST /domains. | ||
| */ | ||
| connect(input: { | ||
| hostname: string; | ||
| mode: "path" | "dedicated"; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** List all custom domains connected to this account. GET /domains. */ | ||
| list(): Promise<DropthisResult<DomainListResponse>>; | ||
| /** Get a domain by its stable id or hostname. GET /domains/{id_or_hostname}. */ | ||
| get(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Trigger a DNS + Cloudflare verification check. Returns the domain with updated status and | ||
| * per-record diagnostics. If DNS is still propagating, `dns[].retryAfter` tells you when to | ||
| * re-call. POST /domains/{id_or_hostname}/verify. | ||
| */ | ||
| verify(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Update a domain's `dropId` (dedicated mode: repoint to a different drop) or `default` | ||
| * flag (path mode only: set/clear the account's default publish domain). Mode is immutable | ||
| * — delete and reconnect to change it. PATCH /domains/{id_or_hostname}. | ||
| */ | ||
| update(idOrHostname: string, input: { | ||
| dropId?: string | null; | ||
| default?: boolean | null; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Delete a custom domain and remove all its routes. The response includes a dangling-CNAME | ||
| * warning — remove the DNS record after deleting so another account cannot re-claim the | ||
| * hostname. DELETE /domains/{id_or_hostname}. | ||
| */ | ||
| delete(idOrHostname: string): Promise<DropthisResult<DomainDeletedResponse>>; | ||
| } | ||
| declare class CursorPage<T> implements ListPage<T> { | ||
| readonly object: "list"; | ||
| readonly data: T[]; | ||
| readonly hasMore: boolean; | ||
| readonly nextCursor: string | null; | ||
| /** Response headers from the fetch that produced this page. */ | ||
| readonly headers: Record<string, string>; | ||
| private readonly fetchNextPage; | ||
| constructor(input: { | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| headers?: Record<string, string>; | ||
| fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined; | ||
| }); | ||
| /** | ||
| * Collect items across every page into a single array. | ||
| * | ||
| * No-throw, consistent with the rest of the SDK's {@link DropthisResult} | ||
| * contract: returns `{ data: items, error: null }` on success, or | ||
| * `{ data: null, error }` if fetching a later page fails — never a thrown | ||
| * exception, and never a silently truncated list. Inspect `.error` | ||
| * (`code`/`statusCode`/`retryable`/`requestId`) exactly as you would for any | ||
| * other call. Pass `limit` to stop once that many items are collected. | ||
| */ | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| } | ||
| /** | ||
| * The drop lifecycle resource. `TInput` is the publish-input type the injected resolver accepts: | ||
| * the full `PublishInput` on the Node client, the fs-free `InMemoryPublishInput` on the edge. The | ||
| * resolver is injected (not statically imported) so this module never pulls in the Node-only | ||
| * publish pipeline and stays Workers-safe. | ||
| */ | ||
| declare class DropsResource<TInput = PublishInput> { | ||
| private readonly transport; | ||
| private readonly resolveInput; | ||
| private readonly defaultWorkspace?; | ||
| constructor(transport: Transport, resolveInput: PublishInputResolver<TInput>, defaultWorkspace?: string | undefined); | ||
| /** | ||
| * Publish content to a NEW permanent public URL; returns the created drop (with its `drop_…` id). | ||
| * Use to publish / share / post / put online / make public a report, dashboard, site, or file. | ||
| * Creates a NEW drop every call — to change something already published, use {@link updateContent} | ||
| * (the files at the URL) or {@link updateSettings} (title, visibility, password, expiry, | ||
| * metadata) with the drop's id; calling publish again makes a duplicate. POST /drops. | ||
| * | ||
| * Mount target: `options.domain` accepts a connected custom hostname, or `SHARED_POOL` | ||
| * (`"shared"`) to publish to the shared pool even when the account has a default domain. | ||
| * | ||
| * Two URLs come back on the response: `url` is the canonical, **always-branded** human | ||
| * view (badge guaranteed, no client detection); `rawUrl` is the drop's exact bytes at | ||
| * their natural path — hand it to other agents. `rawUrl` is populated only for single | ||
| * non-HTML files (`renderMode: "file_viewer"`) and is `null` for HTML drops and | ||
| * collections. To stream bytes through the SDK for any drop kind, use {@link getContent}. | ||
| */ | ||
| publish(input: TInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Replace the content of an EXISTING drop, keeping its URL (ships a new deployment). Requires the | ||
| * `drop_…` id from a publish response (not the slug/URL). Content-only: settings/metadata are | ||
| * stripped BEFORE prepare, so they are never sent — change those with {@link updateSettings}; create | ||
| * a new drop with {@link publish}. Not idempotent (each call is a new deployment) unless you pass the | ||
| * same `idempotencyKey`. POST /drops/{id}/deployments. | ||
| */ | ||
| updateContent(dropId: string, input: TInput, options?: UpdateContentOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * List the account's drops, newest first (paginated). Each item carries its `drop_…` id. | ||
| * Pass `domain` to only list drops mounted on that custom domain — the recovery path | ||
| * when you have a custom-domain URL but no drop id. GET /drops. | ||
| */ | ||
| list(params?: ListDropsParams): Promise<DropthisResult<CursorPage<DropResponse>>>; | ||
| /** Fetch one drop by its `drop_…` id (not the slug/URL). GET /drops/{id}. */ | ||
| get(dropId: string): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Resolve a public locator (a drop URL, a custom-domain URL, or a bare vanity/shared | ||
| * slug) back to the drop — the way to recover a lost `drop_…` id. Sends the raw target | ||
| * to the server (POST /drops/resolve), which owner-scopes and decomposes it. Returns the | ||
| * full drop, or `data: null` when nothing of yours matches. A `drop_…` id passed as the | ||
| * target round-trips to an owner-scoped id lookup (null instead of 404). | ||
| * | ||
| * Persist the drop_… id. URLs, raw_url, and slugs are locators, not identifiers — a vanity | ||
| * slug is renameable and the pool host rotates, so a stored URL can drift; the id never | ||
| * moves. Treat drop_… as an opaque case-sensitive string. | ||
| */ | ||
| resolve(target: string): Promise<DropthisResult<DropResponse | null>>; | ||
| /** | ||
| * Read back what a drop is serving (owner-only; works regardless of any viewer | ||
| * password). By default returns the JSON manifest of the CURRENT deployment's files; | ||
| * pass `deploymentId` to read a historical (even superseded) deployment — downloading | ||
| * an old version's files and republishing them via {@link updateContent} is the | ||
| * rollback path. Pass `path` (one of the manifest's `files[].path` values) to download | ||
| * that file's exact stored bytes instead. GET /drops/{id}/content. | ||
| */ | ||
| getContent(dropId: string, options: GetContentOptions & { | ||
| path: string; | ||
| }): Promise<DropthisResult<DropContentFile>>; | ||
| getContent(dropId: string, options?: Omit<GetContentOptions, "path">): Promise<DropthisResult<DeploymentContentManifest>>; | ||
| /** | ||
| * Change an EXISTING drop's settings — title, visibility, password, noindex, expiry, | ||
| * metadata, domain, or slug — by its `drop_…` id. Does not touch content; replace that | ||
| * with {@link updateContent}. Idempotent. PATCH /drops/{id}. | ||
| * | ||
| * **`domain`** — move the drop to a different custom domain (must be live). Pass `null` to | ||
| * move the drop back to the shared pool (unmount from its current domain). | ||
| * | ||
| * **`slug`** — rename the vanity slug on a path-mode custom domain. Only valid when the drop | ||
| * lives on a path-mode domain. Unlike {@link publish} (which auto-suffixes taken slugs), | ||
| * `updateSettings` returns 409 on a slug conflict and never auto-suffixes — your code must | ||
| * catch 409 and retry with a different slug. Passing `slug` on the shared pool returns 422. | ||
| */ | ||
| updateSettings(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>; | ||
| /** Permanently delete a drop and its public URL by its `drop_…` id. DELETE /drops/{id}. */ | ||
| delete(dropId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class WorkspacesResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| workspaces: Workspace[]; | ||
| }>>; | ||
| /** Create a team workspace (the caller becomes its sole owner). Needs `workspaces:write`. */ | ||
| create(input: { | ||
| name: string; | ||
| /** URL-safe slug; derived from the name when omitted. A clash on an explicit slug → 409. */ | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Rename a team workspace (owner/admin). Needs `workspaces:write`. */ | ||
| rename(workspaceId: string, input: { | ||
| name?: string; | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Delete a team workspace (owner only). Needs `workspaces:admin`. 204 — data is null. */ | ||
| delete(workspaceId: string): Promise<DropthisResult<null>>; | ||
| use(workspace: string): Promise<DropthisResult<Workspace>>; | ||
| active(): Promise<DropthisResult<Workspace | null>>; | ||
| } | ||
| export { type SessionResponse as $, AccountResource as A, type InvitableRole as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type Invitation as F, type GetContentOptions as G, type InvitationListResponse as H, type InMemoryPublishInput as I, type ListDeploymentsParams as J, type KeyType as K, type Limitations as L, type ListDeploymentsResponse as M, type ListPage as N, type Member as O, type MemberListResponse as P, type NextHint as Q, type PrepareOptions as R, type PreparedPublishRequest as S, type PreparedUploadFile as T, type PublishFileInput as U, type PublishInput as V, type PublishOptions as W, type RequestControls as X, type RequestOptions as Y, type RevokeImpact as Z, SHARED_POOL as _, type AccountResponse as a, type TierInfo as a0, Transport as a1, type UpdateContentOptions as a2, type UploadManifestFile as a3, type UploadSessionFileResponse as a4, type UploadSessionResponse as a5, type UploadTarget as a6, type Workspace as a7, type WorkspaceRole as a8, WorkspacesResource as a9, type AccountUsage as b, type AccountWorkspace as c, type ActionResolve as d, ApiKeysResource as e, type CreateUploadSessionResponse as f, CursorPage as g, type DeploymentContentManifest as h, DeploymentsResource as i, type DnsRecord as j, type DomainDeletedResponse as k, type DomainListResponse as l, type DomainResponse as m, DomainsResource as n, type DropAction as o, type DropContentFile as p, type DropDeploymentResponse as q, type DropOptions as r, type DropResponse as s, type DropWorkspace as t, DropsResource as u, type DropthisClientOptions as v, type DropthisErrorResponse as w, type DropthisResult as x, type EntitlementLimits as y, type Entitlements as z }; |
| type DropthisClientOptions = { | ||
| apiKey?: string; | ||
| baseUrl?: string; | ||
| timeoutMs?: number; | ||
| uploadTimeoutMs?: number; | ||
| fetch?: typeof globalThis.fetch; | ||
| /** | ||
| * Default workspace slug or id applied to every publish/prepare call that | ||
| * does not supply its own `options.workspace`. Delegated credentials only; | ||
| * ignored by pinned service keys. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type RequestOptions = { | ||
| authenticated?: boolean; | ||
| idempotencyKey?: string; | ||
| ifRevision?: number; | ||
| timeoutMs?: number; | ||
| }; | ||
| type DropthisErrorResponse = { | ||
| code: string; | ||
| message: string; | ||
| statusCode: number | null; | ||
| type?: string; | ||
| title?: string; | ||
| detail?: string | null; | ||
| instance?: string | null; | ||
| param?: string | null; | ||
| currentRevision?: number; | ||
| requestId?: string | null; | ||
| suggestion?: string | null; | ||
| retryable?: boolean | null; | ||
| /** The gated capability (on `feature_not_in_plan`), e.g. `password_protect`. */ | ||
| feature?: string | null; | ||
| /** The caller's current plan (on `feature_not_in_plan` / `quota_exceeded`). */ | ||
| currentPlan?: string | null; | ||
| /** The lowest plan that unlocks the feature (on `feature_not_in_plan`). */ | ||
| requiredPlan?: string | null; | ||
| /** The pricing/upgrade URL to hand a human (on a plan gate). */ | ||
| upgradeUrl?: string | null; | ||
| /** Numeric ceiling that was hit (on `quota_exceeded`). */ | ||
| limit?: number | null; | ||
| /** Amount already used toward the ceiling (on `quota_exceeded`). */ | ||
| used?: number | null; | ||
| /** Amount the request asked for (on `quota_exceeded`). */ | ||
| requested?: number | null; | ||
| body?: unknown; | ||
| }; | ||
| type DropthisResult<T> = { | ||
| data: T; | ||
| error: null; | ||
| headers: Record<string, string>; | ||
| } | { | ||
| data: null; | ||
| error: DropthisErrorResponse; | ||
| headers: Record<string, string>; | ||
| }; | ||
| type ActionResolve = { | ||
| method: string; | ||
| url?: string | null; | ||
| endpoint?: string | null; | ||
| }; | ||
| type DropAction = { | ||
| code: string; | ||
| kind: "api" | "human"; | ||
| priority: "required" | "suggested"; | ||
| message: string; | ||
| resolve?: ActionResolve | null; | ||
| }; | ||
| type TierInfo = { | ||
| name: string; | ||
| maxSizeBytes: number; | ||
| ttlDays: number | null; | ||
| persistent: boolean; | ||
| badge: boolean; | ||
| }; | ||
| type Limitations = { | ||
| actions: DropAction[]; | ||
| }; | ||
| /** | ||
| * Workspace context echoed on every drop response. Identifies which workspace | ||
| * the drop was published into (ADR 0066). | ||
| */ | ||
| type DropWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| }; | ||
| type DropResponse = { | ||
| id: string; | ||
| slug: string; | ||
| url: string; | ||
| deploymentId: string | null; | ||
| title: string; | ||
| contentType: string; | ||
| visibility: string; | ||
| status: string; | ||
| revision: number; | ||
| contentRevision: number; | ||
| accessRevision: number; | ||
| sizeBytes: number; | ||
| renderMode: string; | ||
| warnings: Array<Record<string, unknown>>; | ||
| createdAt: string; | ||
| expiresAt: string | null; | ||
| noindex: boolean; | ||
| passwordProtected: boolean; | ||
| metadata: Record<string, unknown>; | ||
| /** When the drop was last updated (content or settings), ISO 8601. */ | ||
| updatedAt: string; | ||
| /** Origin that created the drop (e.g. "api", "cli", "mcp"); null/omitted when unattributed. */ | ||
| source?: string | null; | ||
| object: string; | ||
| accessible: boolean; | ||
| persistent: boolean; | ||
| badgeApplied: boolean; | ||
| tier: TierInfo; | ||
| limitations: Limitations; | ||
| /** Hostname of the custom domain this drop is mounted on; null for shared-pool drops. */ | ||
| domain: string | null; | ||
| /** | ||
| * Direct URL to the drop's raw bytes — the agent byte-fetch path. The canonical | ||
| * `url` always serves a branded human view (so the badge is guaranteed); `rawUrl` | ||
| * serves the underlying file's exact bytes at its natural path under the mount | ||
| * (ADR 0061). Populated only for single-file (`renderMode: "file_viewer"`) drops | ||
| * (= canonical URL + the entry filename); `null` for `user_html` drops (the page | ||
| * IS the artifact) and collections (per-file natural paths come from the manifest — | ||
| * see {@link DeploymentContentManifest}). Hand `url` to humans and `rawUrl` to agents. | ||
| * To stream bytes through the SDK regardless of drop kind, use `drops.getContent()`. | ||
| */ | ||
| rawUrl: string | null; | ||
| /** The workspace this drop belongs to (echoed from the server on every response). */ | ||
| workspace: DropWorkspace; | ||
| }; | ||
| type DropDeploymentResponse = { | ||
| id: string; | ||
| dropId: string; | ||
| revision: number; | ||
| status: string; | ||
| entry: string | null; | ||
| contentType: string; | ||
| renderMode: string; | ||
| files: Array<Record<string, unknown>>; | ||
| warnings: Array<Record<string, unknown>>; | ||
| sizeBytes: number; | ||
| classificationVersion: number; | ||
| classificationReason: string; | ||
| errorCode: string | null; | ||
| errorMessage: string | null; | ||
| createdAt: string; | ||
| readyAt: string | null; | ||
| publishedAt: string | null; | ||
| }; | ||
| type ListDeploymentsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| }; | ||
| type ListDeploymentsResponse = { | ||
| deployments: DropDeploymentResponse[]; | ||
| nextCursor: string | null; | ||
| }; | ||
| type ListPage<T> = { | ||
| object: "list"; | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| }; | ||
| type Action = { | ||
| code: string; | ||
| kind: string; | ||
| method?: string | null; | ||
| endpoint?: string | null; | ||
| message: string; | ||
| }; | ||
| type EmailOtpResponse = { | ||
| /** Always `true` on success; optional because the server defaults it. */ | ||
| ok?: true; | ||
| expiresIn: number; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type SessionResponse = { | ||
| object: "session"; | ||
| token: string; | ||
| accountId: string; | ||
| isNewAccount: boolean; | ||
| expiresIn: number; | ||
| /** | ||
| * Rotating refresh token for a console browser session. Present when a session is | ||
| * started (email/verify, refresh); `null`/omitted for non-session token issuance. | ||
| */ | ||
| refreshToken?: string | null; | ||
| }; | ||
| /** | ||
| * Why an API key exists. `delegated` keys act on behalf of the owning account (scoped | ||
| * to the active workspace or an allowed set); `service` keys are pinned to a single | ||
| * workspace and are intended for CI/automation. | ||
| */ | ||
| type KeyType = "delegated" | "service"; | ||
| /** What breaks when a key is revoked. */ | ||
| type RevokeImpact = "disconnects_app" | "breaks_automation"; | ||
| type ApiKeyResponse = { | ||
| object: "api_key"; | ||
| id: string; | ||
| keyLast4: string; | ||
| label: string; | ||
| /** Human-facing credential name: the user's label for `standard` keys, the connected client name for `mcp_oauth` keys. */ | ||
| appName: string; | ||
| /** Why the key exists (drives quota accounting). */ | ||
| keyType: KeyType; | ||
| /** Scopes granted to this key. */ | ||
| scopes: string[]; | ||
| /** When the key was last used to authenticate, ISO 8601; null/omitted if never used. */ | ||
| lastUsedAt?: string | null; | ||
| /** What breaks if this key is revoked. */ | ||
| revokeImpact: RevokeImpact; | ||
| createdAt: string; | ||
| }; | ||
| type ApiKeyCreatedResponse = ApiKeyResponse & { | ||
| key: string; | ||
| accountId?: string | null; | ||
| isNewAccount?: boolean; | ||
| }; | ||
| /** Numeric limits for the active plan — use these to size a publish before uploading. */ | ||
| type EntitlementLimits = { | ||
| /** Maximum size of a single drop in bytes. */ | ||
| maxSizeBytes: number; | ||
| /** Total account storage cap in bytes; null means no account-level cap. */ | ||
| maxStorageBytes: number | null; | ||
| /** Drop lifetime in seconds before expiry; null means drops are permanent. */ | ||
| defaultTtlSeconds: number | null; | ||
| /** Maximum number of custom hostnames the workspace may connect. */ | ||
| maxCustomHostnames: number; | ||
| /** Maximum members the workspace may hold (owner included). */ | ||
| seatLimit: number; | ||
| /** Maximum concurrent in-flight upload sessions (a transient concurrency cap). */ | ||
| maxActiveUploadSessions: number; | ||
| }; | ||
| /** | ||
| * The full capability matrix for the active plan — the single read to pre-check a | ||
| * feature gate before attempting an operation. | ||
| */ | ||
| type Entitlements = { | ||
| /** | ||
| * Per-capability state for the active plan. Boolean caps are `true`/`false`; | ||
| * enum caps (`ogPreview`, `analytics`) carry a value — compare by value, never | ||
| * truthiness (`"none"` is truthy). | ||
| */ | ||
| capabilities: Record<string, boolean | string>; | ||
| /** | ||
| * The lowest plan that unlocks each gated capability — drives the upgrade nudge. | ||
| * Enum sub-values are keyed `ogPreview.customImage` / `analytics.full`. | ||
| */ | ||
| requiredPlan: Record<string, string>; | ||
| /** Numeric limits for the active plan. */ | ||
| limits: EntitlementLimits; | ||
| }; | ||
| /** Current resource usage for the account's active workspace. */ | ||
| type AccountUsage = { | ||
| /** Total bytes consumed across all active drops. */ | ||
| storageUsedBytes: number; | ||
| /** Number of custom domain hostnames currently in use. */ | ||
| customDomainsUsed: number; | ||
| /** Members currently in the workspace (owner included). */ | ||
| seatsUsed: number; | ||
| }; | ||
| /** The workspace a principal acts within (ADR 0066). For an sk_ API key, the workspace the key is bound to. */ | ||
| type AccountWorkspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` when shared with other members. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| }; | ||
| /** | ||
| * A workspace the caller belongs to or has delegated access to. | ||
| * Returned by `GET /v1/workspaces` and `PUT /v1/account/active-workspace`. | ||
| */ | ||
| type Workspace = { | ||
| id: string; | ||
| name: string; | ||
| slug: string; | ||
| /** `personal` for a solo workspace, `team` for a shared team workspace. */ | ||
| kind: string; | ||
| /** The calling account's role in this workspace: `owner`, `admin`, or `member`. */ | ||
| role: string; | ||
| /** The plan tier of this workspace. */ | ||
| plan: string; | ||
| /** Whether this workspace is currently the caller's active workspace. */ | ||
| isActive: boolean; | ||
| /** | ||
| * On CREATE only (null otherwise): whether the credential that created this workspace can act | ||
| * in it. `false` means an allowlist-restricted key created a workspace outside its allowlist — | ||
| * it will be denied on the next write; re-authenticate to obtain a credential that reaches it. | ||
| */ | ||
| creatorCanReach?: boolean | null; | ||
| }; | ||
| /** A role grantable via invite or a member role-change (owner is transferred, never granted). */ | ||
| type WorkspaceRole = "owner" | "admin" | "member"; | ||
| type InvitableRole = "admin" | "member"; | ||
| /** A member of a team workspace. */ | ||
| type Member = { | ||
| accountId: string; | ||
| /** The member's email, or null if their account was deleted. */ | ||
| email: string | null; | ||
| role: WorkspaceRole; | ||
| /** Whether this row is the calling account. */ | ||
| isYou: boolean; | ||
| joinedAt: string; | ||
| }; | ||
| type MemberListResponse = { | ||
| members: Member[]; | ||
| }; | ||
| /** An invitation to join a team workspace. */ | ||
| type Invitation = { | ||
| id: string; | ||
| workspaceId: string; | ||
| email: string; | ||
| role: WorkspaceRole; | ||
| /** `pending`, `accepted`, or `revoked`. */ | ||
| status: string; | ||
| expiresAt: string; | ||
| createdAt: string; | ||
| acceptedAt?: string | null; | ||
| }; | ||
| type InvitationListResponse = { | ||
| invitations: Invitation[]; | ||
| }; | ||
| type AccountResponse = { | ||
| id: string; | ||
| email: string; | ||
| displayName: string | null; | ||
| plan: string; | ||
| status: string; | ||
| createdAt: string; | ||
| /** The full capability matrix + numeric limits for the active plan. */ | ||
| entitlements: Entitlements; | ||
| usage: AccountUsage; | ||
| workspace: AccountWorkspace; | ||
| /** URL to upgrade; present on every plan below Business, null on the top tier. */ | ||
| upgradeUrl: string | null; | ||
| }; | ||
| type ListDropsParams = { | ||
| cursor?: string | null; | ||
| limit?: number; | ||
| /** Only drops mounted on this custom domain hostname (e.g. "reports.example.com"). */ | ||
| domain?: string; | ||
| }; | ||
| /** | ||
| * One file in an upload manifest. A discriminated union: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes through a signed PUT. Requires | ||
| * `contentType` and `sizeBytes`; an optional `checksumSha256` locks the | ||
| * transfer integrity. | ||
| * - **remote** — the server fetches the bytes itself from `sourceUrl` during | ||
| * `POST /uploads/{id}/ingest`. No bytes leave this process, so `sizeBytes`, | ||
| * `contentType`, and `checksumSha256` are all optional (the server infers | ||
| * them on fetch). Carries NO signed PUT target. | ||
| * | ||
| * `sourceUrl` is the discriminant: present ⇒ remote, absent ⇒ client-put. The | ||
| * camelCase `sourceUrl` becomes the wire field `source_url` via the transport's | ||
| * snake_case conversion (exactly like `contentType` → `content_type`). | ||
| */ | ||
| type UploadManifestFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string | null; | ||
| sourceUrl?: never; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| sizeBytes?: number; | ||
| checksumSha256?: string | null; | ||
| }; | ||
| type CreateUploadSessionRequest = { | ||
| schemaVersion?: 1; | ||
| files: UploadManifestFile[]; | ||
| entry?: string | null; | ||
| /** | ||
| * Target workspace slug or id for this upload session. Delegated credentials only; | ||
| * ignored by pinned service keys. Bound at session creation and inherited by the | ||
| * subsequent POST /drops call. | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| type UploadTarget = { | ||
| /** Always `single_put` — one signed PUT per file is the upload contract. */ | ||
| strategy: "single_put"; | ||
| url: string; | ||
| headers: Record<string, string>; | ||
| expiresAt: string; | ||
| }; | ||
| type CreateUploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| objectKey: string; | ||
| upload: UploadTarget; | ||
| }; | ||
| type UploadSessionFileResponse = { | ||
| fileId: string; | ||
| path: string; | ||
| /** Declared MIME type; `null`/omitted for remote-fetch files until ingested. */ | ||
| contentType?: string | null; | ||
| /** Declared byte size; `null`/omitted for remote-fetch files until ingested. */ | ||
| sizeBytes?: number | null; | ||
| objectKey: string; | ||
| /** How the file enters staging: "client_put" (client PUTs bytes) or "remote_fetch" (server fetches sourceUrl). */ | ||
| origin: "client_put" | "remote_fetch"; | ||
| /** Ingest lifecycle state for remote-fetch files (e.g. "pending" | "fetching" | "fetched" | "failed"). */ | ||
| state: string; | ||
| /** Public http(s) URL the server fetches into staging; `null`/omitted for client-put files. */ | ||
| sourceUrl?: string | null; | ||
| verified: boolean; | ||
| }; | ||
| type UploadSessionResponse = { | ||
| uploadId: string; | ||
| status: string; | ||
| expiresAt: string; | ||
| entry?: string | null; | ||
| files: UploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| type CreateUploadSessionResponse = { | ||
| uploadId: string; | ||
| expiresAt: string; | ||
| files: CreateUploadSessionFileResponse[]; | ||
| nextAction?: Action | null; | ||
| }; | ||
| /** | ||
| * Sentinel for `DropOptions.domain`: publish to the shared pool even when the | ||
| * account has a default custom domain (dropthis#55). Collision-free — the | ||
| * literal "shared" can never be a real hostname (single-label names are | ||
| * rejected at domain connect). These drops read back `domain: null`. | ||
| */ | ||
| declare const SHARED_POOL = "shared"; | ||
| type DropOptions = { | ||
| /** Drop title. */ | ||
| title?: string; | ||
| /** public (default) or unlisted. */ | ||
| visibility?: "public" | "unlisted"; | ||
| /** Require password to view. Pass `null` to remove password protection. */ | ||
| password?: string | null; | ||
| /** Prevent search-engine indexing. Pass `null` to allow indexing (default). */ | ||
| noindex?: boolean | null; | ||
| /** Auto-delete after this ISO 8601 date. Pass `null` to clear. */ | ||
| expiresAt?: string | Date | null; | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** Attach JSON key-value pairs, e.g. `{ source: "ci" }`. */ | ||
| metadata?: Record<string, unknown>; | ||
| /** | ||
| * Hostname of a custom domain connected to this account (must be live — see | ||
| * `client.domains`), or {@link SHARED_POOL} (`"shared"`) to publish to the shared | ||
| * pool even when the account has a default domain. Path-mode domains serve the drop | ||
| * at `https://{domain}/{slug}/`; dedicated domains serve it at the root and conflict | ||
| * (409) once occupied. Omit to use the account's default path domain if one exists, | ||
| * else the shared pool. | ||
| */ | ||
| domain?: string | null; | ||
| /** | ||
| * Vanity slug — only valid when the target is a path-mode custom domain. 1–63 | ||
| * lowercase letters/digits/hyphens (no leading/trailing/double hyphen). Taken slugs | ||
| * are auto-suffixed; omit for a random slug. Setting this on the shared pool returns | ||
| * 422. | ||
| */ | ||
| slug?: string | null; | ||
| }; | ||
| type PrepareOptions = { | ||
| /** Glob patterns to ignore when publishing directories. */ | ||
| ignore?: string[]; | ||
| /** Disable default ignore patterns. */ | ||
| ignoreDefaults?: boolean; | ||
| /** Override MIME type (auto-detected from extension). */ | ||
| contentType?: string; | ||
| /** Set filename when publishing from stdin or bytes. */ | ||
| path?: string; | ||
| }; | ||
| type RequestControls = { | ||
| /** Prevent duplicate publishes on retry (auto-generated by CLI). */ | ||
| idempotencyKey?: string; | ||
| /** Fail if current revision doesn't match -- optimistic lock (update only). */ | ||
| ifRevision?: number; | ||
| }; | ||
| type PublishOptions = DropOptions & PrepareOptions & RequestControls & { | ||
| /** | ||
| * Target workspace slug or id — publish/prepare only (a fresh drop's workspace). | ||
| * Delegated credentials only; ignored by pinned service keys. Falls back to the | ||
| * client-level `workspace` default when omitted. Not a settings field: it is NOT | ||
| * accepted by `updateSettings` (a drop never moves workspace) nor by `updateContent` | ||
| * (which stays in the drop's own workspace). | ||
| */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * Options for `drops.updateContent()` — content-only. A content update ships a new content version | ||
| * and never changes drop settings (title, visibility, password, noindex, expiry, metadata); those | ||
| * belong on `drops.updateSettings()`. Carries only content-prep + request controls + the bundle | ||
| * `entry`. | ||
| */ | ||
| type UpdateContentOptions = PrepareOptions & RequestControls & { | ||
| /** Entry file for multi-file bundles (default: index.html). */ | ||
| entry?: string; | ||
| /** | ||
| * How the supplied files combine with what the drop already serves | ||
| * (partial-by-default, ADR 0065): | ||
| * | ||
| * - `"patch"` (default): the supplied files upsert by path and every | ||
| * unmentioned file is carried forward, so editing one file never drops the | ||
| * rest. Use `deletePaths` to remove files. | ||
| * - `"replace"`: the supplied files become the drop's entire content set — | ||
| * a full swap. Anything not supplied is gone. `deletePaths` is invalid here. | ||
| * | ||
| * Omit to default to `"patch"`. | ||
| */ | ||
| mode?: "patch" | "replace"; | ||
| /** | ||
| * Paths to remove from the drop's content (patch-mode only). Each path must | ||
| * exist or the server rejects the update (loud, never a silent no-op). Invalid | ||
| * with `mode: "replace"`. Wire field: `delete_paths`. | ||
| */ | ||
| deletePaths?: string[]; | ||
| }; | ||
| /** | ||
| * One file in a multi-file `{ kind: "files" }` bundle. Supply the bytes inline | ||
| * exactly one way — `content` (UTF-8 text), `contentBase64`, or `bytes` — OR set | ||
| * `sourceUrl` to a public http(s) URL and let the server fetch that file for you | ||
| * server-side (no bytes pass through your process). A single entry may NOT carry | ||
| * both inline bytes and `sourceUrl`. Mix freely within one bundle: e.g. inline | ||
| * `content` for `index.html` plus a `sourceUrl` for each image referenced by it, | ||
| * yielding one self-contained drop. | ||
| */ | ||
| type PublishFileInput = { | ||
| path: string; | ||
| contentType?: string; | ||
| content?: string; | ||
| contentBase64?: string; | ||
| bytes?: Uint8Array; | ||
| /** | ||
| * Public http(s) URL the server fetches this file's bytes from during publish | ||
| * (publish by reference). Mutually exclusive with `content`/`contentBase64`/`bytes`. | ||
| */ | ||
| sourceUrl?: string; | ||
| /** | ||
| * Declared byte size of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server uses this for upfront quota admission before fetching, | ||
| * so a large file is rejected immediately rather than after the server downloads it. | ||
| * Ignored for inline files (size is computed from the bytes). | ||
| */ | ||
| sizeBytes?: number; | ||
| /** | ||
| * Expected SHA-256 hex digest of the remote file (optional hint for `sourceUrl` files). | ||
| * When provided, the server verifies the fetched content matches this checksum and | ||
| * rejects the publish if it does not, giving you integrity verification without | ||
| * downloading the bytes yourself. | ||
| * Ignored for inline files (checksum is computed by the SDK/server from actual bytes). | ||
| */ | ||
| checksumSha256?: string; | ||
| }; | ||
| type PublishInput = string | string[] | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| /** Structured next-step hint returned by domain operations (and publish). */ | ||
| type NextHint = { | ||
| action: string; | ||
| message: string; | ||
| }; | ||
| /** One DNS record instruction or diagnostic for a custom domain. */ | ||
| type DnsRecord = { | ||
| /** Purpose of the record, e.g. "routing". */ | ||
| purpose: string; | ||
| /** DNS record type, e.g. "CNAME". */ | ||
| type: string; | ||
| /** The DNS name to create the record for. */ | ||
| name: string; | ||
| /** The value the record must point at. */ | ||
| value: string; | ||
| /** Current DNS status: "missing" | "ok" | "mismatch". */ | ||
| status: "missing" | "ok" | "mismatch"; | ||
| /** What DoH currently resolves for this record (verify only). */ | ||
| observed?: string | null; | ||
| /** Specific guidance for fixing this record. */ | ||
| hint?: string | null; | ||
| /** Seconds to wait before retrying verify while DNS/cert propagates. */ | ||
| retryAfter?: number | null; | ||
| }; | ||
| /** Full domain resource representation. */ | ||
| type DomainResponse = { | ||
| object: "domain"; | ||
| /** Stable domain identifier. */ | ||
| id: string; | ||
| /** Canonical hostname registered with dropthis. */ | ||
| hostname: string; | ||
| /** Mount mode: "path" (many drops at hostname/{slug}/) or "dedicated" (one drop at hostname/). */ | ||
| mode: "path" | "dedicated"; | ||
| /** Lifecycle status: "pending_dns" | "verifying" | "live" | "failed". */ | ||
| status: "pending_dns" | "verifying" | "live" | "failed"; | ||
| /** Reason for failure status. */ | ||
| failureReason?: string | null; | ||
| /** Whether this is the account's default publish domain. */ | ||
| default: boolean; | ||
| /** Mounted drop id (dedicated mode only). */ | ||
| dropId?: string | null; | ||
| /** DNS records required for this domain. */ | ||
| dns: DnsRecord[]; | ||
| /** Creation timestamp. */ | ||
| createdAt: string; | ||
| /** When the domain first reached "live" status. */ | ||
| verifiedAt?: string | null; | ||
| /** Structured next-step hints for the agent. */ | ||
| next: NextHint[]; | ||
| /** | ||
| * Deep link to this domain's setup page in the dropthis console | ||
| * (e.g. https://app.dropthis.app/domains/dom_…). Hand this to a human so | ||
| * they can add the DNS record and watch it go live in a polished UI. | ||
| */ | ||
| consoleUrl: string; | ||
| }; | ||
| /** List of domains for the account. */ | ||
| type DomainListResponse = { | ||
| object: "domain.list"; | ||
| /** Domains connected to this account. */ | ||
| domains: DomainResponse[]; | ||
| }; | ||
| /** Response body for a successful domain deletion. */ | ||
| type DomainDeletedResponse = { | ||
| object: "domain.deleted"; | ||
| /** Id of the deleted domain. */ | ||
| id: string; | ||
| /** Hostname of the deleted domain. */ | ||
| hostname: string; | ||
| /** Dangling-CNAME risk warning (always present; instructs you to remove the DNS record). */ | ||
| warning: string; | ||
| }; | ||
| /** One readable file in a deployment's content manifest. */ | ||
| type DeploymentContentFile = { | ||
| /** File path within the deployment, relative to its root. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with. */ | ||
| contentType: string; | ||
| /** Stored file size in bytes. */ | ||
| sizeBytes: number; | ||
| }; | ||
| /** | ||
| * Manifest of one deployment's readable files (content read-back). | ||
| * Fetch a single file's bytes with `drops.getContent(dropId, { path })`. | ||
| */ | ||
| type DeploymentContentManifest = { | ||
| /** Parent drop identifier. */ | ||
| dropId: string; | ||
| /** Deployment identifier. */ | ||
| deploymentId: string; | ||
| /** Content revision of this deployment. */ | ||
| revision: number; | ||
| /** Deployment lifecycle status. */ | ||
| status: string; | ||
| /** Total deployment size in bytes. */ | ||
| sizeBytes: number; | ||
| /** Entry path served at the drop root. */ | ||
| entry?: string | null; | ||
| /** Readable files in this deployment; pass files[].path as `path` to download one. */ | ||
| files: DeploymentContentFile[]; | ||
| }; | ||
| /** Options for `drops.getContent()`. */ | ||
| type GetContentOptions = { | ||
| /** Read a historical deployment instead of the current one. */ | ||
| deploymentId?: string; | ||
| /** Download this single file's raw stored bytes instead of the JSON manifest. */ | ||
| path?: string; | ||
| }; | ||
| /** A single file downloaded via `drops.getContent(dropId, { path })`. */ | ||
| type DropContentFile = { | ||
| /** The requested file path. */ | ||
| path: string; | ||
| /** Stored MIME type the file is served with (from the response Content-Type). */ | ||
| contentType: string | null; | ||
| /** Exact stored bytes. */ | ||
| bytes: Uint8Array; | ||
| /** Decode the bytes as UTF-8 text. */ | ||
| text(): string; | ||
| }; | ||
| declare class Transport { | ||
| readonly apiKey: string | undefined; | ||
| readonly baseUrl: string; | ||
| readonly timeoutMs: number; | ||
| readonly uploadTimeoutMs: number; | ||
| readonly fetchImpl: typeof globalThis.fetch; | ||
| constructor(options?: DropthisClientOptions | string); | ||
| putSignedUrl(url: string, body: Uint8Array | Blob | ReadableStream, headers: Record<string, string>): Promise<DropthisResult<{ | ||
| etag: string | null; | ||
| }>>; | ||
| /** | ||
| * Authenticated GET that returns the raw response bytes untouched (no JSON parsing, | ||
| * no case conversion). Error responses are still parsed as problem+json. Used for | ||
| * content read-back (`drops.getContent` with a file path). | ||
| */ | ||
| requestBytes(path: string, options?: RequestOptions & { | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<{ | ||
| bytes: Uint8Array; | ||
| contentType: string | null; | ||
| }>>; | ||
| request<T>(method: string, path: string, options?: RequestOptions & { | ||
| body?: unknown; | ||
| bodyCase?: "snake" | "raw"; | ||
| params?: Record<string, string | number | boolean | null | undefined>; | ||
| }): Promise<DropthisResult<T>>; | ||
| } | ||
| /** | ||
| * A file ready to be staged for upload. Two shapes: | ||
| * | ||
| * - **client-put** — the SDK pushes the bytes. The body is lazy: the orchestrator | ||
| * calls `getBody()` per file when it is ready to push bytes to the signed URL. | ||
| * This keeps the resolution layer pure and lets the filesystem layer (node.ts) | ||
| * defer reads/streams until upload time. | ||
| * - **remote** (`sourceUrl` set, no `getBody`) — the server fetches the bytes from | ||
| * `sourceUrl` during `POST /uploads/{id}/ingest`. No bytes leave this process, so | ||
| * it has no `getBody`, no `sizeBytes`, and consumes no signed PUT target. | ||
| */ | ||
| type PreparedUploadFile = { | ||
| path: string; | ||
| contentType: string; | ||
| sizeBytes: number; | ||
| checksumSha256?: string; | ||
| sourceUrl?: never; | ||
| getBody(): Promise<Uint8Array | Blob | ReadableStream>; | ||
| } | { | ||
| path: string; | ||
| sourceUrl: string; | ||
| contentType?: string; | ||
| /** Optional hint: declared byte size for upfront quota admission (server-side). */ | ||
| sizeBytes?: number; | ||
| /** Optional hint: expected SHA-256 hex digest for server-side integrity check. */ | ||
| checksumSha256?: string; | ||
| getBody?: never; | ||
| }; | ||
| /** | ||
| * Resolves a publish input into a {@link PreparedPublishRequest}. Two implementations exist: | ||
| * the fs-free {@link resolveInMemory} (Workers-safe) and the fs-capable `resolveInput` in | ||
| * `publish/node.ts`. `DropsResource` takes one by injection so it can power both the Node client | ||
| * and the edge client WITHOUT statically importing the Node-only pipeline (which would poison the | ||
| * Workers bundle with `node:fs`/`fast-glob`). `TInput` is the input type the chosen resolver | ||
| * accepts ({@link InMemoryPublishInput} on the edge, the full `PublishInput` on Node). | ||
| */ | ||
| type PublishInputResolver<TInput> = (input: TInput, options: PublishOptions) => Promise<PreparedPublishRequest>; | ||
| type PreparedPublishRequest = { | ||
| kind: "staged"; | ||
| manifest: CreateUploadSessionRequest; | ||
| files: PreparedUploadFile[]; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Bound at upload-session creation. */ | ||
| workspace?: string; | ||
| } | { | ||
| kind: "source"; | ||
| sourceUrl: string; | ||
| options: Record<string, unknown>; | ||
| metadata?: Record<string, unknown>; | ||
| /** Target workspace slug or id (delegated credentials only). Forwarded as top-level field in POST /drops. */ | ||
| workspace?: string; | ||
| }; | ||
| /** | ||
| * The canonical publish inputs that can be resolved with no filesystem access: | ||
| * the {@link PublishInput} union minus `string[]` (which is inherently a list | ||
| * of filesystem paths handled by node.ts). | ||
| */ | ||
| type InMemoryPublishInput = string | URL | Uint8Array | { | ||
| kind: "content"; | ||
| content: string; | ||
| contentType?: string; | ||
| path?: string; | ||
| } | { | ||
| kind: "source_url"; | ||
| sourceUrl: string; | ||
| } | { | ||
| kind: "files"; | ||
| files: PublishFileInput[]; | ||
| entry?: string; | ||
| }; | ||
| declare class AccountResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| get(): Promise<DropthisResult<AccountResponse>>; | ||
| update(input: { | ||
| displayName: string | null; | ||
| }): Promise<DropthisResult<AccountResponse>>; | ||
| delete(): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class ApiKeysResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| object: "list"; | ||
| data: ApiKeyResponse[]; | ||
| }>>; | ||
| create(input: { | ||
| label: string; | ||
| /** Key type: `"delegated"` (default on server) or `"service"` (pinned to a workspace). */ | ||
| type?: KeyType; | ||
| /** Pin a `service` key to this workspace slug or id. */ | ||
| workspace?: string; | ||
| /** Restrict a `delegated` key to these workspace slugs or ids. */ | ||
| allowedWorkspaces?: string[]; | ||
| /** | ||
| * Request the credential's capability scopes (ADR 0068). Each entry is a bundle | ||
| * name (`publish`, `team`, `team-admin`) or a fine-grained scope (`members:admin`). | ||
| * The minted key gets the requested set intersected with your own scopes | ||
| * (downscope-only). Omit for the default `publish` bundle; pass `["team"]` to mint | ||
| * a credential that can create + manage teams (`login --scope team`). | ||
| */ | ||
| scopes?: string[]; | ||
| }): Promise<DropthisResult<ApiKeyCreatedResponse>>; | ||
| /** Revoke an API key. 204 No Content — data is null on success. */ | ||
| delete(keyId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class DeploymentsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(dropId: string, params?: ListDeploymentsParams): Promise<DropthisResult<ListDeploymentsResponse>>; | ||
| get(dropId: string, deploymentId: string): Promise<DropthisResult<DropDeploymentResponse>>; | ||
| } | ||
| declare class DomainsResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| /** | ||
| * Connect a custom domain to the account. Returns the domain in `pending_dns` status with | ||
| * DNS instructions. Idempotent on (account, hostname) — re-connecting an already-connected | ||
| * domain returns the existing row. POST /domains. | ||
| */ | ||
| connect(input: { | ||
| hostname: string; | ||
| mode: "path" | "dedicated"; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** List all custom domains connected to this account. GET /domains. */ | ||
| list(): Promise<DropthisResult<DomainListResponse>>; | ||
| /** Get a domain by its stable id or hostname. GET /domains/{id_or_hostname}. */ | ||
| get(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Trigger a DNS + Cloudflare verification check. Returns the domain with updated status and | ||
| * per-record diagnostics. If DNS is still propagating, `dns[].retryAfter` tells you when to | ||
| * re-call. POST /domains/{id_or_hostname}/verify. | ||
| */ | ||
| verify(idOrHostname: string): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Update a domain's `dropId` (dedicated mode: repoint to a different drop) or `default` | ||
| * flag (path mode only: set/clear the account's default publish domain). Mode is immutable | ||
| * — delete and reconnect to change it. PATCH /domains/{id_or_hostname}. | ||
| */ | ||
| update(idOrHostname: string, input: { | ||
| dropId?: string | null; | ||
| default?: boolean | null; | ||
| }): Promise<DropthisResult<DomainResponse>>; | ||
| /** | ||
| * Delete a custom domain and remove all its routes. The response includes a dangling-CNAME | ||
| * warning — remove the DNS record after deleting so another account cannot re-claim the | ||
| * hostname. DELETE /domains/{id_or_hostname}. | ||
| */ | ||
| delete(idOrHostname: string): Promise<DropthisResult<DomainDeletedResponse>>; | ||
| } | ||
| declare class CursorPage<T> implements ListPage<T> { | ||
| readonly object: "list"; | ||
| readonly data: T[]; | ||
| readonly hasMore: boolean; | ||
| readonly nextCursor: string | null; | ||
| /** Response headers from the fetch that produced this page. */ | ||
| readonly headers: Record<string, string>; | ||
| private readonly fetchNextPage; | ||
| constructor(input: { | ||
| data: T[]; | ||
| hasMore: boolean; | ||
| nextCursor: string | null; | ||
| headers?: Record<string, string>; | ||
| fetchNextPage?: (() => Promise<DropthisResult<CursorPage<T>>>) | undefined; | ||
| }); | ||
| /** | ||
| * Collect items across every page into a single array. | ||
| * | ||
| * No-throw, consistent with the rest of the SDK's {@link DropthisResult} | ||
| * contract: returns `{ data: items, error: null }` on success, or | ||
| * `{ data: null, error }` if fetching a later page fails — never a thrown | ||
| * exception, and never a silently truncated list. Inspect `.error` | ||
| * (`code`/`statusCode`/`retryable`/`requestId`) exactly as you would for any | ||
| * other call. Pass `limit` to stop once that many items are collected. | ||
| */ | ||
| autoPagingToArray(options?: { | ||
| limit?: number; | ||
| }): Promise<DropthisResult<T[]>>; | ||
| } | ||
| /** | ||
| * The drop lifecycle resource. `TInput` is the publish-input type the injected resolver accepts: | ||
| * the full `PublishInput` on the Node client, the fs-free `InMemoryPublishInput` on the edge. The | ||
| * resolver is injected (not statically imported) so this module never pulls in the Node-only | ||
| * publish pipeline and stays Workers-safe. | ||
| */ | ||
| declare class DropsResource<TInput = PublishInput> { | ||
| private readonly transport; | ||
| private readonly resolveInput; | ||
| private readonly defaultWorkspace?; | ||
| constructor(transport: Transport, resolveInput: PublishInputResolver<TInput>, defaultWorkspace?: string | undefined); | ||
| /** | ||
| * Publish content to a NEW permanent public URL; returns the created drop (with its `drop_…` id). | ||
| * Use to publish / share / post / put online / make public a report, dashboard, site, or file. | ||
| * Creates a NEW drop every call — to change something already published, use {@link updateContent} | ||
| * (the files at the URL) or {@link updateSettings} (title, visibility, password, expiry, | ||
| * metadata) with the drop's id; calling publish again makes a duplicate. POST /drops. | ||
| * | ||
| * Mount target: `options.domain` accepts a connected custom hostname, or `SHARED_POOL` | ||
| * (`"shared"`) to publish to the shared pool even when the account has a default domain. | ||
| * | ||
| * Two URLs come back on the response: `url` is the canonical, **always-branded** human | ||
| * view (badge guaranteed, no client detection); `rawUrl` is the drop's exact bytes at | ||
| * their natural path — hand it to other agents. `rawUrl` is populated only for single | ||
| * non-HTML files (`renderMode: "file_viewer"`) and is `null` for HTML drops and | ||
| * collections. To stream bytes through the SDK for any drop kind, use {@link getContent}. | ||
| */ | ||
| publish(input: TInput, options?: PublishOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Replace the content of an EXISTING drop, keeping its URL (ships a new deployment). Requires the | ||
| * `drop_…` id from a publish response (not the slug/URL). Content-only: settings/metadata are | ||
| * stripped BEFORE prepare, so they are never sent — change those with {@link updateSettings}; create | ||
| * a new drop with {@link publish}. Not idempotent (each call is a new deployment) unless you pass the | ||
| * same `idempotencyKey`. POST /drops/{id}/deployments. | ||
| */ | ||
| updateContent(dropId: string, input: TInput, options?: UpdateContentOptions): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * List the account's drops, newest first (paginated). Each item carries its `drop_…` id. | ||
| * Pass `domain` to only list drops mounted on that custom domain — the recovery path | ||
| * when you have a custom-domain URL but no drop id. GET /drops. | ||
| */ | ||
| list(params?: ListDropsParams): Promise<DropthisResult<CursorPage<DropResponse>>>; | ||
| /** Fetch one drop by its `drop_…` id (not the slug/URL). GET /drops/{id}. */ | ||
| get(dropId: string): Promise<DropthisResult<DropResponse>>; | ||
| /** | ||
| * Resolve a public locator (a drop URL, a custom-domain URL, or a bare vanity/shared | ||
| * slug) back to the drop — the way to recover a lost `drop_…` id. Sends the raw target | ||
| * to the server (POST /drops/resolve), which owner-scopes and decomposes it. Returns the | ||
| * full drop, or `data: null` when nothing of yours matches. A `drop_…` id passed as the | ||
| * target round-trips to an owner-scoped id lookup (null instead of 404). | ||
| * | ||
| * Persist the drop_… id. URLs, raw_url, and slugs are locators, not identifiers — a vanity | ||
| * slug is renameable and the pool host rotates, so a stored URL can drift; the id never | ||
| * moves. Treat drop_… as an opaque case-sensitive string. | ||
| */ | ||
| resolve(target: string): Promise<DropthisResult<DropResponse | null>>; | ||
| /** | ||
| * Read back what a drop is serving (owner-only; works regardless of any viewer | ||
| * password). By default returns the JSON manifest of the CURRENT deployment's files; | ||
| * pass `deploymentId` to read a historical (even superseded) deployment — downloading | ||
| * an old version's files and republishing them via {@link updateContent} is the | ||
| * rollback path. Pass `path` (one of the manifest's `files[].path` values) to download | ||
| * that file's exact stored bytes instead. GET /drops/{id}/content. | ||
| */ | ||
| getContent(dropId: string, options: GetContentOptions & { | ||
| path: string; | ||
| }): Promise<DropthisResult<DropContentFile>>; | ||
| getContent(dropId: string, options?: Omit<GetContentOptions, "path">): Promise<DropthisResult<DeploymentContentManifest>>; | ||
| /** | ||
| * Change an EXISTING drop's settings — title, visibility, password, noindex, expiry, | ||
| * metadata, domain, or slug — by its `drop_…` id. Does not touch content; replace that | ||
| * with {@link updateContent}. Idempotent. PATCH /drops/{id}. | ||
| * | ||
| * **`domain`** — move the drop to a different custom domain (must be live). Pass `null` to | ||
| * move the drop back to the shared pool (unmount from its current domain). | ||
| * | ||
| * **`slug`** — rename the vanity slug on a path-mode custom domain. Only valid when the drop | ||
| * lives on a path-mode domain. Unlike {@link publish} (which auto-suffixes taken slugs), | ||
| * `updateSettings` returns 409 on a slug conflict and never auto-suffixes — your code must | ||
| * catch 409 and retry with a different slug. Passing `slug` on the shared pool returns 422. | ||
| */ | ||
| updateSettings(dropId: string, options?: DropOptions & RequestControls): Promise<DropthisResult<DropResponse>>; | ||
| /** Permanently delete a drop and its public URL by its `drop_…` id. DELETE /drops/{id}. */ | ||
| delete(dropId: string): Promise<DropthisResult<null>>; | ||
| } | ||
| declare class WorkspacesResource { | ||
| private readonly transport; | ||
| constructor(transport: Transport); | ||
| list(): Promise<DropthisResult<{ | ||
| workspaces: Workspace[]; | ||
| }>>; | ||
| /** Create a team workspace (the caller becomes its sole owner). Needs `workspaces:write`. */ | ||
| create(input: { | ||
| name: string; | ||
| /** URL-safe slug; derived from the name when omitted. A clash on an explicit slug → 409. */ | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Rename a team workspace (owner/admin). Needs `workspaces:write`. */ | ||
| rename(workspaceId: string, input: { | ||
| name?: string; | ||
| slug?: string; | ||
| }): Promise<DropthisResult<Workspace>>; | ||
| /** Delete a team workspace (owner only). Needs `workspaces:admin`. 204 — data is null. */ | ||
| delete(workspaceId: string): Promise<DropthisResult<null>>; | ||
| use(workspace: string): Promise<DropthisResult<Workspace>>; | ||
| active(): Promise<DropthisResult<Workspace | null>>; | ||
| } | ||
| export { type SessionResponse as $, AccountResource as A, type InvitableRole as B, type CreateUploadSessionRequest as C, type DeploymentContentFile as D, type EmailOtpResponse as E, type Invitation as F, type GetContentOptions as G, type InvitationListResponse as H, type InMemoryPublishInput as I, type ListDeploymentsParams as J, type KeyType as K, type Limitations as L, type ListDeploymentsResponse as M, type ListPage as N, type Member as O, type MemberListResponse as P, type NextHint as Q, type PrepareOptions as R, type PreparedPublishRequest as S, type PreparedUploadFile as T, type PublishFileInput as U, type PublishInput as V, type PublishOptions as W, type RequestControls as X, type RequestOptions as Y, type RevokeImpact as Z, SHARED_POOL as _, type AccountResponse as a, type TierInfo as a0, Transport as a1, type UpdateContentOptions as a2, type UploadManifestFile as a3, type UploadSessionFileResponse as a4, type UploadSessionResponse as a5, type UploadTarget as a6, type Workspace as a7, type WorkspaceRole as a8, WorkspacesResource as a9, type AccountUsage as b, type AccountWorkspace as c, type ActionResolve as d, ApiKeysResource as e, type CreateUploadSessionResponse as f, CursorPage as g, type DeploymentContentManifest as h, DeploymentsResource as i, type DnsRecord as j, type DomainDeletedResponse as k, type DomainListResponse as l, type DomainResponse as m, DomainsResource as n, type DropAction as o, type DropContentFile as p, type DropDeploymentResponse as q, type DropOptions as r, type DropResponse as s, type DropWorkspace as t, DropsResource as u, type DropthisClientOptions as v, type DropthisErrorResponse as w, type DropthisResult as x, type EntitlementLimits as y, type Entitlements as z }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 3 instances
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 3 instances
1974707
1.66%27972
0.72%212
4.95%Updated